Bug 220607 - Elements in a table are incorrectly selected in JavaScript.
Summary: Elements in a table are incorrectly selected in JavaScript.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Megan Gardner
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-01-13 15:55 PST by Megan Gardner
Modified: 2021-01-19 18:00 PST (History)
6 users (show)

See Also:


Attachments
Patch (8.84 KB, patch)
2021-01-13 16:11 PST, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch (10.07 KB, patch)
2021-01-13 17:42 PST, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch (10.79 KB, patch)
2021-01-14 15:55 PST, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch (12.42 KB, patch)
2021-01-19 13:56 PST, Megan Gardner
no flags Details | Formatted Diff | Diff
Patch for landing (12.27 KB, patch)
2021-01-19 17:28 PST, Megan Gardner
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Megan Gardner 2021-01-13 15:55:35 PST
Elements in a table are incorrectly selected in JavaScript.
Comment 1 Megan Gardner 2021-01-13 16:05:07 PST
rdar://69916897
Comment 2 Megan Gardner 2021-01-13 16:11:42 PST
Created attachment 417576 [details]
Patch
Comment 3 Megan Gardner 2021-01-13 17:42:14 PST
Created attachment 417587 [details]
Patch
Comment 4 Megan Gardner 2021-01-14 15:55:34 PST
Created attachment 417663 [details]
Patch
Comment 5 Megan Gardner 2021-01-19 13:56:14 PST
Created attachment 417909 [details]
Patch
Comment 6 Wenson Hsieh 2021-01-19 17:05:24 PST
Comment on attachment 417909 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=417909&action=review

> LayoutTests/editing/selection/editable-table-cell-selection.html:13
> +            if (!testRunner.runUIScript)

I don't see any (direct or indirect) uses of runUIScript in this test…can we just remove this early return and make the test manually runnable?

> LayoutTests/editing/selection/editable-table-cell-selection.html:18
> +            function select( element ) {

Nit - lots of extra spaces in function calls in runTest().

> LayoutTests/editing/selection/editable-table-cell-selection.html:21
> +                range.setStartBefore( element );

(Ditto)

> LayoutTests/editing/selection/editable-table-cell-selection.html:22
> +                range.setEndAfter( element );

(Ditto)

> LayoutTests/editing/selection/editable-table-cell-selection.html:27
> +                selection.addRange( range );

(Ditto)

> LayoutTests/editing/selection/editable-table-cell-selection.html:30
> +            select( document.querySelector( 'thead tr' ) );

(Ditto)

> LayoutTests/editing/selection/editable-table-cell-selection.html:37
> +            const lastHeadCell = [ ...document.querySelectorAll( 'thead th' ) ].pop();

(Ditto)

> LayoutTests/editing/selection/editable-table-cell-selection.html:38
> +            select( lastHeadCell );

(Ditto)

> LayoutTests/editing/selection/editable-table-cell-selection.html:45
> +            select( document.querySelector( 'tbody tr' ) );

(Ditto)

> LayoutTests/editing/selection/editable-table-cell-selection.html:47
> +                output += 'PASS: Correctly Selects row in tboyd';

Nit - tbody.

> LayoutTests/editing/selection/editable-table-cell-selection.html:52
> +            const lastBodyCell = [ ...document.querySelectorAll( 'tbody td' ) ].pop();

(Ditto)

> LayoutTests/editing/selection/editable-table-cell-selection.html:53
> +            select( lastBodyCell );

(Ditto)

> LayoutTests/editing/selection/editable-table-cell-selection.html:123
> +        This test requires UIScriptController to run.

Hm…is this true? I don't see any UIScriptController bits in this test.
Comment 7 Megan Gardner 2021-01-19 17:28:33 PST
Created attachment 417931 [details]
Patch for landing
Comment 8 EWS 2021-01-19 18:00:10 PST
Committed r271635: <https://trac.webkit.org/changeset/271635>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 417931 [details].