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

Side by Side Diff: sky/engine/core/html/HTMLStyleElement.cpp

Issue 797873002: Remove style element counting in ShadowRoot. (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.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2010 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2010 Apple Inc. All rights reserved.
6 * (C) 2007 Rob Buis (buis@kde.org) 6 * (C) 2007 Rob Buis (buis@kde.org)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 66 }
67 67
68 void HTMLStyleElement::insertedInto(ContainerNode* insertionPoint) 68 void HTMLStyleElement::insertedInto(ContainerNode* insertionPoint)
69 { 69 {
70 HTMLElement::insertedInto(insertionPoint); 70 HTMLElement::insertedInto(insertionPoint);
71 71
72 if (!inDocument()) 72 if (!inDocument())
73 return; 73 return;
74 74
75 processStyleSheet(); 75 processStyleSheet();
76
77 if (ShadowRoot* scope = containingShadowRoot())
78 scope->registerScopedHTMLStyleChild();
79 } 76 }
80 77
81 void HTMLStyleElement::removedFrom(ContainerNode* insertionPoint) 78 void HTMLStyleElement::removedFrom(ContainerNode* insertionPoint)
82 { 79 {
83 HTMLElement::removedFrom(insertionPoint); 80 HTMLElement::removedFrom(insertionPoint);
84 81
85 if (!insertionPoint->inDocument()) 82 if (!insertionPoint->inDocument())
86 return; 83 return;
87 84
88 ShadowRoot* scopingNode = containingShadowRoot(); 85 ShadowRoot* scopingNode = containingShadowRoot();
89 if (!scopingNode) 86 if (!scopingNode)
90 scopingNode = insertionPoint->containingShadowRoot(); 87 scopingNode = insertionPoint->containingShadowRoot();
91 88
92 if (scopingNode)
93 scopingNode->unregisterScopedHTMLStyleChild();
94
95 TreeScope* containingScope = containingShadowRoot(); 89 TreeScope* containingScope = containingShadowRoot();
96 TreeScope& scope = containingScope ? *containingScope : insertionPoint->tree Scope(); 90 TreeScope& scope = containingScope ? *containingScope : insertionPoint->tree Scope();
97 91
98 if (m_registeredAsCandidate) { 92 if (m_registeredAsCandidate) {
99 document().styleEngine()->removeStyleSheetCandidateNode(this, scopingNod e, scope); 93 document().styleEngine()->removeStyleSheetCandidateNode(this, scopingNod e, scope);
100 m_registeredAsCandidate = false; 94 m_registeredAsCandidate = false;
101 } 95 }
102 96
103 RefPtr<CSSStyleSheet> removedSheet = m_sheet.get(); 97 RefPtr<CSSStyleSheet> removedSheet = m_sheet.get();
104 98
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 TRACE_EVENT0("blink", "StyleElement::processStyleSheet"); 184 TRACE_EVENT0("blink", "StyleElement::processStyleSheet");
191 185
192 ASSERT(inDocument()); 186 ASSERT(inDocument());
193 187
194 m_registeredAsCandidate = true; 188 m_registeredAsCandidate = true;
195 document().styleEngine()->addStyleSheetCandidateNode(this, false); 189 document().styleEngine()->addStyleSheetCandidateNode(this, false);
196 process(); 190 process();
197 } 191 }
198 192
199 } 193 }
OLDNEW
« no previous file with comments | « sky/engine/core/dom/shadow/ShadowRoot.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698