- From: Eric Eggert <ee@w3.org>
- Date: Wed, 17 Sep 2014 09:46:15 +0200
- To: "Olaf Drümmer" <olaf@druemmer.com>
- Cc: wai-eo-editors <wai-eo-editors@w3.org>, "Shawn Henry" <shawn@w3.org>
- Message-ID: <5D12D275-9389-4D35-9B8B-3FAF8C5E90BD@w3.org>
On 16 Sep 2014, at 19:37, Olaf Drümmer wrote: > Hi Eric, > > the context for this discussion is > http://www.w3.org/WAI/tutorials/tables/ > though it seems somebody change the two instances of > alt > into > alt="" > already. So it seems that the issue is resolved. Thank you for your feedback. > Regarding the syntax discussion: > I am interested in learning where you have found an indication that > using alt without a value is just fine. I have provided sources that > make it very clear for HTML4 that it is **incorrect** (alt is not an > attribute of type boolean), and that one can argue it is not correct > for HTML5 (and I admitted the wording is not very crisp, but wiithout > wording elsewhere that seems to allow such use of alt I would insist > my interpretation is correct). In HTML5 it says http://dev.w3.org/html5/html-author/#empty-attr “An empty attribute is one where the value has been omitted. This is a **syntactic shorthand for specifying the attribute with an empty value**, and is commonly used for boolean attributes.” (Emphasis mine. ) In HTML4 that was not _meant_ to be the case, yet browsers did it like that all the time, so I guess they are just paving cowpaths there. Best, Eric > > > Olaf > > > On 16 Sep 2014, at 16:54, Eric Eggert <ee@w3.org> wrote: > >> hi Olaf, >> >> On 16 Sep 2014, at 16:33, Olaf Drümmer wrote: >> >>> Hi Eric, >>> >>> after some research I found this (3.2.3.1 Empty Attribute Syntax ) >>> http://dev.w3.org/html5/html-author/#empty-attr >>> >>> Also see: >>> http://www.w3.org/TR/html/infrastructure.html#boolean-attributes >>> though wording is much less straightforward here. >>> >>> >>> So except for boolean attributes an attribute without a value is >>> illegal. And even for boolean attributes it is illegal for XHTML. >>> This implies that the synatx used on the mage tutorial overview page >>> is simply incorrect correct and requires fixing. >> >> The empty attribute syntax is not only valid for boolean attributes, >> just “commonly used” for them. The spec is quite unclear for >> developers here. Basically the behavior is like this: >> >> If an attribute is used without a value, assume its value is an empty >> string (attr -> attr=""). >> If a boolean attribute’s value is an empty string, set it to true >> (bool="" -> bool="bool"). >> >> That means an attribute like alt would transform to alt=""; >> and an attribute like disabled would transform to disabled="" and >> then to disabled="disabled". >> >> >> That said, I’m a bit lost on where we have used (or should have >> used??) an alt without an empty value. We nowhere advices to use the >> alt without the empty string attached. It is always >> >> alt="" (which is fine in XHTML as well as HTML) >> >> and not >> >> alt (which is syntactically correct in HTML, but not used for the >> reasons outlined in my previous email) >> >> alone. >> >> Can you point me to the section of the page you have an issue with? >> And to clarify, it could probably be helpful how you’d phase the >> sentence affected. >> >>> BTW - Personally I think, when writing a decent spec it should not >>> have an impact that some agents can handle illegal syntax - the spec >>> should simply get it right. >> >> I think this is a different discussion ;-) >> >> Best, Eric >> >>> >>> >>> >>> Olaf >>> >>> >>> On 15 Sep 2014, at 18:38, Eric Eggert <ee@w3.org> wrote: >>> >>>> Hi Olaf, >>>> >>>> [3] >>>> The last bit goes back to my limited familiarity with details in >>>> HTML: >>>> - is >>>> alt >>>> really equivalent to >>>> alt="" >>>> ? >>>> - if so, why do the examples in W3C WAI related content I have run >>>> into (and definitely those in the image tutorial) use >>>> alt="" >>>> ? >>>> >>>> In modern HTML5 browsers, alt will be interpreted as alt="", but I >>>> don’t consider using this as best practice, especially when >>>> educating website authors: >>>> >>>> Having the ="" in there show that the empty alt is a deliberate >>>> decision and not something forgotten. >>>> >>>> Older browsers or assistive technology might treat alt without a >>>> value as missing and might announce the filename instead of >>>> nothing. >>>> >>>> Using two syntaxes like this with minor differences and little to >>>> no gain would only confuse some people and would be hard to >>>> explain, imho. >>>> >>>> Best, Eric >>>> >>>> -- >>>> >>>> Eric Eggert, Web Accessibility Specialist >>>> WAI-ACT Project >>>> >>>> I’m yatil on IRC. >>>> >> >> >> >> >> -- >> >> Eric Eggert, Web Accessibility Specialist >> WAI-ACT Project >> >> I’m yatil on IRC. -- Eric Eggert, Web Accessibility Specialist WAI-ACT Project I’m yatil on IRC.
Received on Wednesday, 17 September 2014 07:46:51 UTC