Changeset 119069 in webkit
- Timestamp:
- May 31, 2012 12:55:29 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r119065 r119069 1 2012-05-31 Hayato Ito <hayato@chromium.org> 2 3 ComposedShadowTreeWalker should support traversing nodes in an orphaned shadow subtree. 4 https://bugs.webkit.org/show_bug.cgi?id=87493 5 6 Reviewed by Dimitri Glazkov. 7 8 * fast/dom/shadow/composed-shadow-tree-walker.html: 9 1 10 2012-05-31 Shane Stephens <shanestephens@google.com> 2 11 -
trunk/LayoutTests/fast/dom/shadow/composed-shadow-tree-walker-expected.txt
r119022 r119069 175 175 DIV id=a 176 176 177 Test for an orphaned shadow subtree. 178 Composed Shadow Tree: 179 DIV id=a 180 DIV id=d 181 182 Traverse in forward. 183 DIV id=a 184 DIV id=d 185 Traverse in backward. 186 DIV id=d 187 DIV id=a 188 189 Test for traversal, starting with a node in an orphaned shadow subtree. 190 Composed Shadow Tree: 191 DIV id=b 192 DIV id=c 193 194 Traverse in forward. 195 DIV id=b 196 DIV id=c 197 Traverse in backward. 198 DIV id=c 199 DIV id=b 200 177 201 PASS successfullyParsed is true 178 202 -
trunk/LayoutTests/fast/dom/shadow/composed-shadow-tree-walker.html
r119022 r119069 7 7 <body> 8 8 <div id="console"></div> 9 <div id="sandbox"></div> 9 10 <script> 10 11 description("Tests for Composed Shadow DOM Tree Traversal APIs. Can only run within DRT"); … … 66 67 function showComposedShadowTree(node) 67 68 { 68 document.body.appendChild(node);69 document.body.offsetLeft;70 71 69 debug('Composed Shadow Tree:'); 72 70 debug(dumpComposedShadowTree(node)); … … 81 79 } 82 80 81 function testComposedShadowTree(node) 82 { 83 var sandbox = document.getElementById('sandbox'); 84 sandbox.innerHTML = ''; 85 sandbox.appendChild(node); 86 document.body.offsetLeft; 87 showComposedShadowTree(node); 88 } 89 83 90 debug('ShadowRoot should be used.'); 84 showComposedShadowTree(91 testComposedShadowTree( 85 92 createDOM('div', {'id': 'a'}, 86 93 createShadowRoot(createDOM('div', {'id': 'b'})), … … 88 95 89 96 debug('A content element should select light children'); 90 showComposedShadowTree(97 testComposedShadowTree( 91 98 createDOM('div', {'id': 'a'}, 92 99 createShadowRoot(createDOM('div', {'id': 'b'}), … … 96 103 97 104 debug('Test for content element selector.'); 98 showComposedShadowTree(105 testComposedShadowTree( 99 106 createDOM('div', {'id': 'a'}, 100 107 createShadowRoot(createDOM('div', {'id': 'b'}), … … 105 112 106 113 debug('Light children should be selected only at once.'); 107 showComposedShadowTree(114 testComposedShadowTree( 108 115 createDOM('div', {'id': 'a'}, 109 116 createShadowRoot(createDOM('div', {'id': 'b'}), … … 115 122 116 123 debug('A content element can have fallback elements.'); 117 showComposedShadowTree(124 testComposedShadowTree( 118 125 createDOM('div', {'id': 'a'}, 119 126 createShadowRoot(createDOM('div', {'id': 'b'}), … … 124 131 125 132 debug('Fallback elements should not be used if <content> element selects any elements.'); 126 showComposedShadowTree(133 testComposedShadowTree( 127 134 createDOM('div', {'id': 'a'}, 128 135 createShadowRoot(createDOM('div', {'id': 'b'}), … … 133 140 134 141 debug('Test for Nested ShadowRoots.'); 135 showComposedShadowTree(142 testComposedShadowTree( 136 143 createDOM('div', {'id': 'a'}, 137 144 createShadowRoot(createDOM('div', {'id': 'b'}, … … 147 154 148 155 debug('Test for Multiple ShadowRoots.'); 149 showComposedShadowTree(156 testComposedShadowTree( 150 157 createDOM('div', {'id': 'a'}, 151 158 createShadowRoot(createDOM('div', {'id': 'b'}), … … 158 165 159 166 debug('Test for inactive insertion points.'); 160 showComposedShadowTree(167 testComposedShadowTree( 161 168 createDOM('div', {'id': 'a'}, 162 169 createDOM('content', {'id': 'b'}, 163 170 createDOM('content', {'id': 'c'})))); 171 172 debug('Test for an orphaned shadow subtree.'); 173 testComposedShadowTree( 174 createDOM('div', {'id': 'a'}, 175 createShadowRoot( 176 createDOM('div', {'id': 'b'}, 177 createDOM('div', {'id': 'c'}))), 178 createShadowRoot( 179 createDOM('div', {'id': 'd'})))); 180 181 debug('Test for traversal, starting with a node in an orphaned shadow subtree.'); 182 showComposedShadowTree(getNodeInShadowTreeStack('a/b')); 164 183 165 184 </script> -
trunk/Source/WebCore/ChangeLog
r119068 r119069 1 2012-05-31 Hayato Ito <hayato@chromium.org> 2 3 ComposedShadowTreeWalker should support traversing nodes in an orphaned shadow subtree. 4 https://bugs.webkit.org/show_bug.cgi?id=87493 5 6 Reviewed by Dimitri Glazkov. 7 8 ComposedShadowTreeWalker assumed that a visited shadow root is 9 always assigned to a shadow insertion point since it only 10 traverses nodes which are rendered. But there is an exceptional 11 use case such as an event dispatching. Some events, such as a 12 'click' event, may happen in an orphaned shadow subtree. In such 13 cases, traversal might start with a node in an orphaned shadow 14 subtree. So ComposedShadowTreeWalker can not assume that visited 15 shadow root is always assigned to a shadow insertion point. 16 17 This patch only fixes ComposedShadowTreeWalker. 18 ComposedShadowTreeParentWalker will be fixed in another patch with 19 an event dispatching test. 20 21 Test: fast/dom/shadow/composed-shadow-tree-walker.html 22 23 * dom/ComposedShadowTreeWalker.cpp: 24 (WebCore::ComposedShadowTreeWalker::traverseParentBackToYoungerShadowRootOrHost): 25 26 1 27 2012-05-30 Yury Semikhatsky <yurys@chromium.org> 2 28 -
trunk/Source/WebCore/dom/ComposedShadowTreeWalker.cpp
r118890 r119069 230 230 } 231 231 InsertionPoint* assignedInsertionPoint = shadowRoot->assignedTo(); 232 ASSERT(assignedInsertionPoint); 233 return traverseParent(assignedInsertionPoint); 232 return assignedInsertionPoint ? traverseParent(assignedInsertionPoint) : 0; 234 233 } 235 234
Note: See TracChangeset
for help on using the changeset viewer.