Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a global event handler for beforeinput #6743

Closed
wants to merge 299 commits into from

Conversation

mfreed7
Copy link
Contributor

@mfreed7 mfreed7 commented Jun 7, 2021

Also imported the input event from the UI events specifications, since that one defines it.

Fixed #4526

(This PR is directly pulled from #4530, which can't land due to IP issues.)


💥 Error: Wattsi server error 💥

PR Preview failed to build. (Last tried on Jun 7, 2021, 5:48 PM UTC).

More

PR Preview relies on a number of web services to run. There seems to be an issue with the following one:

🚨 Wattsi Server - Wattsi Server is the web service used to build the WHATWG HTML spec.

🔗 Related URL

Parsing MDN data...
Parsing...
Generating HTML variant...
Error: Multiple definitions for term "event-beforeinput" Parent of first says: "beforeinput event", parent of second says: " beforeinput      "
Error: Multiple definitions for term "event-input" Parent of first says: "input event", parent of second says: " input      "
Error: missing <dfn> for topic "event-onbeforeinput" explicitly from <code> element containing "onbeforeinput"; previous heading contents are "8.1.7.2 Event handlers on elements, Document objects, and Window objects"
Error count: 3
Saving index-html
Splitting...
Saving index.html
Saving introduction.html
Saving infrastructure.html
Saving common-microsyntaxes.html
Saving urls-and-fetching.html
Saving common-dom-interfaces.html
Saving structured-data.html
Saving dom.html
Saving semantics.html
Saving sections.html
Saving grouping-content.html
Saving text-level-semantics.html
Saving links.html
Saving edits.html
Saving embedded-content.html
Saving images.html
Saving iframe-embed-object.html
Saving media.html
Saving image-maps.html
Saving embedded-content-other.html
Saving tables.html
Saving forms.html
Saving input.html
Saving form-elements.html
Saving form-control-infrastructure.html
Saving interactive-elements.html
Saving scripting.html
Saving canvas.html
Saving custom-elements.html
Saving semantics-other.html
Saving microdata.html
Saving interaction.html
Saving dnd.html
Saving browsers.html
Saving window-object.html
Saving origin.html
Saving history.html
Saving browsing-the-web.html
Saving webappapis.html
Saving dynamic-markup-insertion.html
Saving timers-and-user-prompts.html
Saving system-state.html
Saving imagebitmap-and-animations.html
Saving comms.html
Saving server-sent-events.html
Saving web-sockets.html
Saving web-messaging.html
Saving workers.html
Saving worklets.html
Saving webstorage.html
Saving syntax.html
Saving parsing.html
Saving named-characters.html
Saving xhtml.html
Saving rendering.html
Saving obsolete.html
Saving iana.html
Saving indices.html
Saving references.html
Saving acknowledgements.html
Generating DEV variant...
Error: Multiple definitions for term "event-beforeinput" Parent of first says: "beforeinput event", parent of second says: " beforeinput      "
Error: Multiple definitions for term "event-input" Parent of first says: "input event", parent of second says: " input      "
Error count: 2
Splitting...
Saving index.html
Saving introduction.html
Saving infrastructure.html
Saving common-microsyntaxes.html
Saving urls-and-fetching.html
Saving common-dom-interfaces.html
Saving dom.html
Saving semantics.html
Saving sections.html
Saving grouping-content.html
Saving text-level-semantics.html
Saving links.html
Saving edits.html
Saving embedded-content.html
Saving images.html
Saving iframe-embed-object.html
Saving media.html
Saving image-maps.html
Saving embedded-content-other.html
Saving tables.html
Saving forms.html
Saving input.html
Saving form-elements.html
Saving form-control-infrastructure.html
Saving interactive-elements.html
Saving scripting.html
Saving canvas.html
Saving custom-elements.html
Saving semantics-other.html
Saving microdata.html
Saving interaction.html
Saving dnd.html
Saving browsers.html
Saving window-object.html
Saving origin.html
Saving history.html
Saving browsing-the-web.html
Saving webappapis.html
Saving dynamic-markup-insertion.html
Saving timers-and-user-prompts.html
Saving system-state.html
Saving imagebitmap-and-animations.html
Saving comms.html
Saving server-sent-events.html
Saving web-sockets.html
Saving web-messaging.html
Saving workers.html
Saving worklets.html
Saving webstorage.html
Saving syntax.html
Saving named-characters.html
Saving xhtml.html
Saving obsolete.html
Saving indices.html
Saving references.html
Saving acknowledgements.html
Generating SNAP variant...
Error: Multiple definitions for term "event-beforeinput" Parent of first says: "beforeinput event", parent of second says: " beforeinput      "
Error: Multiple definitions for term "event-input" Parent of first says: "input event", parent of second says: " input      "
Error: missing <dfn> for topic "event-onbeforeinput" explicitly from <code> element containing "onbeforeinput"; previous heading contents are "8.1.7.2 Event handlers on elements, Document objects, and Window objects"
Error count: 3
Saving index-snap



If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please file an issue.


💥 Error: HTTP Error: 404 Not Found 💥

PR Preview failed to build. (Last tried on Jun 3, 2022, 11:29 PM UTC).

More

🔗 Related URL

If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please file an issue.

source Outdated Show resolved Hide resolved
source Outdated
@@ -123541,8 +123552,8 @@ INSERT INTERFACES HERE
<tr> <!-- input -->
<td> <dfn event for="HTMLElement"><code data-x="event-input" id="event-input-input">input</code></dfn>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this update is a great idea. The definition in UI Events competes with the definition in HTML, and the definition in HTML seems better-maintained. (E.g.: UI Events says the event is always sync, always bubbles, never cancelable, always composed, which is not good; those things are per-call-site properties, not properties of the event definition.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Help me understand. Are you saying you don't want to update this Events non-normative table because the UI Events spec for beforeinput isn't well maintained? It looks like all events described in UI Events are hard-coded with fixed sync/bubbles/cancelable/etc properties. Is it just that you think beforeinput is special there? Perhaps you're saying we shouldn't link to the definition in UI Events at all, and define it here instead?

I guess: please tell me specifically what you'd like me to change here, and I'll change it.

@sideshowbarker sideshowbarker added the impacts documentation Used by documentation communities, such as MDN, to track changes that impact documentation label Jun 9, 2021
@karlcow
Copy link
Member

karlcow commented Aug 19, 2021

@mfreed7 The last 100m on this could be done quickly. Did you see @domenic comment?

jgraham added a commit to web-platform-tests/wpt that referenced this pull request Jan 13, 2022
jgraham added a commit to web-platform-tests/wpt that referenced this pull request Jan 13, 2022
foolip pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 24, 2022
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Feb 5, 2022
…=testonly

Automatic update from web-platform-tests
Add test for onbeforeinput attribute. (#32367)

This is tentative until whatwg/html#6743 lands
--

wpt-commits: d780a800f8bb8a3ee0d08bb9ff77943963313c03
wpt-pr: 32367
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Feb 7, 2022
…=testonly

Automatic update from web-platform-tests
Add test for onbeforeinput attribute. (#32367)

This is tentative until whatwg/html#6743 lands
--

wpt-commits: d780a800f8bb8a3ee0d08bb9ff77943963313c03
wpt-pr: 32367
Kaiido and others added 16 commits June 3, 2022 16:25
This helps especially in the PDF viewing support section.

Also includes some editorial modernization of DOMStringList.
The regression was introduced in f690ad9 (whatwg#6399).

For the case:

<table><math><p>foo

the <p> token would not have foster parenting enabled, thus inserting it into the table.

Fixes whatwg#6439.
This fixes a regression introduced in 326c644.

Fixes whatwg#6509.
Amend the parameters passed when creating the navigation timing info entry to include the service worker timing info. Also, pass 0 for redirectCount When cross-origin redirects occurred as part of the navigation.

See also w3c/navigation-timing#143 and w3c/ServiceWorker#1575.
This allows libraries to emulate the behavior of an exception thrown in an event listener callback.

Additional context: whatwg/console#50.

Tests: web-platform-tests/wpt#29738.

Co-authored-by: Domenic Denicola <[email protected]>
This implements some of the changes described in whatwg/meta#190 (comment) for our "For web developers (non-normative)" boxes, i.e. "domintro" boxes. Although the first three domintros were rewritten by hand and thus reflect all of those changes, the rest were transformed in an automated fashion, with only the following transformations applied:

* Wrap the entire line in <code> instead of just some property names.
* Remove spaces around dots and parentheses.
* Move ...s before the argument, like JavaScript, instead of after.

Additionally the nature of the automated process involved rewrapping all the <dd> contents, and *un*wrapping all <dt> contents. Some linebreaks were removed and inserted as well to give a consistent style.
Reland JSON modules (whatwg#4315), originally found in db03474 but removed in a530f6f. Importing a JSON module now requires the module type to be specified at every import site with an import assertion, addressing the security concern that led to the revert.

Additionally, some of the infrastructure now lives in the TC39 proposal at https://github.com/tc39/proposal-json-modules, and 3d45584 introduced the import assertions integration, so overall this patch is pretty small.
Adding VideoFrame as a CanvasImageSource allows drawImage(), createImageBitmap(), and texImage() to interoperate with VideoFrames. VideoFrames are effectively the same as the existing point-in-time capture done for HTMLVideoElement on each of these interfaces.

Fixes w3c/webcodecs#158.
This came up in the context of https://bugs.chromium.org/p/chromium/issues/detail?id=1144736#c72.

Per spec, removing the src attribute does not release resources, so the best practices section shouldn't suggest doing so. See https://html.spec.whatwg.org/multipage/media.html#location-of-the-media-resource.
zcorpan and others added 25 commits June 3, 2022 16:27
This was introduced in f729a76 but was not implemented in browsers.

Part of whatwg#7867.
* Modernize the definitions and usage of various fields associated with script element, e.g. by removing "scare quotes", changing names from verbose things like "the script's type" to just "type", changing flags to booleans, ensuring initial values are defined, etc. Notable field changes:
    * Rename "the script's script" to "result". This serves as preparation for other specifications, such as import maps, which will expand what that field can contain.  
    * Rename "non-blocking" to "force async" to better communicate its connection to the async="" content attribute and to avoid confusion with the blocking="" content attribute.
* Revamp "the script is ready" into three separate concepts: "delaying the load event", "mark as ready", and "steps to run when the result is ready". Fixes whatwg#5217, in particular making it so that script elements which are never marked as ready (e.g., <script type="foobar">) don't delay the load event indefinitely.
* Un-export "prepare a script". All uses of it in external specs are either monkeypatches or non-normative references.
* Rename "prepare a script" to "prepare the script element" to emphasize it's about the `<script>` element, not about the separate script concept.
* Rewrite the final of "prepare the script element" from a switch into a series of nested if/else blocks, which better communicates how we can land in the various different script element execution modes.
* Rename "execute a script block" to "execute the script element", since "block" is a strange term.
* Various other editorial improvements to those two algorithms.
RFC 9239 resolves the disagreement between WHATWG and IETF w.r.t. the JavaScript MIME type. This patch removes the mention of the previously required willful violation and cleans up the MIME type list, removing any JavaScript MIME types that are now no longer mentioned in the HTML Standard.
f495c02 added some verification to media range responses, but in reality this verification is not present in most implementations. See discussion in whatwg#7655 (comment).
Closes whatwg#7671. Per discussion there, this prefers httpwg.org links and then rfc-editor.org links, since these have reasonable formatting for recent specifications.
Sometimes a navigation causes a BCG swap, e.g. when the cross-origin isolated capability changes. In that case:

* The timestamps should coarsened based on both documents.
* Some user-agents unload in parallel, which should not become part of the new document's timing info.
* Time origin should be according to the new global's time origin, but coarsened by both.

Closes w3c/navigation-timing#169.
Both are already supported by Gecko, and WebKit and Chromium already support nonce.
@domenic
Copy link
Member

domenic commented Jun 6, 2022

I can't really review this now since it contains merge conflicts and 299 commits. Could you try rebasing it, or squashing it, or something similar? Maybe recreating your local branch and force-pushing?

mfreed7 added a commit to mfreed7/html that referenced this pull request Jun 7, 2022
Also imported the input event from the UI events specifications, since that one defines it.

Fixes whatwg#4526

(This PR is directly pulled from whatwg#4530, which can't land due to IP issues.)
(This PR is a replacement for whatwg#6743, which I neglected for too long.)
@mfreed7
Copy link
Contributor Author

mfreed7 commented Jun 7, 2022

I can't really review this now since it contains merge conflicts and 299 commits. Could you try rebasing it, or squashing it, or something similar? Maybe recreating your local branch and force-pushing?

Yikes, sorry about that! It looked good locally but I neglected to double-check it on github.

I've opened a fresh PR with the same content: #7992

@mfreed7 mfreed7 closed this Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impacts documentation Used by documentation communities, such as MDN, to track changes that impact documentation topic: events
Development

Successfully merging this pull request may close these issues.

Add onbeforeinput to GlobalEventHandlers