script: Prevent activation of disabled select elements (#42079)

This change also adjusts the styles of disabled select elements such
that the text appears grayed out, like in firefox:
<img width="480" height="84" alt="image"
src="https://github.com/user-attachments/assets/d36325f5-c811-492b-9510-7a32efd5fd7b"
/>


Testing: No tests. I think it would be possible to write a webdriver
test for this? It didn't seem worth the effort, if someone can point me
to the relevant resources then I'm happy to write one ^^

Fixes: https://github.com/servo/servo/issues/42075

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker
2026-01-23 01:40:28 +01:00
committed by GitHub
parent b3db9cf9d3
commit c023d8edc7
3 changed files with 6 additions and 611 deletions

View File

@@ -833,7 +833,7 @@ impl Activatable for HTMLSelectElement {
}
fn is_instance_activatable(&self) -> bool {
true
!self.upcast::<Element>().disabled_state()
}
fn activation_behavior(&self, _event: &Event, _target: &EventTarget, _can_gc: CanGc) {