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,434 @@
|
|
|
1
|
+
import { expect, test } from "bun:test";
|
|
2
|
+
import { parseHTMLDocument } from "../lib/happy-dom/parser.js";
|
|
3
|
+
import { RenderTreeBuilder, renderTreeText } from "../lib/render-tree/index.js";
|
|
4
|
+
import { computeElementStyle, parseDeclarations, StyleEngine } from "../lib/style/computed-style.js";
|
|
5
|
+
|
|
6
|
+
test("computes the initial UA and inherited style subset", () => {
|
|
7
|
+
const { document, window } = parseHTMLDocument(`<body>
|
|
8
|
+
<div id="parent" style="color: red; font-size: 30px">
|
|
9
|
+
<span id="child">child</span><strong id="strong">bold</strong>
|
|
10
|
+
</div>
|
|
11
|
+
</body>`);
|
|
12
|
+
const engine = new StyleEngine().compute(document);
|
|
13
|
+
|
|
14
|
+
expect(engine.get(document.getElementById("parent"))).toMatchObject({
|
|
15
|
+
display: "block",
|
|
16
|
+
color: "rgba(255, 0, 0, 1)",
|
|
17
|
+
fontSize: 30,
|
|
18
|
+
});
|
|
19
|
+
expect(engine.get(document.getElementById("child"))).toMatchObject({
|
|
20
|
+
display: "inline",
|
|
21
|
+
color: "rgba(255, 0, 0, 1)",
|
|
22
|
+
fontSize: 30,
|
|
23
|
+
});
|
|
24
|
+
expect(engine.get(document.getElementById("strong")).fontWeight).toBe(700);
|
|
25
|
+
window.happyDOM.abort();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test("inline declarations validate values and preserve important priority", () => {
|
|
29
|
+
const { document, window } = parseHTMLDocument(`<div id="box" style="
|
|
30
|
+
display: block; display: none !important; display: inline;
|
|
31
|
+
padding: 1px 2px 3px 4px; margin: -1px 2px; width: 120px;
|
|
32
|
+
color: not-a-color; background-color: #00ff00;
|
|
33
|
+
"></div>`);
|
|
34
|
+
const style = computeElementStyle(document.getElementById("box"));
|
|
35
|
+
|
|
36
|
+
expect(style.display).toBe("none");
|
|
37
|
+
expect(style.padding).toEqual([1, 2, 3, 4]);
|
|
38
|
+
expect(style.margin).toEqual([-1, 2, -1, 2]);
|
|
39
|
+
expect(style.width).toBe(120);
|
|
40
|
+
expect(style.color).toBe("rgba(0, 0, 0, 1)");
|
|
41
|
+
expect(style.backgroundColor).toBe("rgba(0, 255, 0, 1)");
|
|
42
|
+
expect(parseDeclarations(`color: rgb(1, 2, 3); width: calc(10px + 2px)`).size).toBe(2);
|
|
43
|
+
window.happyDOM.abort();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test("display none removes a subtree and inline white-space reaches layout input", () => {
|
|
47
|
+
const { document, window } = parseHTMLDocument(`<body>
|
|
48
|
+
<div style="display:none">hidden</div>
|
|
49
|
+
<span style="white-space:pre">first\n second</span>
|
|
50
|
+
</body>`);
|
|
51
|
+
const styles = new StyleEngine().compute(document);
|
|
52
|
+
const tree = new RenderTreeBuilder().build(document, styles);
|
|
53
|
+
|
|
54
|
+
expect(renderTreeText(tree)).not.toContain("hidden");
|
|
55
|
+
const span = [...tree.nodesById.values()].find((node) => node.tagName === "SPAN");
|
|
56
|
+
expect(span.style.whiteSpace).toBe("pre");
|
|
57
|
+
window.happyDOM.abort();
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test("external rules cascade through selectors and inherited custom properties", () => {
|
|
61
|
+
const { document, window } = parseHTMLDocument(`<body><main class="page"><p>styled</p></main></body>`);
|
|
62
|
+
const styles = new StyleEngine().compute(document, [`
|
|
63
|
+
:root { --page-bg: #0d1117; --page-text: #e6edf3 }
|
|
64
|
+
html, body { background: var(--page-bg) }
|
|
65
|
+
body { color: var(--page-text) }
|
|
66
|
+
.page p { font-weight: bold }
|
|
67
|
+
`]);
|
|
68
|
+
|
|
69
|
+
expect(styles.get(document.body)).toMatchObject({
|
|
70
|
+
backgroundColor: "rgba(13, 17, 23, 1)",
|
|
71
|
+
color: "rgba(230, 237, 243, 1)",
|
|
72
|
+
});
|
|
73
|
+
expect(styles.get(document.querySelector("p"))).toMatchObject({
|
|
74
|
+
color: "rgba(230, 237, 243, 1)",
|
|
75
|
+
fontWeight: 700,
|
|
76
|
+
});
|
|
77
|
+
window.happyDOM.abort();
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
test("computes practical relative lengths and constrained widths", () => {
|
|
81
|
+
const { document, window } = parseHTMLDocument(`<body style="font-size:20px">
|
|
82
|
+
<div style="font-size:1.5em;line-height:1.6;margin:1rem auto;padding:.5em;max-width:50%">box</div>
|
|
83
|
+
</body>`);
|
|
84
|
+
const style = new StyleEngine().compute(document).get(document.querySelector("div"));
|
|
85
|
+
|
|
86
|
+
expect(style).toMatchObject({
|
|
87
|
+
fontSize: 30,
|
|
88
|
+
lineHeight: 48,
|
|
89
|
+
margin: [16, "auto", 16, "auto"],
|
|
90
|
+
padding: [15, 15, 15, 15],
|
|
91
|
+
maxWidth: { unit: "%", value: 50 },
|
|
92
|
+
});
|
|
93
|
+
window.happyDOM.abort();
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
test("computes the first paint and flex presentation properties", () => {
|
|
97
|
+
const { document, window } = parseHTMLDocument(`<div style="
|
|
98
|
+
display:flex;flex-direction:column;flex-wrap:wrap;gap:1rem;text-align:center;
|
|
99
|
+
justify-content:space-between;align-items:center;
|
|
100
|
+
border:2px solid #ff0000;border-radius:.5em
|
|
101
|
+
">box</div>`);
|
|
102
|
+
const style = computeElementStyle(document.querySelector("div"));
|
|
103
|
+
|
|
104
|
+
expect(style).toMatchObject({
|
|
105
|
+
display: "flex",
|
|
106
|
+
flexDirection: "column",
|
|
107
|
+
flexWrap: "wrap",
|
|
108
|
+
justifyContent: "space-between",
|
|
109
|
+
alignItems: "center",
|
|
110
|
+
gap: 16,
|
|
111
|
+
textAlign: "center",
|
|
112
|
+
borderWidths: [2, 2, 2, 2],
|
|
113
|
+
borderColors: Array(4).fill("rgba(255, 0, 0, 1)"),
|
|
114
|
+
borderStyles: Array(4).fill("solid"),
|
|
115
|
+
borderRadius: 8,
|
|
116
|
+
});
|
|
117
|
+
window.happyDOM.abort();
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
test("resolves per-side borders, border-style none and currentColor", () => {
|
|
121
|
+
const { document, window } = parseHTMLDocument(`<body>
|
|
122
|
+
<div id="left" style="color:#00f; border:1px solid #111; border-left:3px solid; border-radius:50%">x</div>
|
|
123
|
+
<div id="none" style="border-width:4px; border-top: thick dashed red">y</div>
|
|
124
|
+
<div id="sides" style="border-style:solid; border-width:1px 2px; border-color:red currentcolor; border-bottom-width:thin">z</div>
|
|
125
|
+
</body>`);
|
|
126
|
+
const styles = new StyleEngine().compute(document);
|
|
127
|
+
const left = styles.get(document.getElementById("left"));
|
|
128
|
+
|
|
129
|
+
expect(left.borderWidths).toEqual([1, 1, 1, 3]);
|
|
130
|
+
expect(left.borderColors).toEqual(["rgba(17, 17, 17, 1)", "rgba(17, 17, 17, 1)", "rgba(17, 17, 17, 1)", "rgba(0, 0, 255, 1)"]);
|
|
131
|
+
expect(left.borderRadius).toEqual({ unit: "%", value: 50 });
|
|
132
|
+
// Only the top side has a style, so the other widths compute to 0.
|
|
133
|
+
expect(styles.get(document.getElementById("none")).borderWidths).toEqual([5, 0, 0, 0]);
|
|
134
|
+
const sides = styles.get(document.getElementById("sides"));
|
|
135
|
+
expect(sides.borderWidths).toEqual([1, 2, 1, 2]);
|
|
136
|
+
expect(sides.borderColors).toEqual(["rgba(255, 0, 0, 1)", "rgba(0, 0, 0, 1)", "rgba(255, 0, 0, 1)", "rgba(0, 0, 0, 1)"]);
|
|
137
|
+
window.happyDOM.abort();
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
test("keeps gradient-clipped transparent text visible with a solid fallback", () => {
|
|
141
|
+
const { document, window } = parseHTMLDocument(`<h1 class="slogan">BUNinu Is Not Unix</h1>`);
|
|
142
|
+
const styles = new StyleEngine().compute(document, [`
|
|
143
|
+
:root { --accent: #ffb703; --accent-2: #ff6b6b }
|
|
144
|
+
.slogan {
|
|
145
|
+
background: linear-gradient(90deg, var(--accent), var(--accent-2));
|
|
146
|
+
-webkit-background-clip: text;
|
|
147
|
+
background-clip: text;
|
|
148
|
+
color: transparent;
|
|
149
|
+
}
|
|
150
|
+
`]);
|
|
151
|
+
const style = styles.get(document.querySelector("h1"));
|
|
152
|
+
|
|
153
|
+
expect(style.backgroundClip).toBe("text");
|
|
154
|
+
expect(style.backgroundImage).toContain("linear-gradient");
|
|
155
|
+
expect(style.color).toBe("rgba(255, 183, 3, 1)");
|
|
156
|
+
window.happyDOM.abort();
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
test("evaluates @media against the viewport and keeps order across stylesheets", () => {
|
|
160
|
+
const { document, window } = parseHTMLDocument(`<body><div id="box">x</div></body>`);
|
|
161
|
+
const sheets = [
|
|
162
|
+
`#box { color: red } @media (max-width: 640px) { #box { padding: 4px } }
|
|
163
|
+
@media print { #box { display: none } } @font-face { font-family: x; src: url(x) }`,
|
|
164
|
+
`#box { color: blue } @media screen and (min-width: 40em) { #box { margin: 0 } }`,
|
|
165
|
+
];
|
|
166
|
+
const wide = new StyleEngine().compute(document, sheets, { width: 800, height: 600 }).get(document.getElementById("box"));
|
|
167
|
+
const narrow = new StyleEngine().compute(document, sheets, { width: 400, height: 600 }).get(document.getElementById("box"));
|
|
168
|
+
|
|
169
|
+
expect(wide).toMatchObject({ color: "rgba(0, 0, 255, 1)", display: "block", padding: [0, 0, 0, 0] });
|
|
170
|
+
expect(narrow.padding).toEqual([4, 4, 4, 4]);
|
|
171
|
+
window.happyDOM.abort();
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
test("applies UA margins, root-relative rem, viewport units and inherited line-height factors", () => {
|
|
175
|
+
const { document, window } = parseHTMLDocument(`<html style="font-size:20px"><body>
|
|
176
|
+
<h1 id="title">t</h1><p id="text">p</p><div id="clamp">c</div>
|
|
177
|
+
</body></html>`);
|
|
178
|
+
const styles = new StyleEngine().compute(document, [`
|
|
179
|
+
body { line-height: 1.5 } p { margin-top: 0 } #clamp { font-size: clamp(1rem, 5vw, 3rem) }
|
|
180
|
+
`], { width: 400, height: 300 });
|
|
181
|
+
|
|
182
|
+
expect(styles.get(document.body).margin).toEqual([8, 8, 8, 8]);
|
|
183
|
+
expect(styles.get(document.getElementById("title"))).toMatchObject({ fontSize: 40, fontWeight: 700, lineHeight: 60 });
|
|
184
|
+
expect(styles.get(document.getElementById("title")).margin[0]).toBeCloseTo(26.8);
|
|
185
|
+
expect(styles.get(document.getElementById("text")).margin).toEqual([0, 0, 20, 0]);
|
|
186
|
+
expect(styles.get(document.getElementById("clamp")).fontSize).toBe(20);
|
|
187
|
+
expect(styles.get(document.documentElement).lineHeight).toBeNull();
|
|
188
|
+
window.happyDOM.abort();
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
test("parses font-family lists, box-shadow layers and the background shorthand", () => {
|
|
192
|
+
const { document, window } = parseHTMLDocument(`<body>
|
|
193
|
+
<div id="card">x<code id="code">c</code></div><div id="plain">y</div>
|
|
194
|
+
</body>`);
|
|
195
|
+
const styles = new StyleEngine().compute(document, [`
|
|
196
|
+
#card { font-family: "SF Mono", Menlo, monospace; box-shadow: 0 20px 60px #ffb70340, inset 1px 2px red;
|
|
197
|
+
background: radial-gradient(1200px 500px at 50% -10%, rgba(255,183,3,.16), transparent 60%), linear-gradient(180deg, #111 0%, #222 70%) }
|
|
198
|
+
#plain { background-color: red; background: #0d1117 }
|
|
199
|
+
`]);
|
|
200
|
+
const card = styles.get(document.getElementById("card"));
|
|
201
|
+
|
|
202
|
+
expect(card.fontFamily).toEqual(["SF Mono", "Menlo", "monospace"]);
|
|
203
|
+
expect(styles.get(document.getElementById("code")).fontFamily).toEqual(["monospace"]);
|
|
204
|
+
expect(card.boxShadow).toEqual([
|
|
205
|
+
{ x: 0, y: 20, blur: 60, spread: 0, color: "rgba(255, 183, 3, 0.2509804)", inset: false },
|
|
206
|
+
{ x: 1, y: 2, blur: 0, spread: 0, color: "rgba(255, 0, 0, 1)", inset: true },
|
|
207
|
+
]);
|
|
208
|
+
// Two gradient layers and no color: the shorthand resets background-color.
|
|
209
|
+
expect(card.backgroundColor).toBe("rgba(0, 0, 0, 0)");
|
|
210
|
+
expect(card.backgroundImage.match(/gradient\(/g)).toHaveLength(2);
|
|
211
|
+
expect(styles.get(document.getElementById("plain"))).toMatchObject({ backgroundColor: "rgba(13, 17, 23, 1)", backgroundImage: null });
|
|
212
|
+
window.happyDOM.abort();
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
test("matches complex selectors with Selectors 4 specificity", () => {
|
|
216
|
+
const { document, window } = parseHTMLDocument(`<body>
|
|
217
|
+
<ul class="list"><li>a</li><li id="b">b</li><li>c</li></ul>
|
|
218
|
+
<a href="/x" target="_blank">x</a>
|
|
219
|
+
</body>`);
|
|
220
|
+
const styles = new StyleEngine().compute(document, [`
|
|
221
|
+
.list > li:not(:last-child) { color: red }
|
|
222
|
+
li:first-child + li { color: blue }
|
|
223
|
+
ul li { color: green }
|
|
224
|
+
:where(#b) { color: black }
|
|
225
|
+
a[target="_blank"] { font-weight: 700 }
|
|
226
|
+
li:hover { color: yellow }
|
|
227
|
+
`]);
|
|
228
|
+
const items = [...document.querySelectorAll("li")];
|
|
229
|
+
|
|
230
|
+
// (0,2,1) beats (0,1,2) beats (0,0,2); :where() adds nothing; :hover never matches statically.
|
|
231
|
+
expect(items.map((item) => styles.get(item).color)).toEqual([
|
|
232
|
+
"rgba(255, 0, 0, 1)", "rgba(255, 0, 0, 1)", "rgba(0, 128, 0, 1)",
|
|
233
|
+
]);
|
|
234
|
+
expect(styles.get(document.querySelector("a")).fontWeight).toBe(700);
|
|
235
|
+
window.happyDOM.abort();
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
test("computes ::before/::after styles only when content generates a box", () => {
|
|
239
|
+
const { document, window } = parseHTMLDocument(`<body><div class="step">a</div><div class="step">b</div></body>`);
|
|
240
|
+
const styles = new StyleEngine().compute(document, [`
|
|
241
|
+
.step:not(:last-child)::after { content: "\\2192 next"; color: orange; display: flex }
|
|
242
|
+
.step:before { content: none }
|
|
243
|
+
.step::placeholder { color: red }
|
|
244
|
+
`]);
|
|
245
|
+
const [first, last] = document.querySelectorAll(".step");
|
|
246
|
+
|
|
247
|
+
expect(styles.getPseudo(first, "after")).toMatchObject({ content: "→ next", display: "flex", color: "rgba(255, 165, 0, 1)" });
|
|
248
|
+
expect(styles.getPseudo(last, "after")).toBeNull();
|
|
249
|
+
expect(styles.getPseudo(first, "before")).toBeNull();
|
|
250
|
+
window.happyDOM.abort();
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
test("CSS-wide keywords work for every property and one bad declaration does not stop the cascade", () => {
|
|
254
|
+
const { document, window } = parseHTMLDocument(`<body>
|
|
255
|
+
<div id="parent" style="margin: 7px; padding: 3px; flex-grow: 2">
|
|
256
|
+
<p id="unset" style="margin: unset; padding: initial; color: blue">u</p>
|
|
257
|
+
<p id="inherit" style="margin: inherit; padding-top: inherit; flex-grow: inherit">i</p>
|
|
258
|
+
<p id="revert" style="margin: revert">r</p>
|
|
259
|
+
</div>
|
|
260
|
+
</body>`);
|
|
261
|
+
const engine = new StyleEngine().compute(document);
|
|
262
|
+
expect(engine.get(document.getElementById("unset"))).toMatchObject({
|
|
263
|
+
margin: [0, 0, 0, 0], padding: [0, 0, 0, 0], color: "rgba(0, 0, 255, 1)",
|
|
264
|
+
});
|
|
265
|
+
expect(engine.get(document.getElementById("inherit"))).toMatchObject({
|
|
266
|
+
margin: [7, 7, 7, 7], padding: [3, 0, 0, 0], flexGrow: 2,
|
|
267
|
+
});
|
|
268
|
+
expect(engine.get(document.getElementById("revert")).margin).toEqual([0, 0, 0, 0]);
|
|
269
|
+
window.happyDOM.abort();
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
test("indexed rules still match by id, class, type, escapes and complex selectors, in cascade order", () => {
|
|
273
|
+
const { document, window } = parseHTMLDocument(`<body>
|
|
274
|
+
<main id="app" class="md:flex w-1.5 wide">
|
|
275
|
+
<section class="card"><span class="x">s</span><em>e</em></section>
|
|
276
|
+
</main>
|
|
277
|
+
</body>`);
|
|
278
|
+
const css = `
|
|
279
|
+
#app { width: 100px }
|
|
280
|
+
.md\\:flex { display: flex }
|
|
281
|
+
.w-1\\.5 { min-width: 5px }
|
|
282
|
+
section.card > span { color: red }
|
|
283
|
+
:is(.card) em { color: green }
|
|
284
|
+
[class~="wide"] { max-width: 300px }
|
|
285
|
+
* + em { font-weight: bold }
|
|
286
|
+
span { color: blue }
|
|
287
|
+
.x { font-size: 20px }
|
|
288
|
+
`;
|
|
289
|
+
const engine = new StyleEngine().compute(document, [css]);
|
|
290
|
+
expect(engine.get(document.getElementById("app"))).toMatchObject({
|
|
291
|
+
width: 100, display: "flex", minWidth: 5, maxWidth: 300,
|
|
292
|
+
});
|
|
293
|
+
const span = document.querySelector("span");
|
|
294
|
+
// `span { color: blue }` comes later with lower specificity: the child combinator rule wins.
|
|
295
|
+
expect(engine.get(span)).toMatchObject({ color: "rgba(255, 0, 0, 1)", fontSize: 20 });
|
|
296
|
+
expect(engine.get(document.querySelector("em"))).toMatchObject({ color: "rgba(0, 128, 0, 1)", fontWeight: 700 });
|
|
297
|
+
window.happyDOM.abort();
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
test("the rule index and ancestor filter never drop a matching rule", () => {
|
|
301
|
+
const { document, window } = parseHTMLDocument(`<html class="dark"><body>
|
|
302
|
+
<main id="m" data-x="1" class="a"><section class="s"><p class="p" title="t">x</p><span>y</span><em>z</em></section>
|
|
303
|
+
<ul><li>1</li><li class="last">2</li></ul></main></body></html>`);
|
|
304
|
+
const css = `
|
|
305
|
+
:root { color: red }
|
|
306
|
+
html.dark p { color: blue }
|
|
307
|
+
[data-x] { width: 10px }
|
|
308
|
+
[data-x="1"] .p { height: 5px }
|
|
309
|
+
[title] { font-weight: bold }
|
|
310
|
+
:is(.p, span) { font-size: 20px }
|
|
311
|
+
:where(em, .nothing) { min-width: 4px }
|
|
312
|
+
.s > * { padding: 1px }
|
|
313
|
+
.a .s + ul li:last-child { color: green }
|
|
314
|
+
.p ~ em { margin: 2px }
|
|
315
|
+
main:not(.zzz) span { display: block }
|
|
316
|
+
[x="a]#m"] { color: pink }
|
|
317
|
+
.missing-ancestor .p { color: orange }
|
|
318
|
+
section p::before { content: "b" }
|
|
319
|
+
`;
|
|
320
|
+
const engine = new StyleEngine().compute(document, [css]);
|
|
321
|
+
const get = (selector) => engine.get(document.querySelector(selector));
|
|
322
|
+
expect(get("html").color).toBe("rgba(255, 0, 0, 1)");
|
|
323
|
+
expect(get("p")).toMatchObject({ color: "rgba(0, 0, 255, 1)", height: 5, fontWeight: 700, fontSize: 20, padding: [1, 1, 1, 1] });
|
|
324
|
+
expect(get("main")).toMatchObject({ width: 10, color: "rgba(255, 0, 0, 1)" });
|
|
325
|
+
expect(get("span")).toMatchObject({ fontSize: 20, display: "block", padding: [1, 1, 1, 1] });
|
|
326
|
+
expect(get("em")).toMatchObject({ minWidth: 4, margin: [2, 2, 2, 2] });
|
|
327
|
+
expect(get("li.last").color).toBe("rgba(0, 128, 0, 1)");
|
|
328
|
+
expect(get("li").color).toBe("rgba(255, 0, 0, 1)");
|
|
329
|
+
expect(engine.getPseudo(document.querySelector("p"), "before")?.content).toBe("b");
|
|
330
|
+
window.happyDOM.abort();
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
test("custom properties keep their case, take inline style, and var() fallbacks may nest", () => {
|
|
334
|
+
const { document, window } = parseHTMLDocument(`<div id="a" style="--paneWidth: var(--wide); --wide: 320px; width: var(--paneWidth)">
|
|
335
|
+
<p id="b">x</p><p id="c">y</p><p id="d">z</p></div>`);
|
|
336
|
+
const css = `
|
|
337
|
+
:root { --borderColor-default: #d1d9e0; --loop: var(--loop) }
|
|
338
|
+
#a { --paneWidth: 0 }
|
|
339
|
+
#b { color: var(--borderColor-default); background-color: var(--missing, var(--borderColor-default)) }
|
|
340
|
+
#c { color: var(--missing, rgba(10, 20, 30, 1)) }
|
|
341
|
+
#d { color: var(--loop, blue); width: var(--paneWidth) }
|
|
342
|
+
`;
|
|
343
|
+
const engine = new StyleEngine().compute(document, [css]);
|
|
344
|
+
const get = (id) => engine.get(document.getElementById(id));
|
|
345
|
+
// Inline --paneWidth wins over the stylesheet's value.
|
|
346
|
+
expect(get("a").width).toBe(320);
|
|
347
|
+
expect(get("b")).toMatchObject({ color: "rgba(209, 217, 224, 1)", backgroundColor: "rgba(209, 217, 224, 1)" });
|
|
348
|
+
expect(get("c").color).toBe("rgba(10, 20, 30, 1)");
|
|
349
|
+
// A property in a reference cycle is invalid, so its fallback applies.
|
|
350
|
+
expect(get("d")).toMatchObject({ color: "rgba(0, 0, 255, 1)", width: 320 });
|
|
351
|
+
window.happyDOM.abort();
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
test("cascade layers: unlayered beats layered, later layers win, !important reverses", () => {
|
|
356
|
+
const { document, window } = parseHTMLDocument(`<p id="a" class="x y">t</p><p id="b" class="x">u</p>`);
|
|
357
|
+
const css = [
|
|
358
|
+
`@layer base, components;
|
|
359
|
+
@layer components { .x { display: inline } }
|
|
360
|
+
@layer base { .x { display: flex; color: red !important } p { margin-top: 5px } }
|
|
361
|
+
.y { display: block }`,
|
|
362
|
+
`.x { color: blue !important } @layer base.inner { .x { visibility: hidden } }`,
|
|
363
|
+
];
|
|
364
|
+
const engine = new StyleEngine().compute(document, css);
|
|
365
|
+
const get = (id) => engine.get(document.getElementById(id));
|
|
366
|
+
expect(get("a").display).toBe("block");
|
|
367
|
+
expect(get("b").display).toBe("inline");
|
|
368
|
+
expect(get("a").color).toBe("rgba(255, 0, 0, 1)");
|
|
369
|
+
// A layered author rule still beats the user-agent defaults.
|
|
370
|
+
expect(get("a").margin).toEqual([5, 0, 16, 0]);
|
|
371
|
+
expect(get("b").visibility).toBe("hidden");
|
|
372
|
+
window.happyDOM.abort();
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
test("the font shorthand resets its parts and competes with font-size in the cascade", () => {
|
|
376
|
+
const { document, window } = parseHTMLDocument(`<h2 id="a" style="font-size:32px;line-height:3">t</h2><h2 id="b">x</h2>
|
|
377
|
+
<p id="c" style="font:italic small-caps bold 12px/1.5 Georgia, serif">u</p><p id="d" style="font-size:large">v</p>`);
|
|
378
|
+
const engine = new StyleEngine().compute(document, ["#a, #b { font: 600 1rem/1.5 sans-serif } h2 { font-size: 40px }"]);
|
|
379
|
+
const get = (id) => engine.get(document.getElementById(id));
|
|
380
|
+
expect(get("a")).toMatchObject({ fontSize: 32, fontWeight: 600, lineHeightFactor: 3 });
|
|
381
|
+
expect(get("b")).toMatchObject({ fontSize: 16, fontWeight: 600, lineHeightFactor: 1.5 });
|
|
382
|
+
expect(get("c")).toMatchObject({ fontSize: 12, fontWeight: 700, fontFamily: ["Georgia", "serif"] });
|
|
383
|
+
expect(get("d").fontSize).toBe(18);
|
|
384
|
+
window.happyDOM.abort();
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
test("calc() sums lengths and percentages; percentages resolve at layout time", () => {
|
|
388
|
+
const { document, window } = parseHTMLDocument(`<body style="font-size:10px">
|
|
389
|
+
<div id="a" style="max-width:calc(100% + 32px);width:calc(2em + 3px * 2);min-width:calc((100% - 20px) / 2)"></div>
|
|
390
|
+
<div id="b" style="width:calc(50% -10px);height:calc(100px - 2 * 1em + calc(4px));max-width:min(100%, 500px)"></div>
|
|
391
|
+
<div id="c" style="width:calc(10px + 5);max-width:calc(100% * 50%);height:calc(1px / 0);margin-left:calc(10% + 1px)"></div>
|
|
392
|
+
</body>`);
|
|
393
|
+
const styles = new StyleEngine().compute(document);
|
|
394
|
+
const style = (id) => styles.get(document.getElementById(id));
|
|
395
|
+
expect(style("a")).toMatchObject({
|
|
396
|
+
maxWidth: { unit: "math", kind: "calc", px: 32, percent: 100 },
|
|
397
|
+
width: 26,
|
|
398
|
+
minWidth: { unit: "math", kind: "calc", px: -10, percent: 50 },
|
|
399
|
+
});
|
|
400
|
+
// "50% -10px" (no space after the minus) still subtracts
|
|
401
|
+
expect(style("b")).toMatchObject({
|
|
402
|
+
width: { unit: "math", kind: "calc", px: -10, percent: 50 },
|
|
403
|
+
height: 84,
|
|
404
|
+
maxWidth: { unit: "math", kind: "min" },
|
|
405
|
+
});
|
|
406
|
+
// Invalid: length + number, % * %, division by zero, % where no percentages are allowed
|
|
407
|
+
expect(style("c")).toMatchObject({ width: "auto", maxWidth: "none", height: "auto", margin: [0, 0, 0, 0] });
|
|
408
|
+
window.happyDOM.abort();
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
test("links get the UA link style; text decorations propagate to in-flow descendants", () => {
|
|
412
|
+
const { document, window } = parseHTMLDocument(`<body>
|
|
413
|
+
<a id="link" href="javascript:void 0"><span id="inside">x</span><span id="atomic" style="display:inline-block">y</span></a>
|
|
414
|
+
<a id="anchor" name="n">no href</a>
|
|
415
|
+
<p id="own" style="text-decoration: line-through red wavy 2px">
|
|
416
|
+
<em id="nested" style="text-decoration-line: underline overline">z</em>
|
|
417
|
+
<span id="cleared" style="text-decoration: none">still struck</span></p>
|
|
418
|
+
<p id="bad" style="text-decoration: underline blue; text-decoration-color: nonsense">b</p>
|
|
419
|
+
<p id="invalid" style="text-decoration: sparkly">c</p>
|
|
420
|
+
</body>`);
|
|
421
|
+
const styles = new StyleEngine().compute(document);
|
|
422
|
+
const style = (id) => styles.get(document.getElementById(id));
|
|
423
|
+
expect(style("link")).toMatchObject({ color: "rgba(0, 0, 238, 1)", textDecorations: { lines: ["underline"], color: "rgba(0, 0, 238, 1)" } });
|
|
424
|
+
expect(style("inside").textDecorations).toEqual({ lines: ["underline"], color: "rgba(0, 0, 238, 1)" });
|
|
425
|
+
expect(style("atomic").textDecorations).toBeNull();
|
|
426
|
+
expect(style("anchor")).toMatchObject({ color: "rgba(0, 0, 0, 1)", textDecorations: null });
|
|
427
|
+
expect(style("own").textDecorations).toEqual({ lines: ["line-through"], color: "rgba(255, 0, 0, 1)" });
|
|
428
|
+
expect(style("nested").textDecorations).toEqual({ lines: ["line-through", "underline", "overline"], color: "rgba(0, 0, 0, 1)" });
|
|
429
|
+
// "none" on a descendant does not remove what an ancestor draws.
|
|
430
|
+
expect(style("cleared").textDecorations).toEqual({ lines: ["line-through"], color: "rgba(255, 0, 0, 1)" });
|
|
431
|
+
expect(style("bad").textDecorations).toEqual({ lines: ["underline"], color: "rgba(0, 0, 255, 1)" });
|
|
432
|
+
expect(style("invalid").textDecorations).toBeNull();
|
|
433
|
+
window.happyDOM.abort();
|
|
434
|
+
});
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { expect, test } from "bun:test";
|
|
2
|
+
import { parseHTMLDocument } from "../lib/happy-dom/parser.js";
|
|
3
|
+
import { layoutText } from "../lib/layout/text-layout.js";
|
|
4
|
+
import { buildDisplayList, visibleItems } from "../lib/paint/display-list.js";
|
|
5
|
+
import { RenderTreeBuilder } from "../lib/render-tree/index.js";
|
|
6
|
+
import { StyleEngine } from "../lib/style/computed-style.js";
|
|
7
|
+
|
|
8
|
+
function displayListFor(html, css, resources = new WeakMap()) {
|
|
9
|
+
const { document, window } = parseHTMLDocument(`<body style="margin:0">${html}</body>`);
|
|
10
|
+
const styles = new StyleEngine().compute(document, [css]);
|
|
11
|
+
const tree = new RenderTreeBuilder().build(document, styles, resources);
|
|
12
|
+
const layout = layoutText(tree, {
|
|
13
|
+
x: 0,
|
|
14
|
+
y: 0,
|
|
15
|
+
width: 200,
|
|
16
|
+
lineHeight: 20,
|
|
17
|
+
measureText: (text) => text.length * 10,
|
|
18
|
+
fontMetrics: () => ({ ascent: 16, height: 20 }),
|
|
19
|
+
});
|
|
20
|
+
return { document, window, tree, displayList: buildDisplayList(layout, tree) };
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
test("paints box decorations in tree order before inline content", () => {
|
|
24
|
+
const { window, displayList } = displayListFor(
|
|
25
|
+
`<div class="card"><p>hi <code>x</code></p></div>`,
|
|
26
|
+
`.card { background:#111; border:2px solid #f00; border-radius:6px; padding:4px }
|
|
27
|
+
p { margin:0; color:#0f0 } code { background:#333 }`,
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
expect(displayList.items.map((item) => item.op)).toEqual([
|
|
31
|
+
"fillRect", "border", "fillRect", "drawText", "drawText",
|
|
32
|
+
]);
|
|
33
|
+
const [background, border, code, text] = displayList.items;
|
|
34
|
+
expect(background).toMatchObject({ rect: { x: 0, y: 0, width: 200, height: 32 }, radii: { x: 6, y: 6 }, color: "rgba(17, 17, 17, 1)" });
|
|
35
|
+
expect(border).toMatchObject({ rect: { x: 0, y: 0, width: 200, height: 32 }, widths: [2, 2, 2, 2] });
|
|
36
|
+
expect(border.colors).toEqual(Array(4).fill("rgba(255, 0, 0, 1)"));
|
|
37
|
+
expect(code).toMatchObject({ rect: { x: 36, width: 10 } });
|
|
38
|
+
expect(text).toMatchObject({ text: "hi ", x: 6, font: { size: 16, weight: 400 }, color: "rgba(0, 255, 0, 1)" });
|
|
39
|
+
expect(Object.isFrozen(displayList.items[0].rect)).toBeTrue();
|
|
40
|
+
window.happyDOM.abort();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test("serializes without image resources and culls by bounds", () => {
|
|
44
|
+
const { document, window } = parseHTMLDocument(`<body style="margin:0"><img src="a.png" width="20" height="10"><div style="height:500px"></div><p>far</p></body>`);
|
|
45
|
+
const image = document.querySelector("img");
|
|
46
|
+
const resource = { width: 20, height: 10, image: { canvasKitImage: true } };
|
|
47
|
+
const styles = new StyleEngine().compute(document);
|
|
48
|
+
const tree = new RenderTreeBuilder().build(document, styles, new WeakMap([[image, resource]]));
|
|
49
|
+
const displayList = buildDisplayList(layoutText(tree, {
|
|
50
|
+
x: 0, y: 0, width: 200, measureText: (text) => text.length * 10,
|
|
51
|
+
}));
|
|
52
|
+
|
|
53
|
+
const draw = displayList.items.find((item) => item.op === "drawImage");
|
|
54
|
+
expect(displayList.images[draw.image]).toBe(resource);
|
|
55
|
+
expect(JSON.stringify(displayList)).not.toContain("canvasKitImage");
|
|
56
|
+
expect(visibleItems(displayList, { x: 0, y: 0, width: 200, height: 100 }).map((item) => item.op)).toEqual(["drawImage"]);
|
|
57
|
+
expect(visibleItems(displayList, { x: 0, y: 500, width: 200, height: 100 }).map((item) => item.text)).toEqual(["far"]);
|
|
58
|
+
window.happyDOM.abort();
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test("emits box shadows, gradient layers, rounded images and gradient text", () => {
|
|
62
|
+
const { document, window } = parseHTMLDocument(`<body style="margin:0">
|
|
63
|
+
<div class="hero"><img class="logo" src="a.png" width="40" height="40"><h1 class="slogan">Hi</h1></div></body>`);
|
|
64
|
+
const image = document.querySelector("img");
|
|
65
|
+
const resource = { width: 40, height: 40, image: {} };
|
|
66
|
+
const styles = new StyleEngine().compute(document, [`
|
|
67
|
+
.hero { background: radial-gradient(100px 50px at 50% 0%, red, transparent 60%), linear-gradient(180deg, #111, #222) }
|
|
68
|
+
.logo { display:block; border-radius:8px; box-shadow: 0 20px 60px #ffb70340 }
|
|
69
|
+
.slogan { margin:0; background: linear-gradient(90deg, #ffb703, #ff6b6b); -webkit-background-clip:text; background-clip:text; color:transparent }
|
|
70
|
+
`]);
|
|
71
|
+
const tree = new RenderTreeBuilder().build(document, styles, new WeakMap([[image, resource]]));
|
|
72
|
+
const displayList = buildDisplayList(layoutText(tree, {
|
|
73
|
+
x: 0, y: 0, width: 200, measureText: (text) => text.length * 10,
|
|
74
|
+
}));
|
|
75
|
+
const ops = displayList.items.map((item) => item.op + (item.gradient ? `:${item.gradient.type}` : ""));
|
|
76
|
+
|
|
77
|
+
// Background layers paint bottom-up; the clipped-text gradient is not a box fill.
|
|
78
|
+
expect(ops).toEqual(["fillRect:linear", "fillRect:radial", "drawShadow", "drawImage", "drawText:linear"]);
|
|
79
|
+
const shadow = displayList.items.find((item) => item.op === "drawShadow");
|
|
80
|
+
expect(shadow).toMatchObject({ rect: { x: 0, y: 20, width: 40, height: 40 }, blur: 60, radii: { x: 8, y: 8 }, clip: { y: 0 } });
|
|
81
|
+
expect(shadow.color).toBe("rgba(255, 183, 3, 0.2509804)");
|
|
82
|
+
expect(displayList.items.find((item) => item.op === "drawImage").radii).toEqual({ x: 8, y: 8 });
|
|
83
|
+
const text = displayList.items.find((item) => item.op === "drawText");
|
|
84
|
+
expect(text.gradient.stops.map((stop) => stop.color)).toEqual(["rgba(255, 183, 3, 1)", "rgba(255, 107, 107, 1)"]);
|
|
85
|
+
window.happyDOM.abort();
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
test("resolves percentage radii per axis and scales overlapping radii down", () => {
|
|
89
|
+
const { window, displayList } = displayListFor(
|
|
90
|
+
`<div class="pill">x</div><div class="huge">y</div>`,
|
|
91
|
+
`.pill { width:100px; height:40px; background:#111; border-radius:50% }
|
|
92
|
+
.huge { width:100px; height:40px; background:#222; border-radius:60px }`,
|
|
93
|
+
);
|
|
94
|
+
const [pill, huge] = displayList.items.filter((item) => item.op === "fillRect");
|
|
95
|
+
expect(pill.radii).toEqual({ x: 50, y: 20 });
|
|
96
|
+
// 60px corners would overlap on a 40px-tall box: scale by 40 / 120.
|
|
97
|
+
expect(huge.radii.x).toBeCloseTo(20);
|
|
98
|
+
expect(huge.radii.y).toBeCloseTo(20);
|
|
99
|
+
window.happyDOM.abort();
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
test("visibility, opacity and overflow/clip clipping apply to descendants", () => {
|
|
103
|
+
const { window, displayList } = displayListFor(`
|
|
104
|
+
<div id="hidden" style="visibility:hidden"><span>gone</span><b style="visibility:visible">shown</b></div>
|
|
105
|
+
<div style="opacity:0"><p>invisible</p></div>
|
|
106
|
+
<div style="opacity:0.5"><p style="opacity:0.5">faint</p></div>
|
|
107
|
+
<div style="overflow:hidden;width:30px;height:20px;white-space:nowrap"><p style="margin:0">clipped</p><p style="margin:0">below</p></div>
|
|
108
|
+
<div style="position:relative"><div style="overflow:hidden;height:5px"><p style="position:absolute">escapes</p></div></div>
|
|
109
|
+
<p style="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)">screen reader only</p>
|
|
110
|
+
<p style="clip-path:inset(50%)">also sr-only</p>`, "");
|
|
111
|
+
const texts = displayList.items.filter((item) => item.op === "drawText");
|
|
112
|
+
const byText = (text) => texts.find((item) => item.text.includes(text));
|
|
113
|
+
expect(byText("gone")).toBeUndefined();
|
|
114
|
+
expect(byText("shown")).toBeDefined();
|
|
115
|
+
expect(byText("invisible")).toBeUndefined();
|
|
116
|
+
expect(byText("faint").opacity).toBeCloseTo(0.25);
|
|
117
|
+
expect(byText("clipped").clipRect).toMatchObject({ width: 30, height: 20 });
|
|
118
|
+
expect(byText("clipped").bounds.width).toBe(30);
|
|
119
|
+
// Entirely outside the clip: not in the list at all.
|
|
120
|
+
expect(byText("below")).toBeUndefined();
|
|
121
|
+
// An absolutely positioned box is not clipped by a non-positioned ancestor
|
|
122
|
+
// between it and its containing block.
|
|
123
|
+
expect(byText("escapes").clipRect ?? null).toBeNull();
|
|
124
|
+
expect(byText("screen reader only")).toBeUndefined();
|
|
125
|
+
expect(byText("also sr-only")).toBeUndefined();
|
|
126
|
+
window.happyDOM.abort();
|
|
127
|
+
});
|
|
128
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { expect, test } from "bun:test";
|
|
2
|
+
import {
|
|
3
|
+
decodeHTML,
|
|
4
|
+
decodeHTMLAttribute,
|
|
5
|
+
decodeXML,
|
|
6
|
+
escapeText,
|
|
7
|
+
} from "../lib/happy-dom/entities-adapter.js";
|
|
8
|
+
|
|
9
|
+
test("decodes HTML named and numeric character references with Bun.markdown", () => {
|
|
10
|
+
expect(decodeHTML("Tom & Jerry © 中文 😀")).toBe(
|
|
11
|
+
"Tom & Jerry © 中文 😀",
|
|
12
|
+
);
|
|
13
|
+
expect(decodeHTML("two code points: ≂̸")).toBe("two code points: ≂̸");
|
|
14
|
+
expect(decodeHTML("unknown: &buninu;")).toBe("unknown: &buninu;");
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test("uses the same decoder for HTML attributes", () => {
|
|
18
|
+
expect(decodeHTMLAttribute("search?a=1&b=2©=yes")).toBe(
|
|
19
|
+
"search?a=1&b=2©=yes",
|
|
20
|
+
);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test("keeps XML named references restricted to the XML predefined set", () => {
|
|
24
|
+
expect(decodeXML("<x a="y">&'😀</x>")).toBe(
|
|
25
|
+
`<x a="y">&'😀</x>`,
|
|
26
|
+
);
|
|
27
|
+
expect(decodeXML("©")).toBe("©");
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test("escapes text without escaping ordinary quotes", () => {
|
|
31
|
+
expect(escapeText(`Tom & Jerry <said> "hello"\u00A0`)).toBe(
|
|
32
|
+
`Tom & Jerry <said> "hello" `,
|
|
33
|
+
);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test("Happy DOM uses the project entity adapter", async () => {
|
|
37
|
+
const utilityPath =
|
|
38
|
+
"../vendor/happy-dom/packages/happy-dom/src/utilities/XMLEncodeUtility.ts";
|
|
39
|
+
const { default: XMLEncodeUtility } = await import(utilityPath);
|
|
40
|
+
expect(XMLEncodeUtility.decodeHTMLEntities("CJK 中 emoji 😀")).toBe(
|
|
41
|
+
"CJK 中 emoji 😀",
|
|
42
|
+
);
|
|
43
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// A scripted renderer for RendererHost tests. Behaviour is chosen per call.
|
|
2
|
+
process.on("message", async (message) => {
|
|
3
|
+
if (message?.type === "fetch-result") {
|
|
4
|
+
process.send({ type: "result", id: globalThis.pendingCall, result: message.error ? { error: message.error } : { status: message.result.status, bytes: message.result.body.byteLength } });
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
if (message?.type !== "call") return;
|
|
8
|
+
const [argument] = message.params;
|
|
9
|
+
switch (message.method) {
|
|
10
|
+
case "echo": return process.send({ type: "result", id: message.id, result: { pid: process.pid, argument } });
|
|
11
|
+
case "hang": for (;;) {}
|
|
12
|
+
case "fail": return process.send({ type: "result", id: message.id, error: "Error: page crashed\n at somewhere" });
|
|
13
|
+
// SES "safe" error taming leaves errors with an empty stack.
|
|
14
|
+
case "fail-blank": return process.send({ type: "result", id: message.id, error: "" });
|
|
15
|
+
case "fetch":
|
|
16
|
+
globalThis.pendingCall = message.id;
|
|
17
|
+
return process.send({ type: "fetch", id: 1, url: argument.url, kind: argument.kind });
|
|
18
|
+
case "forge":
|
|
19
|
+
// A compromised renderer answering a call that was never made, then the real one.
|
|
20
|
+
process.send({ type: "result", id: 9999, result: "forged" });
|
|
21
|
+
process.send({ type: "bogus", payload: {} });
|
|
22
|
+
return process.send({ type: "result", id: message.id, result: "real" });
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
process.on("disconnect", () => process.exit(0));
|
|
26
|
+
process.send({ type: "ready" });
|