Additionally: For “img” elements with empty “alt” attributes, change the
default role to the newer, preferred “none” synonym for the older
“presentation” role; import https://wpt.fyi/results/html-aam/roles.html
(which provides test/regression coverage for these changes).
Currently, the following JS snippet will hang indefinitely:
new DOMParser().parseFromString("<object>", "text/html");
Because the document into which the object is inserted is not active. So
the task queued to run the representation steps will never run.
This patch implements the spec steps to rerun the representation steps
when the active state changes, and avoid the hang when the object is
created in an inactive document.
We currently (sometimes) copy the observer map to a vector for iteration
to ensure we are not iterating over the map if the callback happens to
remove the observer. But that list was not protected from GC.
This patch ensures we protect that list, and makes all document observer
notifiers protected from removal during iteration.
This change updates the (advanced) build docs to explain how to do a
Debug build with the CXX `-O0` option set — which tells the compiler to
build with no optimizations at all.
Otherwise, Debug builds use the `-Og` option — which, when trying to
check frame variables in a debugger can result in an error of this form:
> error: Couldn't look up symbols: __ZN2AK6Detail10StringBaseD2Ev
> Hint: The expression tried to call a function that is not present in
> the target, perhaps because it was optimized out by
> the compiler.
This change aligns the default roles for “th” and “td” elements with the
requirements in the HTML-AAM spec, and with the corresponding WPT tests
at https://wpt.fyi/results/html-aam/table-roles.html, and with the
behavior in other engines.
Otherwise, without this change, the default role values for “th” and
“td” elements in some cases don’t match the behavior in other engines,
and don’t match the expected results for the corresponding WPT tests.
This change makes Ladybird conform to the current requirements at
https://w3c.github.io/core-aam/#roleMappingComputedRole in the “Core
Accessibility API Mappings” spec for the case of “orphaned” li elements;
that is, any li element which doesn’t have a role=list ancestor.
The core-aam spec requires that in such cases, the li element must not
be assigned the “listitem” role but instead must be treated as if it had
no role at all.
This patch ensure Headers object's associated header list
is ISO-8859-1 encoded when set using `Infra::isomorphic_encode`,
and correctly decoded using `Infra::isomorphic_decode`.
Follow-up of https://github.com/LadybirdBrowser/ladybird/pull/1893
These are non-standard and only needed internally as implementation
details in the implementation of AbstractOperations, so let's keep them
at a file-local level.
Before, libpng would use its own internal logging mechanism to print
non-fatal errors and warnings to stdout/stderr. This made it confusing
when trying to search the Ladybird codebase for those messages as they
didn't exist.
This commit uses `png_set_error_fn` from libpng to redirect those
messages to our own custom logging functions instead.
This eliminates the use of ResourceLoader in HTMLObjectElement. The spec
steps around fetching have been slightly updated since we've last looked
at this, so those are updated here.
Regarding the text test change: we cannot rely on the data: URL being
fetched synchronously. It will occur on a deferred task now. This does
match the behavior of other browsers, as they also will not have run the
fallback representation steps as of DOMContentLoaded.
There are essentially 3 URL parsing AOs defined by the spec:
1. Parse a URL
2. Encoding parse a URL
3. Encoding parse a URL and serialize the result
Further, these are replicated between the Document and the ESO.
This patch defines these methods in accordance with the spec and updates
existing users to invoke the correct method. In places where the correct
method is ambiguous, we use the encoding parser to preserve existing ad-
hoc behavior.
Previously, imported WPT tests didn't display any output if the
internals object was exposed. This change adds the condition that the
browser must also be running headlessly for test output to not be
displayed.
We are currently returning LibJS's invalid code point message, but not
formatting it with the bad value. So we get something like:
Unhandled JavaScript exception: [TypeError] Invalid code point {},
must be an integer no less than 0 and no greater than 0x10FFFF
So not only is the error unformatted, but it's inaccurate; in this case,
the byte cannot be larger than 255.
The WebIDL for the `Headers` constructor specifies that the `init`
parameter is optional and must be of type `HeadersInit`. While the
parameter can be omitted (or explicitly set to `undefined`),
`null` is not a valid value.
This change fixes at least 2 "Create headers with null should throw"
WPT subtests which I have imported in this patch.
It is the responsibility of code that deals with TypedArrays to apply
the byte offset and byte length. Not doing this caused Unity Web to
crash, as they call getRandomValues with views into their full main
memory. Previously, it would fill their entire memory of about 33.5 MB
with random bytes.
This triggers a mouse button press without the up event, allowing us to
e.g. simulate a selection by moving the mouse while keeping the button
depressed.