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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Yoshihiro Iwanaga
August 29, 2013
Programming
79
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
WebComponents LT at AQ
Yoshihiro Iwanaga
August 29, 2013
Transcript
19 slides
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
More Decks by Yoshihiro Iwanaga
See All by Yoshihiro Iwanaga
HTTP2 最速実装v2
yoshi
0
150
JavaScript と Arduino でオリジナルデバイスを作ろう
yoshi
0
98
Anomaly Detection by Mean and Standard Deviation
yoshi
0
190
MHTML LT at AQ
yoshi
2
68
HOTATE (Developers Summit 2012)
yoshi
0
47
Anomaly detection using correlations of load
yoshi
0
70
Other Decks in Programming
See All in Programming
SODA - FACT BOOK(EN)
sodainc
1
300
Debian JP Projectのサーバー構成
uwabami
1
190
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
220
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
250
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
470
Datadog を OTel にするメリットを考察する — Datadog との併用を実アプリで確かめる / Examining the Benefits of Moving Datadog to OTel — Testing OTel Alongside Datadog in a Real App
seike460
PRO
1
110
Rails初心者がパスキーを実装してみて大変だったこと
ktombow
0
240
vue-tsc x TypeScript7
koukimiura
0
110
正解の無い問題を 「できるだけ上手く」解く ヒューリスティックで感性を磨こう。〜現実課題をプログラミングで解きあうコミュニティについて〜
allegrogiken
0
120
Skills Are the New npm [AAIF Bengaluru, Nov 2026]
shivamsaraswat
0
140
protojson における文字化けの扱い
kazuki1023
0
470
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
150
Featured
See All Featured
Mind Mapping
helmedeiros
1
460
The Limits of Empathy - UXLibs8
cassininazir
2
800
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Building Applications with DynamoDB
mza
96
7.3k
Side Projects
sachag
456
43k
The Curious Case for Waylosing
cassininazir
1
630
Building Better People: How to give real-time feedback that sticks.
wjessup
371
20k
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
3k
Building the Perfect Custom Keyboard
takai
2
970
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.5k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k