mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Replace sheet change methods with styleResolverChanged.
Unlike blink in sky we just want to mark tree scopes dirty. We can remove these methods, the dirty tree scope tracking we'll add in the future will take care of this. R=ojan@chromium.org Review URL: https://codereview.chromium.org/836893003
This commit is contained in:
parent
7fd0df2238
commit
689b91c36d
@ -78,7 +78,7 @@ void CSSStyleSheet::setMediaQueries(PassRefPtr<MediaQuerySet> mediaQueries)
|
||||
void CSSStyleSheet::clearOwnerNode()
|
||||
{
|
||||
if (Document* owner = ownerDocument())
|
||||
owner->modifiedStyleSheet(this);
|
||||
owner->styleResolverChanged();
|
||||
m_ownerNode = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -2620,22 +2620,6 @@ DocumentLifecycleNotifier& Document::lifecycleNotifier()
|
||||
return static_cast<DocumentLifecycleNotifier&>(LifecycleContext<Document>::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())
|
||||
|
||||
@ -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<String>&);
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user