Commit ebaaf24f authored by esprehn@chromium.org's avatar esprehn@chromium.org

No need to clear the style resolver in Document::childrenChanged

If you delete the documentElement then that also means all <style> and
<link> elements must have been removed from the document so the
StyleResolver should already be reset or cleared and we don't need to
call clearStyleResolver() from inside Document::childrenChanged.

Review URL: https://codereview.chromium.org/209383015

git-svn-id: svn://svn.chromium.org/blink/trunk@169911 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent c72523b3
...@@ -705,13 +705,7 @@ Location* Document::location() const ...@@ -705,13 +705,7 @@ Location* Document::location() const
void Document::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta) void Document::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
{ {
ContainerNode::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); ContainerNode::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
m_documentElement = ElementTraversal::firstWithin(*this);
Element* newDocumentElement = ElementTraversal::firstWithin(*this);
if (newDocumentElement == m_documentElement)
return;
m_documentElement = newDocumentElement;
// The root style used for media query matching depends on the document element.
clearStyleResolver();
} }
PassRefPtr<Element> Document::createElement(const AtomicString& name, ExceptionState& exceptionState) PassRefPtr<Element> Document::createElement(const AtomicString& name, ExceptionState& exceptionState)
......
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