Builds ontop of https://github.com/lightpanda-io/browser/pull/3200 to centralize
header enforcement and standardize merge vs overwrite header logic.
The API is still a `setHeader` and `appendHeader`, with a source, but set/append
both are thin wrappers around private `putHeader`. putHeader blocks overwriting
restricted headers (user-agent). The `source` acts as a priority (ordered enum)
which further restricts the header AND depending on whether set or append were
called, controls if the value is overwritten or appended to.
3200 had an always-append which can cause problems, e.g. a script setting
Accept-Language: fr would have results in the value being appended to the
default, e.g.: 'en-US,en;q=0.9, fr'.
`Connection`: update tests
`Server.zig`: add a test for origin check at handshake + update tests
`help.zon`: entry for `--remote-allow-origins`
`Connection`: only look for existence of `Origin` header key alone
Also reworks `Host` header check to IP alone.
update tests
remove `--remote-allow-origins` flag
`Connection`: reject on `Origin`
`Connection`: prefer `parseLiteral` + return early from `Origin` check
update tests
Apparently, any type that ah indexed property also gets an iterator, even if
the iterator isn't explicitly listed in the spec. This showed up as a bug
rendering washingtonpost.com.
--http-cache-entry-limit is currently implemented as a hard-limit via a check
on every put. For a large --http-cache-entry-limit, this can result in a non-
trivial delay on every http get.
This commit calls cache.maintenance() on Browser.deinit and on startup.
maintenance:
1 - purges stale entries
2 - enforces the limit
With concurrent requests, the number of entries can easily exceed the limit by
hundreds of entries (but this is temporary).
CustomElement reactions (connected/disconnected) need to pierce the shadowdom.
This represents a potentially expensive treewalk on some common operations (add
/remove). That walk requires checking Frame._customized_builtin_definitions and
Frame._element_shadow_roots on every element. EXPENSIVE.
So, a packed _flags: Flags struct is added to Elements which is used to signal
that the element is present in Frame._customized_builtin_definitions and
Frame._element_shadow_roots (1 bool per lookup). Element has spare padding, so
this currently costs no memory. There's spare space in the flag which we should
use for the other hot lookups, but I'll do that in a separate commit.
Because of this new optimized flag, the change touches a few more files than
just the CE reaction change. (Any place that accessed those two Frame lookups
directly now go through a helper which first checks the flag).
Also added a bunch of Element aria getter/setter.
(All of this was done while looking at various /custom-elements/ WPT failures).
Assuming the conditions are met for -dev_fast to work (linux, debug, x86-64
without sanitizers), the -dev_fast now defaults to true.
download-v8 make target always downloads the .a (as before) and on linux x86-64
it also downloads the .so.
Some WPT tests just take more memory, e.g. shadow-dom/declarative/gethtml.html.
Also left some placeholder comments for profiling JS (which I used to make sure
this was just v8 memory usage). These placeholders used to exist but didn't
survive the session multi-page refactor (figured I'd fix it next time I needed
it, and now I needed it).
Supports prebuild-v8 shared library and adds a `download-v8-shared` make target.
Depends on: https://github.com/lightpanda-io/zig-v8-fork/pull/198
The auto-discovery of the .so is done in the build.zig, which is different than
the auto-discovery of the .a which is done in the Makefile. This is intentional
and if we inverse -Ddev_fast so that it's on by default, the .a's auto discovery
will be moved to build.zig for consistency and explicitness. As-is, we have no
way to tell whether -Dprebuilt_v8_path=v8.a is being injected by Makefile or
is explicit (which isn't a problem so long as we're not doing dev_fast by
default).
Saw a non-fatal error on cnn.com related to console. All members are supposed
to be static. Ran it through WPT /console/ and improved a few different thigns:
- added dir and dirxml
- assert condition is optional