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

Unified Diff: Source/core/editing/FrameSelection.cpp

Issue 420103002: Use tighter typing in editing: FormatBlockCommand / FrameSelection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | « Source/core/editing/FrameSelection.h ('k') | Source/core/editing/InputMethodController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/FrameSelection.cpp
diff --git a/Source/core/editing/FrameSelection.cpp b/Source/core/editing/FrameSelection.cpp
index 25f461116beee88e082c3bb83b2d6873608e00d6..9ff55f99a63bd814f56b23321db10ccd15a3e084 100644
--- a/Source/core/editing/FrameSelection.cpp
+++ b/Source/core/editing/FrameSelection.cpp
@@ -121,7 +121,7 @@ Element* FrameSelection::rootEditableElementOrDocumentElement() const
return selectionRoot ? selectionRoot : m_frame->document()->documentElement();
}
-Node* FrameSelection::rootEditableElementOrTreeScopeRootNode() const
+ContainerNode* FrameSelection::rootEditableElementOrTreeScopeRootNode() const
{
Element* selectionRoot = m_selection.rootEditableElement();
if (selectionRoot)
@@ -1346,7 +1346,7 @@ void FrameSelection::selectFrameElementInParentIfFullySelected()
// Get to the <iframe> or <frame> (or even <object>) element in the parent frame.
// FIXME: Doesn't work for OOPI.
- Element* ownerElement = m_frame->deprecatedLocalOwner();
+ HTMLFrameOwnerElement* ownerElement = m_frame->deprecatedLocalOwner();
if (!ownerElement)
return;
ContainerNode* ownerElementParent = ownerElement->parentNode();
@@ -1624,7 +1624,7 @@ bool FrameSelection::shouldBlinkCaret() const
if (m_frame->settings() && m_frame->settings()->caretBrowsingEnabled())
return false;
- Node* root = rootEditableElement();
+ Element* root = rootEditableElement();
if (!root)
return false;
@@ -1813,11 +1813,10 @@ void FrameSelection::setSelectionFromNone()
if (!isNone() || !(document->hasEditableStyle() || caretBrowsing))
return;
- Node* node = document->documentElement();
- if (!node)
+ Element* documentElement = document->documentElement();
+ if (!documentElement)
return;
- Node* body = isHTMLBodyElement(*node) ? node : Traversal<HTMLBodyElement>::next(*node);
- if (body)
+ if (HTMLBodyElement* body = Traversal<HTMLBodyElement>::firstChild(*documentElement))
Inactive 2014/07/26 19:40:22 See Document::body() at https://chromium.googlesou
eseidel 2014/07/26 21:16:54 I guess non-html documents are going the way of th
yosin_UTC9 2014/07/29 04:38:46 I think purpose of this patch is improving typing.
Inactive 2014/07/29 12:01:00 Ok, I'll do this in a separate patch. It just felt
setSelection(VisibleSelection(firstPositionInOrBeforeNode(body), DOWNSTREAM));
}
« no previous file with comments | « Source/core/editing/FrameSelection.h ('k') | Source/core/editing/InputMethodController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698