diff --git a/engine/core/css/CSSStyleSheet.cpp b/engine/core/css/CSSStyleSheet.cpp index 536b622d902..94fb4c51b2f 100644 --- a/engine/core/css/CSSStyleSheet.cpp +++ b/engine/core/css/CSSStyleSheet.cpp @@ -78,7 +78,7 @@ void CSSStyleSheet::setMediaQueries(PassRefPtr mediaQueries) void CSSStyleSheet::clearOwnerNode() { if (Document* owner = ownerDocument()) - owner->modifiedStyleSheet(this); + owner->styleResolverChanged(); m_ownerNode = nullptr; } diff --git a/engine/core/dom/Document.cpp b/engine/core/dom/Document.cpp index 7d9068547ac..a3965deea32 100644 --- a/engine/core/dom/Document.cpp +++ b/engine/core/dom/Document.cpp @@ -2620,22 +2620,6 @@ DocumentLifecycleNotifier& Document::lifecycleNotifier() return static_cast(LifecycleContext::lifecycleNotifier()); } -void Document::removedStyleSheet(CSSStyleSheet* sheet) -{ - // If we're in document teardown, then we don't need this notification of our sheet's removal. - // styleResolverChanged() is needed even when the document is inactive so that - // imported docuements (which is inactive) notifies the change to the master document. - styleResolverChanged(); -} - -void Document::modifiedStyleSheet(CSSStyleSheet* sheet) -{ - // If we're in document teardown, then we don't need this notification of our sheet's removal. - // styleResolverChanged() is needed even when the document is inactive so that - // imported docuements (which is inactive) notifies the change to the master document. - styleResolverChanged(); -} - Element* Document::activeElement() const { if (Element* element = treeScope().adjustedFocusedElement()) diff --git a/engine/core/dom/Document.h b/engine/core/dom/Document.h index cb45790ccfc..741588fb759 100644 --- a/engine/core/dom/Document.h +++ b/engine/core/dom/Document.h @@ -237,12 +237,6 @@ public: // Called when one or more stylesheets in the document may have been added, removed, or changed. void styleResolverChanged(); - // FIXME: Switch all callers of styleResolverChanged to these or better ones and then make them - // do something smarter. - void removedStyleSheet(CSSStyleSheet*); - void addedStyleSheet(CSSStyleSheet*) { styleResolverChanged(); } - void modifiedStyleSheet(CSSStyleSheet*); - void evaluateMediaQueryList(); void setStateForNewFormElements(const Vector&); diff --git a/engine/core/html/HTMLStyleElement.cpp b/engine/core/html/HTMLStyleElement.cpp index 13501168ff7..aade005816b 100644 --- a/engine/core/html/HTMLStyleElement.cpp +++ b/engine/core/html/HTMLStyleElement.cpp @@ -59,7 +59,7 @@ void HTMLStyleElement::parseAttribute(const QualifiedName& name, const AtomicStr { if (name == HTMLNames::mediaAttr && inDocument() && document().isActive() && m_sheet) { m_sheet->setMediaQueries(MediaQuerySet::create(value)); - document().modifiedStyleSheet(m_sheet.get()); + document().styleResolverChanged(); } else { HTMLElement::parseAttribute(name, value); } @@ -91,7 +91,7 @@ void HTMLStyleElement::removedFrom(ContainerNode* insertionPoint) if (m_sheet) clearSheet(); if (removedSheet) - document().removedStyleSheet(removedSheet.get()); + document().styleResolverChanged(); } void HTMLStyleElement::childrenChanged(const ChildrenChange& change)