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

Side by Side Diff: Source/core/html/HTMLStyleElement.cpp

Issue 27537009: Avoid always style recalc when removing stylesheets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 months 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 | Annotate | Revision Log
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 document().styleEngine()->removeStyleSheetCandidateNode(this, parentNode()); 118 document().styleEngine()->removeStyleSheetCandidateNode(this, parentNode());
119 unregisterWithScopingNode(parentNode()); 119 unregisterWithScopingNode(parentNode());
120 120
121 // As any <style> in a shadow tree is treated as "scoped", 121 // As any <style> in a shadow tree is treated as "scoped",
122 // need to add the <style> to its shadow root. 122 // need to add the <style> to its shadow root.
123 if (isInShadowTree()) 123 if (isInShadowTree())
124 registerWithScopingNode(false); 124 registerWithScopingNode(false);
125 125
126 document().styleEngine()->addStyleSheetCandidateNode(this, false); 126 document().styleEngine()->addStyleSheetCandidateNode(this, false);
127 // FIXME: currently need to use FullStyleUpdate here.
128 // Because ShadowTreeStyleSheetCollection doesn't know old scoping node.
129 // So setNeedsStyleRecalc for old scoping node is not invoked.
127 document().modifiedStyleSheet(sheet()); 130 document().modifiedStyleSheet(sheet());
128 } 131 }
129 132
130 void HTMLStyleElement::finishParsingChildren() 133 void HTMLStyleElement::finishParsingChildren()
131 { 134 {
132 StyleElement::finishParsingChildren(this); 135 StyleElement::finishParsingChildren(this);
133 HTMLElement::finishParsingChildren(); 136 HTMLElement::finishParsingChildren();
134 } 137 }
135 138
136 void HTMLStyleElement::registerWithScopingNode(bool scoped) 139 void HTMLStyleElement::registerWithScopingNode(bool scoped)
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 return m_sheet->disabled(); 287 return m_sheet->disabled();
285 } 288 }
286 289
287 void HTMLStyleElement::setDisabled(bool setDisabled) 290 void HTMLStyleElement::setDisabled(bool setDisabled)
288 { 291 {
289 if (CSSStyleSheet* styleSheet = sheet()) 292 if (CSSStyleSheet* styleSheet = sheet())
290 styleSheet->setDisabled(setDisabled); 293 styleSheet->setDisabled(setDisabled);
291 } 294 }
292 295
293 } 296 }
OLDNEW
« Source/core/css/resolver/StyleResolver.cpp ('K') | « Source/core/dom/StyleSheetScopingNodeList.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698