serenity/Tests/LibWeb
Shannon Booth f991e40d7f LibWeb: Support [Reflect] on IDL String attributes that may return null
This change allows IDL interfaces to be compiled using new AK String
which have a attribute in the interface that may return null.

Without this change we would run into a compile error from code such as
the following example:

```
auto retval = impl->deprecated_attribute(HTML::AttributeNames::ref);

if (!retval.has_value()) {
    return JS::js_null();
 }
 return JS::PrimitiveString::create(vm, retval.release_value());
```

As `deprecated_attribute` returns a `DeprecatedString` instead of an
`Optional<String>`. Fix that by using the non-deprecated attribute
implementation, and falling back to the empty string for where we cannot
return null.

Also add a test here to cover a regression I almost introduced here
which was not previously covered by our test suite.

Ideally, all of this should actually just be calling
Element::get_attribute_value, but I'm not entirely sure at this stage
what the behavioral change would be to test for here. Since this
implementation preserves the previous behavior, stick with it, and add a
FIXME for now.
2023-09-05 20:36:09 -04:00
..
Layout LibWeb: Perform rounding when dividing CSSPixels 2023-09-05 14:50:45 +02:00
Ref LibWeb: Implement attr() types :^) 2023-09-05 14:27:23 +02:00
Text LibWeb: Support [Reflect] on IDL String attributes that may return null 2023-09-05 20:36:09 -04:00
WPT Tests: Convert WebDriver patch to a git patch and clean up assumptions 2023-08-20 03:20:54 +02:00
CMakeLists.txt LibWeb: Implement spec-compliant integer parsing 2023-08-24 22:26:53 +01:00
rebaseline-libweb-test
TestCSSIDSpeed.cpp
TestCSSPixels.cpp LibWeb: Perform rounding when dividing CSSPixels 2023-09-05 14:50:45 +02:00
TestHTMLTokenizer.cpp LibWeb: Set the correct end position of HTML attribute names 2023-08-25 08:22:24 +02:00
TestNumbers.cpp LibWeb: Implement spec-compliant integer parsing 2023-08-24 22:26:53 +01:00
tokenizer-test.html