OLD | NEW |
---|---|
1 /* | 1 /* |
2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Dirk Mueller (mueller@kde.org) | 3 * (C) 2000 Dirk Mueller (mueller@kde.org) |
4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) | 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) |
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
496 end = std::min(end, static_cast<unsigned>(INT_MAX)); | 496 end = std::min(end, static_cast<unsigned>(INT_MAX)); |
497 | 497 |
498 const unsigned caretMinOffset = static_cast<unsigned>(this->caretMinOffset()); | 498 const unsigned caretMinOffset = static_cast<unsigned>(this->caretMinOffset()); |
499 const unsigned caretMaxOffset = static_cast<unsigned>(this->caretMaxOffset()); | 499 const unsigned caretMaxOffset = static_cast<unsigned>(this->caretMaxOffset()); |
500 | 500 |
501 // Narrows |start| and |end| into |caretMinOffset| and |careMaxOffset| | 501 // Narrows |start| and |end| into |caretMinOffset| and |careMaxOffset| |
502 // to ignore unrendered leading and trailing whitespaces. | 502 // to ignore unrendered leading and trailing whitespaces. |
503 start = std::min(std::max(caretMinOffset, start), caretMaxOffset); | 503 start = std::min(std::max(caretMinOffset, start), caretMaxOffset); |
504 end = std::min(std::max(caretMinOffset, end), caretMaxOffset); | 504 end = std::min(std::max(caretMinOffset, end), caretMaxOffset); |
505 | 505 |
506 bool hasCheckedBoxInRange = false; | 506 bool hasCheckedBoxInRange = quads.isEmpty() ? false : true; |
mstensho (USE GERRIT)
2017/04/03 11:16:35
bool hasCheckedBoxInRange = !quads.isEmpty();
wanchang
2017/04/03 11:43:36
Done.
| |
507 | 507 |
508 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { | 508 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { |
509 // Note: box->end() returns the index of the last character, not the index | 509 // Note: box->end() returns the index of the last character, not the index |
510 // past it | 510 // past it |
511 if (start <= box->start() && box->end() < end) { | 511 if (start <= box->start() && box->end() < end) { |
512 LayoutRect r(box->frameRect()); | 512 LayoutRect r(box->frameRect()); |
513 if (useSelectionHeight) { | 513 if (useSelectionHeight) { |
514 LayoutRect selectionRect = box->localSelectionRect(start, end); | 514 LayoutRect selectionRect = box->localSelectionRect(start, end); |
515 if (box->isHorizontal()) { | 515 if (box->isHorizontal()) { |
516 r.setHeight(selectionRect.height()); | 516 r.setHeight(selectionRect.height()); |
(...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2090 LayoutRect rect = LayoutRect( | 2090 LayoutRect rect = LayoutRect( |
2091 IntRect(firstRunX(), firstRunY(), linesBox.width(), linesBox.height())); | 2091 IntRect(firstRunX(), firstRunY(), linesBox.width(), linesBox.height())); |
2092 LayoutBlock* block = containingBlock(); | 2092 LayoutBlock* block = containingBlock(); |
2093 if (block && hasTextBoxes()) | 2093 if (block && hasTextBoxes()) |
2094 block->adjustChildDebugRect(rect); | 2094 block->adjustChildDebugRect(rect); |
2095 | 2095 |
2096 return rect; | 2096 return rect; |
2097 } | 2097 } |
2098 | 2098 |
2099 } // namespace blink | 2099 } // namespace blink |
OLD | NEW |