LibWeb+IDLGenerators: Support nullable union types

This commit is contained in:
Luke Wilde
2026-02-17 14:57:03 +00:00
committed by Sam Atkins
parent 500ca417ce
commit cfd795f907
Notes: github-actions[bot] 2026-03-25 13:21:41 +00:00
39 changed files with 146 additions and 128 deletions

View File

@@ -25,11 +25,10 @@ WebIDL::ExceptionOr<GC::Ref<AnimationPlaybackEvent>> AnimationPlaybackEvent::con
return create(realm, type, event_init);
}
AnimationPlaybackEvent::CSSNumberishInternal AnimationPlaybackEvent::to_numberish_internal(Optional<CSS::CSSNumberish> const& numberish_root)
AnimationPlaybackEvent::CSSNumberishInternal AnimationPlaybackEvent::to_numberish_internal(NullableCSSNumberish const& numberish_root)
{
if (!numberish_root.has_value())
return Empty {};
return numberish_root->visit(
return numberish_root.visit(
[](Empty) -> CSSNumberishInternal { return Empty {}; },
[](GC::Root<CSS::CSSNumericValue> const& root) -> CSSNumberishInternal { return GC::Ref { *root }; },
[](auto const& other) -> CSSNumberishInternal { return other; });
}