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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp

Issue 1556963002: Avoid crash when updating stylesheets during a remove operation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/remove-stylesheet-from-shadow-form-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
index 92e8830a36bec9c65a8106c62c249708ae7c0247..f40d913e1939c8fb3b5848705971bac66f476173 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
@@ -205,6 +205,15 @@ void StyleResolver::appendCSSStyleSheet(CSSStyleSheet& cssSheet)
return;
TreeScope* treeScope = &cssSheet.ownerNode()->treeScope();
+ // TODO(rune@opera.com): This is a workaround for crbug.com/559292
+ // when we're in the middle of removing a subtree with a style element
+ // and the treescope has been changed but inDocument and isInShadowTree
+ // are not.
+ //
+ // This check can be removed when crbug.com/567021 is fixed.
+ if (cssSheet.ownerNode()->isInShadowTree() && treeScope->rootNode().isDocumentNode())
+ return;
+
// Sheets in the document scope of HTML imports apply to the main document
// (m_document), so we override it for all document scoped sheets.
if (treeScope->rootNode().isDocumentNode())
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/remove-stylesheet-from-shadow-form-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698