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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 } | 360 } |
361 } | 361 } |
362 return FloatRect(r); | 362 return FloatRect(r); |
363 } | 363 } |
364 return FloatRect(); | 364 return FloatRect(); |
365 } | 365 } |
366 | 366 |
367 void LayoutText::AbsoluteRectsForRange(Vector<IntRect>& rects, | 367 void LayoutText::AbsoluteRectsForRange(Vector<IntRect>& rects, |
368 unsigned start, | 368 unsigned start, |
369 unsigned end, | 369 unsigned end, |
370 bool use_selection_height) { | 370 bool use_selection_height) const { |
371 // Work around signed/unsigned issues. This function takes unsigneds, and is | 371 // Work around signed/unsigned issues. This function takes unsigneds, and is |
372 // often passed UINT_MAX to mean "all the way to the end". InlineTextBox | 372 // often passed UINT_MAX to mean "all the way to the end". InlineTextBox |
373 // coordinates are unsigneds, so changing this function to take ints causes | 373 // coordinates are unsigneds, so changing this function to take ints causes |
374 // various internal mismatches. But selectionRect takes ints, and passing | 374 // various internal mismatches. But selectionRect takes ints, and passing |
375 // UINT_MAX to it causes trouble. Ideally we'd change selectionRect to take | 375 // UINT_MAX to it causes trouble. Ideally we'd change selectionRect to take |
376 // unsigneds, but that would cause many ripple effects, so for now we'll just | 376 // unsigneds, but that would cause many ripple effects, so for now we'll just |
377 // clamp our unsigned parameters to INT_MAX. | 377 // clamp our unsigned parameters to INT_MAX. |
378 DCHECK(end == UINT_MAX || end <= INT_MAX); | 378 DCHECK(end == UINT_MAX || end <= INT_MAX); |
379 DCHECK_LE(start, static_cast<unsigned>(INT_MAX)); | 379 DCHECK_LE(start, static_cast<unsigned>(INT_MAX)); |
380 start = std::min(start, static_cast<unsigned>(INT_MAX)); | 380 start = std::min(start, static_cast<unsigned>(INT_MAX)); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 } | 479 } |
480 | 480 |
481 void LayoutText::AbsoluteQuads(Vector<FloatQuad>& quads, | 481 void LayoutText::AbsoluteQuads(Vector<FloatQuad>& quads, |
482 MapCoordinatesFlags mode) const { | 482 MapCoordinatesFlags mode) const { |
483 this->Quads(quads, kNoClipping, kAbsoluteQuads, mode); | 483 this->Quads(quads, kNoClipping, kAbsoluteQuads, mode); |
484 } | 484 } |
485 | 485 |
486 void LayoutText::AbsoluteQuadsForRange(Vector<FloatQuad>& quads, | 486 void LayoutText::AbsoluteQuadsForRange(Vector<FloatQuad>& quads, |
487 unsigned start, | 487 unsigned start, |
488 unsigned end, | 488 unsigned end, |
489 bool use_selection_height) { | 489 bool use_selection_height) const { |
490 // Work around signed/unsigned issues. This function takes unsigneds, and is | 490 // Work around signed/unsigned issues. This function takes unsigneds, and is |
491 // often passed UINT_MAX to mean "all the way to the end". InlineTextBox | 491 // often passed UINT_MAX to mean "all the way to the end". InlineTextBox |
492 // coordinates are unsigneds, so changing this function to take ints causes | 492 // coordinates are unsigneds, so changing this function to take ints causes |
493 // various internal mismatches. But selectionRect takes ints, and passing | 493 // various internal mismatches. But selectionRect takes ints, and passing |
494 // UINT_MAX to it causes trouble. Ideally we'd change selectionRect to take | 494 // UINT_MAX to it causes trouble. Ideally we'd change selectionRect to take |
495 // unsigneds, but that would cause many ripple effects, so for now we'll just | 495 // unsigneds, but that would cause many ripple effects, so for now we'll just |
496 // clamp our unsigned parameters to INT_MAX. | 496 // clamp our unsigned parameters to INT_MAX. |
497 DCHECK(end == UINT_MAX || end <= INT_MAX); | 497 DCHECK(end == UINT_MAX || end <= INT_MAX); |
498 DCHECK_LE(start, static_cast<unsigned>(INT_MAX)); | 498 DCHECK_LE(start, static_cast<unsigned>(INT_MAX)); |
499 start = std::min(start, static_cast<unsigned>(INT_MAX)); | 499 start = std::min(start, static_cast<unsigned>(INT_MAX)); |
(...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2130 LayoutRect rect = LayoutRect( | 2130 LayoutRect rect = LayoutRect( |
2131 IntRect(FirstRunX(), FirstRunY(), lines_box.Width(), lines_box.Height())); | 2131 IntRect(FirstRunX(), FirstRunY(), lines_box.Width(), lines_box.Height())); |
2132 LayoutBlock* block = ContainingBlock(); | 2132 LayoutBlock* block = ContainingBlock(); |
2133 if (block && HasTextBoxes()) | 2133 if (block && HasTextBoxes()) |
2134 block->AdjustChildDebugRect(rect); | 2134 block->AdjustChildDebugRect(rect); |
2135 | 2135 |
2136 return rect; | 2136 return rect; |
2137 } | 2137 } |
2138 | 2138 |
2139 } // namespace blink | 2139 } // namespace blink |
OLD | NEW |