2 |
--------------------------------------------------------------------------------
/packages/scoped-custom-element-registry/.gitignore:
--------------------------------------------------------------------------------
1 | .wireit/
2 | .tsbuildinfo
3 | build/
4 |
--------------------------------------------------------------------------------
/packages/webcomponentsjs/.gitattributes:
--------------------------------------------------------------------------------
1 | webcomponents-bundle.js* binary
2 | bundles/* binary
3 |
--------------------------------------------------------------------------------
/.eslintignore-sync:
--------------------------------------------------------------------------------
1 | [local]
2 | .gitignore
3 |
4 | [relative]
5 | packages/*/{.gitignore,.eslintignore}
6 |
--------------------------------------------------------------------------------
/.prettierrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "bracketSpacing": false,
3 | "quoteProps": "preserve",
4 | "singleQuote": true
5 | }
6 |
--------------------------------------------------------------------------------
/packages/tests/custom-elements/html/imported-doc.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/es-module-import-2.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/packages/url/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@webcomponents/url",
3 | "version": "0.7.9",
4 | "lockfileVersion": 1
5 | }
6 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/es-module-1.js:
--------------------------------------------------------------------------------
1 | import './es-module-2.js';
2 |
3 | window.loadedModules.push('es-module-1');
4 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/es-module-3.js:
--------------------------------------------------------------------------------
1 | import './es-module-1.js';
2 |
3 | window.loadedModules.push('es-module-3');
4 |
--------------------------------------------------------------------------------
/packages/shadydom/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@webcomponents/shadydom",
3 | "version": "1.11.0",
4 | "lockfileVersion": 1
5 | }
6 |
--------------------------------------------------------------------------------
/packages/template/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@webcomponents/template",
3 | "version": "1.5.1",
4 | "lockfileVersion": 1
5 | }
6 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/es-module-2.js:
--------------------------------------------------------------------------------
1 | export const message = 'foo';
2 |
3 | window.loadedModules.push('es-module-2');
4 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/es-module-inline.html:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/packages/formdata-event/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@webcomponents/formdata-event",
3 | "version": "0.0.3",
4 | "lockfileVersion": 1
5 | }
6 |
--------------------------------------------------------------------------------
/packages/html-imports/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@webcomponents/html-imports",
3 | "version": "1.3.1",
4 | "lockfileVersion": 1
5 | }
6 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/google.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/webcomponents/polyfills/HEAD/packages/tests/html-imports/html/imports/google.png
--------------------------------------------------------------------------------
/packages/shadydom/rollup.config.js:
--------------------------------------------------------------------------------
1 | export default {
2 | input: 'src/shadydom.js',
3 | output: {file: 'shadydom.min.js', format: 'iife', sourcemap: true},
4 | };
5 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | end_of_line = lf
5 | insert_final_newline = true
6 | trim_trailing_whitespace = true
7 | indent_style = space
8 | indent_size = 2
--------------------------------------------------------------------------------
/packages/shady-css-scoped-element/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@webcomponents/shady-css-scoped-element",
3 | "version": "0.0.8",
4 | "lockfileVersion": 1
5 | }
6 |
--------------------------------------------------------------------------------
/packages/tests/custom-elements/html/incorrectly-imported-doc.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/maintenance.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Maintenance
3 | about: Cleanup and other maintenance work
4 | labels: 'Type: Maintenance, Focus Area: Standards & Polyfills'
5 | ---
6 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/es-module-import-1.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/packages/custom-elements/rollup.config.js:
--------------------------------------------------------------------------------
1 | export default {
2 | input: 'src/custom-elements.js',
3 | output: {file: 'custom-elements.min.js', format: 'iife', sourcemap: true},
4 | };
5 |
--------------------------------------------------------------------------------
/.prettierignore-sync:
--------------------------------------------------------------------------------
1 | [local]
2 | .gitignore
3 |
4 | [relative]
5 | packages/*/{.gitignore,.prettierignore}
6 |
7 | [inline]
8 | LICENSE
9 | packages/*/LICENSE.md
10 | packages/tests/html-imports/html/imports/unclosed-import.html
11 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/packages/tests/core-js_url.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This is the entrypoint for the `core-js` bundle used as part of the test
3 | * environment. `core-js` is only distributed as Common JS, so it must be
4 | * bundled.
5 | */
6 |
7 | import 'core-js/stable/url';
8 |
--------------------------------------------------------------------------------
/packages/url/README.md:
--------------------------------------------------------------------------------
1 | # URL
2 |
3 | URL parser in JavaScript
4 |
5 | This is a fork of [annevk/url](https://github.com/annevk/url). The code has been converted to pragmatic JS with a
6 | huge performance improvement as a side effect.
7 |
8 | # License
9 |
10 | This is public domain.
11 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/parent-node/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/child-node/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
--------------------------------------------------------------------------------
/packages/tests/custom-elements/html/async-import.html:
--------------------------------------------------------------------------------
1 |
2 |
13 |
--------------------------------------------------------------------------------
/lerna.json:
--------------------------------------------------------------------------------
1 | {
2 | "lerna": "3.13.3",
3 | "packages": ["packages/*"],
4 | "version": "independent",
5 | "command": {
6 | "publish": {
7 | "allowBranch": ["master"],
8 | "ignoreChanges": [
9 | ".gitignore",
10 | ".travis.yml",
11 | "README.md",
12 | "appveyor.yml"
13 | ]
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/packages/webcomponentsjs/ts_src/platform/custom_typings.d.ts:
--------------------------------------------------------------------------------
1 | declare module 'promise-polyfill/src/index.js' {
2 | type PromiseConstructor = typeof Promise;
3 | interface PromisePolyfill extends PromiseConstructor {
4 | _immediateFn(callback: () => void): void;
5 | }
6 | const PromisePolyfill: PromisePolyfill;
7 | export default PromisePolyfill;
8 | }
9 |
--------------------------------------------------------------------------------
/packages/scoped-custom-element-registry/test/ShadowRoot.test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/scoped-custom-element-registry/test/global-registry.test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/scoped-custom-element-registry/test/scoped-registry.test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/url/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "url",
3 | "main": "url.js",
4 | "homepage": "https://github.com/Polymer/URL",
5 | "authors": ["https://github.com/Polymer/URL/graphs/contributors"],
6 | "description": "URL parser in JavaScript",
7 | "keywords": ["url", "urlsearchparams", "whatwg", "w3c"],
8 | "license": "https://github.com/Polymer/URL#license",
9 | "ignore": ["*test*", "playground.html"]
10 | }
11 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | ## Reporting a Vulnerability
4 |
5 | To report a suspected vulnerability please report it through GitHub at https://github.com/webcomponents/polyfills/security/advisories/new
6 |
7 | Please do not report any suspected vulnerabilities through public issues.
8 |
9 | ## Supported versions
10 |
11 | Only the latest major version of each polyfill is supported with security updates.
12 |
--------------------------------------------------------------------------------
/packages/tests/chai.js:
--------------------------------------------------------------------------------
1 | /**
2 | * This is the entrypoint for the Chai bundle used as part of the test
3 | * environment. Chai is only distributed as Common JS, so it must be bundled.
4 | *
5 | * Despite the `.mjs` extension, the module referenced here[^1] imports another
6 | * file[^2] that itself attempts to import the entire library using `require()`.
7 | *
8 | * [^1]: https://github.com/chaijs/chai/blob/v4.3.6/index.mjs
9 | * [^2]: https://github.com/chaijs/chai/blob/v4.3.6/index.js
10 | */
11 |
12 | export * from 'chai/index.mjs';
13 |
--------------------------------------------------------------------------------
/.github/stale.yml:
--------------------------------------------------------------------------------
1 | # Mark issues stale after 1 year
2 | daysUntilStale: 365
3 | # Delete stale issues after 2 years
4 | daysUntilClose: 730
5 | markComment: >
6 | This issue has been automatically marked as stale because it has not had
7 | recent activity. It will be closed if no further activity occurs. Thank you
8 | for your contributions.
9 | closeComment: >
10 | This issue has been automatically closed after being marked stale. If you're
11 | still facing this problem with the above solution, please comment and we'll
12 | reopen!
13 |
--------------------------------------------------------------------------------
/packages/tests/shadydom/wct-browser-config.js:
--------------------------------------------------------------------------------
1 | window.WCT = {
2 | // Force the 'root' path to be automatically detected relative to the
3 | // 'wct-browser-legacy/browser.js' script.
4 | root: null,
5 | environmentScripts: [
6 | 'stacky/lib/parsing.js',
7 | 'stacky/lib/formatting.js',
8 | 'stacky/lib/normalization.js',
9 | 'mocha/mocha.js',
10 | 'chai/chai.js',
11 | '@polymer/sinonjs/sinon.js',
12 | 'accessibility-developer-tools/dist/js/axs_testing.js',
13 | '@polymer/test-fixture/test-fixture.js',
14 | ],
15 | };
16 |
--------------------------------------------------------------------------------
/wct.conf.json:
--------------------------------------------------------------------------------
1 | {
2 | "suites": [
3 | "packages/tests/formdata-event/index.html",
4 | "packages/tests/html-imports/index.html",
5 | "packages/tests/shadycss/runner.html",
6 | "packages/tests/shadydom/runner.html",
7 | "packages/tests/template/runner.html",
8 | "packages/tests/webcomponentsjs_/runner.html"
9 | ],
10 | "npm": true,
11 | "plugins": {
12 | "local": {
13 | "browserOptions": {
14 | "chrome": ["headless", "disable-gpu", "no-sandbox"],
15 | "firefox": ["-headless"]
16 | }
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/packages/webcomponentsjs/license-header.txt:
--------------------------------------------------------------------------------
1 | /**
2 | @license @nocompile
3 | Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/modules/module-b.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
--------------------------------------------------------------------------------
/packages/shadycss/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2017",
4 | "module": "es2015",
5 | "moduleResolution": "node",
6 | "lib": ["DOM"],
7 | "strict": true,
8 | "declaration": true,
9 | "noUnusedLocals": true,
10 | "noUnusedParameters": true,
11 | "preserveConstEnums": true,
12 | "forceConsistentCasingInFileNames": true,
13 | "rootDir": "ts_src/",
14 | "outDir": "src/",
15 | "sourceMap": true,
16 | "incremental": true,
17 | "tsBuildInfoFile": ".tsbuildinfo"
18 | },
19 | "include": ["ts_src/**/*"],
20 | "exclude": []
21 | }
22 |
--------------------------------------------------------------------------------
/packages/tests/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "mocha": true
4 | },
5 | "rules": {
6 | "@typescript-eslint/no-unused-vars": "off"
7 | },
8 | "globals": {
9 | "assert": false,
10 | "chai": false,
11 | "defineTestElement": false,
12 | "expect": false,
13 | "HTMLImports": true,
14 | "loaded": true,
15 | "makeElement": false,
16 | "makeFocusable": false,
17 | "NATIVE": false,
18 | "remoteCurrentScriptExecuted": true,
19 | "ShadyCSS": true,
20 | "ShadyDOM": true,
21 | "sinon": false,
22 | "WCT": true,
23 | "WebComponents": true
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/wct-config.js:
--------------------------------------------------------------------------------
1 | window.WCT = {
2 | // Force the 'root' path to be automatically detected relative to the
3 | // 'wct-browser-legacy/browser.js' script.
4 | root: null,
5 | environmentScripts: [
6 | 'stacky/lib/parsing.js',
7 | 'stacky/lib/formatting.js',
8 | 'stacky/lib/normalization.js',
9 | 'mocha/mocha.js',
10 | 'chai/chai.js',
11 | '@polymer/sinonjs/sinon.js',
12 | // 'accessibility-developer-tools/dist/js/axs_testing.js',
13 | // '@polymer/test-fixture/test-fixture.js'
14 | ],
15 | environmentImports: [],
16 | // verbose: true
17 | };
18 |
--------------------------------------------------------------------------------
/packages/shadycss/apply-shim.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/webcomponentsjs/closure-output.txt:
--------------------------------------------------------------------------------
1 | /**
2 | @license @nocompile
3 | Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 | (function(){%output%}).call(this);
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/imports/import-upgrade-order.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/shadycss/custom-style-interface.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/empty-script.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/empty-style.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/abs.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/imports/a1-instance.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/scoped-custom-element-registry/web-test-runner.config.js:
--------------------------------------------------------------------------------
1 | const {playwrightLauncher} = require('@web/test-runner-playwright');
2 |
3 | const defaultBrowsers = [
4 | playwrightLauncher({product: 'chromium'}),
5 | playwrightLauncher({product: 'firefox', concurrency: 1}),
6 | playwrightLauncher({product: 'webkit'}),
7 | ];
8 |
9 | const envBrowsers = process.env.BROWSERS?.split(',').map((product) =>
10 | playwrightLauncher({product})
11 | );
12 |
13 | const browsers = envBrowsers ?? defaultBrowsers;
14 |
15 | module.exports = {
16 | files: ['test/**/*.test.(js|html)'],
17 | nodeResolve: true,
18 | concurrency: 10,
19 | browsers,
20 | };
21 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/sheet2.css:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | * Code distributed by Google as part of the polymer project is also
8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | .blue {
12 | background-color: blue;
13 | }
14 |
--------------------------------------------------------------------------------
/packages/formdata-event/ts_src/environment/globals.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2020 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be
6 | * found at http://polymer.github.io/AUTHORS.txt The complete set of
7 | * contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code
8 | * distributed by Google as part of the polymer project is also subject to an
9 | * additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | export const document = window.document;
13 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/csp-import-2.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/import-1-1.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/import-1-3.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/sheet3.css:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | * Code distributed by Google as part of the polymer project is also
8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | .orange {
12 | background-color: orange;
13 | }
14 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/sheet4.css:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | * Code distributed by Google as part of the polymer project is also
8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | .link-typed {
12 | background-color: navy;
13 | }
14 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/imports/csp-import-2.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/imports/csp-script-1.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | * Code distributed by Google as part of the polymer project is also
8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | window.externalScriptParsed1 = new Date().getTime();
12 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/imports/csp-script-2.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | * Code distributed by Google as part of the polymer project is also
8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | window.externalScriptParsed2 = new Date().getTime();
12 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/csp-script-1.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | * Code distributed by Google as part of the polymer project is also
8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | window.externalScriptParsed1 = new Date().getTime();
12 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/csp-script-2.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | * Code distributed by Google as part of the polymer project is also
8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | window.externalScriptParsed2 = new Date().getTime();
12 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/imports/element-import-a.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/imports/element-import-b.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/imports/import-file.html:
--------------------------------------------------------------------------------
1 |
10 |
13 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature
3 | about: Request a new polyfill feature
4 | labels: 'Type: Feature, Focus Area: Standards & Polyfills'
5 | ---
6 |
7 | ## Description
8 |
9 |
15 |
16 | ## Motivation
17 |
18 |
25 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/base-1.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/resolve-import-c.html:
--------------------------------------------------------------------------------
1 |
10 |
13 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/unclosed-import.html:
--------------------------------------------------------------------------------
1 |
10 |
11 | purposefully unclosed tag
12 |
13 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/base/base-2.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/imports/a1-import.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/packages/webcomponentsjs/ts_src/platform/parent-node/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2020 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | import './append.js';
12 | import './prepend.js';
13 | import './replace-children.js';
14 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/load-2.html:
--------------------------------------------------------------------------------
1 |
10 |
15 |
--------------------------------------------------------------------------------
/packages/tests/rollup.config.js:
--------------------------------------------------------------------------------
1 | import commonjs from '@rollup/plugin-commonjs';
2 | import {nodeResolve} from '@rollup/plugin-node-resolve';
3 |
4 | export default [
5 | {
6 | input: 'chai.js',
7 | output: {
8 | file: 'chai-bundle.js',
9 | format: 'es',
10 | },
11 | plugins: [
12 | commonjs(),
13 | nodeResolve({
14 | preferBuiltins: false,
15 | }),
16 | ],
17 | },
18 | {
19 | input: 'core-js_url.js',
20 | output: {
21 | file: 'core-js_url-bundle.js',
22 | format: 'es',
23 | },
24 | plugins: [
25 | commonjs(),
26 | nodeResolve({
27 | preferBuiltins: false,
28 | }),
29 | ],
30 | },
31 | ];
32 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/dedupe.html:
--------------------------------------------------------------------------------
1 |
10 |
14 |
--------------------------------------------------------------------------------
/packages/webcomponentsjs/ts_src/platform/child-node/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2020 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | import './after.js';
12 | import './before.js';
13 | import './remove.js';
14 | import './replace-with.js';
15 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/csp-import-1.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/packages/tests/shadydom/smoke/rel.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/imports/csp-import-1.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/sheet1.css:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | * Code distributed by Google as part of the polymer project is also
8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | .red {
12 | background-color: red;
13 | }
14 |
15 | .overridden {
16 | background-color: green;
17 | }
18 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/resolve-import-c.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
14 |
--------------------------------------------------------------------------------
/packages/webcomponentsjs/src/entrypoints/webcomponents-pf_js-index.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2020 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | import '../platform/es6-misc.js';
12 | import '../platform/promise.js';
13 | import '../platform/symbol.js';
14 |
--------------------------------------------------------------------------------
/packages/tests/shadycss/html-imports/custom-style-import.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
16 |
17 |
--------------------------------------------------------------------------------
/packages/shadycss/src/template-map.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | 'use strict';
12 |
13 | /**
14 | * @const {!Object}
15 | */
16 | const templateMap = {};
17 | export default templateMap;
18 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/resolve-import-a.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
14 |
--------------------------------------------------------------------------------
/packages/scoped-custom-element-registry/test/native-htmlelement.test.js:
--------------------------------------------------------------------------------
1 | import {expect} from '@open-wc/testing';
2 |
3 | import {getTestElement} from './utils';
4 |
5 | describe('Native HTMLElement', () => {
6 | describe('custom element constructors', () => {
7 | it('should allow to create a custom element which class has been created before applying the polyfill', async () => {
8 | const {tagName, CustomElementClass} = getTestElement();
9 |
10 | await import('../scoped-custom-element-registry.min.js');
11 |
12 | customElements.define(tagName, CustomElementClass);
13 |
14 | const element = document.createElement(tagName);
15 |
16 | expect(element).to.not.be.undefined;
17 | });
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/packages/tests/shadycss/module/style-placeholder.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | /*
12 | A simple shim to generate a testable module
13 | */
14 |
15 | import '../../node_modules/@webcomponents/shadycss/src/style-placeholder';
16 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/external-script.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | * Code distributed by Google as part of the polymer project is also
8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | window.externalScriptParsed = new Date().getTime();
12 | console.log('externalScriptParsed', window.externalScriptParsed);
13 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/load-a.html:
--------------------------------------------------------------------------------
1 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/load-d.html:
--------------------------------------------------------------------------------
1 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/packages/shady-css-scoped-element/README.md:
--------------------------------------------------------------------------------
1 | # ShadyCSS Scoped Element
2 |
3 | The `` element provides support for document level styles to declare css variables for use in custom elements in older browsers (IE11).
4 |
5 | # Requirements
6 |
7 | custom-style-interface from @webcomponents/shadycss, support for custom elements via @webcomponents/custom-elements
8 |
9 | # Usage
10 |
11 | When you need to declare css variables outside of a custom element's styles, in index.html for example:
12 |
13 | ```html
14 |
15 |
21 |
22 |
23 | ```
24 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/svg-style.html:
--------------------------------------------------------------------------------
1 |
10 |
18 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/encoding-import.html:
--------------------------------------------------------------------------------
1 |
10 |
14 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/import-1.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/trusted-types/index.html:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
15 |
--------------------------------------------------------------------------------
/packages/tests/shadycss/module/style-info.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | /*
12 | A simple shim to generate a testable module
13 | */
14 |
15 | import StyleInfo from '../../node_modules/@webcomponents/shadycss/src/style-info';
16 | window['StyleInfo'] = StyleInfo;
17 |
--------------------------------------------------------------------------------
/packages/tests/shadycss/module/css-parse.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | /*
12 | A simple shim to generate a testable module
13 | */
14 |
15 | import * as CssParse from '../../node_modules/@webcomponents/shadycss/src/css-parse';
16 |
17 | window['CssParse'] = CssParse;
18 |
--------------------------------------------------------------------------------
/packages/tests/shadycss/module/style-cache.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | /*
12 | A simple shim to generate a testable module
13 | */
14 |
15 | import StyleCache from '../../node_modules/@webcomponents/shadycss/src/style-cache';
16 | window['StyleCache'] = StyleCache;
17 |
--------------------------------------------------------------------------------
/packages/tests/shadycss/module/style-util.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | /*
12 | A simple shim to generate a testable module
13 | */
14 |
15 | import * as StyleUtil from '../../node_modules/@webcomponents/shadycss/src/style-util';
16 | window['StyleUtil'] = StyleUtil;
17 |
--------------------------------------------------------------------------------
/packages/webcomponentsjs/src/entrypoints/custom-elements-es5-adapter-index.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 | 'use strict';
11 |
12 | /*
13 | * Polyfills loaded: Custom Elements ES5 Shim
14 | */
15 |
16 | import '../../node_modules/@webcomponents/custom-elements/src/native-shim.js';
17 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/load-b.html:
--------------------------------------------------------------------------------
1 |
10 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/load-c.html:
--------------------------------------------------------------------------------
1 |
10 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/ready-state-check-import.html:
--------------------------------------------------------------------------------
1 |
10 |
14 |
--------------------------------------------------------------------------------
/packages/webcomponentsjs/src/entrypoints/webcomponents-ce-index.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 | 'use strict';
11 |
12 | /*
13 | * Polyfills loaded: Custom Elements
14 | * Used in: Safari 10
15 | */
16 |
17 | import '../../node_modules/@webcomponents/custom-elements/src/custom-elements.js';
18 |
--------------------------------------------------------------------------------
/packages/tests/shadycss/module/style-settings.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | /*
12 | A simple shim to generate a testable module
13 | */
14 |
15 | import * as StyleSettings from '../../node_modules/@webcomponents/shadycss/src/style-settings';
16 | window['StyleSettings'] = StyleSettings;
17 |
--------------------------------------------------------------------------------
/packages/formdata-event/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "incremental": true,
4 | "target": "es2019",
5 | "tsBuildInfoFile": "./buildcache",
6 | "module": "esnext",
7 | "declaration": true,
8 | "sourceMap": true,
9 | "outDir": "./src",
10 | "importHelpers": true,
11 | "strict": true,
12 | "noImplicitAny": true,
13 | "strictNullChecks": true,
14 | "strictFunctionTypes": true,
15 | "strictBindCallApply": true,
16 | "strictPropertyInitialization": true,
17 | "noImplicitThis": true,
18 | "alwaysStrict": true,
19 | "noUnusedLocals": true,
20 | "noUnusedParameters": true,
21 | "noImplicitReturns": true,
22 | "noFallthroughCasesInSwitch": true,
23 | "moduleResolution": "node"
24 | },
25 | "include": ["ts_src/"]
26 | }
27 |
--------------------------------------------------------------------------------
/packages/tests/shadycss/module/style-properties.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | /*
12 | A simple shim to generate a testable module
13 | */
14 |
15 | import StyleProperties from '../../node_modules/@webcomponents/shadycss/src/style-properties';
16 | window['StyleProperties'] = StyleProperties;
17 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/imports/current-script.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | * Code distributed by Google as part of the polymer project is also
8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 | /* exported remoteCurrentScriptExecuted */
11 | remoteCurrentScriptExecuted = window.remoteCurrentScriptExecuted || 0;
12 | remoteCurrentScriptExecuted++;
13 | assert.ok(document._currentScript);
14 |
--------------------------------------------------------------------------------
/packages/webcomponentsjs/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "incremental": true,
4 | "target": "es2019",
5 | "tsBuildInfoFile": "./buildcache",
6 | "module": "esnext",
7 | "declaration": true,
8 | "sourceMap": true,
9 | "outDir": "./src",
10 | "importHelpers": true,
11 | "strict": true,
12 | "noImplicitAny": true,
13 | "strictNullChecks": true,
14 | "strictFunctionTypes": true,
15 | "strictBindCallApply": true,
16 | "strictPropertyInitialization": true,
17 | "noImplicitThis": true,
18 | "alwaysStrict": true,
19 | "noUnusedLocals": true,
20 | "noUnusedParameters": true,
21 | "noImplicitReturns": true,
22 | "noFallthroughCasesInSwitch": true,
23 | "moduleResolution": "node"
24 | },
25 | "include": ["ts_src"]
26 | }
27 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/import-1-2.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/packages/tests/shadycss/module/style-transformer.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | /*
12 | A simple shim to generate a testable module
13 | */
14 |
15 | import StyleTransformer from '../../node_modules/@webcomponents/shadycss/src/style-transformer';
16 | window['StyleTransformer'] = StyleTransformer;
17 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/parsed-import-1.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
14 |
17 |
--------------------------------------------------------------------------------
/packages/url/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7 |
8 |
9 |
10 | ## [0.7.9] - 2023-03-30
11 |
12 | - Update dependencies ([#542](https://github.com/webcomponents/polyfills/pull/542))
13 |
14 | ## [0.7.8] - 2021-08-02
15 |
16 | - Maintenance release (no user-facing changes)
17 |
18 | ## [0.7.7] - 2020-10-21
19 |
20 | - Maintenance release (no user-facing changes)
21 |
22 | ## [0.7.6] - 2020-07-20
23 |
24 | - Maintenance release (no user-facing changes)
25 |
26 | ## [0.7.5] - 2020-03-16
27 |
28 | - Maintenance release (no user-facing changes)
29 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/csp.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | * Code distributed by Google as part of the polymer project is also
8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | test('imported scripts loaded under CSP', function () {
12 | chai.assert.ok(window.externalScriptParsed1, 'externalScriptParsed1');
13 | chai.assert.ok(window.externalScriptParsed2, 'externalScriptParsed2');
14 | });
15 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/resolve-import-b.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
16 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/styles.css:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | * Code distributed by Google as part of the polymer project is also
8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | /*
12 | Document : styles
13 | Created on : Apr 9, 2013, 5:55:32 PM
14 | Author : sjmiles
15 | Description:
16 | Purpose of the stylesheet follows.
17 | */
18 | root {
19 | display: block;
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/packages/webcomponentsjs/externs/webcomponents.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @externs
3 | * @fileoverview Symbols needed to compile webcomponents
4 | * @license
5 | * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
6 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
7 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
8 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
9 | * Code distributed by Google as part of the polymer project is also
10 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
11 | */
12 | var ShadyDOM;
13 | var WebComponents;
14 |
15 | /** @type {!Function} */
16 | Promise.cast;
17 |
18 | /** @type {function()} */
19 | HTMLTemplateElement.bootstrap;
20 |
--------------------------------------------------------------------------------
/packages/scoped-custom-element-registry/closure-flags.txt:
--------------------------------------------------------------------------------
1 | --compilation_level=ADVANCED_OPTIMIZATIONS
2 | --warning_level=VERBOSE
3 | --language_in=STABLE
4 | --language_out=ECMASCRIPT5_STRICT
5 | --dependency_mode=PRUNE
6 | --entry_point=./build/scoped-custom-element-registry.js
7 | --js=./build/scoped-custom-element-registry.js
8 | --js_output_file=./scoped-custom-element-registry.min.js
9 | --output_wrapper="(function(){
10 | %output%
11 | }).call(typeof globalThis === 'object' ? globalThis : window);
12 |
13 | //# sourceMappingURL=scoped-custom-element-registry.min.js.map"
14 | --assume_function_wrapper=true
15 | --rewrite_polyfills=false
16 | --create_source_map=./scoped-custom-element-registry.min.js.map
17 | --source_map_input="./build/scoped-custom-element-registry.js|./build/scoped-custom-element-registry.js.map"
18 | --source_map_include_content
19 |
--------------------------------------------------------------------------------
/packages/template/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7 |
8 |
9 |
10 | ## [1.5.1] - 2023-03-30
11 |
12 | - Update dependencies ([#542](https://github.com/webcomponents/polyfills/pull/542))
13 |
14 | ## [1.5.0] - 2021-08-02
15 |
16 | - Add TS externs. ([#457](https://github.com/webcomponents/polyfills/pull/457))
17 |
18 | ## [1.4.4] - 2020-10-21
19 |
20 | - Maintenance release (no user-facing changes)
21 |
22 | ## [1.4.3] - 2020-07-20
23 |
24 | - Maintenance release (no user-facing changes)
25 |
26 | ## [1.4.2] - 2020-03-16
27 |
28 | - Maintenance release (no user-facing changes)
29 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/current-script.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | * Code distributed by Google as part of the polymer project is also
8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | chai.assert.ok(document.currentScript);
12 | remoteCurrentScriptExecuted = window.remoteCurrentScriptExecuted || 0;
13 | remoteCurrentScriptExecuted++;
14 | console.log('remoteCurrentScriptExecuted ' + remoteCurrentScriptExecuted);
15 |
--------------------------------------------------------------------------------
/packages/formdata-event/ts_src/environment/html_collection.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2020 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be
6 | * found at http://polymer.github.io/AUTHORS.txt The complete set of
7 | * contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code
8 | * distributed by Google as part of the polymer project is also subject to an
9 | * additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | export const constructor = window.HTMLCollection;
13 |
14 | export const prototype = constructor.prototype;
15 |
16 | export const descriptors = {
17 | length: Object.getOwnPropertyDescriptor(prototype, 'length'),
18 | };
19 |
--------------------------------------------------------------------------------
/packages/template/README.md:
--------------------------------------------------------------------------------
1 | # template
2 |
3 | A minimal polyfill for ``.
4 |
5 | ## Known limitations
6 |
7 | ### Template nodes in main document are upgraded after `DOMContentLoaded`
8 |
9 | The first timepoint in which the polyfill can be certain the main document is loaded is `DOMContentLoaded`.
10 | As such, we use this timepoint to bootstrap any `` as defined in the main document.
11 | This means that any scripts in the main document that run before this event (e.g. inline scripts) will not have the properly upgraded templates.
12 | Instead, listen for `DOMContentLoaded` yourself and only after that interact with any `` in the main document.
13 |
14 | ## License
15 |
16 | Everything in this repository is BSD style license unless otherwise specified.
17 |
18 | Copyright (c) 2016 The Polymer Authors. All rights reserved.
19 |
--------------------------------------------------------------------------------
/packages/formdata-event/ts_src/environment/document.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2020 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be
6 | * found at http://polymer.github.io/AUTHORS.txt The complete set of
7 | * contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code
8 | * distributed by Google as part of the polymer project is also subject to an
9 | * additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | export const constructor = window.Document;
13 |
14 | export const prototype = constructor.prototype;
15 |
16 | export const methods = {
17 | createElement: prototype.createElement,
18 | createEvent: prototype.createEvent,
19 | };
20 |
--------------------------------------------------------------------------------
/packages/formdata-event/ts_src/environment/form_data.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2020 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be
6 | * found at http://polymer.github.io/AUTHORS.txt The complete set of
7 | * contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code
8 | * distributed by Google as part of the polymer project is also subject to an
9 | * additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | export const constructor = window.FormData;
13 |
14 | export const prototype = constructor.prototype;
15 |
16 | export const methods = {
17 | append: prototype.append,
18 | delete: prototype.delete,
19 | set: prototype.set,
20 | };
21 |
--------------------------------------------------------------------------------
/packages/scoped-custom-element-registry/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "incremental": true,
4 | "target": "es2020",
5 | "tsBuildInfoFile": ".tsbuildinfo",
6 | "module": "es2020",
7 | "declaration": true,
8 | "sourceMap": true,
9 | "outDir": "./build",
10 | "importHelpers": true,
11 | "strict": true,
12 | "noImplicitAny": true,
13 | "strictNullChecks": true,
14 | "strictFunctionTypes": true,
15 | "strictBindCallApply": true,
16 | "strictPropertyInitialization": true,
17 | "noImplicitThis": true,
18 | "alwaysStrict": true,
19 | "noUnusedLocals": true,
20 | "noUnusedParameters": true,
21 | "noImplicitReturns": true,
22 | "noFallthroughCasesInSwitch": true,
23 | "moduleResolution": "node",
24 | "noEmitOnError": false
25 | },
26 | "include": ["src/**/*.ts"]
27 | }
28 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/imports/element-import.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
21 |
--------------------------------------------------------------------------------
/packages/tests/template/runner.html:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 | Template Tests
13 |
14 |
15 |
16 |
21 |
--------------------------------------------------------------------------------
/packages/formdata-event/ts_src/environment_api/html_form_element.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2020 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be
6 | * found at http://polymer.github.io/AUTHORS.txt The complete set of
7 | * contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code
8 | * distributed by Google as part of the polymer project is also subject to an
9 | * additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | import {descriptors as HTMLFormElementDescriptors} from '../environment/html_form_element.js';
13 |
14 | export const getElements = (form: HTMLFormElement) => {
15 | return HTMLFormElementDescriptors.elements.get!.call(form);
16 | };
17 |
--------------------------------------------------------------------------------
/packages/tests/shadycss/async-loading.html:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
13 |
17 |
21 |
26 |
--------------------------------------------------------------------------------
/packages/custom-elements/ts_src/CustomElementState.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | * This code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be found
6 | * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may
7 | * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
8 | * Google as part of the polymer project is also subject to an additional IP
9 | * rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | export const CustomElementState = {
13 | custom: 1,
14 | failed: 2,
15 | } as const;
16 | export type CustomElementState =
17 | | typeof CustomElementState.custom
18 | | typeof CustomElementState.failed;
19 |
20 | export default CustomElementState;
21 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/dynamic-importer.html:
--------------------------------------------------------------------------------
1 |
10 |
18 |
--------------------------------------------------------------------------------
/packages/webcomponentsjs/src/entrypoints/webcomponents-sd-index.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 | 'use strict';
11 |
12 | /*
13 | * Polyfills loaded: Shady DOM/Shady CSS
14 | * Used in: Firefox when CE is implemented
15 | */
16 |
17 | import '../../node_modules/@webcomponents/shadydom/src/shadydom.js';
18 | import '../../node_modules/@webcomponents/shadycss/entrypoints/scoping-shim.js';
19 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/parsed-import-2.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
14 |
17 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/imports/script-2.html:
--------------------------------------------------------------------------------
1 |
10 |
me2
11 |
19 |
20 |
--------------------------------------------------------------------------------
/packages/webcomponentsjs/externs/webcomponents.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2021 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be found
6 | * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may
7 | * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
8 | * Google as part of the polymer project is also subject to an additional IP
9 | * rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | // When building externally, this file is always assumed to be a module, but by
13 | // default it isn't when building internally, so we need this export statement.
14 | export {};
15 |
16 | declare global {
17 | // eslint-disable-next-line no-var
18 | var WebComponents: {};
19 | }
20 |
--------------------------------------------------------------------------------
/packages/shadydom/src/patches/EventTarget.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | import * as utils from '../utils.js';
12 | // prettier-ignore
13 | import {addEventListener, removeEventListener, dispatchEvent} from '../patch-events.js';
14 |
15 | export const EventTargetPatches = utils.getOwnPropertyDescriptors({
16 | dispatchEvent,
17 |
18 | addEventListener,
19 |
20 | removeEventListener,
21 | });
22 |
--------------------------------------------------------------------------------
/packages/template/externs/template.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2021 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be found
6 | * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may
7 | * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
8 | * Google as part of the polymer project is also subject to an additional IP
9 | * rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | // When building externally, this file is always assumed to be a module, but by
13 | // default it isn't when building internally, so we need this export statement.
14 | export {};
15 |
16 | declare global {
17 | interface HTMLTemplateElementConstructor {
18 | bootstrap(): void;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/packages/tests/shadycss/module/custom-style-element.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | /*
12 | A simple shim to generate a testable module
13 | */
14 |
15 | // TODO: This reference reaches directly into the shadycss package because this
16 | // file is not available in the npm package. Is there a better way to reference
17 | // this file?
18 | import '../../../shadycss/examples/custom-style-element';
19 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/script-2.html:
--------------------------------------------------------------------------------
1 |
10 |
me2
11 |
19 |
20 |
--------------------------------------------------------------------------------
/packages/url/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@webcomponents/url",
3 | "version": "0.7.9",
4 | "publishConfig": {
5 | "access": "public"
6 | },
7 | "description": "URL parser in JavaScript",
8 | "license": "SAX-PD",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/webcomponents/polyfills.git",
12 | "directory": "packages/url"
13 | },
14 | "author": "Erik Arvidsson ",
15 | "homepage": "https://github.com/webcomponents/polyfills/tree/master/packages/url",
16 | "bugs": "https://github.com/webcomponents/polyfills/issues?q=is%3Aissue+is%3Aopen+label%3A\"Package%3A+url\"",
17 | "main": "url.js",
18 | "scripts": {
19 | "build": "gulp",
20 | "build:watch": "chokidar --initial 'url.js' -c 'npm run build'",
21 | "prepack": "npm run build"
22 | },
23 | "files": [
24 | "CHANGELOG.md",
25 | "url.js",
26 | "url.min.js*"
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/packages/formdata-event/ts_src/environment/window.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2020 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be
6 | * found at http://polymer.github.io/AUTHORS.txt The complete set of
7 | * contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code
8 | * distributed by Google as part of the polymer project is also subject to an
9 | * additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | export const constructor = window.Window;
13 |
14 | export const prototype = constructor.prototype;
15 |
16 | export const methods = {
17 | addEventListener: prototype.addEventListener,
18 | removeEventListener: prototype.removeEventListener,
19 | dispatchEvent: prototype.dispatchEvent,
20 | };
21 |
--------------------------------------------------------------------------------
/packages/formdata-event/ts_src/environment/event_target.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2020 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be
6 | * found at http://polymer.github.io/AUTHORS.txt The complete set of
7 | * contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code
8 | * distributed by Google as part of the polymer project is also subject to an
9 | * additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | export const constructor = window.EventTarget;
13 |
14 | export const prototype = constructor?.prototype;
15 |
16 | export const methods = {
17 | addEventListener: prototype?.addEventListener,
18 | removeEventListener: prototype?.removeEventListener,
19 | dispatchEvent: prototype?.dispatchEvent,
20 | };
21 |
--------------------------------------------------------------------------------
/packages/formdata-event/ts_src/environment/html_form_element.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2020 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be
6 | * found at http://polymer.github.io/AUTHORS.txt The complete set of
7 | * contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code
8 | * distributed by Google as part of the polymer project is also subject to an
9 | * additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | export const constructor = window.HTMLFormElement;
13 |
14 | export const prototype = constructor.prototype;
15 |
16 | export const methods = {
17 | submit: prototype.submit,
18 | };
19 |
20 | export const descriptors = {
21 | elements: Object.getOwnPropertyDescriptor(prototype, 'elements')!,
22 | };
23 |
--------------------------------------------------------------------------------
/packages/shadydom/src/shady-data.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | export class ShadyData {
12 | /** @override */
13 | toJSON() {
14 | return {};
15 | }
16 | }
17 |
18 | export function ensureShadyDataForNode(node) {
19 | if (!node.__shady) {
20 | node.__shady = new ShadyData();
21 | }
22 | return node.__shady;
23 | }
24 |
25 | export function shadyDataForNode(node) {
26 | return node && node.__shady;
27 | }
28 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/imports/simple-element-2.js:
--------------------------------------------------------------------------------
1 | /*
2 | @license
3 | Copyright(c) 2016 The Polymer Project Authors.All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | // Kick off shady CSS.
12 | class SimpleElement2 extends HTMLElement {
13 | constructor() {
14 | super();
15 | this.upgraded = Date.now();
16 | }
17 | connectedCallback() {
18 | this.textContent = `${this.localName} ${this.upgraded}`;
19 | }
20 | }
21 |
22 | window.customElements.define('simple-element-2', SimpleElement2);
23 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/imports/script-1.html:
--------------------------------------------------------------------------------
1 |
10 |
me
11 |
20 |
21 |
--------------------------------------------------------------------------------
/packages/formdata-event/ts_src/environment/element.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2020 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be
6 | * found at http://polymer.github.io/AUTHORS.txt The complete set of
7 | * contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code
8 | * distributed by Google as part of the polymer project is also subject to an
9 | * additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | export const constructor = window.Element;
13 |
14 | export const prototype = constructor.prototype;
15 |
16 | export const methods = {
17 | getAttribute: prototype.getAttribute,
18 | hasAttribute: prototype.hasAttribute,
19 | removeAttribute: prototype.removeAttribute,
20 | setAttribute: prototype.setAttribute,
21 | };
22 |
--------------------------------------------------------------------------------
/packages/tests/formdata-event/wrappers/index.html:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
15 |
16 |
17 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/load-1.html:
--------------------------------------------------------------------------------
1 |
10 |
15 |
24 |
25 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/script-1.html:
--------------------------------------------------------------------------------
1 |
10 |
me
11 |
20 |
21 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/style-elements-import.html:
--------------------------------------------------------------------------------
1 |
10 |
15 |
20 |
25 |
26 |
31 |
--------------------------------------------------------------------------------
/packages/tests/formdata-event/test_environment.html:
--------------------------------------------------------------------------------
1 |
2 |
12 |
18 |
19 |
--------------------------------------------------------------------------------
/packages/formdata-event/ts_src/environment/html_input_element.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2020 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be
6 | * found at http://polymer.github.io/AUTHORS.txt The complete set of
7 | * contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code
8 | * distributed by Google as part of the polymer project is also subject to an
9 | * additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | export const constructor = window.HTMLInputElement;
13 |
14 | export const prototype = constructor.prototype;
15 |
16 | export const descriptors = {
17 | name: Object.getOwnPropertyDescriptor(prototype, 'name'),
18 | type: Object.getOwnPropertyDescriptor(prototype, 'type'),
19 | value: Object.getOwnPropertyDescriptor(prototype, 'value'),
20 | };
21 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/style-links-import.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
16 |
17 |
--------------------------------------------------------------------------------
/packages/webcomponentsjs/src/entrypoints/webcomponents-sd-ce-index.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 | 'use strict';
11 |
12 | /*
13 | * Polyfills loaded: Custom Elements, Shady DOM/Shady CSS
14 | * Used in: Safari 9, Firefox, Edge
15 | */
16 |
17 | import '../../node_modules/@webcomponents/shadydom/src/shadydom.js';
18 | import '../../node_modules/@webcomponents/custom-elements/src/custom-elements.js';
19 | import '../../node_modules/@webcomponents/shadycss/entrypoints/scoping-shim.js';
20 |
--------------------------------------------------------------------------------
/packages/custom-elements/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "incremental": true,
4 | "target": "es2019",
5 | "tsBuildInfoFile": "./buildcache",
6 | "module": "esnext",
7 | "declaration": true,
8 | "sourceMap": true,
9 | "outDir": "./src",
10 | "importHelpers": true,
11 | "strict": true,
12 | "noImplicitAny": true,
13 | "strictNullChecks": true,
14 | "strictFunctionTypes": true,
15 | "strictBindCallApply": true,
16 | "strictPropertyInitialization": true,
17 | "noImplicitThis": true,
18 | "alwaysStrict": true,
19 | "noUnusedLocals": true,
20 | "noUnusedParameters": true,
21 | "noImplicitReturns": true,
22 | "noFallthroughCasesInSwitch": true,
23 | "moduleResolution": "node"
24 | },
25 | "include": [
26 | "externs/**/*.d.ts",
27 | "node_modules/@webcomponents/html-imports/externs/html-imports.d.ts",
28 | "node_modules/@webcomponents/shadydom/externs/shadydom.d.ts",
29 | "ts_src/"
30 | ]
31 | }
32 |
--------------------------------------------------------------------------------
/packages/template/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@webcomponents/template",
3 | "version": "1.5.1",
4 | "publishConfig": {
5 | "access": "public"
6 | },
7 | "description": "HTML template element polyfill",
8 | "license": "BSD-3-Clause",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/webcomponents/polyfills.git",
12 | "directory": "packages/template"
13 | },
14 | "author": "The Polymer Project Authors (https://polymer.github.io/AUTHORS.txt)",
15 | "homepage": "https://github.com/webcomponents/polyfills/tree/master/packages/template",
16 | "bugs": "https://github.com/webcomponents/polyfills/issues?q=is%3Aissue+is%3Aopen+label%3A\"Package%3A+template\"",
17 | "main": "template.js",
18 | "scripts": {
19 | "build": "gulp",
20 | "build:watch": "chokidar --initial 'template.js' -c 'npm run build'",
21 | "prepack": "npm run build"
22 | },
23 | "files": [
24 | "CHANGELOG.md",
25 | "externs/",
26 | "template.min.js*"
27 | ]
28 | }
29 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/imports/a1-reference.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
20 |
--------------------------------------------------------------------------------
/packages/webcomponentsjs/src/entrypoints/webcomponents-pf_dom-index.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2020 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | import '../platform/custom-event.js';
12 | import '../platform/event-listener-options.js';
13 | import '../platform/baseuri.js';
14 | import '../platform/get-attribute-names.js';
15 | import '../platform/matches.js';
16 | import '../platform/parent-node/index.js';
17 | import '../platform/child-node/index.js';
18 | import '../platform/svg-element-class-list.js';
19 | import '../platform/toggle-attribute.js';
20 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/modules/module-a-sub.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | import {BaseClass} from './common-subclass.js';
12 |
13 | const template = document.createElement('template');
14 | template.innerHTML = `
15 |
21 | `;
22 |
23 | class ModuleASub extends BaseClass {
24 | static get template() {
25 | return template;
26 | }
27 | }
28 |
29 | customElements.define('module-a-sub', ModuleASub);
30 |
--------------------------------------------------------------------------------
/packages/custom-elements/ts_src/AlreadyConstructedMarker.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | * This code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be found
6 | * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may
7 | * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
8 | * Google as part of the polymer project is also subject to an additional IP
9 | * rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | /**
13 | * Represents the 'already constructed marker' used in custom
14 | * element construction stacks.
15 | *
16 | * https://html.spec.whatwg.org/#concept-already-constructed-marker
17 | */
18 | const alreadyConstructedMarker = {} as {_alreadyConstructedMarker: never};
19 |
20 | export default alreadyConstructedMarker;
21 | export type AlreadyConstructedMarkerType = typeof alreadyConstructedMarker;
22 |
--------------------------------------------------------------------------------
/packages/formdata-event/ts_src/environment_api/document.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2020 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be
6 | * found at http://polymer.github.io/AUTHORS.txt The complete set of
7 | * contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code
8 | * distributed by Google as part of the polymer project is also subject to an
9 | * additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | import {methods as DocumentMethods} from '../environment/document.js';
13 |
14 | export const createElement = (
15 | doc: Document,
16 | localName: K,
17 | options?: ElementCreationOptions
18 | ): HTMLElementTagNameMap[K] => {
19 | return DocumentMethods.createElement.call(
20 | doc,
21 | localName,
22 | options
23 | ) as HTMLElementTagNameMap[K];
24 | };
25 |
--------------------------------------------------------------------------------
/packages/formdata-event/ts_src/environment_api/html_collection.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2020 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be
6 | * found at http://polymer.github.io/AUTHORS.txt The complete set of
7 | * contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code
8 | * distributed by Google as part of the polymer project is also subject to an
9 | * additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | import {descriptors as HTMLCollectionDescriptors} from '../environment/html_collection.js';
13 |
14 | const lengthDescriptor = HTMLCollectionDescriptors.length ?? {};
15 | const lengthGetter =
16 | lengthDescriptor.get ??
17 | function (this: HTMLCollection) {
18 | return this.length;
19 | };
20 | export const getLength = (collection: HTMLCollection): number =>
21 | lengthGetter.call(collection);
22 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # global
2 | node_modules/
3 | coverage/
4 | lerna-debug.log
5 |
6 | # shared in packages
7 | packages/*/node_modules/
8 | packages/*/buildcache
9 | packages/*/*.tgz
10 | packages/*/*.min.js*
11 |
12 | # custom-elements package
13 | packages/custom-elements/src/
14 |
15 | # formdata-event package
16 | packages/formdata-event/src/
17 |
18 | # html-imports package
19 | packages/html-imports/html-imports.min.js*
20 |
21 | # shadycss package
22 | packages/shadycss/src/interface.*
23 | packages/shadycss/.tsbuildinfo
24 |
25 | # tests package
26 | packages/tests/chai-bundle.js
27 | packages/tests/core-js_url-bundle.js
28 | packages/tests/shadycss/module/generated/
29 |
30 | # webcomponentsjs package
31 | packages/webcomponentsjs/bundles/
32 | packages/webcomponentsjs/src/platform/
33 | packages/webcomponentsjs/src/flag-parser.*
34 | packages/webcomponentsjs/src/unresolved.*
35 | packages/webcomponentsjs/custom-elements-es5-adapter.js
36 | packages/webcomponentsjs/webcomponents-bundle.d.ts
37 | packages/webcomponentsjs/webcomponents-bundle.js*
38 |
--------------------------------------------------------------------------------
/packages/tests/shady-css-scoped-element/index.html:
--------------------------------------------------------------------------------
1 |
2 |
11 | custom-style-element Tests
12 |
13 |
14 |
22 |
23 |
27 |
--------------------------------------------------------------------------------
/packages/custom-elements/ts_src/Patch/DocumentFragment.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | * This code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be found
6 | * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may
7 | * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
8 | * Google as part of the polymer project is also subject to an additional IP
9 | * rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | import CustomElementInternals from '../CustomElementInternals.js';
13 |
14 | import PatchParentNode from './Interface/ParentNode.js';
15 | import * as Native from './Native.js';
16 |
17 | export default function (internals: CustomElementInternals) {
18 | PatchParentNode(internals, DocumentFragment.prototype, {
19 | prepend: Native.DocumentFragment_prepend,
20 | append: Native.DocumentFragment_append,
21 | });
22 | }
23 |
--------------------------------------------------------------------------------
/packages/tests/formdata-event/index.html:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
15 |
16 |
17 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/packages/webcomponentsjs/ts_src/platform/matches.ts:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2020 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at
5 | http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
6 | http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
7 | found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
8 | part of the polymer project is also subject to an additional IP rights grant
9 | found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | export {};
13 |
14 | const Element_prototype = Element.prototype;
15 |
16 | if (!Element_prototype.hasOwnProperty('matches')) {
17 | Element_prototype.matches =
18 | // eslint-disable-next-line @typescript-eslint/no-explicit-any
19 | ((Element_prototype as any).webkitMatchesSelector as Element['matches']) ??
20 | // eslint-disable-next-line @typescript-eslint/no-explicit-any
21 | ((Element_prototype as any).msMatchesSelector as Element['matches']);
22 | }
23 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/modules/module-a.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | import {BaseClass} from './common-subclass.js';
12 | import './module-a-sub.js';
13 |
14 | const template = document.createElement('template');
15 | template.innerHTML = `
16 |
22 |
23 | `;
24 |
25 | class ModuleA extends BaseClass {
26 | static get template() {
27 | return template;
28 | }
29 | }
30 |
31 | customElements.define('module-a', ModuleA);
32 |
--------------------------------------------------------------------------------
/packages/custom-elements/externs/custom-elements.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2021 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be found
6 | * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may
7 | * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
8 | * Google as part of the polymer project is also subject to an additional IP
9 | * rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | // When building externally, this file is always assumed to be a module, but by
13 | // default it isn't when building internally, so we need this export statement.
14 | export {};
15 |
16 | declare global {
17 | interface CustomElementRegistry {
18 | forcePolyfill?: boolean;
19 | polyfillWrapFlushCallback?(outer: (fn: () => void) => void): void;
20 | noDocumentConstructionObserver?: boolean;
21 | shadyDomFastWalk?: boolean;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/packages/tests/environment.js:
--------------------------------------------------------------------------------
1 | /**
2 | * The test environment is intentionally imported into the test pages through
3 | * this _unbundled_ module so that the server middleware is the only step that
4 | * will compile out modules, if they aren't natively supported. This is
5 | * necessary to guarantee that their loading order matches the native behavior,
6 | * which is important here because `@web/test-runner-mocha` and the
7 | * dynamically-generated module that it imports depend on some of the polyfills
8 | * included here.
9 | *
10 | * Also, `chai` and `core-js` are only distributed as Common JS, but the server
11 | * middleware does not support compiling out Common JS, so they are each bundled
12 | * separately and those bundles are referenced here.
13 | */
14 |
15 | import './core-js_url-bundle.js';
16 | import 'whatwg-fetch';
17 | export {assert} from './chai-bundle.js';
18 | import {mocha, runTests as wtrRunTests} from '@web/test-runner-mocha';
19 |
20 | export const runTests = (...args) => {
21 | mocha.setup({ui: 'tdd'});
22 | return wtrRunTests(...args);
23 | };
24 |
--------------------------------------------------------------------------------
/packages/scoped-custom-element-registry/test/Element.test.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
23 |
24 |
25 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/style-paths-import.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
26 |
--------------------------------------------------------------------------------
/packages/shadydom/src/flush.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | import * as utils from './utils.js';
12 |
13 | // render enqueuer/flusher
14 | let flushList = [];
15 | let scheduled;
16 | export function enqueue(callback) {
17 | if (!scheduled) {
18 | scheduled = true;
19 | utils.microtask(flush);
20 | }
21 | flushList.push(callback);
22 | }
23 |
24 | export function flush() {
25 | scheduled = false;
26 | let didFlush = Boolean(flushList.length);
27 | while (flushList.length) {
28 | flushList.shift()();
29 | }
30 | return didFlush;
31 | }
32 |
33 | flush['list'] = flushList;
34 |
--------------------------------------------------------------------------------
/packages/tests/custom-elements/catchReportedErrors.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2019 The Polymer Project Authors. All rights reserved.
3 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6 | * Code distributed by Google as part of the polymer project is also subject to an additional IP
7 | * rights grant found at http://polymer.github.io/PATENTS.txt
8 | */
9 |
10 | // This needs to run first so that it can catch reported errors before Mocha's
11 | // global error handler does.
12 | window.catchReportedErrors = (() => {
13 | let currentHandler = undefined;
14 |
15 | window.addEventListener(
16 | 'error',
17 | (e) => {
18 | if (currentHandler) {
19 | currentHandler(e);
20 | }
21 | },
22 | true
23 | );
24 |
25 | return (fn, handler) => {
26 | currentHandler = handler;
27 | fn();
28 | currentHandler = undefined;
29 | };
30 | })();
31 |
--------------------------------------------------------------------------------
/packages/formdata-event/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7 |
8 | ## [Unreleased]
9 |
10 | - Add the design doc to the repo.
11 | ([#381](https://github.com/webcomponents/polyfills/pull/381))
12 | - Handle `stopPropagation` and `stopImmediatePropagation` calls on the 'submit'
13 | event. ([#379](https://github.com/webcomponents/polyfills/pull/379))
14 | - Capture browser APIs used in `dispatchFormdataForSubmission`.
15 | ([#370](https://github.com/webcomponents/polyfills/pull/370))
16 | - Modify the existing form to submit data from the FormData object.
17 | ([#361](https://github.com/webcomponents/polyfills/pull/361))
18 | - formdata event polyfill: Add support for legacy browsers.
19 | ([#363](https://github.com/webcomponents/polyfills/pull/363))
20 | - Initial, incomplete implementation of the 'formdata' event polyfill.
21 | ([#360](https://github.com/webcomponents/polyfills/pull/360))
22 |
--------------------------------------------------------------------------------
/packages/shadycss/src/common-regex.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | export const VAR_ASSIGN = /(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi;
12 | export const MIXIN_MATCH = /(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi;
13 | export const VAR_CONSUMED = /(--[\w-]+)\s*([:,;)]|$)/gi;
14 | export const ANIMATION_MATCH = /(animation\s*:)|(animation-name\s*:)/;
15 | export const MEDIA_MATCH = /@media\s(.*)/;
16 | export const IS_VAR = /^--/;
17 | export const BRACKETED = /\{[^}]*\}/g;
18 | export const HOST_PREFIX = '(?:^|[^.#[:])';
19 | export const HOST_SUFFIX = '($|[.:[\\s>+~])';
20 |
--------------------------------------------------------------------------------
/packages/formdata-event/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@webcomponents/formdata-event",
3 | "version": "0.0.3",
4 | "private": true,
5 | "publishConfig": {
6 | "access": "public"
7 | },
8 | "description": "'formdata' event polyfill",
9 | "license": "BSD-3-Clause",
10 | "repository": {
11 | "type": "git",
12 | "url": "https://github.com/webcomponents/polyfills.git",
13 | "directory": "packages/formdata-event"
14 | },
15 | "author": "The Polymer Project Authors (https://polymer.github.io/AUTHORS.txt)",
16 | "homepage": "https://github.com/webcomponents/polyfills/tree/master/packages/formdata-event",
17 | "bugs": "https://github.com/webcomponents/polyfills/issues?q=is%3Aissue+is%3Aopen+label%3A\"Package%3A+formdata-event\"",
18 | "main": "formdata-event.min.js",
19 | "scripts": {
20 | "build": "tsc && gulp",
21 | "build:watch": "chokidar --initial 'ts_src/**/*.ts' -c 'npm run build'",
22 | "prepack": "npm run build"
23 | },
24 | "files": [
25 | "CHANGELOG.md",
26 | "formdata-event.min.js*",
27 | "src/"
28 | ],
29 | "keywords": [
30 | "formdata",
31 | "event",
32 | "polyfill"
33 | ]
34 | }
35 |
--------------------------------------------------------------------------------
/packages/shadydom/src/patches/DocumentOrFragment.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 | import * as utils from '../utils.js';
11 | import {query} from './ParentNode.js';
12 |
13 | export const DocumentOrFragmentPatches = utils.getOwnPropertyDescriptors({
14 | /**
15 | * @this {Element}
16 | * @param {string} id
17 | */
18 | getElementById(id) {
19 | if (id === '') {
20 | return null;
21 | }
22 | let result = query(
23 | this,
24 | function (n) {
25 | return n.id == id;
26 | },
27 | function (n) {
28 | return Boolean(n);
29 | }
30 | )[0];
31 | return result || null;
32 | },
33 | });
34 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/modules/common-subclass.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | export class BaseClass extends HTMLElement {
12 | constructor() {
13 | super();
14 | const template = this.constructor.template;
15 | if (template) {
16 | if (window.ShadyCSS && !template._prepared) {
17 | window.ShadyCSS.prepareTemplate(template, this.localName);
18 | }
19 | this.attachShadow({mode: 'open'}).appendChild(
20 | template.content.cloneNode(true)
21 | );
22 | }
23 | }
24 | connectedCallback() {
25 | if (window.ShadyCSS) {
26 | window.ShadyCSS.styleElement(this);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/imports/template-import.html:
--------------------------------------------------------------------------------
1 |
10 |
11 |
17 |
18 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/packages/formdata-event/ts_src/index.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2020 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be
6 | * found at http://polymer.github.io/AUTHORS.txt The complete set of
7 | * contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code
8 | * distributed by Google as part of the polymer project is also subject to an
9 | * additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | import {install as installEvent} from './wrappers/event.js';
13 | import {install as installEventTarget} from './wrappers/event_target.js';
14 | import {install as installFormData} from './wrappers/form_data.js';
15 | import {install as installFormDataEvent} from './form_data_event.js';
16 | import {install as installHTMLFormElement} from './wrappers/html_form_element.js';
17 |
18 | if (window['FormDataEvent'] === undefined) {
19 | installEvent();
20 | installEventTarget();
21 | installFormData();
22 | installFormDataEvent();
23 | installHTMLFormElement();
24 | }
25 |
--------------------------------------------------------------------------------
/packages/custom-elements/ts_src/Deferred.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | * This code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be found
6 | * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may
7 | * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
8 | * Google as part of the polymer project is also subject to an additional IP
9 | * rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | export default class Deferred {
13 | private _value: T | undefined = undefined;
14 |
15 | private _resolve!: (val: T) => void;
16 |
17 | private readonly _promise: Promise;
18 | constructor() {
19 | this._promise = new Promise((resolve) => {
20 | this._resolve = resolve;
21 | });
22 | }
23 |
24 | resolve(value: T) {
25 | if (this._value) {
26 | throw new Error('Already resolved.');
27 | }
28 |
29 | this._value = value;
30 | this._resolve(value);
31 | }
32 |
33 | toPromise() {
34 | return this._promise;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/packages/formdata-event/ts_src/environment/node.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2020 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be
6 | * found at http://polymer.github.io/AUTHORS.txt The complete set of
7 | * contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code
8 | * distributed by Google as part of the polymer project is also subject to an
9 | * additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | export const constructor = window.Node;
13 |
14 | export const prototype = constructor.prototype;
15 |
16 | export const methods = {
17 | addEventListener: prototype.addEventListener,
18 | appendChild: prototype.appendChild,
19 | dispatchEvent: prototype.dispatchEvent,
20 | getRootNode: prototype.getRootNode,
21 | insertBefore: prototype.insertBefore,
22 | removeChild: prototype.removeChild,
23 | removeEventListener: prototype.removeEventListener,
24 | };
25 |
26 | export const descriptors = {
27 | parentNode: Object.getOwnPropertyDescriptor(prototype, 'parentNode')!,
28 | };
29 |
--------------------------------------------------------------------------------
/packages/shadycss/src/env.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2021 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be found
6 | * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may
7 | * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
8 | * Google as part of the polymer project is also subject to an additional IP
9 | * rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | // When building externally, this file is always assumed to be a module, but by
13 | // default it isn't when building internally, so we need this export statement.
14 | export {};
15 |
16 | declare global {
17 | interface Element {
18 | extends?: string;
19 | _element?: Element | null;
20 | __cssBuild?: string;
21 | }
22 |
23 | interface HTMLTemplateElement {
24 | _validating?: boolean;
25 | _prepared?: boolean;
26 | _domPrepared?: boolean;
27 | _content?: DocumentFragment | null;
28 | _gatheredStyle?: HTMLStyleElement | null;
29 | _style?: HTMLStyleElement | null;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/imports/a1-define.html:
--------------------------------------------------------------------------------
1 |
10 |
30 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug
3 | about: Report an error or other polyfill problem
4 | labels: 'Type: Bug, Focus Area: Standards & Polyfills'
5 | ---
6 |
7 | ### Description
8 |
9 |
14 |
15 | ### Example
16 |
17 |
21 |
22 | ### Steps to reproduce
23 |
24 |
32 |
33 | #### Expected behavior
34 |
35 |
36 |
37 | #### Actual behavior
38 |
39 |
40 |
41 | ### Version
42 |
43 |
49 |
50 | ### Browsers affected
51 |
52 |
53 |
54 | - [ ] Chrome
55 | - [ ] Firefox
56 | - [ ] Edge
57 | - [ ] Safari
58 | - [ ] IE 11
59 |
--------------------------------------------------------------------------------
/packages/shadydom/src/patches/Slotable.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | import * as utils from '../utils.js';
12 | import {shadyDataForNode} from '../shady-data.js';
13 |
14 | export const SlotablePatches = utils.getOwnPropertyDescriptors({
15 | /** @this {Node} */
16 | get assignedSlot() {
17 | // Force any parent's shadowRoot to flush so that distribution occurs
18 | // and this node has an assignedSlot.
19 | const parent = this[utils.SHADY_PREFIX + 'parentNode'];
20 | const ownerRoot = parent && parent[utils.SHADY_PREFIX + 'shadowRoot'];
21 | if (ownerRoot) {
22 | ownerRoot._render();
23 | }
24 | const nodeData = shadyDataForNode(this);
25 | return (nodeData && nodeData.assignedSlot) || null;
26 | },
27 | });
28 |
--------------------------------------------------------------------------------
/packages/html-imports/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@webcomponents/html-imports",
3 | "version": "1.3.1",
4 | "publishConfig": {
5 | "access": "public"
6 | },
7 | "description": "HTML Imports polyfill",
8 | "license": "BSD-3-Clause",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/webcomponents/polyfills.git",
12 | "directory": "packages/html-imports"
13 | },
14 | "author": "The Polymer Project Authors (https://polymer.github.io/AUTHORS.txt)",
15 | "homepage": "https://github.com/webcomponents/polyfills/tree/master/packages/html-imports",
16 | "bugs": "https://github.com/webcomponents/polyfills/issues?q=is%3Aissue+is%3Aopen+label%3A\"Package%3A+html-imports\"",
17 | "main": "html-imports.min.js",
18 | "scripts": {
19 | "build": "gulp",
20 | "build:watch": "chokidar --initial 'src/**/*.js' -c 'npm run build'",
21 | "debug": "cp src/html-imports.js html-imports.min.js",
22 | "prepack": "npm run build"
23 | },
24 | "files": [
25 | "CHANGELOG.md",
26 | "externs/",
27 | "html-imports.min.js*",
28 | "src/"
29 | ],
30 | "keywords": [
31 | "html-imports",
32 | "htmlimports",
33 | "web-components",
34 | "webcomponents",
35 | "polyfill",
36 | "shim"
37 | ]
38 | }
39 |
--------------------------------------------------------------------------------
/packages/shadydom/src/patches/Window.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 | import * as utils from '../utils.js';
11 | // prettier-ignore
12 | import {addEventListener, removeEventListener, dispatchEvent} from '../patch-events.js';
13 |
14 | export const WindowPatches = utils.getOwnPropertyDescriptors({
15 | // Ensure that `dispatchEvent` is patched directly on Window since on
16 | // IE11, Window does not descend from EventTarget.
17 | dispatchEvent,
18 |
19 | // NOTE: ensure these methods are bound to `window` so that `this` is correct
20 | // when called directly from global context without a receiver; e.g.
21 | // `addEventListener(...)`.
22 | addEventListener: addEventListener.bind(window),
23 |
24 | removeEventListener: removeEventListener.bind(window),
25 | });
26 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/csp.html:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 | parser Test
14 |
15 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/trusted-types/loader-only-test-page_src-replace_none-allowed.html:
--------------------------------------------------------------------------------
1 |
2 |
11 |
15 |
16 |
27 |
28 |
--------------------------------------------------------------------------------
/packages/webcomponentsjs/src/entrypoints/webcomponents-sd-ce-pf-index.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 | 'use strict';
11 |
12 | /*
13 | * Polyfills loaded: HTML Imports, Custom Elements, Shady DOM/Shady CSS, platform polyfills, template
14 | * Used in: IE 11
15 | */
16 |
17 | import './webcomponents-pf_js-index.js';
18 | import './webcomponents-pf_dom-index.js';
19 | import '../unresolved.js';
20 | import '../flag-parser.js';
21 | import '../../node_modules/@webcomponents/template/template.js';
22 | import '../../node_modules/@webcomponents/shadydom/src/shadydom.js';
23 | import '../../node_modules/@webcomponents/custom-elements/src/custom-elements.js';
24 | import '../../node_modules/@webcomponents/shadycss/entrypoints/scoping-shim.js';
25 | import '../../node_modules/@webcomponents/url/url.js';
26 |
--------------------------------------------------------------------------------
/packages/webcomponentsjs/ts_src/platform/baseuri.ts:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at
5 | http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
6 | http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
7 | found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
8 | part of the polymer project is also subject to an additional IP rights grant
9 | found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | export {};
13 |
14 | // Implement Node.baseURI for IE 11
15 | // adapted from
16 | // https://github.com/webcomponents/html-imports/blob/v1.2.0/src/html-imports.js
17 |
18 | const native_baseURI = Object.getOwnPropertyDescriptor(
19 | Node.prototype,
20 | 'baseURI'
21 | );
22 | if (!native_baseURI) {
23 | Object.defineProperty(Node.prototype, 'baseURI', {
24 | get(this: Node): string {
25 | // this.ownerDocument is `null` for documents
26 | const doc = this.ownerDocument || (this as Document);
27 | const base = doc.querySelector('base[href]') as HTMLBaseElement;
28 | return (base && base.href) || window.location.href;
29 | },
30 | configurable: true,
31 | enumerable: true,
32 | });
33 | }
34 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/trusted-types/loader-only-test-page_src-replace_loader-allowed.html:
--------------------------------------------------------------------------------
1 |
2 |
11 |
15 |
19 |
30 |
31 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/link-import.html:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 | HTMLImportsLoaded, native
14 |
21 |
22 |
23 |
24 |
25 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/packages/formdata-event/ts_src/environment_api/element.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2020 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be
6 | * found at http://polymer.github.io/AUTHORS.txt The complete set of
7 | * contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code
8 | * distributed by Google as part of the polymer project is also subject to an
9 | * additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | import {methods as ElementMethods} from '../environment/element.js';
13 |
14 | export const hasAttribute = (element: Element, name: string): boolean => {
15 | return ElementMethods.hasAttribute.call(element, name);
16 | };
17 |
18 | export const getAttribute = (element: Element, name: string): string | null => {
19 | return ElementMethods.getAttribute.call(element, name);
20 | };
21 |
22 | export const removeAttribute = (element: Element, name: string): void => {
23 | ElementMethods.removeAttribute.call(element, name);
24 | };
25 |
26 | export const setAttribute = (
27 | element: Element,
28 | name: string,
29 | value: string
30 | ): void => {
31 | ElementMethods.setAttribute.call(element, name, value);
32 | };
33 |
--------------------------------------------------------------------------------
/packages/shady-css-scoped-element/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@webcomponents/shady-css-scoped-element",
3 | "version": "0.0.8",
4 | "private": true,
5 | "publishConfig": {
6 | "access": "public"
7 | },
8 | "description": "ShadyCSS scoped element",
9 | "license": "BSD-3-Clause",
10 | "repository": {
11 | "type": "git",
12 | "url": "https://github.com/webcomponents/polyfills.git",
13 | "directory": "packages/shady-css-scoped-element"
14 | },
15 | "author": "The Polymer Project Authors (https://polymer.github.io/AUTHORS.txt)",
16 | "homepage": "https://github.com/webcomponents/polyfills/tree/master/packages/shady-css-scoped-element",
17 | "bugs": "https://github.com/webcomponents/polyfills/issues?q=is%3Aissue+is%3Aopen+label%3A\"Package%3A+shady-css-scoped-element\"",
18 | "main": "shady-css-scoped.min.js",
19 | "scripts": {
20 | "build": "gulp",
21 | "build:watch": "chokidar --initial 'src/**/*.js' -c 'npm run build'",
22 | "debug": "cp src/shady-css-scoped-element.js shady-css-scoped-element.min.js",
23 | "prepack": "npm run build"
24 | },
25 | "files": [
26 | "shady-css-scoped-element.min.js*",
27 | "src/"
28 | ],
29 | "keywords": [
30 | "custom-elements",
31 | "customelements",
32 | "web-components",
33 | "webcomponents",
34 | "polyfill",
35 | "shim"
36 | ]
37 | }
38 |
--------------------------------------------------------------------------------
/packages/formdata-event/ts_src/wrappers/html_form_element.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2020 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be
6 | * found at http://polymer.github.io/AUTHORS.txt The complete set of
7 | * contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code
8 | * distributed by Google as part of the polymer project is also subject to an
9 | * additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | // prettier-ignore
13 | import {prototype as HTMLFormElementPrototype, methods as HTMLFormElementMethods} from '../environment/html_form_element.js';
14 | import {dispatchFormdataForSubmission} from '../dispatch_formdata_for_submission.js';
15 |
16 | export const wrapSubmit = (
17 | prototype: {
18 | submit: HTMLFormElement['submit'];
19 | },
20 | original: HTMLFormElement['submit']
21 | ) => {
22 | prototype.submit = function (this: HTMLFormElement) {
23 | dispatchFormdataForSubmission(this);
24 | return original.call(this);
25 | };
26 | };
27 |
28 | export const install = () => {
29 | if (HTMLFormElementPrototype) {
30 | wrapSubmit(HTMLFormElementPrototype, HTMLFormElementMethods.submit);
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/packages/shadycss/examples/custom-style-element.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | /*
12 | Wrapper over
19 |
20 | */
21 | (function () {
22 | 'use strict';
23 |
24 | const CustomStyleInterface = window.ShadyCSS.CustomStyleInterface;
25 |
26 | class CustomStyle extends HTMLElement {
27 | constructor() {
28 | super();
29 | this._style = null;
30 | CustomStyleInterface.addCustomStyle(this);
31 | }
32 | getStyle() {
33 | if (!this._style) {
34 | this._style = this.querySelector('style');
35 | }
36 | return this._style;
37 | }
38 | }
39 |
40 | window.CustomStyle = CustomStyle;
41 | window.customElements.define('custom-style', CustomStyle);
42 | })();
43 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/load-loop.html:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 | load loop Test
14 |
15 |
22 |
23 |
26 |
27 |
28 |
29 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/.github/workflows/changelog.yml:
--------------------------------------------------------------------------------
1 | # This action requires that any PR targeting the master branch should touch at
2 | # least one CHANGELOG file. If a CHANGELOG entry is not required, add the "Skip
3 | # Changelog" label to disable this action.
4 |
5 | name: changelog
6 |
7 | on:
8 | pull_request:
9 | types: [opened, synchronize, reopened, labeled, unlabeled]
10 | branches:
11 | - master
12 |
13 | jobs:
14 | changelog:
15 | runs-on: ubuntu-latest
16 | if: "!contains(github.event.pull_request.labels.*.name, 'Skip Changelog')"
17 |
18 | steps:
19 | - uses: actions/checkout@v2
20 |
21 | - name: Check for CHANGELOG changes
22 | run: |
23 | # Only the latest commit of the feature branch is available
24 | # automatically (see https://github.com/webcomponents/polyfills). To
25 | # diff with the base branch, we need to fetch that too (and we only
26 | # need its latest commit).
27 | git fetch origin ${{ github.base_ref }} --depth=1
28 | if [[ $(git diff --name-only FETCH_HEAD | grep CHANGELOG) ]]
29 | then
30 | echo "A CHANGELOG was modified. Looks good!"
31 | else
32 | echo "No CHANGELOG was modified."
33 | echo "Please add a CHANGELOG entry, or add the \"Skip Changelog\" label if not required."
34 | false
35 | fi
36 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/load-svg-style.html:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 | Style in SVG loads
14 |
21 |
22 |
23 |
24 |
25 |
26 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/packages/tests/html-imports/html/dynamic-importer.html:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 | HTML Dynamic Importer
14 |
15 |
22 |
23 |
24 |
25 |
26 |
27 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/packages/custom-elements/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@webcomponents/custom-elements",
3 | "version": "1.6.0",
4 | "publishConfig": {
5 | "access": "public"
6 | },
7 | "description": "HTML Custom Elements Polyfill",
8 | "license": "BSD-3-Clause",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/webcomponents/polyfills.git",
12 | "directory": "packages/custom-elements"
13 | },
14 | "author": "The Polymer Project Authors (https://polymer.github.io/AUTHORS.txt)",
15 | "homepage": "https://github.com/webcomponents/polyfills/tree/master/packages/custom-elements",
16 | "bugs": "https://github.com/webcomponents/polyfills/issues?q=is%3Aissue+is%3Aopen+label%3A\"Package%3A+custom-elements\"",
17 | "main": "custom-elements.min.js",
18 | "scripts": {
19 | "build": "tsc && gulp",
20 | "build:watch": "chokidar --initial 'ts_src/**/*.ts' -c 'npm run build'",
21 | "debug": "rollup -c",
22 | "prepack": "npm run build"
23 | },
24 | "files": [
25 | "CHANGELOG.md",
26 | "custom-elements.min.js*",
27 | "externs/",
28 | "src/"
29 | ],
30 | "keywords": [
31 | "custom-elements",
32 | "customelements",
33 | "web-components",
34 | "webcomponents",
35 | "polyfill",
36 | "shim"
37 | ],
38 | "devDependencies": {
39 | "@webcomponents/html-imports": "^1.3.1",
40 | "@webcomponents/shadydom": "^1.11.0"
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/packages/shadydom/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@webcomponents/shadydom",
3 | "version": "1.11.0",
4 | "publishConfig": {
5 | "access": "public"
6 | },
7 | "description": "Shadow DOM polyfill",
8 | "license": "BSD-3-Clause",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/webcomponents/polyfills.git",
12 | "directory": "packages/shadydom"
13 | },
14 | "author": "The Polymer Project Authors (https://polymer.github.io/AUTHORS.txt)",
15 | "homepage": "https://github.com/webcomponents/polyfills/tree/master/packages/shadydom",
16 | "bugs": "https://github.com/webcomponents/polyfills/issues?q=is%3Aissue+is%3Aopen+label%3A\"Package%3A+shadydom\"",
17 | "main": "shadydom.min.js",
18 | "scripts": {
19 | "build": "gulp",
20 | "build:watch": "chokidar --initial 'src/**/*.js' -c 'npm run build'",
21 | "debug": "rollup -c",
22 | "prepack": "npm run build",
23 | "regen-package-lock": "rm -rf node_modules package-lock.json; npm install"
24 | },
25 | "files": [
26 | "CHANGELOG.md",
27 | "externs/**/*.d.ts",
28 | "externs/**/*.js",
29 | "LICENSE.md",
30 | "shadydom.min.js*",
31 | "src/**/*.js",
32 | "README.md"
33 | ],
34 | "keywords": [
35 | "shady-dom",
36 | "shadydom",
37 | "shadow-dom",
38 | "shadowdom",
39 | "web-components",
40 | "webcomponents",
41 | "polyfill",
42 | "shim"
43 | ]
44 | }
45 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | ############################################
2 | # GENERATED BY IGNORE-SYNC, DO NOT EDIT!!! #
3 | # https://github.com/foray1010/ignore-sync #
4 | ############################################
5 |
6 | # global
7 | node_modules/
8 | coverage/
9 | lerna-debug.log
10 |
11 | # shared in packages
12 | packages/*/node_modules/
13 | packages/*/buildcache
14 | packages/*/*.tgz
15 | packages/*/*.min.js*
16 |
17 | # custom-elements package
18 | packages/custom-elements/src/
19 |
20 | # formdata-event package
21 | packages/formdata-event/src/
22 |
23 | # html-imports package
24 | packages/html-imports/html-imports.min.js*
25 |
26 | # shadycss package
27 | packages/shadycss/src/interface.*
28 | packages/shadycss/.tsbuildinfo
29 |
30 | # tests package
31 | packages/tests/chai-bundle.js
32 | packages/tests/core-js_url-bundle.js
33 | packages/tests/shadycss/module/generated/
34 |
35 | # webcomponentsjs package
36 | packages/webcomponentsjs/bundles/
37 | packages/webcomponentsjs/src/platform/
38 | packages/webcomponentsjs/src/flag-parser.*
39 | packages/webcomponentsjs/src/unresolved.*
40 | packages/webcomponentsjs/custom-elements-es5-adapter.js
41 | packages/webcomponentsjs/webcomponents-bundle.d.ts
42 | packages/webcomponentsjs/webcomponents-bundle.js*
43 |
44 | packages/scoped-custom-element-registry/**/.wireit/
45 | packages/scoped-custom-element-registry/**/.tsbuildinfo
46 | packages/scoped-custom-element-registry/**/build/
47 |
--------------------------------------------------------------------------------
/packages/formdata-event/ts_src/environment/event.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2020 The Polymer Project Authors. All rights reserved. This
4 | * code may only be used under the BSD style license found at
5 | * http://polymer.github.io/LICENSE.txt The complete set of authors may be
6 | * found at http://polymer.github.io/AUTHORS.txt The complete set of
7 | * contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code
8 | * distributed by Google as part of the polymer project is also subject to an
9 | * additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10 | */
11 |
12 | // Without this explicit type, TS seems to think that `window.Event` is the
13 | // wrapper from `wrappers/event.ts` at this point, which is typed in terms of
14 | // this binding, causing a cycle in its type.
15 | export const constructor: typeof Event = window.Event;
16 |
17 | export const prototype = constructor.prototype;
18 |
19 | export const methods = {
20 | initEvent: prototype.initEvent,
21 | stopImmediatePropagation: prototype?.stopImmediatePropagation,
22 | stopPropagation: prototype?.stopPropagation,
23 | };
24 |
25 | export const descriptors = {
26 | defaultPrevented: Object.getOwnPropertyDescriptor(
27 | prototype,
28 | 'defaultPrevented'
29 | )!,
30 | target: Object.getOwnPropertyDescriptor(prototype, 'target')!,
31 | type: Object.getOwnPropertyDescriptor(prototype, 'type')!,
32 | };
33 |
--------------------------------------------------------------------------------
/packages/tests/shadycss/module/make-element.js:
--------------------------------------------------------------------------------
1 | /**
2 | @license
3 | Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | /*
12 | A simple webcomponents helper
13 | */
14 | 'use strict';
15 |
16 | window.makeElement = (name, connectedCallback) => {
17 | let template = document.querySelector(`template#${name}`);
18 | if (template && window.ShadyCSS) {
19 | window.ShadyCSS.prepareTemplate(template, name);
20 | }
21 | window.customElements.define(
22 | name,
23 | class extends window.HTMLElement {
24 | connectedCallback() {
25 | window.ShadyCSS && window.ShadyCSS.styleElement(this);
26 | if (!this.shadowRoot) {
27 | this.attachShadow({mode: 'open'});
28 | if (template) {
29 | this.shadowRoot.appendChild(template.content.cloneNode(true));
30 | }
31 | }
32 | if (connectedCallback) {
33 | connectedCallback.call(this);
34 | }
35 | }
36 | }
37 | );
38 | };
39 |
--------------------------------------------------------------------------------
/packages/tests/webcomponentsjs_/imports/simple-element.js:
--------------------------------------------------------------------------------
1 | /*
2 | @license
3 | Copyright(c) 2016 The Polymer Project Authors.All rights reserved.
4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | Code distributed by Google as part of the polymer project is also
8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | // Kick off shady CSS.
12 | var template = document.createElement('template');
13 | template.innerHTML = `
14 |
15 |
Shadow DOM
16 |
17 | `;
18 | if (template) {
19 | if (window.ShadyCSS) {
20 | window.ShadyCSS.prepareTemplate(template, 'simple-element');
21 | }
22 | }
23 |
24 | class SimpleElement extends HTMLElement {
25 | constructor() {
26 | super();
27 | this.bestName = 'batman';
28 | if (window.ShadyCSS) {
29 | window.ShadyCSS.styleElement(this);
30 | }
31 |
32 | if (template && !this.shadowRoot) {
33 | this.attachShadow({mode: 'open'});
34 | this.shadowRoot.appendChild(document.importNode(template.content, true));
35 | }
36 | }
37 | }
38 |
39 | window.customElements.define('simple-element', SimpleElement);
40 |
--------------------------------------------------------------------------------
/packages/html-imports/gulpfile.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 | * Code distributed by Google as part of the polymer project is also
8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 | */
10 |
11 | 'use strict';
12 |
13 | const gulp = require('gulp');
14 | const sourcemaps = require('gulp-sourcemaps');
15 | const closure = require('google-closure-compiler').gulp();
16 | const closureOptions = {
17 | compilation_level: 'ADVANCED',
18 | warning_level: 'VERBOSE',
19 | language_in: 'STABLE',
20 | language_out: 'ES5_STRICT',
21 | externs: ['externs/html-imports.js'],
22 | js_output_file: 'html-imports.min.js',
23 | assume_function_wrapper: true,
24 | isolation_mode: 'IIFE',
25 | rewrite_polyfills: false,
26 | dependency_mode: 'PRUNE',
27 | entry_point: 'src/html-imports.js',
28 | };
29 |
30 | gulp.task('default', () => {
31 | return gulp
32 | .src(['./src/html-imports.js'], {base: './', follow: true})
33 | .pipe(sourcemaps.init())
34 | .pipe(closure(closureOptions))
35 | .pipe(sourcemaps.write('.'))
36 | .pipe(gulp.dest('.'));
37 | });
38 |
--------------------------------------------------------------------------------
/packages/html-imports/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7 |
8 |
9 |
10 | ## [1.3.1] - 2023-03-20
11 |
12 | - Update dependencies ([#542](https://github.com/webcomponents/polyfills/pull/542))
13 |
14 | ## [1.3.0] - 2021-08-02
15 |
16 | - Add TS externs. ([#457](https://github.com/webcomponents/polyfills/pull/457))
17 | - Upstream cl/345169174: Fix calls to XMLHttpRequest#getResponseHeader to accept
18 | null as a return value.
19 | ([#433](https://github.com/webcomponents/polyfills/pull/433))
20 |
21 | ## [1.2.6] - 2020-10-21
22 |
23 | - Maintenance release (no user-facing changes)
24 |
25 | ## [1.2.5] - 2020-07-20
26 |
27 | - Maintenance release (no user-facing changes)
28 |
29 | ## [1.2.4] - 2020-03-16
30 |
31 | - Maintenance release (no user-facing changes)
32 |
33 | ## [1.2.3] - 2020-02-26
34 |
35 | - Maintenance release (no user-facing changes)
36 |
37 | ## [1.2.2] - 2019-09-19
38 |
39 | - Fix bug where `