Bug 122881
Summary: | Fix wrong width of Range in vertical text | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED CONFIGURATION CHANGED | ||
Severity: | Normal | CC: | ahmad.saleem792, ap, benjamin, bfulgham, enrica, mmaxfield |
Priority: | P2 | Keywords: | BlinkMergeCandidate |
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Ryosuke Niwa
Consider merging https://chromium.googlesource.com/chromium/blink/+/7f36ec72aa9f3bd43505d7f2be6978ab20984aa8
if the bug exists in WebKit
When the original code adjusts the width of the quad of a seleciton box
containing one or several characters in vertical text,
box->logicalWidth() (which is actually the height of the box) is used.
Should use box->width() instead.
The original fast/dom/Range/getClientRects.html tests only the whole
block selection case, not covering bug http://crbug.com/297808.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Ryosuke Niwa
See https://code.google.com/p/chromium/issues/detail?id=297808
Ahmad Saleem
I don't think, this is required because Safari 15.6.1 passes all test from the linked Chromium patch:
Link - https://jsfiddle.net/4dszr5fa/show
Changed it to JSFiddle.
*** Safari 15.6.1 ***
Test horizontal
PASS 1 is rects.length
PASS box.offsetWidth / 26 is >= rects[0].width
PASS box.offsetHeight / 2 is >= rects[0].height
Test vertical
PASS 1 is rects.length
PASS box.offsetWidth / 2 is >= rects[0].width
PASS box.offsetHeight / 26 is >= rects[0].height
ABCDEFGHIJKLMNOPQRSTUVWXYZ
_______
Webkit GitHub Source - https://github.com/WebKit/WebKit/blob/main/Source/WebCore/rendering/RenderText.cpp#L475
Thanks!
Alexey Proskuryakov
Selection highlight looks good to me when manually opening this test, too.