OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 285 |
286 bool leftGap, rightGap; | 286 bool leftGap, rightGap; |
287 block().getSelectionGapInfo(lineState, leftGap, rightGap); | 287 block().getSelectionGapInfo(lineState, leftGap, rightGap); |
288 | 288 |
289 GapRects result; | 289 GapRects result; |
290 | 290 |
291 InlineBox* firstBox = firstSelectedBox(); | 291 InlineBox* firstBox = firstSelectedBox(); |
292 InlineBox* lastBox = lastSelectedBox(); | 292 InlineBox* lastBox = lastSelectedBox(); |
293 if (leftGap) { | 293 if (leftGap) { |
294 result.uniteLeft(block().logicalLeftSelectionGap(rootBlock, rootBlockPhy
sicalPosition, offsetFromRootBlock, | 294 result.uniteLeft(block().logicalLeftSelectionGap(rootBlock, rootBlockPhy
sicalPosition, offsetFromRootBlock, |
295 &firstBox->parent()->layoutObject(), firstBox->logicalLeft(), selTop
, selHeight, paintInfo)); | 295 firstBox->parent()->lineLayoutItem(), firstBox->logicalLeft(), selTo
p, selHeight, paintInfo)); |
296 } | 296 } |
297 if (rightGap) { | 297 if (rightGap) { |
298 result.uniteRight(block().logicalRightSelectionGap(rootBlock, rootBlockP
hysicalPosition, offsetFromRootBlock, | 298 result.uniteRight(block().logicalRightSelectionGap(rootBlock, rootBlockP
hysicalPosition, offsetFromRootBlock, |
299 &lastBox->parent()->layoutObject(), lastBox->logicalRight(), selTop,
selHeight, paintInfo)); | 299 lastBox->parent()->lineLayoutItem(), lastBox->logicalRight(), selTop
, selHeight, paintInfo)); |
300 } | 300 } |
301 | 301 |
302 // When dealing with bidi text, a non-contiguous selection region is possibl
e. | 302 // When dealing with bidi text, a non-contiguous selection region is possibl
e. |
303 // e.g. The logical text aaaAAAbbb (capitals denote RTL text and non-capital
s LTR) is laid out | 303 // e.g. The logical text aaaAAAbbb (capitals denote RTL text and non-capital
s LTR) is laid out |
304 // visually as 3 text runs |aaa|bbb|AAA| if we select 4 characters from the
start of the text the | 304 // visually as 3 text runs |aaa|bbb|AAA| if we select 4 characters from the
start of the text the |
305 // selection will look like (underline denotes selection): | 305 // selection will look like (underline denotes selection): |
306 // |aaa|bbb|AAA| | 306 // |aaa|bbb|AAA| |
307 // ___ _ | 307 // ___ _ |
308 // We can see that the |bbb| run is not part of the selection while the runs
around it are. | 308 // We can see that the |bbb| run is not part of the selection while the runs
around it are. |
309 if (firstBox && firstBox != lastBox) { | 309 if (firstBox && firstBox != lastBox) { |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 endBox = nullptr; | 753 endBox = nullptr; |
754 return nullptr; | 754 return nullptr; |
755 } | 755 } |
756 | 756 |
757 const char* RootInlineBox::boxName() const | 757 const char* RootInlineBox::boxName() const |
758 { | 758 { |
759 return "RootInlineBox"; | 759 return "RootInlineBox"; |
760 } | 760 } |
761 | 761 |
762 } // namespace blink | 762 } // namespace blink |
OLD | NEW |