buninu-browser 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +13 -0
- package/Architecture.md +601 -0
- package/LICENSE +21 -0
- package/LICENSES/Apache-2.0.txt +202 -0
- package/LICENSES/BSD-3-Clause-Skia.txt +29 -0
- package/LICENSES/Bitstream-Vera.txt +44 -0
- package/LICENSES/CC-BY-4.0.txt +396 -0
- package/LICENSES/OFL-1.1.txt +91 -0
- package/LICENSES/README.md +9 -0
- package/LICENSES/acorn.txt +21 -0
- package/LICENSES/chromium.txt +27 -0
- package/LICENSES/dropflow.txt +19 -0
- package/LICENSES/emscripten.txt +102 -0
- package/LICENSES/freetype.txt +169 -0
- package/LICENSES/happy-dom.txt +22 -0
- package/LICENSES/harfbuzz.txt +42 -0
- package/LICENSES/icu.txt +512 -0
- package/LICENSES/libjpeg-ijg.txt +260 -0
- package/LICENSES/libjpeg-turbo.txt +147 -0
- package/LICENSES/libpng.txt +134 -0
- package/LICENSES/libwebp.txt +30 -0
- package/LICENSES/ses-aura.txt +16 -0
- package/LICENSES/ses-caja.txt +13 -0
- package/LICENSES/ses-corejs.txt +19 -0
- package/LICENSES/ses-v8.txt +9 -0
- package/LICENSES/ses.txt +201 -0
- package/LICENSES/termdom.txt +21 -0
- package/LICENSES/wasmpeg.txt +501 -0
- package/LICENSES/woff2.txt +19 -0
- package/LICENSES/wuffs.txt +211 -0
- package/LICENSES/zlib.txt +22 -0
- package/Linux +0 -0
- package/PORTING.md +825 -0
- package/README.md +283 -0
- package/THIRD_PARTY_NOTICES.md +224 -0
- package/bunfig.toml +2 -0
- package/buninu-browser.js +65 -0
- package/index.js +149 -0
- package/lib/cdp-server.js +1424 -0
- package/lib/cdp.js +203 -0
- package/lib/happy-dom/entities-adapter.js +51 -0
- package/lib/happy-dom/image-size-adapter.js +8 -0
- package/lib/happy-dom/mime-type-adapter.js +27 -0
- package/lib/happy-dom/parser.js +53 -0
- package/lib/happy-dom/websocket-adapter.js +62 -0
- package/lib/headless-shell.js +362 -0
- package/lib/input/hit-test.js +78 -0
- package/lib/layout/scroll-viewport.js +53 -0
- package/lib/layout/text-layout.js +2236 -0
- package/lib/log.js +85 -0
- package/lib/network/cookie-jar.js +178 -0
- package/lib/network/network-service.js +268 -0
- package/lib/network/resolver.js +97 -0
- package/lib/paint/display-list.js +359 -0
- package/lib/paint/frame.js +88 -0
- package/lib/paint/gradient.js +207 -0
- package/lib/render-tree/index.js +263 -0
- package/lib/render-tree/svg.js +210 -0
- package/lib/renderer/bindings.js +1291 -0
- package/lib/renderer/compositor.js +123 -0
- package/lib/renderer/flags.js +20 -0
- package/lib/renderer/host.js +503 -0
- package/lib/renderer/main.js +234 -0
- package/lib/renderer/module-transform.js +399 -0
- package/lib/renderer/page-realm.js +1471 -0
- package/lib/renderer/page-renderer.js +1691 -0
- package/lib/renderer/script-rewrite.js +232 -0
- package/lib/renderer/seccomp.js +215 -0
- package/lib/renderer/syscall-numbers.js +139 -0
- package/lib/style/computed-style.js +2053 -0
- package/package.json +39 -0
- package/patches/happy-dom/0001-use-bun-entity-adapter.patch +15 -0
- package/patches/happy-dom/0002-use-bun-platform-adapters.patch +69 -0
- package/patches/happy-dom/README.md +38 -0
- package/test/chromium-headless-shell +5 -0
- package/test/compositor.test.js +154 -0
- package/test/computed-style.test.js +434 -0
- package/test/display-list.test.js +128 -0
- package/test/entities-adapter.test.js +43 -0
- package/test/fixtures/fake-renderer.js +26 -0
- package/test/fixtures/seccomp-child.js +32 -0
- package/test/fixtures/video.mp4 +0 -0
- package/test/flex.test.js +150 -0
- package/test/gradient.test.js +56 -0
- package/test/grid.test.js +253 -0
- package/test/happy-dom-platform-adapters.test.js +18 -0
- package/test/headless-shell.test.js +318 -0
- package/test/hit-test.test.js +49 -0
- package/test/html-parser.test.js +40 -0
- package/test/index.test.js +29 -0
- package/test/log.test.js +40 -0
- package/test/mobile.test.js +85 -0
- package/test/network-service.test.js +214 -0
- package/test/page-scripts.test.js +552 -0
- package/test/poc-backend.js +189 -0
- package/test/poc-backend.test.js +154 -0
- package/test/positioning.test.js +112 -0
- package/test/render-tree.test.js +103 -0
- package/test/renderer-host.test.js +69 -0
- package/test/resolver.test.js +51 -0
- package/test/script-rewrite.test.js +31 -0
- package/test/scroll-viewport.test.js +25 -0
- package/test/seccomp.test.js +71 -0
- package/test/site-isolation.test.js +74 -0
- package/test/svg.test.js +61 -0
- package/test/text-layout.test.js +419 -0
- package/usr/README.md +20 -0
- package/usr/lib/canvaskit/LICENSE +29 -0
- package/usr/lib/canvaskit/canvaskit.js +264 -0
- package/usr/lib/canvaskit/canvaskit.wasm +0 -0
- package/usr/share/fonts/DejaVuSansMono-Bold.ttf +0 -0
- package/usr/share/fonts/DejaVuSansMono.ttf +0 -0
- package/usr/share/fonts/LICENSE-Apache-2.0.txt +202 -0
- package/usr/share/fonts/LICENSE-DejaVu.txt +44 -0
- package/usr/share/fonts/LICENSE-OFL-1.1.txt +91 -0
- package/usr/share/fonts/NotoColorEmoji.ttf +0 -0
- package/usr/share/fonts/NotoColorEmojiFlags.ttf +0 -0
- package/usr/share/fonts/NotoSansCJK-Regular.ttc +0 -0
- package/usr/share/fonts/NotoSansSymbols-Regular-Subsetted.ttf +0 -0
- package/usr/share/fonts/NotoSansSymbols-Regular-Subsetted2.ttf +0 -0
- package/usr/share/fonts/Roboto-Regular.ttf +0 -0
- package/usr/share/fonts/fonts.json +28 -0
- package/vendor/acorn/LICENSE +21 -0
- package/vendor/acorn/README.md +309 -0
- package/vendor/acorn/dist/acorn.mjs +6313 -0
- package/vendor/acorn/package.json +50 -0
- package/vendor/happy-dom/.editorconfig +8 -0
- package/vendor/happy-dom/.eslintignore +6 -0
- package/vendor/happy-dom/.eslintrc.cjs +188 -0
- package/vendor/happy-dom/.github/CODEOWNERS +2 -0
- package/vendor/happy-dom/.github/FUNDING.yml +1 -0
- package/vendor/happy-dom/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
- package/vendor/happy-dom/.github/ISSUE_TEMPLATE/custom.md +10 -0
- package/vendor/happy-dom/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
- package/vendor/happy-dom/.github/PULL_REQUEST_TEMPLATE.md +27 -0
- package/vendor/happy-dom/.github/workflows/auto-assign.yml +23 -0
- package/vendor/happy-dom/.github/workflows/pull_request.yml +53 -0
- package/vendor/happy-dom/.github/workflows/release.yml +143 -0
- package/vendor/happy-dom/.husky/pre-commit +1 -0
- package/vendor/happy-dom/.prettierignore +1 -0
- package/vendor/happy-dom/.prettierrc.cjs +6 -0
- package/vendor/happy-dom/.vscode/extensions.json +3 -0
- package/vendor/happy-dom/CODE_OF_CONDUCT.md +128 -0
- package/vendor/happy-dom/CONTRIBUTING.md +147 -0
- package/vendor/happy-dom/LICENSE +21 -0
- package/vendor/happy-dom/README.md +62 -0
- package/vendor/happy-dom/SECURITY.md +12 -0
- package/vendor/happy-dom/cspell.json +34 -0
- package/vendor/happy-dom/docs/happy-dom-logo.jpg +0 -0
- package/vendor/happy-dom/integration-test/.editorconfig +8 -0
- package/vendor/happy-dom/integration-test/LICENSE +21 -0
- package/vendor/happy-dom/integration-test/README.md +1 -0
- package/vendor/happy-dom/integration-test/package.json +24 -0
- package/vendor/happy-dom/package-lock.json +15520 -0
- package/vendor/happy-dom/package.json +55 -0
- package/vendor/happy-dom/packages/@happy-dom/global-registrator/LICENSE +21 -0
- package/vendor/happy-dom/packages/@happy-dom/global-registrator/README.md +60 -0
- package/vendor/happy-dom/packages/@happy-dom/global-registrator/package.json +52 -0
- package/vendor/happy-dom/packages/@happy-dom/global-registrator/register.js +2 -0
- package/vendor/happy-dom/packages/@happy-dom/global-registrator/src/GlobalRegistrator.ts +121 -0
- package/vendor/happy-dom/packages/@happy-dom/global-registrator/src/index.ts +3 -0
- package/vendor/happy-dom/packages/@happy-dom/global-registrator/tsconfig.json +30 -0
- package/vendor/happy-dom/packages/@happy-dom/jest-environment/LICENSE +21 -0
- package/vendor/happy-dom/packages/@happy-dom/jest-environment/README.md +71 -0
- package/vendor/happy-dom/packages/@happy-dom/jest-environment/package.json +93 -0
- package/vendor/happy-dom/packages/@happy-dom/jest-environment/src/index.ts +192 -0
- package/vendor/happy-dom/packages/@happy-dom/jest-environment/tsconfig.json +30 -0
- package/vendor/happy-dom/packages/@happy-dom/node-canvas-adapter/README.md +48 -0
- package/vendor/happy-dom/packages/@happy-dom/node-canvas-adapter/package.json +41 -0
- package/vendor/happy-dom/packages/@happy-dom/node-canvas-adapter/src/CanvasAdapter.ts +275 -0
- package/vendor/happy-dom/packages/@happy-dom/node-canvas-adapter/src/index.ts +1 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/LICENSE +21 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/README.md +100 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/bin/src/happy-dom-sr.ts +30 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/package.json +62 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/ServerRenderer.ts +368 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/ServerRendererBrowser.ts +142 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/ServerRendererBrowserWorker.ts +29 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/ServerRendererPage.ts +305 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/ServerRendererPageWorker.ts +55 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/ServerRendererServer.ts +332 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/config/DefaultServerRendererConfiguration.ts +47 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/enums/ServerRendererLogLevelEnum.ts +9 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/enums/ServerRendererModeEnum.ts +8 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/index.ts +19 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/types/IOptionalServerRendererConfiguration.ts +127 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/types/IServerRendererConfiguration.ts +126 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/types/IServerRendererItem.ts +6 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/types/IServerRendererResult.ts +11 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/utilities/BrowserWindowPolyfill.ts +138 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/utilities/HelpPrinter.ts +36 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/utilities/HelpPrinterRows.ts +288 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/utilities/PackageVersion.ts +12 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/utilities/ProcessArgumentsParser.ts +387 -0
- package/vendor/happy-dom/packages/@happy-dom/server-renderer/src/utilities/ServerRendererConfigurationFactory.ts +91 -0
- package/vendor/happy-dom/packages/happy-dom/LICENSE +21 -0
- package/vendor/happy-dom/packages/happy-dom/README.md +42 -0
- package/vendor/happy-dom/packages/happy-dom/package.json +58 -0
- package/vendor/happy-dom/packages/happy-dom/src/PropertySymbol.ts +431 -0
- package/vendor/happy-dom/packages/happy-dom/src/animation/Animation.ts +273 -0
- package/vendor/happy-dom/packages/happy-dom/src/animation/AnimationTimeline.ts +15 -0
- package/vendor/happy-dom/packages/happy-dom/src/animation/DocumentTimeline.ts +33 -0
- package/vendor/happy-dom/packages/happy-dom/src/animation/KeyframeEffect.ts +295 -0
- package/vendor/happy-dom/packages/happy-dom/src/async-task-manager/AsyncTaskManager.ts +340 -0
- package/vendor/happy-dom/packages/happy-dom/src/async-task-manager/AsyncTaskManagerDebugError.ts +14 -0
- package/vendor/happy-dom/packages/happy-dom/src/base64/Base64.ts +97 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/Browser.ts +123 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/BrowserContext.ts +100 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/BrowserFrame.ts +232 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/BrowserPage.ts +205 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/BrowserSettingsFactory.ts +96 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/DefaultBrowserSettings.ts +67 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/detached-browser/DetachedBrowser.ts +129 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/detached-browser/DetachedBrowserContext.ts +103 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/detached-browser/DetachedBrowserFrame.ts +250 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/detached-browser/DetachedBrowserPage.ts +218 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/enums/BrowserErrorCaptureEnum.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/enums/BrowserNavigationCrossOriginPolicyEnum.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/types/IBrowser.ts +51 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/types/IBrowserContext.ts +44 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/types/IBrowserFrame.ts +112 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/types/IBrowserPage.ts +110 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/types/IBrowserPageViewport.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/types/IBrowserSettings.ts +194 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/types/IGoToOptions.ts +17 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/types/IOptionalBrowserPageViewport.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/types/IOptionalBrowserSettings.ts +190 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/types/IReloadOptions.ts +27 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserExceptionObserver.ts +123 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserFrameFactory.ts +106 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserFrameNavigator.ts +574 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserFrameScriptEvaluator.ts +71 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserFrameURL.ts +30 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserFrameValidator.ts +84 -0
- package/vendor/happy-dom/packages/happy-dom/src/browser/utilities/BrowserPageUtility.ts +56 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/ICanvasAdapter.ts +63 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/ICanvasAdapterCaller.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/ICanvasGradient.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/ICanvasPattern.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/ICanvasRenderingContext2D.ts +162 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/ICanvasShape.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/IImageBitmapOptions.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/ITextMetrics.ts +12 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/ImageBitmap.ts +162 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/ImageData.ts +83 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/OffscreenCanvas.ts +162 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/TCanvasImage.ts +14 -0
- package/vendor/happy-dom/packages/happy-dom/src/canvas/TImageBitmapSource.ts +12 -0
- package/vendor/happy-dom/packages/happy-dom/src/clipboard/Clipboard.ts +108 -0
- package/vendor/happy-dom/packages/happy-dom/src/clipboard/ClipboardItem.ts +57 -0
- package/vendor/happy-dom/packages/happy-dom/src/config/HTMLElementConfig.ts +536 -0
- package/vendor/happy-dom/packages/happy-dom/src/config/HTMLElementConfigContentModelEnum.ts +12 -0
- package/vendor/happy-dom/packages/happy-dom/src/config/IHTMLElementTagNameMap.ts +181 -0
- package/vendor/happy-dom/packages/happy-dom/src/config/ISVGElementTagNameMap.ts +127 -0
- package/vendor/happy-dom/packages/happy-dom/src/config/NamespaceURI.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/config/SVGElementConfig.ts +70 -0
- package/vendor/happy-dom/packages/happy-dom/src/console/IConsole.ts +161 -0
- package/vendor/happy-dom/packages/happy-dom/src/console/IVirtualConsoleLogEntry.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/console/IVirtualConsoleLogGroup.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/console/IVirtualConsolePrinter.ts +58 -0
- package/vendor/happy-dom/packages/happy-dom/src/console/VirtualConsole.ts +363 -0
- package/vendor/happy-dom/packages/happy-dom/src/console/VirtualConsolePrinter.ts +148 -0
- package/vendor/happy-dom/packages/happy-dom/src/console/enums/VirtualConsoleLogLevelEnum.ts +12 -0
- package/vendor/happy-dom/packages/happy-dom/src/console/enums/VirtualConsoleLogTypeEnum.ts +29 -0
- package/vendor/happy-dom/packages/happy-dom/src/console/utilities/VirtualConsoleLogEntryStringifier.ts +100 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie/CookieContainer.ts +91 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie/DefaultCookie.ts +17 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie/ICookie.ts +14 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie/ICookieContainer.ts +33 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie/IOptionalCookie.ts +16 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie/enums/CookieSameSiteEnum.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie/urilities/CookieExpireUtility.ts +16 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie/urilities/CookieStringUtility.ts +119 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie/urilities/CookieURLUtility.ts +27 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie-store/CookieStore.ts +226 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie-store/ICookieStoreDeleteOptions.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie-store/ICookieStoreGetOptions.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie-store/ICookieStoreItem.ts +13 -0
- package/vendor/happy-dom/packages/happy-dom/src/cookie-store/ICookieStoreSetOptions.ts +12 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/CSS.ts +63 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/CSSRule.ts +84 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/CSSRuleTypeEnum.ts +18 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/CSSStyleSheet.ts +141 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/CSSUnitValue.ts +26 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/CSSUnits.ts +31 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/MediaList.ts +177 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/CSSPropertyList.ts +1273 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/CSSStyleDeclaration.ts +355 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/ICSSStyleDeclaration.ts +1178 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/computed-style/CSSComputedStyle.ts +502 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/computed-style/config/CSSComputedStyleElementDefault.ts +133 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/computed-style/config/CSSComputedStyleInheritedProperties.ts +39 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/computed-style/config/CSSComputedStyleMeasurementProperties.ts +41 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/CSSPropertyManager.ts +641 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/parsers/CSSPropertyGetParser.ts +741 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/parsers/CSSPropertySetParser.ts +2955 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/types/ICSSPropertyMap.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/types/ICSSPropertyValue.ts +4 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/utilities/CSSStringUtility.ts +90 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/utilities/CSSValueFormatter.ts +447 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/property-manager/utilities/CSSVariableFormatter.ts +76 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/utilities/CSSMeasurementConverter.ts +79 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/declaration/utilities/CSSTextParser.ts +44 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSConditionRule.ts +20 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSContainerRule.ts +34 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSFontFaceRule.ts +45 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSGroupingRule.ts +84 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSKeyframeRule.ts +53 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSKeyframesRule.ts +147 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSMediaRule.ts +50 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSScopeRule.ts +53 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSStyleRule.ts +73 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/rules/CSSSupportsRule.ts +30 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/style-property-map/CSSKeywordValue.ts +35 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/style-property-map/CSSStyleValue.ts +37 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/style-property-map/StylePropertyMap.ts +45 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/style-property-map/StylePropertyMapReadOnly.ts +128 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/utilities/CSSEscaper.ts +87 -0
- package/vendor/happy-dom/packages/happy-dom/src/css/utilities/CSSRuleParser.ts +315 -0
- package/vendor/happy-dom/packages/happy-dom/src/custom-element/CustomElementReactionStack.ts +91 -0
- package/vendor/happy-dom/packages/happy-dom/src/custom-element/CustomElementRegistry.ts +186 -0
- package/vendor/happy-dom/packages/happy-dom/src/custom-element/CustomElementUtility.ts +34 -0
- package/vendor/happy-dom/packages/happy-dom/src/custom-element/ICustomElementDefinition.ts +16 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/DOMPoint.ts +84 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/DOMPointReadOnly.ts +117 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/DOMRect.ts +92 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/DOMRectList.ts +34 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/DOMRectReadOnly.ts +129 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/DOMStringMap.ts +93 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/DOMStringMapUtility.ts +33 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/DOMTokenList.ts +363 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/IDOMPointInit.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/IDOMRectInit.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/DOMMatrix.ts +526 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/DOMMatrixReadOnly.ts +1608 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/IDOMMatrixCompatibleObject.ts +24 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/IDOMMatrixJSON.ts +26 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/TDOMMatrix2DArray.ts +3 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/TDOMMatrix3DArray.ts +20 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom/dom-matrix/TDOMMatrixInit.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom-implementation/DOMImplementation.ts +81 -0
- package/vendor/happy-dom/packages/happy-dom/src/dom-parser/DOMParser.ts +47 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/DataTransfer.ts +128 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/DataTransferItem.ts +47 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/DataTransferItemList.ts +44 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/Event.ts +222 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/EventPhaseEnum.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/EventTarget.ts +396 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/IEventInit.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/IEventListenerOptions.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/ITouchInit.ts +16 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/IUIEventInit.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/MessagePort.ts +32 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/TEventListener.ts +4 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/TEventListenerFunction.ts +3 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/TEventListenerObject.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/Touch.ts +40 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/UIEvent.ts +32 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/AnimationEvent.ts +25 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/ClipboardEvent.ts +22 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/CloseEvent.ts +25 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/CookieChangeEvent.ts +25 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/CustomEvent.ts +53 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/ErrorEvent.ts +29 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/FocusEvent.ts +22 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/HashChangeEvent.ts +25 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IAnimationEventInit.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IClipboardEventInit.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/ICloseEventInit.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/ICookieChangeEventInit.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/ICustomEventInit.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IErrorEventInit.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IFocusEventInit.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IHashChangeEventInit.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IInputEventInit.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IKeyboardEventInit.ts +23 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IMediaQueryListEventInit.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IMediaQueryListInit.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IMessageEventInit.ts +11 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IMouseEventInit.ts +21 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IPointerEventInit.ts +19 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IPopStateEventInit.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IProgressEventInit.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IStorageEventInit.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/ISubmitEventInit.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/ITouchEventInit.ts +12 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/IWheelEventInit.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/InputEvent.ts +28 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/KeyboardEvent.ts +80 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/MediaQueryListEvent.ts +23 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/MediaStreamTrackEvent.ts +22 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/MessageEvent.ts +33 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/MouseEvent.ts +52 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/PointerEvent.ts +51 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/PopStateEvent.ts +23 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/ProgressEvent.ts +25 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/StorageEvent.ts +30 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/SubmitEvent.ts +22 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/TouchEvent.ts +34 -0
- package/vendor/happy-dom/packages/happy-dom/src/event/events/WheelEvent.ts +30 -0
- package/vendor/happy-dom/packages/happy-dom/src/exception/DOMException.ts +21 -0
- package/vendor/happy-dom/packages/happy-dom/src/exception/DOMExceptionNameEnum.ts +23 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/AbortController.ts +25 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/AbortSignal.ts +182 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/Fetch.ts +1072 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/Headers.ts +177 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/ReadableStreamWrapper.ts +30 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/Request.ts +492 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/ResourceFetch.ts +190 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/Response.ts +439 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/SyncFetch.ts +717 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/preflight/ICacheablePreflightRequest.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/preflight/ICacheablePreflightResponse.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/preflight/ICachedPreflightResponse.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/preflight/IPreflightResponseCache.ts +33 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/preflight/PreflightResponseCache.ts +94 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/CachedResponseStateEnum.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/ICacheableRequest.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/ICacheableResponse.ts +11 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/ICachedResponse.ts +40 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/IResponseCache.ts +37 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/IResponseCacheFileSystem.ts +18 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/ResponseCache.ts +248 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/cache/response/ResponseCacheFileSystem.ts +175 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/certificate/FetchHTTPSCertificate.ts +52 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/data-uri/DataURIParser.ts +66 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/multipart/MultipartFormDataParser.ts +174 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/multipart/MultipartReader.ts +216 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/preload/PreloadEntry.ts +50 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/preload/PreloadUtility.ts +33 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/IFetchInterceptor.ts +60 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/IFetchRequestHeaders.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/IRequestInit.ts +23 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/IResourceFetchResponse.ts +4 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/IResponseInit.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/ISyncResponse.ts +18 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/IVirtualServer.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/THeadersInit.ts +3 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TRequestBody.ts +14 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TRequestCredentials.ts +1 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TRequestInfo.ts +4 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TRequestMode.ts +1 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TRequestRedirect.ts +1 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TRequestReferrerPolicy.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/types/TResponseBody.ts +14 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchBodyUtility.ts +284 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchCORSUtility.ts +23 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchRequestHeaderUtility.ts +141 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchRequestReferrerUtility.ts +259 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchRequestValidationUtility.ts +128 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchResponseHeaderUtility.ts +48 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/FetchResponseRedirectUtility.ts +27 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/SyncFetchScriptBuilder.ts +77 -0
- package/vendor/happy-dom/packages/happy-dom/src/fetch/utilities/VirtualServerUtility.ts +114 -0
- package/vendor/happy-dom/packages/happy-dom/src/file/Blob.ts +163 -0
- package/vendor/happy-dom/packages/happy-dom/src/file/File.ts +43 -0
- package/vendor/happy-dom/packages/happy-dom/src/file/FileReader.ts +211 -0
- package/vendor/happy-dom/packages/happy-dom/src/file/FileReaderEventTypeEnum.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/file/FileReaderFormatEnum.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/file/FileReaderReadyStateEnum.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/form-data/FormData.ts +291 -0
- package/vendor/happy-dom/packages/happy-dom/src/history/History.ts +220 -0
- package/vendor/happy-dom/packages/happy-dom/src/history/HistoryItemList.ts +72 -0
- package/vendor/happy-dom/packages/happy-dom/src/history/HistoryScrollRestorationEnum.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/history/IHistoryItem.ts +12 -0
- package/vendor/happy-dom/packages/happy-dom/src/html-parser/HTMLParser.ts +920 -0
- package/vendor/happy-dom/packages/happy-dom/src/html-serializer/HTMLSerializer.ts +172 -0
- package/vendor/happy-dom/packages/happy-dom/src/index.ts +495 -0
- package/vendor/happy-dom/packages/happy-dom/src/intersection-observer/IIntersectionObserverInit.ts +16 -0
- package/vendor/happy-dom/packages/happy-dom/src/intersection-observer/IntersectionObserver.ts +64 -0
- package/vendor/happy-dom/packages/happy-dom/src/intersection-observer/IntersectionObserverEntry.ts +26 -0
- package/vendor/happy-dom/packages/happy-dom/src/javascript/IJavaScriptCompiledResult.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/javascript/JavaScriptCompiler.ts +381 -0
- package/vendor/happy-dom/packages/happy-dom/src/location/Location.ts +319 -0
- package/vendor/happy-dom/packages/happy-dom/src/match-media/IMediaQueryRange.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/match-media/IMediaQueryRule.ts +4 -0
- package/vendor/happy-dom/packages/happy-dom/src/match-media/MediaQueryItem.ts +354 -0
- package/vendor/happy-dom/packages/happy-dom/src/match-media/MediaQueryList.ts +133 -0
- package/vendor/happy-dom/packages/happy-dom/src/match-media/MediaQueryParser.ts +113 -0
- package/vendor/happy-dom/packages/happy-dom/src/match-media/MediaQueryTypeEnum.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/CSSModule.ts +53 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/ECMAScriptModule.ts +194 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/ECMAScriptModuleCompiler.ts +961 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/JSONModule.ts +58 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/ModuleFactory.ts +148 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/ModuleURLUtility.ts +199 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/UnresolvedModule.ts +81 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/enums/ECMAScriptModuleEvaluateStateEnum.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/types/IECMAScriptModuleCachedResult.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/types/IECMAScriptModuleCompiledResult.ts +19 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/types/IECMAScriptModuleImport.ts +4 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/types/IECMAScriptModuleInit.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/types/IModule.ts +20 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/types/IModuleImportMap.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/types/IModuleImportMapRule.ts +4 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/types/IModuleImportMapScope.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/types/IModuleInit.ts +12 -0
- package/vendor/happy-dom/packages/happy-dom/src/module/types/IResolveNodeModules.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/mutation-observer/IMutationListener.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/mutation-observer/IMutationObserverInit.ts +14 -0
- package/vendor/happy-dom/packages/happy-dom/src/mutation-observer/MutationObserver.ts +175 -0
- package/vendor/happy-dom/packages/happy-dom/src/mutation-observer/MutationObserverListener.ts +115 -0
- package/vendor/happy-dom/packages/happy-dom/src/mutation-observer/MutationRecord.ts +55 -0
- package/vendor/happy-dom/packages/happy-dom/src/mutation-observer/MutationTypeEnum.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/navigator/MimeType.ts +35 -0
- package/vendor/happy-dom/packages/happy-dom/src/navigator/MimeTypeArray.ts +48 -0
- package/vendor/happy-dom/packages/happy-dom/src/navigator/Navigator.ts +247 -0
- package/vendor/happy-dom/packages/happy-dom/src/navigator/Plugin.ts +61 -0
- package/vendor/happy-dom/packages/happy-dom/src/navigator/PluginArray.ts +58 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/NodeFactory.ts +38 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/attr/Attr.ts +119 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/character-data/CharacterData.ts +218 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/character-data/CharacterDataUtility.ts +68 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/child-node/ChildNodeUtility.ts +100 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/child-node/IChildNode.ts +29 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/child-node/INonDocumentTypeChildNode.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/child-node/NonDocumentChildNodeUtility.ts +37 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/comment/Comment.ts +36 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/document/Document.ts +2310 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/document/DocumentReadyStateEnum.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/document/DocumentReadyStateManager.ts +52 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/document/VisibilityStateEnum.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/document-fragment/DocumentFragment.ts +208 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/document-type/DocumentType.ts +70 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/element/Element.ts +1842 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/element/ElementEventAttributeUtility.ts +96 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/element/HTMLCollection.ts +228 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/element/NamedNodeMap.ts +274 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/element/NamedNodeMapProxyFactory.ts +127 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/element/THTMLCollectionListener.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/element/TNamedNodeMapListener.ts +3 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-anchor-element/HTMLAnchorElement.ts +439 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-area-element/HTMLAreaElement.ts +426 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-audio-element/Audio.ts +28 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-audio-element/HTMLAudioElement.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-base-element/HTMLBaseElement.ts +64 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-body-element/HTMLBodyElement.ts +161 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-br-element/HTMLBRElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-button-element/HTMLButtonElement.ts +406 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-canvas-element/CanvasCaptureMediaStreamTrack.ts +51 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-canvas-element/HTMLCanvasElement.ts +304 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-d-list-element/HTMLDListElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-data-element/HTMLDataElement.ts +25 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-data-list-element/HTMLDataListElement.ts +28 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-details-element/HTMLDetailsElement.ts +112 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-dialog-element/HTMLDialogElement.ts +104 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-div-element/HTMLDivElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-document/HTMLDocument.ts +82 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-element/HTMLElement.ts +1149 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-element/HTMLElementUtility.ts +119 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-embed-element/HTMLEmbedElement.ts +90 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-field-set-element/HTMLFieldSetElement.ts +165 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-form-element/HTMLFormControlsCollection.ts +35 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-form-element/HTMLFormElement.ts +675 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-form-element/RadioNodeList.ts +25 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-form-element/THTMLFormControlElement.ts +16 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-head-element/HTMLHeadElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-heading-element/HTMLHeadingElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-hr-element/HTMLHRElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-html-element/HTMLHtmlElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-hyperlink-element/HTMLHyperlinkElementUtility.ts +329 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-hyperlink-element/IHTMLHyperlinkElement.ts +19 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-iframe-element/HTMLIFrameElement.ts +460 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-image-element/HTMLImageElement.ts +500 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-image-element/Image.ts +33 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/FileList.ts +34 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/HTMLInputElement.ts +1550 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/HTMLInputElementDateUtility.ts +50 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/HTMLInputElementSelectionDirectionEnum.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/HTMLInputElementSelectionModeEnum.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/HTMLInputElementValueSanitizer.ts +211 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-input-element/HTMLInputElementValueStepping.ts +92 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-label-element/HTMLLabelElement.ts +128 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-label-element/HTMLLabelElementUtility.ts +45 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-legend-element/HTMLLegendElement.ts +27 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-li-element/HTMLLIElement.ts +31 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-link-element/HTMLLinkElement.ts +501 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-map-element/HTMLMapElement.ts +47 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/HTMLMediaElement.ts +906 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/IMediaTrackCapabilities.ts +21 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/IMediaTrackSettings.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/MediaStream.ts +114 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/MediaStreamTrack.ts +182 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/RemotePlayback.ts +47 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/TextTrack.ts +156 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/TextTrackCue.ts +51 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/TextTrackCueList.ts +37 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/TextTrackKindEnum.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/TextTrackList.ts +182 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/TimeRanges.ts +73 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/VTTCue.ts +80 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-media-element/VTTRegion.ts +15 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-menu-element/HTMLMenuElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-meta-element/HTMLMetaElement.ts +80 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-meter-element/HTMLMeterElement.ts +216 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-mod-element/HTMLModElement.ts +54 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-o-list-element/HTMLOListElement.ts +83 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-object-element/HTMLObjectElement.ts +223 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-opt-group-element/HTMLOptGroupElement.ts +53 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-option-element/HTMLOptionElement.ts +192 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-output-element/HTMLOutputElement.ts +179 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-paragraph-element/HTMLParagraphElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-param-element/HTMLParamElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-picture-element/HTMLPictureElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-pre-element/HTMLPreElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-progress-element/HTMLProgressElement.ts +100 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-quote-element/HTMLQuoteElement.ts +36 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-script-element/HTMLScriptElement.ts +735 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-select-element/HTMLOptionsCollection.ts +69 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-select-element/HTMLSelectElement.ts +779 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-slot-element/HTMLSlotElement.ts +249 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-source-element/HTMLSourceElement.ts +148 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-span-element/HTMLSpanElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-style-element/HTMLStyleElement.ts +125 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-table-caption-element/HTMLTableCaptionElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-table-cell-element/HTMLTableCellElement.ts +125 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-table-col-element/HTMLTableColElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-table-element/HTMLTableElement.ts +343 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-table-row-element/HTMLTableRowElement.ts +149 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-table-section-element/HTMLTableSectionElement.ts +88 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-template-element/HTMLTemplateElement.ts +154 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-text-area-element/HTMLTextAreaElement.ts +649 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-time-element/HTMLTimeElement.ts +27 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-title-element/HTMLTitleElement.ts +48 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-track-element/HTMLTrackElement.ts +164 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-u-list-element/HTMLUListElement.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-unknown-element/HTMLUnknownElement.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/html-video-element/HTMLVideoElement.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedComputedStyleResult.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedElementByIdResult.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedElementByTagNameResult.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedElementsByTagNameResult.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedMatchesResult.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedQuerySelectorAllResult.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedQuerySelectorResult.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedResult.ts +3 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/ICachedStyleResult.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/Node.ts +1373 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/NodeDocumentPositionEnum.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/NodeList.ts +224 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/NodeTypeEnum.ts +13 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/NodeUtility.ts +330 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/node/TNodeListListener.ts +1 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/parent-node/IParentNode.ts +109 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/parent-node/ParentNodeUtility.ts +334 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/processing-instruction/ProcessingInstruction.ts +22 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/shadow-root/ShadowRoot.ts +290 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-animate-element/SVGAnimateElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-animate-motion-element/SVGAnimateMotionElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-animate-transform-element/SVGAnimateTransformElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-animation-element/SVGAnimationElement.ts +94 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-circle-element/SVGCircleElement.ts +72 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-clip-path-element/SVGClipPathElement.ts +34 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-component-transfer-function-element/SVGComponentTransferFunctionElement.ts +167 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-defs-element/SVGDefsElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-desc-element/SVGDescElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-element/SVGElement.ts +828 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-ellipse-element/SVGEllipseElement.ts +92 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-blend-element/SVGFEBlendElement.ts +192 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-color-matrix-element/SVGFEColorMatrixElement.ts +204 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-component-transfer-element/SVGFEComponentTransferElement.ts +133 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-composite-element/SVGFECompositeElement.ts +186 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-convolve-matrix-element/SVGFEConvolveMatrixElement.ts +366 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-diffuse-lighting-element/SVGFEDiffuseLightingElement.ts +214 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-displacement-map-element/SVGFEDisplacementMapElement.ts +226 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-distant-light-element/SVGFEDistantLightElement.ts +52 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-drop-shadow-element/SVGFEDropShadowElement.ts +227 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-flood-element/SVGFEFloodElement.ts +113 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-func-a-element/SVGFEFuncAElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-func-b-element/SVGFEFuncBElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-func-g-element/SVGFEFuncGElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-func-r-element/SVGFEFuncRElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-gaussian-blur-element/SVGFEGaussianBlurElement.ts +214 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-image-element/SVGFEImageElement.ts +173 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-merge-element/SVGFEMergeElement.ts +113 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-merge-node-element/SVGFEMergeNodeElement.ts +32 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-morphology-element/SVGFEMorphologyElement.ts +202 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-offset-element/SVGFEOffsetElement.ts +174 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-point-light-element/SVGFEPointLightElement.ts +72 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-specular-lighting-element/SVGFESpecularLightingElement.ts +237 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-spot-light-element/SVGFESpotLightElement.ts +173 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-tile-element/SVGFETileElement.ts +133 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-fe-turbulence-element/SVGFETurbulenceElement.ts +249 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-filter-element/SVGFilterElement.ts +158 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-foreign-object-element/SVGForeignObjectElement.ts +92 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-g-element/SVGGElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-geometry-element/SVGGeometryElement.ts +94 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-gradient-element/SVGGradientElement.ts +104 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-graphics-element/SVGGraphicsElement.ts +134 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-image-element/SVGImageElement.ts +188 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-line-element/SVGLineElement.ts +92 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-linear-gradient-element/SVGLinearGradientElement.ts +92 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-m-path-element/SVGMPathElement.ts +32 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-marker-element/SVGMarkerElement.ts +230 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-mask-element/SVGMaskElement.ts +137 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-metadata-element/SVGMetadataElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-path-element/SVGPathElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-pattern-element/SVGPatternElement.ts +179 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-polygon-element/SVGPolygonElement.ts +53 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-polyline-element/SVGPolylineElement.ts +53 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-radial-gradient-element/SVGRadialGradientElement.ts +112 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-rect-element/SVGRectElement.ts +132 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-script-element/SVGScriptElement.ts +50 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-set-element/SVGSetElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-stop-element/SVGStopElement.ts +32 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-style-element/SVGStyleElement.ts +143 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-svg-element/SVGSVGElement.ts +601 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-switch-element/SVGSwitchElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-symbol-element/SVGSymbolElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-t-span-element/SVGTSpanElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-text-content-element/SVGTextContentElement.ts +143 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-text-element/SVGTextElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-text-path-element/SVGTextPathElement.ts +106 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-text-positioning-element/SVGTextPositioningElement.ts +113 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-title-element/SVGTitleElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-use-element/SVGUseElement.ts +113 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/svg-view-element/SVGViewElement.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/text/Text.ts +154 -0
- package/vendor/happy-dom/packages/happy-dom/src/nodes/xml-document/XMLDocument.ts +10 -0
- package/vendor/happy-dom/packages/happy-dom/src/permissions/PermissionNameEnum.ts +32 -0
- package/vendor/happy-dom/packages/happy-dom/src/permissions/PermissionStatus.ts +23 -0
- package/vendor/happy-dom/packages/happy-dom/src/permissions/Permissions.ts +59 -0
- package/vendor/happy-dom/packages/happy-dom/src/query-selector/ISelectorAttribute.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/query-selector/ISelectorMatch.ts +3 -0
- package/vendor/happy-dom/packages/happy-dom/src/query-selector/ISelectorPseudo.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/query-selector/QuerySelector.ts +849 -0
- package/vendor/happy-dom/packages/happy-dom/src/query-selector/SelectorCombinatorEnum.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/query-selector/SelectorItem.ts +575 -0
- package/vendor/happy-dom/packages/happy-dom/src/query-selector/SelectorParser.ts +699 -0
- package/vendor/happy-dom/packages/happy-dom/src/query-selector/TGlobalMatchFunction.ts +12 -0
- package/vendor/happy-dom/packages/happy-dom/src/range/IRangeBoundaryPoint.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/range/Range.ts +1161 -0
- package/vendor/happy-dom/packages/happy-dom/src/range/RangeHowEnum.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/range/RangeUtility.ts +118 -0
- package/vendor/happy-dom/packages/happy-dom/src/resize-observer/ResizeObserver.ts +33 -0
- package/vendor/happy-dom/packages/happy-dom/src/screen/Screen.ts +19 -0
- package/vendor/happy-dom/packages/happy-dom/src/screen/ScreenDetailed.ts +17 -0
- package/vendor/happy-dom/packages/happy-dom/src/screen/ScreenDetails.ts +27 -0
- package/vendor/happy-dom/packages/happy-dom/src/selection/Selection.ts +556 -0
- package/vendor/happy-dom/packages/happy-dom/src/selection/SelectionDirectionEnum.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/storage/Storage.ts +149 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAngle.ts +310 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAngleTypeEnum.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedAngle.ts +100 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedBoolean.ts +80 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedEnumeration.ts +119 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedInteger.ts +97 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedLength.ts +100 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedLengthList.ts +101 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedNumber.ts +101 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedNumberList.ts +101 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedPreserveAspectRatio.ts +100 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedRect.ts +100 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedString.ts +83 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGAnimatedTransformList.ts +101 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGLength.ts +375 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGLengthList.ts +489 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGLengthTypeEnum.ts +15 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGMatrix.ts +429 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGNumber.ts +83 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGNumberList.ts +522 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGPoint.ts +114 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGPointList.ts +526 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGPreserveAspectRatio.ts +176 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGPreserveAspectRatioAlignEnum.ts +15 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGPreserveAspectRatioMeetOrSliceEnum.ts +7 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGRect.ts +200 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGStringList.ts +422 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGTransform.ts +369 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGTransformList.ts +531 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGTransformTypeEnum.ts +11 -0
- package/vendor/happy-dom/packages/happy-dom/src/svg/SVGUnitTypes.ts +26 -0
- package/vendor/happy-dom/packages/happy-dom/src/tree-walker/NodeFilter.ts +18 -0
- package/vendor/happy-dom/packages/happy-dom/src/tree-walker/NodeFilterMask.ts +28 -0
- package/vendor/happy-dom/packages/happy-dom/src/tree-walker/NodeIterator.ts +85 -0
- package/vendor/happy-dom/packages/happy-dom/src/tree-walker/TNodeFilter.ts +3 -0
- package/vendor/happy-dom/packages/happy-dom/src/tree-walker/TreeWalker.ts +339 -0
- package/vendor/happy-dom/packages/happy-dom/src/url/URL.ts +45 -0
- package/vendor/happy-dom/packages/happy-dom/src/utilities/AttributeUtility.ts +43 -0
- package/vendor/happy-dom/packages/happy-dom/src/utilities/ClassMethodBinder.ts +71 -0
- package/vendor/happy-dom/packages/happy-dom/src/utilities/StringUtility.ts +47 -0
- package/vendor/happy-dom/packages/happy-dom/src/utilities/XMLEncodeUtility.ts +166 -0
- package/vendor/happy-dom/packages/happy-dom/src/validity-state/ValidityState.ts +234 -0
- package/vendor/happy-dom/packages/happy-dom/src/version.ts +1 -0
- package/vendor/happy-dom/packages/happy-dom/src/web-socket/WebSocket.ts +408 -0
- package/vendor/happy-dom/packages/happy-dom/src/web-socket/WebSocketReadyStateEnum.ts +8 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/BrowserWindow.ts +3074 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/CrossOriginBrowserWindow.ts +152 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/DetachedWindowAPI.ts +133 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/GlobalWindow.ts +90 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/INodeJSGlobal.ts +76 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/IOptionalTimerLoopsLimit.ts +4 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/IScrollToOptions.ts +5 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/ITimerLoopsLimit.ts +4 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/VMGlobalPropertyScript.ts +59 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/Window.ts +67 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/WindowBrowserContext.ts +117 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/WindowContextClassExtender.ts +288 -0
- package/vendor/happy-dom/packages/happy-dom/src/window/WindowPageOpenUtility.ts +200 -0
- package/vendor/happy-dom/packages/happy-dom/src/xml-http-request/XMLHttpRequest.ts +577 -0
- package/vendor/happy-dom/packages/happy-dom/src/xml-http-request/XMLHttpRequestEventTarget.ts +88 -0
- package/vendor/happy-dom/packages/happy-dom/src/xml-http-request/XMLHttpRequestReadyStateEnum.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/xml-http-request/XMLHttpRequestResponseDataParser.ts +70 -0
- package/vendor/happy-dom/packages/happy-dom/src/xml-http-request/XMLHttpRequestUpload.ts +6 -0
- package/vendor/happy-dom/packages/happy-dom/src/xml-http-request/XMLHttpResponseTypeEnum.ts +9 -0
- package/vendor/happy-dom/packages/happy-dom/src/xml-parser/XMLParser.ts +744 -0
- package/vendor/happy-dom/packages/happy-dom/src/xml-serializer/XMLSerializer.ts +280 -0
- package/vendor/happy-dom/turbo.json +52 -0
- package/vendor/ses/LICENSE +201 -0
- package/vendor/ses/LICENSE-aura +16 -0
- package/vendor/ses/LICENSE-caja +13 -0
- package/vendor/ses/LICENSE-corejs +19 -0
- package/vendor/ses/LICENSE-v8 +9 -0
- package/vendor/ses/README.md +968 -0
- package/vendor/ses/dist/ses.mjs +15219 -0
- package/vendor/ses/package.json +142 -0
- package/vendor/wasmpeg/LICENSE +501 -0
- package/vendor/wasmpeg/NOTICE +30 -0
- package/vendor/wasmpeg/VENDORING.md +35 -0
- package/vendor/wasmpeg/dist/cpu.js +2 -0
- package/vendor/wasmpeg/dist/cpu.wasm +0 -0
- package/vendor/wasmpeg/package.json +45 -0
- package/vendor/wasmpeg/source-v1.0.1.tar.gz +0 -0
- package/vendor/wasmpeg/src/js/exec.mjs +478 -0
- package/vendor/wasmpeg/src/js/ffmpeg.js +94 -0
- package/vendor/wasmpeg/src/js/formats.js +84 -0
- package/vendor/wasmpeg/src/js/gpu.js +480 -0
- package/vendor/wasmpeg/src/js/index.d.ts +154 -0
- package/vendor/wasmpeg/src/js/index.js +7 -0
- package/vendor/wasmpeg/src/js/wasmpeg.mjs +221 -0
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts layout output into an immutable, serializable display list.
|
|
3
|
+
*
|
|
4
|
+
* Paint order follows CSS 2 Appendix E for in-flow, non-positioned content:
|
|
5
|
+
* block and inline box decorations in tree order (outer box-shadow,
|
|
6
|
+
* background color, gradient layers bottom-up, per-side borders), then inline content
|
|
7
|
+
* (text and replaced images). `background-clip: text` moves an element's
|
|
8
|
+
* gradient onto its text instead of its box. Positioned boxes form paint
|
|
9
|
+
* layers painted after in-flow content in (z-index, tree order); negative
|
|
10
|
+
* z-index layers paint beneath it.
|
|
11
|
+
*
|
|
12
|
+
* Coordinates are document CSS pixels; scrolling, device scale, and culling
|
|
13
|
+
* belong to the rasterizer.
|
|
14
|
+
*
|
|
15
|
+
* Image resources are referenced by index into the non-enumerable `images`
|
|
16
|
+
* array so `JSON.stringify(displayList)` stays a plain debug/reftest dump.
|
|
17
|
+
*/
|
|
18
|
+
import { gradientLayers, resolveGradient } from "./gradient.js";
|
|
19
|
+
|
|
20
|
+
const TRANSPARENT = "rgba(0, 0, 0, 0)";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @param layout the layout result
|
|
24
|
+
* @param tree the render tree it was laid out from; without it, visibility,
|
|
25
|
+
* opacity and overflow clipping of ancestors are not applied.
|
|
26
|
+
*/
|
|
27
|
+
export function buildDisplayList(layout, tree = null) {
|
|
28
|
+
const items = [];
|
|
29
|
+
const images = [];
|
|
30
|
+
const effects = paintEffects(layout, tree);
|
|
31
|
+
// Text styled with background-clip:text takes its gradient from the owning box.
|
|
32
|
+
const textGradients = new Map();
|
|
33
|
+
for (const box of layout.boxes) {
|
|
34
|
+
const style = box.style;
|
|
35
|
+
if (style?.backgroundClip !== "text" || textGradients.has(style)) continue;
|
|
36
|
+
const gradient = gradientLayers(style.backgroundImage)
|
|
37
|
+
.map((source) => resolveGradient(source, box, style.fontSize))
|
|
38
|
+
.filter(Boolean)
|
|
39
|
+
.at(-1);
|
|
40
|
+
if (gradient) textGradients.set(style, gradient);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Layers are identified by their creation order; the root layer is order 0.
|
|
44
|
+
// Stacking contexts form a tree (CSS 2 Appendix E): a context paints its
|
|
45
|
+
// negative-z children, its own content, then its z >= 0 children (z-index
|
|
46
|
+
// auto counts as 0), each group in z then tree order.
|
|
47
|
+
const layers = new Map([[0, { z: 0, order: 0, context: true, parent: null }]]);
|
|
48
|
+
const boxesByLayer = new Map();
|
|
49
|
+
const fragmentsByLayer = new Map();
|
|
50
|
+
const add = (map, entry) => {
|
|
51
|
+
const order = entry.layer?.order ?? 0;
|
|
52
|
+
if (entry.layer) layers.set(order, entry.layer);
|
|
53
|
+
let list = map.get(order);
|
|
54
|
+
if (!list) map.set(order, list = []);
|
|
55
|
+
list.push(entry);
|
|
56
|
+
};
|
|
57
|
+
for (const box of layout.boxes) add(boxesByLayer, box);
|
|
58
|
+
for (const fragment of layout.fragments) add(fragmentsByLayer, fragment);
|
|
59
|
+
const children = new Map();
|
|
60
|
+
for (const layer of layers.values()) {
|
|
61
|
+
if (layer.order === 0) continue;
|
|
62
|
+
const parent = layer.parent?.order ?? 0;
|
|
63
|
+
let list = children.get(parent);
|
|
64
|
+
if (!list) children.set(parent, list = []);
|
|
65
|
+
list.push(layer);
|
|
66
|
+
}
|
|
67
|
+
const paintLayerContent = (layer) => {
|
|
68
|
+
for (const box of boxesByLayer.get(layer.order) ?? []) paintBox(box);
|
|
69
|
+
for (const fragment of fragmentsByLayer.get(layer.order) ?? []) paintFragment(fragment);
|
|
70
|
+
};
|
|
71
|
+
const paintContext = (context) => {
|
|
72
|
+
const members = (children.get(context.order) ?? []).sort((left, right) => left.z - right.z || left.order - right.order);
|
|
73
|
+
for (const layer of members) if (layer.z < 0) paintMember(layer);
|
|
74
|
+
paintLayerContent(context);
|
|
75
|
+
for (const layer of members) if (layer.z >= 0) paintMember(layer);
|
|
76
|
+
};
|
|
77
|
+
const paintMember = (layer) => (layer.context ? paintContext(layer) : paintLayerContent(layer));
|
|
78
|
+
paintContext(layers.get(0));
|
|
79
|
+
|
|
80
|
+
function paintBox(box) {
|
|
81
|
+
const style = box.style;
|
|
82
|
+
if (!style) return;
|
|
83
|
+
const effect = effects(box.nodeId, "box");
|
|
84
|
+
if (!effect) return;
|
|
85
|
+
const start = items.length;
|
|
86
|
+
const rect = { x: box.x, y: box.y, width: box.width, height: box.height };
|
|
87
|
+
const radii = cornerRadii(style, rect);
|
|
88
|
+
for (const shadow of style.boxShadow ?? []) {
|
|
89
|
+
if (shadow.inset || shadow.color === TRANSPARENT) continue;
|
|
90
|
+
const shadowRect = {
|
|
91
|
+
x: rect.x + shadow.x - shadow.spread,
|
|
92
|
+
y: rect.y + shadow.y - shadow.spread,
|
|
93
|
+
width: rect.width + shadow.spread * 2,
|
|
94
|
+
height: rect.height + shadow.spread * 2,
|
|
95
|
+
};
|
|
96
|
+
items.push({
|
|
97
|
+
op: "drawShadow",
|
|
98
|
+
nodeId: box.nodeId,
|
|
99
|
+
rect: shadowRect,
|
|
100
|
+
radii: radii.x > 0 || radii.y > 0
|
|
101
|
+
? { x: Math.max(0, radii.x + shadow.spread), y: Math.max(0, radii.y + shadow.spread) }
|
|
102
|
+
: radii,
|
|
103
|
+
blur: shadow.blur,
|
|
104
|
+
color: shadow.color,
|
|
105
|
+
// The shadow is clipped out of the casting box's own border box.
|
|
106
|
+
clip: rect,
|
|
107
|
+
clipRadii: radii,
|
|
108
|
+
bounds: inflate(shadowRect, shadow.blur),
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
const gradients = gradientLayers(style.backgroundImage)
|
|
112
|
+
.map((source) => resolveGradient(source, rect, style.fontSize))
|
|
113
|
+
.filter(Boolean);
|
|
114
|
+
if (style.backgroundClip !== "text") {
|
|
115
|
+
if (style.backgroundColor && style.backgroundColor !== TRANSPARENT) {
|
|
116
|
+
items.push({ op: "fillRect", nodeId: box.nodeId, rect, radii, color: style.backgroundColor, bounds: rect });
|
|
117
|
+
}
|
|
118
|
+
for (const gradient of gradients.reverse()) {
|
|
119
|
+
items.push({ op: "fillRect", nodeId: box.nodeId, rect, radii, gradient, bounds: rect });
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
const widths = style.borderWidths ?? [0, 0, 0, 0];
|
|
123
|
+
const visible = widths.some((width, index) => width > 0 && style.borderColors[index] !== TRANSPARENT);
|
|
124
|
+
if (visible) {
|
|
125
|
+
items.push({
|
|
126
|
+
op: "border",
|
|
127
|
+
nodeId: box.nodeId,
|
|
128
|
+
rect,
|
|
129
|
+
radii,
|
|
130
|
+
widths: [...widths],
|
|
131
|
+
colors: [...style.borderColors],
|
|
132
|
+
styles: [...style.borderStyles],
|
|
133
|
+
bounds: rect,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
applyEffect(items, start, effect);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function paintFragment(fragment) {
|
|
140
|
+
for (const run of fragment.runs) {
|
|
141
|
+
if (run.type === "atomic") continue;
|
|
142
|
+
const effect = effects(run.nodeId, run.type === "image" ? "box" : "text");
|
|
143
|
+
if (!effect) continue;
|
|
144
|
+
const start = items.length;
|
|
145
|
+
paintRun(fragment, run);
|
|
146
|
+
applyEffect(items, start, effect);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function paintRun(fragment, run) {
|
|
151
|
+
{
|
|
152
|
+
const y = run.y ?? fragment.y;
|
|
153
|
+
if (run.type === "image" && run.svg) {
|
|
154
|
+
const rect = { x: run.x, y, width: run.width, height: run.height };
|
|
155
|
+
if (run.svg.shapes.length) items.push({ op: "drawSvg", nodeId: run.nodeId, rect, svg: run.svg, bounds: rect });
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (run.type === "image") {
|
|
159
|
+
if (run.video) {
|
|
160
|
+
const rect = { x: run.x, y, width: run.width, height: run.height };
|
|
161
|
+
images.push(run.resource);
|
|
162
|
+
items.push({ op: "drawVideo", nodeId: run.nodeId, image: images.length - 1, rect, bounds: rect });
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (!run.resource?.image) return;
|
|
166
|
+
const rect = { x: run.x, y, width: run.width, height: run.height };
|
|
167
|
+
images.push(run.resource);
|
|
168
|
+
items.push({
|
|
169
|
+
op: "drawImage", nodeId: run.nodeId, image: images.length - 1, rect, radii: cornerRadii(run.style, rect), bounds: rect,
|
|
170
|
+
});
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (!run.text.trim()) return;
|
|
174
|
+
const gradient = textGradients.get(run.style) ?? null;
|
|
175
|
+
if (!gradient && run.style?.color === TRANSPARENT) return;
|
|
176
|
+
items.push({
|
|
177
|
+
op: "drawText",
|
|
178
|
+
nodeId: run.nodeId,
|
|
179
|
+
text: run.text,
|
|
180
|
+
x: run.x,
|
|
181
|
+
y,
|
|
182
|
+
font: {
|
|
183
|
+
family: run.style?.fontFamily ?? ["sans-serif"],
|
|
184
|
+
size: run.style?.fontSize ?? 16,
|
|
185
|
+
weight: run.style?.fontWeight ?? 400,
|
|
186
|
+
},
|
|
187
|
+
color: run.style?.color ?? "rgba(0, 0, 0, 1)",
|
|
188
|
+
...(run.style?.textDecorations ? { decoration: run.style.textDecorations } : {}),
|
|
189
|
+
...(gradient ? { gradient } : {}),
|
|
190
|
+
bounds: { x: run.x, y: fragment.y, width: run.width, height: fragment.height },
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Items clipped away entirely paint nothing.
|
|
196
|
+
const kept = items.filter((item) => !item.clipRect || (item.bounds.width > 0 && item.bounds.height > 0));
|
|
197
|
+
const displayList = {
|
|
198
|
+
generation: layout.generation,
|
|
199
|
+
width: layout.width,
|
|
200
|
+
height: layout.height,
|
|
201
|
+
items: Object.freeze(kept.map(deepFreeze)),
|
|
202
|
+
};
|
|
203
|
+
Object.defineProperty(displayList, "images", { value: Object.freeze(images), enumerable: false });
|
|
204
|
+
return Object.freeze(displayList);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Painting effects of ancestors (CSS Visual Effects / Overflow): visibility,
|
|
209
|
+
* group opacity (approximated per item), and clipping by overflow, clip and
|
|
210
|
+
* clip-path rectangles. Returns effects(nodeId, "box" | "text") → null when
|
|
211
|
+
* the item is not painted, else { opacity, clipRect }.
|
|
212
|
+
*/
|
|
213
|
+
function paintEffects(layout, tree) {
|
|
214
|
+
const none = { opacity: 1, clipRect: null, fixed: false };
|
|
215
|
+
if (!tree?.root) return () => none;
|
|
216
|
+
const parents = new Map();
|
|
217
|
+
(function walk(node) {
|
|
218
|
+
for (const child of node.children ?? []) {
|
|
219
|
+
parents.set(child.id, node);
|
|
220
|
+
walk(child);
|
|
221
|
+
}
|
|
222
|
+
})(tree.root);
|
|
223
|
+
const boxes = new Map();
|
|
224
|
+
for (const box of layout.boxes) if (!box.inline && !boxes.has(box.nodeId)) boxes.set(box.nodeId, box);
|
|
225
|
+
const cache = new Map();
|
|
226
|
+
|
|
227
|
+
// The clip an element applies to its descendants (and, for clip/clip-path, to itself).
|
|
228
|
+
const overflowClip = (node) => {
|
|
229
|
+
const style = node.style;
|
|
230
|
+
const box = boxes.get(node.id);
|
|
231
|
+
if (!style || !box || node === tree.root) return null;
|
|
232
|
+
if (style.overflowX !== "clip" && style.overflowY !== "clip") return null;
|
|
233
|
+
const [top, right, bottom, left] = style.borderWidths ?? [0, 0, 0, 0];
|
|
234
|
+
return { x: box.x + left, y: box.y + top, width: box.width - left - right, height: box.height - top - bottom };
|
|
235
|
+
};
|
|
236
|
+
const shapeClip = (node) => {
|
|
237
|
+
const style = node.style;
|
|
238
|
+
const box = boxes.get(node.id);
|
|
239
|
+
if (!style || !box) return null;
|
|
240
|
+
let rect = null;
|
|
241
|
+
if (style.clipPath?.empty) rect = { x: box.x, y: box.y, width: 0, height: 0 };
|
|
242
|
+
else if (style.clipPath?.inset) {
|
|
243
|
+
const [top, right, bottom, left] = style.clipPath.inset.map((edge, index) =>
|
|
244
|
+
edge?.unit === "%" ? edge.value / 100 * (index % 2 ? box.width : box.height) : edge);
|
|
245
|
+
rect = { x: box.x + left, y: box.y + top, width: box.width - left - right, height: box.height - top - bottom };
|
|
246
|
+
}
|
|
247
|
+
if (style.clip && (style.position === "absolute" || style.position === "fixed")) {
|
|
248
|
+
const [top, right, bottom, left] = style.clip;
|
|
249
|
+
const x0 = left === "auto" ? box.x : box.x + left;
|
|
250
|
+
const y0 = top === "auto" ? box.y : box.y + top;
|
|
251
|
+
const x1 = right === "auto" ? box.x + box.width : box.x + right;
|
|
252
|
+
const y1 = bottom === "auto" ? box.y + box.height : box.y + bottom;
|
|
253
|
+
rect = intersectRects(rect, { x: x0, y: y0, width: x1 - x0, height: y1 - y0 });
|
|
254
|
+
}
|
|
255
|
+
return rect;
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
return (nodeId, kind) => {
|
|
259
|
+
const key = `${kind}:${nodeId}`;
|
|
260
|
+
if (cache.has(key)) return cache.get(key);
|
|
261
|
+
const self = tree.nodesById?.get(nodeId);
|
|
262
|
+
// Text belongs to its parent element for visibility and clipping.
|
|
263
|
+
const owner = kind === "text" ? parents.get(nodeId) : self;
|
|
264
|
+
let result = none;
|
|
265
|
+
if (!owner?.style || owner.style.visibility !== "hidden") {
|
|
266
|
+
let opacity = 1;
|
|
267
|
+
let clipRect = null;
|
|
268
|
+
let fixed = false;
|
|
269
|
+
// Overflow clipping skips ancestors that are not in the containing-block
|
|
270
|
+
// chain of an absolutely positioned box; fixed boxes escape entirely.
|
|
271
|
+
let escaping = null;
|
|
272
|
+
for (let node = owner; node; node = parents.get(node.id)) {
|
|
273
|
+
const style = node.style;
|
|
274
|
+
if (!style) continue;
|
|
275
|
+
if (style.position === "fixed") fixed = true;
|
|
276
|
+
opacity *= style.opacity ?? 1;
|
|
277
|
+
clipRect = intersectRects(clipRect, shapeClip(node));
|
|
278
|
+
const ownContent = kind === "text" || node !== owner;
|
|
279
|
+
if (ownContent && escaping !== "fixed") {
|
|
280
|
+
const positioned = style.position && style.position !== "static";
|
|
281
|
+
if (!escaping || positioned) {
|
|
282
|
+
clipRect = intersectRects(clipRect, overflowClip(node));
|
|
283
|
+
escaping = null;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (style.position === "fixed") escaping = "fixed";
|
|
287
|
+
else if (style.position === "absolute" && escaping !== "fixed") escaping = "absolute";
|
|
288
|
+
}
|
|
289
|
+
result = opacity <= 0 ? null : { opacity, clipRect, fixed };
|
|
290
|
+
} else {
|
|
291
|
+
result = null;
|
|
292
|
+
}
|
|
293
|
+
cache.set(key, result);
|
|
294
|
+
return result;
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function intersectRects(a, b) {
|
|
299
|
+
if (!a) return b;
|
|
300
|
+
if (!b) return a;
|
|
301
|
+
const x = Math.max(a.x, b.x);
|
|
302
|
+
const y = Math.max(a.y, b.y);
|
|
303
|
+
const right = Math.min(a.x + a.width, b.x + b.width);
|
|
304
|
+
const bottom = Math.min(a.y + a.height, b.y + b.height);
|
|
305
|
+
return { x, y, width: Math.max(0, right - x), height: Math.max(0, bottom - y) };
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
function applyEffect(items, start, effect) {
|
|
309
|
+
if (effect.opacity === 1 && !effect.clipRect && !effect.fixed) return;
|
|
310
|
+
for (let index = start; index < items.length; index++) {
|
|
311
|
+
const item = items[index];
|
|
312
|
+
if (effect.fixed) item.fixed = true;
|
|
313
|
+
if (effect.opacity < 1) item.opacity = effect.opacity;
|
|
314
|
+
if (effect.clipRect) {
|
|
315
|
+
item.clipRect = effect.clipRect;
|
|
316
|
+
item.bounds = intersectRects(item.bounds, effect.clipRect);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/** Returns display items whose bounds intersect the given document-space rect. */
|
|
322
|
+
export function visibleItems(displayList, rect, fixedOffset = { x: 0, y: 0 }) {
|
|
323
|
+
return displayList.items.filter(({ bounds, fixed }) => {
|
|
324
|
+
const x = bounds.x + (fixed ? fixedOffset.x : 0);
|
|
325
|
+
const y = bounds.y + (fixed ? fixedOffset.y : 0);
|
|
326
|
+
return x < rect.x + rect.width && x + bounds.width > rect.x
|
|
327
|
+
&& y < rect.y + rect.height && y + bounds.height > rect.y;
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Resolves border-radius to one elliptical radius for every corner.
|
|
333
|
+
* Percentages refer to the border box's width (x) and height (y); radii that
|
|
334
|
+
* would overlap are scaled down together (CSS Backgrounds 3 §5.5).
|
|
335
|
+
*/
|
|
336
|
+
function cornerRadii(style, rect) {
|
|
337
|
+
const value = style?.borderRadius;
|
|
338
|
+
let x = 0;
|
|
339
|
+
let y = 0;
|
|
340
|
+
if (value?.unit === "%") {
|
|
341
|
+
x = rect.width * value.value / 100;
|
|
342
|
+
y = rect.height * value.value / 100;
|
|
343
|
+
} else if (value > 0) {
|
|
344
|
+
x = y = value;
|
|
345
|
+
}
|
|
346
|
+
const scale = Math.min(1, x > 0 ? rect.width / (2 * x) : 1, y > 0 ? rect.height / (2 * y) : 1);
|
|
347
|
+
return { x: x * scale, y: y * scale };
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
function inflate(rect, amount) {
|
|
351
|
+
return { x: rect.x - amount, y: rect.y - amount, width: rect.width + amount * 2, height: rect.height + amount * 2 };
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
function deepFreeze(value) {
|
|
355
|
+
for (const child of Object.values(value)) {
|
|
356
|
+
if (child && typeof child === "object") deepFreeze(child);
|
|
357
|
+
}
|
|
358
|
+
return Object.freeze(value);
|
|
359
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compositor frames: a raster tile of the page plus where it sits, and the
|
|
3
|
+
* two operations the compositor needs without CanvasKit: cutting the
|
|
4
|
+
* viewport out of a tile and encoding it (with Bun.Image).
|
|
5
|
+
*
|
|
6
|
+
* A tile covers a rectangle of the page in CSS pixels (x, y, width, height)
|
|
7
|
+
* rasterized at `scale` device pixels per CSS pixel; `pixels` is RGBA
|
|
8
|
+
* (unpremultiplied), `pixelWidth` x `pixelHeight`.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The viewport's device pixels at a scroll position. Parts of the viewport
|
|
12
|
+
* the tile does not cover show the page background, as Chrome's compositor
|
|
13
|
+
* shows a checkerboard until the missing tiles are rasterized.
|
|
14
|
+
* @returns {{ pixels: Uint8Array, width: number, height: number }}
|
|
15
|
+
*/
|
|
16
|
+
export function cropViewport(tile, scrollX, scrollY, viewportWidth, viewportHeight) {
|
|
17
|
+
const scale = tile.scale;
|
|
18
|
+
const width = Math.max(1, Math.round(Math.floor(viewportWidth) * scale));
|
|
19
|
+
const height = Math.max(1, Math.round(Math.floor(viewportHeight) * scale));
|
|
20
|
+
const pixels = new Uint8Array(width * height * 4);
|
|
21
|
+
const [red, green, blue, alpha] = tile.background ?? [255, 255, 255, 255];
|
|
22
|
+
const fill = new Uint8Array([red, green, blue, alpha]);
|
|
23
|
+
const offsetX = Math.round((scrollX - tile.x) * scale);
|
|
24
|
+
const offsetY = Math.round((scrollY - tile.y) * scale);
|
|
25
|
+
const fromX = Math.max(0, -offsetX);
|
|
26
|
+
const toX = Math.min(width, tile.pixelWidth - offsetX);
|
|
27
|
+
const rowFill = new Uint8Array(width * 4);
|
|
28
|
+
for (let index = 0; index < width; index++) rowFill.set(fill, index * 4);
|
|
29
|
+
for (let row = 0; row < height; row++) {
|
|
30
|
+
const sourceRow = row + offsetY;
|
|
31
|
+
const target = row * width * 4;
|
|
32
|
+
if (sourceRow < 0 || sourceRow >= tile.pixelHeight || toX <= fromX) {
|
|
33
|
+
pixels.set(rowFill, target);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (fromX > 0 || toX < width) pixels.set(rowFill, target);
|
|
37
|
+
const source = (sourceRow * tile.pixelWidth + fromX + offsetX) * 4;
|
|
38
|
+
pixels.set(tile.pixels.subarray(source, source + (toX - fromX) * 4), target + fromX * 4);
|
|
39
|
+
}
|
|
40
|
+
return { pixels, width, height };
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const IMAGE_FORMATS = new Set(["png", "jpeg", "webp"]);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Encodes RGBA pixels with Bun.Image. Bun.Image does not read raw pixels, so
|
|
47
|
+
* they are wrapped in an uncompressed BMP first (header only, no copying of
|
|
48
|
+
* rows or channels).
|
|
49
|
+
* @param {{ format?: "png" | "jpeg" | "webp", quality?: number }} options
|
|
50
|
+
*/
|
|
51
|
+
export async function encodeImage(pixels, width, height, { format = "png", quality = 80 } = {}) {
|
|
52
|
+
const image = new Bun.Image(rgbaBitmap(pixels, width, height));
|
|
53
|
+
const kind = IMAGE_FORMATS.has(format) ? format : "png";
|
|
54
|
+
const level = Math.min(100, Math.max(0, Number.isFinite(quality) ? quality : 80));
|
|
55
|
+
return kind === "png" ? image.png().bytes() : image[kind]({ quality: level }).bytes();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** A 32-bit BMP (BITMAPV4HEADER, BI_BITFIELDS in RGBA byte order, top-down rows) around RGBA pixels. */
|
|
59
|
+
export function rgbaBitmap(pixels, width, height) {
|
|
60
|
+
const headerSize = 14 + 108;
|
|
61
|
+
const bitmap = new Uint8Array(headerSize + pixels.byteLength);
|
|
62
|
+
const view = new DataView(bitmap.buffer);
|
|
63
|
+
view.setUint8(0, 0x42);
|
|
64
|
+
view.setUint8(1, 0x4d);
|
|
65
|
+
view.setUint32(2, bitmap.byteLength, true);
|
|
66
|
+
view.setUint32(10, headerSize, true);
|
|
67
|
+
view.setUint32(14, 108, true);
|
|
68
|
+
view.setInt32(18, width, true);
|
|
69
|
+
view.setInt32(22, -height, true);
|
|
70
|
+
view.setUint16(26, 1, true);
|
|
71
|
+
view.setUint16(28, 32, true);
|
|
72
|
+
view.setUint32(30, 3, true);
|
|
73
|
+
view.setUint32(34, pixels.byteLength, true);
|
|
74
|
+
view.setUint32(54, 0x000000ff, true);
|
|
75
|
+
view.setUint32(58, 0x0000ff00, true);
|
|
76
|
+
view.setUint32(62, 0x00ff0000, true);
|
|
77
|
+
view.setUint32(66, 0xff000000, true);
|
|
78
|
+
view.setUint32(70, 0x73524742, true);
|
|
79
|
+
bitmap.set(pixels, headerSize);
|
|
80
|
+
return bitmap;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** RGBA bytes for a CSS color string such as "rgba(255, 255, 255, 1)". */
|
|
84
|
+
export function backgroundBytes(color) {
|
|
85
|
+
const match = /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*(?:,\s*([\d.]+)\s*)?\)$/.exec(String(color));
|
|
86
|
+
if (!match) return [255, 255, 255, 255];
|
|
87
|
+
return [Number(match[1]), Number(match[2]), Number(match[3]), Math.round(Number(match[4] ?? 1) * 255)];
|
|
88
|
+
}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves CSS gradient images against a background positioning area.
|
|
3
|
+
*
|
|
4
|
+
* Geometry follows CSS Images 3: the linear gradient line length for angle A
|
|
5
|
+
* in a W×H box is |W·sinA| + |H·cosA|, "to <corner>" angles make the 50%
|
|
6
|
+
* line pass through the other two corners, and radial sizes default to
|
|
7
|
+
* farthest-corner. Results are plain data for the display list; the
|
|
8
|
+
* rasterizer turns them into CanvasKit shaders.
|
|
9
|
+
*/
|
|
10
|
+
const SIDES = Object.freeze({ top: [0, -1], bottom: [0, 1], left: [-1, 0], right: [1, 0] });
|
|
11
|
+
|
|
12
|
+
/** Splits a `background`/`background-image` value into gradient layers, topmost first. */
|
|
13
|
+
export function gradientLayers(value) {
|
|
14
|
+
if (!value) return [];
|
|
15
|
+
return splitTopLevel(String(value), ",")
|
|
16
|
+
.map((layer) => layer.trim())
|
|
17
|
+
.filter((layer) => /^(?:repeating-)?(?:linear|radial)-gradient\(/i.test(layer));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function resolveGradient(source, rect, fontSize = 16) {
|
|
21
|
+
const match = /^(repeating-)?(linear|radial)-gradient\((.*)\)$/is.exec(source.trim());
|
|
22
|
+
if (!match) return null;
|
|
23
|
+
const args = splitTopLevel(match[3], ",").map((part) => part.trim()).filter(Boolean);
|
|
24
|
+
if (!args.length) return null;
|
|
25
|
+
return match[2].toLowerCase() === "linear"
|
|
26
|
+
? linearGradient(args, rect, fontSize, Boolean(match[1]))
|
|
27
|
+
: radialGradient(args, rect, fontSize, Boolean(match[1]));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function linearGradient(args, rect, fontSize, repeating) {
|
|
31
|
+
let angle = Math.PI;
|
|
32
|
+
const first = args[0].toLowerCase();
|
|
33
|
+
const parsedAngle = parseAngle(first);
|
|
34
|
+
if (parsedAngle != null) {
|
|
35
|
+
angle = parsedAngle;
|
|
36
|
+
args = args.slice(1);
|
|
37
|
+
} else if (first.startsWith("to ")) {
|
|
38
|
+
let dx = 0;
|
|
39
|
+
let dy = 0;
|
|
40
|
+
for (const word of first.slice(3).trim().split(/\s+/)) {
|
|
41
|
+
const side = SIDES[word];
|
|
42
|
+
if (!side) return null;
|
|
43
|
+
dx += side[0];
|
|
44
|
+
dy += side[1];
|
|
45
|
+
}
|
|
46
|
+
// Corners: perpendicular to the diagonal that joins the other two corners.
|
|
47
|
+
angle = dx && dy ? Math.atan2(dx * rect.height, -dy * rect.width) : Math.atan2(dx, -dy);
|
|
48
|
+
args = args.slice(1);
|
|
49
|
+
}
|
|
50
|
+
const sin = Math.sin(angle);
|
|
51
|
+
const cos = Math.cos(angle);
|
|
52
|
+
const length = Math.abs(rect.width * sin) + Math.abs(rect.height * cos);
|
|
53
|
+
const centerX = rect.x + rect.width / 2;
|
|
54
|
+
const centerY = rect.y + rect.height / 2;
|
|
55
|
+
const stops = colorStops(args, length, fontSize);
|
|
56
|
+
if (!stops) return null;
|
|
57
|
+
return {
|
|
58
|
+
type: "linear",
|
|
59
|
+
x0: centerX - sin * length / 2,
|
|
60
|
+
y0: centerY + cos * length / 2,
|
|
61
|
+
x1: centerX + sin * length / 2,
|
|
62
|
+
y1: centerY - cos * length / 2,
|
|
63
|
+
stops,
|
|
64
|
+
repeating,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function radialGradient(args, rect, fontSize, repeating) {
|
|
69
|
+
let shape = "ellipse";
|
|
70
|
+
let size = "farthest-corner";
|
|
71
|
+
let explicit = null;
|
|
72
|
+
let position = ["50%", "50%"];
|
|
73
|
+
const first = args[0].toLowerCase();
|
|
74
|
+
const isColor = (text) => Bun.color(text.split(/\s+/)[0], "rgba") != null;
|
|
75
|
+
if (!isColor(first)) {
|
|
76
|
+
const [shapePart, positionPart] = first.split(/\s*\bat\b\s*/);
|
|
77
|
+
const words = shapePart.trim() ? shapePart.trim().split(/\s+/) : [];
|
|
78
|
+
const lengths = [];
|
|
79
|
+
for (const word of words) {
|
|
80
|
+
if (word === "circle" || word === "ellipse") shape = word;
|
|
81
|
+
else if (/^(?:closest|farthest)-(?:side|corner)$/.test(word)) size = word;
|
|
82
|
+
else lengths.push(word);
|
|
83
|
+
}
|
|
84
|
+
if (lengths.length) {
|
|
85
|
+
if (lengths.length === 1) shape = "circle";
|
|
86
|
+
explicit = lengths.map((length, index) =>
|
|
87
|
+
resolveLength(length, index === 0 ? rect.width : rect.height, fontSize));
|
|
88
|
+
if (explicit.some((value) => !Number.isFinite(value))) return null;
|
|
89
|
+
}
|
|
90
|
+
if (positionPart) position = positionTokens(positionPart);
|
|
91
|
+
args = args.slice(1);
|
|
92
|
+
}
|
|
93
|
+
const cx = rect.x + resolvePosition(position[0], rect.width, fontSize, "x");
|
|
94
|
+
const cy = rect.y + resolvePosition(position[1], rect.height, fontSize, "y");
|
|
95
|
+
let rx;
|
|
96
|
+
let ry;
|
|
97
|
+
if (explicit) {
|
|
98
|
+
[rx, ry = rx] = explicit;
|
|
99
|
+
} else {
|
|
100
|
+
const distancesX = [Math.abs(cx - rect.x), Math.abs(rect.x + rect.width - cx)];
|
|
101
|
+
const distancesY = [Math.abs(cy - rect.y), Math.abs(rect.y + rect.height - cy)];
|
|
102
|
+
const pickSide = size.startsWith("closest") ? Math.min : Math.max;
|
|
103
|
+
const sideX = pickSide(...distancesX);
|
|
104
|
+
const sideY = pickSide(...distancesY);
|
|
105
|
+
if (shape === "circle") {
|
|
106
|
+
rx = size.endsWith("side") ? pickSide(sideX, sideY) : Math.hypot(sideX, sideY);
|
|
107
|
+
ry = rx;
|
|
108
|
+
} else if (size.endsWith("side")) {
|
|
109
|
+
[rx, ry] = [sideX, sideY];
|
|
110
|
+
} else {
|
|
111
|
+
// Corner sizes keep the side sizes' aspect ratio and pass through the corner.
|
|
112
|
+
[rx, ry] = [sideX * Math.SQRT2, sideY * Math.SQRT2];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (!(rx > 0) || !(ry > 0)) return null;
|
|
116
|
+
const stops = colorStops(args, rx, fontSize);
|
|
117
|
+
if (!stops) return null;
|
|
118
|
+
return { type: "radial", cx, cy, rx, ry, stops, repeating };
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Resolves color stops to offsets in [0, 1] along a gradient ray of `length` px. */
|
|
122
|
+
function colorStops(args, length, fontSize) {
|
|
123
|
+
const stops = [];
|
|
124
|
+
for (const arg of args) {
|
|
125
|
+
const parts = splitTopLevel(arg, " ").filter(Boolean);
|
|
126
|
+
const color = Bun.color(parts[0], "rgba");
|
|
127
|
+
if (!color) return null;
|
|
128
|
+
const positions = parts.slice(1).map((part) => resolveLength(part, length, fontSize) / length);
|
|
129
|
+
if (positions.some((value) => !Number.isFinite(value))) return null;
|
|
130
|
+
if (!positions.length) stops.push({ color, offset: null });
|
|
131
|
+
for (const offset of positions) stops.push({ color, offset });
|
|
132
|
+
}
|
|
133
|
+
if (stops.length < 2) {
|
|
134
|
+
if (stops.length === 1) stops.push({ ...stops[0] });
|
|
135
|
+
else return null;
|
|
136
|
+
}
|
|
137
|
+
// CSS Images 3 §3.4.3: default the ends, keep positions monotonic, then
|
|
138
|
+
// spread unpositioned stops evenly between their positioned neighbours.
|
|
139
|
+
stops[0].offset ??= 0;
|
|
140
|
+
stops.at(-1).offset ??= 1;
|
|
141
|
+
let previous = stops[0].offset;
|
|
142
|
+
for (const stop of stops) {
|
|
143
|
+
if (stop.offset != null) previous = stop.offset = Math.max(stop.offset, previous);
|
|
144
|
+
}
|
|
145
|
+
for (let index = 1; index < stops.length; index++) {
|
|
146
|
+
if (stops[index].offset != null) continue;
|
|
147
|
+
let next = index;
|
|
148
|
+
while (stops[next].offset == null) next++;
|
|
149
|
+
const start = stops[index - 1].offset;
|
|
150
|
+
const step = (stops[next].offset - start) / (next - index + 1);
|
|
151
|
+
for (let fill = index; fill < next; fill++) stops[fill].offset = start + step * (fill - index + 1);
|
|
152
|
+
}
|
|
153
|
+
return stops.map((stop) => ({ color: stop.color, offset: stop.offset }));
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function parseAngle(text) {
|
|
157
|
+
const match = /^([+-]?(?:\d+\.?\d*|\.\d+))(deg|grad|rad|turn)$/.exec(text);
|
|
158
|
+
if (!match) return null;
|
|
159
|
+
const value = Number(match[1]);
|
|
160
|
+
return { deg: value * Math.PI / 180, grad: value * Math.PI / 200, rad: value, turn: value * Math.PI * 2 }[match[2]];
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function positionTokens(text) {
|
|
164
|
+
const words = text.trim().split(/\s+/);
|
|
165
|
+
if (words.length === 1) {
|
|
166
|
+
const word = words[0];
|
|
167
|
+
return ["top", "bottom"].includes(word) ? ["50%", word] : [word, "50%"];
|
|
168
|
+
}
|
|
169
|
+
// Keywords may appear in either order ("top left").
|
|
170
|
+
if (["top", "bottom"].includes(words[0]) || ["left", "right"].includes(words[1])) return [words[1], words[0]];
|
|
171
|
+
return [words[0], words[1]];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function resolvePosition(token, extent, fontSize, axis) {
|
|
175
|
+
const keyword = { left: 0, top: 0, center: 50, right: 100, bottom: 100 }[token];
|
|
176
|
+
if (keyword != null) return extent * keyword / 100;
|
|
177
|
+
const value = resolveLength(token, extent, fontSize);
|
|
178
|
+
return Number.isFinite(value) ? value : extent / 2;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function resolveLength(text, reference, fontSize) {
|
|
182
|
+
const match = /^([+-]?(?:\d+\.?\d*|\.\d+))(px|%|em|rem)?$/.exec(String(text).trim());
|
|
183
|
+
if (!match) return NaN;
|
|
184
|
+
const value = Number(match[1]);
|
|
185
|
+
if (match[2] === "%") return reference * value / 100;
|
|
186
|
+
if (match[2] === "em") return value * fontSize;
|
|
187
|
+
if (match[2] === "rem") return value * 16;
|
|
188
|
+
if (!match[2] && value !== 0) return NaN;
|
|
189
|
+
return value;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function splitTopLevel(source, separator) {
|
|
193
|
+
const parts = [];
|
|
194
|
+
let depth = 0;
|
|
195
|
+
let start = 0;
|
|
196
|
+
for (let index = 0; index < source.length; index++) {
|
|
197
|
+
const character = source[index];
|
|
198
|
+
if (character === "(") depth++;
|
|
199
|
+
else if (character === ")") depth--;
|
|
200
|
+
else if (depth === 0 && (separator === " " ? /\s/.test(character) : character === separator)) {
|
|
201
|
+
parts.push(source.slice(start, index));
|
|
202
|
+
start = index + 1;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
parts.push(source.slice(start));
|
|
206
|
+
return parts.map((part) => part.trim()).filter((part) => part !== "");
|
|
207
|
+
}
|