Closed Bug 580974 Opened 15 years ago Closed 15 years ago

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

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: rifojxh, Unassigned)

Details

(Keywords: testcase)

Attachments

(1 file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.6) 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.
Attached file Test case showing bug.
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.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Component: DOM: CSS Object Model → Style System (CSS)
QA Contact: general → style-system
Resolution: --- → INVALID
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 http://www.hixie.ch/tests/adhoc/css/selectors/active/001.html 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 6.6.1.2. 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?
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
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.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago15 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: