Re: [css-masking] Layered Mask Images

Hi fantasai,

On Apr 2, 2013, at 6:53 PM, fantasai <fantasai.lists@inkedblade.net> wrote:

> https://dvcs.w3.org/hg/FXTF/raw-file/tip/masking/index.html#the-mask-image
> 
> Issue 1
> 
>  #  ‘<url>’
>  #    A URL reference to a ‘mask’ element (for example ‘url(commonmasks.svg#mask)’)
>  #    or an <image>.
> 
> Did you mean to include "A URL reference to an <image>" in this
> definition? If not, delete "or an <image>"; <url> is included in
> the definition of <image>.

I removed the redundant definition.

> 
> Issue 2
> 
>  # ‘child’
>  #    A keyword to indicate that the last direct sibling ‘mask’
>  #    element of the element the ‘mask-image’ property is applied
>  #    should be used as the mask source. It is equivalent to
>  #    ‘select(mask:last-of-type)’.
> 
> Probably meant s/direct sibling/direct child/.

That is correct. I changed the term to child.

> 
> A question: is that mask element namespaced to SVG, or will it
> select any <mask> element?

That is a very good question. It may not matter. While the actual reference must be a <mask> element of the SVG namespace, a selection of a mask element in another namespace (e.g. HTMLUnknownElement) would not be a valid element and masking would not proceed. However, a mixture of the same element in different namespaces would make a difference. I wonder if it is possible to specify to filter the list after the selection. This way the author does not need to specify the svg: namespace on the search.

> 
> Issue 3
> 
>  # ‘<compound-selector>’
>  #    A compound selector as defined in [SELECTORS4].
> 
> This should not be in the <dl>; it implies that this construct
> is a valid value for 'mask'. Just put it as normative text
> somewhere, e.g. right after the syntax expansion
> 
>   |  <child-selector> = select(<compound-selector>#)
>   |
>   |  where <compound-selector> is a <i>compound selector</i> a
>   |  defined in [SELECTORS4]
> 
> or inside the definition of <child-selector>.

I put it inside the definition of child-selector. It seemed to be cleaner.

> 
> Issue 4
> 
>   # An invalid or non-existent mask source is ignored and no masking
>   # is applied.
> 
> I'd assume by this you don't mean an invalid value for the 'mask-image'
> property (which should make the declaration invalid instead), but
> rather a mask that failed to be retrieved/decoded. But you already
> cover that in the next paragraph. So what did you mean here?

The mask source is a reference to an SVG <mask> element which is different to mask image. I rephrased and extended the sentence to make it more clear. It should fix issue 6 as well now:

""
If the URI reference of a mask source is not valid (e.g it points to an object that doesn't exist or the object is not a ‘mask’ element), no masking is applied.
""

I did equivalent changes to clip-path.

> 
> Issue 5
> 
>   # ‘<child-selector>’
>   #    A comma-separated list of compound selectors scoped at the
>   #    element to which the ‘mask-image’ property is applied. The
>   #    first matching element in tree order (as defined in [DOM])
>   #    as a result of evaluating the list of selectors is taken as
>   #    the mask source. If there are no matching elements the mask
>   #    source is invalid.
> 
> Since 'child' is equivalent to 'select(mask:last-of-type)' and both
> are defined to only select among the element's children, I think
> this definition is incorrect. Unless you want to select among all
> descendants (in which case, the 'child' definition needs to be
> updated accordingly), I think you want
> 
>   | A functional notation [CSS3-VALUES] accepting a comma-separated
>   | list of compound selectors that represents first matching child
>   | element in tree order (as defined in [DOM]).

I chose to take the suggested specification text. It seemed to be more focused and cleaner.

> 
> Issue 6
> 
> What happens if the identified element is not a <mask> element, but,
> say, an <li>?

This is a valid objection. See issue 4.

> 
> Issue 7
> 
> Lastly, I think select() should be renamed to child(), if it is scoped
> to only match against the children. Most other syntax that takes a
> scoped selector scopes it to the entire subtree; since this does not
> do that, it should be clear from its name. Using child() makes it
> consistent with the 'child' keyword, which behaves the same, other
> than implying a particular selector as a "default argument".

IIRC this was the main argument against naming the function 'child()' - the equal naming to child. I do not have strong feelings for one or the other.

Greetings,
Dirk

> 
> ~fantasai
> 

Received on Wednesday, 3 April 2013 06:51:27 UTC