summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Bindings
AgeCommit message (Collapse)Author
2023-04-13LibJS: Make intrinsics getters return NonnullGCPtrLinus Groh
Some of these are allocated upon initialization of the intrinsics, and some lazily, but in neither case the getters actually return a nullptr. This saves us a whole bunch of pointer dereferences (as NonnullGCPtr has an `operator T&()`), and also has the interesting side effect of forcing us to explicitly use the FunctionObject& overload of call(), as passing a NonnullGCPtr is ambigous - it could implicitly be turned into a Value _or_ a FunctionObject& (so we have to dereference manually).
2023-04-09Everywhere: Remove unused DeprecatedString includesBen Wiederhake
2023-04-09LibWeb: Add WebGL::EventNamesKenneth Myhra
2023-04-06LibWeb: Port {HTML,UIEvents,XHR}::EventNames to new StringKenneth Myhra
2023-04-06LibWeb: Introduce CustomElementRegistry and creating custom elementsLuke Wilde
The main missing feature here is form associated custom elements.
2023-03-23LibWeb: Add a list of the entry names in the PerformanceTiming interfaceLuke Wilde
Required for the PerformanceMark constructor, which doesn't allow any mark names that have the same name as an attribute in the PerformanceTiming interface in a Window context.
2023-03-23LibWeb: Introduce Performance Timeline and its Performance functionsLuke Wilde
2023-03-18LibWeb: Initialize static web strings during main-thread VM creationTimothy Flynn
These are currently initialized in a [[gnu::constructor]], which has a weird initialization order. These constructors are invoked before main() and, incidentally, before any user-defined default constructors of the static strings they are initializing. This will become an issue when these strings are ported to FlyString, which has a user-defined default constructor. In that scenario, when the FlyString constructor is executed after the [[gnu::constructor]], the strings will be "reset" to the empty string. Instead of relying on a non-standard compiler extension here, let's just initialize these strings explicitly during main-thread VM creation, as this now happens in WebContent's main().
2023-03-17LibWeb: Move initialization of the MainThreadVM to WebContent's main()Timothy Flynn
It is a fallible operation, so this lets us abort early if it fails.
2023-03-17LibJS: Propagate errors from VM creationTimothy Flynn
2023-03-15LibWeb: Port the CSS namespace to IDLTimothy Flynn
2023-03-15LibWeb: Support generating IDL namespacesTimothy Flynn
These are similar to prototypes and constructors in that they will now be lazily instantiated when they are first requested.
2023-03-15LibJS+LibWeb: Wrap raw JS::Cell*/& fields in GCPtr/NonnullGCPtrMatthew Olsson
2023-03-07LibWeb/Bindings: Remove now unused REPLACEABLE_PROPERTY_SETTER() macroLinus Groh
2023-03-07LibWeb/HTML: Port Window.fetch() to IDLLinus Groh
2023-03-07LibWeb: Generate Window{Constructor,Prototype} from IDLLinus Groh
The Window object is massive, so let's do the conversion to IDL step by step. First up: getting rid of the manual constructor and prototype definitions, which can be generated from an empty `interface Window`.
2023-03-07LibWeb: Remove the dummy execution contextLuke Wilde
2023-03-07LibWeb: Remove CSS::Parser::ParsingContext's default constructorLuke Wilde
This relied on pulling the current realm from the main thread VM, which requires an execution context to be on the VM's stack. This heavily relied on the dummy execution context that is always on the stack, for example, when parsing the UA style sheets where no JavaScript is running.
2023-03-06Everywhere: Remove NonnullRefPtr.h includesAndreas Kling
2023-03-06LibWeb: Fix a few const-ness issuesMatthew Olsson
2023-03-05LibWeb: Port PromiseRejectionEvent to new StringKenneth Myhra
2023-03-03LibWeb/WebIDL: Store SimpleException message as a String{,View} variantLinus Groh
2023-03-03LibWeb/Fetch: Port JS interfaces to new StringLinus Groh
Since BodyInit and Headers are tightly coupled to both Request and Response, I chose to do all of them at once instead of introducing a bunch of temporary conversion glue code.
2023-03-03LibWeb: Update generated code in Bindings/FetchMethod.cppLinus Groh
Also update the incomplete and slightly incorrect dummy interface code snippet I used to generate this.
2023-02-28LibWeb: Restore proper functionality of legacy platform objectsLuke Wilde
With the GC heap conversion, the functionality of legacy platform objects was broken. This is because the generated implementation of one of them was used for all of them, removing functionality such as deletion. This re-adds all functionality, where questions such as "does the object support indexed properties?" is instead answered by virtual functions instead of by the IDL generator checking the presence of certain keywords/attributes.
2023-02-22LibWeb: Make factory method of DOM::ElementFactory fallibleKenneth Myhra
2023-02-18LibWeb: Make factory method of HTML::PromiseRejectionEvent fallibleKenneth Myhra
2023-02-17LibJS+Everywhere: Convert JS::Error to StringTimothy Flynn
This includes an Error::create overload to create an Error from a UTF-8 StringView. If creating a String from that view fails, the factory will return an OOM InternalError instead. VM::throw_completion can also make use of this overload via its perfect forwarding.
2023-02-16LibWeb: Convert usages of Value::TDSWOSE to Value::TSWOSETimothy Flynn
2023-02-16LibJS+Everywhere: Deprecate Value::to_string_without_side_effectsTimothy Flynn
2023-02-15LibWeb: Port CSS/Serialize.{h,cpp} to new Strings, and propagate errorsSam Atkins
2023-01-29LibJS+Everywhere: Propagate Cell::initialize errors from Heap::allocateTimothy Flynn
Callers that are already in a fallible context will now TRY to allocate cells. Callers in infallible contexts get a FIXME.
2023-01-29LibJS+Everywhere: Allow Cell::initialize overrides to throw OOM errorsTimothy Flynn
Note that as of this commit, there aren't any such throwers, and the call site in Heap::allocate will drop exceptions on the floor. This commit only serves to change the declaration of the overrides, make sure they return an empty value, and to propagate OOM errors frm their base initialize invocations.
2023-01-18LibWeb: Convert the Location object to IDLLinus Groh
This includes: - Moving it from Bindings/ to HTML/ - Renaming it from LocationObject to Location - Removing the manual definitions of the constructor and prototype - Removing special handling of the Location interface from the bindings generator - Converting the JS_DEFINE_NATIVE_FUNCTIONs to regular functions returning DeprecatedString instead of PrimitiveString - Adding missing (no-op) setters for the various attributes, which are expected to exist by the bindings generator
2023-01-15LibJS+Everywhere: Rename Value::to_string to to_deprecated_stringTimothy Flynn
2023-01-10LibWeb: Generate exposed Window/Worker interfaces as lazy objectsTimothy Flynn
We now lazily create these instances on-demand rather than all at once when a Window/Worker object is created.
2023-01-10LibWeb: Remove Intrinsics::cached_web_prototypeTimothy Flynn
It's now unused, and won't be safe to use once Web constructors and prototypes are lazily created.
2023-01-10LibWeb: Convert uses of cached_web_prototype to ensure_web_prototypeTimothy Flynn
Once the construction of these objects is lazy, we cannot assume they exist.
2023-01-10LibWeb: Move passing of Web object prototypes out of constructorsTimothy Flynn
2023-01-10LibWeb: Move setting of Web object prototypes to initialize()Timothy Flynn
This needs to happen before prototype/constructor intitialization can be made lazy. Otherwise, GC could run during the C++ constructor and try to collect the object currently being created.
2023-01-10LibWeb: Generate dedicated methods to create Web constructors/prototypesTimothy Flynn
Currently, for each exposed interface, we generate one massive function to create every Web constructor and prototype. In an effort to lazily create these instead, this first step is to extract the creation of each of these into its own method. First, this generates a forwarding header for all IDL types. This is to allow callers to remain unchanged without forcing them to include the (very heavy) generated IDL headers. This header is included by LibWeb's forwarding header. Next, this defines a base template method on Web::Bindings::Intrinsics to create a prototype/constructor pair. Specializations of this template are now generated in a new .cpp file, IntrinsicDefinitions.cpp. The base Intrinsics class is updated to use this new method, and will continue to cache the result. Last, some WebAssembly classes are updated to use this new mechanism. They were using some ad hoc cache keys that are now in line with the generated specializations. That one massive function is still used to invoke these specializations, so they are not lazy as of this commit.
2023-01-09AK+Everywhere: Rename FlyString to DeprecatedFlyStringTimothy Flynn
DeprecatedFlyString relies heavily on DeprecatedString's StringImpl, so let's rename it to A) match the name of DeprecatedString, B) write a new FlyString class that is tied to String.
2023-01-02Everywhere: Remove unused includes of AK/StdLibExtras.hBen Wiederhake
These instances were detected by searching for files that include AK/StdLibExtras.h, but don't match the regex: \\b(abs|AK_REPLACED_STD_NAMESPACE|array_size|ceil_div|clamp|exchange|for ward|is_constant_evaluated|is_power_of_two|max|min|mix|move|_RawPtr|RawP tr|round_up_to_power_of_two|swap|to_underlying)\\b (Without the linebreaks.) This regex is pessimistic, so there might be more files that don't actually use any "extra stdlib" functions. In theory, one might use LibCPP to detect things like this automatically, but let's do this one step after another.
2022-12-15LibJS: Convert Object::construct() to NonnullGCPtrLinus Groh
2022-12-15LibJS: Convert Heap::allocate{,_without_realm}() to NonnullGCPtrLinus Groh
2022-12-14LibJS: Remove Object(Object& prototype) footgunAndreas Kling
This constructor was easily confused with a copy constructor, and it was possible to accidentally copy-construct Objects in at least one way that we dicovered (via generic ThrowCompletionOr construction). This patch adds a mandatory ConstructWithPrototypeTag parameter to the constructor to disambiguate it.
2022-12-14LibJS: Convert Object::create() to NonnullGCPtrLinus Groh
2022-12-14LibJS: Convert Array::create{,_from}() to NonnullGCPtrLinus Groh
2022-12-07LibJS: Replace standalone js_string() with PrimitiveString::create()Linus Groh
Note that js_rope_string() has been folded into this, the old name was misleading - it would not always create a rope string, only if both sides are not empty strings. Use a three-argument create() overload instead.
2022-12-06Everywhere: Rename to_{string => deprecated_string}() where applicableLinus Groh
This will make it easier to support both string types at the same time while we convert code, and tracking down remaining uses. One big exception is Value::to_string() in LibJS, where the name is dictated by the ToString AO.