shady-dom

Shadow DOM v1 CSS polyfill

被刻印的时光 ゝ 提交于 2019-12-23 10:07:09
问题 https://developers.google.com/web/fundamentals/getting-started/primers/shadowdom This got me all excited I could write my own custom webpage from scratch without polymer. Only to find out css :host for example is not working in Edge and FireFox. I can deal without html import for now until w3c figured out what they want to do with es6 modules, but each browser having their own half implemented Shadow DOM version without css is pushing my buttons. So I still need a full polymer stack to have

Expose specific element in ShadowDom to external JS using document.getElementById

 ̄綄美尐妖づ 提交于 2019-12-11 04:27:20
问题 I have a v0/Polymer 1 web component that I am upgrading to v1/Polymer 2. This web component dynamically builds a URI that loads an external JavaScript file. The external JavaScript file runs and loads an <iframe> into a <div> of my component. This external JS contains document.getElementById to load the <iframe> into the specified <div> . I have searched and haven't found a way to force the <div> element to be exposed/placed in the shady DOM . I have read that if I design the component

How do I enable Shady DOM in Polymer 2.0?

Deadly 提交于 2019-11-30 13:54:19
Polymer 1.x uses Shady DOM by default, but that could be changed at initialization by setting the window.Polymer object before importing polymer.html as follows: <script>window.Polymer = {dom: 'shadow'};</script> <link rel="import" href="polymer.html"> However, it seems Polymer 2.0 uses Shadow DOM regardless of window.Polymer = {dom: 'shady'} . How do I switch to Shady DOM? The Shady DOM shim was factored out of Polymer in 2.0 and moved into the v1 Web Components polyfill. To enable Shady DOM (instead of the default Shadow DOM), define the following window.ShadyDOM object before importing the