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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 } | 486 } |
487 | 487 |
488 // box is first on line | 488 // box is first on line |
489 // and the x coordinate is to the left of the first text box left edge | 489 // and the x coordinate is to the left of the first text box left edge |
490 if (!box->prevLeafChildIgnoringLineBreak() && pointLineDirection < box->logi
calLeft()) | 490 if (!box->prevLeafChildIgnoringLineBreak() && pointLineDirection < box->logi
calLeft()) |
491 return true; | 491 return true; |
492 | 492 |
493 if (!box->nextLeafChildIgnoringLineBreak()) { | 493 if (!box->nextLeafChildIgnoringLineBreak()) { |
494 // box is last on line | 494 // box is last on line |
495 // and the x coordinate is to the right of the last text box right edge | 495 // and the x coordinate is to the right of the last text box right edge |
496 // generate VisiblePosition, use UPSTREAM affinity if possible | 496 // generate VisiblePosition, use TextAffinity::Upstream affinity if poss
ible |
497 shouldAffinityBeDownstream = UpstreamIfPositionIsNotAtStart; | 497 shouldAffinityBeDownstream = UpstreamIfPositionIsNotAtStart; |
498 return true; | 498 return true; |
499 } | 499 } |
500 | 500 |
501 return false; | 501 return false; |
502 } | 502 } |
503 | 503 |
504 static PositionWithAffinity createPositionWithAffinityForBox(const InlineBox* bo
x, int offset, ShouldAffinityBeDownstream shouldAffinityBeDownstream) | 504 static PositionWithAffinity createPositionWithAffinityForBox(const InlineBox* bo
x, int offset, ShouldAffinityBeDownstream shouldAffinityBeDownstream) |
505 { | 505 { |
506 EAffinity affinity = VP_DEFAULT_AFFINITY; | 506 TextAffinity affinity = VP_DEFAULT_AFFINITY; |
507 switch (shouldAffinityBeDownstream) { | 507 switch (shouldAffinityBeDownstream) { |
508 case AlwaysDownstream: | 508 case AlwaysDownstream: |
509 affinity = DOWNSTREAM; | 509 affinity = TextAffinity::Downstream; |
510 break; | 510 break; |
511 case AlwaysUpstream: | 511 case AlwaysUpstream: |
512 affinity = VP_UPSTREAM_IF_POSSIBLE; | 512 affinity = VP_UPSTREAM_IF_POSSIBLE; |
513 break; | 513 break; |
514 case UpstreamIfPositionIsNotAtStart: | 514 case UpstreamIfPositionIsNotAtStart: |
515 affinity = offset > box->caretMinOffset() ? VP_UPSTREAM_IF_POSSIBLE : DO
WNSTREAM; | 515 affinity = offset > box->caretMinOffset() ? VP_UPSTREAM_IF_POSSIBLE : Te
xtAffinity::Downstream; |
516 break; | 516 break; |
517 } | 517 } |
518 int textStartOffset = box->layoutObject().isText() ? toLayoutText(box->layou
tObject()).textStartOffset() : 0; | 518 int textStartOffset = box->layoutObject().isText() ? toLayoutText(box->layou
tObject()).textStartOffset() : 0; |
519 return box->layoutObject().createPositionWithAffinity(offset + textStartOffs
et, affinity); | 519 return box->layoutObject().createPositionWithAffinity(offset + textStartOffs
et, affinity); |
520 } | 520 } |
521 | 521 |
522 static PositionWithAffinity createPositionWithAffinityForBoxAfterAdjustingOffset
ForBiDi(const InlineTextBox* box, int offset, ShouldAffinityBeDownstream shouldA
ffinityBeDownstream) | 522 static PositionWithAffinity createPositionWithAffinityForBoxAfterAdjustingOffset
ForBiDi(const InlineTextBox* box, int offset, ShouldAffinityBeDownstream shouldA
ffinityBeDownstream) |
523 { | 523 { |
524 ASSERT(box); | 524 ASSERT(box); |
525 ASSERT(offset >= 0); | 525 ASSERT(offset >= 0); |
(...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1876 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { | 1876 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { |
1877 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box); | 1877 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box); |
1878 if (box->truncation() != cNoTruncation) { | 1878 if (box->truncation() != cNoTruncation) { |
1879 if (EllipsisBox* ellipsisBox = box->root().ellipsisBox()) | 1879 if (EllipsisBox* ellipsisBox = box->root().ellipsisBox()) |
1880 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(
*ellipsisBox); | 1880 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(
*ellipsisBox); |
1881 } | 1881 } |
1882 } | 1882 } |
1883 } | 1883 } |
1884 | 1884 |
1885 } // namespace blink | 1885 } // namespace blink |
OLD | NEW |