mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-16 04:59:23 +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
|
@ -89,7 +89,7 @@ WebIDL::ExceptionOr<void> CSSVariableReferenceValue::set_fallback(GC::Ptr<CSSUnp
|
|||
}
|
||||
|
||||
// https://drafts.css-houdini.org/css-typed-om-1/#serialize-a-cssvariablereferencevalue
|
||||
String CSSVariableReferenceValue::to_string() const
|
||||
WebIDL::ExceptionOr<String> CSSVariableReferenceValue::to_string() const
|
||||
{
|
||||
// To serialize a CSSVariableReferenceValue this:
|
||||
// 1. Let s initially be "var(".
|
||||
|
@ -103,7 +103,7 @@ String CSSVariableReferenceValue::to_string() const
|
|||
if (m_fallback) {
|
||||
// AD-HOC: Tested behaviour requires we append "," without the space. https://github.com/w3c/css-houdini-drafts/issues/1148
|
||||
s.append(","sv);
|
||||
s.append(m_fallback->to_string());
|
||||
s.append(TRY(m_fallback->to_string()));
|
||||
}
|
||||
|
||||
// 4. Append ")" to s and return s.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue