W3C home > Mailing lists > Public > www-style@w3.org > June 2012

Re: [css3-regions][cssom] Bubbling for the regionLayoutUpdate event

From: Alan Stearns <stearns@adobe.com>
Date: Mon, 11 Jun 2012 10:42:37 -0700
To: "www-style@w3.org" <www-style@w3.org>
CC: Andrei Bucur <abucur@adobe.com>
Message-ID: <CBFB7A5E.1168D%stearns@adobe.com>
On 6/11/12 6:05 AM, "Andrei Bucur" <abucur@adobe.com> wrote:

>
>On 6/9/12 6:21 PM, "Alan Stearns" <stearns@adobe.com> wrote:
>
>>On 6/8/12 4:51 AM, "Andrei Bucur" <abucur@adobe.com> wrote:
>>
>>>Hello!
>>>
>>>The Regions spec states that the regionLayoutUpdate event should be
>>>bubbling. When this event was dispatched on the region this was very
>>>easy
>>>to understand as they were DOM elements. Now, the NamedFlow object is
>>>the
>>>target, which is not clearly positioned
>>> in  the DOM hierarchy. How is the bubbling supposed to behave for this
>>>event? Should it be possible to listen for the event on the parent
>>>document and determine the NamedFlow from the event target?
>>>
>>>Thanks!
>>>Andrei.
>>
>>Since you can determine the NamedFlow from the event target, it could be
>>useful in the case of multiple named flows to have a single listener on
>>the document. Would it be sufficient to add a line to the description of
>>this event saying that it bubbles up to the document?
>>
>>Thanks,
>>
>>Alan
>>
>
>
>I don't think it is that easy :). The bubbling phase is described in
>http://www.w3.org/TR/DOM-Level-3-Events/#bubble-phase :
>
>"The bubble phase: the event object propagates through the target's
>ancestors in reverse order, starting with the target's parent and ending
>with the defaultView. This phase is also known as the bubbling phase.
>Event listeners registered for this phase must handle the event after it
>has reached its target."
>
>
>The Regions spec doesn't explicitly defines a "parent" or the position in
>the DOM hierarchy for the NamedFlow objects. I suppose there should be a
>special chapter about this so there won't be any confusions when
>implementing.
>
>Thoughts?
>Andrei.
>

My thoughts are that we could do one of the following:

1. Leave things as-is, and you have to attach the listener to the NamedFlow
   (less than optimal, but perhaps sufficient for level 3?)
2. Define bubbling behavior to allow you to catch the event on the document
   (not sure this is worth it just for this event)
3. Move the event to the Document object and add the flow name to the
event data
   (I'm leaning towards this option)

Alex, Vincent, Dave - we decided to target the NamedFlow when we met to go
over a raft of CSSOM issues in Regions. I see the decision recorded in the
bug, but I do not recall why we chose NamedFlow over Document as the
target. Do you agree that option 3 is the best choice, or have other
options to consider?

Thanks,

Alan
Received on Monday, 11 June 2012 17:43:06 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:55 GMT