mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-15 20:49:41 +00:00
LibWeb/CSS: Make CSSStyleValue.to_string() return ExceptionOr
DOMMatrix.to_string() throws exceptions if any of its values are non-finite. This ends up affecting CSSStyleValue because its subclass CSSTransformValue (which is about to be added) serializes CSSTransformComponents, and one of those is CSSMatrixComponent, which calls DOMMatrix.to_string(). This is all quite unfortunate, and because at the time the spec for DOMMatrix was written, CSS couldn't represent NaN or infinity. That's no longer true, so I'm hoping the spec can be updated and this can be reverted. https://github.com/w3c/fxtf-drafts/issues/611
This commit is contained in:
parent
a1db5e7789
commit
d3d695e9d2
Notes:
github-actions[bot]
2025-09-24 11:28:48 +00:00
Author: https://github.com/AtkinsSJ
Commit: d3d695e9d2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6227
19 changed files with 48 additions and 44 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <LibWeb/Bindings/CSSNumericValuePrototype.h>
|
||||
#include <LibWeb/CSS/CSSStyleValue.h>
|
||||
#include <LibWeb/CSS/NumericType.h>
|
||||
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||
#include <LibWeb/WebIDL/Types.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
@ -59,7 +60,7 @@ public:
|
|||
CSSNumericType type_for_bindings() const;
|
||||
NumericType const& type() const { return m_type; }
|
||||
|
||||
virtual String to_string() const final override { return to_string({}); }
|
||||
virtual WebIDL::ExceptionOr<String> to_string() const final override { return to_string({}); }
|
||||
String to_string(SerializationParams const&) const;
|
||||
|
||||
static WebIDL::ExceptionOr<GC::Ref<CSSNumericValue>> parse(JS::VM&, String const& css_text);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue