Selection API: A few more refinements to DOMSelection and VisibleSelection to pass all WPT tests
Created attachment 409253 [details] Patch
Created attachment 409254 [details] Patch
Apparently changing how the selection direction is computed causes a change to this test result (editing/inserting/insert-list-in-table-cell-07.html). It’s not obviously making anything worse, but also not obviously better. I am thinking this is another case where re-basing is the right thing to do. The user-visible change is that the selection ends up inside the first table cell, where in the older case the selected ended up outside the table. Neither result seems right to me. I’d like to see the whole table end up selected and I don’t understand why that doesn’t happen.
Created attachment 409259 [details] Patch
All green on EWS, ready for review.
Comment on attachment 409259 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=409259&action=review > LayoutTests/ChangeLog:13 > + the current beahvior, before this patch and after, yields an insertion point. Misspelled behavior here.
Comment on attachment 409259 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=409259&action=review > Source/WebCore/editing/VisibleSelection.h:160 > + bool m_anchorIsFirst : 1; // True if the anchor is before the focus. > + bool m_isDirectional : 1; // On Mac, Shift-arrow keys move the anchor in a directional selection and moves either end to always extend in a non-directional selection. This is a bit tangential but it seems totally unnecessary to use bitfields here.
Comment on attachment 409259 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=409259&action=review >> Source/WebCore/editing/VisibleSelection.h:160 >> + bool m_isDirectional : 1; // On Mac, Shift-arrow keys move the anchor in a directional selection and moves either end to always extend in a non-directional selection. > > This is a bit tangential but it seems totally unnecessary to use bitfields here. I agree. I was just thinking about that last night, in fact!
Committed r267362: <https://trac.webkit.org/changeset/267362>
<rdar://problem/69323482>