@browsermation/browser-engine 0.0.12 → 0.0.16
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/dist/node_modules/playwright/LICENSE +202 -0
- package/dist/node_modules/playwright/NOTICE +5 -0
- package/dist/node_modules/playwright/README.md +168 -0
- package/dist/node_modules/playwright/ThirdPartyNotices.txt +6197 -0
- package/dist/node_modules/playwright/cli.js +19 -0
- package/dist/node_modules/playwright/index.d.ts +17 -0
- package/dist/node_modules/playwright/index.js +17 -0
- package/dist/node_modules/playwright/index.mjs +18 -0
- package/dist/node_modules/playwright/jsx-runtime.js +42 -0
- package/dist/node_modules/playwright/jsx-runtime.mjs +21 -0
- package/dist/node_modules/playwright/lib/agents/copilot-setup-steps.yml +34 -0
- package/dist/node_modules/playwright/lib/agents/generateAgents.js +395 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-coverage.prompt.md +31 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-generate.prompt.md +8 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-generator.agent.md +88 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-heal.prompt.md +6 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-healer.agent.md +55 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-plan.prompt.md +9 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-planner.agent.md +72 -0
- package/dist/node_modules/playwright/lib/common/config.js +280 -0
- package/dist/node_modules/playwright/lib/common/configLoader.js +344 -0
- package/dist/node_modules/playwright/lib/common/esmLoaderHost.js +102 -0
- package/dist/node_modules/playwright/lib/common/expectBundle.js +43 -0
- package/dist/node_modules/playwright/lib/common/expectBundleImpl.js +407 -0
- package/dist/node_modules/playwright/lib/common/fixtures.js +302 -0
- package/dist/node_modules/playwright/lib/common/globals.js +58 -0
- package/dist/node_modules/playwright/lib/common/ipc.js +60 -0
- package/dist/node_modules/playwright/lib/common/poolBuilder.js +85 -0
- package/dist/node_modules/playwright/lib/common/process.js +104 -0
- package/dist/node_modules/playwright/lib/common/suiteUtils.js +140 -0
- package/dist/node_modules/playwright/lib/common/test.js +321 -0
- package/dist/node_modules/playwright/lib/common/testLoader.js +101 -0
- package/dist/node_modules/playwright/lib/common/testType.js +298 -0
- package/dist/node_modules/playwright/lib/common/validators.js +68 -0
- package/dist/node_modules/playwright/lib/fsWatcher.js +67 -0
- package/dist/node_modules/playwright/lib/index.js +682 -0
- package/dist/node_modules/playwright/lib/internalsForTest.js +42 -0
- package/dist/node_modules/playwright/lib/isomorphic/events.js +77 -0
- package/dist/node_modules/playwright/lib/isomorphic/folders.js +30 -0
- package/dist/node_modules/playwright/lib/isomorphic/stringInternPool.js +69 -0
- package/dist/node_modules/playwright/lib/isomorphic/teleReceiver.js +508 -0
- package/dist/node_modules/playwright/lib/isomorphic/teleSuiteUpdater.js +137 -0
- package/dist/node_modules/playwright/lib/isomorphic/testServerConnection.js +225 -0
- package/dist/node_modules/playwright/lib/isomorphic/testServerInterface.js +16 -0
- package/dist/node_modules/playwright/lib/isomorphic/testTree.js +334 -0
- package/dist/node_modules/playwright/lib/isomorphic/types.d.js +16 -0
- package/dist/node_modules/playwright/lib/loader/loaderMain.js +59 -0
- package/dist/node_modules/playwright/lib/matchers/expect.js +324 -0
- package/dist/node_modules/playwright/lib/matchers/matcherHint.js +87 -0
- package/dist/node_modules/playwright/lib/matchers/matchers.js +382 -0
- package/dist/node_modules/playwright/lib/matchers/toBeTruthy.js +73 -0
- package/dist/node_modules/playwright/lib/matchers/toEqual.js +99 -0
- package/dist/node_modules/playwright/lib/matchers/toHaveURL.js +102 -0
- package/dist/node_modules/playwright/lib/matchers/toMatchAriaSnapshot.js +159 -0
- package/dist/node_modules/playwright/lib/matchers/toMatchSnapshot.js +341 -0
- package/dist/node_modules/playwright/lib/matchers/toMatchText.js +99 -0
- package/dist/node_modules/playwright/lib/mcp/browser/actions.d.js +16 -0
- package/dist/node_modules/playwright/lib/mcp/browser/browserContextFactory.js +296 -0
- package/dist/node_modules/playwright/lib/mcp/browser/browserServerBackend.js +76 -0
- package/dist/node_modules/playwright/lib/mcp/browser/codegen.js +66 -0
- package/dist/node_modules/playwright/lib/mcp/browser/config.js +368 -0
- package/dist/node_modules/playwright/lib/mcp/browser/context.js +267 -0
- package/dist/node_modules/playwright/lib/mcp/browser/response.js +237 -0
- package/dist/node_modules/playwright/lib/mcp/browser/sessionLog.js +160 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tab.js +292 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/common.js +63 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/console.js +44 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/dialogs.js +60 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/evaluate.js +69 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/files.js +58 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/form.js +73 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/install.js +69 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/keyboard.js +84 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/mouse.js +107 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/navigate.js +62 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/network.js +54 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/pdf.js +59 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/runCode.js +75 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/screenshot.js +106 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/snapshot.js +181 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/tabs.js +67 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/tool.js +49 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/tracing.js +74 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/utils.js +89 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/verify.js +153 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/wait.js +63 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools.js +82 -0
- package/dist/node_modules/playwright/lib/mcp/browser/watchdog.js +44 -0
- package/dist/node_modules/playwright/lib/mcp/config.d.js +16 -0
- package/dist/node_modules/playwright/lib/mcp/extension/cdpRelay.js +351 -0
- package/dist/node_modules/playwright/lib/mcp/extension/extensionContextFactory.js +75 -0
- package/dist/node_modules/playwright/lib/mcp/extension/protocol.js +28 -0
- package/dist/node_modules/playwright/lib/mcp/index.js +61 -0
- package/dist/node_modules/playwright/lib/mcp/log.js +35 -0
- package/dist/node_modules/playwright/lib/mcp/program.js +116 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/bundle.js +81 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/exports.js +30 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/http.js +187 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/inProcessTransport.js +71 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/proxyBackend.js +128 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/server.js +198 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/tool.js +47 -0
- package/dist/node_modules/playwright/lib/mcp/test/browserBackend.js +108 -0
- package/dist/node_modules/playwright/lib/mcp/test/generatorTools.js +122 -0
- package/dist/node_modules/playwright/lib/mcp/test/plannerTools.js +144 -0
- package/dist/node_modules/playwright/lib/mcp/test/seed.js +82 -0
- package/dist/node_modules/playwright/lib/mcp/test/streams.js +44 -0
- package/dist/node_modules/playwright/lib/mcp/test/testBackend.js +99 -0
- package/dist/node_modules/playwright/lib/mcp/test/testContext.js +279 -0
- package/dist/node_modules/playwright/lib/mcp/test/testTool.js +30 -0
- package/dist/node_modules/playwright/lib/mcp/test/testTools.js +106 -0
- package/dist/node_modules/playwright/lib/mcpBundleImpl.js +41 -0
- package/dist/node_modules/playwright/lib/plugins/gitCommitInfoPlugin.js +198 -0
- package/dist/node_modules/playwright/lib/plugins/index.js +28 -0
- package/dist/node_modules/playwright/lib/plugins/webServerPlugin.js +237 -0
- package/dist/node_modules/playwright/lib/program.js +403 -0
- package/dist/node_modules/playwright/lib/reporters/base.js +609 -0
- package/dist/node_modules/playwright/lib/reporters/blob.js +135 -0
- package/dist/node_modules/playwright/lib/reporters/dot.js +82 -0
- package/dist/node_modules/playwright/lib/reporters/empty.js +32 -0
- package/dist/node_modules/playwright/lib/reporters/github.js +128 -0
- package/dist/node_modules/playwright/lib/reporters/html.js +623 -0
- package/dist/node_modules/playwright/lib/reporters/internalReporter.js +132 -0
- package/dist/node_modules/playwright/lib/reporters/json.js +254 -0
- package/dist/node_modules/playwright/lib/reporters/junit.js +232 -0
- package/dist/node_modules/playwright/lib/reporters/line.js +113 -0
- package/dist/node_modules/playwright/lib/reporters/list.js +231 -0
- package/dist/node_modules/playwright/lib/reporters/listModeReporter.js +69 -0
- package/dist/node_modules/playwright/lib/reporters/markdown.js +144 -0
- package/dist/node_modules/playwright/lib/reporters/merge.js +541 -0
- package/dist/node_modules/playwright/lib/reporters/multiplexer.js +104 -0
- package/dist/node_modules/playwright/lib/reporters/reporterV2.js +102 -0
- package/dist/node_modules/playwright/lib/reporters/teleEmitter.js +299 -0
- package/dist/node_modules/playwright/lib/reporters/versions/blobV1.js +16 -0
- package/dist/node_modules/playwright/lib/runner/dispatcher.js +515 -0
- package/dist/node_modules/playwright/lib/runner/failureTracker.js +72 -0
- package/dist/node_modules/playwright/lib/runner/lastRun.js +77 -0
- package/dist/node_modules/playwright/lib/runner/loadUtils.js +334 -0
- package/dist/node_modules/playwright/lib/runner/loaderHost.js +89 -0
- package/dist/node_modules/playwright/lib/runner/processHost.js +161 -0
- package/dist/node_modules/playwright/lib/runner/projectUtils.js +241 -0
- package/dist/node_modules/playwright/lib/runner/rebase.js +189 -0
- package/dist/node_modules/playwright/lib/runner/reporters.js +138 -0
- package/dist/node_modules/playwright/lib/runner/sigIntWatcher.js +96 -0
- package/dist/node_modules/playwright/lib/runner/taskRunner.js +127 -0
- package/dist/node_modules/playwright/lib/runner/tasks.js +410 -0
- package/dist/node_modules/playwright/lib/runner/testGroups.js +117 -0
- package/dist/node_modules/playwright/lib/runner/testRunner.js +389 -0
- package/dist/node_modules/playwright/lib/runner/testServer.js +269 -0
- package/dist/node_modules/playwright/lib/runner/uiModeReporter.js +30 -0
- package/dist/node_modules/playwright/lib/runner/vcs.js +72 -0
- package/dist/node_modules/playwright/lib/runner/watchMode.js +395 -0
- package/dist/node_modules/playwright/lib/runner/workerHost.js +98 -0
- package/dist/node_modules/playwright/lib/third_party/pirates.js +62 -0
- package/dist/node_modules/playwright/lib/third_party/tsconfig-loader.js +103 -0
- package/dist/node_modules/playwright/lib/transform/babelBundle.js +43 -0
- package/dist/node_modules/playwright/lib/transform/babelBundleImpl.js +461 -0
- package/dist/node_modules/playwright/lib/transform/compilationCache.js +272 -0
- package/dist/node_modules/playwright/lib/transform/esmLoader.js +104 -0
- package/dist/node_modules/playwright/lib/transform/portTransport.js +67 -0
- package/dist/node_modules/playwright/lib/transform/transform.js +293 -0
- package/dist/node_modules/playwright/lib/util.js +403 -0
- package/dist/node_modules/playwright/lib/utilsBundle.js +43 -0
- package/dist/node_modules/playwright/lib/utilsBundleImpl.js +100 -0
- package/dist/node_modules/playwright/lib/worker/fixtureRunner.js +258 -0
- package/dist/node_modules/playwright/lib/worker/testInfo.js +516 -0
- package/dist/node_modules/playwright/lib/worker/testTracing.js +345 -0
- package/dist/node_modules/playwright/lib/worker/timeoutManager.js +174 -0
- package/dist/node_modules/playwright/lib/worker/util.js +31 -0
- package/dist/node_modules/playwright/lib/worker/workerMain.js +529 -0
- package/dist/node_modules/playwright/package.json +72 -0
- package/dist/node_modules/playwright/test.d.ts +18 -0
- package/dist/node_modules/playwright/test.js +24 -0
- package/dist/node_modules/playwright/test.mjs +33 -0
- package/dist/node_modules/playwright/types/test.d.ts +10253 -0
- package/dist/node_modules/playwright/types/testReporter.d.ts +821 -0
- package/dist/node_modules/playwright-core/LICENSE +202 -0
- package/dist/node_modules/playwright-core/NOTICE +5 -0
- package/dist/node_modules/playwright-core/README.md +3 -0
- package/dist/node_modules/playwright-core/ThirdPartyNotices.txt +1161 -0
- package/dist/node_modules/playwright-core/bin/install_media_pack.ps1 +5 -0
- package/dist/node_modules/playwright-core/bin/install_webkit_wsl.ps1 +33 -0
- package/dist/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +42 -0
- package/dist/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +13 -0
- package/dist/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +24 -0
- package/dist/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +42 -0
- package/dist/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +12 -0
- package/dist/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +24 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +48 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +11 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +23 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +48 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +11 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +23 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +48 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +11 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +24 -0
- package/dist/node_modules/playwright-core/browsers.json +80 -0
- package/dist/node_modules/playwright-core/cli.js +18 -0
- package/dist/node_modules/playwright-core/index.d.ts +17 -0
- package/dist/node_modules/playwright-core/index.js +32 -0
- package/dist/node_modules/playwright-core/index.mjs +28 -0
- package/dist/node_modules/playwright-core/lib/androidServerImpl.js +65 -0
- package/dist/node_modules/playwright-core/lib/browserServerImpl.js +120 -0
- package/dist/node_modules/playwright-core/lib/cli/driver.js +97 -0
- package/dist/node_modules/playwright-core/lib/cli/program.js +590 -0
- package/dist/node_modules/playwright-core/lib/cli/programWithTestStub.js +74 -0
- package/dist/node_modules/playwright-core/lib/client/android.js +361 -0
- package/dist/node_modules/playwright-core/lib/client/api.js +134 -0
- package/dist/node_modules/playwright-core/lib/client/artifact.js +79 -0
- package/dist/node_modules/playwright-core/lib/client/browser.js +163 -0
- package/dist/node_modules/playwright-core/lib/client/browserContext.js +547 -0
- package/dist/node_modules/playwright-core/lib/client/browserType.js +184 -0
- package/dist/node_modules/playwright-core/lib/client/cdpSession.js +51 -0
- package/dist/node_modules/playwright-core/lib/client/channelOwner.js +194 -0
- package/dist/node_modules/playwright-core/lib/client/clientHelper.js +64 -0
- package/dist/node_modules/playwright-core/lib/client/clientInstrumentation.js +55 -0
- package/dist/node_modules/playwright-core/lib/client/clientStackTrace.js +69 -0
- package/dist/node_modules/playwright-core/lib/client/clock.js +68 -0
- package/dist/node_modules/playwright-core/lib/client/connection.js +314 -0
- package/dist/node_modules/playwright-core/lib/client/consoleMessage.js +58 -0
- package/dist/node_modules/playwright-core/lib/client/coverage.js +44 -0
- package/dist/node_modules/playwright-core/lib/client/dialog.js +56 -0
- package/dist/node_modules/playwright-core/lib/client/download.js +62 -0
- package/dist/node_modules/playwright-core/lib/client/electron.js +138 -0
- package/dist/node_modules/playwright-core/lib/client/elementHandle.js +281 -0
- package/dist/node_modules/playwright-core/lib/client/errors.js +77 -0
- package/dist/node_modules/playwright-core/lib/client/eventEmitter.js +314 -0
- package/dist/node_modules/playwright-core/lib/client/events.js +100 -0
- package/dist/node_modules/playwright-core/lib/client/fetch.js +369 -0
- package/dist/node_modules/playwright-core/lib/client/fileChooser.js +46 -0
- package/dist/node_modules/playwright-core/lib/client/fileUtils.js +34 -0
- package/dist/node_modules/playwright-core/lib/client/frame.js +408 -0
- package/dist/node_modules/playwright-core/lib/client/harRouter.js +87 -0
- package/dist/node_modules/playwright-core/lib/client/input.js +84 -0
- package/dist/node_modules/playwright-core/lib/client/jsHandle.js +109 -0
- package/dist/node_modules/playwright-core/lib/client/jsonPipe.js +39 -0
- package/dist/node_modules/playwright-core/lib/client/localUtils.js +60 -0
- package/dist/node_modules/playwright-core/lib/client/locator.js +369 -0
- package/dist/node_modules/playwright-core/lib/client/network.js +747 -0
- package/dist/node_modules/playwright-core/lib/client/page.js +718 -0
- package/dist/node_modules/playwright-core/lib/client/platform.js +74 -0
- package/dist/node_modules/playwright-core/lib/client/playwright.js +71 -0
- package/dist/node_modules/playwright-core/lib/client/selectors.js +55 -0
- package/dist/node_modules/playwright-core/lib/client/stream.js +39 -0
- package/dist/node_modules/playwright-core/lib/client/timeoutSettings.js +79 -0
- package/dist/node_modules/playwright-core/lib/client/tracing.js +119 -0
- package/dist/node_modules/playwright-core/lib/client/types.js +28 -0
- package/dist/node_modules/playwright-core/lib/client/video.js +59 -0
- package/dist/node_modules/playwright-core/lib/client/waiter.js +142 -0
- package/dist/node_modules/playwright-core/lib/client/webError.js +39 -0
- package/dist/node_modules/playwright-core/lib/client/webSocket.js +93 -0
- package/dist/node_modules/playwright-core/lib/client/worker.js +85 -0
- package/dist/node_modules/playwright-core/lib/client/writableStream.js +39 -0
- package/dist/node_modules/playwright-core/lib/generated/bindingsControllerSource.js +28 -0
- package/dist/node_modules/playwright-core/lib/generated/clockSource.js +28 -0
- package/dist/node_modules/playwright-core/lib/generated/injectedScriptSource.js +28 -0
- package/dist/node_modules/playwright-core/lib/generated/pollingRecorderSource.js +28 -0
- package/dist/node_modules/playwright-core/lib/generated/storageScriptSource.js +28 -0
- package/dist/node_modules/playwright-core/lib/generated/utilityScriptSource.js +28 -0
- package/dist/node_modules/playwright-core/lib/generated/webSocketMockSource.js +336 -0
- package/dist/node_modules/playwright-core/lib/inProcessFactory.js +60 -0
- package/dist/node_modules/playwright-core/lib/inprocess.js +3 -0
- package/dist/node_modules/playwright-core/lib/outofprocess.js +76 -0
- package/dist/node_modules/playwright-core/lib/protocol/serializers.js +192 -0
- package/dist/node_modules/playwright-core/lib/protocol/validator.js +2890 -0
- package/dist/node_modules/playwright-core/lib/protocol/validatorPrimitives.js +193 -0
- package/dist/node_modules/playwright-core/lib/remote/playwrightConnection.js +129 -0
- package/dist/node_modules/playwright-core/lib/remote/playwrightServer.js +335 -0
- package/dist/node_modules/playwright-core/lib/server/android/android.js +465 -0
- package/dist/node_modules/playwright-core/lib/server/android/backendAdb.js +177 -0
- package/dist/node_modules/playwright-core/lib/server/artifact.js +127 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiBrowser.js +505 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiChromium.js +153 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiConnection.js +212 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiExecutionContext.js +221 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiFirefox.js +130 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiInput.js +146 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiNetworkManager.js +383 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiOverCdp.js +102 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiPage.js +572 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiPdf.js +106 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiCommands.d.js +22 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiDeserializer.js +98 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiKeyboard.js +256 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocol.js +24 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocolCore.js +179 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocolPermissions.js +42 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiSerializer.js +148 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/firefoxPrefs.js +259 -0
- package/dist/node_modules/playwright-core/lib/server/browser.js +149 -0
- package/dist/node_modules/playwright-core/lib/server/browserContext.js +695 -0
- package/dist/node_modules/playwright-core/lib/server/browserType.js +328 -0
- package/dist/node_modules/playwright-core/lib/server/callLog.js +82 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/chromium.js +402 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/chromiumSwitches.js +104 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crBrowser.js +510 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crConnection.js +202 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crCoverage.js +235 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crDevTools.js +113 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crDragDrop.js +131 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crExecutionContext.js +146 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crInput.js +187 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crNetworkManager.js +666 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crPage.js +1069 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crPdf.js +121 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crProtocolHelper.js +145 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crServiceWorker.js +136 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/defaultFontFamilies.js +162 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/protocol.d.js +16 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/videoRecorder.js +115 -0
- package/dist/node_modules/playwright-core/lib/server/clock.js +149 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/csharp.js +327 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/java.js +274 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/javascript.js +270 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/jsonl.js +52 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/language.js +132 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/languages.js +68 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/python.js +279 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/types.js +16 -0
- package/dist/node_modules/playwright-core/lib/server/console.js +57 -0
- package/dist/node_modules/playwright-core/lib/server/cookieStore.js +206 -0
- package/dist/node_modules/playwright-core/lib/server/debugController.js +191 -0
- package/dist/node_modules/playwright-core/lib/server/debugger.js +119 -0
- package/dist/node_modules/playwright-core/lib/server/deviceDescriptors.js +39 -0
- package/dist/node_modules/playwright-core/lib/server/deviceDescriptorsSource.json +1779 -0
- package/dist/node_modules/playwright-core/lib/server/dialog.js +116 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/androidDispatcher.js +325 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/artifactDispatcher.js +118 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/browserContextDispatcher.js +381 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/browserDispatcher.js +118 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/browserTypeDispatcher.js +64 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/cdpSessionDispatcher.js +44 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/debugControllerDispatcher.js +78 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/dialogDispatcher.js +47 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js +371 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/electronDispatcher.js +89 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/elementHandlerDispatcher.js +181 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/frameDispatcher.js +227 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/jsHandleDispatcher.js +85 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/jsonPipeDispatcher.js +58 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/localUtilsDispatcher.js +149 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/networkDispatchers.js +213 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/pageDispatcher.js +389 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/playwrightDispatcher.js +108 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/streamDispatcher.js +67 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/tracingDispatcher.js +68 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/webSocketRouteDispatcher.js +165 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/writableStreamDispatcher.js +79 -0
- package/dist/node_modules/playwright-core/lib/server/dom.js +806 -0
- package/dist/node_modules/playwright-core/lib/server/download.js +70 -0
- package/dist/node_modules/playwright-core/lib/server/electron/electron.js +270 -0
- package/dist/node_modules/playwright-core/lib/server/electron/loader.js +29 -0
- package/dist/node_modules/playwright-core/lib/server/errors.js +69 -0
- package/dist/node_modules/playwright-core/lib/server/fetch.js +621 -0
- package/dist/node_modules/playwright-core/lib/server/fileChooser.js +43 -0
- package/dist/node_modules/playwright-core/lib/server/fileUploadUtils.js +84 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/ffBrowser.js +428 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/ffConnection.js +147 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/ffExecutionContext.js +150 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/ffInput.js +159 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/ffNetworkManager.js +256 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/ffPage.js +500 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/firefox.js +116 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/protocol.d.js +16 -0
- package/dist/node_modules/playwright-core/lib/server/formData.js +147 -0
- package/dist/node_modules/playwright-core/lib/server/frameSelectors.js +154 -0
- package/dist/node_modules/playwright-core/lib/server/frames.js +1455 -0
- package/dist/node_modules/playwright-core/lib/server/har/harRecorder.js +147 -0
- package/dist/node_modules/playwright-core/lib/server/har/harTracer.js +607 -0
- package/dist/node_modules/playwright-core/lib/server/harBackend.js +157 -0
- package/dist/node_modules/playwright-core/lib/server/helper.js +96 -0
- package/dist/node_modules/playwright-core/lib/server/index.js +58 -0
- package/dist/node_modules/playwright-core/lib/server/input.js +277 -0
- package/dist/node_modules/playwright-core/lib/server/instrumentation.js +69 -0
- package/dist/node_modules/playwright-core/lib/server/javascript.js +291 -0
- package/dist/node_modules/playwright-core/lib/server/launchApp.js +128 -0
- package/dist/node_modules/playwright-core/lib/server/localUtils.js +214 -0
- package/dist/node_modules/playwright-core/lib/server/macEditingCommands.js +143 -0
- package/dist/node_modules/playwright-core/lib/server/network.js +629 -0
- package/dist/node_modules/playwright-core/lib/server/page.js +886 -0
- package/dist/node_modules/playwright-core/lib/server/pipeTransport.js +89 -0
- package/dist/node_modules/playwright-core/lib/server/playwright.js +69 -0
- package/dist/node_modules/playwright-core/lib/server/progress.js +112 -0
- package/dist/node_modules/playwright-core/lib/server/protocolError.js +52 -0
- package/dist/node_modules/playwright-core/lib/server/recorder/chat.js +161 -0
- package/dist/node_modules/playwright-core/lib/server/recorder/recorderApp.js +387 -0
- package/dist/node_modules/playwright-core/lib/server/recorder/recorderRunner.js +138 -0
- package/dist/node_modules/playwright-core/lib/server/recorder/recorderSignalProcessor.js +83 -0
- package/dist/node_modules/playwright-core/lib/server/recorder/recorderUtils.js +157 -0
- package/dist/node_modules/playwright-core/lib/server/recorder/throttledFile.js +57 -0
- package/dist/node_modules/playwright-core/lib/server/recorder.js +499 -0
- package/dist/node_modules/playwright-core/lib/server/registry/browserFetcher.js +175 -0
- package/dist/node_modules/playwright-core/lib/server/registry/dependencies.js +371 -0
- package/dist/node_modules/playwright-core/lib/server/registry/index.js +1399 -0
- package/dist/node_modules/playwright-core/lib/server/registry/nativeDeps.js +1280 -0
- package/dist/node_modules/playwright-core/lib/server/registry/oopDownloadBrowserMain.js +124 -0
- package/dist/node_modules/playwright-core/lib/server/screenshotter.js +333 -0
- package/dist/node_modules/playwright-core/lib/server/selectors.js +112 -0
- package/dist/node_modules/playwright-core/lib/server/socksClientCertificatesInterceptor.js +383 -0
- package/dist/node_modules/playwright-core/lib/server/socksInterceptor.js +95 -0
- package/dist/node_modules/playwright-core/lib/server/trace/recorder/snapshotter.js +147 -0
- package/dist/node_modules/playwright-core/lib/server/trace/recorder/snapshotterInjected.js +541 -0
- package/dist/node_modules/playwright-core/lib/server/trace/recorder/tracing.js +604 -0
- package/dist/node_modules/playwright-core/lib/server/trace/test/inMemorySnapshotter.js +87 -0
- package/dist/node_modules/playwright-core/lib/server/trace/viewer/traceViewer.js +241 -0
- package/dist/node_modules/playwright-core/lib/server/transport.js +181 -0
- package/dist/node_modules/playwright-core/lib/server/types.js +28 -0
- package/dist/node_modules/playwright-core/lib/server/usKeyboardLayout.js +145 -0
- package/dist/node_modules/playwright-core/lib/server/utils/ascii.js +44 -0
- package/dist/node_modules/playwright-core/lib/server/utils/comparators.js +139 -0
- package/dist/node_modules/playwright-core/lib/server/utils/crypto.js +216 -0
- package/dist/node_modules/playwright-core/lib/server/utils/debug.js +42 -0
- package/dist/node_modules/playwright-core/lib/server/utils/debugLogger.js +122 -0
- package/dist/node_modules/playwright-core/lib/server/utils/env.js +73 -0
- package/dist/node_modules/playwright-core/lib/server/utils/eventsHelper.js +39 -0
- package/dist/node_modules/playwright-core/lib/server/utils/expectUtils.js +38 -0
- package/dist/node_modules/playwright-core/lib/server/utils/fileUtils.js +191 -0
- package/dist/node_modules/playwright-core/lib/server/utils/happyEyeballs.js +207 -0
- package/dist/node_modules/playwright-core/lib/server/utils/hostPlatform.js +123 -0
- package/dist/node_modules/playwright-core/lib/server/utils/httpServer.js +218 -0
- package/dist/node_modules/playwright-core/lib/server/utils/imageUtils.js +141 -0
- package/dist/node_modules/playwright-core/lib/server/utils/image_tools/colorUtils.js +89 -0
- package/dist/node_modules/playwright-core/lib/server/utils/image_tools/compare.js +109 -0
- package/dist/node_modules/playwright-core/lib/server/utils/image_tools/imageChannel.js +78 -0
- package/dist/node_modules/playwright-core/lib/server/utils/image_tools/stats.js +102 -0
- package/dist/node_modules/playwright-core/lib/server/utils/linuxUtils.js +71 -0
- package/dist/node_modules/playwright-core/lib/server/utils/network.js +233 -0
- package/dist/node_modules/playwright-core/lib/server/utils/nodePlatform.js +148 -0
- package/dist/node_modules/playwright-core/lib/server/utils/pipeTransport.js +84 -0
- package/dist/node_modules/playwright-core/lib/server/utils/processLauncher.js +241 -0
- package/dist/node_modules/playwright-core/lib/server/utils/profiler.js +65 -0
- package/dist/node_modules/playwright-core/lib/server/utils/socksProxy.js +511 -0
- package/dist/node_modules/playwright-core/lib/server/utils/spawnAsync.js +41 -0
- package/dist/node_modules/playwright-core/lib/server/utils/task.js +51 -0
- package/dist/node_modules/playwright-core/lib/server/utils/userAgent.js +98 -0
- package/dist/node_modules/playwright-core/lib/server/utils/wsServer.js +121 -0
- package/dist/node_modules/playwright-core/lib/server/utils/zipFile.js +74 -0
- package/dist/node_modules/playwright-core/lib/server/utils/zones.js +57 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/protocol.d.js +16 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/webkit.js +110 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkBrowser.js +339 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkConnection.js +149 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkExecutionContext.js +154 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkInput.js +181 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkInterceptableRequest.js +169 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkPage.js +1130 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkProvisionalPage.js +83 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkWorkers.js +105 -0
- package/dist/node_modules/playwright-core/lib/third_party/pixelmatch.js +255 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/ariaSnapshot.js +397 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/assert.js +31 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/colors.js +72 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/cssParser.js +245 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/cssTokenizer.js +1051 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/headers.js +53 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/locatorGenerators.js +689 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/locatorParser.js +176 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/locatorUtils.js +81 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/manualPromise.js +114 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/mimeType.js +459 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/multimap.js +80 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/protocolFormatter.js +81 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/protocolMetainfo.js +322 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/rtti.js +43 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/selectorParser.js +386 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/semaphore.js +54 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/stackTrace.js +158 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/stringUtils.js +155 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/time.js +49 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/timeoutRunner.js +66 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/traceUtils.js +58 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/types.js +16 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/urlMatch.js +190 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/utilityScriptSerializers.js +251 -0
- package/dist/node_modules/playwright-core/lib/utils.js +109 -0
- package/dist/node_modules/playwright-core/lib/utilsBundle.js +112 -0
- package/dist/node_modules/playwright-core/lib/utilsBundleImpl/index.js +218 -0
- package/dist/node_modules/playwright-core/lib/utilsBundleImpl/xdg-open +1066 -0
- package/dist/node_modules/playwright-core/lib/vite/htmlReport/index.html +84 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-BoWUGj0J.js +25 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-C3UTv-Ge.css +1 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/assets/index-DJqDAOZp.js +193 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/assets/index-Ri0uHF7I.css +1 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/index.html +29 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +9 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-Bucv2d7q.js +25 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-BEpdCv1S.js +266 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-CsJ4vdCR.js +9 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.C3UTv-Ge.css +1 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.ConWv5KN.css +1 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/index.BxQ34UMZ.js +2 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/index.C4Y3Aw8n.css +1 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/index.html +43 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/manifest.webmanifest +16 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +9 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +21 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +3 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/uiMode.BWTwXl41.js +5 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/uiMode.Btcz36p_.css +1 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +17 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.DYP7pi_n.css +32 -0
- package/dist/node_modules/playwright-core/lib/zipBundle.js +34 -0
- package/dist/node_modules/playwright-core/lib/zipBundleImpl.js +5 -0
- package/dist/node_modules/playwright-core/package.json +42 -0
- package/dist/node_modules/playwright-core/types/protocol.d.ts +23245 -0
- package/dist/node_modules/playwright-core/types/structs.d.ts +45 -0
- package/dist/node_modules/playwright-core/types/types.d.ts +22856 -0
- package/dist/server.obf.js +1 -1
- package/package.json +11 -12
|
@@ -0,0 +1,1051 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var cssTokenizer_exports = {};
|
|
20
|
+
__export(cssTokenizer_exports, {
|
|
21
|
+
AtKeywordToken: () => AtKeywordToken,
|
|
22
|
+
BadStringToken: () => BadStringToken,
|
|
23
|
+
BadURLToken: () => BadURLToken,
|
|
24
|
+
CDCToken: () => CDCToken,
|
|
25
|
+
CDOToken: () => CDOToken,
|
|
26
|
+
CSSParserToken: () => CSSParserToken,
|
|
27
|
+
CloseCurlyToken: () => CloseCurlyToken,
|
|
28
|
+
CloseParenToken: () => CloseParenToken,
|
|
29
|
+
CloseSquareToken: () => CloseSquareToken,
|
|
30
|
+
ColonToken: () => ColonToken,
|
|
31
|
+
ColumnToken: () => ColumnToken,
|
|
32
|
+
CommaToken: () => CommaToken,
|
|
33
|
+
DashMatchToken: () => DashMatchToken,
|
|
34
|
+
DelimToken: () => DelimToken,
|
|
35
|
+
DimensionToken: () => DimensionToken,
|
|
36
|
+
EOFToken: () => EOFToken,
|
|
37
|
+
FunctionToken: () => FunctionToken,
|
|
38
|
+
GroupingToken: () => GroupingToken,
|
|
39
|
+
HashToken: () => HashToken,
|
|
40
|
+
IdentToken: () => IdentToken,
|
|
41
|
+
IncludeMatchToken: () => IncludeMatchToken,
|
|
42
|
+
InvalidCharacterError: () => InvalidCharacterError,
|
|
43
|
+
NumberToken: () => NumberToken,
|
|
44
|
+
OpenCurlyToken: () => OpenCurlyToken,
|
|
45
|
+
OpenParenToken: () => OpenParenToken,
|
|
46
|
+
OpenSquareToken: () => OpenSquareToken,
|
|
47
|
+
PercentageToken: () => PercentageToken,
|
|
48
|
+
PrefixMatchToken: () => PrefixMatchToken,
|
|
49
|
+
SemicolonToken: () => SemicolonToken,
|
|
50
|
+
StringToken: () => StringToken,
|
|
51
|
+
StringValuedToken: () => StringValuedToken,
|
|
52
|
+
SubstringMatchToken: () => SubstringMatchToken,
|
|
53
|
+
SuffixMatchToken: () => SuffixMatchToken,
|
|
54
|
+
URLToken: () => URLToken,
|
|
55
|
+
WhitespaceToken: () => WhitespaceToken,
|
|
56
|
+
tokenize: () => tokenize
|
|
57
|
+
});
|
|
58
|
+
module.exports = __toCommonJS(cssTokenizer_exports);
|
|
59
|
+
const between = function(num, first, last) {
|
|
60
|
+
return num >= first && num <= last;
|
|
61
|
+
};
|
|
62
|
+
function digit(code) {
|
|
63
|
+
return between(code, 48, 57);
|
|
64
|
+
}
|
|
65
|
+
function hexdigit(code) {
|
|
66
|
+
return digit(code) || between(code, 65, 70) || between(code, 97, 102);
|
|
67
|
+
}
|
|
68
|
+
function uppercaseletter(code) {
|
|
69
|
+
return between(code, 65, 90);
|
|
70
|
+
}
|
|
71
|
+
function lowercaseletter(code) {
|
|
72
|
+
return between(code, 97, 122);
|
|
73
|
+
}
|
|
74
|
+
function letter(code) {
|
|
75
|
+
return uppercaseletter(code) || lowercaseletter(code);
|
|
76
|
+
}
|
|
77
|
+
function nonascii(code) {
|
|
78
|
+
return code >= 128;
|
|
79
|
+
}
|
|
80
|
+
function namestartchar(code) {
|
|
81
|
+
return letter(code) || nonascii(code) || code === 95;
|
|
82
|
+
}
|
|
83
|
+
function namechar(code) {
|
|
84
|
+
return namestartchar(code) || digit(code) || code === 45;
|
|
85
|
+
}
|
|
86
|
+
function nonprintable(code) {
|
|
87
|
+
return between(code, 0, 8) || code === 11 || between(code, 14, 31) || code === 127;
|
|
88
|
+
}
|
|
89
|
+
function newline(code) {
|
|
90
|
+
return code === 10;
|
|
91
|
+
}
|
|
92
|
+
function whitespace(code) {
|
|
93
|
+
return newline(code) || code === 9 || code === 32;
|
|
94
|
+
}
|
|
95
|
+
const maximumallowedcodepoint = 1114111;
|
|
96
|
+
class InvalidCharacterError extends Error {
|
|
97
|
+
constructor(message) {
|
|
98
|
+
super(message);
|
|
99
|
+
this.name = "InvalidCharacterError";
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function preprocess(str) {
|
|
103
|
+
const codepoints = [];
|
|
104
|
+
for (let i = 0; i < str.length; i++) {
|
|
105
|
+
let code = str.charCodeAt(i);
|
|
106
|
+
if (code === 13 && str.charCodeAt(i + 1) === 10) {
|
|
107
|
+
code = 10;
|
|
108
|
+
i++;
|
|
109
|
+
}
|
|
110
|
+
if (code === 13 || code === 12)
|
|
111
|
+
code = 10;
|
|
112
|
+
if (code === 0)
|
|
113
|
+
code = 65533;
|
|
114
|
+
if (between(code, 55296, 56319) && between(str.charCodeAt(i + 1), 56320, 57343)) {
|
|
115
|
+
const lead = code - 55296;
|
|
116
|
+
const trail = str.charCodeAt(i + 1) - 56320;
|
|
117
|
+
code = Math.pow(2, 16) + lead * Math.pow(2, 10) + trail;
|
|
118
|
+
i++;
|
|
119
|
+
}
|
|
120
|
+
codepoints.push(code);
|
|
121
|
+
}
|
|
122
|
+
return codepoints;
|
|
123
|
+
}
|
|
124
|
+
function stringFromCode(code) {
|
|
125
|
+
if (code <= 65535)
|
|
126
|
+
return String.fromCharCode(code);
|
|
127
|
+
code -= Math.pow(2, 16);
|
|
128
|
+
const lead = Math.floor(code / Math.pow(2, 10)) + 55296;
|
|
129
|
+
const trail = code % Math.pow(2, 10) + 56320;
|
|
130
|
+
return String.fromCharCode(lead) + String.fromCharCode(trail);
|
|
131
|
+
}
|
|
132
|
+
function tokenize(str1) {
|
|
133
|
+
const str = preprocess(str1);
|
|
134
|
+
let i = -1;
|
|
135
|
+
const tokens = [];
|
|
136
|
+
let code;
|
|
137
|
+
let line = 0;
|
|
138
|
+
let column = 0;
|
|
139
|
+
let lastLineLength = 0;
|
|
140
|
+
const incrLineno = function() {
|
|
141
|
+
line += 1;
|
|
142
|
+
lastLineLength = column;
|
|
143
|
+
column = 0;
|
|
144
|
+
};
|
|
145
|
+
const locStart = { line, column };
|
|
146
|
+
const codepoint = function(i2) {
|
|
147
|
+
if (i2 >= str.length)
|
|
148
|
+
return -1;
|
|
149
|
+
return str[i2];
|
|
150
|
+
};
|
|
151
|
+
const next = function(num) {
|
|
152
|
+
if (num === void 0)
|
|
153
|
+
num = 1;
|
|
154
|
+
if (num > 3)
|
|
155
|
+
throw "Spec Error: no more than three codepoints of lookahead.";
|
|
156
|
+
return codepoint(i + num);
|
|
157
|
+
};
|
|
158
|
+
const consume = function(num) {
|
|
159
|
+
if (num === void 0)
|
|
160
|
+
num = 1;
|
|
161
|
+
i += num;
|
|
162
|
+
code = codepoint(i);
|
|
163
|
+
if (newline(code))
|
|
164
|
+
incrLineno();
|
|
165
|
+
else
|
|
166
|
+
column += num;
|
|
167
|
+
return true;
|
|
168
|
+
};
|
|
169
|
+
const reconsume = function() {
|
|
170
|
+
i -= 1;
|
|
171
|
+
if (newline(code)) {
|
|
172
|
+
line -= 1;
|
|
173
|
+
column = lastLineLength;
|
|
174
|
+
} else {
|
|
175
|
+
column -= 1;
|
|
176
|
+
}
|
|
177
|
+
locStart.line = line;
|
|
178
|
+
locStart.column = column;
|
|
179
|
+
return true;
|
|
180
|
+
};
|
|
181
|
+
const eof = function(codepoint2) {
|
|
182
|
+
if (codepoint2 === void 0)
|
|
183
|
+
codepoint2 = code;
|
|
184
|
+
return codepoint2 === -1;
|
|
185
|
+
};
|
|
186
|
+
const donothing = function() {
|
|
187
|
+
};
|
|
188
|
+
const parseerror = function() {
|
|
189
|
+
};
|
|
190
|
+
const consumeAToken = function() {
|
|
191
|
+
consumeComments();
|
|
192
|
+
consume();
|
|
193
|
+
if (whitespace(code)) {
|
|
194
|
+
while (whitespace(next()))
|
|
195
|
+
consume();
|
|
196
|
+
return new WhitespaceToken();
|
|
197
|
+
} else if (code === 34) {
|
|
198
|
+
return consumeAStringToken();
|
|
199
|
+
} else if (code === 35) {
|
|
200
|
+
if (namechar(next()) || areAValidEscape(next(1), next(2))) {
|
|
201
|
+
const token = new HashToken("");
|
|
202
|
+
if (wouldStartAnIdentifier(next(1), next(2), next(3)))
|
|
203
|
+
token.type = "id";
|
|
204
|
+
token.value = consumeAName();
|
|
205
|
+
return token;
|
|
206
|
+
} else {
|
|
207
|
+
return new DelimToken(code);
|
|
208
|
+
}
|
|
209
|
+
} else if (code === 36) {
|
|
210
|
+
if (next() === 61) {
|
|
211
|
+
consume();
|
|
212
|
+
return new SuffixMatchToken();
|
|
213
|
+
} else {
|
|
214
|
+
return new DelimToken(code);
|
|
215
|
+
}
|
|
216
|
+
} else if (code === 39) {
|
|
217
|
+
return consumeAStringToken();
|
|
218
|
+
} else if (code === 40) {
|
|
219
|
+
return new OpenParenToken();
|
|
220
|
+
} else if (code === 41) {
|
|
221
|
+
return new CloseParenToken();
|
|
222
|
+
} else if (code === 42) {
|
|
223
|
+
if (next() === 61) {
|
|
224
|
+
consume();
|
|
225
|
+
return new SubstringMatchToken();
|
|
226
|
+
} else {
|
|
227
|
+
return new DelimToken(code);
|
|
228
|
+
}
|
|
229
|
+
} else if (code === 43) {
|
|
230
|
+
if (startsWithANumber()) {
|
|
231
|
+
reconsume();
|
|
232
|
+
return consumeANumericToken();
|
|
233
|
+
} else {
|
|
234
|
+
return new DelimToken(code);
|
|
235
|
+
}
|
|
236
|
+
} else if (code === 44) {
|
|
237
|
+
return new CommaToken();
|
|
238
|
+
} else if (code === 45) {
|
|
239
|
+
if (startsWithANumber()) {
|
|
240
|
+
reconsume();
|
|
241
|
+
return consumeANumericToken();
|
|
242
|
+
} else if (next(1) === 45 && next(2) === 62) {
|
|
243
|
+
consume(2);
|
|
244
|
+
return new CDCToken();
|
|
245
|
+
} else if (startsWithAnIdentifier()) {
|
|
246
|
+
reconsume();
|
|
247
|
+
return consumeAnIdentlikeToken();
|
|
248
|
+
} else {
|
|
249
|
+
return new DelimToken(code);
|
|
250
|
+
}
|
|
251
|
+
} else if (code === 46) {
|
|
252
|
+
if (startsWithANumber()) {
|
|
253
|
+
reconsume();
|
|
254
|
+
return consumeANumericToken();
|
|
255
|
+
} else {
|
|
256
|
+
return new DelimToken(code);
|
|
257
|
+
}
|
|
258
|
+
} else if (code === 58) {
|
|
259
|
+
return new ColonToken();
|
|
260
|
+
} else if (code === 59) {
|
|
261
|
+
return new SemicolonToken();
|
|
262
|
+
} else if (code === 60) {
|
|
263
|
+
if (next(1) === 33 && next(2) === 45 && next(3) === 45) {
|
|
264
|
+
consume(3);
|
|
265
|
+
return new CDOToken();
|
|
266
|
+
} else {
|
|
267
|
+
return new DelimToken(code);
|
|
268
|
+
}
|
|
269
|
+
} else if (code === 64) {
|
|
270
|
+
if (wouldStartAnIdentifier(next(1), next(2), next(3)))
|
|
271
|
+
return new AtKeywordToken(consumeAName());
|
|
272
|
+
else
|
|
273
|
+
return new DelimToken(code);
|
|
274
|
+
} else if (code === 91) {
|
|
275
|
+
return new OpenSquareToken();
|
|
276
|
+
} else if (code === 92) {
|
|
277
|
+
if (startsWithAValidEscape()) {
|
|
278
|
+
reconsume();
|
|
279
|
+
return consumeAnIdentlikeToken();
|
|
280
|
+
} else {
|
|
281
|
+
parseerror();
|
|
282
|
+
return new DelimToken(code);
|
|
283
|
+
}
|
|
284
|
+
} else if (code === 93) {
|
|
285
|
+
return new CloseSquareToken();
|
|
286
|
+
} else if (code === 94) {
|
|
287
|
+
if (next() === 61) {
|
|
288
|
+
consume();
|
|
289
|
+
return new PrefixMatchToken();
|
|
290
|
+
} else {
|
|
291
|
+
return new DelimToken(code);
|
|
292
|
+
}
|
|
293
|
+
} else if (code === 123) {
|
|
294
|
+
return new OpenCurlyToken();
|
|
295
|
+
} else if (code === 124) {
|
|
296
|
+
if (next() === 61) {
|
|
297
|
+
consume();
|
|
298
|
+
return new DashMatchToken();
|
|
299
|
+
} else if (next() === 124) {
|
|
300
|
+
consume();
|
|
301
|
+
return new ColumnToken();
|
|
302
|
+
} else {
|
|
303
|
+
return new DelimToken(code);
|
|
304
|
+
}
|
|
305
|
+
} else if (code === 125) {
|
|
306
|
+
return new CloseCurlyToken();
|
|
307
|
+
} else if (code === 126) {
|
|
308
|
+
if (next() === 61) {
|
|
309
|
+
consume();
|
|
310
|
+
return new IncludeMatchToken();
|
|
311
|
+
} else {
|
|
312
|
+
return new DelimToken(code);
|
|
313
|
+
}
|
|
314
|
+
} else if (digit(code)) {
|
|
315
|
+
reconsume();
|
|
316
|
+
return consumeANumericToken();
|
|
317
|
+
} else if (namestartchar(code)) {
|
|
318
|
+
reconsume();
|
|
319
|
+
return consumeAnIdentlikeToken();
|
|
320
|
+
} else if (eof()) {
|
|
321
|
+
return new EOFToken();
|
|
322
|
+
} else {
|
|
323
|
+
return new DelimToken(code);
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
const consumeComments = function() {
|
|
327
|
+
while (next(1) === 47 && next(2) === 42) {
|
|
328
|
+
consume(2);
|
|
329
|
+
while (true) {
|
|
330
|
+
consume();
|
|
331
|
+
if (code === 42 && next() === 47) {
|
|
332
|
+
consume();
|
|
333
|
+
break;
|
|
334
|
+
} else if (eof()) {
|
|
335
|
+
parseerror();
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
};
|
|
341
|
+
const consumeANumericToken = function() {
|
|
342
|
+
const num = consumeANumber();
|
|
343
|
+
if (wouldStartAnIdentifier(next(1), next(2), next(3))) {
|
|
344
|
+
const token = new DimensionToken();
|
|
345
|
+
token.value = num.value;
|
|
346
|
+
token.repr = num.repr;
|
|
347
|
+
token.type = num.type;
|
|
348
|
+
token.unit = consumeAName();
|
|
349
|
+
return token;
|
|
350
|
+
} else if (next() === 37) {
|
|
351
|
+
consume();
|
|
352
|
+
const token = new PercentageToken();
|
|
353
|
+
token.value = num.value;
|
|
354
|
+
token.repr = num.repr;
|
|
355
|
+
return token;
|
|
356
|
+
} else {
|
|
357
|
+
const token = new NumberToken();
|
|
358
|
+
token.value = num.value;
|
|
359
|
+
token.repr = num.repr;
|
|
360
|
+
token.type = num.type;
|
|
361
|
+
return token;
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
const consumeAnIdentlikeToken = function() {
|
|
365
|
+
const str2 = consumeAName();
|
|
366
|
+
if (str2.toLowerCase() === "url" && next() === 40) {
|
|
367
|
+
consume();
|
|
368
|
+
while (whitespace(next(1)) && whitespace(next(2)))
|
|
369
|
+
consume();
|
|
370
|
+
if (next() === 34 || next() === 39)
|
|
371
|
+
return new FunctionToken(str2);
|
|
372
|
+
else if (whitespace(next()) && (next(2) === 34 || next(2) === 39))
|
|
373
|
+
return new FunctionToken(str2);
|
|
374
|
+
else
|
|
375
|
+
return consumeAURLToken();
|
|
376
|
+
} else if (next() === 40) {
|
|
377
|
+
consume();
|
|
378
|
+
return new FunctionToken(str2);
|
|
379
|
+
} else {
|
|
380
|
+
return new IdentToken(str2);
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
const consumeAStringToken = function(endingCodePoint) {
|
|
384
|
+
if (endingCodePoint === void 0)
|
|
385
|
+
endingCodePoint = code;
|
|
386
|
+
let string = "";
|
|
387
|
+
while (consume()) {
|
|
388
|
+
if (code === endingCodePoint || eof()) {
|
|
389
|
+
return new StringToken(string);
|
|
390
|
+
} else if (newline(code)) {
|
|
391
|
+
parseerror();
|
|
392
|
+
reconsume();
|
|
393
|
+
return new BadStringToken();
|
|
394
|
+
} else if (code === 92) {
|
|
395
|
+
if (eof(next()))
|
|
396
|
+
donothing();
|
|
397
|
+
else if (newline(next()))
|
|
398
|
+
consume();
|
|
399
|
+
else
|
|
400
|
+
string += stringFromCode(consumeEscape());
|
|
401
|
+
} else {
|
|
402
|
+
string += stringFromCode(code);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
throw new Error("Internal error");
|
|
406
|
+
};
|
|
407
|
+
const consumeAURLToken = function() {
|
|
408
|
+
const token = new URLToken("");
|
|
409
|
+
while (whitespace(next()))
|
|
410
|
+
consume();
|
|
411
|
+
if (eof(next()))
|
|
412
|
+
return token;
|
|
413
|
+
while (consume()) {
|
|
414
|
+
if (code === 41 || eof()) {
|
|
415
|
+
return token;
|
|
416
|
+
} else if (whitespace(code)) {
|
|
417
|
+
while (whitespace(next()))
|
|
418
|
+
consume();
|
|
419
|
+
if (next() === 41 || eof(next())) {
|
|
420
|
+
consume();
|
|
421
|
+
return token;
|
|
422
|
+
} else {
|
|
423
|
+
consumeTheRemnantsOfABadURL();
|
|
424
|
+
return new BadURLToken();
|
|
425
|
+
}
|
|
426
|
+
} else if (code === 34 || code === 39 || code === 40 || nonprintable(code)) {
|
|
427
|
+
parseerror();
|
|
428
|
+
consumeTheRemnantsOfABadURL();
|
|
429
|
+
return new BadURLToken();
|
|
430
|
+
} else if (code === 92) {
|
|
431
|
+
if (startsWithAValidEscape()) {
|
|
432
|
+
token.value += stringFromCode(consumeEscape());
|
|
433
|
+
} else {
|
|
434
|
+
parseerror();
|
|
435
|
+
consumeTheRemnantsOfABadURL();
|
|
436
|
+
return new BadURLToken();
|
|
437
|
+
}
|
|
438
|
+
} else {
|
|
439
|
+
token.value += stringFromCode(code);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
throw new Error("Internal error");
|
|
443
|
+
};
|
|
444
|
+
const consumeEscape = function() {
|
|
445
|
+
consume();
|
|
446
|
+
if (hexdigit(code)) {
|
|
447
|
+
const digits = [code];
|
|
448
|
+
for (let total = 0; total < 5; total++) {
|
|
449
|
+
if (hexdigit(next())) {
|
|
450
|
+
consume();
|
|
451
|
+
digits.push(code);
|
|
452
|
+
} else {
|
|
453
|
+
break;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
if (whitespace(next()))
|
|
457
|
+
consume();
|
|
458
|
+
let value = parseInt(digits.map(function(x) {
|
|
459
|
+
return String.fromCharCode(x);
|
|
460
|
+
}).join(""), 16);
|
|
461
|
+
if (value > maximumallowedcodepoint)
|
|
462
|
+
value = 65533;
|
|
463
|
+
return value;
|
|
464
|
+
} else if (eof()) {
|
|
465
|
+
return 65533;
|
|
466
|
+
} else {
|
|
467
|
+
return code;
|
|
468
|
+
}
|
|
469
|
+
};
|
|
470
|
+
const areAValidEscape = function(c1, c2) {
|
|
471
|
+
if (c1 !== 92)
|
|
472
|
+
return false;
|
|
473
|
+
if (newline(c2))
|
|
474
|
+
return false;
|
|
475
|
+
return true;
|
|
476
|
+
};
|
|
477
|
+
const startsWithAValidEscape = function() {
|
|
478
|
+
return areAValidEscape(code, next());
|
|
479
|
+
};
|
|
480
|
+
const wouldStartAnIdentifier = function(c1, c2, c3) {
|
|
481
|
+
if (c1 === 45)
|
|
482
|
+
return namestartchar(c2) || c2 === 45 || areAValidEscape(c2, c3);
|
|
483
|
+
else if (namestartchar(c1))
|
|
484
|
+
return true;
|
|
485
|
+
else if (c1 === 92)
|
|
486
|
+
return areAValidEscape(c1, c2);
|
|
487
|
+
else
|
|
488
|
+
return false;
|
|
489
|
+
};
|
|
490
|
+
const startsWithAnIdentifier = function() {
|
|
491
|
+
return wouldStartAnIdentifier(code, next(1), next(2));
|
|
492
|
+
};
|
|
493
|
+
const wouldStartANumber = function(c1, c2, c3) {
|
|
494
|
+
if (c1 === 43 || c1 === 45) {
|
|
495
|
+
if (digit(c2))
|
|
496
|
+
return true;
|
|
497
|
+
if (c2 === 46 && digit(c3))
|
|
498
|
+
return true;
|
|
499
|
+
return false;
|
|
500
|
+
} else if (c1 === 46) {
|
|
501
|
+
if (digit(c2))
|
|
502
|
+
return true;
|
|
503
|
+
return false;
|
|
504
|
+
} else if (digit(c1)) {
|
|
505
|
+
return true;
|
|
506
|
+
} else {
|
|
507
|
+
return false;
|
|
508
|
+
}
|
|
509
|
+
};
|
|
510
|
+
const startsWithANumber = function() {
|
|
511
|
+
return wouldStartANumber(code, next(1), next(2));
|
|
512
|
+
};
|
|
513
|
+
const consumeAName = function() {
|
|
514
|
+
let result = "";
|
|
515
|
+
while (consume()) {
|
|
516
|
+
if (namechar(code)) {
|
|
517
|
+
result += stringFromCode(code);
|
|
518
|
+
} else if (startsWithAValidEscape()) {
|
|
519
|
+
result += stringFromCode(consumeEscape());
|
|
520
|
+
} else {
|
|
521
|
+
reconsume();
|
|
522
|
+
return result;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
throw new Error("Internal parse error");
|
|
526
|
+
};
|
|
527
|
+
const consumeANumber = function() {
|
|
528
|
+
let repr = "";
|
|
529
|
+
let type = "integer";
|
|
530
|
+
if (next() === 43 || next() === 45) {
|
|
531
|
+
consume();
|
|
532
|
+
repr += stringFromCode(code);
|
|
533
|
+
}
|
|
534
|
+
while (digit(next())) {
|
|
535
|
+
consume();
|
|
536
|
+
repr += stringFromCode(code);
|
|
537
|
+
}
|
|
538
|
+
if (next(1) === 46 && digit(next(2))) {
|
|
539
|
+
consume();
|
|
540
|
+
repr += stringFromCode(code);
|
|
541
|
+
consume();
|
|
542
|
+
repr += stringFromCode(code);
|
|
543
|
+
type = "number";
|
|
544
|
+
while (digit(next())) {
|
|
545
|
+
consume();
|
|
546
|
+
repr += stringFromCode(code);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
const c1 = next(1), c2 = next(2), c3 = next(3);
|
|
550
|
+
if ((c1 === 69 || c1 === 101) && digit(c2)) {
|
|
551
|
+
consume();
|
|
552
|
+
repr += stringFromCode(code);
|
|
553
|
+
consume();
|
|
554
|
+
repr += stringFromCode(code);
|
|
555
|
+
type = "number";
|
|
556
|
+
while (digit(next())) {
|
|
557
|
+
consume();
|
|
558
|
+
repr += stringFromCode(code);
|
|
559
|
+
}
|
|
560
|
+
} else if ((c1 === 69 || c1 === 101) && (c2 === 43 || c2 === 45) && digit(c3)) {
|
|
561
|
+
consume();
|
|
562
|
+
repr += stringFromCode(code);
|
|
563
|
+
consume();
|
|
564
|
+
repr += stringFromCode(code);
|
|
565
|
+
consume();
|
|
566
|
+
repr += stringFromCode(code);
|
|
567
|
+
type = "number";
|
|
568
|
+
while (digit(next())) {
|
|
569
|
+
consume();
|
|
570
|
+
repr += stringFromCode(code);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
const value = convertAStringToANumber(repr);
|
|
574
|
+
return { type, value, repr };
|
|
575
|
+
};
|
|
576
|
+
const convertAStringToANumber = function(string) {
|
|
577
|
+
return +string;
|
|
578
|
+
};
|
|
579
|
+
const consumeTheRemnantsOfABadURL = function() {
|
|
580
|
+
while (consume()) {
|
|
581
|
+
if (code === 41 || eof()) {
|
|
582
|
+
return;
|
|
583
|
+
} else if (startsWithAValidEscape()) {
|
|
584
|
+
consumeEscape();
|
|
585
|
+
donothing();
|
|
586
|
+
} else {
|
|
587
|
+
donothing();
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
let iterationCount = 0;
|
|
592
|
+
while (!eof(next())) {
|
|
593
|
+
tokens.push(consumeAToken());
|
|
594
|
+
iterationCount++;
|
|
595
|
+
if (iterationCount > str.length * 2)
|
|
596
|
+
throw new Error("I'm infinite-looping!");
|
|
597
|
+
}
|
|
598
|
+
return tokens;
|
|
599
|
+
}
|
|
600
|
+
class CSSParserToken {
|
|
601
|
+
constructor() {
|
|
602
|
+
this.tokenType = "";
|
|
603
|
+
}
|
|
604
|
+
toJSON() {
|
|
605
|
+
return { token: this.tokenType };
|
|
606
|
+
}
|
|
607
|
+
toString() {
|
|
608
|
+
return this.tokenType;
|
|
609
|
+
}
|
|
610
|
+
toSource() {
|
|
611
|
+
return "" + this;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
class BadStringToken extends CSSParserToken {
|
|
615
|
+
constructor() {
|
|
616
|
+
super(...arguments);
|
|
617
|
+
this.tokenType = "BADSTRING";
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
class BadURLToken extends CSSParserToken {
|
|
621
|
+
constructor() {
|
|
622
|
+
super(...arguments);
|
|
623
|
+
this.tokenType = "BADURL";
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
class WhitespaceToken extends CSSParserToken {
|
|
627
|
+
constructor() {
|
|
628
|
+
super(...arguments);
|
|
629
|
+
this.tokenType = "WHITESPACE";
|
|
630
|
+
}
|
|
631
|
+
toString() {
|
|
632
|
+
return "WS";
|
|
633
|
+
}
|
|
634
|
+
toSource() {
|
|
635
|
+
return " ";
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
class CDOToken extends CSSParserToken {
|
|
639
|
+
constructor() {
|
|
640
|
+
super(...arguments);
|
|
641
|
+
this.tokenType = "CDO";
|
|
642
|
+
}
|
|
643
|
+
toSource() {
|
|
644
|
+
return "<!--";
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
class CDCToken extends CSSParserToken {
|
|
648
|
+
constructor() {
|
|
649
|
+
super(...arguments);
|
|
650
|
+
this.tokenType = "CDC";
|
|
651
|
+
}
|
|
652
|
+
toSource() {
|
|
653
|
+
return "-->";
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
class ColonToken extends CSSParserToken {
|
|
657
|
+
constructor() {
|
|
658
|
+
super(...arguments);
|
|
659
|
+
this.tokenType = ":";
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
class SemicolonToken extends CSSParserToken {
|
|
663
|
+
constructor() {
|
|
664
|
+
super(...arguments);
|
|
665
|
+
this.tokenType = ";";
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
class CommaToken extends CSSParserToken {
|
|
669
|
+
constructor() {
|
|
670
|
+
super(...arguments);
|
|
671
|
+
this.tokenType = ",";
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
class GroupingToken extends CSSParserToken {
|
|
675
|
+
constructor() {
|
|
676
|
+
super(...arguments);
|
|
677
|
+
this.value = "";
|
|
678
|
+
this.mirror = "";
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
class OpenCurlyToken extends GroupingToken {
|
|
682
|
+
constructor() {
|
|
683
|
+
super();
|
|
684
|
+
this.tokenType = "{";
|
|
685
|
+
this.value = "{";
|
|
686
|
+
this.mirror = "}";
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
class CloseCurlyToken extends GroupingToken {
|
|
690
|
+
constructor() {
|
|
691
|
+
super();
|
|
692
|
+
this.tokenType = "}";
|
|
693
|
+
this.value = "}";
|
|
694
|
+
this.mirror = "{";
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
class OpenSquareToken extends GroupingToken {
|
|
698
|
+
constructor() {
|
|
699
|
+
super();
|
|
700
|
+
this.tokenType = "[";
|
|
701
|
+
this.value = "[";
|
|
702
|
+
this.mirror = "]";
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
class CloseSquareToken extends GroupingToken {
|
|
706
|
+
constructor() {
|
|
707
|
+
super();
|
|
708
|
+
this.tokenType = "]";
|
|
709
|
+
this.value = "]";
|
|
710
|
+
this.mirror = "[";
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
class OpenParenToken extends GroupingToken {
|
|
714
|
+
constructor() {
|
|
715
|
+
super();
|
|
716
|
+
this.tokenType = "(";
|
|
717
|
+
this.value = "(";
|
|
718
|
+
this.mirror = ")";
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
class CloseParenToken extends GroupingToken {
|
|
722
|
+
constructor() {
|
|
723
|
+
super();
|
|
724
|
+
this.tokenType = ")";
|
|
725
|
+
this.value = ")";
|
|
726
|
+
this.mirror = "(";
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
class IncludeMatchToken extends CSSParserToken {
|
|
730
|
+
constructor() {
|
|
731
|
+
super(...arguments);
|
|
732
|
+
this.tokenType = "~=";
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
class DashMatchToken extends CSSParserToken {
|
|
736
|
+
constructor() {
|
|
737
|
+
super(...arguments);
|
|
738
|
+
this.tokenType = "|=";
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
class PrefixMatchToken extends CSSParserToken {
|
|
742
|
+
constructor() {
|
|
743
|
+
super(...arguments);
|
|
744
|
+
this.tokenType = "^=";
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
class SuffixMatchToken extends CSSParserToken {
|
|
748
|
+
constructor() {
|
|
749
|
+
super(...arguments);
|
|
750
|
+
this.tokenType = "$=";
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
class SubstringMatchToken extends CSSParserToken {
|
|
754
|
+
constructor() {
|
|
755
|
+
super(...arguments);
|
|
756
|
+
this.tokenType = "*=";
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
class ColumnToken extends CSSParserToken {
|
|
760
|
+
constructor() {
|
|
761
|
+
super(...arguments);
|
|
762
|
+
this.tokenType = "||";
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
class EOFToken extends CSSParserToken {
|
|
766
|
+
constructor() {
|
|
767
|
+
super(...arguments);
|
|
768
|
+
this.tokenType = "EOF";
|
|
769
|
+
}
|
|
770
|
+
toSource() {
|
|
771
|
+
return "";
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
class DelimToken extends CSSParserToken {
|
|
775
|
+
constructor(code) {
|
|
776
|
+
super();
|
|
777
|
+
this.tokenType = "DELIM";
|
|
778
|
+
this.value = "";
|
|
779
|
+
this.value = stringFromCode(code);
|
|
780
|
+
}
|
|
781
|
+
toString() {
|
|
782
|
+
return "DELIM(" + this.value + ")";
|
|
783
|
+
}
|
|
784
|
+
toJSON() {
|
|
785
|
+
const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
|
|
786
|
+
json.value = this.value;
|
|
787
|
+
return json;
|
|
788
|
+
}
|
|
789
|
+
toSource() {
|
|
790
|
+
if (this.value === "\\")
|
|
791
|
+
return "\\\n";
|
|
792
|
+
else
|
|
793
|
+
return this.value;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
class StringValuedToken extends CSSParserToken {
|
|
797
|
+
constructor() {
|
|
798
|
+
super(...arguments);
|
|
799
|
+
this.value = "";
|
|
800
|
+
}
|
|
801
|
+
ASCIIMatch(str) {
|
|
802
|
+
return this.value.toLowerCase() === str.toLowerCase();
|
|
803
|
+
}
|
|
804
|
+
toJSON() {
|
|
805
|
+
const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
|
|
806
|
+
json.value = this.value;
|
|
807
|
+
return json;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
class IdentToken extends StringValuedToken {
|
|
811
|
+
constructor(val) {
|
|
812
|
+
super();
|
|
813
|
+
this.tokenType = "IDENT";
|
|
814
|
+
this.value = val;
|
|
815
|
+
}
|
|
816
|
+
toString() {
|
|
817
|
+
return "IDENT(" + this.value + ")";
|
|
818
|
+
}
|
|
819
|
+
toSource() {
|
|
820
|
+
return escapeIdent(this.value);
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
class FunctionToken extends StringValuedToken {
|
|
824
|
+
constructor(val) {
|
|
825
|
+
super();
|
|
826
|
+
this.tokenType = "FUNCTION";
|
|
827
|
+
this.value = val;
|
|
828
|
+
this.mirror = ")";
|
|
829
|
+
}
|
|
830
|
+
toString() {
|
|
831
|
+
return "FUNCTION(" + this.value + ")";
|
|
832
|
+
}
|
|
833
|
+
toSource() {
|
|
834
|
+
return escapeIdent(this.value) + "(";
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
class AtKeywordToken extends StringValuedToken {
|
|
838
|
+
constructor(val) {
|
|
839
|
+
super();
|
|
840
|
+
this.tokenType = "AT-KEYWORD";
|
|
841
|
+
this.value = val;
|
|
842
|
+
}
|
|
843
|
+
toString() {
|
|
844
|
+
return "AT(" + this.value + ")";
|
|
845
|
+
}
|
|
846
|
+
toSource() {
|
|
847
|
+
return "@" + escapeIdent(this.value);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
class HashToken extends StringValuedToken {
|
|
851
|
+
constructor(val) {
|
|
852
|
+
super();
|
|
853
|
+
this.tokenType = "HASH";
|
|
854
|
+
this.value = val;
|
|
855
|
+
this.type = "unrestricted";
|
|
856
|
+
}
|
|
857
|
+
toString() {
|
|
858
|
+
return "HASH(" + this.value + ")";
|
|
859
|
+
}
|
|
860
|
+
toJSON() {
|
|
861
|
+
const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
|
|
862
|
+
json.value = this.value;
|
|
863
|
+
json.type = this.type;
|
|
864
|
+
return json;
|
|
865
|
+
}
|
|
866
|
+
toSource() {
|
|
867
|
+
if (this.type === "id")
|
|
868
|
+
return "#" + escapeIdent(this.value);
|
|
869
|
+
else
|
|
870
|
+
return "#" + escapeHash(this.value);
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
class StringToken extends StringValuedToken {
|
|
874
|
+
constructor(val) {
|
|
875
|
+
super();
|
|
876
|
+
this.tokenType = "STRING";
|
|
877
|
+
this.value = val;
|
|
878
|
+
}
|
|
879
|
+
toString() {
|
|
880
|
+
return '"' + escapeString(this.value) + '"';
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
class URLToken extends StringValuedToken {
|
|
884
|
+
constructor(val) {
|
|
885
|
+
super();
|
|
886
|
+
this.tokenType = "URL";
|
|
887
|
+
this.value = val;
|
|
888
|
+
}
|
|
889
|
+
toString() {
|
|
890
|
+
return "URL(" + this.value + ")";
|
|
891
|
+
}
|
|
892
|
+
toSource() {
|
|
893
|
+
return 'url("' + escapeString(this.value) + '")';
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
class NumberToken extends CSSParserToken {
|
|
897
|
+
constructor() {
|
|
898
|
+
super();
|
|
899
|
+
this.tokenType = "NUMBER";
|
|
900
|
+
this.type = "integer";
|
|
901
|
+
this.repr = "";
|
|
902
|
+
}
|
|
903
|
+
toString() {
|
|
904
|
+
if (this.type === "integer")
|
|
905
|
+
return "INT(" + this.value + ")";
|
|
906
|
+
return "NUMBER(" + this.value + ")";
|
|
907
|
+
}
|
|
908
|
+
toJSON() {
|
|
909
|
+
const json = super.toJSON();
|
|
910
|
+
json.value = this.value;
|
|
911
|
+
json.type = this.type;
|
|
912
|
+
json.repr = this.repr;
|
|
913
|
+
return json;
|
|
914
|
+
}
|
|
915
|
+
toSource() {
|
|
916
|
+
return this.repr;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
class PercentageToken extends CSSParserToken {
|
|
920
|
+
constructor() {
|
|
921
|
+
super();
|
|
922
|
+
this.tokenType = "PERCENTAGE";
|
|
923
|
+
this.repr = "";
|
|
924
|
+
}
|
|
925
|
+
toString() {
|
|
926
|
+
return "PERCENTAGE(" + this.value + ")";
|
|
927
|
+
}
|
|
928
|
+
toJSON() {
|
|
929
|
+
const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
|
|
930
|
+
json.value = this.value;
|
|
931
|
+
json.repr = this.repr;
|
|
932
|
+
return json;
|
|
933
|
+
}
|
|
934
|
+
toSource() {
|
|
935
|
+
return this.repr + "%";
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
class DimensionToken extends CSSParserToken {
|
|
939
|
+
constructor() {
|
|
940
|
+
super();
|
|
941
|
+
this.tokenType = "DIMENSION";
|
|
942
|
+
this.type = "integer";
|
|
943
|
+
this.repr = "";
|
|
944
|
+
this.unit = "";
|
|
945
|
+
}
|
|
946
|
+
toString() {
|
|
947
|
+
return "DIM(" + this.value + "," + this.unit + ")";
|
|
948
|
+
}
|
|
949
|
+
toJSON() {
|
|
950
|
+
const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
|
|
951
|
+
json.value = this.value;
|
|
952
|
+
json.type = this.type;
|
|
953
|
+
json.repr = this.repr;
|
|
954
|
+
json.unit = this.unit;
|
|
955
|
+
return json;
|
|
956
|
+
}
|
|
957
|
+
toSource() {
|
|
958
|
+
const source = this.repr;
|
|
959
|
+
let unit = escapeIdent(this.unit);
|
|
960
|
+
if (unit[0].toLowerCase() === "e" && (unit[1] === "-" || between(unit.charCodeAt(1), 48, 57))) {
|
|
961
|
+
unit = "\\65 " + unit.slice(1, unit.length);
|
|
962
|
+
}
|
|
963
|
+
return source + unit;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
function escapeIdent(string) {
|
|
967
|
+
string = "" + string;
|
|
968
|
+
let result = "";
|
|
969
|
+
const firstcode = string.charCodeAt(0);
|
|
970
|
+
for (let i = 0; i < string.length; i++) {
|
|
971
|
+
const code = string.charCodeAt(i);
|
|
972
|
+
if (code === 0)
|
|
973
|
+
throw new InvalidCharacterError("Invalid character: the input contains U+0000.");
|
|
974
|
+
if (between(code, 1, 31) || code === 127 || i === 0 && between(code, 48, 57) || i === 1 && between(code, 48, 57) && firstcode === 45)
|
|
975
|
+
result += "\\" + code.toString(16) + " ";
|
|
976
|
+
else if (code >= 128 || code === 45 || code === 95 || between(code, 48, 57) || between(code, 65, 90) || between(code, 97, 122))
|
|
977
|
+
result += string[i];
|
|
978
|
+
else
|
|
979
|
+
result += "\\" + string[i];
|
|
980
|
+
}
|
|
981
|
+
return result;
|
|
982
|
+
}
|
|
983
|
+
function escapeHash(string) {
|
|
984
|
+
string = "" + string;
|
|
985
|
+
let result = "";
|
|
986
|
+
for (let i = 0; i < string.length; i++) {
|
|
987
|
+
const code = string.charCodeAt(i);
|
|
988
|
+
if (code === 0)
|
|
989
|
+
throw new InvalidCharacterError("Invalid character: the input contains U+0000.");
|
|
990
|
+
if (code >= 128 || code === 45 || code === 95 || between(code, 48, 57) || between(code, 65, 90) || between(code, 97, 122))
|
|
991
|
+
result += string[i];
|
|
992
|
+
else
|
|
993
|
+
result += "\\" + code.toString(16) + " ";
|
|
994
|
+
}
|
|
995
|
+
return result;
|
|
996
|
+
}
|
|
997
|
+
function escapeString(string) {
|
|
998
|
+
string = "" + string;
|
|
999
|
+
let result = "";
|
|
1000
|
+
for (let i = 0; i < string.length; i++) {
|
|
1001
|
+
const code = string.charCodeAt(i);
|
|
1002
|
+
if (code === 0)
|
|
1003
|
+
throw new InvalidCharacterError("Invalid character: the input contains U+0000.");
|
|
1004
|
+
if (between(code, 1, 31) || code === 127)
|
|
1005
|
+
result += "\\" + code.toString(16) + " ";
|
|
1006
|
+
else if (code === 34 || code === 92)
|
|
1007
|
+
result += "\\" + string[i];
|
|
1008
|
+
else
|
|
1009
|
+
result += string[i];
|
|
1010
|
+
}
|
|
1011
|
+
return result;
|
|
1012
|
+
}
|
|
1013
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1014
|
+
0 && (module.exports = {
|
|
1015
|
+
AtKeywordToken,
|
|
1016
|
+
BadStringToken,
|
|
1017
|
+
BadURLToken,
|
|
1018
|
+
CDCToken,
|
|
1019
|
+
CDOToken,
|
|
1020
|
+
CSSParserToken,
|
|
1021
|
+
CloseCurlyToken,
|
|
1022
|
+
CloseParenToken,
|
|
1023
|
+
CloseSquareToken,
|
|
1024
|
+
ColonToken,
|
|
1025
|
+
ColumnToken,
|
|
1026
|
+
CommaToken,
|
|
1027
|
+
DashMatchToken,
|
|
1028
|
+
DelimToken,
|
|
1029
|
+
DimensionToken,
|
|
1030
|
+
EOFToken,
|
|
1031
|
+
FunctionToken,
|
|
1032
|
+
GroupingToken,
|
|
1033
|
+
HashToken,
|
|
1034
|
+
IdentToken,
|
|
1035
|
+
IncludeMatchToken,
|
|
1036
|
+
InvalidCharacterError,
|
|
1037
|
+
NumberToken,
|
|
1038
|
+
OpenCurlyToken,
|
|
1039
|
+
OpenParenToken,
|
|
1040
|
+
OpenSquareToken,
|
|
1041
|
+
PercentageToken,
|
|
1042
|
+
PrefixMatchToken,
|
|
1043
|
+
SemicolonToken,
|
|
1044
|
+
StringToken,
|
|
1045
|
+
StringValuedToken,
|
|
1046
|
+
SubstringMatchToken,
|
|
1047
|
+
SuffixMatchToken,
|
|
1048
|
+
URLToken,
|
|
1049
|
+
WhitespaceToken,
|
|
1050
|
+
tokenize
|
|
1051
|
+
});
|