Commit 461fe030 authored by rune's avatar rune Committed by Commit bot

Removed resolverChanged().

This method was now empty and has been replaced by asynchronous active
stylesheet update in updateActiveStyleSheets().

R=meade@chromium.org
BUG=567021

Review-Url: https://codereview.chromium.org/2559613002
Cr-Commit-Position: refs/heads/master@{#439142}
parent 9380084b
...@@ -159,25 +159,15 @@ void CSSStyleSheet::didMutateRules() { ...@@ -159,25 +159,15 @@ void CSSStyleSheet::didMutateRules() {
DCHECK(m_contents->isMutable()); DCHECK(m_contents->isMutable());
DCHECK_LE(m_contents->clientSize(), 1u); DCHECK_LE(m_contents->clientSize(), 1u);
didMutate(PartialRuleUpdate); didMutate();
} }
void CSSStyleSheet::didMutate(StyleSheetUpdateType updateType) { void CSSStyleSheet::didMutate() {
Document* owner = ownerDocument(); Document* owner = ownerDocument();
if (!owner) if (!owner)
return; return;
if (ownerNode() && ownerNode()->isConnected()) if (ownerNode() && ownerNode()->isConnected())
owner->styleEngine().setNeedsActiveStyleUpdate(ownerNode()->treeScope()); owner->styleEngine().setNeedsActiveStyleUpdate(ownerNode()->treeScope());
// TODO(rune@opera.com): resolverChanged() can be removed once stylesheet
// updates are async. https://crbug.com/567021
// Need FullStyleUpdate when insertRule or deleteRule,
// because StyleSheetCollection::analyzeStyleSheetChange cannot detect partial
// rule update.
StyleResolverUpdateMode updateMode =
updateType != PartialRuleUpdate ? AnalyzedStyleUpdate : FullStyleUpdate;
owner->styleEngine().resolverChanged(updateMode);
} }
void CSSStyleSheet::reattachChildRuleCSSOMWrappers() { void CSSStyleSheet::reattachChildRuleCSSOMWrappers() {
...@@ -232,7 +222,7 @@ CSSRule* CSSStyleSheet::item(unsigned index) { ...@@ -232,7 +222,7 @@ CSSRule* CSSStyleSheet::item(unsigned index) {
} }
void CSSStyleSheet::clearOwnerNode() { void CSSStyleSheet::clearOwnerNode() {
didMutate(EntireStyleSheetUpdate); didMutate();
if (m_ownerNode) if (m_ownerNode)
m_contents->unregisterClient(this); m_contents->unregisterClient(this);
m_ownerNode = nullptr; m_ownerNode = nullptr;
......
...@@ -42,8 +42,6 @@ class MediaQuerySet; ...@@ -42,8 +42,6 @@ class MediaQuerySet;
class SecurityOrigin; class SecurityOrigin;
class StyleSheetContents; class StyleSheetContents;
enum StyleSheetUpdateType { PartialRuleUpdate, EntireStyleSheetUpdate };
class CORE_EXPORT CSSStyleSheet final : public StyleSheet { class CORE_EXPORT CSSStyleSheet final : public StyleSheet {
DEFINE_WRAPPERTYPEINFO(); DEFINE_WRAPPERTYPEINFO();
WTF_MAKE_NONCOPYABLE(CSSStyleSheet); WTF_MAKE_NONCOPYABLE(CSSStyleSheet);
...@@ -129,7 +127,7 @@ class CORE_EXPORT CSSStyleSheet final : public StyleSheet { ...@@ -129,7 +127,7 @@ class CORE_EXPORT CSSStyleSheet final : public StyleSheet {
void willMutateRules(); void willMutateRules();
void didMutateRules(); void didMutateRules();
void didMutate(StyleSheetUpdateType = PartialRuleUpdate); void didMutate();
StyleSheetContents* contents() const { return m_contents.get(); } StyleSheetContents* contents() const { return m_contents.get(); }
......
...@@ -3787,8 +3787,6 @@ void Document::notifyResizeForViewportUnits() { ...@@ -3787,8 +3787,6 @@ void Document::notifyResizeForViewportUnits() {
} }
void Document::styleResolverMayHaveChanged() { void Document::styleResolverMayHaveChanged() {
styleEngine().resolverChanged(AnalyzedStyleUpdate);
if (hasNodesWithPlaceholderStyle()) { if (hasNodesWithPlaceholderStyle()) {
setNeedsStyleRecalc(SubtreeStyleChange, setNeedsStyleRecalc(SubtreeStyleChange,
StyleChangeReasonForTracing::create( StyleChangeReasonForTracing::create(
......
...@@ -180,14 +180,6 @@ using MouseEventWithHitTestResults = ...@@ -180,14 +180,6 @@ using MouseEventWithHitTestResults =
EventWithHitTestResults<PlatformMouseEvent>; EventWithHitTestResults<PlatformMouseEvent>;
using ExceptionCode = int; using ExceptionCode = int;
enum StyleResolverUpdateMode {
// Discards the StyleResolver and rebuilds it.
FullStyleUpdate,
// Attempts to use StyleInvalidationAnalysis to avoid discarding the entire
// StyleResolver.
AnalyzedStyleUpdate
};
enum NodeListInvalidationType { enum NodeListInvalidationType {
DoNotInvalidateOnAttributeChanges = 0, DoNotInvalidateOnAttributeChanges = 0,
InvalidateOnClassAttrChange, InvalidateOnClassAttrChange,
......
...@@ -281,13 +281,6 @@ void ProcessingInstruction::removedFrom(ContainerNode* insertionPoint) { ...@@ -281,13 +281,6 @@ void ProcessingInstruction::removedFrom(ContainerNode* insertionPoint) {
// No need to remove pending sheets. // No need to remove pending sheets.
clearResource(); clearResource();
// TODO(rune@opera.com): resolverChanged() can be removed once stylesheet
// updates are async. https://crbug.com/567021
// If we're in document teardown, then we don't need to do any notification of
// our sheet's removal.
if (document().isActive())
document().styleEngine().resolverChanged(FullStyleUpdate);
} }
void ProcessingInstruction::clearSheet() { void ProcessingInstruction::clearSheet() {
......
...@@ -82,14 +82,8 @@ void StyleElement::removedFrom(Element& element, ...@@ -82,14 +82,8 @@ void StyleElement::removedFrom(Element& element,
m_registeredAsCandidate = false; m_registeredAsCandidate = false;
} }
if (m_sheet) { if (m_sheet)
clearSheet(element); clearSheet(element);
if (element.isConnected()) {
// TODO(rune@opera.com): resolverChanged() can be removed once stylesheet
// updates are async. https://crbug.com/567021
document.styleEngine().resolverChanged(AnalyzedStyleUpdate);
}
}
} }
StyleElement::ProcessingResult StyleElement::childrenChanged(Element& element) { StyleElement::ProcessingResult StyleElement::childrenChanged(Element& element) {
......
...@@ -140,7 +140,6 @@ void StyleEngine::injectAuthorSheet(StyleSheetContents* authorSheet) { ...@@ -140,7 +140,6 @@ void StyleEngine::injectAuthorSheet(StyleSheetContents* authorSheet) {
m_injectedAuthorStyleSheets.push_back(TraceWrapperMember<CSSStyleSheet>( m_injectedAuthorStyleSheets.push_back(TraceWrapperMember<CSSStyleSheet>(
this, CSSStyleSheet::create(authorSheet, *m_document))); this, CSSStyleSheet::create(authorSheet, *m_document)));
markDocumentDirty(); markDocumentDirty();
resolverChanged(AnalyzedStyleUpdate);
} }
CSSStyleSheet& StyleEngine::ensureInspectorStyleSheet() { CSSStyleSheet& StyleEngine::ensureInspectorStyleSheet() {
...@@ -232,11 +231,8 @@ void StyleEngine::removeStyleSheetCandidateNode(Node& node, ...@@ -232,11 +231,8 @@ void StyleEngine::removeStyleSheetCandidateNode(Node& node,
} }
void StyleEngine::modifiedStyleSheetCandidateNode(Node& node) { void StyleEngine::modifiedStyleSheetCandidateNode(Node& node) {
if (!node.isConnected()) if (node.isConnected())
return; markTreeScopeDirty(node.treeScope());
markTreeScopeDirty(node.treeScope());
resolverChanged(AnalyzedStyleUpdate);
} }
void StyleEngine::mediaQueriesChangedInScope(TreeScope& treeScope) { void StyleEngine::mediaQueriesChangedInScope(TreeScope& treeScope) {
......
...@@ -207,7 +207,6 @@ class CORE_EXPORT StyleEngine final ...@@ -207,7 +207,6 @@ class CORE_EXPORT StyleEngine final
void updateGenericFontFamilySettings(); void updateGenericFontFamilySettings();
void didDetach(); void didDetach();
void resolverChanged(StyleResolverUpdateMode) {}
CSSStyleSheet* createSheet(Element&, CSSStyleSheet* createSheet(Element&,
const String& text, const String& text,
......
...@@ -218,13 +218,8 @@ void HTMLLinkElement::removedFrom(ContainerNode* insertionPoint) { ...@@ -218,13 +218,8 @@ void HTMLLinkElement::removedFrom(ContainerNode* insertionPoint) {
} }
document().styleEngine().removeStyleSheetCandidateNode(*this, document().styleEngine().removeStyleSheetCandidateNode(*this,
*insertionPoint); *insertionPoint);
if (m_link) if (m_link)
m_link->ownerRemoved(); m_link->ownerRemoved();
// TODO(rune@opera.com): resolverChanged() can be removed once stylesheet
// updates are async. https://crbug.com/567021
document().styleEngine().resolverChanged(AnalyzedStyleUpdate);
} }
void HTMLLinkElement::finishParsingChildren() { void HTMLLinkElement::finishParsingChildren() {
......
...@@ -58,9 +58,6 @@ void HTMLStyleElement::parseAttribute(const QualifiedName& name, ...@@ -58,9 +58,6 @@ void HTMLStyleElement::parseAttribute(const QualifiedName& name,
m_sheet) { m_sheet) {
m_sheet->setMediaQueries(MediaQuerySet::create(value)); m_sheet->setMediaQueries(MediaQuerySet::create(value));
document().styleEngine().mediaQueriesChangedInScope(treeScope()); document().styleEngine().mediaQueriesChangedInScope(treeScope());
// TODO(rune@opera.com): resolverChanged() can be removed once stylesheet
// updates are async. https://crbug.com/567021
document().styleEngine().resolverChanged(FullStyleUpdate);
} else { } else {
HTMLElement::parseAttribute(name, oldValue, value); HTMLElement::parseAttribute(name, oldValue, value);
} }
......
...@@ -389,9 +389,6 @@ void LinkStyle::process() { ...@@ -389,9 +389,6 @@ void LinkStyle::process() {
// we no longer contain a stylesheet, e.g. perhaps rel or type was changed // we no longer contain a stylesheet, e.g. perhaps rel or type was changed
clearSheet(); clearSheet();
document().styleEngine().setNeedsActiveStyleUpdate(m_owner->treeScope()); document().styleEngine().setNeedsActiveStyleUpdate(m_owner->treeScope());
// TODO(rune@opera.com): resolverChanged() can be removed once stylesheet
// updates are async. https://crbug.com/567021
document().styleEngine().resolverChanged(FullStyleUpdate);
} }
} }
......
...@@ -60,9 +60,6 @@ void HTMLImportChild::ownerInserted() { ...@@ -60,9 +60,6 @@ void HTMLImportChild::ownerInserted() {
DCHECK(root()); DCHECK(root());
DCHECK(root()->document()); DCHECK(root()->document());
root()->document()->styleEngine().htmlImportAddedOrRemoved(); root()->document()->styleEngine().htmlImportAddedOrRemoved();
// TODO(rune@opera.com): resolverChanged() can be removed once stylesheet
// updates are async. https://crbug.com/567021
root()->document()->styleEngine().resolverChanged(AnalyzedStyleUpdate);
} }
void HTMLImportChild::didShareLoader() { void HTMLImportChild::didShareLoader() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment