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 Discussion: Difference between revisions

From WHATWG Wiki
Jump to navigation Jump to search
 
(8 intermediate revisions by 2 users not shown)
Line 11: Line 11:
= Issues =
= Issues =


* '''<span style="color: #006633">Now</span>''': issues regarding parts that are already implemented
* '''<span style="color: #006633">Now</span>''': in the spec draft and/or already in use for internal components
* '''<span style="color: #008866">Soon</span>''': issues regarding parts that we intend to implement soon
* '''<span style="color: #008866">Soon</span>''': to be included in V1 spec
* '''<span style="color: #00AA88">Later</span>''': issues regarding parts that we intend to postpone (may change substantially and/or not be implemented at all)
* '''<span style="color: #00AA88">Later</span>''': issues to be discussed for later versions of the spec
 


== CSS and Rendering ==
== CSS and Rendering ==
Line 19: Line 20:
* [http://wiki.whatwg.org/index.php?title=Component_Model_Discussion:_Rendering rendering sub-page]: discussions on rendering details
* [http://wiki.whatwg.org/index.php?title=Component_Model_Discussion:_Rendering rendering sub-page]: discussions on rendering details
* [http://wiki.whatwg.org/wiki/Component_Model_CSS_Brainstorming CSS brainstorming page]: brainstorming on alternative solutions to styling
* [http://wiki.whatwg.org/wiki/Component_Model_CSS_Brainstorming CSS brainstorming page]: brainstorming on alternative solutions to styling
=== <span style="color: #006633">Now</span> ===
* Do components create a layer?
** <span style="color: blue">assumption: no</span>
::[[User:Dglazkov|Dglazkov]]: isn't this an implementation detail?


=== <span style="color: #008866">Soon</span> ===
=== <span style="color: #008866">Soon</span> ===


* styling of rendering children of &lt;content&gt; (partially discussed in the [http://wiki.whatwg.org/wiki/Component_Model_CSS_Brainstorming CSS brainstorming page]).
* styling of rendering children of &lt;content&gt; (partially discussed in the [http://wiki.whatwg.org/wiki/Component_Model_CSS_Brainstorming CSS brainstorming page]).
=== <span style="color: #00AA88">Later</span> ===
* tab-index behavior
* tab-index behavior
* z-order behavior
* z-order behavior
Line 72: Line 64:
** on rebinding? (provided CSS 'binding' is possible)
** on rebinding? (provided CSS 'binding' is possible)
* event on component registration?
* event on component registration?


== Loading and Life Cycle ==
== Loading and Life Cycle ==
Line 78: Line 71:


* loading mechanism (syntax)
* loading mechanism (syntax)
:[[User:Annevk|Annevk]]: Have a binding="" attribute on the root element (similar to manifest="")?
* How to handle definition after use
* How to handle definition after use
** <span style="color:blue">assumption: don't do anything</span>
** <span style="color:blue">assumption: don't do anything</span>
* packaging
* packaging
* is it possible to rename a component? e.g., to avoid name clashes?
** <span style="color:blue">assumption: no</span>
* define all edge cases and “unhappy” cases. Examples: constructor throws exception (general case), constructor throws exception during parsing
* define all edge cases and “unhappy” cases. Examples: constructor throws exception (general case), constructor throws exception during parsing


=== <span style="color: #00AA88">Later</span> ===
=== <span style="color: #00AA88">Later</span> ===


* is it possible to rename a component? e.g., to avoid name clashes?
** <span style="color:blue">assumption: no</span>
* is it possible to have a scoped (private) names, e.g., for private components?
* is it possible to have a scoped (private) names, e.g., for private components?
** <span style="color:blue">assumption: no</span>
** <span style="color:blue">assumption: no</span>
* Is it possible to undefine a component? (if yes, how?)
* Is it possible to undefine a component? (if yes, how?)
** <span style="color:blue">assumption: no</span>
** <span style="color:blue">assumption: no</span>


== Registration ==
== Registration ==
Line 148: Line 141:
* how to handle, e.g., appendChild being overwritten on a component?
* how to handle, e.g., appendChild being overwritten on a component?
** <span style="color:blue">assumption: don't care</span>
** <span style="color:blue">assumption: don't care</span>
=== <span style="color: #00AA88">Later</span> ===
* Attribute/property forwarding.




Line 157: Line 154:


* To what degree is isolation/confinement really necessary? (scripts? DOM access? CSS properties?)
* To what degree is isolation/confinement really necessary? (scripts? DOM access? CSS properties?)
* How far is isolation/confinement handling for components similar to &lt;iframe&gt;?
* How far is isolation/confinement handling for components similar to &lt;iframe sandbox&gt;?
* Can we substitute isolation with &lt;iframe&gt;s?
* Can we substitute isolation with &lt;iframe&gt;s?
** <span style="color:blue">assumption: not in a very satisfactory manner</span>
* Are instances of the same component isolated from each other?
* Are instances of the same component isolated from each other?
** <span style="color:blue">assumption: yes, but they should be able to set up shared data structures</span>
** <span style="color:blue">assumption: yes, but they should be able to set up shared data structures</span>
Line 171: Line 169:
* Can isolated components position content outside the host boundary rect? (if not, problems with, e.g., +1 widget)
* Can isolated components position content outside the host boundary rect? (if not, problems with, e.g., +1 widget)
** <span style="color:blue">assumption: yes</span>
** <span style="color:blue">assumption: yes</span>


== Declarative syntax ==
== Declarative syntax ==

Latest revision as of 06:41, 12 October 2011

Overview

This document attempts to exhaustively list issues that we feel are unanswered or ambiguous.

Linked pages:

Issues

  • Now: in the spec draft and/or already in use for internal components
  • Soon: to be included in V1 spec
  • Later: issues to be discussed for later versions of the spec


CSS and Rendering

Soon

  • styling of rendering children of <content> (partially discussed in the CSS brainstorming page).
  • tab-index behavior
  • z-order behavior


Shadow Nodes

Now

  • shadow root being a separate node type vs. an element vs. document fragment vs. ??? (see rendering sub-page)
    • current state: separate node type
  • Can the same host element child be rendered under multiple <content> elements that all select it?
    • assumption: no - the first to select it "gets" it. <content> without select is always last in this regard
  • Is <content> is a bona-fide HTML element (vs. a DOM subtype)?
    • assumption: HTML element

Soon

  • Does ShadowRoot have innerHTML?
    • assumption: yes
  • details of <content> selector syntax
    • suggestion: space-separated list of selector sequences: [tag]?[class]*[id]*[attr]*[pseudo-class]* (NO pseudo-elements)
Dglazkov: will space-separation be confusing? I like the idea, but just thought I should raise this as a concern.
Rolandsteiner: I thought a space-separated list follows HTML conventions more closely, but perhaps to draw an analogue to CSS (and to allow potential later extensions), a comma-separated list may be better (?).


Events

Soon

  • focus event traversing out of shadow?
    • assumption: yes, redirected
    • current state: not implemented

Later

  • instantiation events (which events & when?)
    • for <template> instantiations
    • for component instances
    • on rebinding? (provided CSS 'binding' is possible)
  • event on component registration?


Loading and Life Cycle

Soon

  • loading mechanism (syntax)
Annevk: Have a binding="" attribute on the root element (similar to manifest="")?
  • How to handle definition after use
    • assumption: don't do anything
  • packaging
  • define all edge cases and “unhappy” cases. Examples: constructor throws exception (general case), constructor throws exception during parsing

Later

  • is it possible to rename a component? e.g., to avoid name clashes?
    • assumption: no
  • is it possible to have a scoped (private) names, e.g., for private components?
    • assumption: no
  • Is it possible to undefine a component? (if yes, how?)
    • assumption: no

Registration

Soon

  • how to handle name clashes between components?
    • assumption: teach authors to add unique prefix, e.g., <x-cyberdyne-terminator>
  • details on attaching a shadow tree?
    • <x-mywidget>
      • Pros: flexible, tag is inherently static, most performant
      • Cons: accessibility, fall-back
        • <div becomes=mywidget> even more problematic in these regards and also requires duplication of style rules (?)
    • <button is=mywidget>
      • Pros: accessibility of base element, natural fallback
      • Cons: not a priori obvious that 'is' cannot be rebound, limited to existing element names
    • CSS binding: button { binding: mywidget; }
      • Pros: accessibility and fallback, most flexible
      • Cons: implementation is hard, multiple (perhaps mutually exclusive) bindings may apply, cannot extend the API
    • other?
Dglazkov: Hixie suggested a mix of decorator and element, where the API is bound using magic attribute and shadow tree + events are bound using css binding.
  • fallback mechanisms (implicit with <button is=mywidget>, explicit, e.g., with fallback content as children)
  • Are shadow trees dynamic or static?
    • assumption: static, but see discussion in public-webapps@ ML

Later

  • accessibility (implicit, e.g. with <button is=mywidget>, explicit, e.g., with ARIA roles)


Derivation

Later

  • should we do XBL-like inheritance?
    • assumption: no
  • “aspect-oriented" components (components defining the parts they use, derived components can override or re-use specific parts, part names automatically become pseudos)
  • composition vs. inheritance (i.e., do we need inheritance at all, or can composition handle all use cases?)
    • temporary assumption: composition only

JavaScript

Now

  • Can one subtype anything (text/attribute nodes, events, ...), or just HTMLElement?
    • assumption: just HTML element
  • details of construction

Soon

  • can one write a constructor with <supertype>.call(...), or does one have to use createElement?
  • Isolation/Confinement JS implementation details
  • Forwarding JS implementation details (ex: sub-classing <textarea> (Maciej’s examples), auto-completion, omni-bar like drop-down, toolbar)
  • how to handle Element.register being overwritten?
    • assumption: don't care
  • how to handle, e.g., appendChild being overwritten on a component?
    • assumption: don't care

Later

  • Attribute/property forwarding.


Isolation and Confinement

(see also the isolation brainstorming page)

Soon

  • To what degree is isolation/confinement really necessary? (scripts? DOM access? CSS properties?)
  • How far is isolation/confinement handling for components similar to <iframe sandbox>?
  • Can we substitute isolation with <iframe>s?
    • assumption: not in a very satisfactory manner
  • Are instances of the same component isolated from each other?
    • assumption: yes, but they should be able to set up shared data structures
  • Are instances of the components from the same domain isolated from each other?
    • assumption: yes, but they should be able to set up shared data structures
  • Can instances of the same component share data somehow?
    • assumption: yes (how?)
  • Can instances of the same component and its derivatives share data somehow?
    • assumption: yes (how?)
  • Can instances of the components from the same domain share data somehow?
    • assumption: yes (how?)
  • Can isolated components position content outside the host boundary rect? (if not, problems with, e.g., +1 widget)
    • assumption: yes

Declarative syntax

Soon

  • how/when to run scripts?
  • syntax to style the host (provided we select a model where it is rendered)?
  • <template> details:
    • usable without components?
    • instantiable without explicit components (e.g., <instance select=”x-cyberdyne-terminator”>)
    • event handler registration syntax
  • <element> details
  • Do we need <binding> as well?
  • How to define the API of components

Later

  • <template>: introduce template types (e.g., <template type=”django”>)?
    • assumption: no


Misc.

Now

  • How can we split the spec into (more) different parts?

Later

  • Do we define the shadow DOM (or parts thereof) of built-in elements?
    • assumption: no