mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Update style attribute when calling attributeStyleMap.set()
We also now invalidate the element
This commit is contained in:
parent
4e79d86d03
commit
d7d4f90a2c
Notes:
github-actions[bot]
2025-12-02 11:38:26 +00:00
Author: https://github.com/Calme1709
Commit: d7d4f90a2c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6995
Reviewed-by: https://github.com/AtkinsSJ ✅
4 changed files with 21 additions and 0 deletions
|
|
@ -415,6 +415,10 @@ WebIDL::ExceptionOr<void> CSSStyleProperties::set_property_style_value(PropertyN
|
||||||
Important::No,
|
Important::No,
|
||||||
PropertyID::Custom,
|
PropertyID::Custom,
|
||||||
style_value });
|
style_value });
|
||||||
|
|
||||||
|
update_style_attribute();
|
||||||
|
invalidate_owners(DOM::StyleInvalidationReason::CSSStylePropertiesSetPropertyStyleValue);
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -439,6 +443,9 @@ WebIDL::ExceptionOr<void> CSSStyleProperties::set_property_style_value(PropertyN
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
update_style_attribute();
|
||||||
|
invalidate_owners(DOM::StyleInvalidationReason::CSSStylePropertiesSetPropertyStyleValue);
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ enum class ShouldComputeRole {
|
||||||
X(CSSImportRule) \
|
X(CSSImportRule) \
|
||||||
X(CSSStylePropertiesRemoveProperty) \
|
X(CSSStylePropertiesRemoveProperty) \
|
||||||
X(CSSStylePropertiesSetProperty) \
|
X(CSSStylePropertiesSetProperty) \
|
||||||
|
X(CSSStylePropertiesSetPropertyStyleValue) \
|
||||||
X(CSSStylePropertiesTextChange) \
|
X(CSSStylePropertiesTextChange) \
|
||||||
X(CustomElementStateChange) \
|
X(CustomElementStateChange) \
|
||||||
X(CustomStateSetChange) \
|
X(CustomStateSetChange) \
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
width: 10px;
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<div id="foo"></div>
|
||||||
|
<script src="../include.js"></script>
|
||||||
|
<script>
|
||||||
|
test(() => {
|
||||||
|
foo.attributeStyleMap.set("width", CSS.px(10));
|
||||||
|
|
||||||
|
println(foo.getAttribute("style"));
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</html>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue