You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
applyThinScrollbarsEverywhere now follows iframe, frame, object, and embed into the same-origin pages they hold, as deeply as those nest, and
restyles a framed page when it navigates.
Each framed page needs its own sheet (a constructable one is refused by any
other document) and its own attachShadow patch. Realm-agnostic tests
throughout: instanceof answers for one realm only.
Cross-origin and allow-same-origin-less frames stay out of reach.
Review pass: three cross-realm faults found and fixed in 00f598f.
patchRoot remembered its owner document. A shadow host adopted into another same-origin document kept being handed the old document's sheet, which the new one refuses. The owner is now read afresh on every call, via a restored ownerOf.
A root was flagged observed before it was known to be observable.observedRoots.add ran ahead of the defaultView !== null check, so a root first seen in a window-less document was recorded as watched and never got an observer. The null check now returns first.
instanceof was asked of the document's realm, not the node's. A node built in one realm keeps that realm's prototypes after adoption, so whole subtrees were skipped in silence. Element and frame tests are now nodeType and localName, which belong to no realm, and framedDocumentOf reads contentDocument/getSVGDocument through a type predicate instead of a four-branch instanceof chain.
Also folded in: the attachShadow patch is keyed by Element.prototype rather than by document, so a frame showing about:blank before its real page no longer wraps the same prototype twice.
Measured against a throwaway harness, before and after:
before
after
host adopted into another document
0 sheets, 2 uncaught NotAllowedError
1 sheet, 0 errors
frame inside a root first seen window-less
auto
thin
subtree built in another realm, then adopted
auto
thin
The example page still reports thin at all eight depths. deno check, deno lint, deno fmt --check, and deno task build pass.
Merged main (Node + Vite+ tooling) into this branch. The frame code now lives in src/scrollbars/index.ts; patchRoot is split into sheetOf and observeRoot for max-statements, the attachShadow patch uses main's NativeAttachShadow typing, and the description moved from scripts/build-npm.ts to package.json. vp check, vp test, and vp pack pass, and CI is green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
applyThinScrollbarsEverywherenow followsiframe,frame,object, andembedinto the same-origin pages they hold, as deeply as those nest, andrestyles a framed page when it navigates.
Each framed page needs its own sheet (a constructable one is refused by any
other document) and its own
attachShadowpatch. Realm-agnostic teststhroughout:
instanceofanswers for one realm only.Cross-origin and
allow-same-origin-less frames stay out of reach.