Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for CSS :active selector #8719

Closed
frewsxcv opened this issue Nov 28, 2015 · 2 comments · Fixed by #11781
Closed

Support for CSS :active selector #8719

frewsxcv opened this issue Nov 28, 2015 · 2 comments · Fixed by #11781
Labels
A-content/css Interacting with CSS from web content (parsing, serializing, introspection) I-enhancement No impact; the issue is a missing or proposed feature.

Comments

@frewsxcv
Copy link
Contributor

https://html.spec.whatwg.org/multipage/#concept-selector-active

https://drafts.csswg.org/selectors/#the-active-pseudo

@frewsxcv frewsxcv changed the title Support for CSS :active Support for CSS :active selector Dec 4, 2015
@mbrubeck mbrubeck added A-content/css Interacting with CSS from web content (parsing, serializing, introspection) I-enhancement No impact; the issue is a missing or proposed feature. labels May 24, 2016
@sjmelia
Copy link
Contributor

sjmelia commented Jun 15, 2016

This is referenced in PR #11726, the selector state already exists and is just missing the code to set it.

So either the element itself or perhaps the "Activatable" trait could be extended to deal with the "formal activation state" and call element.set_active_state.

In document.handle_mouse_event; I could hook mousedown and mouseup (as done for a click, which hooks to element.authentic_click_activation) to trigger this.

Does this sound about right? I'm not sure whether it's correct to consider activation as synonymous with mousedown.

@jdm
Copy link
Member

jdm commented Jun 15, 2016

cc @Manishearth for the previous comment.

bors-servo pushed a commit that referenced this issue Jul 3, 2016
Issue 8719: Add basic support for :active selector

<!-- Please describe your changes on the following line: -->
Added toggling of active state for element and parents on mousedown/mouseup. Active state is removed when mouseout. (hover)

- As with my other PR i'm struggling a bit with the automated testing. I've added a manual test case and found quirks-mode/active-and-hover-manual.html which - aside from also being a manual test, is functional in Firefox but does not render correctly in Servo.
- Not implemented: In Firefox, behaviour differs with a <!DOCTYPE HTML> and an anchor does not lose it's activation on mouseout; whereas a button does.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #8719  (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11781)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Jul 8, 2016
…arth

Issue 8719: Add basic support for :active selector

<!-- Please describe your changes on the following line: -->
Added toggling of active state for element and parents on mousedown/mouseup. Active state is removed when mouseout. (hover)

- As with my other PR i'm struggling a bit with the automated testing. I've added a manual test case and found quirks-mode/active-and-hover-manual.html which - aside from also being a manual test, is functional in Firefox but does not render correctly in Servo.
- Not implemented: In Firefox, behaviour differs with a <!DOCTYPE HTML> and an anchor does not lose it's activation on mouseout; whereas a button does.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #8719  (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11781)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-content/css Interacting with CSS from web content (parsing, serializing, introspection) I-enhancement No impact; the issue is a missing or proposed feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants