-
Notifications
You must be signed in to change notification settings - Fork 66
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
Rule update: "HTML page has a title" #440
Merged
Merged
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e0dcf6e
Rule update: "HTML page has a title"
7bc0188
linking to definition of "root"
2392288
Removed Technique G88 (descriptive titles)
fbe4e5d
Non-letter/numbers characters is a Pass
7477ebd
[root] element --> [document element] + fix typos
075c398
Expectation updated to match Applicability
5c97c95
[text nodes] --> [child text content]
8942285
Added link to definition
97f2af5
[seperator characters] --> [whitespace]
d3f291c
Update SC2-4-2-page-has-title.md
2f5a9c8
Update SC2-4-2-page-has-title.md
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we simplify this a little by doing:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WilcoFiers, we don't find your suggestion to be as unambiguous as we would like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which part of it? Alternative proposal:
Text content is what the HTML 5.2 spec says needs to be used to derive the document title from the title element, so it's the right technical term, and it reads better than "text nodes" IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HTML defines "child text content" as a term (https://www.w3.org/TR/html/infrastructure.html#child-text-content), not "text content". In general, I don't really think it's appropriate to refer do DOM attributes in the manner proposed, e.g. use "text content" to mean
node.textContent
or "document title" to meandocument.title
. If referring to DOM attributes or properties, be explicit about it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point. But then shouldn't this simply be using
document.title
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it should; that's an implementation detail and rules shouldn't dictate the "how" but rather the "what". The "what", in this case, is the concatenation of the data of the text nodes that are children of the
<title>
element, i.e. the "child text content". The "how" could bedocument.title
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mean to say to literally access the document.title property. You're right, that's clearly implementation. I mean using "document title", linking to the algorithm for deriving it, the same way we talk about "accessible name" and referencing that algorithm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes perfect sense and for that very same reason I'd also suggest using the term "child text content" similar to how we use the term "accessible name". We could even add "document title" to the glossary and define it as "the child text content of the first
<title>
element that is a descendant of the document".