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
|
@ -7,6 +7,7 @@
|
|||
#include "CSSImageValue.h"
|
||||
#include <LibWeb/Bindings/CSSImageValuePrototype.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
|
@ -30,7 +31,7 @@ void CSSImageValue::initialize(JS::Realm& realm)
|
|||
}
|
||||
|
||||
// https://drafts.css-houdini.org/css-typed-om-1/#stylevalue-serialization
|
||||
String CSSImageValue::to_string() const
|
||||
WebIDL::ExceptionOr<String> CSSImageValue::to_string() const
|
||||
{
|
||||
// AD-HOC: The spec doesn't say how to serialize this, as it's intentionally a black box.
|
||||
// We just serialize the source string that was used to construct this.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue