mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibWeb/CSS: Add flag to disable create-internal-rep type checking
CSSTransformComponents hold other CSSStyleValues as their parameters. We want to be able to create internal representations from those parameters without them caring if they would be valid when directly assigned to the property. This is a temporary solution to make transform functions work. To be completely correct, we need to know what is allowed in that context, along with value ranges - a combination of the contexts we create when parsing, and when computing calculations. For transform functions, this doesn't matter, as there's no limit to the range of allowed values.
This commit is contained in:
Notes:
github-actions[bot]
2025-10-14 12:42:59 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/5178d1ebe3d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6466
@@ -62,7 +62,7 @@ static WebIDL::ExceptionOr<NonnullRefPtr<StyleValue const>> create_an_internal_r
|
||||
// To create an internal representation, given a string property and a string or CSSStyleValue value:
|
||||
return value.visit(
|
||||
[&property](GC::Root<CSSStyleValue> const& css_style_value) {
|
||||
return css_style_value->create_an_internal_representation(property);
|
||||
return css_style_value->create_an_internal_representation(property, CSSStyleValue::PerformTypeCheck::Yes);
|
||||
},
|
||||
[&](String const& css_text) -> WebIDL::ExceptionOr<NonnullRefPtr<StyleValue const>> {
|
||||
// If value is a USVString,
|
||||
@@ -71,7 +71,7 @@ static WebIDL::ExceptionOr<NonnullRefPtr<StyleValue const>> create_an_internal_r
|
||||
// FIXME: Avoid passing name as a string, as it gets immediately converted back to PropertyNameAndID.
|
||||
auto result = TRY(CSSStyleValue::parse_a_css_style_value(vm, property.name(), css_text, CSSStyleValue::ParseMultiple::No));
|
||||
// AD-HOC: Result is a CSSStyleValue but we want an internal representation, so... convert it again I guess?
|
||||
return result.get<GC::Ref<CSSStyleValue>>()->create_an_internal_representation(property);
|
||||
return result.get<GC::Ref<CSSStyleValue>>()->create_an_internal_representation(property, CSSStyleValue::PerformTypeCheck::Yes);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user