Changeset 121481 in webkit
- Timestamp:
- Jun 28, 2012 4:05:59 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r121474 r121481 1 2012-06-28 Hayato Ito <hayato@chromium.org> 2 3 CompositeShadowTreeWalker should use InsertionPoint::hasDistribution() instead of InsertionPoint::isActive(). 4 https://bugs.webkit.org/show_bug.cgi?id=89177 5 6 Reviewed by Dimitri Glazkov. 7 8 * fast/dom/shadow/composed-shadow-tree-walker-expected.txt: 9 * fast/dom/shadow/composed-shadow-tree-walker.html: 10 1 11 2012-06-28 Gregg Tavares <gman@google.com> 2 12 -
trunk/LayoutTests/fast/dom/shadow/composed-shadow-tree-walker-expected.txt
r119069 r121481 88 88 DIV id=a 89 89 90 Fallback elements should not be used if element selects any elements. 91 Composed Shadow Tree: 92 DIV id=a 93 DIV id=b 94 DIV id=c 95 96 Traverse in forward. 97 DIV id=a 98 DIV id=b 99 DIV id=c 100 Traverse in backward. 101 DIV id=c 102 DIV id=b 103 DIV id=a 90 Fallback elements should not be used if a content element selects an element. 91 Composed Shadow Tree: 92 DIV id=a 93 DIV id=b 94 DIV id=c 95 96 Traverse in forward. 97 DIV id=a 98 DIV id=b 99 DIV id=c 100 Traverse in backward. 101 DIV id=c 102 DIV id=b 103 DIV id=a 104 105 Test for traversal, starting with a fallback element which is not used. 106 Composed Shadow Tree: 107 DIV id=f1 108 DIV id=f2 109 110 Traverse in forward. 111 DIV id=f1 112 DIV id=f2 113 Traverse in backward. 114 DIV id=f2 115 DIV id=f1 116 117 Next node of [DIV id=f1] is [DIV id=f2] 118 Next node of [DIV id=f2] is [(null)] 104 119 105 120 Test for Nested ShadowRoots. -
trunk/LayoutTests/fast/dom/shadow/composed-shadow-tree-walker.html
r120792 r121481 16 16 function dumpNode(node) 17 17 { 18 if (!node) 19 return '(null)' 18 20 var output = node.nodeName + "\t"; 19 21 if (node.id) … … 79 81 } 80 82 83 function showNextNode(node) { 84 var next = internals.nextNodeByWalker(node); 85 debug('Next node of [' + dumpNode(node) + '] is [' + dumpNode(next) + ']'); 86 } 87 81 88 function testComposedShadowTree(node) 82 89 { … … 130 137 createDOM('div', {'id': 'c'}))); 131 138 132 debug('Fallback elements should not be used if <content> element selects any elements.');139 debug('Fallback elements should not be used if a content element selects an element.'); 133 140 testComposedShadowTree( 134 141 createDOM('div', {'id': 'a'}, 135 142 createShadowRoot(createDOM('div', {'id': 'b'}), 136 143 createDOM('content', {'select': '#c'}, 137 createDOM('div', {'id': 'f1'} ),138 createDOM('div', {'id': 'f2'}))),144 createDOM('div', {'id': 'f1'}, 145 createDOM('div', {'id': 'f2'})))), 139 146 createDOM('div', {'id': 'c'}))); 147 148 debug('Test for traversal, starting with a fallback element which is not used.'); 149 showComposedShadowTree(getNodeInShadowTreeStack('a/f1')); 150 showNextNode(getNodeInShadowTreeStack('a/f1')); 151 showNextNode(getNodeInShadowTreeStack('a/f2')); 152 debug(''); 140 153 141 154 debug('Test for Nested ShadowRoots.'); -
trunk/Source/WebCore/ChangeLog
r121479 r121481 1 2012-06-28 Hayato Ito <hayato@chromium.org> 2 3 CompositeShadowTreeWalker should use InsertionPoint::hasDistribution() instead of InsertionPoint::isActive(). 4 https://bugs.webkit.org/show_bug.cgi?id=89177 5 6 Reviewed by Dimitri Glazkov. 7 8 Prevents ComposedShadowTreeWalker from escaping out of an 9 insertion point (which has distributed nodes) from a non-used 10 fallback element in the insertion point. Such a fallback element 11 should be treated as in an orphaned subtree. 12 13 ComposedShadowTreeParentWalker will be also fixed in a follow-up patch. 14 15 Test: fast/dom/shadow/composed-shadow-tree-walker.html 16 17 * dom/ComposedShadowTreeWalker.cpp: 18 (WebCore::ComposedShadowTreeWalker::traverseNodeEscapingFallbackContents): 19 1 20 2012-06-27 Ryosuke Niwa <rniwa@webkit.org> 2 21 -
trunk/Source/WebCore/dom/ComposedShadowTreeWalker.cpp
r119365 r121481 189 189 { 190 190 ASSERT(node); 191 if (isActiveInsertionPoint(node)) 192 return traverseParent(node); 193 return const_cast<Node*>(node); 191 if (!isInsertionPoint(node)) 192 return const_cast<Node*>(node); 193 const InsertionPoint* insertionPoint = toInsertionPoint(node); 194 return insertionPoint->hasDistribution() ? 0 : 195 insertionPoint->isActive() ? traverseParent(node) : const_cast<Node*>(node); 194 196 } 195 197
Note: See TracChangeset
for help on using the changeset viewer.