W3C home > Mailing lists > Public > www-style@w3.org > April 2015

W3C can say (?) what an ID means to CSS4, in the fast profile context

From: Peter Krauss <ppkrauss@gmail.com>
Date: Tue, 7 Apr 2015 16:45:35 -0300
Message-ID: <CAHEREts30rvWku8kM8TV+iJcvfSM4Ovv0e2V-0=+e4twgK9r7A@mail.gmail.com>
To: "www-style@w3.org" <www-style@w3.org>
I will try to summarize...
Facts when rendering XML or HTML documents with CSS:

* Designers have the option to use CLASS and ID attributes, and the ID
option is to express the uniqueness.

* W3C need to listen to the design community, and statistics speak
for them:
   there are a lot of ugly documents with non-unique IDs... we must to
tolerate non-unique IDs.

in view of the facts ... There are two kinds of  "W3C workarounds", for
tolerate non-unique IDs:

*1) use the first*. The DOM's tradition, with the
*getElementById(elementId)* method, that
    "must return the first element, in tree order", http://www.w3.org/TR/dom

*2) ignore uniqueness of IDs*. Is not an explicit W3C workaround,
    but it is the (worst) practice in the CSS-parsing of all popular render
engines (like Blink, Gecko or Webkit);
    and, the W3C's "nothing to declare" is near to an agreement.
    This practice say to designers "ID=CLASS" and
    created a culture of "invalid IDs" in the content production.

But now, with the CSS4's *fast profile* proposal, since 2013,
we can change this culture of "worst practices"...

*PROPOSAL* (? is possible):  let's drop "repeated ID support" in the *fast
profile* definition of CSS4.
   To do it explicitally, the CSS4 must express uniqueness as an
extra-constraint for the *fast profile*.

... would be a gift, a W3C's bounty for designers and template-engines that
produce non-ugly documents (docs with real IDs),
and an incentive for render-engines really use distinct algorithms for each
looking for effective optimizations in the *fast profile*.


PS1: there are many old discussions about ID in XML/HTML/CSS... Here an
example as reference,

PS2: about render engines, they work with "ignore uniqueness of IDs"
strategy in the sense that
  not use something like getElementById(), the CSS-render algorithms see ID
attribute as see CLASS attribute.
Received on Tuesday, 7 April 2015 19:46:03 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:53 UTC