W3C home > Mailing lists > Public > www-style@w3.org > August 2017

[CSS3-Selctors] Selecting Implicit Attributes

From: Brent Ritchie <ritchie.brent@gmail.com>
Date: Tue, 15 Aug 2017 17:31:13 +0000
Message-ID: <CACWr733LtZAtGyyMueVnmza3Ao2WJmhALL2vvHf9W1TwcsWJhg@mail.gmail.com>
To: www-style@w3.org
Hi All,

I was playing around with some ideas and came across a few cases that I
thought should have worked but don't.

The html that I am using as an example is:

<progress value="0.4"></progress>

I would expect that the following CSS selector would select this element:

[role="progressbar"]:not(:indeterminate)

The problem seems to be that only explicitly defined attributes are able to
be selected.

The specification doesn't make this readily apparent and other
specifications muddle the issue as well.

ARIA in HTML document says: "Setting an ARIA role and/or aria-* attribute
that matches the implicit ARIA semantics is unnecessary and is not
recommended as these properties are already set by the browser."
https://www.w3.org/TR/html-aria/#docconformance

It then lists all of the aria attributes that each element inherits. I
would expect that these would be selectable by CSS.


The HTML 5.1 Specification for the <meter> element says: If the min
<https://www.w3.org/TR/html/sec-forms.html#element-attrdef-meter-min>
attribute is specified and a value could be parsed out of it, then the minimum
value <https://www.w3.org/TR/html/sec-forms.html#meter-minimum-value> is
that value. Otherwise, the minimum value
<https://www.w3.org/TR/html/sec-forms.html#meter-minimum-value> is zero.
https://www.w3.org/TR/html/sec-forms.html#meter-minimum-value


Given the text above I would expect for: meter[min="0"] to match
<meter></meter> but it does not.

I couldn't find any discussions on why the selectors operate the way they
do but I suspect that it may be mostly due to performance.

I can see the benefit of having more compact selectors if the implied
attributes could be selected as well as help authors style better for
assisted technologies. Maybe come up with a new syntax to opt-in to
searching implied attributes?

Any thoughts, comments or pointers to past discussions of this matter?

Thanks,

Brent Ritchie
Received on Wednesday, 16 August 2017 09:06:03 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 16 August 2017 09:06:04 UTC