RESOLVED FIXED 213052
[Line clamp] Do not apply the special anchor handling when the anchor content is visible after clamping
https://bugs.webkit.org/show_bug.cgi?id=213052
Summary [Line clamp] Do not apply the special anchor handling when the anchor content...
alan
Reported 2020-06-10 15:10:45 PDT
Attachments
Patch (5.12 KB, patch)
2020-06-10 15:34 PDT, alan
no flags
Patch (5.91 KB, patch)
2020-06-10 19:25 PDT, alan
no flags
alan
Comment 1 2020-06-10 15:34:02 PDT
Darin Adler
Comment 2 2020-06-10 16:16:14 PDT
Comment on attachment 401592 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=401592&action=review > Source/WebCore/ChangeLog:9 > + Line clamping tries to preserve the anchor text if it is at the bottom of the paragraph to support cases like "... Read mode", where the "read more" is an actual link. mode/more?
alan
Comment 3 2020-06-10 19:25:25 PDT
EWS
Comment 4 2020-06-10 20:01:54 PDT
Committed r262892: <https://trac.webkit.org/changeset/262892> All reviewed patches have been landed. Closing bug and clearing flags on attachment 401615 [details].
David Kilzer (:ddkilzer)
Comment 5 2020-06-11 11:01:42 PDT
Comment on attachment 401615 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=401615&action=review > Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:1004 > - if (anchorBox && anchorBox->renderer().style().isLink()) > + auto& anchorRenderer = anchorBox->renderer(); > + auto& lastVisibleRenderer = lastVisibleLine->firstChild()->renderer(); > + if (anchorBox && anchorBox->renderer().style().isLink() && &lastVisibleRenderer != &anchorRenderer) Is Line 1002 (auto& anchorRenderer = anchorBox->renderer();) susceptible to a nullptr crash since you're no longer checking `anchorBox` before dereferencing it?
alan
Comment 6 2020-06-11 11:05:55 PDT
(In reply to David Kilzer (:ddkilzer) from comment #5) > Comment on attachment 401615 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=401615&action=review > > > Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:1004 > > - if (anchorBox && anchorBox->renderer().style().isLink()) > > + auto& anchorRenderer = anchorBox->renderer(); > > + auto& lastVisibleRenderer = lastVisibleLine->firstChild()->renderer(); > > + if (anchorBox && anchorBox->renderer().style().isLink() && &lastVisibleRenderer != &anchorRenderer) > > Is Line 1002 (auto& anchorRenderer = anchorBox->renderer();) susceptible to > a nullptr crash since you're no longer checking `anchorBox` before > dereferencing it? It should never really happen but I'll add a check. Thanks.
alan
Comment 7 2020-06-11 11:09:02 PDT
(In reply to zalan from comment #6) > (In reply to David Kilzer (:ddkilzer) from comment #5) > > Comment on attachment 401615 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=401615&action=review > > > > > Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp:1004 > > > - if (anchorBox && anchorBox->renderer().style().isLink()) > > > + auto& anchorRenderer = anchorBox->renderer(); > > > + auto& lastVisibleRenderer = lastVisibleLine->firstChild()->renderer(); > > > + if (anchorBox && anchorBox->renderer().style().isLink() && &lastVisibleRenderer != &anchorRenderer) > > > > Is Line 1002 (auto& anchorRenderer = anchorBox->renderer();) susceptible to > > a nullptr crash since you're no longer checking `anchorBox` before > > dereferencing it? > It should never really happen but I'll add a check. Thanks. The InlineBox interface should probably be changed to return references.
Note You need to log in before you can comment on or make changes to this bug.