While a key of length zero seems like a bad idea in general, the WPT
tests end up calling exactly this, so we need to support it one way or
another.
(cherry picked from commit e1c3e212defe92b4afe36e8184ffda5a08d0abdb)
This change implements the https://w3c.github.io/accname/#comp_append
step in the “Accessible Name and Description Computation” spec — so that
when an accessible name is computed from multiple sources in a document
subtree, the parts of the computed text are joined together with spaces.
Otherwise without this change, in accessible names computed from
multiple sources in a document subtree, the parts of the computed text
are unexpectedly run together, with no spaces between the parts.
(cherry picked from commit 3ba7c536681e8471e9b53aaf8e5dd32d801e26e4)
This adds the following behavior for the DOM node/attribute editor in
the Inspector:
* If the user double clicks on an attribute name, the name is selected.
* If the user double clicks on an attribute value, the value text (sans
the surrounding quotes) is selected.
* Otherwise, double clicks select the entire text range.
(cherry picked from commit 7fff00972d667e7c83ed0336dc8e7f8ddbd91298)
For example, if the shadow root was detached from the document in some
manner, its host will be null.
(cherry picked from commit 8fb2cc2be1d7a63eba7b1ae5c93e3db181ca393f)
This allows for coming up with coordinates that work on macOS with a DPR
of 2 more easily.
(cherry picked from commit 59fe7ca8300ca64ad92e47a694ee352e8f99a1f8)
Otherwise, it looks a bit awkward where the cursor position does not
update while the selection is elsewhere.
Note that this requires passing along the raw selection positions from
`set the selection range` to the elements. Otherwise, consider what will
happen if we set the selection start and end to the same value. By going
through the API accessor, we hit the case where the start and end are
the same value, and return the document cursor position. This would mean
the cursor position would not be updated.
The test changes here more closely match what Firefox produces now. It
is not a 100% match; the `select event fired` test case isn't right. The
problem is the event fires for the input element, but we most recently
focused the textarea element. Thus, when we retrieve the selection from
the input element, we return the document's cursor position, which is
actually in the textarea element. The fix will ultimately be to fully
implement the following:
https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-textarea/input-cursor
That is, each input / textarea element should separately track its own
text cursor position.
(cherry picked from commit fd289deb44e0fc26f54a133c637c136bf0716cd5)
UI event handlers currently return a boolean where false means the event
was cancelled by a script on the page, or otherwise dropped. It has been
a point of confusion for some time now, as it's not particularly clear
what should be returned in some special cases, or how the UI process
should handle the response.
This adds an enumeration with a few states that indicate exactly how the
WebContent process handled the event. This should remove all ambiguity,
and let us properly handle these states going forward.
There should be no behavior change with this patch. It's meant to only
introduce the enum, not change any of our decisions based on the result.
(cherry picked from commit 541968b30dc50208f473566498100769711f10c8;
amended to fix tiny conflict in ConnectionFromClient.h due to serenity
not having #1182 yet)
There's no reason to parse this again and again every time we parse an
XHTML document.
(cherry picked from commit 24c2ad059b9523711bd468ef50d613366c557499)
These come from string literals and compiletime-known values, no need to
allocate a ByteString.
(cherry picked from commit fd5ee06bbf4e9872827ffb4324758e8beeb780de)
...unless specified otherwise explicitly.
This is dervied from an interpretation of a note in the html5 spec at
https://html.spec.whatwg.org/#xml
(cherry picked from commit 5c23ef1596b954da2515f00c7a939809cd7c4fb4)
Instead of saying "expected />", make the parser output the real cause
for the following ("unknown reference"):
<foo>&unknown;</foo>
(cherry picked from commit 202bfabdc6c18d1dd760d5157a7a3269bb82cfd9)
Also updates a LibWeb text test that used to report the wrong line
number.
(cherry picked from commit 02b50d463b174e5d525c7ab8ce8dd173d550de28;
amended to exclude LineTrackingLexer from KERNEL, since that now use
make<>)
This is necessary for the next commit (and might even help performance
in some very weird cases).
(cherry picked from commit e5f87eb12bdad9dfbf8a825461ac17fdb8457f50;
amended to add a missing include of StdLibExtras.h for move())
We should only block the escape key from being sent to the web page if
the CloseWatcherManager actually closed something.
We use the escape key in the Inspector to cancel editing a DOM field.
This unconditional early return broke this feature.
(cherry picked from commit 099956a7cd2bec55e7e0376d54525f8a3f7b1955)
That helps to pass WPT tests
under webaudio/the-audio-api/the-biquadfilternode-interface/ctor-biquadfilter.html
(cherry picked from commit c78c7064228d41d2afddeba3a3900f0c772d7be4)
The cols and rows attributes are limited to only positive numbers with
fallback. The cols IDL attribute's default value is 20. The rows IDL
attribute's default value is 2.
The default value was returned only for the negative number. I added an
additional check for the case when the attribute is 0 to match the
specification.
(cherry picked from commit 205155a7abb9b9754cd0917901cfc04d86291820)
That helps to pass more WPT tests
under /webaudio/the-audio-api/the-dynamicscompressornode-interface/ctor-dynamicscompressor.html
(cherry picked from commit 8ac60273a69cd900e744c375a5650438e9692b05)
That helps to pass more WPT tests
under /webaudio/the-audio-api/the-dynamicscompressornode-interface/ctor-dynamicscompressor.html
(cherry picked from commit f2ed59879f7781019152a18740fc5743cc513016)
If we don't reject the Promise, it lasts forever,
so rejecting non implemented Promises is essential,
to not timeout in e.g. WPT tests
(cherry picked from commit aab5a9e944f8b1c1a9de321047556bbcaa282a56)
This fixes an issue where https://hey.com/ was horizontally scrollable
even though it shouldn't be.
(cherry picked from commit 94721385ceb17e20428b94a946d39828bdd5b74e)
https://www.w3.org/TR/event-timing/#sec-performance-event-timing
Add idl, header and stubs for PerformanceEventTiming interface.
Two missing `PerformanceEntry` types that have come up in issues
are the `first-input` and the `event` entryTypes. Those are both
this.
Also, because both of those are this same interface, the static
methods from the parent class are difficult to implement because
of instance-specific details. Might either need subclasses or to
edit the parent and also everything that inherits from it :/
(cherry picked from commit d30ae92b82d997bc4db407c563c88f90d8260093)
Previously, any message logged to the console within a worker with a
log level greater than trace was printed twice.
(cherry picked from commit d0008ae5e0100984f3188c32a67008a03c05bea8)
Removes the unnecessary separator, redundant open action, and changes
shortcuts to match other browsers.
(cherry picked from commit 1f365ba44a2f95006121f689429e2f58db30bc5b)
There is still some work to do with some of the underying methods
called inside this method (e.g is_css_connected) but this is a start.
(cherry picked from commit 14d62d7f31e49e021332f3e64e6ea4b285dcdd15)
Transitions are currently not implemented for pseudo elements which
causes the transition to be applied to the "real"/"parent" element. When
a transition adjusts width/height on a pseudo element this causes the
real elements layout to break.
As a quick fix we just skip doing transitions when they are against
pseudo elements.
(cherry picked from commit 30f59cfe1aec0b385631a40da8b2447eed62ad79)