mirror of
https://github.com/servo/servo
synced 2026-04-26 09:35:26 +02:00
dom: Add the attribute mutation reason (#40527)
For some specific cases (one of them see below) where are requirement to identify the reason of the attribute mutation (by whom/why it was changed - by cloning, parser or directly), so the following `reason` parameter was added to `AttributeMutation::Set` option. Note that for the HTMLMediaElement the internal `muted` state should be set to true when the element is created and the element has a `muted` content attribute specified (should be done once on the first attribute mutation caused by parser or cloning). See https://html.spec.whatwg.org/multipage/#dom-media-muted Testing: Improvements in the following tests - html/semantics/embedded-content/media-elements/user-interface/muted.html Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
This commit is contained in:
@@ -526,7 +526,7 @@ impl VirtualMethods for HTMLTextAreaElement {
|
||||
local_name!("disabled") => {
|
||||
let el = self.upcast::<Element>();
|
||||
match mutation {
|
||||
AttributeMutation::Set(_) => {
|
||||
AttributeMutation::Set(..) => {
|
||||
el.set_disabled_state(true);
|
||||
el.set_enabled_state(false);
|
||||
|
||||
@@ -572,7 +572,7 @@ impl VirtualMethods for HTMLTextAreaElement {
|
||||
{
|
||||
let mut placeholder = self.placeholder.borrow_mut();
|
||||
placeholder.clear();
|
||||
if let AttributeMutation::Set(_) = mutation {
|
||||
if let AttributeMutation::Set(..) = mutation {
|
||||
placeholder.push_str(attr.value().as_ref());
|
||||
}
|
||||
}
|
||||
@@ -581,7 +581,7 @@ impl VirtualMethods for HTMLTextAreaElement {
|
||||
local_name!("readonly") => {
|
||||
let el = self.upcast::<Element>();
|
||||
match mutation {
|
||||
AttributeMutation::Set(_) => {
|
||||
AttributeMutation::Set(..) => {
|
||||
el.set_read_write_state(false);
|
||||
},
|
||||
AttributeMutation::Removed => {
|
||||
|
||||
Reference in New Issue
Block a user