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() {
DCHECK(m_contents->isMutable());
DCHECK_LE(m_contents->clientSize(), 1u);
didMutate(PartialRuleUpdate);
didMutate();
}
void CSSStyleSheet::didMutate(StyleSheetUpdateType updateType) {
void CSSStyleSheet::didMutate() {
Document* owner = ownerDocument();
if (!owner)
return;
if (ownerNode() && ownerNode()->isConnected())
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() {
......@@ -232,7 +222,7 @@ CSSRule* CSSStyleSheet::item(unsigned index) {
}
void CSSStyleSheet::clearOwnerNode() {
didMutate(EntireStyleSheetUpdate);
didMutate();
if (m_ownerNode)
m_contents->unregisterClient(this);
m_ownerNode = nullptr;
......
......@@ -42,8 +42,6 @@ class MediaQuerySet;
class SecurityOrigin;
class StyleSheetContents;
enum StyleSheetUpdateType { PartialRuleUpdate, EntireStyleSheetUpdate };
class CORE_EXPORT CSSStyleSheet final : public StyleSheet {
DEFINE_WRAPPERTYPEINFO();
WTF_MAKE_NONCOPYABLE(CSSStyleSheet);
......@@ -129,7 +127,7 @@ class CORE_EXPORT CSSStyleSheet final : public StyleSheet {
void willMutateRules();
void didMutateRules();
void didMutate(StyleSheetUpdateType = PartialRuleUpdate);
void didMutate();
StyleSheetContents* contents() const { return m_contents.get(); }
......
......@@ -3787,8 +3787,6 @@ void Document::notifyResizeForViewportUnits() {
}
void Document::styleResolverMayHaveChanged() {
styleEngine().resolverChanged(AnalyzedStyleUpdate);
if (hasNodesWithPlaceholderStyle()) {
setNeedsStyleRecalc(SubtreeStyleChange,
StyleChangeReasonForTracing::create(
......
......@@ -180,14 +180,6 @@ using MouseEventWithHitTestResults =
EventWithHitTestResults<PlatformMouseEvent>;
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 {
DoNotInvalidateOnAttributeChanges = 0,
InvalidateOnClassAttrChange,
......
......@@ -281,13 +281,6 @@ void ProcessingInstruction::removedFrom(ContainerNode* insertionPoint) {
// No need to remove pending sheets.
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() {
......
......@@ -82,14 +82,8 @@ void StyleElement::removedFrom(Element& element,
m_registeredAsCandidate = false;
}
if (m_sheet) {
if (m_sheet)
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) {
......
......@@ -140,7 +140,6 @@ void StyleEngine::injectAuthorSheet(StyleSheetContents* authorSheet) {
m_injectedAuthorStyleSheets.push_back(TraceWrapperMember<CSSStyleSheet>(
this, CSSStyleSheet::create(authorSheet, *m_document)));
markDocumentDirty();
resolverChanged(AnalyzedStyleUpdate);
}
CSSStyleSheet& StyleEngine::ensureInspectorStyleSheet() {
......@@ -232,11 +231,8 @@ void StyleEngine::removeStyleSheetCandidateNode(Node& node,
}
void StyleEngine::modifiedStyleSheetCandidateNode(Node& node) {
if (!node.isConnected())
return;
markTreeScopeDirty(node.treeScope());
resolverChanged(AnalyzedStyleUpdate);
if (node.isConnected())
markTreeScopeDirty(node.treeScope());
}
void StyleEngine::mediaQueriesChangedInScope(TreeScope& treeScope) {
......
......@@ -207,7 +207,6 @@ class CORE_EXPORT StyleEngine final
void updateGenericFontFamilySettings();
void didDetach();
void resolverChanged(StyleResolverUpdateMode) {}
CSSStyleSheet* createSheet(Element&,
const String& text,
......
......@@ -218,13 +218,8 @@ void HTMLLinkElement::removedFrom(ContainerNode* insertionPoint) {
}
document().styleEngine().removeStyleSheetCandidateNode(*this,
*insertionPoint);
if (m_link)
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() {
......
......@@ -58,9 +58,6 @@ void HTMLStyleElement::parseAttribute(const QualifiedName& name,
m_sheet) {
m_sheet->setMediaQueries(MediaQuerySet::create(value));
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 {
HTMLElement::parseAttribute(name, oldValue, value);
}
......
......@@ -389,9 +389,6 @@ void LinkStyle::process() {
// we no longer contain a stylesheet, e.g. perhaps rel or type was changed
clearSheet();
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() {
DCHECK(root());
DCHECK(root()->document());
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() {
......
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