WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
168565
Simple line layout: Implement positionForPoint.
https://bugs.webkit.org/show_bug.cgi?id=168565
Summary
Simple line layout: Implement positionForPoint.
zalan
Reported
2017-02-18 16:22:28 PST
for single RenderText only at this point.
Attachments
Patch
(12.81 KB, patch)
2017-02-18 16:43 PST
,
zalan
no flags
Details
Formatted Diff
Diff
Patch
(12.90 KB, patch)
2017-02-18 17:09 PST
,
zalan
no flags
Details
Formatted Diff
Diff
Patch
(13.02 KB, patch)
2017-02-19 07:31 PST
,
zalan
no flags
Details
Formatted Diff
Diff
Patch
(13.01 KB, patch)
2017-02-19 08:07 PST
,
zalan
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2017-02-18 16:23:01 PST
<
rdar://problem/30593370
>
zalan
Comment 2
2017-02-18 16:43:29 PST
Created
attachment 302061
[details]
Patch
zalan
Comment 3
2017-02-18 16:46:01 PST
Comment on
attachment 302061
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=302061&action=review
> Source/WebCore/rendering/SimpleLineLayoutResolver.cpp:217 > + if (it.lineIndex() > lineIndex) > + return --it; > + // Now we have a candidate run. > + // Find the last run that still contains this point (taking overlapping runs with odd word spacing values into account). > + while (it != end() && (*it).logicalLeft() <= x && lineIndex == it.lineIndex())
The if condition could be eliminated by changing the while to this while (it != end() && lineIndex == it.lineIndex() && (*it).logicalLeft() <= x) but this way it's a bit more implicit. I don't really have a preference on this.
zalan
Comment 4
2017-02-18 17:09:12 PST
Created
attachment 302062
[details]
Patch
Antti Koivisto
Comment 5
2017-02-19 00:47:36 PST
Comment on
attachment 302062
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=302062&action=review
> Source/WebCore/rendering/RenderBlockFlow.cpp:3553 > + if (!simpleLineLayout() || firstChild() != lastChild() || !is<RenderText>(firstChild()))
It might be good to have a comment explaining the tests (beyond just having !simpleLineLayout()).
> Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp:220 > +unsigned positionForPoint(const LayoutPoint& point, const RenderText& renderer, const Layout& layout)
Might be better to call this something else since it doesn't return a Position object (unlike the RenderText version). Maybe textOffsetForPoint or similar?
> Source/WebCore/rendering/SimpleLineLayoutResolver.cpp:204 > + auto it = Iterator(begin());
Can't this just be auto it = begin(); ?
zalan
Comment 6
2017-02-19 07:31:37 PST
Created
attachment 302076
[details]
Patch
Antti Koivisto
Comment 7
2017-02-19 08:04:00 PST
Comment on
attachment 302076
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=302076&action=review
> Source/WebCore/rendering/SimpleLineLayoutResolver.cpp:201 > + return Iterator(end());
return end()?
zalan
Comment 8
2017-02-19 08:07:06 PST
Created
attachment 302078
[details]
Patch
WebKit Commit Bot
Comment 9
2017-02-19 08:26:04 PST
Comment on
attachment 302078
[details]
Patch Clearing flags on attachment: 302078 Committed
r212615
: <
http://trac.webkit.org/changeset/212615
>
WebKit Commit Bot
Comment 10
2017-02-19 08:26:11 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