This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26298 - Clarify whether anchors, areas and link elements should match :enabled selector if they have a disabled ancestor
Summary: Clarify whether anchors, areas and link elements should match :enabled select...
Status: RESOLVED WORKSFORME
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-09 17:15 UTC by Bruno de Oliveira Abinader
Modified: 2014-09-03 17:15 UTC (History)
7 users (show)

See Also:


Attachments
Testcase (508 bytes, text/html)
2014-07-10 14:09 UTC, Bruno de Oliveira Abinader
Details

Description Bruno de Oliveira Abinader 2014-07-09 17:15:15 UTC
The HTML spec says:

The :enabled pseudo-class must match any element falling into one of the following categories:

    a elements that have an href attribute
    area elements that have an href attribute
    link elements that have an href attribute

However, a simple query for ":enabled" selector in both Firefox and Chrome returns null if, for example, an anchor element which contains an "href" attribute has a disabled ancestor.
Comment 1 Lachlan Hunt 2014-07-09 19:24:00 UTC
This is not a bug with the Selectors API spec.
Comment 2 Ms2ger 2014-07-09 20:13:09 UTC
The helpful reaction would be to move the bug....
Comment 3 Ian 'Hixie' Hickson 2014-07-09 21:45:02 UTC
Do you have a test case showing what you mean, exactly?
Comment 4 Bruno de Oliveira Abinader 2014-07-10 14:09:09 UTC
Created attachment 1493 [details]
Testcase

See testcase attached.

#1: Tested on FF, Blink & WebKit w/ same results.
#2: Even if the anchor was a direct child of body elem, ":enabled" still returns null for all tested web engines.
Comment 5 Ian 'Hixie' Hickson 2014-09-02 22:44:52 UTC
Chrome for me clearly shows the <a> element as matching :enabled, regardless of the state of the <button>.

Safari and Firefox for me never have <a> elements match :enabled or :disabled, regardless of the state of the <button>.

http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=3144


This seems like a simple bug in Safari and Firefox, assuming we want links to be able to match :enabled.
Comment 6 Boris Zbarsky 2014-09-03 00:12:48 UTC
I don't think that's a good assumption.  See bug 26622.
Comment 7 Ian 'Hixie' Hickson 2014-09-03 17:15:29 UTC
Ah, we have a bug for that already. Excellent. In that case, this bug is moot — the browsers and the spec agree that the ancestor chain doesn't affect :enabled/:disabled on links. So I'm marking this WORKSFORME.