2. XBL 2.0 (15‐20mins) Widgets ...
What does it do..
What does it do Our definition of widget
How it works... Spec overview
Issues we want to
discuss
Please stop me to
discuss stuff!
14. Binding Global Attributes
Implementation
p e e tat o xbl:pseudo
b pseudo
Template ▪ For CSS pseudo selectors
▪ Content xbl:attr
▪ div ▪ For forwarding attributes
▪ Inherited
Resources
▪ Prefetch
▪ Style
Handlers
▪ Handler
Script
15. Same as HTML script <script>
Declare global var c = 0;
functions function magic(a,b ){
Scoped to the XBL return a + b c;
return a + b * c;
document }
</script?>
16. Allows you to define a binding:
How it behaves
H it b h
If it extends other bindings (inheritance model will
be discussed later)
What content it adds when bound to another
element
What resources it uses
17. Allows you to add new <binding element=“h1”>
DOM interfaces <implementation>
Define new functionality for ({
an object this.makeRed() =function(){
Define event handlers },
}
Define properties and fields this.onclick(e) = function{
this.makeRed();
}
})
</implementation>
/implementation
</binding>
...
<h1>
18. Template <binding id=“reshuffle”>
Contains a template of the
p <template>
content to be inserted into <content includes=“b”/>
a document <content includes=“a”/>
Content </template>
Inserts the “selected” </binding>
content of a bound ....
element
l t
<div id=“homepage”>
You can only use a selected
element once. <h1 id=“a”>Welcome!</h1>
The resulting DOM tree <h2 id=“b”>Marcos’
h id “b” M ’
is called shadow content page</h1>
</div>
19. DIV <binding extends=“reshuffle”>
Used as a general container <template>
mechanism (like HTML div) <div state=“idle”>
Has a “state” attribute <inherited>
Inherited <h1>
Used to insert the content of an no one’s homepage
extended binding into another </h1>
binding. </inherited>
<div>
p
</template>
<resources>
<style>
div[state=idle]{
color: yellow;
}
</style>
</ resources>
</binding>
20. Resources <binding>
Structural container <resources>
esou ces
Style <style>
Styles applied to a binding
y pp g button:active{
Author sheet styles can border: solid red;
also be applied to a background: url(fancy.png);
binding
bi di }
Prefetch </style>
Primes the cache <prefetch src=“fancy.png”/>
f h “f ”/
</resources>
</binding>
21. Allows you to group event The bound document is:
handlers
Trap DOM events and re‐route
p <hotspot message=quot;Hello Worldquot;>
p g
them to functions defined in the <instruction>
<implementation> Activate this text.
Fine‐grained control over </instruction>
keyboard and mouse events </hotspot>
The binding is:
g
<binding>
<handlers>
<handler event=quot;clickquot;>
alert(
event.currentTarget.getAttribute(
event currentTarget getAttribute(
'message' ));
</handler>
</handlers>
</binding>
22. id key
event key‐location
key location
phase text
trusted prev‐value
prev value
propagate new‐value
default action
default‐action attr name
attr‐name
button attr‐change
click‐count
click count
modifiers
23. Document attachment Binding Detachment
Processing Instruction Element.removeBinding(URI)
▪ <?xbl href=quot;foo.xmlquot;?>
New DOM interface
▪ document.loadBindingDocument('foo.xml');
Element Attachment
CSS
▪ ‐xbl‐binding: url(quot;foo.xmlquot;)
g ( )
Binding element
▪ <binding element=quot;#xquot;>
g
28. Widgets 1.0 addresses:
Packaging (Zip)
▪ Digital signature, Internationalization (?)
Bootstrapping
Configuration and Metadata
APIs
API
Automatic updates
Rendering, UI, accessibility
Security
29. Packaging format
Format: Zip (64bit?),Compression (Deflate)
Format: Zip (64bit?) Compression (Deflate)
Is it effectively specified? (eg. For longevity?)
Digital Signatures
XML Dig Sig: x.509 Certificates, tap into PKI,
As quality assurance
Internationalization
Leave it to the authors?
Make it folder based?
What about Unicode folder names?
31. Filename: config.xml
Elements: Id, version, description, author (url,
Elements Id version description author (url
email), title, start, icon, license, access
(network and plugins)
k d l
Have we captured what developers want?
p p
Flexible processing model
We want robust error handling
Parsing rules
Robust error handling (not overly strict, )
R b h dli ( l i )