Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-masking] Specify how 'clip-path' should serialize for getComputedStyle #3

Closed
jwatt opened this issue Apr 21, 2016 · 7 comments
Closed

Comments

@jwatt
Copy link

jwatt commented Apr 21, 2016

https://drafts.csswg.org/css-shapes-1/#basic-shape-serialization

specifies how basic shapes should be serialized. However, a clip-path value can also contain a <geometry-box> and nothing seems to specify how clip-path as a whole serializes.

Since the text for basic shape serialization says something like "if part of the value is a default value and omitting it won't affect the result, omit it", it would seem on the surface to make sense to do that for clip-path as a whole too. That would seem to imply that if a shape and the default value for <geometry-box> of border-box is specified, the serialization would just be the shape. If however just a <geometry-box> is specified its value would need to be serialized regardless of whether it is the default or not.

That said, Mozilla's implementation would not make it very easy to skip serialization of the <geometry-box> since, at the point in the code where we serialize the enum, we don't have any information about whether the enum value is paired with a shape. @dbaron

@dirkschulze
Copy link
Contributor

@jwatt So if I get your request right, serialization should always include the geometry box even though it was either not specified or falls back to a different default?

@jwatt
Copy link
Author

jwatt commented Apr 24, 2016

My request is simply "please define the behavior". :)

I was additionally noting that the behavior that would seem to be the desirable behavior is problematic for Mozilla, since our code isn't set up to have one part of value (the geometry box in this case) be present in the serialization depending on whether another part (the shape in this case) was specified or not.

@dbaron
Copy link
Member

dbaron commented Apr 25, 2016

How is that problematic? It seems like that's a pattern we have a lot.

@jwatt
Copy link
Author

jwatt commented Apr 25, 2016

@dbaron Let's take the Mozilla implementation details to https://bugzilla.mozilla.org/show_bug.cgi?id=1266316

@dirkschulze
Copy link
Contributor

dirkschulze commented Apr 26, 2016

@jwatt As far as I understood it is necessary to specify serialization of individual constructs like <basic-shapes> introduced by a spec. The rest should simply follow CSS OM / CSS OM View.

Beside that there is the computed value specified for each property. CSS Shapes' shape-outside uses a similar syntax as clip-path. It makes sense to align both.

The syntax in question for clip-path is <basic-shape> || <geometry-box>. So one value must be specified anyway. If <geometry-box> was specified it must be serialized. With the changes from shape-outside it seems like it should address this issue. Would you agree?

@astleychen
Copy link

astleychen commented Dec 20, 2016

@jwatt per the last feedback from @dirkschulze , I think it's sufficient to know how serialization should be done in combination with <geometry-box>. Do you have any concerns or thoughts as to the feedback ?

[ Edited by @dbaron to escape markup that was being hidden. ]

@dirkschulze
Copy link
Contributor

Closing this issue since there hasn't been any activity and response. Please reopen if this is not resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants