Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #4357. #4360

Merged
merged 7 commits into from
Mar 3, 2017
Merged

Fixes #4357. #4360

merged 7 commits into from
Mar 3, 2017

Conversation

sorvell
Copy link
Contributor

@sorvell sorvell commented Mar 2, 2017

Adds importPath and rootPath properties to Polymer.Element. The importPath property defaults to the path part of the url containing the dom-module matching the element's static is property. The rootPath property is set to the Polymer.rootPath property and defaults to the path part of the main document url. These properties can be used in bindings to url's. The importPath property is used to scope url's in element styles. [Note, this depends on this html-imports pr ].

…lement. The `importPath` property defaults to the path part of the url containing the dom-module matching the element's static `is` property. The `rootPath` property is set to the `Polymer.rootPath` property and defaults to the path part of the main document url. These properties can be used in bindings to url's. The `importPath` property is used to scope url's in element styles. [Note, this depends on webcomponents/html-imports#44].
Copy link
Member

@kevinpschaaf kevinpschaaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Add to README breaking change list
  • Confirmed perf impact?

* Defaults to the path matching the url containing a `dom-module` element
* matching this element's static `is` property.
* Note, this path does not contain a trailing `/`.
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@returns {string}

@@ -392,13 +392,16 @@
* style scoping.
* @param {HTMLElement} proto
* @param {HTMLTemplateElement} template
* @param {string} baseURI URL against which to resolve urls in
* style element cssText.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@returns {HTMLTemplateElement}

}
super._initializeProperties();
// set path defaults
this.rootPath = Polymer.rootPath;
this.importPath = importPath;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder to discuss why it was bad if these went before initializeProperties

// support user settings on the Polymer object
if (userPolymer) {
Object.assign(Polymer, userPolymer);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noting, this fixes the ability to set Polymer.sanitizeDOMValue before loading polymer, closing a loophole where it's conceivable that main-document e.g. dom-repeat's could upgrade before the sanitization hook is installed. 👍

return (new URL(url, baseURI)).href;
}
// Fallback to creating an anchor into a disconnected document.
let doc = tempDoc;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this indirection?

@kevinpschaaf
Copy link
Member

Also, looks like there's some Linux 41 issue

* `importPath` can now be a path fragment (e.g. `foo/`)
@sorvell sorvell merged commit da49964 into 2.0-preview Mar 3, 2017
@sorvell sorvell deleted the 2.0-fix-4357 branch March 3, 2017 03:41
This was referenced Mar 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants