Changeset 89742 in webkit
- Timestamp:
- Jun 25, 2011 10:04:40 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r89741 r89742 1 2011-06-24 Dimitri Glazkov <dglazkov@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 REGRESSION (r77740): Shadow DOM pseudo elements aren't matching when combined with descendant selectors 6 https://bugs.webkit.org/show_bug.cgi?id=63373 7 8 * fast/css/unknown-pseudo-element-matching-expected.txt: Updated results. 9 * fast/css/unknown-pseudo-element-matching.html: Added more tests. 10 1 11 2011-06-25 Pavel Feldman <pfeldman@google.com> 2 12 -
trunk/LayoutTests/fast/css/unknown-pseudo-element-matching-expected.txt
r85077 r89742 50 50 input.bar::-webkit-slider-thumb:hover should match: PASS 51 51 input[type=range]::-webkit-slider-thumb:hover should match: PASS 52 53 Should match when combined with descendant selectors: 54 #baz input::-webkit-slider-thumb should match: PASS 55 #baz #foo::-webkit-slider-thumb should match: PASS 56 #baz input#foo::-webkit-slider-thumb should match: PASS 57 #baz input.bar::-webkit-slider-thumb should match: PASS 58 #baz input[type=range]::-webkit-slider-thumb should match: PASS 59 .qux input::-webkit-slider-thumb should match: PASS 60 .qux #foo::-webkit-slider-thumb should match: PASS 61 .qux input#foo::-webkit-slider-thumb should match: PASS 62 .qux input.bar::-webkit-slider-thumb should match: PASS 63 .qux input[type=range]::-webkit-slider-thumb should match: PASS -
trunk/LayoutTests/fast/css/unknown-pseudo-element-matching.html
r85077 r89742 26 26 ]; 27 27 var DISABLED_SELECTORS = SELECTORS.map(function(selector) { return selector + ':disabled'; }); 28 var HOVER_SELECTORS = SELECTORS.map(function(selector) { return selector + ':hover'; }) 28 var HOVER_SELECTORS = SELECTORS.map(function(selector) { return selector + ':hover'; }); 29 var DESCENDANT_ID_SELECTORS = SELECTORS.map(function(selector) { return '#baz ' + selector; }); 30 DESCENDANT_ID_SELECTORS.shift(); 31 var DESCENDANT_CLASS_SELECTORS = SELECTORS.map(function(selector) { return '.qux ' + selector; }); 32 DESCENDANT_CLASS_SELECTORS.shift(); 29 33 30 34 // convenience constants … … 101 105 log('<br>Should match :hover when the mouse is over the slider thumb:'); 102 106 HOVER_SELECTORS.forEach(expectMatch); 103 document.body.removeChild(input); 107 log('<br>Should match when combined with descendant selectors:'); 108 DESCENDANT_ID_SELECTORS.forEach(expectMatch); 109 DESCENDANT_CLASS_SELECTORS.forEach(expectMatch); 110 input.parentNode.removeChild(input); 104 111 } 105 112 … … 116 123 <body onload="runTest()"> 117 124 <p>Tests various selector combinations, containing unknown pseudo element selectors.</p> 118 <input id="foo" class="bar" type="range"> 125 <div id="baz" class="qux"> 126 <input id="foo" class="bar" type="range"> 127 </div> 119 128 <div id="log"></div> 120 129 </body> -
trunk/Source/WebCore/ChangeLog
r89733 r89742 1 2011-06-24 Dimitri Glazkov <dglazkov@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 REGRESSION (r77740): Shadow DOM pseudo elements aren't matching when combined with descendant selectors 6 https://bugs.webkit.org/show_bug.cgi?id=63373 7 8 * css/CSSStyleSelector.cpp: 9 (WebCore::CSSStyleSelector::pushParentStackFrame): Changed to use parentOrHostElement. 10 (WebCore::CSSStyleSelector::pushParent): Ditto. 11 * dom/Node.cpp: 12 (WebCore::Node::parentOrHostElement): Added. 13 * dom/Node.h: 14 1 15 2011-06-24 Dan Bernstein <mitz@apple.com> 2 16 -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r89705 r89742 625 625 { 626 626 ASSERT(m_ancestorIdentifierFilter); 627 ASSERT(m_parentStack.isEmpty() || m_parentStack.last().element == parent->parent Element());628 ASSERT(!m_parentStack.isEmpty() || !parent->parent Element());627 ASSERT(m_parentStack.isEmpty() || m_parentStack.last().element == parent->parentOrHostElement()); 628 ASSERT(!m_parentStack.isEmpty() || !parent->parentOrHostElement()); 629 629 m_parentStack.append(ParentStackFrame(parent)); 630 630 ParentStackFrame& parentFrame = m_parentStack.last(); … … 658 658 m_ancestorIdentifierFilter = adoptPtr(new BloomFilter<bloomFilterKeyBits>); 659 659 // If the element is not the root itself, build the stack starting from the root. 660 if (parent->parent Element()) {660 if (parent->parentOrHostNode()) { 661 661 Vector<Element*, 30> ancestors; 662 for (Element* ancestor = parent; ancestor; ancestor = ancestor->parent Element())662 for (Element* ancestor = parent; ancestor; ancestor = ancestor->parentOrHostElement()) 663 663 ancestors.append(ancestor); 664 664 int count = ancestors.size(); … … 667 667 return; 668 668 } 669 } else if (!parent->parent Element()) {669 } else if (!parent->parentOrHostElement()) { 670 670 // We are not always invoked consistently. For example, script execution can cause us to enter 671 671 // style recalc in the middle of tree building. Reset the stack if we see a new root element. … … 677 677 // We may get invoked for some random elements in some wacky cases during style resolve. 678 678 // Pause maintaining the stack in this case. 679 if (m_parentStack.last().element != parent->parent Element())679 if (m_parentStack.last().element != parent->parentOrHostElement()) 680 680 return; 681 681 } -
trunk/Source/WebCore/dom/Node.cpp
r89521 r89742 1577 1577 } 1578 1578 1579 Element* Node::parentOrHostElement() const 1580 { 1581 ContainerNode* parent = parentOrHostNode(); 1582 if (!parent) 1583 return 0; 1584 1585 if (parent->isShadowRoot()) 1586 parent = parent->shadowHost(); 1587 1588 if (!parent->isElementNode()) 1589 return 0; 1590 1591 return toElement(parent); 1592 } 1593 1594 1579 1595 bool Node::isBlockFlow() const 1580 1596 { -
trunk/Source/WebCore/dom/Node.h
r89069 r89742 222 222 // Node's parent, shadow tree host, or SVG use. 223 223 ContainerNode* parentOrHostNode() const; 224 Element* parentOrHostElement() const; 224 225 // Use when it's guaranteed to that shadowHost is 0 and svgShadowHost is 0. 225 226 ContainerNode* parentNodeGuaranteedHostFree() const;
Note: See TracChangeset
for help on using the changeset viewer.