Commit Graph

370 Commits

Author SHA1 Message Date
Russell Bicknell
adc6d51723 Upstream http://cl/374717449 2022-04-27 15:37:02 -07:00
Russell Bicknell
96897876a2 Upstream http://cl/362104095 2022-04-27 15:32:51 -07:00
Russell Bicknell
4036db442b Upstream http://cl/368587394 2022-04-27 15:30:54 -07:00
Russell Bicknell
2445554f4f Upstream http://cl/397536696 2022-04-27 15:18:29 -07:00
Russell Bicknell
ec36597fb0 Upstream http://cl/416087593 2022-04-27 14:59:22 -07:00
Peter Burns
10220c9af1 Add support for TrustedTypes (#5692)
* Add support for TrustedTypes to html-tag.js

This avoids setting innerHTML to a string.

* Comment on why .slice() the  XMLSerializer output

* Handle data binding Trusted Types into attributes

Fixes #5648

* Lint clean
2021-08-26 12:37:17 -07:00
Jacob Reid
1e9be28d74 Fix SyntaxError
Without the quotes in safari you get the following error: SyntaxError: The string did not match the expected pattern.
2021-01-05 14:49:20 -07:00
Russell Bicknell
2515cd215f Upstream internal error suppression.
Co-authored-by: Phil Harnish <philharnish@gmail.com>
2020-11-17 11:58:44 -08:00
Russell Bicknell
9e8df6821b Upstream internal type differences. 2020-05-13 14:24:51 -07:00
Russell Bicknell
8b2ea7bce2 Remove "DO NOT EDIT" warning comments. 2020-04-29 13:57:09 -07:00
Russell Bicknell
ec7b7c5541 Track TypeScript declarations. 2020-04-29 13:39:09 -07:00
Peter Burns
ad2bca189f Fix a couple more compiler warnings
Fixes warnings in some internal builds.
2020-04-27 10:21:48 -07:00
Russell Bicknell
33e149863e shareBuiltCSSWithAdoptedStyleSheets -> useAdoptedStyleSheetsWithBuiltCSS 2020-04-06 14:10:57 -07:00
Russell Bicknell
c0813cd3d3 Fix incorrect JSDoc param name. 2020-04-02 17:33:27 -07:00
Russell Bicknell
2fc9062d83 Add shareBuiltCSSWithAdoptedStyleSheets global setting 2020-04-02 17:17:10 -07:00
Peter Burns
afdd9119ad Rebase sanitize dom value getter onto legacy-undefined-noBatch (#5618)
* Add  getSanitizeDOMValue to settings API

For environments that don't well support `export let`.

* Add a test for getSanitizeDOMValue
2020-01-17 14:07:17 -08:00
Steven Orvell
7b0c57a43e Lint fixes. 2019-12-18 18:45:43 -08:00
Steven Orvell
8ef2cc7089 Adds legacyNoAttributes setting
Applies a number of optimizations that speed up defining a legacy element. These optimizations are mostly beneficial when a large number of elements are defined that are not used for initial render.

* Fixes an issue with `dedupingMixin` that was causing info to be cached on the resulting class even when no mixin should be applied.
* In Polymer.Class, avoids using `LegacyElementMixin(HTMLElement)` in favor of a cached `LegacyElement`.
* Copies `DisableUpgradeMixin` into Polymer's legacy class generation. This avoids the need to mix this on top of all legacy elements.
* Adds `legacyNoAttributes` setting which avoids setting `observedAttributes` and instead (1) applies the values of all attributes at create time, (2) patches set/removeAttribute so that they call attributeChangedCallback. This is faster since it avoids the work Polymer needs to do to calculate `observedAttributes`.
2019-12-18 18:40:46 -08:00
Steve Orvell
dbd9140af3 Update lib/utils/settings.js
Co-Authored-By: Kevin Schaaf <kschaaf@google.com>
2019-10-10 11:56:54 -07:00
Steven Orvell
124d878ea8 Changes based on review. 2019-10-09 10:37:20 -07:00
Steven Orvell
ab04377bda Add basic support for adoptedStyleSheets
Uses `shadowRoot.adoptedStyleSheets` for element styling when supported (currently Chrome) and only if a css build is used. The build restriction is in place in order to support `@apply` via ShadyCSS. Currently ShadyCSS works only with a style element in the element template.
2019-10-08 17:55:38 -07:00
Kevin Schaaf
cbc722b1cd [ci skip] Add/fix comments per review. 2019-09-23 14:54:42 -07:00
Kevin Schaaf
d64ee9ef24 Reintroduce suppressTemplateNotifications and gate Dom-change & renderedItemCount on that.
Matches Polymer 1 setting for better backward compatibility.
2019-09-19 18:47:55 -07:00
Kevin Schaaf
50dbf551f0 Merge branch 'legacy-undefined-noBatch' into legach-undefined-noBatch-opt 2019-09-17 17:55:27 -07:00
Kevin Schaaf
534654de4d Move @private annotation to decorate class definition.
Fixes CI issue with generate-types
2019-09-17 17:52:28 -07:00
Steven Orvell
280f4f0a37 Applies micro-optimizations and removes obsolete settings
Applies micro-optimizations that were found to improve element creation benchmarks by 5-10%, and removes obsolete settings:

* Removed `legacyNoBatch` and `legacyNotifyOrder` settings.
* dom-if/repeat: `dom-change` and `renderedCount` no longer fire with `legacyOptimizations` set.
* legacy-element-mixin: `isAttached` now set before calling `connectedCallback` so it is batched with initial rendering.
* `PropertiesChanged`: property accessor code now inlined for efficiency rather than calling `_get/_setProperty`. The `__dataCounter` tracking flag has been moved here to avoid the need to override `_flushProperties` in `PropertyEffects`.
* `PropertyEffects`: inlined `runEffectsForProperty` into `runEffects` for efficiency. Removed wrapping around sending data events.
* `async`: In the microtask scheduler, now only provoke a DOM mutation if needed.
2019-09-12 15:11:38 -07:00
Laura Harker
5382e2ca1f Work around Closure Compiler bug to avoid upcoming type error
Fixing a compiler type-equality bug uncovers a new error caused by
https://github.com/google/closure-compiler/issues/2928.
2019-09-09 16:41:39 -07:00
Kevin Schaaf
e4bb039f6a Merge pull request #5560 from Polymer/legacy-undefined-noBatch-altTemplates
Optimizations to template elements - fastDomIf & removeNestedTemplates
2019-07-11 16:48:45 -07:00
Daniel Freedman
4d0e5e388f Merge branch 'master' into legacy-undefined-noBatch 2019-07-11 12:24:19 -07:00
Kevin Schaaf
f0cbc837d0 Updates from review. 2019-07-01 17:36:46 -07:00
Kevin Schaaf
ff25283a51 Closure type fixes. 2019-07-01 16:14:05 -07:00
Alexander Marks
46ee2aecc1 Make Closure compiler happier about ShadyDOM access 2019-06-28 17:31:07 -07:00
Kevin Schaaf
18c83de2fc Merge branch 'legacy-undefined-noBatch' into legacy-undefined-noBatch-altTemplates 2019-06-27 21:10:14 -07:00
Kevin Schaaf
c2093be115 Merge branch 'master' into legacy-undefined-noBatch 2019-06-27 21:09:47 -07:00
Kevin Schaaf
df1eb73b3a Initialize all settings from Polymer object when available. 2019-06-27 21:05:18 -07:00
Peter Burns
0d2c2e5dbc Remove other double import (#5565)
Debouncer is no longer used in the file, even as a type name.
2019-06-27 13:01:13 -07:00
Peter Burns
54f8b47fee Only use CONST_CASE for constants. (#5564)
Otherwise it looks suspicious to closure compiler, and triggers a warning.
2019-06-27 13:00:47 -07:00
Kevin Schaaf
39207cceee Updates based on review. 2019-06-26 22:52:38 -07:00
Kevin Schaaf
4bdbe925a1 Fix defaults back to false for new settings. 2019-06-26 20:32:21 -07:00
Kevin Schaaf
fc693a095d Fix host property syncing 2019-06-24 16:56:05 -07:00
Daniel Freedman
db0557ffb8 Merge branch 'master' into legacy-undefined-noBatch 2019-06-24 11:20:19 -07:00
Peter Burns
94585c3168 Don't import/export from the same file twice (#5562)
Quiets down an annoying build warning in some configurations
2019-06-23 17:09:01 -07:00
Kevin Schaaf
c2f31edaa5 Refactor DomIf into separate subclasses. 2019-06-19 16:36:47 -07:00
Kevin Schaaf
e690dfe2c1 Runtime stamped dom-if 2019-06-18 22:10:50 -07:00
Alexander Marks
cbace6b17c Merge branch 'master' into legacy-undefined-noBatch 2019-06-18 18:15:07 -07:00
Alexander Marks
ed7709f6a4 Add @override, remove @attribute/@group/@hero/@homepage 2019-06-17 15:51:00 -07:00
Alexander Marks
7845582464 Merge branch 'master' into legacy-undefined-noBatch 2019-06-17 12:08:31 -07:00
Alexander Marks
15090f2664 Closure compilation tweaks 2019-06-15 22:33:17 -07:00
Kevin Schaaf
27ed93aff1 dom-if/dom-repeat bind-to-parent 2019-06-06 12:59:48 -07:00
Alexander Marks
f55584a787 Merge branch 'master' into legacy-undefined-noBatch 2019-06-06 12:17:51 -07:00