summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML
AgeCommit message (Collapse)Author
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-15LibTextCodec+Everywhere: Make TextCodec::decoder_for() take a StringViewSam Atkins
We don't need a full String/DeprecatedString inside this function, so we might as well not force users to create one.
2023-02-13LibWeb: Do not assume field element is always a HTMLInputElementKenneth Myhra
Cast to a HTMLElement instead and retrieve the value attribute from there instead.
2023-02-13LibWeb: Avoid dereferencing null pointerKenneth Myhra
Null check was missing and we would crash when dereferencing the pointer to access the type() member.
2023-02-12LibWeb: Implement location.hash setterAndreas Kling
This stops a lot of the whining about uncaught exceptions on the Speedometer benchmark.
2023-02-12LibWeb: Use 'auto& vm =' once at beginning to reduce noiseKenneth Myhra
2023-02-12LibWeb: Implement algorithm 'construct the entry list given a form'Kenneth Myhra
2023-02-12LibWeb: Add accessor function HTMLFormElement::constructing_entry_list()Kenneth Myhra
Each form element has a constructing entry list boolean, initially false.
2023-02-12LibWeb: Implement HTMLFormElement::get_submittable_elements()Kenneth Myhra
This implements a convenience method on HTMLFormElement to retrieve a list in tree order of submittable elements associated with the form element.
2023-02-12LibWeb: Introduce the FormDataEvent interfaceKenneth Myhra
2023-02-12LibWeb: Introduce the FormData interface from the XHR specificationKenneth Myhra
2023-02-10LibJS+Userland: Port the JS Console object and direct callers to StringTimothy Flynn
2023-02-09LibJS+LibWeb: Convert string view PrimitiveString instances to StringTimothy Flynn
First, this adds an overload of PrimitiveString::create for StringView. This overload will throw an OOM completion if creating a String fails. This is not only a bit more convenient, but it also ensures at compile time that all PrimitiveString::create(string_view) invocations will be handled as String and OOM-aware. Next, this wraps all invocations to PrimitiveString::create(string_view) with MUST_OR_THROW_OOM. A small PrimitiveString::create(DeprecatedFlyString) overload also had to be added to disambiguate between the StringView and DeprecatedString overloads.
2023-02-03LibWeb: Implement CanvasRenderingContext2D.createPattern()MacDue
This is a first pass at implementing CRC2D.createPattern() and the associated CanvasPattern object. This implementation only works for a few of the required image sources [like CRC2D.drawImage()], and does not yet support transforms. Other than that it supports everything else (which is mainly the various repeat modes).
2023-02-03LibWeb: Fix typo and use auto where possibleMacDue
2023-02-02LibWeb: Allow to set a root mode value when constructing a ShadowRootKarol Kosek
2023-02-02LibWeb: Add a helper function for checking if element is a shadow hostKarol Kosek
2023-02-02LibWeb: Rename DOM::shadow_root() to shadow_root_internal()Karol Kosek
The shadowRoot property getter that will be added in subsequent commits has an additional check that checks whether the shadow root is opened. I didn't update the function logic to match with the IDL interface, because it's very likely we don't want that check in the existing code, so that for example closed shadow root elements can still be updated.
2023-01-29LibWeb: Move ARIA-related code into the Web::ARIA namespaceLinus Groh
ARIA has its own spec and is not part of the DOM spec, which is what the Web::DOM namespace is for (https://www.w3.org/TR/wai-aria-1.2/). This allows us to stay closer to the spec with function names and don't have to add the word "ARIA" to identifiers constantly - the namespace now provides that clarity.
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-28LibWeb: Replace ARIA role static FlyStrings with an enumMacDue
This replaces the FlyStrings for ARIA roles that were constructed in a [[gnu::constructor]] with a single enum. I came across this as the DOM inspector was crashing due to a null FlyString for an ARIA role. After fixing that, I was confused as to why these roles were not an enum. Looking at the spec there's a fixed list of roles and switching from references to static strings to an enum was pretty much an exercise in find and replace :). No functional changes (outside of fixing the mentioned crash).
2023-01-28LibWeb: Add a few extra spec links to CanvasGradientMacDue
2023-01-28LibWeb: Throw exception if any canvas radial gradient radius is < 0MacDue
As per the specification: https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-createradialgradient
2023-01-27AK: Remove StringBuilder::build() in favor of to_deprecated_string()Linus Groh
Having an alias function that only wraps another one is silly, and keeping the more obvious name should flush out more uses of deprecated strings. No behavior change.
2023-01-27LibWeb: Remove declarations for non-existent methodsSam Atkins
2023-01-26LibGfx: Remove `try_` prefix from bitmap creation functionsTim Schumacher
Those don't have any non-try counterpart, so we might as well just omit it.
2023-01-22LibWeb: Implement the canvas gradientsMacDue
This gets: - CanvasRenderingContext2D.createLinearGradient() - CanvasRenderingContext2D.createConicGradient() - CanvasRenderingContext2D.createRadialGradient() Actually working as fill styles for paths and rectangles :^) Getting them working for strokes is left as an exercise is left as an exercise for the reader.
2023-01-22LibWeb: Update CRC2D .fillStyle and .strokeStyle to accept gradientsMacDue
While doing add some structures to hold these new fill styles and plumb them over to the painter.
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-18LibWeb: Define window.isSecureContextCameron Youell
2023-01-15LibJS+Everywhere: Rename Value::to_string to to_deprecated_stringTimothy Flynn
2023-01-15LibJS+LibWeb: Rename number_to_string to number_to_deprecated_stringTimothy Flynn
2023-01-12LibWeb: Implement BrowsingContext::select_all() in terms of SelectionAndreas Kling
We do what other browsers do and create a selection anchored at the document's body element.
2023-01-12LibWeb: Implement BrowsingContext::selected_text() in terms of SelectionAndreas Kling
Instead of sifting through the layout tree to extract the selected text, look at the DOM selection instead. Note that we can't just stringify the DOM Range, as that would include non-visible things (like the content of <style> elements, etc.) so we run it through an ad-hoc variant of the range stringification algorithm. This can probably be factored better, but it's a start. :^)
2023-01-10AK+LibWeb: Move decode forgiving base64 under Web::Infra namespaceArda Cinar
Since the forgiving base64 is part of the web infra standard
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: 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-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-09LibWeb: Only log HTML parser errors when HTML_PARSER_DEBUG is enabledAndreas Kling
At this point, the parser is reliable enough that we don't need to spam the debug log about minor parsing issues on every websites.
2023-01-09LibWeb: Run object representation steps on specified attribute updatesSrikavin Ramkumar
2023-01-09LibWeb: Run object representation steps on element creationSrikavin Ramkumar
Prior to this change, fallback content inside an object tag would not be rendered on page load.
2023-01-08LibJS+LibWeb: Move the macro to convert ENOMEM to an exception to LibJSTimothy Flynn
Move the macro to LibJS and change it to return a throw completion instead of a WebIDL exception. This will let us use this macro within LibJS to handle OOM conditions.
2023-01-07LibWeb: Add Support for the ARIA Element PropertiesJonah
Element now supports getting and setting ARIA properties from JS and HTML.
2023-01-05LibWeb: Pass FloatRect to Painter::draw_text in fill_textVayuDev
Don't round float values to int values in CanvasRenderingContext2D::fill_text when passing them to Painter::draw_text. This also fixes a fixme.
2023-01-05LibWeb: Convert Layout::Node to new pixel unitsSam Atkins
2023-01-05LibWeb+WebContent: Convert BrowsingContext to new pixel unitsSam Atkins
This fixes a few glitches. We no longer give the page double the width it should have, and we mark the correct area of the page as needing repainting.
2023-01-04LibWeb: Support more presentational hints from the HTML specimplicitfield
Specifically, this adds support for the align attribute when applied to heading, paragraph and caption elements.