-
Notifications
You must be signed in to change notification settings - Fork 51
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] Define "raw geometry" for <clipPath>
clipping
#170
Comments
My interpretation and some basic browser testing leans toward defining this as if the following properties were always set: clipPath * {
fill: #000;
fill-opacity: 1;
stroke: none;
} But maybe that's begging the question in some way. |
@tigt That's one way of thinking about it. But the list of |
That's indeed one way to frame it - and this pretty much how Blink (and IIRC, WebKit) handles this in the general case (modulo other details, as @AmeliaBR mentions.) It really boils down to engine architecture and requirements on that based on the rendering architecture/pipeline. (In Presto we handled this in a similar, but not exactly the same way, for instance.) |
There are roughly 3 not further specified categories of properties that are interesting for us. Properties
The spec says:
Ideally we could reuse one of the Media Groups of CSS 2.1 to specify a set of allowed properties. Sadly, many properties like We could add a list of CSS properties that are affecting the geometry into CSS Masking. I wonder if we can add another, more specific Media Group for geometry properties instead. All specs that define geometry affecting properties would need to get updated. But otherwise the Masking spec might get outdated quickly when new properties arrive. Also, at least at the moment, just properties that affect the visuals of SVG elements are of interest. CC @fantasai @tabatkins |
For now we need to investigate which properties are affecting clipping paths across implementations. |
Thinking about it more, I think it is a mistake to talk about 1-bit masks in the normative code in general. This is a mistake inherited from SVG. At the end the main differences between masking and clipping is that the former fundamentally is a pixel based operation. The latter is defining an area. I'd still like to keep this text in as informative note. To the normative part:
IIRC (and I'll check) we should have normative text for @AmeliaBR I agree that ideally CSS would define a group of properties and settings that contribute to the clipping region (geometry of the shape). But with the absence of such a definition I think that is the best we can do for level 1. I am not sure if the term "geometry" needs a definition in any W3C spec. CSS and SVG depend on the knowledge of common terms like that. |
Continuing to leave it unspecified would not make the situation any worse. I think we have interop about what properties are used, but we don't have comprehensive tests, so I don't know. I think the text should also specifically call out SVG geometry properties and attributes, and maybe have a prose description for "any properties or attributes that determine glyph selection and position" in text elements. |
The CSS Masking module description of
<clipPath>
states (copying SVG 1.1 ):"Raw geometry" isn't a defined term anywhere. And some style properties do affect the clipping result. In addition to the
clip-path
,display
, andvisibility
properties that are currently called out in the spec, all text layout & font-selections properties would affect<text>
elements inside the clipping path, and all the SVG 2 geometric properties (attributes in SVG 1) andtransform
. Possibly others I haven't thought of yet.PS, See also #17, about expanding the content model for
<clipPath>
.The text was updated successfully, but these errors were encountered: