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

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

Issue 221673003: Defer iframe JavaScript URL evaluation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Landing Created 6 years, 9 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/frames/javascript-url-style-crash-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/StyleElement.cpp
diff --git a/Source/core/dom/StyleElement.cpp b/Source/core/dom/StyleElement.cpp
index fb172edc7a268ccbd441570199b4ecced6d45722..cbe3765c7c735307a928c59e76aa5ba6a703413b 100644
--- a/Source/core/dom/StyleElement.cpp
+++ b/Source/core/dom/StyleElement.cpp
@@ -60,6 +60,7 @@ void StyleElement::processStyleSheet(Document& document, Element* element)
{
TRACE_EVENT0("webkit", "StyleElement::processStyleSheet");
ASSERT(element);
+ ASSERT(element->inDocument());
m_registeredAsCandidate = true;
document.styleEngine()->addStyleSheetCandidateNode(element, m_createdByParser);
@@ -78,20 +79,17 @@ void StyleElement::removedFromDocument(Document& document, Element* element, Con
{
ASSERT(element);
- if (!m_registeredAsCandidate) {
- ASSERT(!m_sheet);
- return;
+ if (m_registeredAsCandidate) {
+ document.styleEngine()->removeStyleSheetCandidateNode(element, scopingNode, treeScope);
+ m_registeredAsCandidate = false;
}
- document.styleEngine()->removeStyleSheetCandidateNode(element, scopingNode, treeScope);
- m_registeredAsCandidate = false;
-
RefPtrWillBeRawPtr<StyleSheet> removedSheet = m_sheet.get();
if (m_sheet)
clearSheet(element);
-
- document.removedStyleSheet(removedSheet.get(), RecalcStyleDeferred, AnalyzedStyleUpdate);
+ if (removedSheet)
+ document.removedStyleSheet(removedSheet.get(), RecalcStyleDeferred, AnalyzedStyleUpdate);
}
void StyleElement::clearDocumentData(Document& document, Element* element)
« no previous file with comments | « LayoutTests/fast/frames/javascript-url-style-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698