pokeedex 0.1.0 → 0.1.5
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.
- checksums.yaml +4 -4
- data/README.md +3 -5
- data/bin/pokeedex +1 -44
- data/lib/pokeedex/configuration.rb +0 -6
- data/lib/pokeedex/install_playwright.rb +62 -0
- data/lib/pokeedex/pokemon/scrapper/fetchers/base.rb +1 -1
- data/lib/pokeedex/version.rb +1 -1
- data/lib/pokeedex.rb +5 -2
- data/spec/pokeedex/configuration_spec.rb +0 -7
- data/spec/spec_helper.rb +1 -1
- metadata +2 -550
- data/node_modules/.bin/playwright +0 -1
- data/node_modules/.bin/playwright-core +0 -1
- data/node_modules/.yarn-integrity +0 -22
- data/node_modules/@playwright/test/LICENSE +0 -202
- data/node_modules/@playwright/test/NOTICE +0 -5
- data/node_modules/@playwright/test/README.md +0 -169
- data/node_modules/@playwright/test/cli.js +0 -19
- data/node_modules/@playwright/test/index.d.ts +0 -18
- data/node_modules/@playwright/test/index.js +0 -17
- data/node_modules/@playwright/test/index.mjs +0 -18
- data/node_modules/@playwright/test/node_modules/.bin/playwright +0 -1
- data/node_modules/@playwright/test/package.json +0 -35
- data/node_modules/@playwright/test/reporter.d.ts +0 -17
- data/node_modules/@playwright/test/reporter.js +0 -17
- data/node_modules/@playwright/test/reporter.mjs +0 -17
- data/node_modules/@types/node/LICENSE +0 -21
- data/node_modules/@types/node/README.md +0 -15
- data/node_modules/@types/node/assert/strict.d.ts +0 -8
- data/node_modules/@types/node/assert.d.ts +0 -1040
- data/node_modules/@types/node/async_hooks.d.ts +0 -541
- data/node_modules/@types/node/buffer.d.ts +0 -2300
- data/node_modules/@types/node/child_process.d.ts +0 -1544
- data/node_modules/@types/node/cluster.d.ts +0 -578
- data/node_modules/@types/node/console.d.ts +0 -452
- data/node_modules/@types/node/constants.d.ts +0 -19
- data/node_modules/@types/node/crypto.d.ts +0 -4451
- data/node_modules/@types/node/dgram.d.ts +0 -596
- data/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
- data/node_modules/@types/node/dns/promises.d.ts +0 -476
- data/node_modules/@types/node/dns.d.ts +0 -865
- data/node_modules/@types/node/dom-events.d.ts +0 -124
- data/node_modules/@types/node/domain.d.ts +0 -170
- data/node_modules/@types/node/events.d.ts +0 -931
- data/node_modules/@types/node/fs/promises.d.ts +0 -1264
- data/node_modules/@types/node/fs.d.ts +0 -4390
- data/node_modules/@types/node/globals.d.ts +0 -611
- data/node_modules/@types/node/globals.global.d.ts +0 -1
- data/node_modules/@types/node/http.d.ts +0 -1921
- data/node_modules/@types/node/http2.d.ts +0 -2555
- data/node_modules/@types/node/https.d.ts +0 -544
- data/node_modules/@types/node/index.d.ts +0 -90
- data/node_modules/@types/node/inspector.d.ts +0 -3966
- data/node_modules/@types/node/module.d.ts +0 -301
- data/node_modules/@types/node/net.d.ts +0 -995
- data/node_modules/@types/node/os.d.ts +0 -495
- data/node_modules/@types/node/package.json +0 -217
- data/node_modules/@types/node/path.d.ts +0 -200
- data/node_modules/@types/node/perf_hooks.d.ts +0 -941
- data/node_modules/@types/node/process.d.ts +0 -1912
- data/node_modules/@types/node/punycode.d.ts +0 -117
- data/node_modules/@types/node/querystring.d.ts +0 -153
- data/node_modules/@types/node/readline/promises.d.ts +0 -150
- data/node_modules/@types/node/readline.d.ts +0 -540
- data/node_modules/@types/node/repl.d.ts +0 -430
- data/node_modules/@types/node/sea.d.ts +0 -153
- data/node_modules/@types/node/sqlite.d.ts +0 -213
- data/node_modules/@types/node/stream/consumers.d.ts +0 -12
- data/node_modules/@types/node/stream/promises.d.ts +0 -83
- data/node_modules/@types/node/stream/web.d.ts +0 -606
- data/node_modules/@types/node/stream.d.ts +0 -1726
- data/node_modules/@types/node/string_decoder.d.ts +0 -67
- data/node_modules/@types/node/test.d.ts +0 -2098
- data/node_modules/@types/node/timers/promises.d.ts +0 -97
- data/node_modules/@types/node/timers.d.ts +0 -240
- data/node_modules/@types/node/tls.d.ts +0 -1220
- data/node_modules/@types/node/trace_events.d.ts +0 -197
- data/node_modules/@types/node/tty.d.ts +0 -208
- data/node_modules/@types/node/url.d.ts +0 -969
- data/node_modules/@types/node/util.d.ts +0 -2301
- data/node_modules/@types/node/v8.d.ts +0 -808
- data/node_modules/@types/node/vm.d.ts +0 -922
- data/node_modules/@types/node/wasi.d.ts +0 -181
- data/node_modules/@types/node/worker_threads.d.ts +0 -712
- data/node_modules/@types/node/zlib.d.ts +0 -539
- data/node_modules/fsevents/LICENSE +0 -22
- data/node_modules/fsevents/README.md +0 -83
- data/node_modules/fsevents/fsevents.d.ts +0 -46
- data/node_modules/fsevents/fsevents.js +0 -82
- data/node_modules/fsevents/fsevents.node +0 -0
- data/node_modules/fsevents/package.json +0 -62
- data/node_modules/playwright/.eslintrc.js +0 -6
- data/node_modules/playwright/LICENSE +0 -202
- data/node_modules/playwright/NOTICE +0 -5
- data/node_modules/playwright/README.md +0 -169
- data/node_modules/playwright/ThirdPartyNotices.txt +0 -4356
- data/node_modules/playwright/cli.js +0 -19
- data/node_modules/playwright/index.d.ts +0 -17
- data/node_modules/playwright/index.js +0 -17
- data/node_modules/playwright/index.mjs +0 -18
- data/node_modules/playwright/jsx-runtime.js +0 -41
- data/node_modules/playwright/jsx-runtime.mjs +0 -21
- data/node_modules/playwright/lib/common/config.js +0 -256
- data/node_modules/playwright/lib/common/configLoader.js +0 -321
- data/node_modules/playwright/lib/common/esmLoaderHost.js +0 -93
- data/node_modules/playwright/lib/common/expectBundle.js +0 -27
- data/node_modules/playwright/lib/common/expectBundleImpl.js +0 -389
- data/node_modules/playwright/lib/common/fixtures.js +0 -323
- data/node_modules/playwright/lib/common/globals.js +0 -48
- data/node_modules/playwright/lib/common/ipc.js +0 -48
- data/node_modules/playwright/lib/common/poolBuilder.js +0 -79
- data/node_modules/playwright/lib/common/process.js +0 -140
- data/node_modules/playwright/lib/common/suiteUtils.js +0 -133
- data/node_modules/playwright/lib/common/test.js +0 -311
- data/node_modules/playwright/lib/common/testLoader.js +0 -102
- data/node_modules/playwright/lib/common/testType.js +0 -284
- data/node_modules/playwright/lib/fsWatcher.js +0 -69
- data/node_modules/playwright/lib/index.js +0 -888
- data/node_modules/playwright/lib/internalsForTest.js +0 -28
- data/node_modules/playwright/lib/isomorphic/events.js +0 -72
- data/node_modules/playwright/lib/isomorphic/folders.js +0 -25
- data/node_modules/playwright/lib/isomorphic/stringInternPool.js +0 -58
- data/node_modules/playwright/lib/isomorphic/teleReceiver.js +0 -504
- data/node_modules/playwright/lib/isomorphic/teleSuiteUpdater.js +0 -149
- data/node_modules/playwright/lib/isomorphic/testServerConnection.js +0 -210
- data/node_modules/playwright/lib/isomorphic/testServerInterface.js +0 -5
- data/node_modules/playwright/lib/isomorphic/testTree.js +0 -272
- data/node_modules/playwright/lib/loader/loaderMain.js +0 -58
- data/node_modules/playwright/lib/matchers/expect.js +0 -297
- data/node_modules/playwright/lib/matchers/matcherHint.js +0 -50
- data/node_modules/playwright/lib/matchers/matchers.js +0 -449
- data/node_modules/playwright/lib/matchers/toBeTruthy.js +0 -55
- data/node_modules/playwright/lib/matchers/toEqual.js +0 -57
- data/node_modules/playwright/lib/matchers/toMatchSnapshot.js +0 -383
- data/node_modules/playwright/lib/matchers/toMatchText.js +0 -76
- data/node_modules/playwright/lib/plugins/gitCommitInfoPlugin.js +0 -78
- data/node_modules/playwright/lib/plugins/index.js +0 -19
- data/node_modules/playwright/lib/plugins/webServerPlugin.js +0 -187
- data/node_modules/playwright/lib/program.js +0 -346
- data/node_modules/playwright/lib/reporters/base.js +0 -553
- data/node_modules/playwright/lib/reporters/blob.js +0 -133
- data/node_modules/playwright/lib/reporters/dot.js +0 -82
- data/node_modules/playwright/lib/reporters/empty.js +0 -42
- data/node_modules/playwright/lib/reporters/github.js +0 -115
- data/node_modules/playwright/lib/reporters/html.js +0 -623
- data/node_modules/playwright/lib/reporters/internalReporter.js +0 -123
- data/node_modules/playwright/lib/reporters/json.js +0 -243
- data/node_modules/playwright/lib/reporters/junit.js +0 -233
- data/node_modules/playwright/lib/reporters/line.js +0 -108
- data/node_modules/playwright/lib/reporters/list.js +0 -222
- data/node_modules/playwright/lib/reporters/markdown.js +0 -76
- data/node_modules/playwright/lib/reporters/merge.js +0 -477
- data/node_modules/playwright/lib/reporters/multiplexer.js +0 -90
- data/node_modules/playwright/lib/reporters/reporterV2.js +0 -118
- data/node_modules/playwright/lib/reporters/teleEmitter.js +0 -268
- data/node_modules/playwright/lib/reporters/versions/blobV1.js +0 -5
- data/node_modules/playwright/lib/runner/dispatcher.js +0 -532
- data/node_modules/playwright/lib/runner/failureTracker.js +0 -60
- data/node_modules/playwright/lib/runner/loadUtils.js +0 -308
- data/node_modules/playwright/lib/runner/loaderHost.js +0 -85
- data/node_modules/playwright/lib/runner/processHost.js +0 -175
- data/node_modules/playwright/lib/runner/projectUtils.js +0 -203
- data/node_modules/playwright/lib/runner/reporters.js +0 -151
- data/node_modules/playwright/lib/runner/runner.js +0 -179
- data/node_modules/playwright/lib/runner/sigIntWatcher.js +0 -100
- data/node_modules/playwright/lib/runner/taskRunner.js +0 -147
- data/node_modules/playwright/lib/runner/tasks.js +0 -407
- data/node_modules/playwright/lib/runner/testGroups.js +0 -136
- data/node_modules/playwright/lib/runner/testServer.js +0 -605
- data/node_modules/playwright/lib/runner/uiModeReporter.js +0 -31
- data/node_modules/playwright/lib/runner/vcs.js +0 -55
- data/node_modules/playwright/lib/runner/watchMode.js +0 -398
- data/node_modules/playwright/lib/runner/workerHost.js +0 -85
- data/node_modules/playwright/lib/third_party/tsconfig-loader.js +0 -134
- data/node_modules/playwright/lib/transform/babelBundle.js +0 -28
- data/node_modules/playwright/lib/transform/babelBundleImpl.js +0 -2032
- data/node_modules/playwright/lib/transform/compilationCache.js +0 -254
- data/node_modules/playwright/lib/transform/esmLoader.js +0 -117
- data/node_modules/playwright/lib/transform/esmUtils.js +0 -32
- data/node_modules/playwright/lib/transform/portTransport.js +0 -81
- data/node_modules/playwright/lib/transform/transform.js +0 -267
- data/node_modules/playwright/lib/util.js +0 -356
- data/node_modules/playwright/lib/utilsBundle.js +0 -28
- data/node_modules/playwright/lib/utilsBundleImpl.js +0 -102
- data/node_modules/playwright/lib/worker/fixtureRunner.js +0 -279
- data/node_modules/playwright/lib/worker/testInfo.js +0 -397
- data/node_modules/playwright/lib/worker/testTracing.js +0 -314
- data/node_modules/playwright/lib/worker/timeoutManager.js +0 -153
- data/node_modules/playwright/lib/worker/workerMain.js +0 -637
- data/node_modules/playwright/node_modules/.bin/playwright-core +0 -1
- data/node_modules/playwright/package.json +0 -66
- data/node_modules/playwright/test.d.ts +0 -18
- data/node_modules/playwright/test.js +0 -24
- data/node_modules/playwright/test.mjs +0 -33
- data/node_modules/playwright/types/test.d.ts +0 -8444
- data/node_modules/playwright/types/testReporter.d.ts +0 -749
- data/node_modules/playwright-core/LICENSE +0 -202
- data/node_modules/playwright-core/NOTICE +0 -5
- data/node_modules/playwright-core/README.md +0 -3
- data/node_modules/playwright-core/ThirdPartyNotices.txt +0 -1548
- data/node_modules/playwright-core/bin/PrintDeps.exe +0 -0
- data/node_modules/playwright-core/bin/README.md +0 -2
- data/node_modules/playwright-core/bin/install_media_pack.ps1 +0 -5
- data/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +0 -40
- data/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +0 -13
- data/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +0 -24
- data/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +0 -40
- data/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +0 -12
- data/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +0 -24
- data/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +0 -40
- data/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +0 -11
- data/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +0 -23
- data/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +0 -40
- data/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +0 -11
- data/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +0 -23
- data/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +0 -40
- data/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +0 -11
- data/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +0 -24
- data/node_modules/playwright-core/browsers.json +0 -53
- data/node_modules/playwright-core/cli.js +0 -18
- data/node_modules/playwright-core/index.d.ts +0 -17
- data/node_modules/playwright-core/index.js +0 -33
- data/node_modules/playwright-core/index.mjs +0 -28
- data/node_modules/playwright-core/lib/androidServerImpl.js +0 -69
- data/node_modules/playwright-core/lib/browserServerImpl.js +0 -92
- data/node_modules/playwright-core/lib/cli/driver.js +0 -95
- data/node_modules/playwright-core/lib/cli/program.js +0 -577
- data/node_modules/playwright-core/lib/cli/programWithTestStub.js +0 -67
- data/node_modules/playwright-core/lib/client/accessibility.js +0 -50
- data/node_modules/playwright-core/lib/client/android.js +0 -473
- data/node_modules/playwright-core/lib/client/api.js +0 -279
- data/node_modules/playwright-core/lib/client/artifact.js +0 -79
- data/node_modules/playwright-core/lib/client/browser.js +0 -145
- data/node_modules/playwright-core/lib/client/browserContext.js +0 -541
- data/node_modules/playwright-core/lib/client/browserType.js +0 -241
- data/node_modules/playwright-core/lib/client/cdpSession.js +0 -53
- data/node_modules/playwright-core/lib/client/channelOwner.js +0 -231
- data/node_modules/playwright-core/lib/client/clientHelper.js +0 -57
- data/node_modules/playwright-core/lib/client/clientInstrumentation.js +0 -50
- data/node_modules/playwright-core/lib/client/clock.js +0 -68
- data/node_modules/playwright-core/lib/client/connection.js +0 -330
- data/node_modules/playwright-core/lib/client/consoleMessage.js +0 -55
- data/node_modules/playwright-core/lib/client/coverage.js +0 -41
- data/node_modules/playwright-core/lib/client/dialog.js +0 -57
- data/node_modules/playwright-core/lib/client/download.js +0 -62
- data/node_modules/playwright-core/lib/client/electron.js +0 -135
- data/node_modules/playwright-core/lib/client/elementHandle.js +0 -321
- data/node_modules/playwright-core/lib/client/errors.js +0 -77
- data/node_modules/playwright-core/lib/client/eventEmitter.js +0 -314
- data/node_modules/playwright-core/lib/client/events.js +0 -94
- data/node_modules/playwright-core/lib/client/fetch.js +0 -396
- data/node_modules/playwright-core/lib/client/fileChooser.js +0 -45
- data/node_modules/playwright-core/lib/client/frame.js +0 -504
- data/node_modules/playwright-core/lib/client/harRouter.js +0 -99
- data/node_modules/playwright-core/lib/client/input.js +0 -111
- data/node_modules/playwright-core/lib/client/jsHandle.js +0 -129
- data/node_modules/playwright-core/lib/client/jsonPipe.js +0 -35
- data/node_modules/playwright-core/lib/client/localUtils.js +0 -35
- data/node_modules/playwright-core/lib/client/locator.js +0 -441
- data/node_modules/playwright-core/lib/client/network.js +0 -604
- data/node_modules/playwright-core/lib/client/page.js +0 -725
- data/node_modules/playwright-core/lib/client/playwright.js +0 -77
- data/node_modules/playwright-core/lib/client/selectors.js +0 -67
- data/node_modules/playwright-core/lib/client/stream.js +0 -54
- data/node_modules/playwright-core/lib/client/tracing.js +0 -138
- data/node_modules/playwright-core/lib/client/types.js +0 -24
- data/node_modules/playwright-core/lib/client/video.js +0 -51
- data/node_modules/playwright-core/lib/client/waiter.js +0 -158
- data/node_modules/playwright-core/lib/client/webError.js +0 -37
- data/node_modules/playwright-core/lib/client/worker.js +0 -71
- data/node_modules/playwright-core/lib/client/writableStream.js +0 -54
- data/node_modules/playwright-core/lib/common/socksProxy.js +0 -569
- data/node_modules/playwright-core/lib/common/timeoutSettings.js +0 -73
- data/node_modules/playwright-core/lib/common/types.js +0 -5
- data/node_modules/playwright-core/lib/generated/clockSource.js +0 -7
- data/node_modules/playwright-core/lib/generated/consoleApiSource.js +0 -7
- data/node_modules/playwright-core/lib/generated/injectedScriptSource.js +0 -7
- data/node_modules/playwright-core/lib/generated/recorderSource.js +0 -7
- data/node_modules/playwright-core/lib/generated/utilityScriptSource.js +0 -7
- data/node_modules/playwright-core/lib/image_tools/colorUtils.js +0 -98
- data/node_modules/playwright-core/lib/image_tools/compare.js +0 -108
- data/node_modules/playwright-core/lib/image_tools/imageChannel.js +0 -70
- data/node_modules/playwright-core/lib/image_tools/stats.js +0 -102
- data/node_modules/playwright-core/lib/inProcessFactory.js +0 -54
- data/node_modules/playwright-core/lib/inprocess.js +0 -20
- data/node_modules/playwright-core/lib/outofprocess.js +0 -67
- data/node_modules/playwright-core/lib/protocol/debug.js +0 -27
- data/node_modules/playwright-core/lib/protocol/serializers.js +0 -173
- data/node_modules/playwright-core/lib/protocol/transport.js +0 -82
- data/node_modules/playwright-core/lib/protocol/validator.js +0 -2694
- data/node_modules/playwright-core/lib/protocol/validatorPrimitives.js +0 -139
- data/node_modules/playwright-core/lib/remote/playwrightConnection.js +0 -274
- data/node_modules/playwright-core/lib/remote/playwrightServer.js +0 -110
- data/node_modules/playwright-core/lib/server/accessibility.js +0 -62
- data/node_modules/playwright-core/lib/server/android/android.js +0 -441
- data/node_modules/playwright-core/lib/server/android/backendAdb.js +0 -172
- data/node_modules/playwright-core/lib/server/artifact.js +0 -104
- data/node_modules/playwright-core/lib/server/bidi/bidiBrowser.js +0 -296
- data/node_modules/playwright-core/lib/server/bidi/bidiConnection.js +0 -206
- data/node_modules/playwright-core/lib/server/bidi/bidiExecutionContext.js +0 -162
- data/node_modules/playwright-core/lib/server/bidi/bidiFirefox.js +0 -110
- data/node_modules/playwright-core/lib/server/bidi/bidiInput.js +0 -174
- data/node_modules/playwright-core/lib/server/bidi/bidiNetworkManager.js +0 -304
- data/node_modules/playwright-core/lib/server/bidi/bidiPage.js +0 -456
- data/node_modules/playwright-core/lib/server/bidi/third_party/bidiDeserializer.js +0 -93
- data/node_modules/playwright-core/lib/server/bidi/third_party/bidiKeyboard.js +0 -238
- data/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocol.js +0 -139
- data/node_modules/playwright-core/lib/server/bidi/third_party/bidiSerializer.js +0 -144
- data/node_modules/playwright-core/lib/server/browser.js +0 -137
- data/node_modules/playwright-core/lib/server/browserContext.js +0 -684
- data/node_modules/playwright-core/lib/server/browserType.js +0 -307
- data/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
- data/node_modules/playwright-core/lib/server/chromium/chromium.js +0 -362
- data/node_modules/playwright-core/lib/server/chromium/chromiumSwitches.js +0 -44
- data/node_modules/playwright-core/lib/server/chromium/crAccessibility.js +0 -237
- data/node_modules/playwright-core/lib/server/chromium/crBrowser.js +0 -515
- data/node_modules/playwright-core/lib/server/chromium/crConnection.js +0 -228
- data/node_modules/playwright-core/lib/server/chromium/crCoverage.js +0 -246
- data/node_modules/playwright-core/lib/server/chromium/crDevTools.js +0 -104
- data/node_modules/playwright-core/lib/server/chromium/crDragDrop.js +0 -143
- data/node_modules/playwright-core/lib/server/chromium/crExecutionContext.js +0 -156
- data/node_modules/playwright-core/lib/server/chromium/crInput.js +0 -171
- data/node_modules/playwright-core/lib/server/chromium/crNetworkManager.js +0 -767
- data/node_modules/playwright-core/lib/server/chromium/crPage.js +0 -1128
- data/node_modules/playwright-core/lib/server/chromium/crPdf.js +0 -153
- data/node_modules/playwright-core/lib/server/chromium/crProtocolHelper.js +0 -133
- data/node_modules/playwright-core/lib/server/chromium/crServiceWorker.js +0 -112
- data/node_modules/playwright-core/lib/server/chromium/defaultFontFamilies.js +0 -145
- data/node_modules/playwright-core/lib/server/chromium/videoRecorder.js +0 -155
- data/node_modules/playwright-core/lib/server/clock.js +0 -125
- data/node_modules/playwright-core/lib/server/codegen/csharp.js +0 -299
- data/node_modules/playwright-core/lib/server/codegen/java.js +0 -235
- data/node_modules/playwright-core/lib/server/codegen/javascript.js +0 -223
- data/node_modules/playwright-core/lib/server/codegen/jsonl.js +0 -47
- data/node_modules/playwright-core/lib/server/codegen/language.js +0 -76
- data/node_modules/playwright-core/lib/server/codegen/languages.js +0 -30
- data/node_modules/playwright-core/lib/server/codegen/python.js +0 -265
- data/node_modules/playwright-core/lib/server/codegen/types.js +0 -5
- data/node_modules/playwright-core/lib/server/console.js +0 -57
- data/node_modules/playwright-core/lib/server/cookieStore.js +0 -112
- data/node_modules/playwright-core/lib/server/debugController.js +0 -234
- data/node_modules/playwright-core/lib/server/debugger.js +0 -132
- data/node_modules/playwright-core/lib/server/deviceDescriptors.js +0 -26
- data/node_modules/playwright-core/lib/server/deviceDescriptorsSource.json +0 -1669
- data/node_modules/playwright-core/lib/server/dialog.js +0 -70
- data/node_modules/playwright-core/lib/server/dispatchers/androidDispatcher.js +0 -193
- data/node_modules/playwright-core/lib/server/dispatchers/artifactDispatcher.js +0 -118
- data/node_modules/playwright-core/lib/server/dispatchers/browserContextDispatcher.js +0 -351
- data/node_modules/playwright-core/lib/server/dispatchers/browserDispatcher.js +0 -170
- data/node_modules/playwright-core/lib/server/dispatchers/browserTypeDispatcher.js +0 -55
- data/node_modules/playwright-core/lib/server/dispatchers/cdpSessionDispatcher.js +0 -48
- data/node_modules/playwright-core/lib/server/dispatchers/debugControllerDispatcher.js +0 -103
- data/node_modules/playwright-core/lib/server/dispatchers/dialogDispatcher.js +0 -44
- data/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js +0 -395
- data/node_modules/playwright-core/lib/server/dispatchers/electronDispatcher.js +0 -93
- data/node_modules/playwright-core/lib/server/dispatchers/elementHandlerDispatcher.js +0 -228
- data/node_modules/playwright-core/lib/server/dispatchers/frameDispatcher.js +0 -286
- data/node_modules/playwright-core/lib/server/dispatchers/jsHandleDispatcher.js +0 -102
- data/node_modules/playwright-core/lib/server/dispatchers/jsonPipeDispatcher.js +0 -59
- data/node_modules/playwright-core/lib/server/dispatchers/localUtilsDispatcher.js +0 -413
- data/node_modules/playwright-core/lib/server/dispatchers/networkDispatchers.js +0 -221
- data/node_modules/playwright-core/lib/server/dispatchers/pageDispatcher.js +0 -358
- data/node_modules/playwright-core/lib/server/dispatchers/playwrightDispatcher.js +0 -106
- data/node_modules/playwright-core/lib/server/dispatchers/selectorsDispatcher.js +0 -36
- data/node_modules/playwright-core/lib/server/dispatchers/streamDispatcher.js +0 -62
- data/node_modules/playwright-core/lib/server/dispatchers/tracingDispatcher.js +0 -54
- data/node_modules/playwright-core/lib/server/dispatchers/writableStreamDispatcher.js +0 -58
- data/node_modules/playwright-core/lib/server/dom.js +0 -845
- data/node_modules/playwright-core/lib/server/download.js +0 -53
- data/node_modules/playwright-core/lib/server/electron/electron.js +0 -296
- data/node_modules/playwright-core/lib/server/electron/loader.js +0 -57
- data/node_modules/playwright-core/lib/server/errors.js +0 -68
- data/node_modules/playwright-core/lib/server/fetch.js +0 -660
- data/node_modules/playwright-core/lib/server/fileChooser.js +0 -42
- data/node_modules/playwright-core/lib/server/fileUploadUtils.js +0 -75
- data/node_modules/playwright-core/lib/server/firefox/ffAccessibility.js +0 -216
- data/node_modules/playwright-core/lib/server/firefox/ffBrowser.js +0 -458
- data/node_modules/playwright-core/lib/server/firefox/ffConnection.js +0 -168
- data/node_modules/playwright-core/lib/server/firefox/ffExecutionContext.js +0 -138
- data/node_modules/playwright-core/lib/server/firefox/ffInput.js +0 -150
- data/node_modules/playwright-core/lib/server/firefox/ffNetworkManager.js +0 -233
- data/node_modules/playwright-core/lib/server/firefox/ffPage.js +0 -556
- data/node_modules/playwright-core/lib/server/firefox/firefox.js +0 -110
- data/node_modules/playwright-core/lib/server/formData.js +0 -75
- data/node_modules/playwright-core/lib/server/frameSelectors.js +0 -171
- data/node_modules/playwright-core/lib/server/frames.js +0 -1654
- data/node_modules/playwright-core/lib/server/har/harRecorder.js +0 -139
- data/node_modules/playwright-core/lib/server/har/harTracer.js +0 -531
- data/node_modules/playwright-core/lib/server/helper.js +0 -103
- data/node_modules/playwright-core/lib/server/index.js +0 -114
- data/node_modules/playwright-core/lib/server/input.js +0 -311
- data/node_modules/playwright-core/lib/server/instrumentation.js +0 -70
- data/node_modules/playwright-core/lib/server/isomorphic/utilityScriptSerializers.js +0 -226
- data/node_modules/playwright-core/lib/server/javascript.js +0 -306
- data/node_modules/playwright-core/lib/server/launchApp.js +0 -91
- data/node_modules/playwright-core/lib/server/macEditingCommands.js +0 -139
- data/node_modules/playwright-core/lib/server/network.js +0 -617
- data/node_modules/playwright-core/lib/server/page.js +0 -825
- data/node_modules/playwright-core/lib/server/pipeTransport.js +0 -85
- data/node_modules/playwright-core/lib/server/playwright.js +0 -85
- data/node_modules/playwright-core/lib/server/progress.js +0 -102
- data/node_modules/playwright-core/lib/server/protocolError.js +0 -49
- data/node_modules/playwright-core/lib/server/recorder/contextRecorder.js +0 -316
- data/node_modules/playwright-core/lib/server/recorder/recorderActions.js +0 -5
- data/node_modules/playwright-core/lib/server/recorder/recorderApp.js +0 -190
- data/node_modules/playwright-core/lib/server/recorder/recorderCollection.js +0 -127
- data/node_modules/playwright-core/lib/server/recorder/recorderRunner.js +0 -177
- data/node_modules/playwright-core/lib/server/recorder/recorderUtils.js +0 -71
- data/node_modules/playwright-core/lib/server/recorder/throttledFile.js +0 -46
- data/node_modules/playwright-core/lib/server/recorder.js +0 -324
- data/node_modules/playwright-core/lib/server/registry/browserFetcher.js +0 -168
- data/node_modules/playwright-core/lib/server/registry/dependencies.js +0 -322
- data/node_modules/playwright-core/lib/server/registry/index.js +0 -924
- data/node_modules/playwright-core/lib/server/registry/nativeDeps.js +0 -490
- data/node_modules/playwright-core/lib/server/registry/oopDownloadBrowserMain.js +0 -138
- data/node_modules/playwright-core/lib/server/screenshotter.js +0 -348
- data/node_modules/playwright-core/lib/server/selectors.js +0 -73
- data/node_modules/playwright-core/lib/server/socksClientCertificatesInterceptor.js +0 -328
- data/node_modules/playwright-core/lib/server/socksInterceptor.js +0 -100
- data/node_modules/playwright-core/lib/server/trace/recorder/snapshotter.js +0 -171
- data/node_modules/playwright-core/lib/server/trace/recorder/snapshotterInjected.js +0 -493
- data/node_modules/playwright-core/lib/server/trace/recorder/tracing.js +0 -486
- data/node_modules/playwright-core/lib/server/trace/test/inMemorySnapshotter.js +0 -93
- data/node_modules/playwright-core/lib/server/trace/viewer/traceViewer.js +0 -216
- data/node_modules/playwright-core/lib/server/transport.js +0 -191
- data/node_modules/playwright-core/lib/server/types.js +0 -24
- data/node_modules/playwright-core/lib/server/usKeyboardLayout.js +0 -555
- data/node_modules/playwright-core/lib/server/webkit/webkit.js +0 -87
- data/node_modules/playwright-core/lib/server/webkit/wkAccessibility.js +0 -194
- data/node_modules/playwright-core/lib/server/webkit/wkBrowser.js +0 -328
- data/node_modules/playwright-core/lib/server/webkit/wkConnection.js +0 -173
- data/node_modules/playwright-core/lib/server/webkit/wkExecutionContext.js +0 -146
- data/node_modules/playwright-core/lib/server/webkit/wkInput.js +0 -169
- data/node_modules/playwright-core/lib/server/webkit/wkInterceptableRequest.js +0 -162
- data/node_modules/playwright-core/lib/server/webkit/wkPage.js +0 -1216
- data/node_modules/playwright-core/lib/server/webkit/wkProvisionalPage.js +0 -94
- data/node_modules/playwright-core/lib/server/webkit/wkWorkers.js +0 -104
- data/node_modules/playwright-core/lib/third_party/diff_match_patch.js +0 -2222
- data/node_modules/playwright-core/lib/third_party/pixelmatch.js +0 -255
- data/node_modules/playwright-core/lib/utils/ascii.js +0 -31
- data/node_modules/playwright-core/lib/utils/comparators.js +0 -171
- data/node_modules/playwright-core/lib/utils/crypto.js +0 -174
- data/node_modules/playwright-core/lib/utils/debug.js +0 -46
- data/node_modules/playwright-core/lib/utils/debugLogger.js +0 -91
- data/node_modules/playwright-core/lib/utils/env.js +0 -49
- data/node_modules/playwright-core/lib/utils/eventsHelper.js +0 -38
- data/node_modules/playwright-core/lib/utils/expectUtils.js +0 -33
- data/node_modules/playwright-core/lib/utils/fileUtils.js +0 -205
- data/node_modules/playwright-core/lib/utils/happy-eyeballs.js +0 -181
- data/node_modules/playwright-core/lib/utils/headers.js +0 -52
- data/node_modules/playwright-core/lib/utils/hostPlatform.js +0 -133
- data/node_modules/playwright-core/lib/utils/httpServer.js +0 -236
- data/node_modules/playwright-core/lib/utils/index.js +0 -368
- data/node_modules/playwright-core/lib/utils/isomorphic/cssParser.js +0 -250
- data/node_modules/playwright-core/lib/utils/isomorphic/cssTokenizer.js +0 -979
- data/node_modules/playwright-core/lib/utils/isomorphic/locatorGenerators.js +0 -651
- data/node_modules/playwright-core/lib/utils/isomorphic/locatorParser.js +0 -179
- data/node_modules/playwright-core/lib/utils/isomorphic/locatorUtils.js +0 -62
- data/node_modules/playwright-core/lib/utils/isomorphic/mimeType.js +0 -29
- data/node_modules/playwright-core/lib/utils/isomorphic/selectorParser.js +0 -397
- data/node_modules/playwright-core/lib/utils/isomorphic/stringUtils.js +0 -139
- data/node_modules/playwright-core/lib/utils/isomorphic/traceUtils.js +0 -39
- data/node_modules/playwright-core/lib/utils/isomorphic/urlMatch.js +0 -120
- data/node_modules/playwright-core/lib/utils/linuxUtils.js +0 -78
- data/node_modules/playwright-core/lib/utils/manualPromise.js +0 -109
- data/node_modules/playwright-core/lib/utils/multimap.js +0 -75
- data/node_modules/playwright-core/lib/utils/network.js +0 -160
- data/node_modules/playwright-core/lib/utils/processLauncher.js +0 -248
- data/node_modules/playwright-core/lib/utils/profiler.js +0 -53
- data/node_modules/playwright-core/lib/utils/rtti.js +0 -44
- data/node_modules/playwright-core/lib/utils/semaphore.js +0 -51
- data/node_modules/playwright-core/lib/utils/spawnAsync.js +0 -45
- data/node_modules/playwright-core/lib/utils/stackTrace.js +0 -121
- data/node_modules/playwright-core/lib/utils/task.js +0 -58
- data/node_modules/playwright-core/lib/utils/time.js +0 -37
- data/node_modules/playwright-core/lib/utils/timeoutRunner.js +0 -66
- data/node_modules/playwright-core/lib/utils/traceUtils.js +0 -44
- data/node_modules/playwright-core/lib/utils/userAgent.js +0 -105
- data/node_modules/playwright-core/lib/utils/wsServer.js +0 -127
- data/node_modules/playwright-core/lib/utils/zipFile.js +0 -75
- data/node_modules/playwright-core/lib/utils/zones.js +0 -62
- data/node_modules/playwright-core/lib/utilsBundle.js +0 -82
- data/node_modules/playwright-core/lib/utilsBundleImpl/index.js +0 -53
- data/node_modules/playwright-core/lib/utilsBundleImpl/xdg-open +0 -1066
- data/node_modules/playwright-core/lib/vite/htmlReport/index.html +0 -66
- data/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-aW6Vz3gf.js +0 -24
- data/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-ez37Vkbh.css +0 -1
- data/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- data/node_modules/playwright-core/lib/vite/recorder/assets/index-B-MT5gKo.css +0 -1
- data/node_modules/playwright-core/lib/vite/recorder/assets/index-DCpXOVIh.js +0 -47
- data/node_modules/playwright-core/lib/vite/recorder/index.html +0 -29
- data/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +0 -9
- data/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-eFKCUIu2.js +0 -24
- data/node_modules/playwright-core/lib/vite/traceViewer/assets/testServerConnection-DeE2kSzz.js +0 -1
- data/node_modules/playwright-core/lib/vite/traceViewer/assets/workbench-D0cirtfA.js +0 -72
- data/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-BeNbaIVa.js +0 -9
- data/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.ez37Vkbh.css +0 -1
- data/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- data/node_modules/playwright-core/lib/vite/traceViewer/embedded.BkuvsLJp.js +0 -2
- data/node_modules/playwright-core/lib/vite/traceViewer/embedded.html +0 -16
- data/node_modules/playwright-core/lib/vite/traceViewer/embedded.w7WN2u1R.css +0 -1
- data/node_modules/playwright-core/lib/vite/traceViewer/index.C968kAiC.js +0 -2
- data/node_modules/playwright-core/lib/vite/traceViewer/index.CrbWWHbf.css +0 -1
- data/node_modules/playwright-core/lib/vite/traceViewer/index.html +0 -27
- data/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +0 -9
- data/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +0 -21
- data/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +0 -3
- data/node_modules/playwright-core/lib/vite/traceViewer/uiMode.BkFnr4V0.js +0 -10
- data/node_modules/playwright-core/lib/vite/traceViewer/uiMode.D3cNFP6u.css +0 -1
- data/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +0 -18
- data/node_modules/playwright-core/lib/vite/traceViewer/workbench.DjbIuxix.css +0 -1
- data/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.DSXBckUd.css +0 -32
- data/node_modules/playwright-core/lib/zipBundle.js +0 -25
- data/node_modules/playwright-core/lib/zipBundleImpl.js +0 -5
- data/node_modules/playwright-core/package.json +0 -44
- data/node_modules/playwright-core/types/protocol.d.ts +0 -21500
- data/node_modules/playwright-core/types/structs.d.ts +0 -45
- data/node_modules/playwright-core/types/types.d.ts +0 -21431
- data/node_modules/undici-types/LICENSE +0 -21
- data/node_modules/undici-types/README.md +0 -6
- data/node_modules/undici-types/agent.d.ts +0 -31
- data/node_modules/undici-types/api.d.ts +0 -43
- data/node_modules/undici-types/balanced-pool.d.ts +0 -29
- data/node_modules/undici-types/cache.d.ts +0 -36
- data/node_modules/undici-types/client.d.ts +0 -108
- data/node_modules/undici-types/connector.d.ts +0 -34
- data/node_modules/undici-types/content-type.d.ts +0 -21
- data/node_modules/undici-types/cookies.d.ts +0 -28
- data/node_modules/undici-types/diagnostics-channel.d.ts +0 -66
- data/node_modules/undici-types/dispatcher.d.ts +0 -255
- data/node_modules/undici-types/env-http-proxy-agent.d.ts +0 -21
- data/node_modules/undici-types/errors.d.ts +0 -149
- data/node_modules/undici-types/eventsource.d.ts +0 -63
- data/node_modules/undici-types/fetch.d.ts +0 -209
- data/node_modules/undici-types/file.d.ts +0 -39
- data/node_modules/undici-types/filereader.d.ts +0 -54
- data/node_modules/undici-types/formdata.d.ts +0 -108
- data/node_modules/undici-types/global-dispatcher.d.ts +0 -9
- data/node_modules/undici-types/global-origin.d.ts +0 -7
- data/node_modules/undici-types/handlers.d.ts +0 -15
- data/node_modules/undici-types/header.d.ts +0 -4
- data/node_modules/undici-types/index.d.ts +0 -71
- data/node_modules/undici-types/interceptors.d.ts +0 -15
- data/node_modules/undici-types/mock-agent.d.ts +0 -50
- data/node_modules/undici-types/mock-client.d.ts +0 -25
- data/node_modules/undici-types/mock-errors.d.ts +0 -12
- data/node_modules/undici-types/mock-interceptor.d.ts +0 -93
- data/node_modules/undici-types/mock-pool.d.ts +0 -25
- data/node_modules/undici-types/package.json +0 -55
- data/node_modules/undici-types/patch.d.ts +0 -71
- data/node_modules/undici-types/pool-stats.d.ts +0 -19
- data/node_modules/undici-types/pool.d.ts +0 -39
- data/node_modules/undici-types/proxy-agent.d.ts +0 -28
- data/node_modules/undici-types/readable.d.ts +0 -60
- data/node_modules/undici-types/retry-agent.d.ts +0 -8
- data/node_modules/undici-types/retry-handler.d.ts +0 -116
- data/node_modules/undici-types/util.d.ts +0 -18
- data/node_modules/undici-types/webidl.d.ts +0 -222
- data/node_modules/undici-types/websocket.d.ts +0 -152
- data/yarn.lock +0 -41
@@ -1,979 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.WhitespaceToken = exports.URLToken = exports.SuffixMatchToken = exports.SubstringMatchToken = exports.StringValuedToken = exports.StringToken = exports.SemicolonToken = exports.PrefixMatchToken = exports.PercentageToken = exports.OpenSquareToken = exports.OpenParenToken = exports.OpenCurlyToken = exports.NumberToken = exports.InvalidCharacterError = exports.IncludeMatchToken = exports.IdentToken = exports.HashToken = exports.GroupingToken = exports.FunctionToken = exports.EOFToken = exports.DimensionToken = exports.DelimToken = exports.DashMatchToken = exports.CommaToken = exports.ColumnToken = exports.ColonToken = exports.CloseSquareToken = exports.CloseParenToken = exports.CloseCurlyToken = exports.CSSParserToken = exports.CDOToken = exports.CDCToken = exports.BadURLToken = exports.BadStringToken = exports.AtKeywordToken = void 0;
|
7
|
-
exports.tokenize = tokenize;
|
8
|
-
/* eslint-disable notice/notice */
|
9
|
-
|
10
|
-
/*
|
11
|
-
* The code in this file is licensed under the CC0 license.
|
12
|
-
* http://creativecommons.org/publicdomain/zero/1.0/
|
13
|
-
* It is free to use for any purpose. No attribution, permission, or reproduction of this license is required.
|
14
|
-
*/
|
15
|
-
|
16
|
-
// Original at https://github.com/tabatkins/parse-css
|
17
|
-
// Changes:
|
18
|
-
// - JS is replaced with TS.
|
19
|
-
// - Universal Module Definition wrapper is removed.
|
20
|
-
// - Everything not related to tokenizing - below the first exports block - is removed.
|
21
|
-
|
22
|
-
const between = function (num, first, last) {
|
23
|
-
return num >= first && num <= last;
|
24
|
-
};
|
25
|
-
function digit(code) {
|
26
|
-
return between(code, 0x30, 0x39);
|
27
|
-
}
|
28
|
-
function hexdigit(code) {
|
29
|
-
return digit(code) || between(code, 0x41, 0x46) || between(code, 0x61, 0x66);
|
30
|
-
}
|
31
|
-
function uppercaseletter(code) {
|
32
|
-
return between(code, 0x41, 0x5a);
|
33
|
-
}
|
34
|
-
function lowercaseletter(code) {
|
35
|
-
return between(code, 0x61, 0x7a);
|
36
|
-
}
|
37
|
-
function letter(code) {
|
38
|
-
return uppercaseletter(code) || lowercaseletter(code);
|
39
|
-
}
|
40
|
-
function nonascii(code) {
|
41
|
-
return code >= 0x80;
|
42
|
-
}
|
43
|
-
function namestartchar(code) {
|
44
|
-
return letter(code) || nonascii(code) || code === 0x5f;
|
45
|
-
}
|
46
|
-
function namechar(code) {
|
47
|
-
return namestartchar(code) || digit(code) || code === 0x2d;
|
48
|
-
}
|
49
|
-
function nonprintable(code) {
|
50
|
-
return between(code, 0, 8) || code === 0xb || between(code, 0xe, 0x1f) || code === 0x7f;
|
51
|
-
}
|
52
|
-
function newline(code) {
|
53
|
-
return code === 0xa;
|
54
|
-
}
|
55
|
-
function whitespace(code) {
|
56
|
-
return newline(code) || code === 9 || code === 0x20;
|
57
|
-
}
|
58
|
-
const maximumallowedcodepoint = 0x10ffff;
|
59
|
-
class InvalidCharacterError extends Error {
|
60
|
-
constructor(message) {
|
61
|
-
super(message);
|
62
|
-
this.name = 'InvalidCharacterError';
|
63
|
-
}
|
64
|
-
}
|
65
|
-
exports.InvalidCharacterError = InvalidCharacterError;
|
66
|
-
function preprocess(str) {
|
67
|
-
// Turn a string into an array of code points,
|
68
|
-
// following the preprocessing cleanup rules.
|
69
|
-
const codepoints = [];
|
70
|
-
for (let i = 0; i < str.length; i++) {
|
71
|
-
let code = str.charCodeAt(i);
|
72
|
-
if (code === 0xd && str.charCodeAt(i + 1) === 0xa) {
|
73
|
-
code = 0xa;
|
74
|
-
i++;
|
75
|
-
}
|
76
|
-
if (code === 0xd || code === 0xc) code = 0xa;
|
77
|
-
if (code === 0x0) code = 0xfffd;
|
78
|
-
if (between(code, 0xd800, 0xdbff) && between(str.charCodeAt(i + 1), 0xdc00, 0xdfff)) {
|
79
|
-
// Decode a surrogate pair into an astral codepoint.
|
80
|
-
const lead = code - 0xd800;
|
81
|
-
const trail = str.charCodeAt(i + 1) - 0xdc00;
|
82
|
-
code = Math.pow(2, 16) + lead * Math.pow(2, 10) + trail;
|
83
|
-
i++;
|
84
|
-
}
|
85
|
-
codepoints.push(code);
|
86
|
-
}
|
87
|
-
return codepoints;
|
88
|
-
}
|
89
|
-
function stringFromCode(code) {
|
90
|
-
if (code <= 0xffff) return String.fromCharCode(code);
|
91
|
-
// Otherwise, encode astral char as surrogate pair.
|
92
|
-
code -= Math.pow(2, 16);
|
93
|
-
const lead = Math.floor(code / Math.pow(2, 10)) + 0xd800;
|
94
|
-
const trail = code % Math.pow(2, 10) + 0xdc00;
|
95
|
-
return String.fromCharCode(lead) + String.fromCharCode(trail);
|
96
|
-
}
|
97
|
-
function tokenize(str1) {
|
98
|
-
const str = preprocess(str1);
|
99
|
-
let i = -1;
|
100
|
-
const tokens = [];
|
101
|
-
let code;
|
102
|
-
|
103
|
-
// Line number information.
|
104
|
-
let line = 0;
|
105
|
-
let column = 0;
|
106
|
-
// The only use of lastLineLength is in reconsume().
|
107
|
-
let lastLineLength = 0;
|
108
|
-
const incrLineno = function () {
|
109
|
-
line += 1;
|
110
|
-
lastLineLength = column;
|
111
|
-
column = 0;
|
112
|
-
};
|
113
|
-
const locStart = {
|
114
|
-
line: line,
|
115
|
-
column: column
|
116
|
-
};
|
117
|
-
const codepoint = function (i) {
|
118
|
-
if (i >= str.length) return -1;
|
119
|
-
return str[i];
|
120
|
-
};
|
121
|
-
const next = function (num) {
|
122
|
-
if (num === undefined) num = 1;
|
123
|
-
if (num > 3) throw 'Spec Error: no more than three codepoints of lookahead.';
|
124
|
-
return codepoint(i + num);
|
125
|
-
};
|
126
|
-
const consume = function (num) {
|
127
|
-
if (num === undefined) num = 1;
|
128
|
-
i += num;
|
129
|
-
code = codepoint(i);
|
130
|
-
if (newline(code)) incrLineno();else column += num;
|
131
|
-
// console.log('Consume '+i+' '+String.fromCharCode(code) + ' 0x' + code.toString(16));
|
132
|
-
return true;
|
133
|
-
};
|
134
|
-
const reconsume = function () {
|
135
|
-
i -= 1;
|
136
|
-
if (newline(code)) {
|
137
|
-
line -= 1;
|
138
|
-
column = lastLineLength;
|
139
|
-
} else {
|
140
|
-
column -= 1;
|
141
|
-
}
|
142
|
-
locStart.line = line;
|
143
|
-
locStart.column = column;
|
144
|
-
return true;
|
145
|
-
};
|
146
|
-
const eof = function (codepoint) {
|
147
|
-
if (codepoint === undefined) codepoint = code;
|
148
|
-
return codepoint === -1;
|
149
|
-
};
|
150
|
-
const donothing = function () {};
|
151
|
-
const parseerror = function () {
|
152
|
-
// Language bindings don't like writing to stdout!
|
153
|
-
// console.log('Parse error at index ' + i + ', processing codepoint 0x' + code.toString(16) + '.'); return true;
|
154
|
-
};
|
155
|
-
const consumeAToken = function () {
|
156
|
-
consumeComments();
|
157
|
-
consume();
|
158
|
-
if (whitespace(code)) {
|
159
|
-
while (whitespace(next())) consume();
|
160
|
-
return new WhitespaceToken();
|
161
|
-
} else if (code === 0x22) {
|
162
|
-
return consumeAStringToken();
|
163
|
-
} else if (code === 0x23) {
|
164
|
-
if (namechar(next()) || areAValidEscape(next(1), next(2))) {
|
165
|
-
const token = new HashToken('');
|
166
|
-
if (wouldStartAnIdentifier(next(1), next(2), next(3))) token.type = 'id';
|
167
|
-
token.value = consumeAName();
|
168
|
-
return token;
|
169
|
-
} else {
|
170
|
-
return new DelimToken(code);
|
171
|
-
}
|
172
|
-
} else if (code === 0x24) {
|
173
|
-
if (next() === 0x3d) {
|
174
|
-
consume();
|
175
|
-
return new SuffixMatchToken();
|
176
|
-
} else {
|
177
|
-
return new DelimToken(code);
|
178
|
-
}
|
179
|
-
} else if (code === 0x27) {
|
180
|
-
return consumeAStringToken();
|
181
|
-
} else if (code === 0x28) {
|
182
|
-
return new OpenParenToken();
|
183
|
-
} else if (code === 0x29) {
|
184
|
-
return new CloseParenToken();
|
185
|
-
} else if (code === 0x2a) {
|
186
|
-
if (next() === 0x3d) {
|
187
|
-
consume();
|
188
|
-
return new SubstringMatchToken();
|
189
|
-
} else {
|
190
|
-
return new DelimToken(code);
|
191
|
-
}
|
192
|
-
} else if (code === 0x2b) {
|
193
|
-
if (startsWithANumber()) {
|
194
|
-
reconsume();
|
195
|
-
return consumeANumericToken();
|
196
|
-
} else {
|
197
|
-
return new DelimToken(code);
|
198
|
-
}
|
199
|
-
} else if (code === 0x2c) {
|
200
|
-
return new CommaToken();
|
201
|
-
} else if (code === 0x2d) {
|
202
|
-
if (startsWithANumber()) {
|
203
|
-
reconsume();
|
204
|
-
return consumeANumericToken();
|
205
|
-
} else if (next(1) === 0x2d && next(2) === 0x3e) {
|
206
|
-
consume(2);
|
207
|
-
return new CDCToken();
|
208
|
-
} else if (startsWithAnIdentifier()) {
|
209
|
-
reconsume();
|
210
|
-
return consumeAnIdentlikeToken();
|
211
|
-
} else {
|
212
|
-
return new DelimToken(code);
|
213
|
-
}
|
214
|
-
} else if (code === 0x2e) {
|
215
|
-
if (startsWithANumber()) {
|
216
|
-
reconsume();
|
217
|
-
return consumeANumericToken();
|
218
|
-
} else {
|
219
|
-
return new DelimToken(code);
|
220
|
-
}
|
221
|
-
} else if (code === 0x3a) {
|
222
|
-
return new ColonToken();
|
223
|
-
} else if (code === 0x3b) {
|
224
|
-
return new SemicolonToken();
|
225
|
-
} else if (code === 0x3c) {
|
226
|
-
if (next(1) === 0x21 && next(2) === 0x2d && next(3) === 0x2d) {
|
227
|
-
consume(3);
|
228
|
-
return new CDOToken();
|
229
|
-
} else {
|
230
|
-
return new DelimToken(code);
|
231
|
-
}
|
232
|
-
} else if (code === 0x40) {
|
233
|
-
if (wouldStartAnIdentifier(next(1), next(2), next(3))) return new AtKeywordToken(consumeAName());else return new DelimToken(code);
|
234
|
-
} else if (code === 0x5b) {
|
235
|
-
return new OpenSquareToken();
|
236
|
-
} else if (code === 0x5c) {
|
237
|
-
if (startsWithAValidEscape()) {
|
238
|
-
reconsume();
|
239
|
-
return consumeAnIdentlikeToken();
|
240
|
-
} else {
|
241
|
-
parseerror();
|
242
|
-
return new DelimToken(code);
|
243
|
-
}
|
244
|
-
} else if (code === 0x5d) {
|
245
|
-
return new CloseSquareToken();
|
246
|
-
} else if (code === 0x5e) {
|
247
|
-
if (next() === 0x3d) {
|
248
|
-
consume();
|
249
|
-
return new PrefixMatchToken();
|
250
|
-
} else {
|
251
|
-
return new DelimToken(code);
|
252
|
-
}
|
253
|
-
} else if (code === 0x7b) {
|
254
|
-
return new OpenCurlyToken();
|
255
|
-
} else if (code === 0x7c) {
|
256
|
-
if (next() === 0x3d) {
|
257
|
-
consume();
|
258
|
-
return new DashMatchToken();
|
259
|
-
} else if (next() === 0x7c) {
|
260
|
-
consume();
|
261
|
-
return new ColumnToken();
|
262
|
-
} else {
|
263
|
-
return new DelimToken(code);
|
264
|
-
}
|
265
|
-
} else if (code === 0x7d) {
|
266
|
-
return new CloseCurlyToken();
|
267
|
-
} else if (code === 0x7e) {
|
268
|
-
if (next() === 0x3d) {
|
269
|
-
consume();
|
270
|
-
return new IncludeMatchToken();
|
271
|
-
} else {
|
272
|
-
return new DelimToken(code);
|
273
|
-
}
|
274
|
-
} else if (digit(code)) {
|
275
|
-
reconsume();
|
276
|
-
return consumeANumericToken();
|
277
|
-
} else if (namestartchar(code)) {
|
278
|
-
reconsume();
|
279
|
-
return consumeAnIdentlikeToken();
|
280
|
-
} else if (eof()) {
|
281
|
-
return new EOFToken();
|
282
|
-
} else {
|
283
|
-
return new DelimToken(code);
|
284
|
-
}
|
285
|
-
};
|
286
|
-
const consumeComments = function () {
|
287
|
-
while (next(1) === 0x2f && next(2) === 0x2a) {
|
288
|
-
consume(2);
|
289
|
-
while (true) {
|
290
|
-
consume();
|
291
|
-
if (code === 0x2a && next() === 0x2f) {
|
292
|
-
consume();
|
293
|
-
break;
|
294
|
-
} else if (eof()) {
|
295
|
-
parseerror();
|
296
|
-
return;
|
297
|
-
}
|
298
|
-
}
|
299
|
-
}
|
300
|
-
};
|
301
|
-
const consumeANumericToken = function () {
|
302
|
-
const num = consumeANumber();
|
303
|
-
if (wouldStartAnIdentifier(next(1), next(2), next(3))) {
|
304
|
-
const token = new DimensionToken();
|
305
|
-
token.value = num.value;
|
306
|
-
token.repr = num.repr;
|
307
|
-
token.type = num.type;
|
308
|
-
token.unit = consumeAName();
|
309
|
-
return token;
|
310
|
-
} else if (next() === 0x25) {
|
311
|
-
consume();
|
312
|
-
const token = new PercentageToken();
|
313
|
-
token.value = num.value;
|
314
|
-
token.repr = num.repr;
|
315
|
-
return token;
|
316
|
-
} else {
|
317
|
-
const token = new NumberToken();
|
318
|
-
token.value = num.value;
|
319
|
-
token.repr = num.repr;
|
320
|
-
token.type = num.type;
|
321
|
-
return token;
|
322
|
-
}
|
323
|
-
};
|
324
|
-
const consumeAnIdentlikeToken = function () {
|
325
|
-
const str = consumeAName();
|
326
|
-
if (str.toLowerCase() === 'url' && next() === 0x28) {
|
327
|
-
consume();
|
328
|
-
while (whitespace(next(1)) && whitespace(next(2))) consume();
|
329
|
-
if (next() === 0x22 || next() === 0x27) return new FunctionToken(str);else if (whitespace(next()) && (next(2) === 0x22 || next(2) === 0x27)) return new FunctionToken(str);else return consumeAURLToken();
|
330
|
-
} else if (next() === 0x28) {
|
331
|
-
consume();
|
332
|
-
return new FunctionToken(str);
|
333
|
-
} else {
|
334
|
-
return new IdentToken(str);
|
335
|
-
}
|
336
|
-
};
|
337
|
-
const consumeAStringToken = function (endingCodePoint) {
|
338
|
-
if (endingCodePoint === undefined) endingCodePoint = code;
|
339
|
-
let string = '';
|
340
|
-
while (consume()) {
|
341
|
-
if (code === endingCodePoint || eof()) {
|
342
|
-
return new StringToken(string);
|
343
|
-
} else if (newline(code)) {
|
344
|
-
parseerror();
|
345
|
-
reconsume();
|
346
|
-
return new BadStringToken();
|
347
|
-
} else if (code === 0x5c) {
|
348
|
-
if (eof(next())) donothing();else if (newline(next())) consume();else string += stringFromCode(consumeEscape());
|
349
|
-
} else {
|
350
|
-
string += stringFromCode(code);
|
351
|
-
}
|
352
|
-
}
|
353
|
-
throw new Error('Internal error');
|
354
|
-
};
|
355
|
-
const consumeAURLToken = function () {
|
356
|
-
const token = new URLToken('');
|
357
|
-
while (whitespace(next())) consume();
|
358
|
-
if (eof(next())) return token;
|
359
|
-
while (consume()) {
|
360
|
-
if (code === 0x29 || eof()) {
|
361
|
-
return token;
|
362
|
-
} else if (whitespace(code)) {
|
363
|
-
while (whitespace(next())) consume();
|
364
|
-
if (next() === 0x29 || eof(next())) {
|
365
|
-
consume();
|
366
|
-
return token;
|
367
|
-
} else {
|
368
|
-
consumeTheRemnantsOfABadURL();
|
369
|
-
return new BadURLToken();
|
370
|
-
}
|
371
|
-
} else if (code === 0x22 || code === 0x27 || code === 0x28 || nonprintable(code)) {
|
372
|
-
parseerror();
|
373
|
-
consumeTheRemnantsOfABadURL();
|
374
|
-
return new BadURLToken();
|
375
|
-
} else if (code === 0x5c) {
|
376
|
-
if (startsWithAValidEscape()) {
|
377
|
-
token.value += stringFromCode(consumeEscape());
|
378
|
-
} else {
|
379
|
-
parseerror();
|
380
|
-
consumeTheRemnantsOfABadURL();
|
381
|
-
return new BadURLToken();
|
382
|
-
}
|
383
|
-
} else {
|
384
|
-
token.value += stringFromCode(code);
|
385
|
-
}
|
386
|
-
}
|
387
|
-
throw new Error('Internal error');
|
388
|
-
};
|
389
|
-
const consumeEscape = function () {
|
390
|
-
// Assume the current character is the \
|
391
|
-
// and the next code point is not a newline.
|
392
|
-
consume();
|
393
|
-
if (hexdigit(code)) {
|
394
|
-
// Consume 1-6 hex digits
|
395
|
-
const digits = [code];
|
396
|
-
for (let total = 0; total < 5; total++) {
|
397
|
-
if (hexdigit(next())) {
|
398
|
-
consume();
|
399
|
-
digits.push(code);
|
400
|
-
} else {
|
401
|
-
break;
|
402
|
-
}
|
403
|
-
}
|
404
|
-
if (whitespace(next())) consume();
|
405
|
-
let value = parseInt(digits.map(function (x) {
|
406
|
-
return String.fromCharCode(x);
|
407
|
-
}).join(''), 16);
|
408
|
-
if (value > maximumallowedcodepoint) value = 0xfffd;
|
409
|
-
return value;
|
410
|
-
} else if (eof()) {
|
411
|
-
return 0xfffd;
|
412
|
-
} else {
|
413
|
-
return code;
|
414
|
-
}
|
415
|
-
};
|
416
|
-
const areAValidEscape = function (c1, c2) {
|
417
|
-
if (c1 !== 0x5c) return false;
|
418
|
-
if (newline(c2)) return false;
|
419
|
-
return true;
|
420
|
-
};
|
421
|
-
const startsWithAValidEscape = function () {
|
422
|
-
return areAValidEscape(code, next());
|
423
|
-
};
|
424
|
-
const wouldStartAnIdentifier = function (c1, c2, c3) {
|
425
|
-
if (c1 === 0x2d) return namestartchar(c2) || c2 === 0x2d || areAValidEscape(c2, c3);else if (namestartchar(c1)) return true;else if (c1 === 0x5c) return areAValidEscape(c1, c2);else return false;
|
426
|
-
};
|
427
|
-
const startsWithAnIdentifier = function () {
|
428
|
-
return wouldStartAnIdentifier(code, next(1), next(2));
|
429
|
-
};
|
430
|
-
const wouldStartANumber = function (c1, c2, c3) {
|
431
|
-
if (c1 === 0x2b || c1 === 0x2d) {
|
432
|
-
if (digit(c2)) return true;
|
433
|
-
if (c2 === 0x2e && digit(c3)) return true;
|
434
|
-
return false;
|
435
|
-
} else if (c1 === 0x2e) {
|
436
|
-
if (digit(c2)) return true;
|
437
|
-
return false;
|
438
|
-
} else if (digit(c1)) {
|
439
|
-
return true;
|
440
|
-
} else {
|
441
|
-
return false;
|
442
|
-
}
|
443
|
-
};
|
444
|
-
const startsWithANumber = function () {
|
445
|
-
return wouldStartANumber(code, next(1), next(2));
|
446
|
-
};
|
447
|
-
const consumeAName = function () {
|
448
|
-
let result = '';
|
449
|
-
while (consume()) {
|
450
|
-
if (namechar(code)) {
|
451
|
-
result += stringFromCode(code);
|
452
|
-
} else if (startsWithAValidEscape()) {
|
453
|
-
result += stringFromCode(consumeEscape());
|
454
|
-
} else {
|
455
|
-
reconsume();
|
456
|
-
return result;
|
457
|
-
}
|
458
|
-
}
|
459
|
-
throw new Error('Internal parse error');
|
460
|
-
};
|
461
|
-
const consumeANumber = function () {
|
462
|
-
let repr = '';
|
463
|
-
let type = 'integer';
|
464
|
-
if (next() === 0x2b || next() === 0x2d) {
|
465
|
-
consume();
|
466
|
-
repr += stringFromCode(code);
|
467
|
-
}
|
468
|
-
while (digit(next())) {
|
469
|
-
consume();
|
470
|
-
repr += stringFromCode(code);
|
471
|
-
}
|
472
|
-
if (next(1) === 0x2e && digit(next(2))) {
|
473
|
-
consume();
|
474
|
-
repr += stringFromCode(code);
|
475
|
-
consume();
|
476
|
-
repr += stringFromCode(code);
|
477
|
-
type = 'number';
|
478
|
-
while (digit(next())) {
|
479
|
-
consume();
|
480
|
-
repr += stringFromCode(code);
|
481
|
-
}
|
482
|
-
}
|
483
|
-
const c1 = next(1),
|
484
|
-
c2 = next(2),
|
485
|
-
c3 = next(3);
|
486
|
-
if ((c1 === 0x45 || c1 === 0x65) && digit(c2)) {
|
487
|
-
consume();
|
488
|
-
repr += stringFromCode(code);
|
489
|
-
consume();
|
490
|
-
repr += stringFromCode(code);
|
491
|
-
type = 'number';
|
492
|
-
while (digit(next())) {
|
493
|
-
consume();
|
494
|
-
repr += stringFromCode(code);
|
495
|
-
}
|
496
|
-
} else if ((c1 === 0x45 || c1 === 0x65) && (c2 === 0x2b || c2 === 0x2d) && digit(c3)) {
|
497
|
-
consume();
|
498
|
-
repr += stringFromCode(code);
|
499
|
-
consume();
|
500
|
-
repr += stringFromCode(code);
|
501
|
-
consume();
|
502
|
-
repr += stringFromCode(code);
|
503
|
-
type = 'number';
|
504
|
-
while (digit(next())) {
|
505
|
-
consume();
|
506
|
-
repr += stringFromCode(code);
|
507
|
-
}
|
508
|
-
}
|
509
|
-
const value = convertAStringToANumber(repr);
|
510
|
-
return {
|
511
|
-
type: type,
|
512
|
-
value: value,
|
513
|
-
repr: repr
|
514
|
-
};
|
515
|
-
};
|
516
|
-
const convertAStringToANumber = function (string) {
|
517
|
-
// CSS's number rules are identical to JS, afaik.
|
518
|
-
return +string;
|
519
|
-
};
|
520
|
-
const consumeTheRemnantsOfABadURL = function () {
|
521
|
-
while (consume()) {
|
522
|
-
if (code === 0x29 || eof()) {
|
523
|
-
return;
|
524
|
-
} else if (startsWithAValidEscape()) {
|
525
|
-
consumeEscape();
|
526
|
-
donothing();
|
527
|
-
} else {
|
528
|
-
donothing();
|
529
|
-
}
|
530
|
-
}
|
531
|
-
};
|
532
|
-
let iterationCount = 0;
|
533
|
-
while (!eof(next())) {
|
534
|
-
tokens.push(consumeAToken());
|
535
|
-
iterationCount++;
|
536
|
-
if (iterationCount > str.length * 2) throw new Error("I'm infinite-looping!");
|
537
|
-
}
|
538
|
-
return tokens;
|
539
|
-
}
|
540
|
-
class CSSParserToken {
|
541
|
-
constructor() {
|
542
|
-
this.tokenType = '';
|
543
|
-
this.value = void 0;
|
544
|
-
}
|
545
|
-
toJSON() {
|
546
|
-
return {
|
547
|
-
token: this.tokenType
|
548
|
-
};
|
549
|
-
}
|
550
|
-
toString() {
|
551
|
-
return this.tokenType;
|
552
|
-
}
|
553
|
-
toSource() {
|
554
|
-
return '' + this;
|
555
|
-
}
|
556
|
-
}
|
557
|
-
exports.CSSParserToken = CSSParserToken;
|
558
|
-
class BadStringToken extends CSSParserToken {
|
559
|
-
constructor(...args) {
|
560
|
-
super(...args);
|
561
|
-
this.tokenType = 'BADSTRING';
|
562
|
-
}
|
563
|
-
}
|
564
|
-
exports.BadStringToken = BadStringToken;
|
565
|
-
class BadURLToken extends CSSParserToken {
|
566
|
-
constructor(...args) {
|
567
|
-
super(...args);
|
568
|
-
this.tokenType = 'BADURL';
|
569
|
-
}
|
570
|
-
}
|
571
|
-
exports.BadURLToken = BadURLToken;
|
572
|
-
class WhitespaceToken extends CSSParserToken {
|
573
|
-
constructor(...args) {
|
574
|
-
super(...args);
|
575
|
-
this.tokenType = 'WHITESPACE';
|
576
|
-
}
|
577
|
-
toString() {
|
578
|
-
return 'WS';
|
579
|
-
}
|
580
|
-
toSource() {
|
581
|
-
return ' ';
|
582
|
-
}
|
583
|
-
}
|
584
|
-
exports.WhitespaceToken = WhitespaceToken;
|
585
|
-
class CDOToken extends CSSParserToken {
|
586
|
-
constructor(...args) {
|
587
|
-
super(...args);
|
588
|
-
this.tokenType = 'CDO';
|
589
|
-
}
|
590
|
-
toSource() {
|
591
|
-
return '<!--';
|
592
|
-
}
|
593
|
-
}
|
594
|
-
exports.CDOToken = CDOToken;
|
595
|
-
class CDCToken extends CSSParserToken {
|
596
|
-
constructor(...args) {
|
597
|
-
super(...args);
|
598
|
-
this.tokenType = 'CDC';
|
599
|
-
}
|
600
|
-
toSource() {
|
601
|
-
return '-->';
|
602
|
-
}
|
603
|
-
}
|
604
|
-
exports.CDCToken = CDCToken;
|
605
|
-
class ColonToken extends CSSParserToken {
|
606
|
-
constructor(...args) {
|
607
|
-
super(...args);
|
608
|
-
this.tokenType = ':';
|
609
|
-
}
|
610
|
-
}
|
611
|
-
exports.ColonToken = ColonToken;
|
612
|
-
class SemicolonToken extends CSSParserToken {
|
613
|
-
constructor(...args) {
|
614
|
-
super(...args);
|
615
|
-
this.tokenType = ';';
|
616
|
-
}
|
617
|
-
}
|
618
|
-
exports.SemicolonToken = SemicolonToken;
|
619
|
-
class CommaToken extends CSSParserToken {
|
620
|
-
constructor(...args) {
|
621
|
-
super(...args);
|
622
|
-
this.tokenType = ',';
|
623
|
-
}
|
624
|
-
}
|
625
|
-
exports.CommaToken = CommaToken;
|
626
|
-
class GroupingToken extends CSSParserToken {
|
627
|
-
constructor(...args) {
|
628
|
-
super(...args);
|
629
|
-
this.value = '';
|
630
|
-
this.mirror = '';
|
631
|
-
}
|
632
|
-
}
|
633
|
-
exports.GroupingToken = GroupingToken;
|
634
|
-
class OpenCurlyToken extends GroupingToken {
|
635
|
-
constructor() {
|
636
|
-
super();
|
637
|
-
this.tokenType = '{';
|
638
|
-
this.value = '{';
|
639
|
-
this.mirror = '}';
|
640
|
-
}
|
641
|
-
}
|
642
|
-
exports.OpenCurlyToken = OpenCurlyToken;
|
643
|
-
class CloseCurlyToken extends GroupingToken {
|
644
|
-
constructor() {
|
645
|
-
super();
|
646
|
-
this.tokenType = '}';
|
647
|
-
this.value = '}';
|
648
|
-
this.mirror = '{';
|
649
|
-
}
|
650
|
-
}
|
651
|
-
exports.CloseCurlyToken = CloseCurlyToken;
|
652
|
-
class OpenSquareToken extends GroupingToken {
|
653
|
-
constructor() {
|
654
|
-
super();
|
655
|
-
this.tokenType = '[';
|
656
|
-
this.value = '[';
|
657
|
-
this.mirror = ']';
|
658
|
-
}
|
659
|
-
}
|
660
|
-
exports.OpenSquareToken = OpenSquareToken;
|
661
|
-
class CloseSquareToken extends GroupingToken {
|
662
|
-
constructor() {
|
663
|
-
super();
|
664
|
-
this.tokenType = ']';
|
665
|
-
this.value = ']';
|
666
|
-
this.mirror = '[';
|
667
|
-
}
|
668
|
-
}
|
669
|
-
exports.CloseSquareToken = CloseSquareToken;
|
670
|
-
class OpenParenToken extends GroupingToken {
|
671
|
-
constructor() {
|
672
|
-
super();
|
673
|
-
this.tokenType = '(';
|
674
|
-
this.value = '(';
|
675
|
-
this.mirror = ')';
|
676
|
-
}
|
677
|
-
}
|
678
|
-
exports.OpenParenToken = OpenParenToken;
|
679
|
-
class CloseParenToken extends GroupingToken {
|
680
|
-
constructor() {
|
681
|
-
super();
|
682
|
-
this.tokenType = ')';
|
683
|
-
this.value = ')';
|
684
|
-
this.mirror = '(';
|
685
|
-
}
|
686
|
-
}
|
687
|
-
exports.CloseParenToken = CloseParenToken;
|
688
|
-
class IncludeMatchToken extends CSSParserToken {
|
689
|
-
constructor(...args) {
|
690
|
-
super(...args);
|
691
|
-
this.tokenType = '~=';
|
692
|
-
}
|
693
|
-
}
|
694
|
-
exports.IncludeMatchToken = IncludeMatchToken;
|
695
|
-
class DashMatchToken extends CSSParserToken {
|
696
|
-
constructor(...args) {
|
697
|
-
super(...args);
|
698
|
-
this.tokenType = '|=';
|
699
|
-
}
|
700
|
-
}
|
701
|
-
exports.DashMatchToken = DashMatchToken;
|
702
|
-
class PrefixMatchToken extends CSSParserToken {
|
703
|
-
constructor(...args) {
|
704
|
-
super(...args);
|
705
|
-
this.tokenType = '^=';
|
706
|
-
}
|
707
|
-
}
|
708
|
-
exports.PrefixMatchToken = PrefixMatchToken;
|
709
|
-
class SuffixMatchToken extends CSSParserToken {
|
710
|
-
constructor(...args) {
|
711
|
-
super(...args);
|
712
|
-
this.tokenType = '$=';
|
713
|
-
}
|
714
|
-
}
|
715
|
-
exports.SuffixMatchToken = SuffixMatchToken;
|
716
|
-
class SubstringMatchToken extends CSSParserToken {
|
717
|
-
constructor(...args) {
|
718
|
-
super(...args);
|
719
|
-
this.tokenType = '*=';
|
720
|
-
}
|
721
|
-
}
|
722
|
-
exports.SubstringMatchToken = SubstringMatchToken;
|
723
|
-
class ColumnToken extends CSSParserToken {
|
724
|
-
constructor(...args) {
|
725
|
-
super(...args);
|
726
|
-
this.tokenType = '||';
|
727
|
-
}
|
728
|
-
}
|
729
|
-
exports.ColumnToken = ColumnToken;
|
730
|
-
class EOFToken extends CSSParserToken {
|
731
|
-
constructor(...args) {
|
732
|
-
super(...args);
|
733
|
-
this.tokenType = 'EOF';
|
734
|
-
}
|
735
|
-
toSource() {
|
736
|
-
return '';
|
737
|
-
}
|
738
|
-
}
|
739
|
-
exports.EOFToken = EOFToken;
|
740
|
-
class DelimToken extends CSSParserToken {
|
741
|
-
constructor(code) {
|
742
|
-
super();
|
743
|
-
this.tokenType = 'DELIM';
|
744
|
-
this.value = '';
|
745
|
-
this.value = stringFromCode(code);
|
746
|
-
}
|
747
|
-
toString() {
|
748
|
-
return 'DELIM(' + this.value + ')';
|
749
|
-
}
|
750
|
-
toJSON() {
|
751
|
-
const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
|
752
|
-
json.value = this.value;
|
753
|
-
return json;
|
754
|
-
}
|
755
|
-
toSource() {
|
756
|
-
if (this.value === '\\') return '\\\n';else return this.value;
|
757
|
-
}
|
758
|
-
}
|
759
|
-
exports.DelimToken = DelimToken;
|
760
|
-
class StringValuedToken extends CSSParserToken {
|
761
|
-
constructor(...args) {
|
762
|
-
super(...args);
|
763
|
-
this.value = '';
|
764
|
-
}
|
765
|
-
ASCIIMatch(str) {
|
766
|
-
return this.value.toLowerCase() === str.toLowerCase();
|
767
|
-
}
|
768
|
-
toJSON() {
|
769
|
-
const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
|
770
|
-
json.value = this.value;
|
771
|
-
return json;
|
772
|
-
}
|
773
|
-
}
|
774
|
-
exports.StringValuedToken = StringValuedToken;
|
775
|
-
class IdentToken extends StringValuedToken {
|
776
|
-
constructor(val) {
|
777
|
-
super();
|
778
|
-
this.tokenType = 'IDENT';
|
779
|
-
this.value = val;
|
780
|
-
}
|
781
|
-
toString() {
|
782
|
-
return 'IDENT(' + this.value + ')';
|
783
|
-
}
|
784
|
-
toSource() {
|
785
|
-
return escapeIdent(this.value);
|
786
|
-
}
|
787
|
-
}
|
788
|
-
exports.IdentToken = IdentToken;
|
789
|
-
class FunctionToken extends StringValuedToken {
|
790
|
-
constructor(val) {
|
791
|
-
super();
|
792
|
-
this.tokenType = 'FUNCTION';
|
793
|
-
this.mirror = void 0;
|
794
|
-
this.value = val;
|
795
|
-
this.mirror = ')';
|
796
|
-
}
|
797
|
-
toString() {
|
798
|
-
return 'FUNCTION(' + this.value + ')';
|
799
|
-
}
|
800
|
-
toSource() {
|
801
|
-
return escapeIdent(this.value) + '(';
|
802
|
-
}
|
803
|
-
}
|
804
|
-
exports.FunctionToken = FunctionToken;
|
805
|
-
class AtKeywordToken extends StringValuedToken {
|
806
|
-
constructor(val) {
|
807
|
-
super();
|
808
|
-
this.tokenType = 'AT-KEYWORD';
|
809
|
-
this.value = val;
|
810
|
-
}
|
811
|
-
toString() {
|
812
|
-
return 'AT(' + this.value + ')';
|
813
|
-
}
|
814
|
-
toSource() {
|
815
|
-
return '@' + escapeIdent(this.value);
|
816
|
-
}
|
817
|
-
}
|
818
|
-
exports.AtKeywordToken = AtKeywordToken;
|
819
|
-
class HashToken extends StringValuedToken {
|
820
|
-
constructor(val) {
|
821
|
-
super();
|
822
|
-
this.tokenType = 'HASH';
|
823
|
-
this.type = void 0;
|
824
|
-
this.value = val;
|
825
|
-
this.type = 'unrestricted';
|
826
|
-
}
|
827
|
-
toString() {
|
828
|
-
return 'HASH(' + this.value + ')';
|
829
|
-
}
|
830
|
-
toJSON() {
|
831
|
-
const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
|
832
|
-
json.value = this.value;
|
833
|
-
json.type = this.type;
|
834
|
-
return json;
|
835
|
-
}
|
836
|
-
toSource() {
|
837
|
-
if (this.type === 'id') return '#' + escapeIdent(this.value);else return '#' + escapeHash(this.value);
|
838
|
-
}
|
839
|
-
}
|
840
|
-
exports.HashToken = HashToken;
|
841
|
-
class StringToken extends StringValuedToken {
|
842
|
-
constructor(val) {
|
843
|
-
super();
|
844
|
-
this.tokenType = 'STRING';
|
845
|
-
this.value = val;
|
846
|
-
}
|
847
|
-
toString() {
|
848
|
-
return '"' + escapeString(this.value) + '"';
|
849
|
-
}
|
850
|
-
}
|
851
|
-
exports.StringToken = StringToken;
|
852
|
-
class URLToken extends StringValuedToken {
|
853
|
-
constructor(val) {
|
854
|
-
super();
|
855
|
-
this.tokenType = 'URL';
|
856
|
-
this.value = val;
|
857
|
-
}
|
858
|
-
toString() {
|
859
|
-
return 'URL(' + this.value + ')';
|
860
|
-
}
|
861
|
-
toSource() {
|
862
|
-
return 'url("' + escapeString(this.value) + '")';
|
863
|
-
}
|
864
|
-
}
|
865
|
-
exports.URLToken = URLToken;
|
866
|
-
class NumberToken extends CSSParserToken {
|
867
|
-
constructor() {
|
868
|
-
super();
|
869
|
-
this.tokenType = 'NUMBER';
|
870
|
-
this.type = void 0;
|
871
|
-
this.repr = void 0;
|
872
|
-
this.type = 'integer';
|
873
|
-
this.repr = '';
|
874
|
-
}
|
875
|
-
toString() {
|
876
|
-
if (this.type === 'integer') return 'INT(' + this.value + ')';
|
877
|
-
return 'NUMBER(' + this.value + ')';
|
878
|
-
}
|
879
|
-
toJSON() {
|
880
|
-
const json = super.toJSON();
|
881
|
-
json.value = this.value;
|
882
|
-
json.type = this.type;
|
883
|
-
json.repr = this.repr;
|
884
|
-
return json;
|
885
|
-
}
|
886
|
-
toSource() {
|
887
|
-
return this.repr;
|
888
|
-
}
|
889
|
-
}
|
890
|
-
exports.NumberToken = NumberToken;
|
891
|
-
class PercentageToken extends CSSParserToken {
|
892
|
-
constructor() {
|
893
|
-
super();
|
894
|
-
this.tokenType = 'PERCENTAGE';
|
895
|
-
this.repr = void 0;
|
896
|
-
this.repr = '';
|
897
|
-
}
|
898
|
-
toString() {
|
899
|
-
return 'PERCENTAGE(' + this.value + ')';
|
900
|
-
}
|
901
|
-
toJSON() {
|
902
|
-
const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
|
903
|
-
json.value = this.value;
|
904
|
-
json.repr = this.repr;
|
905
|
-
return json;
|
906
|
-
}
|
907
|
-
toSource() {
|
908
|
-
return this.repr + '%';
|
909
|
-
}
|
910
|
-
}
|
911
|
-
exports.PercentageToken = PercentageToken;
|
912
|
-
class DimensionToken extends CSSParserToken {
|
913
|
-
constructor() {
|
914
|
-
super();
|
915
|
-
this.tokenType = 'DIMENSION';
|
916
|
-
this.type = void 0;
|
917
|
-
this.repr = void 0;
|
918
|
-
this.unit = void 0;
|
919
|
-
this.type = 'integer';
|
920
|
-
this.repr = '';
|
921
|
-
this.unit = '';
|
922
|
-
}
|
923
|
-
toString() {
|
924
|
-
return 'DIM(' + this.value + ',' + this.unit + ')';
|
925
|
-
}
|
926
|
-
toJSON() {
|
927
|
-
const json = this.constructor.prototype.constructor.prototype.toJSON.call(this);
|
928
|
-
json.value = this.value;
|
929
|
-
json.type = this.type;
|
930
|
-
json.repr = this.repr;
|
931
|
-
json.unit = this.unit;
|
932
|
-
return json;
|
933
|
-
}
|
934
|
-
toSource() {
|
935
|
-
const source = this.repr;
|
936
|
-
let unit = escapeIdent(this.unit);
|
937
|
-
if (unit[0].toLowerCase() === 'e' && (unit[1] === '-' || between(unit.charCodeAt(1), 0x30, 0x39))) {
|
938
|
-
// Unit is ambiguous with scinot
|
939
|
-
// Remove the leading "e", replace with escape.
|
940
|
-
unit = '\\65 ' + unit.slice(1, unit.length);
|
941
|
-
}
|
942
|
-
return source + unit;
|
943
|
-
}
|
944
|
-
}
|
945
|
-
exports.DimensionToken = DimensionToken;
|
946
|
-
function escapeIdent(string) {
|
947
|
-
string = '' + string;
|
948
|
-
let result = '';
|
949
|
-
const firstcode = string.charCodeAt(0);
|
950
|
-
for (let i = 0; i < string.length; i++) {
|
951
|
-
const code = string.charCodeAt(i);
|
952
|
-
if (code === 0x0) throw new InvalidCharacterError('Invalid character: the input contains U+0000.');
|
953
|
-
if (between(code, 0x1, 0x1f) || code === 0x7f || i === 0 && between(code, 0x30, 0x39) || i === 1 && between(code, 0x30, 0x39) && firstcode === 0x2d) result += '\\' + code.toString(16) + ' ';else if (code >= 0x80 || code === 0x2d || code === 0x5f || between(code, 0x30, 0x39) || between(code, 0x41, 0x5a) || between(code, 0x61, 0x7a)) result += string[i];else result += '\\' + string[i];
|
954
|
-
}
|
955
|
-
return result;
|
956
|
-
}
|
957
|
-
function escapeHash(string) {
|
958
|
-
// Escapes the contents of "unrestricted"-type hash tokens.
|
959
|
-
// Won't preserve the ID-ness of "id"-type hash tokens;
|
960
|
-
// use escapeIdent() for that.
|
961
|
-
string = '' + string;
|
962
|
-
let result = '';
|
963
|
-
for (let i = 0; i < string.length; i++) {
|
964
|
-
const code = string.charCodeAt(i);
|
965
|
-
if (code === 0x0) throw new InvalidCharacterError('Invalid character: the input contains U+0000.');
|
966
|
-
if (code >= 0x80 || code === 0x2d || code === 0x5f || between(code, 0x30, 0x39) || between(code, 0x41, 0x5a) || between(code, 0x61, 0x7a)) result += string[i];else result += '\\' + code.toString(16) + ' ';
|
967
|
-
}
|
968
|
-
return result;
|
969
|
-
}
|
970
|
-
function escapeString(string) {
|
971
|
-
string = '' + string;
|
972
|
-
let result = '';
|
973
|
-
for (let i = 0; i < string.length; i++) {
|
974
|
-
const code = string.charCodeAt(i);
|
975
|
-
if (code === 0x0) throw new InvalidCharacterError('Invalid character: the input contains U+0000.');
|
976
|
-
if (between(code, 0x1, 0x1f) || code === 0x7f) result += '\\' + code.toString(16) + ' ';else if (code === 0x22 || code === 0x5c) result += '\\' + string[i];else result += string[i];
|
977
|
-
}
|
978
|
-
return result;
|
979
|
-
}
|