-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Centralize checks for <a>, <area>, <form>, and <link> #2613
Conversation
6f5078f
to
3becdd1
Compare
Follow-up test for whatwg/html#2613.
Sigh. This is wrong, because we'd also have to add the check to "download the hyperlink". The whole setup seems rather broken though. |
And with broken I mean that "download the hyperlink" shouldn't have to do its own URL processing and such. |
3becdd1
to
5cd556f
Compare
I updated the commit to address #2615 per how I think it should be addressed and also addressed my own review feedback above. I will also update the three test PRs to align with the proposed change. |
5cd556f
to
475c12a
Compare
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.
LGTM with nit, but we'll mark "do not merge yet" pending compat analysis in #2615.
source
Outdated
</ol> | ||
<!-- c.f. <link> and <a>'s similar section --> | ||
<p>The <span>activation behavior</span> of <code>area</code> elements is to <span | ||
data-x="following hyperlinks">Follow the hyperlink</span> or <span data-x="downloading |
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.
Nit: lowercase "follow"
Require that they are all connected to a document that is fully active. There is enough difference between implementations that this appears to be web compatible. Tests: * web-platform-tests/wpt#5758 * web-platform-tests/wpt#5759 * web-platform-tests/wpt#5761 Fixes #2615.
475c12a
to
dd32b3d
Compare
Follow-up test for whatwg/html#2613.
source
Outdated
<li><p>If <var>continue</var> is false, then abort these steps. | ||
<li><p>If <var>continue</var> is false, then return.</p></li> | ||
|
||
<li><p>If <var>form</var> <span>cannot navigate</span>, then return.</p></li> |
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.
Should we expand the HTML comment here into a visible note?
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 guess we could.
@@ -22935,11 +22922,23 @@ interface <dfn>HTMLHyperlinkElementUtils</dfn> { | |||
|
|||
<h4>Following hyperlinks</h4> | |||
|
|||
<p>An element <var>element</var> <dfn>cannot navigate</dfn> if one of the following is true:</p> |
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.
This section is full of double negatives ("an element cannot navigate if it's node document is not fully active"), but I think it's pretty nice at the call sites, so I'm not sure what to do. I guess you could define "can navigate" and then say "cannot navigate = the negation of can navigate".
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'd rather just leave it as-is unless we get more complaints. Or until we turn everything into abstract operations, if ever.
@@ -22935,11 +22922,23 @@ interface <dfn>HTMLHyperlinkElementUtils</dfn> { | |||
|
|||
<h4>Following hyperlinks</h4> | |||
|
|||
<p>An element <var>element</var> <dfn>cannot navigate</dfn> if one of the following is true:</p> |
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.
FYI https://english.stackexchange.com/questions/204006/cannot-vs-can-not since my brain momentarily started thinking "cannot" is weird. (TLDR: it's correct.)
Can we also get tests for both locations in the form algorithm? |
Made the note visible. |
Updated tests too. |
Updated tests are at web-platform-tests/wpt#5759 and web-platform-tests/wpt#5761 btw. |
Follow-up tests for whatwg/html#2613.
Follow-up tests for whatwg/html#2613.
Follow-up tests for whatwg/html#2613.
Tests: web-platform-tests/wpt#5758.