[Bug 22344] [Shadow]: projecting into <shadow>

https://www.w3.org/Bugs/Public/show_bug.cgi?id=22344

--- Comment #10 from Hayato Ito <hayato@chromium.org> ---
I've read carefully the proposal.

Looks okay to me. That gives us a more fine controlled way to call
*superclass*'s constructor.

For the reference, let me quote the example I've once used to understand this
kind of proposal using an Object Oriented analogy.

So far, in the example, the parameters of super(..) are implicit and cannot
control.

With the new proposal, we can explicitly specifiy the parameter of super(..)
using a notation of '<shadow>parameters</shadow>'.


I've not assessed the feasibility of implementation yet.


---- From Here ----
Custome element: g-flowpanel
  Example markup:
    <g-flowpanel>
      <g-panel/>
      <g-panel/>
    </g-flowpanel>

Custome element: my-flowpanel extends g-flopanel.
  Example markup:
    <my-flowpanel>
      <g-panel/>
      <g-panel/>
      <h3>hello</h3>
    </my-flowpanel>

That might be implemented using the following DOM tree:

  DOM Tree:
  - Shadow Host
    - g-panel
    - g-panel
    - <h3> hello </h3>

  - The older Shadow Root (g-flowpanel)
    - div
      - <content select='gpanel (or something related to gpanel)'>

  - The yonger Shadow Root (my-flowpanel)
      - <content select='h3:first-of-typel'>
      - <shadow>


The following Markup

  <my-flowpanel>
    <g-panel/>
    <g-panel/>
    <h3>hello</h3>
  </my-flowpanel>

corresponds to a constructor's invocation like:

  MyFlowpanel myFlowPanel = new MyFlowPanel(g1, g2, h3);

MyFlowpanel's implementation,

  - The younger Shadow Root (my-flowpanel)
    - <content select='h3:first-of-type'>
    - <shadow>

corresponds to:

  class MyFlowpanel extends GFlowpanel {
    MyFlowPanel(g1, g2, h3) {
      this.h3 = h3
      super(g1, g2);
    }

GFlowpanel's implementation,

  - The older Shadow Root (g-flowpanel)
    - div
      - <content select='gpanel (or something related to gpanel)'>

corresponds to:

  class GFlowpanel extends ??? {
    GFlowPanel(g1, g2) {
      this.g1 = g1;
      this.g2 = g2;
    }


Good analogy are:
  - A <content> element consumes parameters of constructor of parameters like:
    this.x1 = x1
  - A <shadow> element is like calling super class's constructor, like
    'super(...)'. But parameters passed to the super(..) are automatically
    filled. In this case, unselected host's children are passed to the
    super(...).

---- End Here ----

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Tuesday, 18 June 2013 06:33:36 UTC