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

Unified Diff: sky/engine/core/dom/Position.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/Element.cpp ('k') | sky/engine/core/editing/Editor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/Position.cpp
diff --git a/sky/engine/core/dom/Position.cpp b/sky/engine/core/dom/Position.cpp
index d7093bb4bb8396264ca867fbcaed4b411b0fc01c..8cd1499aee4018567acf724217c029ee7fc34dab 100644
--- a/sky/engine/core/dom/Position.cpp
+++ b/sky/engine/core/dom/Position.cpp
@@ -416,18 +416,16 @@ Node* Position::parentEditingBoundary() const
if (!m_anchorNode)
return 0;
- Node* documentElement = m_anchorNode->document().documentElement();
- if (!documentElement)
- return 0;
-
+ // FIXME: Why does this look at parentNode?
Node* boundary = m_anchorNode.get();
- while (boundary != documentElement && boundary->nonShadowBoundaryParentNode() && m_anchorNode->hasEditableStyle() == boundary->parentNode()->hasEditableStyle())
+ while (boundary->nonShadowBoundaryParentNode()
+ && boundary->nonShadowBoundaryParentNode()->isElementNode()
+ && m_anchorNode->hasEditableStyle() == boundary->parentNode()->hasEditableStyle())
boundary = boundary->nonShadowBoundaryParentNode();
return boundary;
}
-
bool Position::atStartOfTree() const
{
if (isNull())
« no previous file with comments | « sky/engine/core/dom/Element.cpp ('k') | sky/engine/core/editing/Editor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698