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

Unified Diff: Source/core/layout/LayoutText.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 | « Source/core/layout/LayoutText.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutText.cpp
diff --git a/Source/core/layout/LayoutText.cpp b/Source/core/layout/LayoutText.cpp
index f947ab80107344f15552b8b675f9e9da5744259b..ac36dc083ba35685a1bf8b5d22a0079e180c6ea5 100644
--- a/Source/core/layout/LayoutText.cpp
+++ b/Source/core/layout/LayoutText.cpp
@@ -1134,6 +1134,22 @@ bool LayoutText::isAllCollapsibleWhitespace() const
return true;
}
+bool LayoutText::isRenderedCharacter(int offsetInNode) const
+{
+ for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
+ if (offsetInNode < static_cast<int>(box->start()) && !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 (offsetInNode >= static_cast<int>(box->start()) && offsetInNode < static_cast<int>(box->start() + box->len()))
+ return true;
+ }
+
+ return false;
+}
+
bool LayoutText::containsOnlyWhitespace(unsigned from, unsigned len) const
{
ASSERT(m_text);
« no previous file with comments | « Source/core/layout/LayoutText.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698