| Summary: | [InputElement] Selection after type change needs to follow HTML specification | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | zsun | ||||||||||||||||||||||
| Component: | Forms | Assignee: | zsun | ||||||||||||||||||||||
| Status: | RESOLVED FIXED | ||||||||||||||||||||||||
| Severity: | Normal | CC: | cdumez, changseok, esprehn+autocc, ews-watchlist, gyuyoung.kim, mifenton, ntim, webkit-bug-importer, wenson_hsieh | ||||||||||||||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||||||||||||||
| Version: | WebKit Nightly Build | ||||||||||||||||||||||||
| Hardware: | Unspecified | ||||||||||||||||||||||||
| OS: | Unspecified | ||||||||||||||||||||||||
| Attachments: |
|
||||||||||||||||||||||||
|
Description
zsun
2022-03-02 05:56:21 PST
Created attachment 453600 [details]
Patch
Not ready for review yet. I need to rebase the test expectations across platforms. Created attachment 458437 [details]
Patch
Created attachment 458502 [details]
Patch
Created attachment 458505 [details]
Patch
Created attachment 458506 [details]
Patch
Created attachment 458511 [details]
Patch
Created attachment 458520 [details]
Patch
Comment on attachment 458520 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=458520&action=review > Source/WebCore/html/HTMLTextFormControlElement.cpp:97 > + m_cachedSelectionDirection = document.frame() && document.frame()->editor().behavior().shouldConsiderSelectionAsDirectional() ? SelectionHasForwardDirection: SelectionHasNoDirection; Why did you move this out of the initializer list? It seems like it could / should stay in the initializer list. Created attachment 458575 [details]
Patch
Comment on attachment 458575 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=458575&action=review > Source/WebCore/html/HTMLTextFormControlElement.cpp:91 > + , m_cachedSelectionDirection(document.frame() && document.frame()->editor().behavior().shouldConsiderSelectionAsDirectional() ? SelectionHasForwardDirection: SelectionHasNoDirection) nit: please add a space after `SelectionHasForwardDirection` Created attachment 458664 [details]
Patch
Comment on attachment 458664 [details]
Patch
Why does imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-start-end-extra-expected.txt need different expectations per-platform?
(In reply to Tim Nguyen (:ntim) from comment #14) > Comment on attachment 458664 [details] > Patch > > Why does > imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/ > selection-start-end-extra-expected.txt need different expectations > per-platform? This patch fixes the sub-test "Shortening value by turning the input type into 'color' and back to 'text'" in selection-start-end-extra.html for all the platforms except mac-wk1. (In reply to zsun from comment #15) > (In reply to Tim Nguyen (:ntim) from comment #14) > > Comment on attachment 458664 [details] > > Patch > > > > Why does > > imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/ > > selection-start-end-extra-expected.txt need different expectations > > per-platform? > > This patch fixes the sub-test "Shortening value by turning the input type > into 'color' and back to 'text'" in selection-start-end-extra.html for all > the platforms except mac-wk1. If that's the case, can we make the failing expectation specific to mac-wk1 and just update the common expectation for all the other platforms? (In reply to Tim Nguyen (:ntim) from comment #16) > (In reply to zsun from comment #15) > > (In reply to Tim Nguyen (:ntim) from comment #14) > > > Comment on attachment 458664 [details] > > > Patch > > > > > > Why does > > > imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/ > > > selection-start-end-extra-expected.txt need different expectations > > > per-platform? > > > > This patch fixes the sub-test "Shortening value by turning the input type > > into 'color' and back to 'text'" in selection-start-end-extra.html for all > > the platforms except mac-wk1. > > If that's the case, can we make the failing expectation specific to mac-wk1 > and just update the common expectation for all the other platforms? This was my initial thought at https://bugs.webkit.org/attachment.cgi?id=458520&action=diff but mac-wk1 didn't seem picking up the mac-wk1 expectation file. (In reply to zsun from comment #17) > (In reply to Tim Nguyen (:ntim) from comment #16) > > (In reply to zsun from comment #15) > > > (In reply to Tim Nguyen (:ntim) from comment #14) > > > > Comment on attachment 458664 [details] > > > > Patch > > > > > > > > Why does > > > > imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/ > > > > selection-start-end-extra-expected.txt need different expectations > > > > per-platform? > > > > > > This patch fixes the sub-test "Shortening value by turning the input type > > > into 'color' and back to 'text'" in selection-start-end-extra.html for all > > > the platforms except mac-wk1. > > > > If that's the case, can we make the failing expectation specific to mac-wk1 > > and just update the common expectation for all the other platforms? > > This was my initial thought at > https://bugs.webkit.org/attachment.cgi?id=458520&action=diff but mac-wk1 > didn't seem picking up the mac-wk1 expectation file. Looks like it didn't work because your paths don't match up. You put the expectation in: LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/selection-start-end-extra-expected.txt when it should be in: LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-start-end-extra-expected.txt Created attachment 458784 [details]
Patch
(In reply to Tim Nguyen (:ntim) from comment #18) > (In reply to zsun from comment #17) > > (In reply to Tim Nguyen (:ntim) from comment #16) > > > (In reply to zsun from comment #15) > > > > (In reply to Tim Nguyen (:ntim) from comment #14) > > > > > Comment on attachment 458664 [details] > > > > > Patch > > > > > > > > > > Why does > > > > > imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/ > > > > > selection-start-end-extra-expected.txt need different expectations > > > > > per-platform? > > > > > > > > This patch fixes the sub-test "Shortening value by turning the input type > > > > into 'color' and back to 'text'" in selection-start-end-extra.html for all > > > > the platforms except mac-wk1. > > > > > > If that's the case, can we make the failing expectation specific to mac-wk1 > > > and just update the common expectation for all the other platforms? > > > > This was my initial thought at > > https://bugs.webkit.org/attachment.cgi?id=458520&action=diff but mac-wk1 > > didn't seem picking up the mac-wk1 expectation file. > > Looks like it didn't work because your paths don't match up. You put the > expectation in: > > LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/ > forms/the-input-element/selection-start-end-extra-expected.txt > > when it should be in: > > LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/ > forms/textfieldselection/selection-start-end-extra-expected.txt Oops! I was so careless. Thank you! Comment on attachment 458784 [details]
Patch
Thanks for addressing the comments! I assume this is ready to land.
Committed r293773 (250252@main): <https://commits.webkit.org/250252@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 458784 [details]. *** Bug 239769 has been marked as a duplicate of this bug. *** |