Chromium Code Reviews| Index: Source/core/layout/LayoutText.cpp |
| diff --git a/Source/core/layout/LayoutText.cpp b/Source/core/layout/LayoutText.cpp |
| index ac36dc083ba35685a1bf8b5d22a0079e180c6ea5..834a9e33c28c4dd9dd38514da69ff856394d5eab 100644 |
| --- a/Source/core/layout/LayoutText.cpp |
| +++ b/Source/core/layout/LayoutText.cpp |
| @@ -441,6 +441,12 @@ void LayoutText::absoluteQuadsForRange(Vector<FloatQuad>& quads, unsigned start, |
| start = std::min(start, static_cast<unsigned>(INT_MAX)); |
| end = std::min(end, static_cast<unsigned>(INT_MAX)); |
| + const unsigned caretMinOffset = static_cast<unsigned>(this->caretMinOffset()); |
| + const unsigned caretMaxOffset = static_cast<unsigned>(this->caretMaxOffset()); |
| + // Skip leading and trailing unrendered whitespaces |
|
eae
2015/08/18 16:14:45
The comment doesn't explain how this accounts for
yosin_UTC9
2015/08/19 06:08:55
Done.
|
| + start = std::min(std::max(caretMinOffset, start), caretMaxOffset); |
| + end = std::min(std::max(caretMinOffset, end), caretMaxOffset); |
| + |
| for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { |
| // Note: box->end() returns the index of the last character, not the index past it |
| if (start <= box->start() && box->end() < end) { |