Changeset 181283 in webkit
- Timestamp:
- Mar 9, 2015 2:10:37 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r181278 r181283 1 2015-03-09 Benjamin Poulain <benjamin@webkit.org> 2 3 CSS JIT: add aliases between :nth-child()/:nth-last-child() and :first-child/:last-child 4 https://bugs.webkit.org/show_bug.cgi?id=142472 5 6 Reviewed by Andreas Kling. 7 8 * fast/selectors/nth-child-matching-first-expected.txt: Added. 9 * fast/selectors/nth-child-matching-first-on-root-expected.txt: Added. 10 * fast/selectors/nth-child-matching-first-on-root.html: Added. 11 * fast/selectors/nth-child-matching-first.html: Added. 12 * fast/selectors/nth-last-child-matching-first-expected.txt: Added. 13 * fast/selectors/nth-last-child-matching-first-on-root-expected.txt: Added. 14 * fast/selectors/nth-last-child-matching-first-on-root.html: Added. 15 * fast/selectors/nth-last-child-matching-first.html: Added. 16 1 17 2015-03-09 Myles C. Maxfield <mmaxfield@apple.com> 2 18 -
trunk/Source/WebCore/ChangeLog
r181282 r181283 1 2015-03-09 Benjamin Poulain <benjamin@webkit.org> 2 3 CSS JIT: add aliases between :nth-child()/:nth-last-child() and :first-child/:last-child 4 https://bugs.webkit.org/show_bug.cgi?id=142472 5 6 Reviewed by Andreas Kling. 7 8 The pseudo class :first-child has weaker tree marking than :nth-child(1). 9 This patch aliases :nth-child(1) to :first-child in the CSS JIT to take 10 advantage of that. 11 12 The strength of :last-child and :nth-last-child(1) are pretty much identical 13 but :last-child is a bit simpler so I changed it too. It is also easier 14 to handle both the same. 15 16 Tests: fast/selectors/nth-child-matching-first-on-root.html 17 fast/selectors/nth-child-matching-first.html 18 fast/selectors/nth-last-child-matching-first-on-root.html 19 fast/selectors/nth-last-child-matching-first.html 20 21 * cssjit/SelectorCompiler.cpp: 22 (WebCore::SelectorCompiler::addNthChildType): 23 (WebCore::SelectorCompiler::addPseudoClassType): 24 1 25 2015-03-09 Benjamin Poulain <bpoulain@apple.com> 2 26 -
trunk/Source/WebCore/cssjit/SelectorCompiler.cpp
r181197 r181283 472 472 473 473 // Handle the forward :nth-child() and backward :nth-last-child(). 474 static FunctionType addNthChildType(const CSSSelector& selector, SelectorContext selectorContext, FragmentPositionInRootFragments positionInRootFragments, bool visitedMatchEnabled, Vector<std::pair<int, int>, 2>& simpleCases, Vector<NthChildOfSelectorInfo>& filteredCases, unsigned& internalSpecificity)474 static FunctionType addNthChildType(const CSSSelector& selector, SelectorContext selectorContext, FragmentPositionInRootFragments positionInRootFragments, CSSSelector::PseudoClassType firstMatchAlternative, bool visitedMatchEnabled, Vector<std::pair<int, int>, 2>& simpleCases, Vector<NthChildOfSelectorInfo>& filteredCases, HashSet<unsigned>& pseudoClasses, unsigned& internalSpecificity) 475 475 { 476 476 if (!selector.parseNth()) … … 541 541 return globalFunctionType; 542 542 } 543 simpleCases.append(std::pair<int, int>(a, b)); 543 544 if (b == 1 && a <= 0) 545 pseudoClasses.add(firstMatchAlternative); 546 else 547 simpleCases.append(std::pair<int, int>(a, b)); 544 548 if (selectorContext == SelectorContext::QuerySelector) 545 549 return FunctionType::SimpleSelectorChecker; … … 699 703 700 704 case CSSSelector::PseudoClassNthChild: 701 return addNthChildType(selector, selectorContext, positionInRootFragments, visitedMatchEnabled, fragment.nthChildFilters, fragment.nthChildOfFilters, internalSpecificity);705 return addNthChildType(selector, selectorContext, positionInRootFragments, CSSSelector::PseudoClassFirstChild, visitedMatchEnabled, fragment.nthChildFilters, fragment.nthChildOfFilters, fragment.pseudoClasses, internalSpecificity); 702 706 703 707 case CSSSelector::PseudoClassNthLastChild: 704 return addNthChildType(selector, selectorContext, positionInRootFragments, visitedMatchEnabled, fragment.nthLastChildFilters, fragment.nthLastChildOfFilters, internalSpecificity);708 return addNthChildType(selector, selectorContext, positionInRootFragments, CSSSelector::PseudoClassLastChild, visitedMatchEnabled, fragment.nthLastChildFilters, fragment.nthLastChildOfFilters, fragment.pseudoClasses, internalSpecificity); 705 709 706 710 case CSSSelector::PseudoClassNot:
Note: See TracChangeset
for help on using the changeset viewer.