Commit graph

8 commits

Author SHA1 Message Date
Timothy Flynn
0f93c9d6c8 LibWeb: Convert the CSS namespace object to ThrowCompletionOr 2021-10-31 15:48:36 +01:00
Idan Horowitz
40eb3a39d4 LibJS: Rename define_native_function => define_old_native_function
This method will eventually be removed once all native functions are
converted to ThrowCompletionOr
2021-10-20 12:27:19 +01:00
Idan Horowitz
20163c0584 LibJS: Add ThrowCompletionOr versions of the JS native function macros
The old versions were renamed to JS_DECLARE_OLD_NATIVE_FUNCTION and
JS_DEFINE_OLD_NATIVE_FUNCTION, and will be eventually removed once all
native functions were converted to the new format.
2021-10-20 12:27:19 +01:00
Linus Groh
4d8912a92b LibJS: Convert to_string() to ThrowCompletionOr
Also update get_function_name() to use ThrowCompletionOr, but this is
not a standard AO and should be refactored out of existence eventually.
2021-10-13 09:55:10 +01:00
Andreas Kling
4bf88436cb LibWeb: Handle JS exceptions slightly sooner in CSS.escape() 2021-10-10 02:55:19 +02:00
Sam Atkins
bc0ef5f69d LibWeb: Implement CSS.supports(string) function :^)
Websites being able to query whether we support a given CSS feature
should prevent them from loading unnecessary polyfills for things we
already support! Or at least, that's the nice theory. :^)
2021-10-08 23:02:57 +02:00
Sam Atkins
2b67f87629 LibWeb: Implement 2-argument version of CSS.supports()
This version takes a property name and value as separate parameters.
2021-10-08 23:02:57 +02:00
Sam Atkins
575ce04148 LibWeb: Add CSS.escape() JS function
This is the `CSS` namespace defined in IDL here:
https://www.w3.org/TR/cssom-1/#namespacedef-css , not to be confused
with our `Web::CSS` namespace. Words are hard.

`CSS.escape()` lets you escape identifiers that can then be used to
create a CSS string.

I've also stubbed out the `CSS.supports()` function.
2021-10-08 23:02:57 +02:00