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

Attribute 'href' may not appear in tag 'use' #8928

Closed
amedina opened this issue Apr 25, 2017 · 3 comments
Closed

Attribute 'href' may not appear in tag 'use' #8928

amedina opened this issue Apr 25, 2017 · 3 comments
Assignees

Comments

@amedina
Copy link
Member

amedina commented Apr 25, 2017

What's the issue?

HTML page with the following content fails to validate:

<div class="wrap">
    <a href="#content" class="menu-scroll-down">
        <svg class="icon icon-arrow-right" aria-hidden="true" role="img">
            <use href="#icon-arrow-right" xlink:href="#icon-arrow-right"></use>
        </svg><span class="screen-reader-text">Scroll down to content</span>
    </a>
</div>

Validation error:
svg-validation-error

Could not find explanation/rationale for validation failure in docs; not sure if it is a bug or a feature.

What browsers are affected?

All browsers

Which AMP version is affected?

AMP Version 1492571781980

@jridgewell
Copy link
Contributor

/to @Gregable

@honeybadgerdontcare
Copy link
Contributor

Thank you for the report. Looks like xlink:href (which is allowed) has been deprecated in favor of just href. We'll update the validation to allow href with local (within document) links where xlink:href is also allowed.

honeybadgerdontcare added a commit that referenced this issue Apr 26, 2017
Per issue #8928, `xlink:href` has been deprecated since SVG2 in favor of `href`.
honeybadgerdontcare added a commit that referenced this issue Apr 26, 2017
* Allow href for all SVG tags that allow xlink:href

Per issue #8928, `xlink:href` has been deprecated since SVG2 in favor of `href`.

* Use alternative_names instead of new attribute

It's unlikely AMP will deprecate xlink:href even though it is deprecated in SVG. Because of that we don't need to have it as a separate attribute spec and instead use alternative_names on xlink:href.
@honeybadgerdontcare
Copy link
Contributor

This is checked in but it'll take up to 2 weeks to reach production.

mrjoro pushed a commit to mrjoro/amphtml that referenced this issue Apr 28, 2017
* Allow href for all SVG tags that allow xlink:href

Per issue ampproject#8928, `xlink:href` has been deprecated since SVG2 in favor of `href`.

* Use alternative_names instead of new attribute

It's unlikely AMP will deprecate xlink:href even though it is deprecated in SVG. Because of that we don't need to have it as a separate attribute spec and instead use alternative_names on xlink:href.
KenneyE pushed a commit to spotxchange/amphtml that referenced this issue May 3, 2017
* Allow href for all SVG tags that allow xlink:href

Per issue ampproject#8928, `xlink:href` has been deprecated since SVG2 in favor of `href`.

* Use alternative_names instead of new attribute

It's unlikely AMP will deprecate xlink:href even though it is deprecated in SVG. Because of that we don't need to have it as a separate attribute spec and instead use alternative_names on xlink:href.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants