https://github.com/lightpanda-io/browser/pull/3619 added proper support for
Sanitizer. A consequence of that is that every setHTML/parseHTML without an
explicit creates the default Sanitizer (with its ~300 entries).
This commit creates 1 app-level default sanitizer and uses it, internally, when
none is explicitly given. The sanitizer is immutable so can safely be used
across threads.
Adjacent placeholder anchors, like a JS-driven nav, ran together as
HomeAbout. Keep the standalone line placement linked anchors get and
drop only the link syntax.
`lightpanda version.io` was rejected as a misspelt `version`, 3 edits
within the length-scaled limit. Like curl, it fetches now: the command check
shares --dump's isUrlLike.
Following some experimentation, this sets M_MMAP_THRESHOLD to 128K on linux
builds IF it isn't explicit set, e.g. via the `MALLOC_MMAP_THRESHOLD_` env. This
allows users explicitly set it if they want.
I've been looking at this for a while, but my understanding is still basic. The
simplistic explanation is that glibc's allocator internally uses arenas.
Allocations above THRESHOLD skip these arenas and are allocated directly from
and freed directly to the OS. Allocations under this threshold are released
to the arena where they can be re-used. Everything works OK, EXCEPT for when it
comes time to release the memory from these arenas back to the OS. If free arena
memory is pinned under live memory, it cannot be released.
Various online posts / comments reference glibc as suffering from significant
fragmentation and "holding" onto memory. That's the behavior that we've seen.
Further, calls to malloc_trim reclaim the lost memory, so what we're seeing
aren't leaks.
Since AttachedSession is already heap-based, it's inspector_session is at a
fixed address and thus can own the session.
Also, hook in some noop callbacks on deinit.
Encode the !important'ness of a rule into its priority (we have the bit to
spare). This keeps the !important calculation the build-side, not the read side
and is more consistent with how the StyleManager generally works.
CSSStyleDeclaration `getPropertyValue` is now !important aware. Whereas before
an inline value would always win, it now cedes to an !important stylesheet rule
While the token list itself is readonly, the attribute itself is settable. For
example, HTMLOutputElement's htmlFor says:
"Although the htmlFor property itself is read-only in the sense that you can't
replace the DOMTokenList object, you can still assign to the htmlFor property
directly"
`Inspector` now supports several sessions; `startSession` allocates one (the V8 channel keeps its address) and `stopSession` frees it. They all connect to the same context group so every session see every context.
`BrowserContext.session_id` stays the primary session's id for the many event call sites.
Tag chips like <a class="tag">x</a> pushed short quotes on
quotes.toscrape.com/js/ over the 0.2 link-density limit, so
--strip-mode clutter pruned them as navigation.
Playwright's `browserContext.newCDPSession` must get its response on that session, not the primary one. Playwright keys its pending callbacks by session, finds none for that id, and throws
"Assertion error", which takes the whole process down.
Addresses #1838 and #1839.