Changeset 114334 in webkit
- Timestamp:
- Apr 16, 2012 7:55:40 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/fast/dom/shadow/shadow-contents-fallback-dynamic.html
r108480 r114334 343 343 function testContentInContent(callIfDone) { 344 344 document.getElementById('expect-container').innerHTML = 345 "<div>{SHADOW: < span>S1</span><span>S2</span>}</div>";345 "<div>{SHADOW: <content><span>CONTENT 2 FALLBACK</span></content>}</div>"; 346 346 347 347 var target = document.createElement('div'); … … 374 374 function testContentInContentFallback(callIfDone) { 375 375 document.getElementById('expect-container').innerHTML = 376 "<div>{SHADOW: < span>CONTENT 2 FALLBACK</span>}</div>";376 "<div>{SHADOW: <content><span>CONTENT 2 FALLBACK</span></content>}</div>"; 377 377 378 378 var target = document.createElement('div'); … … 405 405 function testContentInContentFallbackDirect(callIfDone) { 406 406 document.getElementById('expect-container').innerHTML = 407 "<div>< span>CONTENT 2 FALLBACK</span></div>";407 "<div><content><span>CONTENT 2 FALLBACK</span></content></div>"; 408 408 409 409 var target = document.createElement('div'); -
trunk/LayoutTests/fast/dom/shadow/shadow-contents-fallback.html
r108480 r114334 268 268 document.getElementById('actual-container').appendChild(target); 269 269 document.getElementById('expect-container').innerHTML = 270 "<div>{SHADOW: < span>S1</span><span>S2</span>}</div>";270 "<div>{SHADOW: <content><span>CONTENT 2 FALLBACK</span></content>}</div>"; 271 271 } 272 272 … … 291 291 document.getElementById('actual-container').appendChild(target); 292 292 document.getElementById('expect-container').innerHTML = 293 "<div>{SHADOW: < span>CONTENT 2 FALLBACK</span>}</div>";293 "<div>{SHADOW: <content><span>CONTENT 2 FALLBACK</span></content>}</div>"; 294 294 } 295 295 … … 317 317 document.getElementById('actual-container').appendChild(target); 318 318 document.getElementById('expect-container').innerHTML = 319 "<div>{SHADOW: < span>CONTENT 2 FALLBACK</span>}</div>";319 "<div>{SHADOW: <content><span>CONTENT 2 FALLBACK</span></content>}</div>"; 320 320 } 321 321 … … 338 338 document.getElementById('actual-container').appendChild(target); 339 339 document.getElementById('expect-container').innerHTML = 340 "<div>< span>CONTENT 2 FALLBACK</span></div>";340 "<div><content><span>CONTENT 2 FALLBACK</span></content></div>"; 341 341 } 342 342 -
trunk/Source/WebCore/ChangeLog
r114333 r114334 1 2012-04-16 Takashi Sakamoto <tasak@google.com> 2 3 [Shadow DOM] InsertionPoint should have isActive() member function. 4 https://bugs.webkit.org/show_bug.cgi?id=82010 5 6 Reviewed by Hajime Morita. 7 8 This patch adds isActive public member function to InsertionPoint and 9 makes InsertionPoint elements consider whether active or not. 10 If an InsertionPoint is inactive, the element is not shadow boundary 11 and is needed to be rendered. 12 c.f. https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#dfn-active-insertion-point 13 14 Test: update existing tests, i.e. 15 LayoutTests/fast/dom/shadow/shadow-contents-fallback-dynamic.html and 16 LayoutTests/fast/dom/shadow/shadow-contents-fallback.html 17 18 * html/shadow/InsertionPoint.cpp: 19 (WebCore::InsertionPoint::isActive): 20 A new public method for checking whether an insertion point is active or inactive. 21 If active, returns true. Otherwise, false. 22 (WebCore::InsertionPoint::isShadowBoundary): 23 Make the method consider whether an insertin point is active or inactive. 24 (WebCore::InsertionPoint::rendererIsNeeded): 25 Changed to return true If an insertion point is inactive. 26 (WebCore::InsertionPoint::attach): 27 Changed to call only HTMLElement::attach If an insertion point is inactive. 28 (WebCore::InsertionPoint::detach): 29 Changed to call only HTMLElement::detach If an insertion point is inactive. 30 * html/shadow/InsertionPoint.h: 31 (InsertionPoint): 32 Added isActive public method. 33 * dom/NodeRenderingContext.cpp: 34 (WebCore::NodeRenderingContext::NodeRenderingContext): 35 Changed to take into account an insertion point's activeness when parent is an insertion point. 36 (WebCore::NodeRenderingContext::firstRendererOf): 37 (WebCore::NodeRenderingContext::lastRendererOf): 38 Changed to take into account an insertion point's activeness. 39 1 40 2012-04-16 MORITA Hajime <morrita@google.com> 2 41 -
trunk/Source/WebCore/dom/NodeRenderingContext.cpp
r114189 r114334 102 102 else 103 103 m_phase = AttachingFallbacked; 104 m_parentNodeForRenderingAndStyle = NodeRenderingContext(parent).parentNodeForRenderingAndStyle(); 104 105 if (toInsertionPoint(parent)->isActive()) 106 m_parentNodeForRenderingAndStyle = NodeRenderingContext(parent).parentNodeForRenderingAndStyle(); 107 else 108 m_parentNodeForRenderingAndStyle = parent; 105 109 return; 106 110 } … … 203 207 } 204 208 205 if (isInsertionPoint(node) ) {209 if (isInsertionPoint(node) && toInsertionPoint(node)->isActive()) { 206 210 if (RenderObject* first = firstRendererOfInsertionPoint(toInsertionPoint(node))) 207 211 return first; … … 221 225 return node->renderer(); 222 226 } 223 if (isInsertionPoint(node) ) {227 if (isInsertionPoint(node) && toInsertionPoint(node)->isActive()) { 224 228 if (RenderObject* last = lastRendererOfInsertionPoint(toInsertionPoint(node))) 225 229 return last; -
trunk/Source/WebCore/html/shadow/InsertionPoint.cpp
r112978 r114334 49 49 void InsertionPoint::attach() 50 50 { 51 TreeScope* scope = treeScope(); 52 if (scope->rootNode()->isShadowRoot()) { 53 ShadowRoot* root = toShadowRoot(scope->rootNode()); 51 if (isShadowBoundary()) { 52 ShadowRoot* root = toShadowRoot(treeScope()->rootNode()); 54 53 if (doesSelectFromHostChildren()) { 55 54 distributeHostChildren(root->tree()); … … 67 66 void InsertionPoint::detach() 68 67 { 69 if (ShadowRoot* root = toShadowRoot(shadowTreeRootNode())) { 68 ShadowRoot* root = toShadowRoot(shadowTreeRootNode()); 69 if (root && isActive()) { 70 70 ShadowTree* tree = root->tree(); 71 71 … … 98 98 bool InsertionPoint::isShadowBoundary() const 99 99 { 100 return treeScope()->rootNode()->isShadowRoot(); 100 return treeScope()->rootNode()->isShadowRoot() && isActive(); 101 } 102 103 bool InsertionPoint::isActive() const 104 { 105 const Node* node = parentNode(); 106 while (node) { 107 if (WebCore::isInsertionPoint(node)) 108 return false; 109 110 node = node->parentNode(); 111 } 112 return true; 101 113 } 102 114 -
trunk/Source/WebCore/html/shadow/InsertionPoint.h
r112055 r114334 46 46 bool hasSelection() const { return m_selections.first(); } 47 47 bool isShadowBoundary() const; 48 bool isActive() const; 48 49 49 50 virtual const AtomicString& select() const = 0;
Note: See TracChangeset
for help on using the changeset viewer.