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
|
|
@ -242,11 +242,11 @@ WebIDL::UnsignedLong HTMLImageElement::width() const
|
|||
return 0;
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<void> HTMLImageElement::set_width(WebIDL::UnsignedLong width)
|
||||
void HTMLImageElement::set_width(WebIDL::UnsignedLong width)
|
||||
{
|
||||
if (width > 2147483647)
|
||||
width = 0;
|
||||
return set_attribute(HTML::AttributeNames::width, String::number(width));
|
||||
set_attribute_value(HTML::AttributeNames::width, String::number(width));
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-height
|
||||
|
|
@ -273,11 +273,11 @@ WebIDL::UnsignedLong HTMLImageElement::height() const
|
|||
return 0;
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<void> HTMLImageElement::set_height(WebIDL::UnsignedLong height)
|
||||
void HTMLImageElement::set_height(WebIDL::UnsignedLong height)
|
||||
{
|
||||
if (height > 2147483647)
|
||||
height = 0;
|
||||
return set_attribute(HTML::AttributeNames::height, String::number(height));
|
||||
set_attribute_value(HTML::AttributeNames::height, String::number(height));
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-naturalwidth
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue