Commit 14e5876
committed
Text highlighting range is wrong for truncated RTL text.
https://bugs.webkit.org/show_bug.cgi?id=304475
Reviewed by Antti Koivisto.
Expand on 263418@main by moving truncation handling over to TextBoxSelectableRange to
ensure all callers get correct start/end positions when RTL content is truncated.
(imported/w3c/web-platform-tests/css/css-ui/text-overflow-028.html now passes the selection
test too not just the painting one. -263418@main only fixed painting)
Tests: imported/w3c/web-platform-tests/css/css-ui/text-overflow-with-selection-ref.html
imported/w3c/web-platform-tests/css/css-ui/text-overflow-with-selection.html
* LayoutTests/imported/w3c/web-platform-tests/css/css-ui/text-overflow-with-selection-expected.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-ui/text-overflow-with-selection-ref.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-ui/text-overflow-with-selection.html: Added.
* Source/WebCore/layout/integration/inline/InlineIteratorBoxModernPath.h:
(WebCore::InlineIterator::BoxModernPath::writingMode const):
(WebCore::InlineIterator::BoxModernPath::selectableRange const):
* Source/WebCore/layout/integration/inline/InlineIteratorBoxModernPathInlines.h:
(WebCore::InlineIterator::BoxModernPath::writingMode const): Deleted.
* Source/WebCore/rendering/TextBoxPainter.cpp:
(WebCore::TextBoxPainter::paintForegroundAndDecorations):
* Source/WebCore/rendering/TextBoxSelectableRange.h:
(WebCore::TextBoxSelectableRange::clamp const):
Canonical link: https://commits.webkit.org/304821@main1 parent fe7e0f5 commit 14e5876
File tree
7 files changed
+64
-14
lines changed- LayoutTests/imported/w3c/web-platform-tests/css/css-ui
- Source/WebCore
- layout/integration/inline
- rendering
7 files changed
+64
-14
lines changedLines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
60 | | - | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
93 | | - | |
| 94 | + | |
| 95 | + | |
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | | - | |
372 | | - | |
373 | 371 | | |
374 | 372 | | |
375 | 373 | | |
| |||
410 | 408 | | |
411 | 409 | | |
412 | 410 | | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
419 | 414 | | |
420 | | - | |
| 415 | + | |
421 | 416 | | |
422 | 417 | | |
423 | 418 | | |
| |||
426 | 421 | | |
427 | 422 | | |
428 | 423 | | |
429 | | - | |
| 424 | + | |
430 | 425 | | |
431 | 426 | | |
432 | 427 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
| |||
0 commit comments