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

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

Issue 1102003002: Missing m_registeredAsCandidate = false. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | 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 79a03030c3e3a6117df0c6c449e4dcfb44dc4e3b..c86d84dfa09faff040cd50b9aee94369986204af 100644
--- a/Source/core/dom/StyleElement.cpp
+++ b/Source/core/dom/StyleElement.cpp
@@ -56,6 +56,7 @@ StyleElement::StyleElement(Document* document, bool createdByParser)
StyleElement::~StyleElement()
{
+ ASSERT(!m_registeredAsCandidate);
tasak 2015/04/28 10:19:05 I heard that inserted elements might be destroyed
#if !ENABLE(OILPAN)
if (m_sheet)
clearSheet();
@@ -86,8 +87,10 @@ void StyleElement::insertedInto(Element* element, ContainerNode* insertionPoint)
void StyleElement::removedFrom(Element* element, ContainerNode* insertionPoint)
{
- if (!insertionPoint->inDocument())
+ if (!insertionPoint->inDocument()) {
+ ASSERT(!m_registeredAsCandidate);
return;
+ }
ShadowRoot* shadowRoot = element->containingShadowRoot();
if (!shadowRoot)
@@ -118,6 +121,7 @@ void StyleElement::clearDocumentData(Document& document, Element* element)
if (m_registeredAsCandidate) {
ASSERT(element->inDocument());
document.styleEngine().removeStyleSheetCandidateNode(element, element->treeScope());
+ m_registeredAsCandidate = false;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698