Skip to content

Commit

Permalink
Auto merge of #25948 - NeverHappened:accept-only-connected-attributes…
Browse files Browse the repository at this point in the history
…-for-checkbox-radio-activation, r=jdm

Accept only connected attributes for checkbox and radio activation behavior

<!-- Please describe your changes on the following line: -->
Accept only connected attributes for checkbox and radio activation behavior

---
<!-- 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 #25906
- [x] WPT tests were already here
  • Loading branch information
bors-servo committed Mar 12, 2020
2 parents 38f0c35 + 6284795 commit 6ab923c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
3 changes: 3 additions & 0 deletions components/script/dom/htmlinputelement.rs
Expand Up @@ -2488,6 +2488,9 @@ impl Activatable for HTMLInputElement {
// https://html.spec.whatwg.org/multipage/#checkbox-state-(type=checkbox):activation-behavior
// https://html.spec.whatwg.org/multipage/#radio-button-state-(type=radio):activation-behavior
// Check if document owner is fully active
if !self.upcast::<Node>().is_connected() {
return ();
}
let target = self.upcast::<EventTarget>();
target.fire_bubbling_event(atom!("input"));
target.fire_bubbling_event(atom!("change"));
Expand Down
Expand Up @@ -2,21 +2,9 @@
[attached to shadow dom radio should emit input and change events on click().]
expected: FAIL

[detached checkbox should not emit input or change events on click().]
expected: FAIL

[attached to shadow dom checkbox should emit input and change events on click().]
expected: FAIL

[detached radio should not emit input or change events on click().]
expected: FAIL

[detached radio should not emit input or change events on dispatchEvent(new MouseEvent('click')).]
expected: FAIL

[detached checkbox should not emit input or change events on dispatchEvent(new MouseEvent('click')).]
expected: FAIL

[attached to shadow dom checkbox should emit input and change events on dispatchEvent(new MouseEvent('click')).]
expected: FAIL

Expand Down

0 comments on commit 6ab923c

Please sign in to comment.