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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutText.cpp

Issue 2792953002: Fix unexpected erasing textQuad (Closed)
Patch Set: comment added. Created 3 years, 8 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 | « third_party/WebKit/Source/core/dom/RangeTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutText.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutText.cpp b/third_party/WebKit/Source/core/layout/LayoutText.cpp
index 75337eeed2189260acf05984ac6533c62046f20a..7c737606f965adc158ca37a7c3f05f65d01d0356 100644
--- a/third_party/WebKit/Source/core/layout/LayoutText.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutText.cpp
@@ -380,7 +380,8 @@ void LayoutText::absoluteRectsForRange(Vector<IntRect>& rects,
start = std::min(start, static_cast<unsigned>(INT_MAX));
end = std::min(end, static_cast<unsigned>(INT_MAX));
- bool hasCheckedBoxInRange = false;
+ // This function is always called in sequence that this check should work.
+ bool hasCheckedBoxInRange = !rects.isEmpty();
for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
// Note: box->end() returns the index of the last character, not the index
@@ -503,7 +504,8 @@ void LayoutText::absoluteQuadsForRange(Vector<FloatQuad>& quads,
start = std::min(std::max(caretMinOffset, start), caretMaxOffset);
end = std::min(std::max(caretMinOffset, end), caretMaxOffset);
- bool hasCheckedBoxInRange = false;
+ // This function is always called in sequence that this check should work.
+ bool hasCheckedBoxInRange = !quads.isEmpty();
for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
// Note: box->end() returns the index of the last character, not the index
« no previous file with comments | « third_party/WebKit/Source/core/dom/RangeTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698