WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
203139
Implement new autofocus behavior
https://bugs.webkit.org/show_bug.cgi?id=203139
Summary
Implement new autofocus behavior
Ryosuke Niwa
Reported
2019-10-17 22:07:56 PDT
autofocus processing model has been updated in
https://github.com/whatwg/html/pull/4763
and
https://github.com/whatwg/html/pull/5015
Implement that in WebKit.
Attachments
WIP
(35.87 KB, patch)
2021-09-13 16:38 PDT
,
Ryosuke Niwa
no flags
Details
Formatted Diff
Diff
Patch
(44.57 KB, patch)
2021-09-27 11:54 PDT
,
Brent Fulgham
no flags
Details
Formatted Diff
Diff
Patch
(35.02 KB, patch)
2021-10-05 03:47 PDT
,
Tim Nguyen (:ntim)
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(37.98 KB, patch)
2021-10-05 05:54 PDT
,
Tim Nguyen (:ntim)
no flags
Details
Formatted Diff
Diff
Patch
(39.09 KB, patch)
2021-10-05 07:42 PDT
,
Tim Nguyen (:ntim)
no flags
Details
Formatted Diff
Diff
Patch
(40.14 KB, patch)
2021-10-05 07:48 PDT
,
Tim Nguyen (:ntim)
no flags
Details
Formatted Diff
Diff
Patch
(43.09 KB, patch)
2021-10-06 14:16 PDT
,
Tim Nguyen (:ntim)
no flags
Details
Formatted Diff
Diff
Patch
(44.87 KB, patch)
2021-10-07 00:55 PDT
,
Tim Nguyen (:ntim)
no flags
Details
Formatted Diff
Diff
Patch
(46.02 KB, patch)
2021-10-08 10:41 PDT
,
Tim Nguyen (:ntim)
no flags
Details
Formatted Diff
Diff
Patch
(45.99 KB, patch)
2021-10-08 10:50 PDT
,
Tim Nguyen (:ntim)
no flags
Details
Formatted Diff
Diff
Patch
(45.77 KB, patch)
2021-10-11 08:08 PDT
,
Tim Nguyen (:ntim)
no flags
Details
Formatted Diff
Diff
Patch
(45.94 KB, patch)
2021-10-11 11:55 PDT
,
Tim Nguyen (:ntim)
no flags
Details
Formatted Diff
Diff
Show Obsolete
(11)
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2019-10-17 22:09:20 PDT
<
rdar://problem/56397019
>
Ryosuke Niwa
Comment 2
2019-10-17 22:11:13 PDT
***
Bug 129743
has been marked as a duplicate of this bug. ***
Ryosuke Niwa
Comment 3
2019-10-17 22:11:26 PDT
***
Bug 82778
has been marked as a duplicate of this bug. ***
Ryosuke Niwa
Comment 4
2020-09-26 15:25:25 PDT
***
Bug 213982
has been marked as a duplicate of this bug. ***
Kent Tamura
Comment 5
2020-12-09 00:34:40 PST
***
Bug 202651
has been marked as a duplicate of this bug. ***
Kent Tamura
Comment 6
2020-12-09 00:35:06 PST
***
Bug 200913
has been marked as a duplicate of this bug. ***
Ryosuke Niwa
Comment 7
2021-09-13 16:38:33 PDT
Created
attachment 438089
[details]
WIP Here's some work-in-progress patch.
Brent Fulgham
Comment 8
2021-09-27 11:54:11 PDT
Created
attachment 439376
[details]
Patch
Brent Fulgham
Comment 9
2021-09-27 11:54:47 PDT
Rebased patch for EWS.
Tim Nguyen (:ntim)
Comment 10
2021-09-27 14:51:08 PDT
Relevant links:
https://html.spec.whatwg.org/multipage/interaction.html#the-autofocus-attribute
https://html.spec.whatwg.org/multipage/interaction.html#focusing-steps
Tim Nguyen (:ntim)
Comment 11
2021-10-05 03:47:59 PDT
Created
attachment 440195
[details]
Patch
Tim Nguyen (:ntim)
Comment 12
2021-10-05 05:54:15 PDT
Created
attachment 440204
[details]
Patch
Tim Nguyen (:ntim)
Comment 13
2021-10-05 07:42:30 PDT
Created
attachment 440211
[details]
Patch
Tim Nguyen (:ntim)
Comment 14
2021-10-05 07:48:23 PDT
Created
attachment 440213
[details]
Patch
Simon Fraser (smfr)
Comment 15
2021-10-05 09:01:50 PDT
Comment on
attachment 440213
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=440213&action=review
> Source/WebCore/ChangeLog:9 > + Make WebKit match the new autofocus spec:
You should summarize how the old behavior differs from the new behavior here, and what code changes were necessary to implement the new behavior.
Tim Nguyen (:ntim)
Comment 16
2021-10-06 14:16:44 PDT
Created
attachment 440437
[details]
Patch
Tim Nguyen (:ntim)
Comment 17
2021-10-07 00:55:06 PDT
Created
attachment 440485
[details]
Patch
Wenson Hsieh
Comment 18
2021-10-07 19:58:22 PDT
Comment on
attachment 440485
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=440485&action=review
Seems reasonable to me, but it would be good if Simon or Chris could take a look as well. (Also, do we know why form-submission-crash-3.html is timing out on the Windows bot?)
> Source/WebCore/dom/Document.cpp:4481 > + m_autofocusCandidates.appendOrMoveToLast(candidate);
Should we clear this out elsewhere as well? (e.g. `destroyRenderTree()` or `commonTeardown()`?)
> Source/WebCore/dom/Document.cpp:4491 > + for (; !m_autofocusCandidates.isEmpty(); m_autofocusCandidates.removeFirst()) { > + Ref element = m_autofocusCandidates.first();
Nit - I think this might be a bit cleaner with a `while (!m_autofocusCandidates.isEmpty())` loop and `takeFirst()`.
Tim Nguyen (:ntim)
Comment 19
2021-10-08 00:29:02 PDT
(In reply to Wenson Hsieh from
comment #18
)
> Comment on
attachment 440485
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=440485&action=review
> > Seems reasonable to me, but it would be good if Simon or Chris could take a > look as well. > > (Also, do we know why form-submission-crash-3.html is timing out on the > Windows bot?)
Another race between the first rendering update and the onload event :)
> > Source/WebCore/dom/Document.cpp:4481 > > + m_autofocusCandidates.appendOrMoveToLast(candidate); > > Should we clear this out elsewhere as well? (e.g. `destroyRenderTree()` or > `commonTeardown()`?)
I guess we could clear it in commonTeardown().
Tim Nguyen (:ntim)
Comment 20
2021-10-08 10:41:12 PDT
Created
attachment 440642
[details]
Patch
Tim Nguyen (:ntim)
Comment 21
2021-10-08 10:50:30 PDT
Created
attachment 440644
[details]
Patch
Tim Nguyen (:ntim)
Comment 22
2021-10-11 08:08:21 PDT
Created
attachment 440795
[details]
Patch
Chris Dumez
Comment 23
2021-10-11 08:36:41 PDT
Comment on
attachment 440795
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=440795&action=review
> Source/WebCore/dom/Document.h:1809 > + ListHashSet<Ref<Element>> m_autofocusCandidates;
Does this really need to hold a strong ref to the elements? Seems like it shouldn't and it would be less leak-prone to hold WeakPtrs.
> Source/WebCore/dom/Document.h:1810 > + bool m_isAutofocusProcessed { false };
Please move this bool next to some other boolean data members for better packing.
Tim Nguyen (:ntim)
Comment 24
2021-10-11 11:55:34 PDT
Created
attachment 440812
[details]
Patch
EWS
Comment 25
2021-10-11 13:59:51 PDT
Committed
r283935
(
242794@main
): <
https://commits.webkit.org/242794@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 440812
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug