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

Unified Diff: Source/core/editing/commands/EditCommand.cpp

Issue 1298823003: Move isRenderedCharacter() to EditorCommand.cpp from Position.cpp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-20T14:16:30 Rebase Created 5 years, 4 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/commands/EditCommand.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/commands/EditCommand.cpp
diff --git a/Source/core/editing/commands/EditCommand.cpp b/Source/core/editing/commands/EditCommand.cpp
index 8cae2268635d69aa1749599670fe86aea735c48b..937170a0547244163676f7add23aad53ef6ad805 100644
--- a/Source/core/editing/commands/EditCommand.cpp
+++ b/Source/core/editing/commands/EditCommand.cpp
@@ -31,6 +31,7 @@
#include "core/editing/FrameSelection.h"
#include "core/editing/commands/CompositeEditCommand.h"
#include "core/frame/LocalFrame.h"
+#include "core/layout/LayoutText.h"
namespace blink {
@@ -89,6 +90,21 @@ void EditCommand::setEndingSelection(const VisiblePosition& position)
setEndingSelection(VisibleSelection(position));
}
+bool EditCommand::isRenderedCharacter(const Position& position)
+{
+ if (position.isNull())
+ return false;
+ ASSERT(position.isOffsetInAnchor());
+ if (!position.anchorNode()->isTextNode())
+ return false;
+
+ LayoutObject* layoutObject = position.anchorNode()->layoutObject();
+ if (!layoutObject)
+ return false;
+
+ return toLayoutText(layoutObject)->isRenderedCharacter(position.offsetInContainerNode());
+}
+
void EditCommand::setParent(CompositeEditCommand* parent)
{
ASSERT((parent && !m_parent) || (!parent && m_parent));
« no previous file with comments | « Source/core/editing/commands/EditCommand.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698