[Bug 16176] [Shadow]: What should we do if an event happens on light child which is distributed to a insertion point.

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

--- Comment #9 from Hayato Ito <hayato@chromium.org> 2012-04-09 08:07:12 UTC ---
Let me continue thinking and propose a new idea.
I prefer the latter to the former since that won't break compatibility. Let me
quote that again here.

> - #D (target = #D, relatedTarget = #F)
> - #C (target = #D, relatedTarget = #F)
> - #J (target = #J, relatedTarget = #L)
> - ... (#G should be skipped...)
> - #B (target = #D, relatedTarget = #F)
> - #A (target = #D, relatedTarget = #F)


To achieve that,  section 6 should be modified as follows:

- Remove IGNORE_UPPER_BOUNDARY flag from the Section 6.
  That means we use the same algorithm to calculate ancestors both for a target
and a relatedTarget.

- Define a scope of a node as follows:
  A nearest ancestor youngestShadowRoot (or Document). Ancestors should be
calculated by algorithm described in Section6, but not using <content> element
as insertionPoint. Use only <shadow> element as insertion points.

- Modify 6.5:
  - If the scope of currentTarget are same to the scope of TARGET (the original
target DOM node of the event):
    An event should be dispatched on the currentTarget node even if the
currentTarget is an ancestor of LIMIT.
    And, use TARGET as target, instead of using adjusted target.
  - If the scope of currentTarget are same to the scope of RELATED (the
original related target DOM node of the event), use RELATED as relatedTarget,
instead of using adjusted relatedTarget.

This rule can achieve the result:
 - At #D, its scope is same to the scope of TARGET(#D) and the scope of
RELATED(#F). Use (target='#D', relatedTarget='#F')
 - At #C, its scope is same to the scope of TARGET(#D) and the scope of
RELATED(#F). Use (target='#D', relatedTarget='#F')
 - At #J, its scope is different from the scope of #D and the scope of #F.
Therefore use adjusted results (target = #J, relatedTarget = #L)
 - At #G, an event should not be dispatched since it's ancestor of LIMIT.
 - At #B, its scope is same to the scope of #D and the scope of #F, so an event
should be dispatched on #B even if it is an ancestor of LIMIT. Use
(target='#D', relatedTarget='#F')
 - At #A, its scope is same to the scope of #D and the scope of #F, so an event
should be dispatched on #A even if it is an ancestor of LIMIT. Use
(target='#D', relatedTarget='#F')

That preserves compatibility. At #D, #C, #B, and #A, nothing has changed
before/after shadow DOM spec.
That only explains a basic idea. Is there any flaws?

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Monday, 9 April 2012 08:07:15 UTC