diff options
5 files changed, 3 insertions, 16 deletions
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp index 7106bd0..fa42789 100644 --- a/third_party/WebKit/Source/core/dom/Document.cpp +++ b/third_party/WebKit/Source/core/dom/Document.cpp @@ -5684,11 +5684,6 @@ void Document::removedStyleSheet(StyleSheet* sheet, StyleResolverUpdateMode upda styleEngine().resolverChanged(updateMode); } -void Document::addedStyleSheet(StyleSheet*) -{ - styleEngine().resolverChanged(FullStyleUpdate); -} - void Document::modifiedStyleSheet(StyleSheet* sheet, StyleResolverUpdateMode updateMode) { // If we're in document teardown, then we don't need this notification of our sheet's removal. diff --git a/third_party/WebKit/Source/core/dom/Document.h b/third_party/WebKit/Source/core/dom/Document.h index 9ae8ef1f..65ba18d 100644 --- a/third_party/WebKit/Source/core/dom/Document.h +++ b/third_party/WebKit/Source/core/dom/Document.h @@ -388,7 +388,6 @@ public: // FIXME: Switch all callers of resolverChanged to these or better ones and then make them // do something smarter. void removedStyleSheet(StyleSheet*, StyleResolverUpdateMode = FullStyleUpdate); - void addedStyleSheet(StyleSheet*); void modifiedStyleSheet(StyleSheet*, StyleResolverUpdateMode = FullStyleUpdate); void changedSelectorWatch(); diff --git a/third_party/WebKit/Source/core/dom/StyleEngine.cpp b/third_party/WebKit/Source/core/dom/StyleEngine.cpp index a40a516..6cf9cd2 100644 --- a/third_party/WebKit/Source/core/dom/StyleEngine.cpp +++ b/third_party/WebKit/Source/core/dom/StyleEngine.cpp @@ -157,7 +157,7 @@ void StyleEngine::injectAuthorSheet(PassRefPtrWillBeRawPtr<StyleSheetContents> a { m_injectedAuthorStyleSheets.append(CSSStyleSheet::create(authorSheet, m_document)); markDocumentDirty(); - document().addedStyleSheet(m_injectedAuthorStyleSheets.last().get()); + resolverChanged(FullStyleUpdate); } void StyleEngine::addPendingSheet() @@ -180,8 +180,6 @@ void StyleEngine::removePendingSheet(Node* styleSheetCandidateNode) if (m_pendingStylesheets) return; - // FIXME: We can't call addedStyleSheet or removedStyleSheet here because we don't know - // what's new. We should track that to tell the style system what changed. document().didRemoveAllPendingStylesheet(); } @@ -245,6 +243,7 @@ void StyleEngine::modifiedStyleSheetCandidateNode(Node* node) TreeScope& treeScope = isStyleElement(*node) ? node->treeScope() : *m_document; ASSERT(isStyleElement(*node) || treeScope == m_document); markTreeScopeDirty(treeScope); + resolverChanged(FullStyleUpdate); } bool StyleEngine::shouldUpdateDocumentStyleSheetCollection(StyleResolverUpdateMode updateMode) const diff --git a/third_party/WebKit/Source/core/dom/StyleEngine.h b/third_party/WebKit/Source/core/dom/StyleEngine.h index ee066c4..367649c 100644 --- a/third_party/WebKit/Source/core/dom/StyleEngine.h +++ b/third_party/WebKit/Source/core/dom/StyleEngine.h @@ -163,8 +163,6 @@ public: bool shouldClearResolver() const; void resolverChanged(StyleResolverUpdateMode); - void markDocumentDirty(); - PassRefPtrWillBeRawPtr<CSSStyleSheet> createSheet(Element*, const String& text, TextPosition startPosition); void removeSheet(StyleSheetContents*); @@ -198,6 +196,7 @@ private: bool shouldUpdateDocumentStyleSheetCollection(StyleResolverUpdateMode) const; bool shouldUpdateShadowTreeStyleSheetCollection(StyleResolverUpdateMode) const; + void markDocumentDirty(); void markTreeScopeDirty(TreeScope&); bool isMaster() const { return m_isMaster; } diff --git a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp index 5f7c5da..4ca2d1f 100644 --- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp @@ -643,10 +643,6 @@ void LinkStyle::removePendingSheet() if (type == NonBlocking) { // Tell StyleEngine to re-compute styleSheets of this m_owner's treescope. m_owner->document().styleEngine().modifiedStyleSheetCandidateNode(m_owner); - // Document::removePendingSheet() triggers the style selector recalc for blocking sheets. - // FIXME: We don't have enough knowledge at this point to know if we're adding or removing a sheet - // so we can't call addedStyleSheet() or removedStyleSheet(). - m_owner->document().styleEngine().resolverChanged(FullStyleUpdate); return; } @@ -689,7 +685,6 @@ void LinkStyle::setDisabledState(bool disabled) if (m_owner->shouldProcessStyle()) process(); } else { - // FIXME: We don't have enough knowledge here to know if we should call addedStyleSheet() or removedStyleSheet(). m_owner->document().styleEngine().resolverChanged(FullStyleUpdate); } } |
