Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
WebComponents LT at AQ
Search
Yoshihiro Iwanaga
August 29, 2013
Programming
71
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
WebComponents LT at AQ
Yoshihiro Iwanaga
August 29, 2013
More Decks by Yoshihiro Iwanaga
See All by Yoshihiro Iwanaga
HTTP2 最速実装v2
yoshi
0
140
JavaScript と Arduino でオリジナルデバイスを作ろう
yoshi
0
95
Anomaly Detection by Mean and Standard Deviation
yoshi
0
180
MHTML LT at AQ
yoshi
2
63
HOTATE (Developers Summit 2012)
yoshi
0
40
Anomaly detection using correlations of load
yoshi
0
62
Other Decks in Programming
See All in Programming
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
390
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
270
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
310
プロダクトコードからライブラリの境界を見つける
elmetal
PRO
0
110
Rでドレミ/Do-Re-Mi_with_R
florets1
0
120
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
280
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
350
Agents on Rails - Rails at Scale 2026
irinanazarova
0
340
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
450
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
340
R8 の設定見直しでアプリサイズ削減
andpad
0
180
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
110
Featured
See All Featured
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
420
GitHub's CSS Performance
jonrohan
1033
470k
Evolving SEO for Evolving Search Engines
ryanjones
0
310
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Un-Boring Meetings
codingconduct
0
440
Writing Fast Ruby
sferik
630
63k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
300
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
390
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
610
Transcript
WebComponents iwanaga
Who am I Working at Twitter bot @quake_alert @quake_alert_en Yoshihiro
Iwanaga
What is WebComponents? Provides mechanism for the declaration of markup
prototype. (W3C Working Draft) Makes reusing and composing HTML components much easier J
None
None
The component model for the WebComponents 1. Templates 2. Decorators
3. Custom Elements 4. Shadow DOM 5. Imports
Templates <template id="t"> <div> <h2>デフォルトテキスト</h2> <figure> <img alt="image"> <figcaption>キャプション</figcaption> <button>イイネ!</button>
</figure> </div> </template>
insert template to DOM var t = document.getElementById('t'); var clone
= t.content.cloneNode(true); clone.querySelector('h2').textContent = 'テキスト'; clone.querySelector('img').src = 'image.png'; clone.querySelector('figcaption').textContent = 'キャプション'; document.body.appendChild(clone); <template id="t"> <div> <h2>デフォルトテキスト</h2> <figure> <img alt="image"> <figcaption>キャプション</figcaption> <button>イイネ!</button> </figure> </div> </template>
demo
Shadow DOM Establishes functional boundaries in document tree. Document tree
boundary Shadow tree
Shadow DOM <div id="target"></div> <script> document.addEventListener("DOMContentLoaded", function(){ /* not supported
*/ //var shadow = document.getElementById("target”) .createShadowRoot(); /* deprecated. Webkit Only */ //var shadow = new WebKitShadowRoot( document.getElementById("target")); /* Webkit Only */ var shadow = document.getElementById("target") .webkitCreateShadowRoot(); shadow.innerHTML = '<h2>this is shadow tree</h2>' + '<img src="image.jpg">'; }, false); </script>
demo
Wait !! How is the Style inheritance?
<script> document.addEventListener("DOMContentLoaded", function(){ /* not supported */ //var shadow =
document.getElementById("target”) .createShadowRoot(); /* Webkit Only */ var shadow = document.getElementById("target") .webkitCreateShadowRoot(); /* resetStyleInheritance */ shadow.resetStyleInheritance = true; shadow.innerHTML = '<h2>this is shadow tree</h2>' + '<img src="image.jpg">'; }, false); </script> Preventing the CSS inheritance
demo
How is the browser compatibility?
Browser Compatibility lol
Frameworks J http://www.polymer-project.org/ Polymer Brick http://mozilla.github.io/brick/
Thanks @quake_alert! @quake_alert_en please follow