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)
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)
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)
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)
Which fixes the following WPT test from failing due to issues stemming
from all of the windows which have been opened.
https://wpt.live/url/failure.html
This will give us 1205 new subtests passing in WPT.
(cherry picked from commit f2134dc1e960cb1d0c743b375509fe165885ddbe)
Aligning with a spec update, fixing 195 tests for:
https://wpt.live/url/failure.html
(cherry picked from commit ea971792b5da5f10cadb4f88f49c9722d88b32f6)
This aligns with an update to the HTML specification which instead
stores these promises on the global object instead of the settings
object.
It also makes progress towards implementing the ShadowRealm proposal
as these promises are not present in the 'synthetic' realm for that
proposal.
(cherry picked from commit 1096b6493668724ff9776929339e40b33213f410)
Replaced the ad-hoc implementation with a spec compliant one.
This change fixes 36 WPT tests.
(cherry picked from commit 50f642613de54c73473c216fdc4d7e607e712679)
Previously, we would crash if scripting was disabled and a javascript
URL was evaluated.
(cherry picked from commit 57f82c029c1f66c516650d96c176ba0f47da0f78)
This change takes all existing WebIDL files in the repo that had
definition lines without four leading spaces, and fixes them so they
have four leading spaces.
(cherry picked from commit 51528ec6779202747cc3b99d3b77772a124a0b47)
This is an ad-hoc change to account for the fact that we may run
arbitrary code while waiting for the tasks in this function to complete.
I don't have a way to reproduce it, but I've seen trouble caused by
navigables disappearing, which causes the history step numbers to be
disturbed.
(cherry picked from commit ac48222ed7b497b13343ec79a234ba432ffd29e2)
The HTML tokenizer specification says that we're supposed to do this
when leaving the Attribute name or when emitting the token, as
appropriate.
Hopefully 'as appropriate' can mean only when emitting the token, as
that's the easiest place to insert this logic without complicating the
tokenizer any more.
(cherry picked from commit 7aa0165fe75bb94b79bc847484c7913d249ce263)
Applies changes in https://github.com/whatwg/html/pull/10658 and also
whichever previous change split the step for firing the navigateerror
into two parts.
(cherry picked from commit ec15f8fa626e5b0faf5b3e420080e944ab31ff11)
Fixes crashing on https://playbiolab.com/ in
VERIFY(page.client().is_ready_to_paint()) caused by attempting to start
the next repaint before the ongoing repaint is done.
(cherry picked from commit f341af1d7265eee880355f10ef5d479c9ebceaf2)
We now use the "report an exception" AO when a script has an execution
error. This has mostly replaced the older "report the exception" AO in
various specifications. Using this newer AO ensures that
`window.onerror` is invoked when a script has an execution error.
(cherry picked from commit 579a289d3db849657987c3310e7b1d71d290b566)
This mainly uses forward declarations as appropriate for input element
related files. This reduces the number of targets being built when we
change HTMLInputElement.h from 430 to 44.
(cherry picked from commit 57e4fb0caebb0074a23bef70d7558ce5e8a5f357)
If we decide to fetch another linked resource, we don't care about the
earlier fetch and can safely abort it.
This fixes an issue on GitHub where we'd load the same style sheet
multiple times and invalidate style for the entire document every time
it finished fetching.
By aborting the ongoing fetch, no excess invalidation happens.
(cherry picked from commit 57e26ed6b9b2c0cf1e4f5ac3e85ca0c7f3647caa)
This fixes an issue where document.write() with only text input would
leave all the character data as unflushed text in the parser.
This fixes many of the WPT tests for document.write().
(cherry picked from commit a0ed12e839f14b3ac80caca0e18a09ca256fd99d)
Instead of trying to locate the relevant StyleSheetList on style element
removal from the DOM, we now simply keep a pointer to the list instead.
This fixes an issue where using attachShadow() on an element that had
a declarative shadow DOM would cause any style elements present to use
the wrong StyleSheetList when removing themselves from the tree.
(cherry picked from commit 8543b8ad6a4d96bd0c247052572b8c2abf3929a7)
This change moves the `crypto()` getter from `Window` to
`WorkerOrWindowGlobalScope`. This aligns our implementation with the
WebCrypto specification.
(cherry picked from commit 89b6cd3fb1b9a3058dbada9e12606950b466936a)
Previously `#keyword` was used in the macro, meaning all keywords
gained `""` around them
(cherry picked from commit d828d80b756468eb343aec074e7c9944d129437f)
This commit implements the setter for `location.search`, allowing
updates to the query string of the URL.
(cherry picked from commit 514a2a1757b10b9b4ff020237c84f70ba5a79c4b)
This allows us to use HeapFunction all of the way down, allowing us
to remove the Handle usage in after_session_callback for
create_new_child_navigable.
(cherry picked from commit fc83653f3c7a650229d2be3eef0f1738a9395db9)
...For the completion steps. This is quite nice, as we can simply
capture this in the heap function where it is used instead of
needing to establish a new root.
Note that with these changes, to represent 'an empty algorithm', we now
use a null HeapFunction and do not invoke the steps.
(cherry picked from commit b6d2ab23322ebc6d667276257220c401fe025617)
If given, the spec expects the input URL to be manipulated on the fly
as it is being parsed, and may ignore any errors thrown by the URL
parser.
Previously, we were not exactly following the specs assumption here
which resulted in us needed to make awkward copies of the URL in these
situations.
For most cases this is not an issue. But it does cause problems for
situations where URL parsing would result in a failure (which is
ignored by the caller), and the URL is _partially_ updated
while parsing.
Such a situation can occur when setting the host of an href alongside a
port number which is not valid. It is expected that this situation will
result in the host being updates - but not the port number.
Adjust the URL parser API so that it mutates the URL given (if any), and
adjust the callers accordingly.
Fixes two tests on https://wpt.live/url/url-setters-a-area.window.html
(cherry picked from commit ff71d8f2c97441bff5975c117a7e7c8820e33e44)
Rather than returning a relative URL, an absolutized URL is now
returned relative to the document base URL
(cherry picked from commit 48e5d28ec985aeaee565d06a625a0d664b6975d3)
This change also ensures that relative URLs are resolved relative to
the document's base URL.
(cherry picked from commit c25dda767eb43d1620602ccc2c955bc56ef1745b)