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

Unified Diff: Source/core/dom/Position.cpp

Issue 1285123002: Move Position::isRenderedCharacter() for Text node to LayoutText (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-12T16:31:05 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 | « no previous file | Source/core/layout/LayoutText.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Position.cpp
diff --git a/Source/core/dom/Position.cpp b/Source/core/dom/Position.cpp
index 6044832feb967cc50a6987c71471bd29e55ca214..c6971ec88ae57a1ce5764cdf3e7edf32930db04a 100644
--- a/Source/core/dom/Position.cpp
+++ b/Source/core/dom/Position.cpp
@@ -1016,20 +1016,7 @@ bool PositionAlgorithm<Strategy>::isRenderedCharacter() const
if (!layoutObject)
return false;
- const int offset = offsetInContainerNode();
- LayoutText* textLayoutObject = toLayoutText(layoutObject);
- for (InlineTextBox* box = textLayoutObject->firstTextBox(); box; box = box->nextTextBox()) {
- if (offset < static_cast<int>(box->start()) && !textLayoutObject->containsReversedText()) {
- // The offset we're looking for is before this node
- // this means the offset must be in content that is
- // not laid out. Return false.
- return false;
- }
- if (offset >= static_cast<int>(box->start()) && offset < static_cast<int>(box->start() + box->len()))
- return true;
- }
-
- return false;
+ return toLayoutText(layoutObject)->isRenderedCharacter(offsetInContainerNode());
}
// TODO(yosin) We should move |rendersInDifferentPosition()to "htmlediting.cpp"
« no previous file with comments | « no previous file | Source/core/layout/LayoutText.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698