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

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

Issue 815653002: Remove global list map of TreeScope to StyleSheetCollection. (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/TreeScope.cpp ('k') | no next file » | 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 ShadowRoot::ShadowRoot(Document& document) 49 ShadowRoot::ShadowRoot(Document& document)
50 : DocumentFragment(0, CreateShadowRoot) 50 : DocumentFragment(0, CreateShadowRoot)
51 , TreeScope(*this, document) 51 , TreeScope(*this, document)
52 , m_descendantInsertionPointsIsValid(false) 52 , m_descendantInsertionPointsIsValid(false)
53 { 53 {
54 } 54 }
55 55
56 ShadowRoot::~ShadowRoot() 56 ShadowRoot::~ShadowRoot()
57 { 57 {
58 if (StyleEngine* styleEngine = document().styleEngine())
59 styleEngine->didRemoveShadowRoot(this);
60
61 // We cannot let ContainerNode destructor call willBeDeletedFromDocument() 58 // We cannot let ContainerNode destructor call willBeDeletedFromDocument()
62 // for this ShadowRoot instance because TreeScope destructor 59 // for this ShadowRoot instance because TreeScope destructor
63 // clears Node::m_treeScope thus ContainerNode is no longer able 60 // clears Node::m_treeScope thus ContainerNode is no longer able
64 // to access it Document reference after that. 61 // to access it Document reference after that.
65 willBeDeletedFromDocument(); 62 willBeDeletedFromDocument();
66 63
67 // We must remove all of our children first before the TreeScope destructor 64 // We must remove all of our children first before the TreeScope destructor
68 // runs so we don't go through TreeScopeAdopter for each child with a 65 // runs so we don't go through TreeScopeAdopter for each child with a
69 // destructed tree scope in each descendant. 66 // destructed tree scope in each descendant.
70 removeDetachedChildren(); 67 removeDetachedChildren();
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 Vector<RefPtr<InsertionPoint> > insertionPoints; 196 Vector<RefPtr<InsertionPoint> > insertionPoints;
200 for (InsertionPoint* insertionPoint = Traversal<InsertionPoint>::firstWithin (*this); insertionPoint; insertionPoint = Traversal<InsertionPoint>::next(*inser tionPoint, this)) 197 for (InsertionPoint* insertionPoint = Traversal<InsertionPoint>::firstWithin (*this); insertionPoint; insertionPoint = Traversal<InsertionPoint>::next(*inser tionPoint, this))
201 insertionPoints.append(insertionPoint); 198 insertionPoints.append(insertionPoint);
202 199
203 ensureShadowRootRareData()->setDescendantInsertionPoints(insertionPoints); 200 ensureShadowRootRareData()->setDescendantInsertionPoints(insertionPoints);
204 201
205 return m_shadowRootRareData->descendantInsertionPoints(); 202 return m_shadowRootRareData->descendantInsertionPoints();
206 } 203 }
207 204
208 } 205 }
OLDNEW
« no previous file with comments | « sky/engine/core/dom/TreeScope.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698