Chromium Code Reviews| 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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 323 | 323 |
| 324 static FloatRect localQuadForTextBox(InlineTextBox* box, unsigned start, unsigne d end, bool useSelectionHeight) | 324 static FloatRect localQuadForTextBox(InlineTextBox* box, unsigned start, unsigne d end, bool useSelectionHeight) |
| 325 { | 325 { |
| 326 unsigned realEnd = min(box->end() + 1, end); | 326 unsigned realEnd = min(box->end() + 1, end); |
| 327 LayoutRect r = box->localSelectionRect(start, realEnd); | 327 LayoutRect r = box->localSelectionRect(start, realEnd); |
| 328 if (r.height()) { | 328 if (r.height()) { |
| 329 if (!useSelectionHeight) { | 329 if (!useSelectionHeight) { |
| 330 // Change the height and y position (or width and x for vertical tex t) | 330 // Change the height and y position (or width and x for vertical tex t) |
| 331 // because selectionRect uses selection-specific values. | 331 // because selectionRect uses selection-specific values. |
| 332 if (box->isHorizontal()) { | 332 if (box->isHorizontal()) { |
| 333 r.setHeight(box->logicalHeight()); | 333 r.setHeight(box->height()); |
|
eae
2013/09/24 23:14:25
How about removing the branching on isHorizontal a
Xianzhu
2013/09/24 23:16:43
No, we still need the branches for r.setHeight/Y a
eae
2013/09/24 23:19:30
Right, r is a LayoutRect which isn't direction awa
| |
| 334 r.setY(box->y()); | 334 r.setY(box->y()); |
| 335 } else { | 335 } else { |
| 336 r.setWidth(box->logicalWidth()); | 336 r.setWidth(box->width()); |
| 337 r.setX(box->x()); | 337 r.setX(box->x()); |
| 338 } | 338 } |
| 339 } | 339 } |
| 340 return FloatRect(r); | 340 return FloatRect(r); |
| 341 } | 341 } |
| 342 return FloatRect(); | 342 return FloatRect(); |
| 343 } | 343 } |
| 344 | 344 |
| 345 void RenderText::absoluteRectsForRange(Vector<IntRect>& rects, unsigned start, u nsigned end, bool useSelectionHeight, bool* wasFixed) | 345 void RenderText::absoluteRectsForRange(Vector<IntRect>& rects, unsigned start, u nsigned end, bool useSelectionHeight, bool* wasFixed) |
| 346 { | 346 { |
| (...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1857 | 1857 |
| 1858 SecureTextTimer* secureTextTimer = gSecureTextTimers->get(this); | 1858 SecureTextTimer* secureTextTimer = gSecureTextTimers->get(this); |
| 1859 if (!secureTextTimer) { | 1859 if (!secureTextTimer) { |
| 1860 secureTextTimer = new SecureTextTimer(this); | 1860 secureTextTimer = new SecureTextTimer(this); |
| 1861 gSecureTextTimers->add(this, secureTextTimer); | 1861 gSecureTextTimers->add(this, secureTextTimer); |
| 1862 } | 1862 } |
| 1863 secureTextTimer->restartWithNewText(lastTypedCharacterOffset); | 1863 secureTextTimer->restartWithNewText(lastTypedCharacterOffset); |
| 1864 } | 1864 } |
| 1865 | 1865 |
| 1866 } // namespace WebCore | 1866 } // namespace WebCore |
| OLD | NEW |