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
70
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
94
Anomaly Detection by Mean and Standard Deviation
yoshi
0
180
MHTML LT at AQ
yoshi
2
62
HOTATE (Developers Summit 2012)
yoshi
0
40
Anomaly detection using correlations of load
yoshi
0
62
Other Decks in Programming
See All in Programming
仕様駆動開発による爆速プロダクト開発 / Bakusoku Spec Driven Development
kobakei
0
110
{ Android | Kotlin } Gradle Plugin in 2026
ryunen344
1
320
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
120
kubernetes コンポーネント開発入門 / 新卒N年目の勉強会&交流会!〜〇〇への誘い〜 #n_study
mazrean
0
240
Kiroで創り、AgentCoreで繋ぐ!AWSで実践する「AI-DLC」から「AIエージェント統合」までの最新地図
licux
4
690
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
710
Heart of Swift Concurrency
koher
0
800
AI活用は、個人から組織へ|マルチプレイヤーエージェントハーネス「QM」の社内活用事例 / AI use is moving from individuals to orgs
rkaga
1
100
そのリトライ、死んだコネクションを使い回していませんか ── GoのHTTPクライアントとHTTP/2を実プロダクト障害から学び直す
myus4a
0
140
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
250
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
380
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
290
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Writing Fast Ruby
sferik
630
63k
Designing for Timeless Needs
cassininazir
1
480
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
330
Building the Perfect Custom Keyboard
takai
2
870
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Color Theory Basics | Prateek | Gurzu
gurzu
1
470
Build your cross-platform service in a week with App Engine
jlugia
234
19k
The Invisible Side of Design
smashingmag
301
52k
Ten Tips & Tricks for a 🌱 transition
stuffmc
1
230
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