Re: [css-regions] Region.flowFrom throwing exception

On 7/23/12 9:18 AM, "Andrei Bucur" <abucur@adobe.com> wrote:

>Hello Alan!
>
>
>The CSS Regions spec mentions that an exception is thrown when accessing
>the properties of a Region that's no longer one (
>http://dev.w3.org/csswg/css3-regions/#the-region-interface ).
> However the flowFrom property looks to be more special to me because
>with it throwing an exception it is difficult (getComputedStyle?) to
>determine if an Element is region or not.
>If flowFrom throws exceptions developers would often need to use
>try/catch blocks which I don't think is recommended for an API
>(exceptions hellŠ). However, it would be much more nice to be able to
>wrap flowFrom in an IF statement and then use the Region
> API without worrying about the object not being a region.
>
>
>Thoughts?
>Andrei

Andrei,

Since this information is already available through getComputedStyle,
perhaps we do not actually need Region.flowFrom? Are there use cases for
Region.flowFrom that are not served by getting the computed value of
flow-from?

I see three possibilities:

1. Remove Region.flowFrom in favor of accessing the flow-from property
using getComputedStyle

This seems to be the best course of action to me, as we should only be
adding to the OM when necessary.

2. Retain Region.flowFrom with the current throwing behavior

You can still use getComputedStyle if you want the simple branching, and
you get consistent errors thrown on all Region interface members if you
call them on a non-Region.

3. Change Region.flowFrom to always return the computed value of the
flow-into property

This seems like duplication to me.

Thanks,

Alan

Received on Tuesday, 31 July 2012 18:58:08 UTC