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

Unified Diff: Source/core/dom/TreeScopeStyleSheetCollection.cpp

Issue 839303003: Adding stylesheet candidates should not crash when the parser reorders the tree (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add a test Created 5 years, 11 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 | « LayoutTests/fast/dom/css-stylesheet-candidate-ordering-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/TreeScopeStyleSheetCollection.cpp
diff --git a/Source/core/dom/TreeScopeStyleSheetCollection.cpp b/Source/core/dom/TreeScopeStyleSheetCollection.cpp
index 0c4c24e27cef0f86a4e87a7610a914a73e5ed232..231dd0a03f1b67b0ef8a3a0d5b43abdaf5a96ed7 100644
--- a/Source/core/dom/TreeScopeStyleSheetCollection.cpp
+++ b/Source/core/dom/TreeScopeStyleSheetCollection.cpp
@@ -55,7 +55,7 @@ void TreeScopeStyleSheetCollection::addStyleSheetCandidateNode(Node* node, bool
// since styles outside of the body and head continue to be shunted into the head
// (and thus can shift to end up before dynamically added DOM content that is also
// outside the body).
- if (createdByParser && document().body())
+ if (createdByParser && document().body() && !node->nextSibling())
esprehn 2015/01/10 01:50:44 I suspect this is wrong if there's mutation events
m_styleSheetCandidateNodes.parserAdd(node);
else
m_styleSheetCandidateNodes.add(node);
« no previous file with comments | « LayoutTests/fast/dom/css-stylesheet-candidate-ordering-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698