mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 09:46:04 -05:00
f991e40d7f
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. |
||
---|---|---|
.. | ||
AK | ||
Kernel | ||
LibAudio | ||
LibC | ||
LibCompress | ||
LibCore | ||
LibCpp | ||
LibCrypto | ||
LibEDID | ||
LibELF | ||
LibGfx | ||
LibGL | ||
LibGLSL | ||
LibIMAP | ||
LibJS | ||
LibLocale | ||
LibMarkdown | ||
LibPDF | ||
LibRegex | ||
LibSQL | ||
LibTest | ||
LibTextCodec | ||
LibThreading | ||
LibTimeZone | ||
LibTLS | ||
LibTTF | ||
LibUnicode | ||
LibVideo | ||
LibWasm | ||
LibWeb | ||
LibXML | ||
Spreadsheet | ||
UserspaceEmulator | ||
Utilities | ||
CMakeLists.txt |