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

Remove HTMLAreaElement.hreflang and .type #232

Closed
foolip opened this issue Oct 6, 2015 · 49 comments
Closed

Remove HTMLAreaElement.hreflang and .type #232

foolip opened this issue Oct 6, 2015 · 49 comments
Assignees
Labels
removal/deprecation Removing or deprecating a feature

Comments

@foolip
Copy link
Member

foolip commented Oct 6, 2015

There's a review to add HTMLAreaElement.hreflang in Blink:
https://codereview.chromium.org/1381913002/

However, it doesn't look like the hreflang attribute is actually used internally, and no other engine exposes the HTMLAreaElement.hreflang attribute, while HTMLAnchorElement.hreflang appears to be universally supported.

The situation is the same with HTMLAreaElement.type.

@annevk
Copy link
Member

annevk commented Oct 6, 2015

I tend to think we should either keep them on both, or obsolete them on <a>. I don't like the muddy middle ground.

@foolip
Copy link
Member Author

foolip commented Oct 6, 2015

If you mean merely moving them to the obsolete section, then that sounds fine to me, but trying to remove things already shipping on HTMLAnchorElement doesn't seem worthwhile.

@foolip
Copy link
Member Author

foolip commented Oct 6, 2015

I'd be interested to know if the hreflang or type content attributes have any effect in any browser. It's not super grep-friendly, but I can't find anything in Blink.

@zcorpan
Copy link
Member

zcorpan commented Oct 6, 2015

My understanding is that these don't do anything on a/area, they just exist as a styling hook or for other tools.

@foolip
Copy link
Member Author

foolip commented Oct 6, 2015

I see that HTMLLinkElement also has hreflang and type. If we obsolete these IDL attributes, should the content attributes remain valid?

@annevk
Copy link
Member

annevk commented Oct 6, 2015

Technically user agents were supposed to create all kinds of cool UI around these attributes, but they didn't. So I would say that the content attributes should also move. However, link might have processing requirements related to type.

@foolip
Copy link
Member Author

foolip commented Oct 6, 2015

Right, for the link element it looks like type="application/opensearchdescription+xml" has special behavior in Blink.

@annevk
Copy link
Member

annevk commented Oct 6, 2015

Yeah, so my tentative proposal would be that we obsolete hreflang on all three, and type on a and area. We'd need to raise that on the list though.

@foolip
Copy link
Member Author

foolip commented Oct 6, 2015

Do you think we should make them obsolete but conforming, or non-conforming?

@annevk
Copy link
Member

annevk commented Oct 6, 2015

I'm not sure. They are useless since there's no support. But we might not want to annoy folks that have added them anyway with validator messages.

@zcorpan
Copy link
Member

zcorpan commented Oct 6, 2015

I see 14,347 instances of hreflang on link/a/area in webdevdata.org data set 2015-01-08 (780 Mb) 87,000 pages.

1,161 instances of type on a/area.

I don't think we should obsolete these, that seems like wasting authors' time, similarly to obsoleting <samp> would (which is less common, 175 instances). Implementing the missing IDL attribute is relatively low cost, isn't it?

@foolip
Copy link
Member Author

foolip commented Oct 6, 2015

It's very low cost, by why must we have the IDL attributes just because we can't emit validator warnings?

@annevk
Copy link
Member

annevk commented Oct 6, 2015

@zcorpan what is wrong with obsolete but conforming? They don't anything useful after all.

@zcorpan
Copy link
Member

zcorpan commented Oct 6, 2015

Things in the spec are obsolete but conforming because we want the validator to issue warning (but not error). I don't think that is good here. Saying that it is obsolete but conforming but validators shouldn't whine about it, either, seems confusing. How do you explain samp being conforming but hreflang obsolete when the latter is almost two orders of magnitude more common?

The IDL attributes should be there for consistency; I consider it a bugfix from HTML4.

@zcorpan
Copy link
Member

zcorpan commented Oct 6, 2015

cc @sideshowbarker

@annevk
Copy link
Member

annevk commented Oct 6, 2015

Maybe we should drop samp too. There's really not much point in explaining and promoting features that bring no benefit when used.

@domenic
Copy link
Member

domenic commented Oct 6, 2015

Does the spec always have IDL attributes corresponding to valid content attributes? I guess since we removed the microdata API that's no longer strictly true, right? Are there other cases?

@domenic domenic added the removal/deprecation Removing or deprecating a feature label Oct 6, 2015
@annevk
Copy link
Member

annevk commented Oct 7, 2015

ARIA and manifest="".

@zcorpan
Copy link
Member

zcorpan commented Oct 7, 2015

Also charset on meta. But in general there are IDL attributes for content attributes.

We could remove the not-implemented IDL attributes from the spec but still leave the attributes as conforming, saying that this is a historical quirk and you have to use setAttribute for these (although personally I would prefer to have the IDL attributes implemented, since people use these attributes).

@annevk
Copy link
Member

annevk commented Oct 7, 2015

I still think we should also dissuade folks from the notion that they might be useful. Obsolete, but conforming seems fine. The validator can simply opt not to show a warning for them since they're harmless.

@foolip
Copy link
Member Author

foolip commented Oct 7, 2015

Given that these are currently interoperably non-implemented, I don't think going through a period of many years where some browsers have the reflected IDL attributes and others don't would be worthwhile. A "all conforming content attributes should be reflected" design rule doesn't seem important enough to me, at least.

I think the "obsolete but conforming" category seems fine, so that we continue to say "all conforming content attributes should be reflected".

@domenic
Copy link
Member

domenic commented Oct 7, 2015

I'm OK with removing the IDL attribute since there's precedent. But there are a lot of attributes that don't do anything useful according to user agents, but are useful hooks for scripts, styles, or other parts of the ecosystem. (E.g. microdata, cite attribute, datetime attribute, ...) I don't see any reason to mark this as obsolete.

foolip added a commit that referenced this issue Oct 7, 2015
The content attributes are left as conforming, the IDL attributes are
removed simply because they are not implemented, and implementing them
would not be particularly worthwhile, while temporarily decreasing
interoperability until all browsers have implemented them.

Fixes #232
@foolip
Copy link
Member Author

foolip commented Oct 7, 2015

OK, I've submitted a pull request that merely removes the IDL attributes. Does there need to be an explanation of why the IDL attributes are missing?

Note that the spec still says "The rel, hreflang, and type attributes may be used to indicate to the user the likely nature of the target resource before the user follows the link" for both the a and area element.

foolip added a commit that referenced this issue Oct 7, 2015
The content attributes are left as conforming, the IDL attributes are
removed simply because they are not implemented, and implementing them
would not be particularly worthwhile, while temporarily decreasing
interoperability until all browsers have implemented them.

Fixes #232
foolip added a commit that referenced this issue Oct 7, 2015
The content attributes are left as conforming, the IDL attributes are
removed simply because they are not implemented, and implementing them
would not be particularly worthwhile, while temporarily decreasing
interoperability until all browsers have implemented them.

Fixes #232
@annevk
Copy link
Member

annevk commented Oct 8, 2015

@domenic I guess I did not articulate things carefully enough. The precedent for missing IDL attributes all were carefully considered. None of them were omitted due to not being implemented (in fact, Chrome at some point supported <html>.manifest). They were omitted because that would not make sense, .e.g., manipulating <html>.manifest or <meta>.charset has no meaningful effect.

What we have now does not make sense and has created a logical inconsistency.

@foolip
Copy link
Member Author

foolip commented Oct 8, 2015

OK, so the outrage of making these non-conforming would probably be very small. @annevk, does that sounds OK, or do you have some other preference?

@annevk
Copy link
Member

annevk commented Oct 9, 2015

It still seems weird to have our hyperlink elements diverged again, but it seems somewhat better than the new status quo.

@foolip
Copy link
Member Author

foolip commented Oct 16, 2015

I basically think that all options are better than having implementations diverge by fiddling with attributes that don't actually do anything at all.

Proposal:

This would put hreflang and type in the same category as the charset and name attributes for a.

Objections?

@sideshowbarker
Copy link
Contributor

Proposal:

Also remove the hreflang and type content attributes for area, accepting some very small amount of validator warnings for this.
Make hreflang and type on a obsolete but conforming, moving the HTMLAnchorElement.hreflang and type IDL attributes to https://html.spec.whatwg.org/#other-elements,-attributes-and-apis
This would put hreflang and type in the same category as the charset and name attributes for a.

Objections?

No objections from me. All sounds reasonable

@zcorpan
Copy link
Member

zcorpan commented Oct 19, 2015

This would put hreflang and type in the same category as the charset and name attributes for a.

Not quite; charset is obsolete on both a and link.

I see 2,565 hreflang on a in webdevdata. 3 charset on a. 36,150 name on a.

I think I would prefer to make hreflang and type obsolete for only area, and leave them conforming for a and link. The motivation is that there is usage for a and link and there is no harm for those. This also aligns the conformingness to which IDL attributes are implemented, and happens to match what was conforming in HTML4.

@annevk
Copy link
Member

annevk commented Oct 19, 2015

You don't think consistency between a and area is more important than between a and link? I guess it's messy either way.

@zcorpan
Copy link
Member

zcorpan commented Oct 19, 2015

I think it is, but that is not the only consideration, and I think it is less important than making people spend time thinking about what they should do about their hreflangs if we make it obsolete (or if they should stop caring about validation).

@foolip
Copy link
Member Author

foolip commented Oct 19, 2015

My suggestion was "Make hreflang and type on a obsolete but conforming" so that shouldn't change anything about validation. Only the content attributes on area would be affected, and it doesn't seem like there's very much of that out there.

@zcorpan
Copy link
Member

zcorpan commented Oct 19, 2015

Currently things are obsolete but conforming because we want validators to give a warning (but not an error). I want no message for a hreflang, which in my view maps to conforming. Making things be obsolete but conforming but not give a validator message is imo more confusing, and I don't see much benefit.

@foolip
Copy link
Member Author

foolip commented Oct 20, 2015

OK, I just didn't read past the heading of "Obsolete but conforming features", the first paragraph says "Features listed in this section will trigger warnings in conformance checkers."

I guess we don't have a category of things that are useless and harmless. Unless we introduce such a category, we have to chose between two different forms of inconsistency:

I'm really fine either way, or perhaps there are other options. If anyone feels strongly, please make a very concrete suggestion :)

@zcorpan
Copy link
Member

zcorpan commented Oct 20, 2015

Yes. I'm also fine with either of those. @annevk you didn't like the current spec text, are you OK with the other option?

@annevk
Copy link
Member

annevk commented Oct 20, 2015

I'm happier with the second option. To have a and area diverge. Perhaps we should consider not making "Obsolete but conforming" trigger warnings though, if we're so afraid of warnings.

@zcorpan
Copy link
Member

zcorpan commented Oct 20, 2015

I don't mind warnings for things where it is useful to make people think about changing their markup, e.g. change <a name> to id (<a name> is a lot more common than <a hreflang> still), but I think commonly used useless and harmless things don't belong there.

@annevk
Copy link
Member

annevk commented Oct 20, 2015

<a name> is harmless in much the same way. Folks might know about id and just not want to bother updating legacy content.

@sideshowbarker
Copy link
Contributor

For the record here (I know this issue is resolved now), in implementing warnings in the Nu HTML Checker, I take statements about warnings in the spec to be somewhat advisory (I think we currently implement most of the ones it defines, though not all), so there is room for a gray area here with regard to whether or not to emit warnings for particular cases. And incidentally as I’ve noted in other places, we also emit some warnings that are not necessarily directly associated with any specific requirements in the spec. So the warning-level messages from the checker are already somewhat discretionary in practice, and we can avoid emitting warnings for particular obsolete-but-conforming cases if the prevailing agreement is that’s what we should be doing.

@foolip
Copy link
Member Author

foolip commented Oct 21, 2015

@sideshowbarker, does that mean that you would support making hreflang and type on a obsolete but conforming, while not emitting any warnings for them? If so, maybe we should also s/will/can potentially/ in "Features listed in this section will trigger warnings in conformance checkers."

@sideshowbarker
Copy link
Contributor

@sideshowbarker, does that mean that you would support making hreflang and type on a obsolete but conforming, while not emitting any warnings for them?

Yes, if that's what you and @zcorpan and @annevk and @domenic think would be the best way to deal with it.

If so, maybe we should also s/will/can potentially/ in "Features listed in this section will trigger warnings in conformance checkers."

Yes, some wording refinement like that would be appropriate, I think.

@zcorpan
Copy link
Member

zcorpan commented Oct 28, 2015

I'm a bit confused about what the goal of that section would be if not to trigger warnings in validators. Is it to avoid having people who write tutorials include the feature? Something else?

@foolip
Copy link
Member Author

foolip commented Oct 28, 2015

The point would be to hide useless features from view, much like the things in https://html.spec.whatwg.org/#Document-partial

@prlbr
Copy link

prlbr commented Oct 28, 2015

I see that the issue is closed and hreflang has fortunately not been removed from the link element. So just for the record: It is not useless! While browser may not make use of these attributes, Google and possibly other search engines "use the rel='alternate' hreflang='x' attributes to serve the correct language or regional URL in search results".

https://support.google.com/webmasters/answer/189077?hl=en

@zcorpan
Copy link
Member

zcorpan commented Oct 29, 2015

Yeah, I don't think it has been suggested to obsolete it for link in particular. If search engines do something for <a hreflang>, that would be interesting to this discussion. It look like from the link above like it's just <link hreflang>.

nathaneliason pushed a commit to nathaneliason/html that referenced this issue Jun 16, 2022
nathaneliason pushed a commit to nathaneliason/html that referenced this issue Jun 16, 2022
nathaneliason pushed a commit to nathaneliason/html that referenced this issue Jun 16, 2022
Part of whatwg#232.

This also fixes an issue where the Docker build would always used the cached Docker container for Wattsi, so updating $WATTSI_LATEST would cause any further Docker builds to warn that Wattsi was out of date. Now it uses the one based on the $WATTSI_LATEST variable.
nathaneliason pushed a commit to nathaneliason/html that referenced this issue Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
removal/deprecation Removing or deprecating a feature
Development

No branches or pull requests

6 participants