Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Unified Diff: sky/engine/core/dom/Document.cpp

Issue 928393003: Remove the concept of document.documentElement (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/dom/Document.h ('k') | sky/engine/core/dom/Document.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/Document.cpp
diff --git a/sky/engine/core/dom/Document.cpp b/sky/engine/core/dom/Document.cpp
index 06b06c062a8dcadb35af8b2627e7172895d4da6e..d742219eb116bcfb91299ea63452133ffebde5f1 100644
--- a/sky/engine/core/dom/Document.cpp
+++ b/sky/engine/core/dom/Document.cpp
@@ -250,7 +250,6 @@ Document::Document(const DocumentInit& initializer)
, m_loadEventDelayTimer(this, &Document::loadEventDelayTimerFired)
, m_didSetReferrerPolicy(false)
, m_referrerPolicy(ReferrerPolicyDefault)
- , m_directionSetOnDocumentElement(false)
, m_registrationContext(initializer.registrationContext())
, m_elementDataCacheClearTimer(this, &Document::elementDataCacheClearTimerFired)
, m_timeline(AnimationTimeline::create(this))
@@ -354,7 +353,6 @@ void Document::dispose()
m_hoverNode = nullptr;
m_activeHoverElement = nullptr;
m_titleElement = nullptr;
- m_documentElement = nullptr;
m_userActionElements.documentDidRemoveLastRef();
detachParser();
@@ -410,12 +408,6 @@ Location* Document::location() const
return &domWindow()->location();
}
-void Document::childrenChanged(const ChildrenChange& change)
-{
- ContainerNode::childrenChanged(change);
- m_documentElement = ElementTraversal::firstWithin(*this);
-}
-
PassRefPtr<Element> Document::createElement(const AtomicString& name, ExceptionState& exceptionState)
{
if (!isValidName(name)) {
@@ -1043,9 +1035,9 @@ void Document::updateStyle(StyleRecalcChange change)
if (StyleResolverStats* stats = styleResolver().stats())
stats->reset();
- if (Element* documentElement = this->documentElement()) {
- if (documentElement->shouldCallRecalcStyle(change))
- documentElement->recalcStyle(change);
+ for (Element* element = ElementTraversal::firstChild(*this); element; element = ElementTraversal::nextSibling(*element)) {
+ if (element->shouldCallRecalcStyle(change))
+ element->recalcStyle(change);
}
styleResolver().printStats();
@@ -2168,16 +2160,6 @@ IntSize Document::initialViewportSize() const
return view()->unscaledVisibleContentSize();
}
-Node* eventTargetNodeForDocument(Document* doc)
-{
- if (!doc)
- return 0;
- Node* node = doc->focusedElement();
- if (!node)
- node = doc->documentElement();
- return node;
-}
-
void Document::decrementActiveParserCount()
{
--m_activeParserCount;
@@ -2218,7 +2200,7 @@ Element* Document::activeElement() const
{
if (Element* element = treeScope().adjustedFocusedElement())
return element;
- return documentElement();
+ return nullptr;
}
void Document::getTransitionElementData(Vector<TransitionElementData>& elementData)
« no previous file with comments | « sky/engine/core/dom/Document.h ('k') | sky/engine/core/dom/Document.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698