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

Write "represents" guideline for HTML elements #1521

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,15 @@ Avoid, especially with gerunds.
For example, prefer the "The feature writes to…" over "The feature provides writing to…."
([#727](https://github.com/web-platform-dx/web-features/pull/727#discussion_r1537635491))

##### represents

If an HTML element or other type doesn't obviously do anything, then it probably _represents_ something.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd really like to see a Good/Bad example here. I'm still struggling with this one a bunch, and having a couple of examples would help a lot.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's hard to think of bad examples, rather I'd treat "represents" as a default for HTML elements which we diverge from when we think some other verb is clearer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, @foolip captured my meaning here, as using it as a default. That said, I was able to come up with some examples, so I added them. This necessitated some edits to actual descriptions, of course.

Use _represents_ as a default for describing the behavior of HTML elements when no more specific verb makes sense.

- 👍 Recommended: The `<html>` element represents the top level of an HTML document…
- 👍 Recommended: The `<br>` element breaks lines in text.
- 👎 Not recommended: The `<br>` element represents a line break in text.

Comment on lines +186 to +191
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New elaboration on the "represents" guidance

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure I would have used "represents" for the <html> example either...

Thinking how it would compare to <math> and <svg>. Maybe something like:

  • The <html> element is the top level container for documents and iFrames and is referred to as the root element.
  • The <math> element is the top level MathML container, used to write a single mathematical formula.
  • The <svg> element is the top level SVG container, used in SVG files or for SVG fragments inside an SVG or HTML document.

##### sets

Prefer this over multisyllabic alternatives, such as "defines", "determines", or "specifies".
Expand Down
2 changes: 1 addition & 1 deletion features/br.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: <br>
description: The `<br>` element produces line breaks in text.
description: The `<br>` element breaks lines in text.
spec: https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-br-element
group: html-elements
compat_features:
Expand Down
2 changes: 1 addition & 1 deletion features/html.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: <html>
description: The `<html>` element represents the top-level of an HTML document and is referred to as the root element.
description: The `<html>` element represents the top level of an HTML document and is referred to as the root element.
spec: https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
group: html-elements
compat_features:
Expand Down