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

Set dfn types; switch to (Bikeshed) short syntax #5916

Merged
merged 5 commits into from
Sep 15, 2020

Conversation

sideshowbarker
Copy link
Contributor

@sideshowbarker sideshowbarker commented Sep 15, 2020

This change sets dfn type attributes on a large number of dfn elements throughout the spec — generated using a specialized definitions parser for the HTML spec built to improve on the existing scraping done in Shepherd.

This particular patch doesn’t set all the potential dfn types that could be set; instead it only sets those that were easiest to determine (those where the data-x attribute and dfn start tag occur on the same line).

The setting of dfn type attributes and for attributes is based on the corresponding WebIDL defined in the spec.

Note that this change also switches the spec to using the Bikeshed short syntax for the attribute names; specifically:

  • rather than using data-dfn-type=element, etc., attribute names, it uses attributes literally named element, etc.

  • rather than the attribute name data-dfn-for it uses an attribute literally named for

  • replaces all data-export="" and data-noexport="" attributes with value-less attributes literally named export and noexport

Additionally, the change drops export from any dfn that has a dfn type attribute.


/browsers.html ( diff )
/browsing-the-web.html ( diff )
/canvas.html ( diff )
/common-microsyntaxes.html ( diff )
/custom-elements.html ( diff )
/dnd.html ( diff )
/dom.html ( diff )
/dynamic-markup-insertion.html ( diff )
/edits.html ( diff )
/embedded-content-other.html ( diff )
/embedded-content.html ( diff )
/form-control-infrastructure.html ( diff )
/form-elements.html ( diff )
/forms.html ( diff )
/grouping-content.html ( diff )
/history.html ( diff )
/iana.html ( diff )
/iframe-embed-object.html ( diff )
/image-maps.html ( diff )
/index.html ( diff )
/indices.html ( diff )
/infrastructure.html ( diff )
/input.html ( diff )
/interaction.html ( diff )
/interactive-elements.html ( diff )
/links.html ( diff )
/media.html ( diff )
/microdata.html ( diff )
/obsolete.html ( diff )
/offline.html ( diff )
/origin.html ( diff )
/parsing.html ( diff )
/rendering.html ( diff )
/scripting.html ( diff )
/semantics-other.html ( diff )
/semantics.html ( diff )
/server-sent-events.html ( diff )
/structured-data.html ( diff )
/system-state.html ( diff )
/tables.html ( diff )
/text-level-semantics.html ( diff )
/timers-and-user-prompts.html ( diff )
/urls-and-fetching.html ( diff )
/webappapis.html ( diff )
/window-object.html ( diff )
/workers.html ( diff )
/xhtml.html ( diff )

This change sets dfn type attributes on a large number of dfn elements
throughout the spec — generated using a specialized definitions parser for
the HTML spec built to improve on the existing scraping done in Shepherd.

This particular patch doesn’t set all the potential dfn types that could
be set; instead it only sets those that were easiest to determine (those
where the data-x attribute and dfn start tag occur on the same line).

The setting of dfn type attributes and “for” attributes is based on the
corresponding WebIDL defined in the spec.

Note that this change also switches the spec to using the Bikeshed short
syntax for the attribute names; specifically:

* rather than using data-dfn-type=element, etc., attribute names, it
  uses attributes literally named "element", etc.

* rather than the attribute name data-dfn-for it uses an attribute
  literally named "for"

* replaces all data-export="" and data-noexport="" attributes with
  value-less attributes literally named "export" and "noexport"

Additionally, the change drops "export" from any dfn that has a dfn type
attribute.
@domenic
Copy link
Member

domenic commented Sep 15, 2020

Remaining errors after latest push and whatwg/wattsi#136:

"file:/mnt/c/Users/Domenic/Dropbox/GitHub/whatwg/html-build/output/404.html":1.16-2.35: info warning: Consider adding a “lang” attribute to the “html” start tag to declare the language of this document.
"file:/mnt/c/Users/Domenic/Dropbox/GitHub/whatwg/html-build/output/demos/offline/clock/clock2.html":2.16-3.42: info warning: The manifest-based application cache feature is obsolete. Consider using service workers instead.
"file:/mnt/c/Users/Domenic/Dropbox/GitHub/whatwg/html-build/output/index.html":1702.1501-1702.1517: error: Attribute “noexport” not allowed on element “div” at this point.
"file:/mnt/c/Users/Domenic/Dropbox/GitHub/whatwg/html-build/output/index.html":9613.8-9613.67: error: Attribute “dfn” not allowed on element “dfn” at this point.
"file:/mnt/c/Users/Domenic/Dropbox/GitHub/whatwg/html-build/output/index.html":41436.270-41436.320: error: Attribute “dfn” not allowed on element “dfn” at this point.
"file:/mnt/c/Users/Domenic/Dropbox/GitHub/whatwg/html-build/output/index.html":55233.1698-55233.1792: error: Attribute “operation” not allowed on element “dfn” at this point.
"file:/mnt/c/Users/Domenic/Dropbox/GitHub/whatwg/html-build/output/index.html":63213.3-63213.82: error: Attribute “dfn” not allowed on element “h5” at this point.
"file:/mnt/c/Users/Domenic/Dropbox/GitHub/whatwg/html-build/output/index.html":63529.15-63529.58: error: Attribute “dfn” not allowed on element “dfn” at this point.
"file:/mnt/c/Users/Domenic/Dropbox/GitHub/whatwg/html-build/output/index.html":68667.3-68667.45: error: Attribute “dfn” not allowed on element “h2” at this point.
"file:/mnt/c/Users/Domenic/Dropbox/GitHub/whatwg/html-build/output/index.html":69686.3-69686.55: error: Attribute “dfn” not allowed on element “h5” at this point.
"file:/mnt/c/Users/Domenic/Dropbox/GitHub/whatwg/html-build/output/index.html":69972.125-69972.200: error: Attribute “dfn” not allowed on element “dfn” at this point.

@domenic
Copy link
Member

domenic commented Sep 15, 2020

The dfn type probably just needs to be translated. (And maybe we should add an error if you use it on <dfn>; it only makes sense on <hN>.) Per https://tabatkins.github.io/bikeshed/#dfn-contract it seems reasonable.

The noexport on <div> is trickier. Is it OK to just translate that to data-noexport? Or is it supposed to flow into all the descendant <dfn>s? The latter would be a pain.

domenic added a commit to whatwg/wattsi that referenced this pull request Sep 15, 2020
This reverts commit 7e4d1e8
temporarily, as it breaks building the HTML Standard on master. When
whatwg/html#5916 is finished and merged, then we
can add this check back.
domenic added a commit to whatwg/wattsi that referenced this pull request Sep 15, 2020
This reverts commit 7e4d1e8
temporarily, as it breaks building the HTML Standard on master. When
whatwg/html#5916 is finished and merged, then we
can add this check back.
These were previously done as data-dfn-type="dfn" to override the heuristic the scraper was using, where something starting with "dom-" would be treated as an IDL construct. Now we can mark them up explicitly.
It was using "operation" instead of "method", and had a wrong lt="".
Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

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

Woohoo, build passes!

@domenic domenic merged commit 739d472 into master Sep 15, 2020
@domenic domenic deleted the sideshowbarker/set-dfn-types-and-use-short-syntax branch September 15, 2020 17:17
dontcallmedom added a commit to dontcallmedom/html that referenced this pull request Sep 29, 2020
Follow up to whatwg#5694 whatwg#5916 setting dfn types on more items identified by reffy
dontcallmedom added a commit to dontcallmedom/html that referenced this pull request Sep 29, 2020
Follow up to whatwg#5694 whatwg#5916 whatwg#5956 setting dfn types on items defined in IDL fragments
sideshowbarker pushed a commit to dontcallmedom/html that referenced this pull request Feb 5, 2021
Follow up to whatwg#5694 whatwg#5916 setting dfn types on more items identified by reffy
sideshowbarker added a commit that referenced this pull request Feb 5, 2021
Follow-up to:

* #5694
* #5916

...setting dfn types on more items identified by reffy
domenic pushed a commit that referenced this pull request Feb 5, 2021
A follow-up to:

* #5694
* #5916
imhele added a commit to imhele/html that referenced this pull request Feb 18, 2021
* Editorial: remove redundant "the"

* Meta: default branch rename

Also correct a broken link. Not even w3.org URLs are that cool.

Helps with whatwg/meta#174.

* Editorial: clean up calls to "parse a URL"

It actually takes a string, so calls should be clear about that.

* Review Draft Publication: January 2021

* Simplify <link>s

In particular, remove their activation behavior, stop them from matching
:link and :visited, and stop suggesting that they be focusable areas.

This also includes a slight expansion and rearrangement of the link
element's section to make it clearer what hyperlinks created by <link>
are meant for, contrasting them to <a> and <area> hyperlinks.

Closes whatwg#4831. Closes whatwg#2617. Helps with whatwg#5490.

* Meta: remove demos/offline/* (whatwg#6307)

These are no longer needed as of e4330d5.

* Meta: minor references cleanup

Use more HTTPS and drop obsolete HTML Differences reference.

* Editorial: anticlockwise → counterclockwise

We use en-US these days. Spotted in https://twitter.com/iso2022jp/status/1352601086519955456.

* Use :focus-visible in the UA stylesheet

See w3c/csswg-drafts#4278.

* Editorial: align with WebIDL and Infra

* Fix "update a style block" early return

The new version matches implementation reality and CSSWG resolution.

The algorithm was also inconsistent, as it looked at whether
the element was in a shadow tree or in the document tree, but it was
only specified to be re-run if the element becomes connected or
disconnected.

The CSSWG discussed this in
w3c/csswg-drafts#3096 (comment)
and http://wpt.live/shadow-dom/ShadowRoot-interface.html tests this.

This also matches closer the definition of <link rel="stylesheet">,
which does use connectedness (though it uses "browsing-context
connected", which is a bit different):
https://html.spec.whatwg.org/#link-type-stylesheet

* Modernize and refactor simple dialogs

This contains a small bug fix, in that confirm() and prompt() said
"return" in some cases instead of "return false" or "return null" as
appropriate.

Other notable changes, all editorial, are:

* Factoring out repeated "cannot show simple dialogs" steps, which will
  likely expand over time (see e.g. whatwg#6297).
* Separating out and explaining the no-argument overload of alert().
* Passing the document through to the "printing steps", instead of just
  having them talk about "this Window object".

* Meta: add definition markup for MessageEvent

* Remove <marquee> events

They are only supported by one engine (Gecko).

Closes whatwg#2957.

* Clarify when microtasks happen

* Ignore COEP on non-secure contexts

Fixes whatwg#6328.

* Editorial: update URL Standard integration

* Editorial: only invoke response's location URL once

Complements whatwg/fetch#1149.

* Track the incumbent settings and active script in Promise callbacks

Closes whatwg#5213.

* createImageBitmap(): stop clipping sourceRect to source's dimensions

It has been found in whatwg#6306 that this was an oversight at the time of its introduction. Current behavior goes against author expectations and no implementer has opposed the change to "no-clip".

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

Closes whatwg#6306.

* Remove CSP plugin-types blocking

With Flash not being supported anymore, the CSP directive plugin-types has lost its main reason for being and is being removed from the Content Security Policy specification: w3c/webappsec-csp#456.

This change removes references to the relevant algorithm from the Content Security Policy spec.

* Meta: set more dfn types

A follow-up to:

* whatwg#5694
* whatwg#5916

* Editorial: occuring → occurring

* Make all plugin-related APIs no-ops

Part of whatwg#6003.

* Disallow simple dialogs from different-origin domain iframes

Closes whatwg#5407.

* Revive @@iterator for PluginArray/MimeTypeArray/Plugin

@@iterator is implicitly installed by defining an indexed property getter. Since there is no other way to define it exclusively, this restores some methods back to being indexed getters.

This fixes an inadvertent observable behavior change in d4f07b8.

* Adjust web+ scheme security considerations to account for FTP removal

Also, network scheme is now reduced to HTTP(S) scheme.

Helps with whatwg#5375, but form submission issue remains.

See whatwg/fetch#1166 for context.

* Meta: export pause

Nobody but XMLHttpRequest take a dependency on this please. You have been warned.

Context: whatwg/xhr#311.

* Fix typo: ancestor → accessor

Fixes whatwg#6374.

Co-authored-by: Dominic Farolino <domfarolino@gmail.com>
Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
Co-authored-by: Domenic Denicola <d@domenic.me>
Co-authored-by: Emilio Cobos Álvarez <emilio@crisal.io>
Co-authored-by: Momdo Nakamura <xmomdo@gmail.com>
Co-authored-by: Jake Archibald <jaffathecake@gmail.com>
Co-authored-by: Yutaka Hirano <yhirano@chromium.org>
Co-authored-by: Shu-yu Guo <syg@chromium.org>
Co-authored-by: Kaiido <tristan.fraipont@gmail.com>
Co-authored-by: Antonio Sartori <anton.sartori@gmail.com>
Co-authored-by: Michael[tm] Smith <mike@w3.org>
Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
Co-authored-by: Carlos IL <carlosjoan91@gmail.com>
Co-authored-by: Kagami Sascha Rosylight <saschanaz@outlook.com>
Co-authored-by: Simon Pieters <zcorpan@gmail.com>
dontcallmedom added a commit to dontcallmedom/html that referenced this pull request Jun 8, 2021
Follow up to whatwg#5694 whatwg#5916 whatwg#5956 setting dfn types on items defined in IDL fragments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants