WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
205842
First character in each word-wrapped line has incorrect character rect when requested range spans multiple lines
https://bugs.webkit.org/show_bug.cgi?id=205842
Summary
First character in each word-wrapped line has incorrect character rect when r...
Daniel Bates
Reported
2020-01-06 16:34:44 PST
Consider a page with the following markup: [[ <style>@font-face { font-family: Ahem; src: url(Ahem.ttf); } body { margin: 0; } * { font: 25px/1 Ahem; -webkit-text-size-adjust: 100%; }</style> <meta name='viewport' content='width=980, initial-scale=1.0'> <textarea id='test' style='width: 26em; padding: 0 /* Overrides default user-agent stylesheet */;'>The quick brown fox jumps over the lazy dog.</textarea> <script> test.focus(); test.setSelectionRange(25, 25) </script> ]] (^^^ Assumes the Ahem font is available) Then requesting the a document context for rects returns an incorrect character rect for the space/line break after "jumps".
Attachments
For Bots
(13.90 KB, patch)
2020-01-06 16:36 PST
,
Daniel Bates
no flags
Details
Formatted Diff
Diff
Patch and unit test
(17.20 KB, patch)
2020-01-07 10:30 PST
,
Daniel Bates
no flags
Details
Formatted Diff
Diff
Addendum - keep current behavior of Range::absoluteBoundingBox, but fix up request document context code path
(2.26 KB, patch)
2020-01-07 10:52 PST
,
Daniel Bates
no flags
Details
Formatted Diff
Diff
To land
(19.88 KB, patch)
2020-01-07 11:59 PST
,
Daniel Bates
no flags
Details
Formatted Diff
Diff
To land
(19.88 KB, patch)
2020-01-07 13:25 PST
,
Daniel Bates
no flags
Details
Formatted Diff
Diff
Show Obsolete
(4)
View All
Add attachment
proposed patch, testcase, etc.
Daniel Bates
Comment 1
2020-01-06 16:34:53 PST
<
rdar://problem/56884325
>
Daniel Bates
Comment 2
2020-01-06 16:36:20 PST
Created
attachment 386911
[details]
For Bots
Daniel Bates
Comment 3
2020-01-07 10:30:17 PST
Created
attachment 386989
[details]
Patch and unit test
Daniel Bates
Comment 4
2020-01-07 10:34:28 PST
Comment on
attachment 386989
[details]
Patch and unit test View in context:
https://bugs.webkit.org/attachment.cgi?id=386989&action=review
> Source/WebCore/dom/Range.cpp:1152 > + absoluteTextRects(rects, useSelectionHeight, inFixed, { BoundingRectBehavior::IgnoreEmptyTextSelections });
I patched here because I was kinda thinking this is the behavior we want for all IPI and SPI: it makes us match NSLayoutManager behavior. But it's enough to fix just my particular bug by having <
https://trac.webkit.org/browser/trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm?rev=254070#L4074
> pass BoundingRectBehavior::IgnoreEmptyTextSelections. That is, Range::absoluteBoundingBox() could take an optional BoundingRectBehavior argument, default such that we do what we do now and just have WebPageIOS.mm's code pass BoundingRectBehavior::IgnoreEmptyTextSelections. Thoughts?
Daniel Bates
Comment 5
2020-01-07 10:52:11 PST
Created
attachment 386996
[details]
Addendum - keep current behavior of Range::absoluteBoundingBox, but fix up request document context code path
Daniel Bates
Comment 6
2020-01-07 10:54:51 PST
(In reply to Daniel Bates from
comment #5
)
> Created
attachment 386996
[details]
> Addendum - keep current behavior of Range::absoluteBoundingBox, but fix up > request document context code path
I can merge ^^^ into the patch if it would help make it easier to review this change.
Daniel Bates
Comment 7
2020-01-07 11:59:45 PST
Created
attachment 387011
[details]
To land
Daniel Bates
Comment 8
2020-01-07 12:00:25 PST
(In reply to Daniel Bates from
comment #6
)
> (In reply to Daniel Bates from
comment #5
) > > Created
attachment 386996
[details]
> > Addendum - keep current behavior of Range::absoluteBoundingBox, but fix up > > request document context code path > > I can merge ^^^ into the patch if it would help make it easier to review > this change.
Merge this in to the updated patch!
Daniel Bates
Comment 9
2020-01-07 12:03:12 PST
Comment on
attachment 387011
[details]
To land Clearing flags on attachment: 387011 Committed
r254144
: <
https://trac.webkit.org/changeset/254144
>
Daniel Bates
Comment 10
2020-01-07 12:03:15 PST
All reviewed patches have been landed. Closing bug.
Aakash Jain
Comment 11
2020-01-07 12:54:16 PST
This seems to have broken the iOS build. Tracked in
https://bugs.webkit.org/show_bug.cgi?id=205883
Relevant error: WebPageIOS.mm:4064:73: error: use of undeclared identifier 'BoundingRectBehavior'
Ryan Haddad
Comment 12
2020-01-07 13:10:23 PST
Reverted
r254144
for reason: Broke the iOS build. Committed
r254151
: <
https://trac.webkit.org/changeset/254151
>
Daniel Bates
Comment 13
2020-01-07 13:25:38 PST
Created
attachment 387024
[details]
To land
Daniel Bates
Comment 14
2020-01-07 13:27:00 PST
Comment on
attachment 387024
[details]
To land Clearing flags on attachment: 387024 Committed
r254153
: <
https://trac.webkit.org/changeset/254153
>
Daniel Bates
Comment 15
2020-01-07 13:27:02 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug