A user account is required in order to edit this wiki, but we've had to disable public user registrations due to spam.

To request an account, ask an autoconfirmed user on Chat (such as one of these permanent autoconfirmed members).

Component Model Strawman: Isolation: Difference between revisions

From WHATWG Wiki
Jump to navigation Jump to search
(creating the page)
 
mNo edit summary
Line 1: Line 1:
Stub
= Overview =
 
The isolated components definition is a <tt>provide</tt> attributed HTML file which is loaded in separate namespace.
It is basically a document loaded by an iframe. But it has different way for communicating with the host document.
 
See also the "Isolation" section on [[Component_Model_Strawman:_Declarative_Syntax]].
 
== Element Registration and HTMLElementProxy ==
 
* XXX: define the element name resolution order.
 
Isolated providing document can register new elements for the host document.
But in slightly different way: the lifecycle callbacks including <tt>open</tt> and <tt>close</tt> use
<tt>HTMLElementProxy</tt> instead of <tt>HTMLElement</tt>, that means <tt>open</tt> should return
an instance of <tt>HTMLElementProxy</tt> and <tt>close</tt> callback receives it as a parameter.
 
<pre>
 
<head>
  <element for="x-comment">
    <script>
      HTMLElementElement.current.open = function() {
        var element = return new HTMLElementProxy();
        element.addEventListener("message", ...
        return element;
      }});
    </script>
  </element>
</head>
 
</pre>

Revision as of 02:05, 25 October 2011

Overview

The isolated components definition is a provide attributed HTML file which is loaded in separate namespace. It is basically a document loaded by an iframe. But it has different way for communicating with the host document.

See also the "Isolation" section on Component_Model_Strawman:_Declarative_Syntax.

Element Registration and HTMLElementProxy

  • XXX: define the element name resolution order.

Isolated providing document can register new elements for the host document. But in slightly different way: the lifecycle callbacks including open and close use HTMLElementProxy instead of HTMLElement, that means open should return an instance of HTMLElementProxy and close callback receives it as a parameter.


<head>
  <element for="x-comment">
    <script>
       HTMLElementElement.current.open = function() {
         var element = return new HTMLElementProxy();
         element.addEventListener("message", ...
         return element;
       }});
    </script>
  </element>
</head>