Adds the Geolocation and GeolocationPositionError interfaces plus a
navigator.geolocation accessor. getCurrentPosition schedules delivery
on the frame's js.Scheduler so callbacks always fire off the calling
stack, and covers the no-override path where no
Browser.geolocation_override is set: the error callback receives a
GeolocationPositionError with code POSITION_UNAVAILABLE (2), or
PERMISSION_DENIED (1) if the geolocation permission was denied via
CDP. Reading an override into a successful GeolocationPosition and
watchPosition/clearWatch are left for later work.
The unconditional full load incurs a performance hit in the common case where
the about:blank is safe to use. This commit restores the fast-path only when
(a) the page is waiting for its initial navigate (same as before) and (b)
no Runtime.* methods were executed (i.e. no driver-driven JS was executed on
about:blank)
We currently implement a v8 signature check on the receiver. This throws on
failure. However, for a promise-returning function, it should reject the
promise instead. This skips the (v8) signature check for promise-returning so
that it flows through the normal code which does rejection.
Fixes a few WPT cases (in fetch and FileAPI, but probably others too).
This reject, don't throw, is an ongoing thing that we're fixing, e.g.
https://github.com/lightpanda-io/browser/pull/3095
Hooks into the xml5ever parse_error callback to capture parse errors and reject
malformed XML. Because of this stricter error handling, we need to do some
input pre-processing for edge cases (thank you WPT). We need to strip out
<!DOCTYPE svg [ <!ENTITY ...> ]> which comes form Illustrator SVG export since
that now causes errors (but should be ignored).
Finally, by default xml5ever closes any opened tags at the end of the stream.
Per WPT, these should be invalid.
The rust work was all Claude-driven.
If we have a materialized element.style (stored in Frame._element_styles) and
the style attribute changes (e.g. via setAttribute('style', '....'), then the
materialized CSSStyleDeclaration has to be updated (cleared and the style
re-parsed)
FileReader.readAs* now do their processing (and fires events) asynchronously on
the next scheduler tick. readAsText also now uses its encoding argument using
html5ever.encoding_decode (added for TextDecoder's encoder support).
FileReaderSync is a new (simple) Worker-only API.
A JS global set on a freshly-created target's initial about:blank page
survived the first Page.navigate: the CDP fast path navigated the active
blank frame in place, reusing its V8 context/global. A cross-document
navigation must replace the JS global object, so route every root
navigation through initiateRootNavigation, which commits a fresh
page/window/global and discards the bootstrap blank one (matching the
already-correct second-navigation behavior).
I don't know why, but I had assumed libcurl wouldn't give us a 1 byte buffer. It
did. This adjusts the send path so that it works when given a 1 byte buffer (
instead of failing an assertion).
Mime.isHttpToken already exists for the header name, added
Mime.isHttpHeaderValue which was extracted from het/Headers.zig. Now Config (
for validating CLI headers), net/Headers for script headers, and cdp/network.zig
all use the same validation methods.
WPT /performance-timeline/po-mark-measure.any.html in debug (can pass in release
since this is UB). Performance observers disconnected during callback are only
removed after the run completes.
This is almost all Claude driven. I guided it for the arena/finalizer, asserted
it's unit test work in Firefox, and WPT'd the result. (WPT 15/2440 -> 2440/2440)
It's a single WebAPI interface that isn't used from within Zig.
https://github.com/lightpanda-io/browser/pull/3195 introduced a Flags within the
padding of Element to avoid map lookups on the shadow dom piercing hot path.
This does the same thing for Node for Frame._assigned_slots. Node also has spare
padding,and this lookup happens on every hot of every event path.
/html/editing/activation/click_checkbox.html is a DCHECK crash (debug only) and
just a failure in ReleaseFast.
click() handler shouldn't trigger its own click(). Click is singled out for this
behavior, which is 'do nothing':
https://html.spec.whatwg.org/multipage/interaction.html#click-in-progress-flag
Used the new Element flags. There's a simple way to implement this in
EventManager, but the element flag is cheaper and it's currently not used. If
someone ever needs that bit, they can implement the stack-based solution.
Deduplicate the three executable blocks and the vendored C library
module setup, drop vestigial error unions, and replace hand-rolled
formatting with b.fmt/b.pathJoin/std.mem.concat.
The snapshot-creator and skills executables now get the same
sanitize_c/sanitize_thread flags as the browser executable, which
they were silently missing.
Prebuilt V8 discovery now reports every cache miss with the probed
path. Previously a miss on the static archive path fell back to the
source build without a message, and the dev_fast message claimed a
source build was starting when the graph might not compile anything.
This fixes a WPT crash on /html/semantics/forms/the-label-element/clicking-noninteractive-labelable-content.html
The short of it is that a label activates a click on a different element (it's
the only element that does this), and if that element is inside the label and
has its own activation behavior, you end up in an infinite loop.