mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Avoid invoking Trusted Types where avoidable
Prevents observably calling Trusted Types, which can run arbitrary JS, cause crashes due to use of MUST and allow arbitrary JS to modify internal elements.
This commit is contained in:
parent
fb9406ddcd
commit
82bd3d3891
Notes:
github-actions[bot]
2025-11-06 16:46:00 +00:00
Author: https://github.com/Lubrsi
Commit: 82bd3d3891
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6632
Reviewed-by: https://github.com/AtkinsSJ
83 changed files with 407 additions and 366 deletions
|
|
@ -99,9 +99,9 @@ Utf16String HTMLOptionElement::value() const
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-elements.html#dom-option-value
|
||||
WebIDL::ExceptionOr<void> HTMLOptionElement::set_value(Utf16String const& value)
|
||||
void HTMLOptionElement::set_value(Utf16String const& value)
|
||||
{
|
||||
return set_attribute(HTML::AttributeNames::value, value);
|
||||
set_attribute_value(HTML::AttributeNames::value, value.to_utf8_but_should_be_ported_to_utf16());
|
||||
}
|
||||
|
||||
static void concatenate_descendants_text_content(DOM::Node const* node, StringBuilder& builder)
|
||||
|
|
@ -129,7 +129,7 @@ String HTMLOptionElement::label() const
|
|||
// https://html.spec.whatwg.org/multipage/form-elements.html#dom-option-label
|
||||
void HTMLOptionElement::set_label(String const& label)
|
||||
{
|
||||
MUST(set_attribute(HTML::AttributeNames::label, label));
|
||||
set_attribute_value(HTML::AttributeNames::label, label);
|
||||
// Note: this causes attribute_changed() to be called, which will update the <select>'s label
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue