Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(432)

Side by Side Diff: sky/engine/core/dom/shadow/ShadowRoot.cpp

Issue 758623002: Remove didNotifySubtreeInsertionsToDocument. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/core/dom/shadow/ShadowRoot.h ('k') | sky/engine/core/html/HTMLIFrameElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 if (child->shouldCallRecalcStyle(change)) 119 if (child->shouldCallRecalcStyle(change))
120 toElement(child)->recalcStyle(change, lastTextNode); 120 toElement(child)->recalcStyle(change, lastTextNode);
121 if (child->renderer()) 121 if (child->renderer())
122 lastTextNode = 0; 122 lastTextNode = 0;
123 } 123 }
124 } 124 }
125 125
126 clearChildNeedsStyleRecalc(); 126 clearChildNeedsStyleRecalc();
127 } 127 }
128 128
129 Node::InsertionNotificationRequest ShadowRoot::insertedInto(ContainerNode* inser tionPoint) 129 void ShadowRoot::insertedInto(ContainerNode* insertionPoint)
130 { 130 {
131 DocumentFragment::insertedInto(insertionPoint); 131 DocumentFragment::insertedInto(insertionPoint);
132 132
133 if (!insertionPoint->inDocument() || !isOldest()) 133 if (!insertionPoint->inDocument() || !isOldest())
134 return InsertionDone; 134 return;
135 135
136 // FIXME: When parsing <video controls>, insertedInto() is called many times without invoking removedFrom. 136 // FIXME: When parsing <video controls>, insertedInto() is called many times without invoking removedFrom.
137 // For now, we check m_registeredWithParentShadowroot. We would like to ASSE RT(!m_registeredShadowRoot) here. 137 // For now, we check m_registeredWithParentShadowroot. We would like to ASSE RT(!m_registeredShadowRoot) here.
138 // https://bugs.webkit.org/show_bug.cig?id=101316 138 // https://bugs.webkit.org/show_bug.cig?id=101316
139 if (m_registeredWithParentShadowRoot) 139 if (m_registeredWithParentShadowRoot)
140 return InsertionDone; 140 return;
141 141
142 if (ShadowRoot* root = host()->containingShadowRoot()) { 142 if (ShadowRoot* root = host()->containingShadowRoot()) {
143 root->addChildShadowRoot(); 143 root->addChildShadowRoot();
144 m_registeredWithParentShadowRoot = true; 144 m_registeredWithParentShadowRoot = true;
145 } 145 }
146
147 return InsertionDone;
148 } 146 }
149 147
150 void ShadowRoot::removedFrom(ContainerNode* insertionPoint) 148 void ShadowRoot::removedFrom(ContainerNode* insertionPoint)
151 { 149 {
152 if (insertionPoint->inDocument() && m_registeredWithParentShadowRoot) { 150 if (insertionPoint->inDocument() && m_registeredWithParentShadowRoot) {
153 ShadowRoot* root = host()->containingShadowRoot(); 151 ShadowRoot* root = host()->containingShadowRoot();
154 if (!root) 152 if (!root)
155 root = insertionPoint->containingShadowRoot(); 153 root = insertionPoint->containingShadowRoot();
156 if (root) 154 if (root)
157 root->removeChildShadowRoot(); 155 root->removeChildShadowRoot();
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 247
250 StyleSheetList* ShadowRoot::styleSheets() 248 StyleSheetList* ShadowRoot::styleSheets()
251 { 249 {
252 if (!ensureShadowRootRareData()->styleSheets()) 250 if (!ensureShadowRootRareData()->styleSheets())
253 m_shadowRootRareData->setStyleSheets(StyleSheetList::create(this)); 251 m_shadowRootRareData->setStyleSheets(StyleSheetList::create(this));
254 252
255 return m_shadowRootRareData->styleSheets(); 253 return m_shadowRootRareData->styleSheets();
256 } 254 }
257 255
258 } 256 }
OLDNEW
« no previous file with comments | « sky/engine/core/dom/shadow/ShadowRoot.h ('k') | sky/engine/core/html/HTMLIFrameElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698