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

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

Issue 2863023003: Remove use_selection_height usage in LayoutText (Closed)
Patch Set: corrected indentation Created 3 years, 7 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/layout/LayoutText.h ('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 c7b873fe8e40d46f38d3c45bf8ad62b7b85ba2b0..6e007fd64554d30aee75cb3a7d4b99ba5ad2de84 100644
--- a/third_party/WebKit/Source/core/layout/LayoutText.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutText.cpp
@@ -343,21 +343,18 @@ void LayoutText::AbsoluteRects(Vector<IntRect>& rects,
static FloatRect LocalQuadForTextBox(InlineTextBox* box,
unsigned start,
- unsigned end,
- bool use_selection_height) {
+ unsigned end) {
unsigned real_end = std::min(box->end() + 1, end);
LayoutRect r = box->LocalSelectionRect(start, real_end);
if (r.Height()) {
- if (!use_selection_height) {
- // Change the height and y position (or width and x for vertical text)
- // because selectionRect uses selection-specific values.
- if (box->IsHorizontal()) {
- r.SetHeight(box->Height());
- r.SetY(box->Y());
- } else {
- r.SetWidth(box->Width());
- r.SetX(box->X());
- }
+ // Change the height and y position (or width and x for vertical text)
+ // because selectionRect uses selection-specific values.
+ if (box->IsHorizontal()) {
+ r.SetHeight(box->Height());
+ r.SetY(box->Y());
+ } else {
+ r.SetWidth(box->Width());
+ r.SetX(box->X());
}
return FloatRect(r);
}
@@ -366,8 +363,7 @@ static FloatRect LocalQuadForTextBox(InlineTextBox* box,
void LayoutText::AbsoluteRectsForRange(Vector<IntRect>& rects,
unsigned start,
- unsigned end,
- bool use_selection_height) const {
+ unsigned end) const {
// Work around signed/unsigned issues. This function takes unsigneds, and is
// often passed UINT_MAX to mean "all the way to the end". InlineTextBox
// coordinates are unsigneds, so changing this function to take ints causes
@@ -388,16 +384,6 @@ void LayoutText::AbsoluteRectsForRange(Vector<IntRect>& rects,
// past it
if (start <= box->Start() && box->end() < end) {
FloatRect r(box->FrameRect());
- if (use_selection_height) {
- LayoutRect selection_rect = box->LocalSelectionRect(start, end);
- if (box->IsHorizontal()) {
- r.SetHeight(selection_rect.Height().ToFloat());
- r.SetY(selection_rect.Y().ToFloat());
- } else {
- r.SetWidth(selection_rect.Width().ToFloat());
- r.SetX(selection_rect.X().ToFloat());
- }
- }
if (!has_checked_box_in_range) {
has_checked_box_in_range = true;
rects.clear();
@@ -405,8 +391,7 @@ void LayoutText::AbsoluteRectsForRange(Vector<IntRect>& rects,
rects.push_back(LocalToAbsoluteQuad(r).EnclosingBoundingBox());
} else if ((box->Start() <= start && start <= box->end()) ||
(box->Start() < end && end <= box->end())) {
- FloatRect rect =
- LocalQuadForTextBox(box, start, end, use_selection_height);
+ FloatRect rect = LocalQuadForTextBox(box, start, end);
if (!rect.IsZero()) {
if (!has_checked_box_in_range) {
has_checked_box_in_range = true;
@@ -417,8 +402,7 @@ void LayoutText::AbsoluteRectsForRange(Vector<IntRect>& rects,
} else if (!has_checked_box_in_range) {
// FIXME: This code is wrong. It's converting local to absolute twice.
// http://webkit.org/b/65722
- FloatRect rect =
- LocalQuadForTextBox(box, start, end, use_selection_height);
+ FloatRect rect = LocalQuadForTextBox(box, start, end);
if (!rect.IsZero())
rects.push_back(LocalToAbsoluteQuad(rect).EnclosingBoundingBox());
}
@@ -523,7 +507,7 @@ void LayoutText::AbsoluteQuadsForRange(Vector<FloatQuad>& quads,
quads.push_back(LocalToAbsoluteQuad(FloatRect(r)));
} else if ((box->Start() <= start && start <= box->end()) ||
(box->Start() < end && end <= box->end())) {
- FloatRect rect = LocalQuadForTextBox(box, start, end, false);
+ FloatRect rect = LocalQuadForTextBox(box, start, end);
if (!rect.IsZero()) {
if (!has_checked_box_in_range) {
has_checked_box_in_range = true;
@@ -534,7 +518,7 @@ void LayoutText::AbsoluteQuadsForRange(Vector<FloatQuad>& quads,
} else if (!has_checked_box_in_range) {
// consider when the offset of range is area of leading or trailing
// whitespace
- FloatRect rect = LocalQuadForTextBox(box, start, end, false);
+ FloatRect rect = LocalQuadForTextBox(box, start, end);
if (!rect.IsZero())
quads.push_back(LocalToAbsoluteQuad(rect).EnclosingBoundingBox());
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutText.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698