Age | Commit message (Collapse) | Author |
|
|
|
|
|
We don't need a full String/DeprecatedString inside this function, so we
might as well not force users to create one.
|
|
Cast to a HTMLElement instead and retrieve the value attribute from
there instead.
|
|
Null check was missing and we would crash when dereferencing the
pointer to access the type() member.
|
|
This stops a lot of the whining about uncaught exceptions on the
Speedometer benchmark.
|
|
|
|
|
|
Each form element has a constructing entry list boolean, initially
false.
|
|
This implements a convenience method on HTMLFormElement to retrieve a
list in tree order of submittable elements associated with the form
element.
|
|
|
|
|
|
|
|
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.
|
|
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).
|
|
|
|
|
|
|
|
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.
|
|
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.
|
|
Callers that are already in a fallible context will now TRY to allocate
cells. Callers in infallible contexts get a FIXME.
|
|
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.
|
|
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).
|
|
|
|
As per the specification:
https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-createradialgradient
|
|
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.
|
|
|
|
Those don't have any non-try counterpart, so we might as well just omit
it.
|
|
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.
|
|
While doing add some structures to hold these new fill styles and
plumb them over to the painter.
|
|
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
|
|
|
|
|
|
|
|
We do what other browsers do and create a selection anchored at the
document's body element.
|
|
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. :^)
|
|
Since the forgiving base64 is part of the web infra standard
|
|
We now lazily create these instances on-demand rather than all at once
when a Window/Worker object is created.
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
Prior to this change, fallback content inside an object tag would not
be rendered on page load.
|
|
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.
|
|
Element now supports getting and setting ARIA properties from
JS and HTML.
|
|
Don't round float values to int values in
CanvasRenderingContext2D::fill_text when passing them to
Painter::draw_text.
This also fixes a fixme.
|
|
|
|
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.
|
|
Specifically, this adds support for the align attribute when applied to
heading, paragraph and caption elements.
|