Skip to content
Merged
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
34 changes: 34 additions & 0 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ <h3>Elements and attributes</h3>
<dfn>Unknown MathML element</dfn>.
</p>
<ol>
<li>[^a^]</li>
<li>[^annotation^]</li>
<li>[^annotation-xml^]</li>
<li>[^maction^]</li>
Expand Down Expand Up @@ -4658,6 +4659,39 @@ <h4>Entry in Table or Matrix <code>&lt;mtd&gt;</code></h4>
</p>
</section>
</section>
<section id="the-a-element">
<h3>Linking <code>&lt;a&gt;</code></h3>
<p>
The
<dfn class="element">a</dfn>
element is used to group together any number of sub-expressions equivalently
to [^mrow^]. It's main purpose is to enable the specification fo hyperlinks
via the use of the <code>href</code> attribute.
</p>
<p>
The <code>&lt;a&gt;</code> element accepts the attributes described
in <a href="#global-attributes"></a> as well as the all the attributes of the
<a href="https://html.spec.whatwg.org/#the-a-element">corresponding element in HTML</a>.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't know yet if we want to support all the attributes or just href. I wonder what SVG is doing?

Maybe we should check existing implementations and ask browser vendors for feedback here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

SVG lists the attributes explicltly but is I think all of them https://svgwg.org/svg2-draft/linking.html#AElement, so ping, download etc not just href

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In practice SVG support isn't quite what is specified just as an fyi.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

relevant discussion whatwg/html#12063

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think regardless of that some IDL would be useful. For example, HTML A and Area elements when you call .toString() returns the href value. SVG does not have this, so it would be good to define if that behaviour is wanted.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yeah, I think no... I want to hear some reasoning but it seems weirdly esoteric... It would be not great if relevant parts of math turned into URLs.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The main requirement here is for linking in MathML. Using <a> and adopting the properties of HTML a are more about trying to better integrate MathML into the web platform, so whatever makes the most sense from an implementation perspective would I think be fine. Agreed it needs to be specified but I think changes from HTML a are fine if they don't cause implementation issues

The primary additional attribute is [^a/href^].
</p>
<ul id="a-attributes">
<li>[^a/href^]</li>
</ul>
<p>
If the
<dfn data-dfn-for="a" class="element-attr">href</dfn>
attribute is used then the <code>&lt;a&gt;</code> element creates a hyperlink
to the URL specified by the <code>href</code> attribute. The linking behavior
is as described for the <code>a</code> element in HTML.
</p>

<p> The layout algorithm of the <code>&lt;a&gt;</code> element
is the same as the <code>&lt;mrow&gt;</code> element.</p>

<div class="note">
Note that this means that in the absence of an <code>href</code> attribute,
Comment thread
davidcarlisle marked this conversation as resolved.
<code>&lt;a&gt;</code> may be seen as equivalent to <code>&lt;mrow&gt;</code>.</div>
</section>
<section id="enlivening-expressions">
<h3>Enlivening Expressions</h3>
<p>
Expand Down