|email@example.com <firstname.lastname@example.org>||Thu Dec 04 17:13:11 2014 +0000|
|email@example.com <firstname.lastname@example.org>||Thu Dec 04 17:13:11 2014 +0000|
update to polymer js 0.5.1 BUG= http://dartbug.com/21583 Remail@example.com Review URL: https://codereview.chromium.org//723393003 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart/pkg/web_components@42114 260f80e4-7a28-3924-810f-c04153c831b5
These features exist in dart:html, for example Element.reateShadowRoot and Document.register. However those APIs are not supported on all browsers yet unless you load the polyfills, as indicated below.
Include the polyfills in your HTML
<head> to enable Shadow DOM:
<script src="packages/web_components/webcomponents.min.js"></script> <script src="packages/web_components/dart_support.js"></script>
You can also use an unminified version for development:
<script src="packages/web_components/webcomponents.js"></script> <script src="packages/web_components/dart_support.js"></script>
Because the Shadow DOM polyfill does extensive DOM patching, webcomponents.js should be included before other script tags. Be sure to include dart_support.js too, it is required for the Shadow DOM polyfill to work with dart2js.
For example, after registering a special kind of button called
super-button, use the super button just like this:
Custom elements are still elements. We can create, use, manipulate, and compose them just as easily as any standard
See the Polymer Custom Elements page for more information.
Shadow DOM is designed to provide encapsulation by hiding DOM subtrees under shadow roots. It provides a method of establishing and maintaining functional boundaries between DOM trees and how these trees interact with each other within a document, thus enabling better functional encapsulation within the DOM.
See the Polymer Shadow DOM page for more information.
webcomponents.* files in this package are developed here. Follow the instructions there for how to build a new release and then copy the files into this package.