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
[motion] Inconsistency in offset-path contain #22
Comments
Sorry for the late reply. The description of 'contain' is bit wrong. The intent of the contain is guaranteeing the entire element stays inside the path, not the containing block. The < size > was added to 'offset-path' with < angle >, and it decides the end point of the path.
I couldn't get your intention for the vertical positioning. |
y-coordinate of the placed item. If we have an example with the following: When we change this to If the horizontal position changes from 230px to 200px, and the vertical position remains unchanged, the element would be placed at 200px 25px. If the horizontal position changes from 230px to 200px, but the element must remain on the path, the element would be placed at 200px 42px. If we say that the "entire element stays inside the path, not the containing block" and that the element must remain on the path, then any offset-distance exceeding 100% is equivalent to offset-distance: 100%, and the element would be placed at 187px 50px Assume 187px 50px is required. Now suppose we change the size: If the element must be contained within the fully containing block, and the anchor must remain on the path, the element moves to 180px 54px. If the "entire element stays inside the path", and the anchor must remain on the path, the element moves to 163px 64px. The top right corner of the element becomes 183px 44px, which is 100px from offset-position. I suspect this is the placement we require. I've implemented code that achieves this, and can
|
I think this case, the result would be: @ericwilligers Do you have another opinion? |
'smallest clipped area' gave no guidance when the path and the box had zero area in common regarless of the value of offset-distance. For example, this can occur when the path size is 0, or when offset-anchor is substantially outside the box. We now define the meaning of 'contain' by specifying that the path size is minimally increased so that the box can be contained. resolves w3c#22
Suppose the path size is 0px and/or offset-anchor is very large in magnitude. In such cases, the clipped area can be always 100% regardless of offset-distance. Minimally increasing the path size is a good solution. |
https://drafts.fxtf.org/motion-1/#offset-path-property
"The path ends at the edge of the containing block."
Note that this implies that, when no size is specified in offset-distance, the path length is not constant as the angle changes, and we only have a polar coordinate system if offset-distance is a length, not a percentage.
The text for 'contain' is not consistent with Example 2.
"When the value of offset-distance would select a point on the path which is outside the edge of the containing element, the value is instead clipped so that the selected point lies on the edge of the element."
"offset-path: 45deg; offset-distance: 100%" gives the point at the top right corner of the containing element.
Figure 2 displays the top-right element incorrectly.
"offset-path: 180deg; offset-distance: 100%" gives a point on the bottom edge of the containing element.
Figure 2 correctly displays the bottom element.
In each case, 'contain' would not cause any change. Figure 3 displays both elements incorrectly.
It is possible the intent for 'contain' is that the entire element stays inside the containing block. If so, we need to specify what happens when the element is larger than the container.
Perhaps have an example with
"offset-path: 60deg contain; offset-distance: 150%"
Then clamping causes the selected point to lie on the right edge of the element.
It would be helpful to describe what happens to the vertical positioning of this element.
Does the element continue to lie on the path, making this equivalent to "offset-path: 60deg; offset-distance: 100%" ?
Or is the vertical positioning the same as it would have been without contain?
(I suspect the former is intended but the wording allows either.)
(In all the above, I assume a square containing element.)
The text was updated successfully, but these errors were encountered: