WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
102320
HTMLFormElement#requestAutocomplete() should require a user action
https://bugs.webkit.org/show_bug.cgi?id=102320
Summary
HTMLFormElement#requestAutocomplete() should require a user action
Elliott Sprehn
Reported
2012-11-14 19:50:31 PST
requestAutocomplete should require a user action and should dispatch a failure event when triggered from a non user action: ex. setTimeout(function() { form.requestAutocomplete(); // this should always fail. }, 0);
Attachments
Patch
(10.55 KB, patch)
2012-12-05 17:42 PST
,
Dan Beam
no flags
Details
Formatted Diff
Diff
changelog typo
(10.57 KB, patch)
2012-12-05 17:48 PST
,
Dan Beam
no flags
Details
Formatted Diff
Diff
if specified impl
(3.29 KB, patch)
2012-12-05 18:04 PST
,
Dan Beam
no flags
Details
Formatted Diff
Diff
if unspecified impl
(10.77 KB, patch)
2012-12-05 18:13 PST
,
Dan Beam
no flags
Details
Formatted Diff
Diff
if specified impl
(3.50 KB, patch)
2012-12-05 18:14 PST
,
Dan Beam
no flags
Details
Formatted Diff
Diff
Patch for landing
(3.33 KB, patch)
2012-12-05 21:32 PST
,
Dan Beam
no flags
Details
Formatted Diff
Diff
Patch for landing
(3.33 KB, patch)
2012-12-05 22:08 PST
,
Dan Beam
no flags
Details
Formatted Diff
Diff
Show Obsolete
(6)
View All
Add attachment
proposed patch, testcase, etc.
Adam Barth
Comment 1
2012-11-14 21:15:29 PST
Should be an easy patch.
Dan Beam
Comment 2
2012-12-05 17:14:50 PST
If I'm just passing along this info to the embedder (so it can fail if it'd like), I guess I have to wait for the code to land in Chrome before I can test firing an autocompleteerror on a non-user gesture. Also, is there a way to simulate user gestures in layout tests?
Dan Beam
Comment 3
2012-12-05 17:29:58 PST
Hey Ian and Adam, This bug is about requiring HTMLFormElement#requestAutocomplete() be based on a user action, else dispatching an error. Is this behavior going to be specified (meaning all WebKit implementations will need to behave the same) or will it be up to each embedder/browser to choose this behavior? Whether it's standardized or not affects my patch, that's why I'm asking.
Dan Beam
Comment 4
2012-12-05 17:42:23 PST
Created
attachment 177887
[details]
Patch
Elliott Sprehn
Comment 5
2012-12-05 17:44:22 PST
(In reply to
comment #3
)
> Hey Ian and Adam, > > This bug is about requiring HTMLFormElement#requestAutocomplete() be based on a user action, else dispatching an error. Is this behavior going to be specified (meaning all WebKit implementations will need to behave the same) or will it be up to each embedder/browser to choose this behavior? > > Whether it's standardized or not affects my patch, that's why I'm asking.
As the person writing the preliminary spec I was going to require it for all implementations.
WebKit Review Bot
Comment 6
2012-12-05 17:45:38 PST
Please wait for approval from
abarth@webkit.org
,
dglazkov@chromium.org
,
fishd@chromium.org
,
jamesr@chromium.org
or
tkent@chromium.org
before submitting, as this patch contains changes to the Chromium public API. See also
https://trac.webkit.org/wiki/ChromiumWebKitAPI
.
Dan Beam
Comment 7
2012-12-05 17:48:01 PST
Created
attachment 177888
[details]
changelog typo
Dan Beam
Comment 8
2012-12-05 17:55:07 PST
esprehn@: I only see 2 differentiations on whether something is a user action or not in this document (
http://dev.w3.org/html5/spec/single-page.html
) 1)
http://dev.w3.org/html5/spec/single-page.html#history-notes
""" In addition, a user agent could ignore calls to pushState() that are invoked on a timer, or from event listeners that are not triggered in response to a clear user action, or that are invoked in rapid succession. """ 2)
http://dev.w3.org/html5/spec/single-page.html#context-menus
""" The context information of the event must be initialized to the same values as the last MouseEvent user interaction event that was fired as part of the gesture that that was interpreted as a request for the context menu. """ It'd seem only #1 is applicable, and it's only a recommendation (if that). However, there's a first time for everything, :).
Dan Beam
Comment 9
2012-12-05 18:04:29 PST
Created
attachment 177894
[details]
if specified impl
Kent Tamura
Comment 10
2012-12-05 18:09:40 PST
Comment on
attachment 177894
[details]
if specified impl View in context:
https://bugs.webkit.org/attachment.cgi?id=177894&action=review
> Source/WebCore/ChangeLog:11 > + No new tests (OOPS!).
OOPS! You had better mention that you updated form-request-autocomplete.html.
Dan Beam
Comment 11
2012-12-05 18:10:35 PST
Comment on
attachment 177894
[details]
if specified impl View in context:
https://bugs.webkit.org/attachment.cgi?id=177894&action=review
>> Source/WebCore/ChangeLog:11 >> + No new tests (OOPS!). > > OOPS! > You had better mention that you updated form-request-autocomplete.html.
Yeah, I don't know why the scripts aren't picking this up automatically... will update now.
Elliott Sprehn
Comment 12
2012-12-05 18:13:16 PST
(In reply to
comment #8
)
> esprehn@: I only see 2 differentiations on whether something is a user action or not in this document (
http://dev.w3.org/html5/spec/single-page.html
)
http://www.whatwg.org/specs/web-apps/current-work/#allowed-to-show-a-pop-up
window.open() is indeed spec'ed to require a trusted event. See also DOMWindow::allowPopUp which has the user gesture code baked into webkit, not into the embedder.
Dan Beam
Comment 13
2012-12-05 18:13:23 PST
Created
attachment 177896
[details]
if unspecified impl
Dan Beam
Comment 14
2012-12-05 18:14:36 PST
Created
attachment 177898
[details]
if specified impl
Dan Beam
Comment 15
2012-12-05 18:25:00 PST
(In reply to
comment #13
)
> Created an attachment (id=177896) [details] > if unspecified impl
I talked with esprehn@ and we agreed that we'd want to spec the safer, simpler to implement version of this API. So, I've obsoleted the unspecified implementation in favor of the specified one. tkent@: if I could steal a minute of your time it'd be awesome to get a [very short] review on the non-obsolete patch (
https://bugs.webkit.org/attachment.cgi?id=177898&action=review
) now that I'm done juggling this bug's attachments, :P.
Kent Tamura
Comment 16
2012-12-05 18:31:26 PST
Comment on
attachment 177898
[details]
if specified impl View in context:
https://bugs.webkit.org/attachment.cgi?id=177898&action=review
> Source/WebCore/ChangeLog:14 > + * fast/forms/form-request-autocomplete.html: > + > + Added a test to ensure that dispatching a call to HTMLFormElement#requestAutocomplete() in a setTimeout() (which will > + never be a user gesture) always fails.
nit: This file is not a part of WebCore. So you don't need to follow the file list style here. "fast/forms/form-request-autocomplete.html is updated." is enough.
Adam Barth
Comment 17
2012-12-05 18:38:14 PST
> As the person writing the preliminary spec I was going to require it for all implementations.
Makes sense.
Ian 'Hixie' Hickson
Comment 18
2012-12-05 19:36:38 PST
I think it makes sense that it happen that way, but in practice the spec won't require it, since it's UI. But acting as if it does is appropriate.
Dan Beam
Comment 19
2012-12-05 21:32:12 PST
Created
attachment 177925
[details]
Patch for landing
Dan Beam
Comment 20
2012-12-05 21:32:55 PST
Comment on
attachment 177898
[details]
if specified impl View in context:
https://bugs.webkit.org/attachment.cgi?id=177898&action=review
>> Source/WebCore/ChangeLog:14 >> + never be a user gesture) always fails. > > nit: This file is not a part of WebCore. So you don't need to follow the file list style here. > "fast/forms/form-request-autocomplete.html is updated." is enough.
Done.
Kent Tamura
Comment 21
2012-12-05 21:47:53 PST
Comment on
attachment 177925
[details]
Patch for landing View in context:
https://bugs.webkit.org/attachment.cgi?id=177925&action=review
> Source/WebCore/ChangeLog:11 > + * fast/forms/form-request-autocomplete.html is updated.
"* " is confusing. It looks like a part of WebCore files.
Dan Beam
Comment 22
2012-12-05 22:08:18 PST
Created
attachment 177931
[details]
Patch for landing
WebKit Review Bot
Comment 23
2012-12-05 22:08:57 PST
Comment on
attachment 177925
[details]
Patch for landing Clearing flags on attachment: 177925 Committed
r136800
: <
http://trac.webkit.org/changeset/136800
>
WebKit Review Bot
Comment 24
2012-12-05 22:09:03 PST
All reviewed patches have been landed. Closing bug.
Dan Beam
Comment 25
2012-12-05 22:09:14 PST
Comment on
attachment 177925
[details]
Patch for landing View in context:
https://bugs.webkit.org/attachment.cgi?id=177925&action=review
>> Source/WebCore/ChangeLog:11 >> + * fast/forms/form-request-autocomplete.html is updated. > > "* " is confusing. It looks like a part of WebCore files.
Sorry, removed.
Kent Tamura
Comment 26
2012-12-05 22:09:47 PST
Comment on
attachment 177931
[details]
Patch for landing OMG
Dan Beam
Comment 27
2012-12-05 22:11:03 PST
(In reply to
comment #24
)
> All reviewed patches have been landed. Closing bug.
Whoops, too late. I'll remember next time. I understand now, looking at the patchset (
http://trac.webkit.org/changeset/136800
), why * matters.
Dan Beam
Comment 28
2012-12-05 22:14:15 PST
(In reply to
comment #26
)
> (From update of
attachment 177931
[details]
) > OMG
Yes, bad timing :(. Is there anything else I need to do for this bug?
Dan Beam
Comment 29
2012-12-05 22:18:26 PST
Comment on
attachment 177925
[details]
Patch for landing this was the committed patch
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