Repository: Polymer/polymer Branch: master Commit: 26171d338534 Files: 245 Total size: 2.5 MB Directory structure: gitextract_axbv8l9c/ ├── .eslintrc.json ├── .gitattributes ├── .github/ │ ├── CODEOWNERS │ ├── ISSUE_TEMPLATE.md │ ├── PULL_REQUEST_TEMPLATE.md │ └── stale.yml ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.txt ├── README.md ├── RELEASING.md ├── externs/ │ ├── .gitignore │ ├── .npmignore │ ├── polymer-dom-api-externs.js │ ├── polymer-externs.js │ ├── polymer-iconset-externs.js │ ├── polymer-internal-shared-types.js │ ├── polymer-internal-types.html │ └── webcomponents-externs.js ├── gulpfile.js ├── index.html ├── interfaces.d.ts ├── lib/ │ ├── elements/ │ │ ├── array-selector.d.ts │ │ ├── array-selector.js │ │ ├── custom-style.d.ts │ │ ├── custom-style.js │ │ ├── dom-bind.d.ts │ │ ├── dom-bind.js │ │ ├── dom-if.d.ts │ │ ├── dom-if.js │ │ ├── dom-module.d.ts │ │ ├── dom-module.js │ │ ├── dom-repeat.d.ts │ │ └── dom-repeat.js │ ├── legacy/ │ │ ├── class.d.ts │ │ ├── class.js │ │ ├── legacy-data-mixin.d.ts │ │ ├── legacy-data-mixin.js │ │ ├── legacy-element-mixin.d.ts │ │ ├── legacy-element-mixin.js │ │ ├── mutable-data-behavior.d.ts │ │ ├── mutable-data-behavior.js │ │ ├── polymer-fn.d.ts │ │ ├── polymer-fn.js │ │ ├── polymer.dom.d.ts │ │ ├── polymer.dom.js │ │ ├── templatizer-behavior.d.ts │ │ └── templatizer-behavior.js │ ├── mixins/ │ │ ├── dir-mixin.d.ts │ │ ├── dir-mixin.js │ │ ├── disable-upgrade-mixin.d.ts │ │ ├── disable-upgrade-mixin.js │ │ ├── element-mixin.d.ts │ │ ├── element-mixin.js │ │ ├── gesture-event-listeners.d.ts │ │ ├── gesture-event-listeners.js │ │ ├── mutable-data.d.ts │ │ ├── mutable-data.js │ │ ├── properties-changed.d.ts │ │ ├── properties-changed.js │ │ ├── properties-mixin.d.ts │ │ ├── properties-mixin.js │ │ ├── property-accessors.d.ts │ │ ├── property-accessors.js │ │ ├── property-effects.d.ts │ │ ├── property-effects.js │ │ ├── strict-binding-parser.d.ts │ │ ├── strict-binding-parser.js │ │ ├── template-stamp.d.ts │ │ └── template-stamp.js │ └── utils/ │ ├── array-splice.d.ts │ ├── array-splice.js │ ├── async.d.ts │ ├── async.js │ ├── boot.d.ts │ ├── boot.js │ ├── case-map.d.ts │ ├── case-map.js │ ├── debounce.d.ts │ ├── debounce.js │ ├── flattened-nodes-observer.d.ts │ ├── flattened-nodes-observer.js │ ├── flush.d.ts │ ├── flush.js │ ├── gestures.d.ts │ ├── gestures.js │ ├── hide-template-controls.d.ts │ ├── hide-template-controls.js │ ├── html-tag.d.ts │ ├── html-tag.js │ ├── mixin.d.ts │ ├── mixin.js │ ├── path.d.ts │ ├── path.js │ ├── render-status.d.ts │ ├── render-status.js │ ├── resolve-url.d.ts │ ├── resolve-url.js │ ├── scope-subtree.d.ts │ ├── scope-subtree.js │ ├── settings.d.ts │ ├── settings.js │ ├── style-gather.d.ts │ ├── style-gather.js │ ├── telemetry.d.ts │ ├── telemetry.js │ ├── templatize.d.ts │ ├── templatize.js │ ├── unresolved.d.ts │ ├── unresolved.js │ ├── wrap.d.ts │ └── wrap.js ├── manifest.json ├── package.json ├── polymer-element.d.ts ├── polymer-element.js ├── polymer-legacy.d.ts ├── polymer-legacy.js ├── test/ │ ├── .eslintignore │ ├── .eslintrc.json │ ├── perf/ │ │ ├── binding-expressions.html │ │ └── perf-tests.html │ ├── runner.html │ ├── smoke/ │ │ ├── alacarte-property-accessors.html │ │ ├── alacarte-property-effects-ordering.html │ │ ├── alacarte-property-effects.html │ │ ├── alacarte-template-stamp.html │ │ ├── behavior-mixin.html │ │ ├── data-table.html │ │ ├── dirty-check.html │ │ ├── disable-upgrade.html │ │ ├── disabled-attr-gestures.html │ │ ├── dom-if.html │ │ ├── gestures.html │ │ ├── html-tag.html │ │ ├── label-click.html │ │ ├── ordering-test.html │ │ ├── passive-gestures.html │ │ └── style-props/ │ │ ├── src/ │ │ │ ├── elements-defaults.js │ │ │ ├── elements.js │ │ │ ├── scopes.js │ │ │ └── settings.js │ │ └── test.html │ └── unit/ │ ├── array-selector-elements.js │ ├── array-selector.html │ ├── async.html │ ├── attributes-elements.js │ ├── attributes.html │ ├── behaviors.html │ ├── case-map.html │ ├── class-properties.html │ ├── configure.html │ ├── css-parse.html │ ├── custom-style-async-import.html │ ├── custom-style-async-import.js │ ├── custom-style-async.html │ ├── custom-style-import.js │ ├── custom-style-late.html │ ├── custom-style-scope-cache.html │ ├── custom-style.html │ ├── debounce.html │ ├── dir.html │ ├── disable-upgrade.html │ ├── dom-bind-elements1.js │ ├── dom-bind-elements2.js │ ├── dom-bind.html │ ├── dom-if-elements.js │ ├── dom-if.html │ ├── dom-repeat-elements.js │ ├── dom-repeat.html │ ├── dynamic-import.html │ ├── dynamic-imports/ │ │ ├── async-import.html │ │ ├── async.html │ │ ├── dynamic-element.js │ │ ├── inner-element.js │ │ └── outer-element.html │ ├── events-elements.js │ ├── events.html │ ├── flattened-nodes-observer.html │ ├── gestures-elements.js │ ├── gestures.html │ ├── globals.html │ ├── html-tag.html │ ├── importHref.html │ ├── inheritance.html │ ├── legacy-data.html │ ├── legacy-noattributes.html │ ├── legacy-undefined.html │ ├── logging.html │ ├── mixin-behaviors.html │ ├── mixin-utils.html │ ├── multi-style.html │ ├── path-effects-elements.js │ ├── path-effects.html │ ├── path.html │ ├── polymer-dom-nopatch.html │ ├── polymer-dom-observeNodes.html │ ├── polymer-dom.html │ ├── polymer-element-with-apply-import.js │ ├── polymer-element-with-apply.html │ ├── polymer.element.html │ ├── polymer.legacyelement.html │ ├── polymer.properties-mixin-with-property-accessors.html │ ├── polymer.properties-mixin.html │ ├── properties-changed.html │ ├── property-accessors.html │ ├── property-effects-elements.js │ ├── property-effects-template.html │ ├── property-effects.html │ ├── ready-attached-order-class.html │ ├── ready-attached-order.html │ ├── render-status.html │ ├── resolveurl.html │ ├── shady-content.html │ ├── shady-dynamic.html │ ├── shady-events.html │ ├── shady-unscoped-style-import.js │ ├── shady-unscoped-style.html │ ├── shady.html │ ├── strict-template-policy.html │ ├── styling-build-adopted-stylesheets.html │ ├── styling-cross-scope-apply.html │ ├── styling-cross-scope-unknown-host.html │ ├── styling-cross-scope-var.html │ ├── styling-import-host2.css │ ├── styling-import-shared-styles.js │ ├── styling-only-with-template.html │ ├── styling-scoped-nopatch.html │ ├── styling-scoped.html │ ├── sub/ │ │ ├── resolveurl-elements.js │ │ ├── style-import.js │ │ ├── x-sub.html │ │ └── x-test.html │ ├── template-stamp.html │ ├── template-whitespace.html │ ├── templatize-elements.js │ ├── templatize.html │ └── wct-browser-config.js ├── util/ │ ├── .eslintrc.json │ ├── gen-changelog.sh │ ├── minimalDocument.js │ └── travis-sauce-test.sh └── wct.conf.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .eslintrc.json ================================================ { "extends": "eslint:recommended", "parser": "babel-eslint", "parserOptions": { "ecmaVersion": 6, "sourceType": "module" }, "rules": { "no-console": "off", "no-var": "error", "semi": "error", "strict": "error", "valid-jsdoc": ["error", { "requireReturn": false, "prefer": { "arg": "param", "argument": "param", "returns": "return" }, "preferType": { "Boolean": "boolean", "Number": "number", "String": "string", "object": "Object", "array": "Array" } }], "no-useless-escape": "off" }, "env": { "browser": true, "es6": true }, "plugins": [ "html" ], "globals": { "customElements": true, "HTMLImports": true, "Polymer": true, "ShadyDOM": true, "ShadyCSS": true, "JSCompiler_renameProperty": true, "trustedTypes": true } } ================================================ FILE: .gitattributes ================================================ * text=auto ================================================ FILE: .github/CODEOWNERS ================================================ # Code owners for Polymer * @sorvell @kevinpschaaf @azakus ================================================ FILE: .github/ISSUE_TEMPLATE.md ================================================ ### Description #### Live Demo https://jsbin.com/luhaxab/edit https://glitch.com/edit/#!/polymer-repro?path=my-element.html:2:0 #### Steps to Reproduce #### Expected Results #### Actual Results ### Browsers Affected - [ ] Chrome - [ ] Firefox - [ ] Edge - [ ] Safari 11 - [ ] Safari 10 - [ ] IE 11 ### Versions - Polymer: vX.X.X - webcomponents: vX.X.X ================================================ FILE: .github/PULL_REQUEST_TEMPLATE.md ================================================ ### Reference Issue ================================================ FILE: .github/stale.yml ================================================ # Mark issues stale after 1 year daysUntilStale: 365 # Delete stale issues after 2 years daysUntilClose: 730 markComment: > This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. closeComment: > This issue has been automatically closed after being marked stale. If you're still facing this problem with the above solution, please comment and we'll reopen! ================================================ FILE: .gitignore ================================================ # dependencies bower_components node_modules # compiled output dist # IDEs .idea .vscode # misc .DS_Store npm-debug.log # Analyzer output used in the docs analysis.json # NPM artifact polymer-polymer-*.tgz ================================================ FILE: .travis.yml ================================================ language: node_js sudo: false dist: xenial node_js: '10' services: - xvfb addons: firefox: latest chrome: stable cache: directories: - node_modules before_script: - npm install -g gulp-cli@1 - gulp lint-eslint script: - node ./node_modules/.bin/polymer test --npm --module-resolution=node -l chrome - node ./node_modules/.bin/polymer test --npm --module-resolution=node -l firefox - if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then travis_wait 30 ./util/travis-sauce-test.sh; fi env: global: - secure: bfF/o1ewpOxDNqTzWfvlwgRgGfP8OXhSQLLdEwZ6izO9tckMJuSNghk3qBXCEQJwTcUEyXP6EqfzIrRAvDXPa0H3OoinbrooDyV2wIDaVRK++WR2iZIqzqo3hGOdzm4tdrGJZe5av5Rk661Hls8aPfLbjdzcGuYXi8B4wZq2xMI= - secure: jBrKtQBdoL2dsXi9BQpw5tMkYZOsQAy2iSB+0xPOxhPI8EbXKnm8OhWQDEJ5TdduLWUxLLc12IJwjBy9ocLlC1ZvzgOXNfqOUkLD03qSPnyT/LomTXeP4XuojUAemc/w1MHd61nFz4YJaO8cQ+yfy6GOX2susabW+Y80mnIeGJk= ================================================ FILE: CHANGELOG.md ================================================ # Change Log ## [v3.5.2] (2024-10-07) - FlattenedNodesObserver.getFlattenedNodes was accidentally quadratic if given a non-slot node. Found by @mvanbem-goog. ## [v3.5.1](https://github.com/Polymer/polymer/tree/v3.5.1) (2022-06-03) - [ci skip] bump to 3.5.1 ([commit](https://github.com/Polymer/polymer/commit/2cbb3d2b)) - `_valueToNodeAttribute` converts the empty string to `trustedTypes.emptyScript` before setting, if available. ([commit](https://github.com/Polymer/polymer/commit/d69041cc)) - Adds Trusted Types support for reflected boolean properties. ([commit](https://github.com/Polymer/polymer/commit/ce474db9)) - [ci skip] update changelog ([commit](https://github.com/Polymer/polymer/commit/76e77b6d)) ## [v3.5.0](https://github.com/Polymer/polymer/tree/v3.5.0) (2022-05-18) - [ci skip] bump to 3.5.0 ([commit](https://github.com/Polymer/polymer/commit/a800a1a9)) - Add `CHANGELOG.md` to the packaged files. ([commit](https://github.com/Polymer/polymer/commit/6696976e)) - Upstream http://cl/374717449 ([commit](https://github.com/Polymer/polymer/commit/adc6d517)) - Upstream http://cl/362104095 ([commit](https://github.com/Polymer/polymer/commit/96897876)) - Upstream http://cl/368587394 ([commit](https://github.com/Polymer/polymer/commit/4036db44)) - Upstream http://cl/330613283 ([commit](https://github.com/Polymer/polymer/commit/178dfa5e)) - Upstream http://cl/397536696 ([commit](https://github.com/Polymer/polymer/commit/2445554f)) - Upstream http://cl/374930792 ([commit](https://github.com/Polymer/polymer/commit/4a85c7f9)) - Upstream http://cl/438642754 ([commit](https://github.com/Polymer/polymer/commit/8582dd64)) - Upstream http://cl/387624221 ([commit](https://github.com/Polymer/polymer/commit/067dd302)) - Upstream http://cl/420889188 ([commit](https://github.com/Polymer/polymer/commit/d0d39b8d)) - Upstream http://cl/416087593 ([commit](https://github.com/Polymer/polymer/commit/ec36597f)) - Fix typo in dom-repeat.js ([commit](https://github.com/Polymer/polymer/commit/7b37193e)) - Update polymer -> lit link to point at new lit repo instead of old lit-element repo ([commit](https://github.com/Polymer/polymer/commit/4586fed6)) - Add support for TrustedTypes (#5692) ([commit](https://github.com/Polymer/polymer/commit/10220c9a)) - Fix typo in disable-upgrade-mixin.js ([commit](https://github.com/Polymer/polymer/commit/5c06ae9b)) - Fix `Polymer.dom(el).attachShadow/shadowRoot` ([commit](https://github.com/Polymer/polymer/commit/2b0494a9)) - Fix typo in dom-module.js ([commit](https://github.com/Polymer/polymer/commit/69eb8a7a)) - Fix SyntaxError ([commit](https://github.com/Polymer/polymer/commit/1e9be28d)) - Upstream internal error suppression. ([commit](https://github.com/Polymer/polymer/commit/2515cd21)) - Updated Readme ([commit](https://github.com/Polymer/polymer/commit/78602fcc)) - Fix let back to const ([commit](https://github.com/Polymer/polymer/commit/04a4ded8)) - Cancel chunking when disconnected. Fixes #5667 ([commit](https://github.com/Polymer/polymer/commit/32d7d61d)) - Accept function in legacy _template field for template parsing. Fixes #5660 ([commit](https://github.com/Polymer/polymer/commit/22ac86a8)) - Upstream internal type differences. ([commit](https://github.com/Polymer/polymer/commit/9e8df682)) - Remove types from LegacyElementMixin's overridden setAttribute and removeAttribute. ([commit](https://github.com/Polymer/polymer/commit/00b36709)) - [ci skip] update changelog ([commit](https://github.com/Polymer/polymer/commit/6acf6e3c)) ## [v3.4.1](https://github.com/Polymer/polymer/tree/v3.4.1) (2020-04-29) - [ci skip] bump to 3.4.1 ([commit](https://github.com/Polymer/polymer/commit/12fa1b50)) - Add type for DomApiNative's setAttribute method. ([commit](https://github.com/Polymer/polymer/commit/024ab01e)) - Remove gen-typescript-declarations; manually add LegacyElementMixin's setAttribute type. ([commit](https://github.com/Polymer/polymer/commit/e717f0f0)) - Remove "DO NOT EDIT" warning comments. ([commit](https://github.com/Polymer/polymer/commit/8b2ea7bc)) - Track TypeScript declarations. ([commit](https://github.com/Polymer/polymer/commit/ec7b7c55)) - Update Closure types for overridden setAttribute in LegacyElementMixin. ([commit](https://github.com/Polymer/polymer/commit/604856b2)) - Add method / parameter descriptions. ([commit](https://github.com/Polymer/polymer/commit/370ae5eb)) - Fix TypeScript breakages by specifying types for overridden `setAttribute` and `getAttribute`. ([commit](https://github.com/Polymer/polymer/commit/c8715b50)) - Add complete commit list for v3.4.0 ([commit](https://github.com/Polymer/polymer/commit/e47493b0)) - Fix a couple more compiler warnings ([commit](https://github.com/Polymer/polymer/commit/ad2bca18)) - Typos and other minor changes. ([commit](https://github.com/Polymer/polymer/commit/a55e248d)) - Add a note about a bug fix for chunking. ([commit](https://github.com/Polymer/polymer/commit/002c98a0)) - Add `useAdoptedStyleSheetsWithBuiltCSS` section. ([commit](https://github.com/Polymer/polymer/commit/d9fc4fbf)) - Add setters to settings titles. ([commit](https://github.com/Polymer/polymer/commit/9c78b481)) - Add a note about `orderedComputed` and cycles. ([commit](https://github.com/Polymer/polymer/commit/c181c3d8)) - Add example of overriding `suppressTemplateNotifications` via `notify-dom-change`. ([commit](https://github.com/Polymer/polymer/commit/1fa4948b)) - Add a section about automatic use of constructable stylesheets. ([commit](https://github.com/Polymer/polymer/commit/d9c18b47)) - Add "Other new features" section for `reuseChunkedInstances` and `LegacyElementMixin`'s built-in `disable-upgrade` support. ([commit](https://github.com/Polymer/polymer/commit/7a2e9f81)) - Added notes for `fastDomIf`, `removeNestedTemplates`, `suppressNestedTemplates`, and `suppressTemplateNotifications`. ([commit](https://github.com/Polymer/polymer/commit/3b6494bf)) - Started on release notes for `legacyUndefined`, `legacyWarnings`, `orderedComputed`. (...) ([commit](https://github.com/Polymer/polymer/commit/d80fdca0)) - Remove unused externs. ([commit](https://github.com/Polymer/polymer/commit/0da4e63f)) ## [v3.4.0](https://github.com/Polymer/polymer/tree/v3.4.0) (2020-04-23) ### New global settings This update to Polymer includes some new [global settings](https://polymer-library.polymer-project.org/3.0/docs/devguide/settings): - `legacyUndefined` / `setLegacyUndefined` **What does it do?** This setting reverts how computed properties handle `undefined` values to the Polymer 1 behavior: when enabled, computed properties will only be recomputed if none of their dependencies are `undefined`. Components can override the global setting by setting their `_overrideLegacyUndefined` property to `true`. This is useful for reenabling the default behavior as you migrate individual components: ```js import {PolymerElement, html} from '@polymer/polymer/polymer-element.js'; class MigratedElement extends PolymerElement { /* ... */ } // All MigratedElement instances will use the default behavior. MigratedElement.prototype._overrideLegacyUndefined = true; customElements.define('migrated-element', SomeElement); ``` **Should I use it?** This setting should only be used for migrating legacy codebases that depend on this behavior and is otherwise **not recommended**. - `legacyWarnings` / `setLegacyWarnings` **What does it do?** This setting causes Polymer to warn if a component's template contains bindings to properties that are not listed in that element's [`properties` block](https://polymer-library.polymer-project.org/3.0/docs/devguide/properties). For example: ```js import {PolymerElement, html} from '@polymer/polymer/polymer-element.js'; class SomeElement extends PolymerElement { static get template() { return html`[[someProperty]] is used here`; } static get properties() { return { /* but `someProperty` is not declared here */ }; } } customElements.define('some-element', SomeElement); ``` Only properties explicitly declared in the `properties` block are [associated with an attribute](https://polymer-library.polymer-project.org/3.0/docs/devguide/properties#property-name-mapping) and [update when that attribute changes](https://polymer-library.polymer-project.org/3.0/docs/devguide/properties#attribute-deserialization). Enabling this setting will show you where you might have forgotten to declare properties. **Should I use it?** Consider using this feature during development but don't enable it in production. - `orderedComputed` / `setOrderedComputed` **What does it do?** This setting causes Polymer to topologically sort each component's computed properties graph when the class is initialized and uses that order whenever computed properties are run. For example: ```js import {PolymerElement, html} from '@polymer/polymer/polymer-element.js'; class SomeElement extends PolymerElement { static get properties() { return { a: {type: Number, value: 0}, b: {type: Number, computed: 'computeB(a)'}, c: {type: Number, computed: 'computeC(a, b)'}, }; } computeB(a) { console.log('Computing b...'); return a + 1; } computeC(a, b) { console.log('Computing c...'); return (a + b) * 2; } } customElements.define('some-element', SomeElement); ``` When `a` changes, Polymer's default behavior does not specify the order in which its dependents will run. Given that both `b` and `c` depend directly on `a`, one of two possible orders could occur: [`computeB`, `computeC`] or [`computeC`, `computeB`]. - In the first case - [`computeB`, `computeC`] - `computeB` is run with the new value of `a` and produces a new value for `b`. Then, `computeC` is run with both the new values of `a` and `b` to produce `c`. - In the second case - [`computeC`, `computeB`] - `computeC` is run first with the new value of `a` and the _current_ value of `b` to produce `c`. Then, `computeB` is run with the new value of `a` to produce `b`. If `computeB` changed the value of `b` then `computeC` will be run again, with the new values of both `a` and `b` to produce the final value of `c`. However, with `orderedComputed` enabled, the computed properties would have been previously sorted into [`computeB`, `computeC`], so updating `a` would cause them to run specifically in that order. If your component's computed property graph contains cycles, the order in which they are run when using `orderedComputed` is still undefined. **Should I use it?** The value of this setting depends on how your computed property functions are implemented. If they are pure and relatively inexpensive, you shouldn't need to enable this feature. If they have side effects that would make the order in which they are run important or are expensive enough that it would be a problem to run them multiple times for a property update, consider enabling it. - `fastDomIf` / `setFastDomIf` **What does it do?** This setting enables a different implementation of `` that uses its host element's template stamping facilities (provided as part of `PolymerElement`) rather than including its own. This setting can help with performance but comes with a few caveats: - First, `fastDomIf` requires that every `` is in the shadow root of a Polymer element: you can't use a `` directly in the main document or inside a shadow root of an element that doesn't extend `PolymerElement`. - Second, because the `fastDomIf` implementation of `` doesn't include its own template stamping features, it doesn't create its own scope for property effects. This means that any properties you were previously setting on the `` will no longer be applied within its template, only properties of the host element are available. **Should I use it?** This setting is recommended as long as your app doesn't use `` as described in the section above. - `removeNestedTemplates` / `setRemoveNestedTemplates` **What does it do?** This setting causes Polymer to remove the child `