<rdar://problem/54359330>
Created attachment 376694 [details] Patch
Created attachment 376695 [details] WIP patch
Created attachment 376740 [details] Alternate approach
Comment on attachment 376740 [details] Alternate approach View in context: https://bugs.webkit.org/attachment.cgi?id=376740&action=review > Source/WebCore/dom/Position.cpp:636 > + auto& renderer = *node->renderer(); > + return is<RenderElement>(renderer) && !Position::hasRenderedNonAnonymousDescendantsWithHeight(downcast<RenderElement>(renderer)); This doesn't seem right. It's possible for a text node to appear as direct children of a document node. > LayoutTests/ChangeLog:13 > + * fast/events/focus-anchor-with-tabindex-hang-expected.txt: Added. > + * fast/events/focus-anchor-with-tabindex-hang.html: Added. Please add another test which uses getSelection().modify(~) to reproduce the hang.
Comment on attachment 376740 [details] Alternate approach View in context: https://bugs.webkit.org/attachment.cgi?id=376740&action=review >> Source/WebCore/dom/Position.cpp:636 >> + return is<RenderElement>(renderer) && !Position::hasRenderedNonAnonymousDescendantsWithHeight(downcast<RenderElement>(renderer)); > > This doesn't seem right. It's possible for a text node to appear as direct children of a document node. Hm…I’m a bit confused by this comment. This existing early return: if (!node->renderer()->isInline()) return true; …should ensure that we always consider the document element to have visually distinct ends, even in a page like this: <html> <style> html, body { display: inline; } </style> </html> Perhaps I misunderstood something? >> LayoutTests/ChangeLog:13 >> + * fast/events/focus-anchor-with-tabindex-hang.html: Added. > > Please add another test which uses getSelection().modify(~) to reproduce the hang. Good call! Added a new test.
Created attachment 376775 [details] Patch
Created attachment 376776 [details] Patch
(In reply to Wenson Hsieh from comment #5) > Comment on attachment 376740 [details] > Alternate approach > > View in context: > https://bugs.webkit.org/attachment.cgi?id=376740&action=review > > >> Source/WebCore/dom/Position.cpp:636 > >> + return is<RenderElement>(renderer) && !Position::hasRenderedNonAnonymousDescendantsWithHeight(downcast<RenderElement>(renderer)); > > > > This doesn't seem right. It's possible for a text node to appear as direct children of a document node. > > Hm…I’m a bit confused by this comment. This existing early return: > > if (!node->renderer()->isInline()) > return true; > > …should ensure that we always consider the document element to have visually > distinct ends, even in a page like this: Oh, I missed that. Cool.
Comment on attachment 376776 [details] Patch Clearing flags on attachment: 376776 Committed r248909: <https://trac.webkit.org/changeset/248909>
All reviewed patches have been landed. Closing bug.