elements are selected by the :active selector which should be inactive




8 years ago
8 years ago


(Reporter: rifojxh, Unassigned)



Firefox Tracking Flags

(Not tracked)



(1 attachment)



8 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20100628
Build Identifier: Firefox 3.6.6

Other elements are being affected by the :active selector than the (correctly) active element.

Reproducible: Always

Steps to Reproduce:
See the attached test case.

Comment 1

8 years ago
Created attachment 459382 [details]
Test case showing bug.
Keywords: testcase
All the parent elements are activated when you click on the link in the testcase,
and :active selector applies also to the body element which is a (great-grand-) parent, so the text color changes everywhere.
Yep.  :active is hierarchical.  See discussion in bug 65917.
Last Resolved: 8 years ago
Component: DOM: CSS Object Model → Style System (CSS)
QA Contact: general → style-system
Resolution: --- → INVALID

Comment 4

8 years ago
bz, I followed your tip and looked at that bug.
It seems to me after reading it that the issue of what :active should affect is not universally trivially obvious.
After reading the bug, it still appears that the issue in this bug is valid.
I also tried the test case at
You can see that some of the cases are not handled correctly, as the test case author regards correct.
As I presently understand it, the part of :active that was agreed should act hierarchically is given in this example:
<a href="head.html"><b>Tail</b></a>
When the user clicks on "Tail" , ':active' should be hierarchically applied up to and including the <a> element.

Maybe there there is a version of CSS specification which is more relevant, but I take this excerpt from the CSS3 selector draft.

http://www.w3.org/TR/2009/PR-css3-selectors-20091215/#the-user-action-pseudo-classes-hover-act The user action pseudo-classes :hover, :active, and :focus
"The :active pseudo-class applies while an element is being activated by the user."

Relevant question: What is "element is being activated by the user."?

I do not know of other sources which describe an answer except the corresponding CSS2.1 section on selectors.
':active' seems related to ':hover' and ':visited' and I expect that it should have identical scope.
Does everyone agree on that?

If it is universally agreed that they should have same scope, then that would mean that in the test case I wrote, the ':active' should not propagate up the hierarchy beyond the link tail.  In the test case I attached, firefox makes elements active which are neither enclosed in the anchor tail nor anchor head. All indications I see are that those elements should not be :active .
Do you see any indication to the contrary?
Resolution: INVALID → ---

Comment 5

8 years ago
To implementation:
Can this be implemented easier or cleanly by sharing code for selection by ':hover' or remarking :hover :active when activated?
Yep.  :hover is hierarchical just like active.  And the point is that ancestors of the link do in fact get activated on click (in the sense of triggering default actions).  This really is invalid...  Ian's tests assume a different interpretation of the spec from what we decided on and also predate the main discussion about the behavior by a good bit.  We happen to think he's wrong.
Last Resolved: 8 years ago8 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.