diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..9d3a1a94 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,24 @@ +language: node_js +sudo: false +node_js: stable +addons: + firefox: latest + sauce_connect: true + apt: + sources: + - google-chrome + - ubuntu-toolchain-r-test + packages: + - google-chrome-stable + - g++-4.8 +before_script: +- npm install -g bower +- bower install +script: +- xvfb-run wct +- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi" +env: + global: + - secure: eFrp9xwSYG579rAR9/XyXYKh+UtIQJ1xS5q5PABu4ndYFckdJb8o3m7oXqRSikbiPWbCSd3Fkd6+ZKXlcQFdjJ+nx9gFitGthtH93qkvZCO3XhWEEBPj65igIo3hrRSOB6dIWyiZcnoH9IXLLQtKXY9uL1NCqCcyVHg1omPKr9w= + - secure: EAjjkzqZ8z+PEvdo2N2MiIjkqUYAjVkQABKyMw6N4hUa6YSNEW9PYyn4I0d9Rdvc25GwJ+oLQFdeQepioAkNfp6wYUj2IdMIfmmKa1aJWo5DWvOMDYp3ufRhIoiVi4ZVpLg9sTjw+078UhUQFWE44rwfUtHiIb2UbWe2/ueLOiM= + - CXX=g++-4.8 diff --git a/CHANGELOG.md b/CHANGELOG.md index 3db06504..c072f18c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,521 @@ # Change Log +##[v1.2.4](https://github.com/Polymer/polymer/tree/v1.2.4) (2016-01-27) +- Fixes #3337. When a doc fragment is added, only update the invalidation state of the insertion point list of the shadyRoot IFF it is not already invalid. This fixes an issue that was detected when an a doc fragment that did not include an insertion point was added after one that did but before distribution. ([commit](https://github.com/Polymer/polymer/commit/d26b003)) + +- fix build output with new vulcanize ([commit](https://github.com/Polymer/polymer/commit/c317711)) + +- Revert style properties change from fd5778470551f677c2aa5827398681abb1994a88 ([commit](https://github.com/Polymer/polymer/commit/0a0b580)) + +- Fix shadow dom test. ([commit](https://github.com/Polymer/polymer/commit/6b83911)) + +- Add shadow root support. (tests broken) ([commit](https://github.com/Polymer/polymer/commit/4b7da35)) + +- Ensure dom-if moved into doc fragment is torn down. Fixes #3324 ([commit](https://github.com/Polymer/polymer/commit/6c4f5d5)) + +- improve test. ([commit](https://github.com/Polymer/polymer/commit/d70c40a)) + +- Update comment. ([commit](https://github.com/Polymer/polymer/commit/aa14687)) + +- In addition to fragments, also handle non-distributed elements more completely. ([commit](https://github.com/Polymer/polymer/commit/fe2699e)) + +- Simplify fix for fragment children management. ([commit](https://github.com/Polymer/polymer/commit/713377e)) + +- Fix test under polypill. ([commit](https://github.com/Polymer/polymer/commit/25da63d)) + +- Ensure fragments added via Polymer.dom always have elements removed, even when distribution does not select those elements. ([commit](https://github.com/Polymer/polymer/commit/101eb3d)) + +- Fixes #3321. Only let dom-repeat insert elements in attached if it has been previously detached; correctly avoid re-adding children in document fragments to an element's logical linked list if they are already there. ([commit](https://github.com/Polymer/polymer/commit/9f2464d)) + +- Ugh ([commit](https://github.com/Polymer/polymer/commit/172d93c)) + +- Fixes #3308. Use an explicit undefined check to test if logical tree information exists. ([commit](https://github.com/Polymer/polymer/commit/9106398)) + +- add test ([commit](https://github.com/Polymer/polymer/commit/b1ea014)) + +- use class attribute in applyElementScopeSelector ([commit](https://github.com/Polymer/polymer/commit/07d8c06)) + +- Remove reference to _composedChildren ([commit](https://github.com/Polymer/polymer/commit/9f85acd)) + +- Fix typo in documentation for set() ([commit](https://github.com/Polymer/polymer/commit/aa47515)) + +- Fix typo in dom-tree-api ([commit](https://github.com/Polymer/polymer/commit/ae98a7c)) + +- Correct use of document.contains to document.documentElement.contains on IE. ([commit](https://github.com/Polymer/polymer/commit/0e74810)) + +- Ensure querySelector always returns `null` when a node is not found. Also optimize querySelector such that the matcher halts on the first result. ([commit](https://github.com/Polymer/polymer/commit/b9e5cce)) + +- Fixes #3295. Only cache a false-y result for an element's owner shady root iff the element is currently in the document. ([commit](https://github.com/Polymer/polymer/commit/6e16619)) + +- Use local references to wrapper functions; add test element tree to native shadow tests; reorder test elements. ([commit](https://github.com/Polymer/polymer/commit/47ee2ca)) + +- Remove leftover garbage line ([commit](https://github.com/Polymer/polymer/commit/d7567b7)) + +- Removes the case where activeElement could be in the light DOM of a ShadowRoot. ([commit](https://github.com/Polymer/polymer/commit/e848af8)) + +- DOM API implementation of `activeElement`. ([commit](https://github.com/Polymer/polymer/commit/2984576)) + +- Remove call to `wrap` in deepContains ([commit](https://github.com/Polymer/polymer/commit/4cbdef7)) + +- Fixes #3270. ([commit](https://github.com/Polymer/polymer/commit/7d0485b)) + +- Include more styling tests under ShadowDOM. Fix custom-style media query test to work under both shadow/shady. ([commit](https://github.com/Polymer/polymer/commit/33a24bb)) + +- Remove duplicate code related to dom traversal in Polymer.dom. ([commit](https://github.com/Polymer/polymer/commit/555252b)) + +- Fix parsing of minimized css output also for mixins ([commit](https://github.com/Polymer/polymer/commit/87d02e0)) + +- Set position to relative to make Safari to succeed top/bottom tests ([commit](https://github.com/Polymer/polymer/commit/94f505a)) + +- Fix parsing of minimized css output ([commit](https://github.com/Polymer/polymer/commit/f92f9ff)) + +- Fix for `Polymer.dom(...)._query()` method doesn't exist which causes `Polymer.updateStyles()` to fail ([commit](https://github.com/Polymer/polymer/commit/0eea7a6)) + +- Minor factoring of dom patching. ([commit](https://github.com/Polymer/polymer/commit/8c95014)) + +- use destination insertion points when calculating the path ([commit](https://github.com/Polymer/polymer/commit/3f8b6ee)) + +- Store all dom tree data in `__dom` private storage; implement composed patching via a linked list. ([commit](https://github.com/Polymer/polymer/commit/9a3bead)) + +- Modernize the build ([commit](https://github.com/Polymer/polymer/commit/2b69bb1)) + +- Add more globals to whitelist for safari ([commit](https://github.com/Polymer/polymer/commit/82b2443)) + +- Shady patching: patch element accessors in composed tree; fixes HTMLImports polyfill support. ([commit](https://github.com/Polymer/polymer/commit/d135fef)) + +- remove unused code; minor changes based on review. ([commit](https://github.com/Polymer/polymer/commit/c3fbd10)) + +- added polymer-mini and polymer-micro to main ([commit](https://github.com/Polymer/polymer/commit/da5d781)) + +- Updates the patch-don experiment to work with recent changes. ([commit](https://github.com/Polymer/polymer/commit/b9e6859)) + +- Fixes #3113 ([commit](https://github.com/Polymer/polymer/commit/fadd455)) + +- Polymer.dom: when adding a node, only remove the node from its existing location if it's not a fragment and has a parent. ([commit](https://github.com/Polymer/polymer/commit/9915627)) + +- Consistently use TreeApi.Composed api for composed dom manipulation; use TreeApi.Logical methods to get node leaves. Avoid making a Polymer.dom when TreeApi.Logical can provide the needed info. ([commit](https://github.com/Polymer/polymer/commit/5033fdb)) + +- Produce nicer error on malformed observer ([commit](https://github.com/Polymer/polymer/commit/0e248f5)) + +- Deduplicate setup and verifying in notify-path test suite ([commit](https://github.com/Polymer/polymer/commit/68707ad)) + +- more explicit tests for debouncer wait and no-wait behavior ([commit](https://github.com/Polymer/polymer/commit/8ef7bac)) + +- speed up microtask testing ([commit](https://github.com/Polymer/polymer/commit/9bef4c0)) + +- ensure isDebouncerActive returns a Boolean ([commit](https://github.com/Polymer/polymer/commit/3916493)) + +- add more debouncer tests ([commit](https://github.com/Polymer/polymer/commit/0206852)) + +- remove dead debounce test assertion ([commit](https://github.com/Polymer/polymer/commit/9b898c2)) + +- Factoring of distribution logic in both add and remove cases. ([commit](https://github.com/Polymer/polymer/commit/8272d5e)) + +- Minor typo in docs: call the debounce callback ([commit](https://github.com/Polymer/polymer/commit/02c5c79)) + +- Correct test to avoid using `firstElementChild` on a documentFragment since it is not universally supported. ([commit](https://github.com/Polymer/polymer/commit/dfa6a44)) + +- Remove all TODOs ([commit](https://github.com/Polymer/polymer/commit/6467ae1)) + +- Revert "Add .gitattributes to solve line endings cross-OS (merge after other PRs)" ([commit](https://github.com/Polymer/polymer/commit/b6b8293)) + +- Make renderedItemCount readOnly & add tests. ([commit](https://github.com/Polymer/polymer/commit/e39d5ba)) + +- Revert "Fix parsing of minimized css output" ([commit](https://github.com/Polymer/polymer/commit/d3145e8)) + +- Custom setProperty for bindings to hidden textNodes. Fixes #3157. ([commit](https://github.com/Polymer/polymer/commit/c6be10d)) + +- Ensure dom-if in host does not restamp when host detaches. Fixes #3125. ([commit](https://github.com/Polymer/polymer/commit/bb85e2b)) + +- Avoid making a copy of childNodes when a dom fragment is inserted in the logical tree. ([commit](https://github.com/Polymer/polymer/commit/dcbafbf)) + +- Slightly faster `findAnnotatedNodes` ([commit](https://github.com/Polymer/polymer/commit/43fc853)) + +- Add .gitattributes to solve line endings cross-OS ([commit](https://github.com/Polymer/polymer/commit/94c2bc2)) + +- Ensure literals are excluded from parent props. Fixes #3128. Fixes #3121. ([commit](https://github.com/Polymer/polymer/commit/526fa3c)) + +- Fix parsing of minimized css output ([commit](https://github.com/Polymer/polymer/commit/d458690)) + +- Disable chunked dom-repeat tests on IE due to CI rAF flakiness. ([commit](https://github.com/Polymer/polymer/commit/7fe5e2b)) + +- Add comment. ([commit](https://github.com/Polymer/polymer/commit/d8ecd45)) + +- Make Polymer.dom.flush reentrant-safe. Fixes #3115. ([commit](https://github.com/Polymer/polymer/commit/644105a)) + +- Fixes #3108. Moves `debounce` functionality from polymer-micro to polymer-mini. The functionality belongs at the mini tier and was never actually functional in micro. ([commit](https://github.com/Polymer/polymer/commit/3df4ef2)) + +- Clarify this is for IE. ([commit](https://github.com/Polymer/polymer/commit/63782fa)) + +- Patch rAF to setTimeout to reduce flakiness on CI. ([commit](https://github.com/Polymer/polymer/commit/35abadc)) + +- added missing semicolons, removed some unused variables ([commit](https://github.com/Polymer/polymer/commit/00ed797)) + +- ?Node ([commit](https://github.com/Polymer/polymer/commit/9385891)) + +- Remove closures holding element references after mouseup/touchend ([commit](https://github.com/Polymer/polymer/commit/811f766)) + +- set class attribute instead of using classname ([commit](https://github.com/Polymer/polymer/commit/690838a)) + +- Include wildcard character in identifier. Fixes #3084. ([commit](https://github.com/Polymer/polymer/commit/c36d6c1)) + +- Revert fromAbove in applyEffectValue. Add test. Fixes #3077. ([commit](https://github.com/Polymer/polymer/commit/156122c)) + +- loosen isLightDescendant's @param type to Node ([commit](https://github.com/Polymer/polymer/commit/c635797)) + +- Put beforeRegister in the behaviorProperties. ([commit](https://github.com/Polymer/polymer/commit/445b6cd)) + +- ES5 strict doesn't like function declarations inside inner blocks. ([commit](https://github.com/Polymer/polymer/commit/51d3fa6)) + +- Fixes #3065: Add dom-repeat.renderedItemCount property ([commit](https://github.com/Polymer/polymer/commit/b589f70)) + +- Minor factoring; ensure base properties set on instance. ([commit](https://github.com/Polymer/polymer/commit/da15ff0)) + +- Fix typos. ([commit](https://github.com/Polymer/polymer/commit/c12d3ed)) + +- Simplify more. ([commit](https://github.com/Polymer/polymer/commit/186e053)) + +- Improvements to regex. ([commit](https://github.com/Polymer/polymer/commit/a3d17d5)) + +- Give dom-repeat#_targetFrameTime a type ([commit](https://github.com/Polymer/polymer/commit/adad9ce)) + +- [skip ci] update travis config to firefox latest ([commit](https://github.com/Polymer/polymer/commit/608ce9f)) + +- Add a couple of tests. ([commit](https://github.com/Polymer/polymer/commit/108b7f9)) + +- Suppress warnings and expected errors in test suite ([commit](https://github.com/Polymer/polymer/commit/92d6fcb)) + +- Use linked-list for element tree traversal. Factor Polymer.DomApi into shadow/shady modules. ([commit](https://github.com/Polymer/polymer/commit/306cc81)) + +- Avoid throwing with invalid keys/paths. Fixes #3018. ([commit](https://github.com/Polymer/polymer/commit/5076ee0)) + +- Use stricter binding parsing for efficiency and correctness. Fixes #2705. ([commit](https://github.com/Polymer/polymer/commit/04cd184)) + +- Simpler travis config ([commit](https://github.com/Polymer/polymer/commit/68b457d)) + +- [ci skip] Update Changelog ([commit](https://github.com/Polymer/polymer/commit/7e7600a)) + +- Fix for incorrect CSS selectors specificity as reported in #2531 Fix for overriding mixin properties, fixes #1873 Added awareness from `@apply()` position among other rules so that it is preserved after CSS variables/mixing substitution. `Polymer.StyleUtil.clearStyleRules()` method removed as it is not used anywhere. Some unused variables removed. Typos, unused variables and unnecessary escaping in regexps corrected. Tests added. ([commit](https://github.com/Polymer/polymer/commit/fd57784)) + +- Fix for method parsing in computed binding ([commit](https://github.com/Polymer/polymer/commit/c2e43d3)) + +- Fix doc typo. ([commit](https://github.com/Polymer/polymer/commit/8886c2c)) + +- Filtering causes unexpected issues ([commit](https://github.com/Polymer/polymer/commit/df22564)) + +- Fix using value$ on input element ([commit](https://github.com/Polymer/polymer/commit/05a1e95)) + +- added missing semicolons, removed some unused variables ([commit](https://github.com/Polymer/polymer/commit/338574d)) + +##[v1.2.3](https://github.com/Polymer/polymer/tree/v1.2.3) (2015-11-16) +- Call decorate instead of bootstrap for template prepping ([commit](https://github.com/Polymer/polymer/commit/e2a2cfd)) + +- Fix global leak test. Necessary due to changes to test harness. ([commit](https://github.com/Polymer/polymer/commit/134766f)) + +- Defer property application only when a custom-style is first created. ([commit](https://github.com/Polymer/polymer/commit/4bf0e13)) + +- Update comment. ([commit](https://github.com/Polymer/polymer/commit/27e1dcd)) + +- Simplify custom-style property deferment. ([commit](https://github.com/Polymer/polymer/commit/a970493)) + +- [ci skip] update changelog ([commit](https://github.com/Polymer/polymer/commit/98acb3a)) + +- Fixes #2692. Ensures that custom-style properties are applied async but before next render so that all properties are defined before any are consumed by custom-styles. Also refines dom-module's early upgrade code so that it does not affect other elements (corrects for example, custom-styles upgrading before expected). ([commit](https://github.com/Polymer/polymer/commit/b829f2a)) + +- Remove undesired full-stop from outputs ([commit](https://github.com/Polymer/polymer/commit/68d5c55)) + +- Fix Formatting ([commit](https://github.com/Polymer/polymer/commit/724e1bc)) + +##[v1.2.2](https://github.com/Polymer/polymer/tree/v1.2.2) (2015-11-12) +- use local reference for wrap. ([commit](https://github.com/Polymer/polymer/commit/b15e5b9)) + +- Add Polymer.DomApi.wrap ([commit](https://github.com/Polymer/polymer/commit/6cf974a)) + +- For correctness, bind listeners must use a property's current value rather than its passed value. ([commit](https://github.com/Polymer/polymer/commit/aca404f)) + +- Explicitly making an element's `_template` falsy is now considered an allowable setting. This means the element stamps no content, doesn't collect any styles, and avoids looking up a dom-module. This helps address #2708 and the 5 elements Polymer registers that have no template have been set with `_template: null`. ([commit](https://github.com/Polymer/polymer/commit/b905a37)) + +- Make test work under native Shadow DOM. ([commit](https://github.com/Polymer/polymer/commit/4f9c2bd)) + +- In `_notifyListener`, only use `e.detail` if the event has a detail. This is necessary for `::eventName` compatibility where `eventName` is a native event like `change`. ([commit](https://github.com/Polymer/polymer/commit/3ece552)) + +- Fix TOC re: host event listeners. ([commit](https://github.com/Polymer/polymer/commit/ce32459)) + +- Fix compound bindings with braces in literals ([commit](https://github.com/Polymer/polymer/commit/561b28b)) + +- Re-enable listeners of the form 'a.b' (todo: make this more efficient). ([commit](https://github.com/Polymer/polymer/commit/139257b)) + +- Avoid stomping on property objects when mixing behaviors. ([commit](https://github.com/Polymer/polymer/commit/ec4d313)) + +- Update test to avoid template polypill issues. ([commit](https://github.com/Polymer/polymer/commit/fa96ff3)) + +- Ensure parent node exists when stamping. Fixes #2685. ([commit](https://github.com/Polymer/polymer/commit/62f2d2a)) + +- Add global leak test to runner. ([commit](https://github.com/Polymer/polymer/commit/dc2255c)) + +- Add global leak test. ([commit](https://github.com/Polymer/polymer/commit/7f71b4c)) + +- Fix typo that prevented correct functioning of Polymer.dom under Shadow DOM and add tests to catch. ([commit](https://github.com/Polymer/polymer/commit/cdc9fde)) + +- maintain compatibility with older `_notifyChange` arguments. ([commit](https://github.com/Polymer/polymer/commit/f5aec30)) + +- Weird assignment fix ([commit](https://github.com/Polymer/polymer/commit/9e6f77a)) + +- add comment. ([commit](https://github.com/Polymer/polymer/commit/f2d5f44)) + +- For efficiency, use cached events in data system, for property and path changes. ([commit](https://github.com/Polymer/polymer/commit/da71dfe)) + +- Fixes #2690 ([commit](https://github.com/Polymer/polymer/commit/d8b78d4)) + +- change after render method to `Polymer.RenderStatus.afterNextRender` ([commit](https://github.com/Polymer/polymer/commit/8949c04)) + +- When effect values are applied via bindings, use fromAbove gambit to avoid unnecessary wheel spinning. (This is now possible since we have fast lookup for readOnly where we want to avoid doing the set at all). ([commit](https://github.com/Polymer/polymer/commit/c520907)) + +- do readOnly check for configured properties where they are handed down, rather than when they are consumed. ([commit](https://github.com/Polymer/polymer/commit/24bcedb)) + +- Minor cleanup. ([commit](https://github.com/Polymer/polymer/commit/0b21506)) + +- Avoid creating unnecessary placeholders for full refresh. ([commit](https://github.com/Polymer/polymer/commit/996289a)) + +- Simplify ([commit](https://github.com/Polymer/polymer/commit/c5e1135)) + +- Fix typo. ([commit](https://github.com/Polymer/polymer/commit/680c56d)) + +- Update docs. ([commit](https://github.com/Polymer/polymer/commit/352ccbe)) + +- _removeInstance -> _detachAndRemoveInstance ([commit](https://github.com/Polymer/polymer/commit/ba7a16f)) + +- Remove limit & chunkCount API. Refactor insert/remove. ([commit](https://github.com/Polymer/polymer/commit/f447c0e)) + +- add back deepContains (got removed incorrectly in merge). ([commit](https://github.com/Polymer/polymer/commit/d53ab57)) + +- fix line endings. ([commit](https://github.com/Polymer/polymer/commit/0233d6d)) + +- revert host attributes ordering change optimization as it was not worth the trouble (barely measurable and more cumbersome impl). ([commit](https://github.com/Polymer/polymer/commit/f9894a0)) + +- rename host functions fix typos afterFirstRender is now raf+setTimeout dom-repeat: remove cruft ([commit](https://github.com/Polymer/polymer/commit/d82840b)) + +- Fix Gestures when using SD polyfill ([commit](https://github.com/Polymer/polymer/commit/96e4bfa)) + +- Fix for multiple consequent spaces present in CSS selectors, fixes #2670 ([commit](https://github.com/Polymer/polymer/commit/ecddb56)) + +- avoid configuration work when unnecessary ([commit](https://github.com/Polymer/polymer/commit/e0fbfbe)) + +- lazily create effect objects so we can more easily abort processing. avoid forEach ([commit](https://github.com/Polymer/polymer/commit/66df196)) + +- provides support for memoizing pathFn on effect; only process effects/listeners if they exist. ([commit](https://github.com/Polymer/polymer/commit/a2376b6)) + +- memoize pathFn on effect (note: notifyPath change made in previous commit); avoid forEach. ([commit](https://github.com/Polymer/polymer/commit/d93340a)) + +- Avoid using .slice and .forEach ([commit](https://github.com/Polymer/polymer/commit/d2c02a9)) + +- Added support for short unicode escape sequences, fixes #2650 ([commit](https://github.com/Polymer/polymer/commit/2c87145)) + +- Fix for BEM-like CSS selectors under media queries, fixes #2639. Small optimization for produced CSS (empty rules produced semicolon before, now empty string). ([commit](https://github.com/Polymer/polymer/commit/35c89f1)) + +- Fix parsing of custom properties with 'var' in value ([commit](https://github.com/Polymer/polymer/commit/61abfbd)) + +- Clean up cruft. ([commit](https://github.com/Polymer/polymer/commit/59c27fa)) + +- Add tests and fix issues. ([commit](https://github.com/Polymer/polymer/commit/e99e5fa)) + +- dom-repeat chunked/throttled render API ([commit](https://github.com/Polymer/polymer/commit/e9aebd7)) + +- Fix formatting. ([commit](https://github.com/Polymer/polymer/commit/56734a7)) + +- Add notes on running unit tests. ([commit](https://github.com/Polymer/polymer/commit/492f310)) + +- Corrected method name. Fixes #2649. ([commit](https://github.com/Polymer/polymer/commit/5168604)) + +- Fix typos in more efficient array copying. ([commit](https://github.com/Polymer/polymer/commit/53f3a7d)) + +- Adds `Polymer.RenderStatus.afterFirstRender` method. Call to perform tasks after an element first renders. ([commit](https://github.com/Polymer/polymer/commit/71b5c2a)) + +- More efficient array management in Polymer.DomApi. ([commit](https://github.com/Polymer/polymer/commit/320d5c7)) + +- Fixes #2652 ([commit](https://github.com/Polymer/polymer/commit/e35c4e9)) + +- [ci skip] update changelog ([commit](https://github.com/Polymer/polymer/commit/0dc69df)) + +- Fix whitespace around bindings. ([commit](https://github.com/Polymer/polymer/commit/d7d0ed6)) + +- Add support for `strip-whitespace`. Should fix #2511. ([commit](https://github.com/Polymer/polymer/commit/35a1b94)) + +- Improve efficiency of attribute configuration. ([commit](https://github.com/Polymer/polymer/commit/f7d86e9)) + +- Remove use of Function.bind ([commit](https://github.com/Polymer/polymer/commit/25aab8b)) + +- fix typos. ([commit](https://github.com/Polymer/polymer/commit/5fb20da)) + +- Re-use data change events. Remove unused/undocumented listener object specific node listening feature. ([commit](https://github.com/Polymer/polymer/commit/8bdedf3)) + +- Add flattened properties to dom-bind, templatizer, optimize by 'liming properties that are protected/private and not readOnly from list. ([commit](https://github.com/Polymer/polymer/commit/2ba08ec)) + +- Use flattened list of properties for fast access during configuration and attribute->property ([commit](https://github.com/Polymer/polymer/commit/acdd242)) + +- Assemble effect strings at prototype time. ([commit](https://github.com/Polymer/polymer/commit/4745e8f)) + +- Fallback to string lookup to fix support for extra effects. ([commit](https://github.com/Polymer/polymer/commit/d3c4611)) + +- Fix typo. ([commit](https://github.com/Polymer/polymer/commit/ead9adb)) + +- Correct NodeList copying. ([commit](https://github.com/Polymer/polymer/commit/1d29e19)) + +- Avoid Polymer.dom.setAttribute when unneeded. ([commit](https://github.com/Polymer/polymer/commit/9c5a404)) + +- More efficient iteration. ([commit](https://github.com/Polymer/polymer/commit/23a9a06)) + +- Avoid forEach ([commit](https://github.com/Polymer/polymer/commit/ebeaf80)) + +- Copy dom NodeList faster than slice. ([commit](https://github.com/Polymer/polymer/commit/8cad475)) + +- Avoid function lookup by string. ([commit](https://github.com/Polymer/polymer/commit/e2674bc)) + +- Add test for parsing multi-line css comments ([commit](https://github.com/Polymer/polymer/commit/6f21ae6)) + +##[v1.2.1](https://github.com/Polymer/polymer/tree/v1.2.1) (2015-10-29) +- Fix test for SD polyfill ([commit](https://github.com/Polymer/polymer/commit/dd8b3e9)) + +- Add pre-condition check for completeness. ([commit](https://github.com/Polymer/polymer/commit/89304dc)) + +- Find non distributed children with deepContains ([commit](https://github.com/Polymer/polymer/commit/8e6f55a)) + +- Ensure outer paths aren't forwarded to instance props. Fixes #2556. ([commit](https://github.com/Polymer/polymer/commit/01273e9)) + +- Add `Polymer.dom.deepContains` ([commit](https://github.com/Polymer/polymer/commit/279bf63)) + +- [ci skip] Update CHANGELOG ([commit](https://github.com/Polymer/polymer/commit/e1f83d2)) + +- isLightDescendant should return false for self ([commit](https://github.com/Polymer/polymer/commit/a0debf4)) + +- Fix for mixins declaration with space before colon. Allow any space character or even `{` and `}` (before and after capturing pattern correspondingly) as pattern boundaries instead of new lines only. In minified sources there might be no space, semicolon or line start, so we need to account that as well. ([commit](https://github.com/Polymer/polymer/commit/883aa5c)) + +##[v1.2.0](https://github.com/Polymer/polymer/tree/v1.2.0) (2015-10-22) +- A simpler travis config ([commit](https://github.com/Polymer/polymer/commit/3338b67)) + +- Fix #2587: When Polymer.dom(el).appendChild(node) is called, cleanup work must be performed on the existing parent of node. This change fixes a missing case in this cleanup work: if the existing parent has a observer via `Polymer.dom(parent).observeNodes`, it needs to be notified that node is being removed even if the node does not have specific logical info. For example, if an observed node has no Shady DOM and has a child that is removed. A test for this case was added. ([commit](https://github.com/Polymer/polymer/commit/0d4f418)) + +- add fancy travis status badge to the readme ([commit](https://github.com/Polymer/polymer/commit/e29fca8)) + +- Do not configure compound property/attribute binding if literal if empty. Fixes #2583. ([commit](https://github.com/Polymer/polymer/commit/ca4724a)) + +- Update .travis.yml ([commit](https://github.com/Polymer/polymer/commit/ef366c5)) + +- Remove web-component-tester cache. ([commit](https://github.com/Polymer/polymer/commit/4ae23ce)) + +- Fix IE10 regressions. Fixes #2582 * Copy attribute list before modifying it * Fall back to document for current document if no currentScript ([commit](https://github.com/Polymer/polymer/commit/ee65e68)) + +- Allow _atEndOfMicrotask to be patchable. ([commit](https://github.com/Polymer/polymer/commit/e2d8446)) + +- contributing copy fixup ([commit](https://github.com/Polymer/polymer/commit/ed22c50)) + +- Update CONTRIBUTING.md ([commit](https://github.com/Polymer/polymer/commit/0c21efc)) + +- Add travis config ([commit](https://github.com/Polymer/polymer/commit/6fb7684)) + +- Factor into functions. ([commit](https://github.com/Polymer/polymer/commit/b2117dc)) + +- Fix deepEqual on Safari 9 due to Safari enumeration bug. ([commit](https://github.com/Polymer/polymer/commit/445d603)) + +- ensure distribution observers see all changes that can come from attributes under native Shadow DOM; +minor factoring ([commit](https://github.com/Polymer/polymer/commit/344f5cc)) + +- Add .getDistributedNodes observation. Refactor flush. ([commit](https://github.com/Polymer/polymer/commit/8b1face)) + +- Add docs ([commit](https://github.com/Polymer/polymer/commit/0ede79a)) + +- Make shadow attribute tracking automatic based on detecting a that depends on attributes; add tests. ([commit](https://github.com/Polymer/polymer/commit/54911a7)) + +- Add comments. ([commit](https://github.com/Polymer/polymer/commit/758c483)) + +- Fix typo. ([commit](https://github.com/Polymer/polymer/commit/74a87a0)) + +- Replace _compoundInitializationEffect with statically-initialized literals in the template for attributes & textContent, and by configuring literal values of properties in _configureAnnotationReferences. ([commit](https://github.com/Polymer/polymer/commit/2f1bd31)) + +- Simplify change tracking by always dirty checking at the observer level. Under Shadow DOM, use a deep MO to watch for attributes. ([commit](https://github.com/Polymer/polymer/commit/669acaa)) + +- Fix URL to component.kitchen ([commit](https://github.com/Polymer/polymer/commit/d9af504)) + +- Update the Google+ community link ([commit](https://github.com/Polymer/polymer/commit/c6684e5)) + +- Fixes from review. ([commit](https://github.com/Polymer/polymer/commit/a300862)) + +- Remove compound binding limitation from primer. ([commit](https://github.com/Polymer/polymer/commit/b1c1b35)) + +- Exclude compound bindings from configure; revisit later. ([commit](https://github.com/Polymer/polymer/commit/1035e2d)) + +- Apply effect value from compound parts. ([commit](https://github.com/Polymer/polymer/commit/c30ac10)) + +- Store binding parts in notes. ([commit](https://github.com/Polymer/polymer/commit/1026498)) + +- Fix missing var ([commit](https://github.com/Polymer/polymer/commit/68edb83)) + +- Add radix for correctness. ([commit](https://github.com/Polymer/polymer/commit/a79f012)) + +- Separate public & private get, flip conditions, add notifyPath API. ([commit](https://github.com/Polymer/polymer/commit/97503ec)) + +- Fix typo in comments. ([commit](https://github.com/Polymer/polymer/commit/e59dbef)) + +- Improvements to path API. Fixes #2509. * Allows `set` to take paths with array #keys * Allows `notifyPath` to take paths with array indices * Exposes public notifySplices API ([commit](https://github.com/Polymer/polymer/commit/10021cc)) + +- Fix merge issue. ([commit](https://github.com/Polymer/polymer/commit/85c23e1)) + +- Denote keys with # to disambiguate from index. Fixes #2007. ([commit](https://github.com/Polymer/polymer/commit/85d8a3a)) + +- update CHANGELOG to 1.1.5 ([commit](https://github.com/Polymer/polymer/commit/b2b23c4)) + +- make tests work on polyfill. ([commit](https://github.com/Polymer/polymer/commit/9ff2ee4)) + +- add `observeNodes` tests. ([commit](https://github.com/Polymer/polymer/commit/bd90b57)) + +- Add optional attribute tracking to support better distributed node notifications under shadow dom. ([commit](https://github.com/Polymer/polymer/commit/8242a98)) + +- Add `Polymer.dom().notifyObservers` method to 'kick' observers, for example, when attributes change under Shadow DOM. ([commit](https://github.com/Polymer/polymer/commit/07261e4)) + +- Add mutation tracking for distributedNodes. ([commit](https://github.com/Polymer/polymer/commit/b11f86b)) + +- Factor dom-api's into separate helpers. ([commit](https://github.com/Polymer/polymer/commit/effedcb)) + +- Adds `Polymer.dom(element).observeChildren(callback)` api ([commit](https://github.com/Polymer/polymer/commit/6499e83)) + +- Adds `getEffectiveChildNodes`, `getEffectiveChildren`, `getEffectiveTextContent` ([commit](https://github.com/Polymer/polymer/commit/f34fb45)) + +##[v1.1.5](https://github.com/Polymer/polymer/tree/v1.1.5) (2015-10-08) +- Simplify ([commit](https://github.com/Polymer/polymer/commit/79dfe1f)) + +- Clean up templatizer _pathEffectorImpl. ([commit](https://github.com/Polymer/polymer/commit/1a89bcf)) + +- Add issue link. ([commit](https://github.com/Polymer/polymer/commit/e4c2433)) + +- Missing var keyword ([commit](https://github.com/Polymer/polymer/commit/45fcbcf)) + +- Make sure we only actually call _listen once ([commit](https://github.com/Polymer/polymer/commit/837e9b8)) + +- Add templatizer tests. Fix issues from tests. ([commit](https://github.com/Polymer/polymer/commit/2d97cd7)) + +- Use 'value' in place of 'object' when referring to detail. ([commit](https://github.com/Polymer/polymer/commit/f17be35)) + +- Allow any type, not just objects, as the detail for fire. ([commit](https://github.com/Polymer/polymer/commit/ec59f57)) + +- Make model param of stamp method optional. ([commit](https://github.com/Polymer/polymer/commit/a2e1e64)) + +- add test to ensure unlisten events do not fire ([commit](https://github.com/Polymer/polymer/commit/bf2f694)) + +- add tests ([commit](https://github.com/Polymer/polymer/commit/900d82b)) + +- Only one real listener per `listen` call ([commit](https://github.com/Polymer/polymer/commit/8bd380a)) + +- add util method for shadow children ([commit](https://github.com/Polymer/polymer/commit/1e9110a)) + +- Add notify-path API to templatized template. Fixes #2505. ([commit](https://github.com/Polymer/polymer/commit/2e086fe)) + +- Parent property values should come from template. Fixes #2504. ([commit](https://github.com/Polymer/polymer/commit/23c883b)) + +- Added note about including a clear repro case. ([commit](https://github.com/Polymer/polymer/commit/e18f009)) + +- added request to submit an issue before sending a PR ([commit](https://github.com/Polymer/polymer/commit/6ed836f)) + +- update CHANGELOG to 1.1.4 ([commit](https://github.com/Polymer/polymer/commit/c2b7c31)) + ##[v1.1.4](https://github.com/Polymer/polymer/tree/v1.1.4) (2015-09-25) - :memo: Update description ([commit](https://github.com/Polymer/polymer/commit/6afb8be)) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 26ec2bf6..576d8579 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,9 +2,9 @@ There are many ways to contribute to the Polymer project! We welcome and truly appreciate contribution in all forms - issues and pull requests to the [main library](https://github.com/polymer/polymer), issues and pull requests to the [elements the Polymer team maintains](https://github.com/polymerelements), issues and pull requests to one of our many [Polymer-related tools](https://github.com/polymer), and of course we love to hear about any Polymer elements that you build to share with the community! -# Logistics +## Logistics -## Communicating with the Polymer team +### Communicating with the Polymer team Beyond Github, we try to have a variety of different lines of communication open: @@ -14,17 +14,17 @@ Beyond Github, we try to have a variety of different lines of communication open * [Mailing list](https://groups.google.com/forum/#!forum/polymer-dev) * [Slack channel](https://bit.ly/polymerslack) -## The Polymer Repositories +### The Polymer Repositories Because of the component-based nature of the Polymer project, we tend to have lots of different repositories. Our main repository for the Polymer library itself is at [github.com/Polymer/polymer](https://github.com/polymer/polymer). File any issues or pull requests that have to do with the core library on that repository, and we'll take a look ASAP. -We keep all of the element "product lines" that the Polymer team maintains and distributes in the [PolymerElements](https://github.com/polymerelements) organization. For any element-specific issues or pull requests, file directly on the element's repository, such as the `paper-button` repository at [github.com/polymerelements/paper-button](https://github.com/polymerelements/paper-button). Of course, the elements built by the Polymer team are just a tiny fraction of all the Polymer-based elements out there - catalogs of other web components include [customelements.io](http://www.customelements.io) and [component.kitchen](http://www.component.kitchen). +We keep all of the element "product lines" that the Polymer team maintains and distributes in the [PolymerElements](https://github.com/polymerelements) organization. For any element-specific issues or pull requests, file directly on the element's repository, such as the `paper-button` repository at [github.com/polymerelements/paper-button](https://github.com/polymerelements/paper-button). Of course, the elements built by the Polymer team are just a tiny fraction of all the Polymer-based elements out there - catalogs of other web components include [customelements.io](http://www.customelements.io) and [component.kitchen](http://component.kitchen). The GoogleWebComponents element product line is maintained by teams all across Google, and so is kept in a separate organization: the [GoogleWebComponents](https://github.com/googlewebcomponents) org. Feel free to file issues and PR's on those elements directly in that organization. We also track each element product line overall in "meta-repos", named as `$PRODUCTLINE-elements`. These include [paper-elements](https://github.com/polymerelements/paper-elements), [iron-elements](https://github.com/polymerelements/iron-elements), [gold-elements](https://github.com/polymerelements/gold-elements), and more. Feel free to file issues for element requests on those meta-repos, and the README in each repo tracks a roadmap for the product line. -## Contributor License Agreement +### Contributor License Agreement You might notice our friendly CLA-bot commenting on a pull request you open if you haven't yet signed our CLA. We use the same CLA for all open-source Google projects, so you only have to sign it once. Once you complete the CLA, all your pull-requests will automatically get the `cla: yes` tag. @@ -32,9 +32,9 @@ If you've already signed a CLA but are still getting bothered by the awfully ins [Complete the CLA](https://cla.developers.google.com/clas) -# Contributing +## Contributing -## Filing bugs +### Filing bugs The Polymer team heavily uses (and loves!) Github for all of our software management. We use Github issues to track all bugs and features. @@ -46,14 +46,109 @@ We love examples for addressing issues - issues with a Plunkr, jsFiddle, or jsBi Occasionally we'll close issues if they appear stale or are too vague - please don't take this personally! Please feel free to re-open issues we've closed if there's something we've missed and they still need to be addressed. -## Contributing Code to Elements +### Contributing Pull Requests + +PR's are even better than issues. We gladly accept community pull requests. In general across the core library and all of the elements, there are a few necessary steps before we can accept a pull request: + +- Open an issue describing the problem that you are looking to solve in your PR (if one is not already open), and your approach to solving it. This makes it easier to have a conversation around the best general approach for solving your problem, outside of the code itself. +- Sign the [CLA](https://cla.developers.google.com/clas), as described above. +- Fork the repo you're making the fix on to your own Github account. +- Code! +- Ideally, squash your commits into a single commit with a clear message of what the PR does. If it absolutely makes sense to keep multiple commits, that's OK - or perhaps consider making two separate PR's. +- **Include tests that test the range of behavior that changes with your PR.** If you PR fixes a bug, make sure your tests capture that bug. If your PR adds new behavior, make sure that behavior is fully tested. Every PR *must* include associated tests. (See [Unit tests](#unit-tests) for more.) +- Submit your PR, making sure it references the issue you created. +- If your PR fixes a bug, make sure the issue includes clear steps to reproduce the bug so we can test your fix. + +If you've completed all of these steps the core team will do its best to respond to the PR as soon as possible. + +#### Contributing Code to Elements Though the aim of the Polymer library is to allow lots of flexibility and not get in your way, we work to standardize our elements to make them as toolable and easy to maintain as possible. All elements should follow the [Polymer element style guide](http://polymerelements.github.io/style-guide/), which defines how to specify properties, documentation, and more. It's a great guide to follow when building your own elements as well, for maximum standardization and toolability. For instance, structuring elements following the style guide will ensure that they work with the [`iron-component-page`](https://github.com/polymerelements/iron-component-page) element, an incredibly easy way to turn any raw element directly into a documentation page. -## Contributing Code to the Polymer library +#### Contributing Code to the Polymer library We follow the most common javascript and HTML style guidelines for how we structure our code - in general, look at the code and you'll know how to contribute! If you'd like a bit more structure, the [Google Javascript Styleguide](https://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml) is a good place to start. Polymer also participates in Google's [Patch Rewards Program](http://www.google.com/about/appsecurity/patch-rewards/), where you can earn cold, hard cash for qualifying security patches to the Polymer library. Visit the [patch rewards page](http://www.google.com/about/appsecurity/patch-rewards/) to find out more. + +## Unit tests + +All Polymer projects use [`web-component-tester`](https://github.com/Polymer/web-component-tester) for unit tests. +The [`polyserve`](https://github.com/PolymerLabs/polyserve) utility is helpful for running tests in the browser. + +For maximum flexibility, install `web-component-tester` and `polyserve` locally: + + npm install -g polyserve web-component-tester + +### Running the Polymer library unit tests + +To run the Polymer library unit tests: + +1. Clone the [Polymer repo](https://github.com/polymer/polymer). + +2. Install the dependencies: + + npm install && bower install + +3. Run the tests: + + npm test + + Or if you have `web-component-tester` installed locally: + + wct + +To run individual test suites: + +npm test path/to/suite + +Or: + +wct path/to/suite + +For example: + + npm test test/unit/template.html + +You can also run tests in the browser: + + polyserve + +Navigate to: + +[`http://localhost:8080/components/polymer/test/runner.html`](http://localhost:8080/components/polymer/test/runner.html) + +### Running Polymer element unit tests + +To run the element unit tests, you need a global +install of `web-component-tester` or `polyserve` (or both). + +1. Clone the element repo. + +2. Install the dependencies. + + bower install + +3. Run the tests: + + wct + + Or run the tests in a browser: + + polyserve + + Navigate to: + + http://localhost:8080/components/element-name/test/runner.html + +### Configuring `web-component-tester` + +By default, `web-component-tester` runs tests on all installed browsers. You can configure it +to run tests on a subset of available browsers, or to run tests remotely using Sauce Labs. + +See the [`web-component-tester` README](https://github.com/Polymer/web-component-tester) for +information on configuring the tool. + + diff --git a/PRIMER.md b/PRIMER.md index 3b76f218..11b77286 100644 --- a/PRIMER.md +++ b/PRIMER.md @@ -3,7 +3,7 @@ Below is a description of current Polymer features, followed by individual feature guides. -See [the full Polymer.Base API documentation](http://polymer.github.io/polymer/) for details on specific methods and properties. +See [the full Polymer.Base API documentation](http://polymer.github.io/polymer/) for details on specific methods and properties. **Basic Custom Element sugaring** @@ -38,7 +38,7 @@ See [the full Polymer.Base API documentation](http://polymer.github.io/polymer/) | Feature | Usage |---------|------- | [Local node marshaling](#node-marshaling) | this.$.\ -| [Event listener setup](#event-listeners)| listeners: { ‘\.\’: ‘function’, ... } +| [Host event listener setup](#event-listeners)| listeners: { ‘\’: ‘function’, ... } | [Annotated event listener setup](#annotated-listeners) | \ | [Gesture event support](#gesture-events) | \ @@ -167,8 +167,8 @@ MyElement = Polymer({ is: 'my-element', factoryImpl: function(foo, bar) { - el.foo = foo; - el.configureWithBar(bar); + this.foo = foo; + this.configureWithBar(bar); }, configureWithBar: function(bar) { @@ -1085,17 +1085,10 @@ Polymer({ Properties of the custom element may be bound into text content or properties of local DOM elements using binding annotations in the template. -To bind to textContent, the binding annotation must currently span the entire content of the tag: - ```html @@ -359,6 +383,26 @@ }); + + - - + + + + + + + + + + + + diff --git a/test/unit/bind.html b/test/unit/bind.html index 47d7d889..dd0cb055 100644 --- a/test/unit/bind.html +++ b/test/unit/bind.html @@ -16,7 +16,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN - @@ -373,6 +379,15 @@ suite('2-way binding effects between elements', function() { assert.equal(el.boundreadonlyvalue, 46, 'property bound to read-only property should change from change to bound value'); }); + test('listener for value-changed fires when value changed from host', function() { + var listener = sinon.spy(); + el.$.basic1.addEventListener('notifyingvalue-changed', listener); + el.boundnotifyingvalue = 678; + assert.equal(el.$.basic1.notifyingvalue, 678); + assert.isTrue(listener.calledOnce); + assert.equal(listener.getCalls()[0].args[0].detail.value, 678); + }); + }); suite('1-way binding effects between elements', function() { @@ -598,6 +613,17 @@ suite('binding to attribute', function() { assert(!el.$.boundChild.hasAttribute('attrvalue')); }); + test('bind to value attribute on input should not fail', function() { + Polymer({ + is: 'x-input-value' + }); + + var el = document.createElement('x-input-value'); + el.inputValue = "the value"; + assert.equal(el.$.input.value, "the value", "The value of the input is not propagated"); + assert.equal(el.$.input.value$, undefined, "value$ should be removed from input"); + }); + }); suite('avoid non-bubbling event gotchas', function() { @@ -653,7 +679,6 @@ suite('warnings', function() { var warned = false; el._warn = function() { warned = true; - warn.apply(el, arguments); }; el.noObserver = 42; assert.equal(warned, true, 'no warning for undefined observer'); @@ -663,7 +688,6 @@ suite('warnings', function() { var warned = false; el._warn = function() { warned = true; - warn.apply(el, arguments); }; el.noComplexObserver = {}; assert.equal(warned, true, 'no warning for undefined complex observer'); @@ -673,7 +697,6 @@ suite('warnings', function() { var warned = false; el._warn = function() { warned = true; - warn.apply(el, arguments); }; el.noComputed = 99; assert.equal(warned, true, 'no warning for undefined computed function'); @@ -683,7 +706,6 @@ suite('warnings', function() { var warned = false; el._warn = function() { warned = true; - warn.apply(el, arguments); }; el.noInlineComputed = 99; assert.equal(warned, true, 'no warning for undefined computed function'); @@ -691,22 +713,153 @@ suite('warnings', function() { }); - - - - - diff --git a/test/unit/configure-elements.html b/test/unit/configure-elements.html index da91f857..c3eee344 100644 --- a/test/unit/configure-elements.html +++ b/test/unit/configure-elements.html @@ -128,7 +128,7 @@ diff --git a/test/unit/css-parse.html b/test/unit/css-parse.html index 36172ae7..e718ed45 100644 --- a/test/unit/css-parse.html +++ b/test/unit/css-parse.html @@ -59,6 +59,44 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN background: red; } /* comment */ + + /* + This is a multi-line comment + */ + + /*.aclassThatShouldBeIgnored { + someProperty: thatMustNotShowUp + }*/ + + + + + diff --git a/test/unit/custom-style-late-import.html b/test/unit/custom-style-late-import.html new file mode 100644 index 00000000..fa6f62be --- /dev/null +++ b/test/unit/custom-style-late-import.html @@ -0,0 +1,19 @@ + + + \ No newline at end of file diff --git a/test/unit/custom-style-late.html b/test/unit/custom-style-late.html new file mode 100644 index 00000000..92a28df7 --- /dev/null +++ b/test/unit/custom-style-late.html @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + diff --git a/test/unit/custom-style.html b/test/unit/custom-style.html index 8fe3d9a9..d04c7340 100644 --- a/test/unit/custom-style.html +++ b/test/unit/custom-style.html @@ -47,6 +47,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }; } + :root { + --red-text : { + color : red; + }; + } + + :root{--blue-text:{color:#0000ff};--dummy-mixin:{};--bold-text:{font-weight:700}} + :root { @@ -69,15 +77,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN } x-foo { - + --primary: 10px; } body /deep/ * { --deeep: 6px solid orange; } - - + + @@ -126,11 +144,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN + + + + + +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/unit/dom-bind-elements2.html b/test/unit/dom-bind-elements2.html index 5dad951a..be6e482d 100644 --- a/test/unit/dom-bind-elements2.html +++ b/test/unit/dom-bind-elements2.html @@ -1,5 +1,4 @@ \ No newline at end of file + diff --git a/test/unit/dom-bind.html b/test/unit/dom-bind.html index 2b40a376..e44f3819 100644 --- a/test/unit/dom-bind.html +++ b/test/unit/dom-bind.html @@ -226,6 +226,5 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN - diff --git a/test/unit/dom-if-elements.html b/test/unit/dom-if-elements.html index f569bebf..238b9d42 100644 --- a/test/unit/dom-if-elements.html +++ b/test/unit/dom-if-elements.html @@ -165,13 +165,42 @@
1
2
3
- Stuff + {{text}}
4
+
+ + + + diff --git a/test/unit/dom-if.html b/test/unit/dom-if.html index c1e46d69..5b554b01 100644 --- a/test/unit/dom-if.html +++ b/test/unit/dom-if.html @@ -56,6 +56,21 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN +
+ + +
+
+
+ +
+ +
+ diff --git a/test/unit/dom-module-inline.html b/test/unit/dom-module-inline.html index edc8cfc0..cfc8a76f 100644 --- a/test/unit/dom-module-inline.html +++ b/test/unit/dom-module-inline.html @@ -23,13 +23,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN var module; suite('dom-module inline', function() { - var temp = document.getElementById('temp'); test('dom-module will work when inlined', function() { // simulate an inline dom-module // use a new script object to make document.currentScript work correctly var e = document.createElement('script'); - e.textContent = 'temp.innerHTML = \'\'; module = Polymer.DomModule.import("foo");'; + e.textContent = + 'temp.innerHTML = \'\';' + + 'module = Polymer.DomModule.import("foo");'; document.body.appendChild(e); assert.ok(module, 'found module'); }); diff --git a/test/unit/dom-repeat-elements.html b/test/unit/dom-repeat-elements.html index 274294da..54ee9a5c 100644 --- a/test/unit/dom-repeat-elements.html +++ b/test/unit/dom-repeat-elements.html @@ -411,3 +411,64 @@ window.data = [ }); + + + + + + + + + + diff --git a/test/unit/dom-repeat.html b/test/unit/dom-repeat.html index 65de283c..222619bc 100644 --- a/test/unit/dom-repeat.html +++ b/test/unit/dom-repeat.html @@ -71,6 +71,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN

x-primitive-large

+

x-repeat-limit

+ + +

x-repeat-chunked

+ +
@@ -93,12 +99,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN stamped[38] .. 3-3-3 */ + suite('errors', function() { test('items must be array', function() { - assert.throws(function() { - inDocumentRepeater.items = {}; - }, /expected array/, 'should warn when items is not array'); + var warned = false; + inDocumentRepeater._error = function(message) { + assert.match(message, /expected array/) + warned = true; + } + inDocumentRepeater.items = {}; + assert.equal(warned, true, 'should warn when items is not array'); }); }); @@ -108,6 +119,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN test('basic rendering, downward item binding', function() { var stamped = Polymer.dom(configured.root).querySelectorAll('*:not(template)'); assert.equal(stamped.length, 3 + 3*3 + 3*3*3, 'total stamped count incorrect'); + assert.equal(configured.$.repeater.renderedItemCount, 3, 'rendered item count incorrect'); assert.equal(stamped[0].itemaProp, 'prop-1'); assert.equal(stamped[0].computeda, 'prop-1+itemForComputedA'); assert.equal(stamped[0].indexa, 0); @@ -275,6 +287,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN CustomElements.takeRecords(); var stamped = Polymer.dom(configured.root).querySelectorAll('*:not(template)'); assert.equal(stamped.length, 2 + 2*3 + 2*3*3, 'total stamped count incorrect'); + assert.equal(configured.$.repeater.renderedItemCount, 2, 'rendered item count incorrect'); assert.equal(stamped[0].itemaProp, 'prop-1'); assert.equal(stamped[0].indexa, 0); assert.equal(stamped[13].itemaProp, 'prop-3'); @@ -1310,6 +1323,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN done(); }); }); + } else { + done(); } }); @@ -3215,7 +3230,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN setTimeout(function() { var stamped1 = Polymer.dom(primitive.$.container1).querySelectorAll('*:not(template)'); for (var i=0; i lastLength); + } + if (stamped.length < 100) { + lastLength = stamped.length; + checkUntilComplete(); + } else { + // Final rendering at exact item count + assert.equal(stamped.length, 100); + done(); + } + }; + var checkUntilComplete = function() { + // On polyfilled MO, need to wait one setTimeout before rAF + if (MutationObserver._isPolyfilled) { + setTimeout(function() { + requestAnimationFrame(checkCount); + }); + } else { + requestAnimationFrame(checkCount); + } + }; + + chunked.items = chunked.preppedItems.slice(); + checkUntilComplete(); + + }); + + test('mutations during chunked rendering', function(done) { + + var checkItemOrder = function(stamped) { + var last = -1; + for (var i=0; i last); + last = curr; + } + }; + + var mutateArray = function(repeater, renderedCount) { + // The goal here is to remove & add some, and do it over + // the threshold of where we have currently rendered items, and + // ensure that the prop values of the newly inserted items are in + // ascending order so we can do a simple check in checkItemOrder + var overlap = 2; + var remove = 4; + var add = 6; + var start = renderedCount.length - overlap; + if (start + add < repeater.items.length) { + var end = start + remove; + var args = ['items', start, remove]; + var startVal = repeater.items[start].prop; + var endVal = repeater.items[end].prop; + var delta = (endVal - startVal) / add; + for (var i=0; i lastLength); + } + if (stamped.length < chunked.items.length) { + if (mutateCount-- > 0) { + mutateArray(chunked, stamped); + } + lastLength = stamped.length; + checkUntilComplete(); + } else { + // Final rendering at exact item count + assert.equal(stamped.length, chunked.items.length); + done(); + } + }; + var checkUntilComplete = function() { + // On polyfilled MO, need to wait one setTimeout before rAF + if (MutationObserver._isPolyfilled) { + setTimeout(function() { + requestAnimationFrame(checkCount); + }); + } else { + requestAnimationFrame(checkCount); + } + }; + + chunked.items = chunked.preppedItems.slice(); + checkUntilComplete(); + + }); + + + test('mutations during chunked rendering, sort & filtered', function(done) { + + var checkItemOrder = function(stamped) { + var last = Infinity; + for (var i=0; i lastLength); + } + } + if (stamped.length < filteredLength) { + if (mutateCount-- > 0) { + mutateArray(chunked, stamped); + } + lastLength = stamped.length; + checkUntilComplete(); + } else { + assert.equal(stamped.length, filteredLength); + done(); + } + }; + var checkUntilComplete = function() { + // On polyfilled MO, need to wait one setTimeout before rAF + if (MutationObserver._isPolyfilled) { + setTimeout(function() { + requestAnimationFrame(checkCount); + }); + } else { + requestAnimationFrame(checkCount); + } + }; + + chunked.$.repeater.sort = function(a, b) { + return b.prop - a.prop; + }; + chunked.$.repeater.filter = function(a) { + return (a.prop % 2) === 0; + }; + chunked.items = chunked.preppedItems.slice(); + checkUntilComplete(); + + }); + + }); + + } + diff --git a/test/unit/dynamic-import.html b/test/unit/dynamic-import.html index 983f05a4..c4c94588 100644 --- a/test/unit/dynamic-import.html +++ b/test/unit/dynamic-import.html @@ -20,7 +20,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN diff --git a/test/unit/dynamic-imports/dynamic-element.html b/test/unit/dynamic-imports/dynamic-element.html index 7b5b1467..3233e3fb 100644 --- a/test/unit/dynamic-imports/dynamic-element.html +++ b/test/unit/dynamic-imports/dynamic-element.html @@ -12,12 +12,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN \ No newline at end of file + diff --git a/test/unit/events-elements.html b/test/unit/events-elements.html index 5f283af2..668c9bb9 100644 --- a/test/unit/events-elements.html +++ b/test/unit/events-elements.html @@ -93,3 +93,19 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }); + + + + diff --git a/test/unit/events.html b/test/unit/events.html index 518d4b97..3ffb4745 100644 --- a/test/unit/events.html +++ b/test/unit/events.html @@ -141,6 +141,51 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN assert.deepEqual(el._removed[3], {target: 'div', event: 'bar'}); }); }); + + suite('Event Listener Cache', function() { + suiteSetup(function() { + el = document.createElement('x-double'); + document.body.appendChild(el); + el.setup(); + }); + + suiteTeardown(function() { + document.body.removeChild(el); + }); + + test('listen marks event handler as listening', function() { + var handler = el._recallEventHandler(el, 'foo', el, 'missing'); + assert.equal(handler._listening, true, 'handler should be marked'); + }); + + test('Event handler fires only once', function() { + el.fire('foo'); + assert.equal(el._warned.length, 1, 'event should fire only once'); + }); + + test('listen reuses handler cache', function() { + var expected = el._recallEventHandler(el, 'foo', el, 'missing'); + el.listen(el, 'foo', 'missing'); + var actual = el._recallEventHandler(el, 'foo', el, 'missing'); + assert.equal(actual, expected, 'function was not cached'); + }); + + test('unlisten keeps handler for caching', function() { + el.teardown(); + var fn = el._recallEventHandler(el, 'foo', el, 'missing'); + assert.ok(fn, 'should be cached'); + }); + + test('unlisten markes cached handler as not listening', function() { + var handler = el._recallEventHandler(el, 'foo', el, 'missing'); + assert.equal(handler._listening, false, 'handler should not be listening'); + }); + + test('once unlistened, no handler fire', function() { + el.fire('foo'); + assert.equal(el._warned.length, 1, 'event should not be handled anymore'); + }); + }); }); diff --git a/test/unit/gestures-elements.html b/test/unit/gestures-elements.html index 17c55f2b..ee9a3c13 100644 --- a/test/unit/gestures-elements.html +++ b/test/unit/gestures-elements.html @@ -139,3 +139,28 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }); + + + + diff --git a/test/unit/gestures.html b/test/unit/gestures.html index e77a45e3..24efc9e1 100644 --- a/test/unit/gestures.html +++ b/test/unit/gestures.html @@ -12,7 +12,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN - + @@ -386,6 +386,65 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }); }); }); + + suite('SD Polyfill', function() { + var el; + setup(function() { + el = document.createElement('x-document-listener'); + document.body.appendChild(el); + el.setup(); + }); + + teardown(function() { + el.teardown(); + document.body.removeChild(el); + }); + + test('document listener works in SD polyfill', function() { + var ev = new CustomEvent('mousedown', {bubbles: true}); + el.dispatchEvent(ev); + assert.equal(el.stream.length, 1); + }); + }); + + suite('Reference Cleanup', function() { + var el; + + setup(function() { + el = document.createElement('x-buttons'); + document.body.appendChild(el); + }); + + teardown(function() { + document.body.removeChild(el); + }); + + test('down and up clear document tracking', function() { + var ev = new CustomEvent('mousedown', {bubbles: true}); + el.dispatchEvent(ev); + + // some recognizers do not track the document, like tap + var recognizers = Polymer.Gestures.recognizers.filter(function(r) { + return r.info.hasOwnProperty('movefn') && + r.info.hasOwnProperty('upfn'); + }); + + assert.isAbove(recognizers.length, 0, 'some recognizers track the document'); + + recognizers.forEach(function(r) { + assert.isFunction(r.info.movefn, r.name + ' movefn'); + assert.isFunction(r.info.upfn, r.name + ' upfn'); + }); + + ev = new CustomEvent('mouseup', {bubbles: true}); + el.dispatchEvent(ev); + + recognizers.forEach(function(r) { + assert.isNull(r.info.movefn, r.name + ' movefn'); + assert.isNull(r.info.upfn, r.name + ' upfn'); + }); + }); + }); diff --git a/test/unit/globals.html b/test/unit/globals.html new file mode 100644 index 00000000..34ae5552 --- /dev/null +++ b/test/unit/globals.html @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + diff --git a/test/unit/notify-path-elements.html b/test/unit/notify-path-elements.html index 4afbae4a..48bf32cb 100644 --- a/test/unit/notify-path-elements.html +++ b/test/unit/notify-path-elements.html @@ -124,6 +124,7 @@ 'multipleChanged(a, b, nested.obj.*)', 'multiplePathsChanged(a, nested.b, nested.obj.c)', 'arrayChanged(array.splices)', + 'arrayChangedDeep(array.*)', 'arrayNoCollChanged(arrayNoColl.splices)', 'arrayOrPropChanged(prop, array.splices)', 'aChanged(a.*)', @@ -210,6 +211,7 @@ 'arrayChanged keySplices incorrect'); } }, + arrayChangedDeep: function(info) { }, arrayNoCollChanged: function(splices) { this.observerCounts.arrayNoCollChanged++; if (this.arrayNoColl.length) { @@ -228,4 +230,4 @@ cChanged: function() {} }); - \ No newline at end of file + diff --git a/test/unit/notify-path.html b/test/unit/notify-path.html index 0408a543..74f24c82 100644 --- a/test/unit/notify-path.html +++ b/test/unit/notify-path.html @@ -19,6 +19,21 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN diff --git a/test/unit/polymer-dom-content.html b/test/unit/polymer-dom-content.html index 9ff18071..3b1bda29 100644 --- a/test/unit/polymer-dom-content.html +++ b/test/unit/polymer-dom-content.html @@ -40,6 +40,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN + + + + +