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

Editorial: use newer method/getter/setter styles #7294

Merged
merged 2 commits into from
Nov 4, 2021
Merged

Editorial: use newer method/getter/setter styles #7294

merged 2 commits into from
Nov 4, 2021

Conversation

domenic
Copy link
Member

@domenic domenic commented Nov 3, 2021

For many (but not all) method/getter/setter definitions, update to use:

  • The defined term "this", instead of "this X object" or "the X object"
  • The "method steps"/"getter steps"/"setter steps" introductory clauses
  • Separate method steps for overloads, calling into a shared algorithm

I had the ambition of removing all "this X object" uses, but some are more complicated and I gave up about 2/3 of the way through, realizing I'd spent too much time on this already. Still, a nice step in the right direction. Searching for this[\s\n]+<code>[^<]+</code>(?![\s\n]+element) now gives 64 matches, mostly OffscreenCanvas, CustomElementRegistry, and ElementInternals.

Most changes here are mechanical but the canvas methods I updated probably need a bit closer review than the rest.


/browsers.html ( diff )
/canvas.html ( diff )
/common-dom-interfaces.html ( diff )
/dynamic-markup-insertion.html ( diff )
/form-elements.html ( diff )
/history.html ( diff )
/imagebitmap-and-animations.html ( diff )
/links.html ( diff )
/media.html ( diff )
/web-messaging.html ( diff )
/window-object.html ( diff )
/workers.html ( diff )

For many (but not all) method/getter/setter definitions, update to use:

* The defined term "this", instead of "this X object" or "the X object"
* The "method steps"/"getter steps"/"setter steps" introductory clauses
* Separate method steps for overloads, calling into a shared algorithm
@domenic domenic added the editorial Changes that do not affect how the standard is understood label Nov 3, 2021
@domenic domenic requested a review from annevk November 3, 2021 20:13
Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

I like it! I added a couple more.

data-x="concept-get-all-indexed">getting the "all"-indexed element</span> from this
<code>HTMLAllCollection</code> given the number represented by <var>nameOrIndex</var>.</p></li>
data-x="concept-get-all-indexed">getting the "all"-indexed element</span> from
<var>collection</var> given the number represented by <var>nameOrIndex</var>.</p></li>
Copy link
Member

Choose a reason for hiding this comment

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

Nice copypasta find here and below!

@domenic
Copy link
Member Author

domenic commented Nov 4, 2021

Hooray! Thanks especially for pushing fixups instead of asking for me to do them, so that we could merge this quickly :)

@domenic domenic merged commit 4aeec51 into main Nov 4, 2021
@domenic domenic deleted the this-style branch November 4, 2021 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editorial Changes that do not affect how the standard is understood
Development

Successfully merging this pull request may close these issues.

2 participants