-
Notifications
You must be signed in to change notification settings - Fork 52
[motion-1] offset-position + circle() #504
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
Comments
Since the spec doesn't say this behavior only applies to non-auto 'offset-position', this also means that the circle()/ellipse() defaults to being centered on the top-left corner of the element's laid-out position, which similarly doesn't seem very useful. |
A different take with larger potential compat issues - what if we defined that ray() takes an optional initial position, similar to the circle() function, and just dropped offset-position entirely? I think offset-position is, in general, just a relic of the old "based on abspos" spec. It gets completely ignored by most of the basic shapes (and is only hacked into working with circle()/ellipse()). Do we have any data on usage of the property? If it is usually set to 'center' when paired with ray(), we might be able to just default the ray() position to center, like Shapes does for circle()/ellipse(). |
Okay, looking into this more, the "offset-position affects circle()/ellipse()" behavior was committed in a1faed1, claiming to fix #78. However, #78 ended without any resolutions, and just some topics we needed to address:
Done now, via shape().
Done now, via xywh().
After rereading the issue a few times, still not sure what this is referring to.
I think this was about the "path relative to element's current position" thing. So I think the edits ended up doing the one thing we agreed to punt on (making offset-position interact with basic shapes) and failed to add the one thing we seemed to agree needed doing (allowing path() to be specified relative to the element's current position). If we added the ability for path() to respond to offset-position, we have an issue - ray() pays attention to offset-position by default, but path doesn't pay attention by default. We need to resolve this somehow. My proposal, then:
Hopefully this minimizes the chance of breakage, since rays will default to coming from the center if the author didn't touch offset-position, identical to what is probably the common case today where the element is abspos'd with This requires an edit to Shapes 1 as well, so /cc @astearns . |
The CSS Working Group just discussed
The full IRC log of that discussion |
… override the normal position defaulting, and add an 'at' to ray(). #504
In the definition of
for 'offset-path', there's a paragraph that states:This contradicts Shapes 1, which simply defaults an omitted center-position to "center" without making it configurable.
Worse, this means that 'offset-position' now does two completely unrelated things - for ray(), it sets where the ray emerges from (aka where
offset-distance: 0%
places you), but for circle() and ellipse() it (sometimes!) sets the center of the ellipse, which is not a point on the path at all.I don't understand why this is necessary; you can just set the center position directly in the function if you need to, and if you omit it I think it's confusing for it not to act like an omitted position in other contexts. To get the default behavior that Shapes defines I have to explicitly say
circle(... at center)
.Can we just drop this odd behavior and have circle()/ellipse() default their center position as normal?
The text was updated successfully, but these errors were encountered: