Optimized querySelector(All) when selector contains #id
https://bugs.webkit.org/show_bug.cgi?id=116502

Reviewed by Andreas Kling.

Source/WebCore: 

Test: fast/selectors/querySelector-id-filtering.html

The idea of this patch is to perform querySelector on a subtree
rooted at the last element with #id matching. For example, if we have the selector
"#foobar div a", we start by looking for the element with ID foobar in the TreeScope
cache, and start matching the children from there.

The idea comes from Rune for
https://chromium.googlesource.com/chromium/blink/+/1cd83d3588973a02ab15d94b1b05a28620853624
but the code as diverged too much so it had to be reimplemented specifically for WebKit.

* css/CSSSelectorList.cpp:
(WebCore::CSSSelectorList::CSSSelectorList):
(WebCore::CSSSelectorList::operator=):
* css/CSSSelectorList.h:
(WebCore::CSSSelectorList::~CSSSelectorList):
* css/StyleRule.h:
(WebCore::StyleRule::wrapperAdoptSelectorList):
(WebCore::StyleRulePage::wrapperAdoptSelectorList):
* dom/SelectorQuery.cpp:
(WebCore::isSingleTagNameSelector):
(WebCore::isSingleClassNameSelector):
(WebCore::findIdMatchingType):
(WebCore::SelectorDataList::SelectorDataList):
(WebCore::filterRootById):
(WebCore::SelectorDataList::executeCompiledSimpleSelectorChecker):
(WebCore::SelectorDataList::execute):
(WebCore::SelectorQuery::SelectorQuery):
(WebCore::SelectorQueryCache::add):
* dom/SelectorQuery.h:
(WebCore::SelectorDataList::SelectorData::SelectorData):

LayoutTests: 

* fast/selectors/querySelector-id-filtering-expected.txt: Added.
* fast/selectors/querySelector-id-filtering.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164924 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Avoid going through ExecState for VM when we already have it (in some places.)
<https://webkit.org/b/129554>

Tweak some places that jump through unnecessary hoops to get the VM.
There are many more like this.

Reviewed by Sam Weinig.

* runtime/JSObject.cpp:
(JSC::JSObject::putByIndexBeyondVectorLength):
(JSC::JSObject::putDirectIndexBeyondVectorLength):
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncToString):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164925 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Set css3/filter/huge-region as skipped
https://bugs.webkit.org/show_bug.cgi?id=129552

It tries to use an insanely huge kernel for a huge blur filtered
element while it is expected to *not* execute. Thanks to the changes
introduced in #123716, this test will try to be executed and may
timeout in some machines. The proper fix will follow up in #129553.

Reviewed by Dirk Schulze.

* TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164926 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSCell::fastGetOwnProperty() should get the Structure more efficiently.
<https://webkit.org/b/129560>

Now that structure() is nontrivial and we have a faster structure(VM&),
make use of that in fastGetOwnProperty() since we already have VM.

Reviewed by Sam Weinig.

* runtime/JSCellInlines.h:
(JSC::JSCell::fastGetOwnProperty):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164927 268f45cc-cd09-0410-ab3c-d52691b4dbfc