-
Notifications
You must be signed in to change notification settings - Fork 711
[css-overflow-3] computed value rules for 'overflow' should not depend on whether something is a replaced element #7435
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
This behaviour for replaced elements is a recent addition to the spec. See discussion here. Since replaced elements need to be clipped by default, we also have UA CSS which depends on the element type to apply the default behaviour (see change here).
That's interesting. What are the cases where |
Items one and three in this example. Note that distinguishing items two and three at value computation time is particularly hard, but I think in general it may be difficult to distinguish replaced elements during value computation, just because that's not the sort of information that's expected to be needed during selector matching and value computation. |
|
Had a discussion with @dbaron today. The current implementation for how overflow is applied to replaced elements is dependent on the element's tag (for example img and object in this case). This is required for any values being supplied by UA CSS and wasn't the part dbaron was concerned about. @Loirooriol please clarify if you disagree. The concern was with modifying the style at value computation to apply the overrides in the spec. Implementation wise they follow the same pattern as UA CSS and depend on the element's tag. But this runs into the case where the same tag might not be rendered as a replaced element (like when img falls back to alt test). Given that we need to rely on the element tag to identify a replaced element in UA CSS, it seems reasonable to rely on the element's tag (which is known at value computation time) when applying overrides to its computed value as well. I see some precedent for this in code but I could only trace back to the spec here. @tabatkins for an opinion too. |
@khushalsagar |
Ok. I see the point now. We can avoid regressing the behaviour for img elements by applying the rule for replaced elements at used value time as David suggested. So only when the element is rendered as a replaced element it won't create a scroll container (consistent with the behaviour today). But |
Yeah, it's been years since it's come up, but I remember now that we can't have computed values depending on replaced-ness, due to image fallback and related stuff - we didn't want to have to wait for network responses before we were able to inherit values. Unfortunate in general, but in this case indeed not a real problem - having the overflow adjust at used-value time works just fine since this isn't an inherited property and it would be very weird to explicitly use |
Replaced elements support only 2 configs for overflow: visible and clip. Currently we apply this override at style resolution based on the element tag to identify replaced elements. This misses cases where a an element (like img) could be rendered as a non-replaced element if fallback to alt text is used. Avoid this by applying this override when using the value in layout/paint when its known whether the element will render as a replaced element. See discussion at: w3c/csswg-drafts#7435. Bug:1321217 Change-Id: Iadf653ea4a531a1ab313e2e797988d082d5ef1c1
Replaced elements support only 2 configs for overflow: visible and clip. Currently we apply this override at style resolution based on the element tag to identify replaced elements. This misses cases where a an element (like img) could be rendered as a non-replaced element if fallback to alt text is used. Avoid this by applying this override when using the value in layout/paint when its known whether the element will render as a replaced element. See discussion at: w3c/csswg-drafts#7435. Bug:1321217 Change-Id: Iadf653ea4a531a1ab313e2e797988d082d5ef1c1
The spec has been updated and the implementation change is landing in chromium soon. Could we close this issue now? |
Replaced elements support only 2 configs for overflow: visible and clip. Currently we apply this override at style resolution based on the element tag to identify replaced elements. This misses cases where a an element (like img) could be rendered as a non-replaced element if fallback to alt text is used. Avoid this by applying this override when using the value in layout/paint when its known whether the element will render as a replaced element. See discussion at: w3c/csswg-drafts#7435. Bug:1321217 Change-Id: Iadf653ea4a531a1ab313e2e797988d082d5ef1c1
Replaced elements support only 2 configs for overflow: visible and clip. Currently we apply this override at style resolution based on the element tag to identify replaced elements. This misses cases where a an element (like img) could be rendered as a non-replaced element if fallback to alt text is used. Avoid this by applying the override when using the value in layout/paint when it's known whether the element will render as a replaced element. See discussion at: w3c/csswg-drafts#7435. Bug:1321217 Change-Id: Iadf653ea4a531a1ab313e2e797988d082d5ef1c1
Agreed that this can be closed since it was fixed in efa3228. |
Replaced elements support only 2 configs for overflow: visible and clip. Currently we apply this override at style resolution based on the element tag to identify replaced elements. This misses cases where a an element (like img) could be rendered as a non-replaced element if fallback to alt text is used. Avoid this by applying the override when using the value in layout/paint when it's known whether the element will render as a replaced element. See discussion at: w3c/csswg-drafts#7435. Bug:1321217 Change-Id: Iadf653ea4a531a1ab313e2e797988d082d5ef1c1
Replaced elements support only 2 configs for overflow: visible and clip. Currently we apply this override at style resolution based on the element tag to identify replaced elements. This misses cases where a an element (like img) could be rendered as a non-replaced element if fallback to alt text is used. Avoid this by applying the override when using the value in layout/paint when it's known whether the element will render as a replaced element. See discussion at: w3c/csswg-drafts#7435. Bug: 1321217 Change-Id: Iadf653ea4a531a1ab313e2e797988d082d5ef1c1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3750018 Auto-Submit: Khushal Sagar <[email protected]> Reviewed-by: Chris Harrelson <[email protected]> Commit-Queue: Khushal Sagar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1022859}
Replaced elements support only 2 configs for overflow: visible and clip. Currently we apply this override at style resolution based on the element tag to identify replaced elements. This misses cases where a an element (like img) could be rendered as a non-replaced element if fallback to alt text is used. Avoid this by applying the override when using the value in layout/paint when it's known whether the element will render as a replaced element. See discussion at: w3c/csswg-drafts#7435. Bug: 1321217 Change-Id: Iadf653ea4a531a1ab313e2e797988d082d5ef1c1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3750018 Auto-Submit: Khushal Sagar <[email protected]> Reviewed-by: Chris Harrelson <[email protected]> Commit-Queue: Khushal Sagar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1022859}
Replaced elements support only 2 configs for overflow: visible and clip. Currently we apply this override at style resolution based on the element tag to identify replaced elements. This misses cases where a an element (like img) could be rendered as a non-replaced element if fallback to alt text is used. Avoid this by applying the override when using the value in layout/paint when it's known whether the element will render as a replaced element. See discussion at: w3c/csswg-drafts#7435. Bug: 1321217 Change-Id: Iadf653ea4a531a1ab313e2e797988d082d5ef1c1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3750018 Auto-Submit: Khushal Sagar <[email protected]> Reviewed-by: Chris Harrelson <[email protected]> Commit-Queue: Khushal Sagar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1022859}
…laced elements to used value., a=testonly Automatic update from web-platform-tests blink: Switch overflow overrides for replaced elements to used value. Replaced elements support only 2 configs for overflow: visible and clip. Currently we apply this override at style resolution based on the element tag to identify replaced elements. This misses cases where a an element (like img) could be rendered as a non-replaced element if fallback to alt text is used. Avoid this by applying the override when using the value in layout/paint when it's known whether the element will render as a replaced element. See discussion at: w3c/csswg-drafts#7435. Bug: 1321217 Change-Id: Iadf653ea4a531a1ab313e2e797988d082d5ef1c1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3750018 Auto-Submit: Khushal Sagar <[email protected]> Reviewed-by: Chris Harrelson <[email protected]> Commit-Queue: Khushal Sagar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1022859} -- wpt-commits: e8138dce388f65c12feff54c07d07e5755962799 wpt-pr: 34743
…laced elements to used value., a=testonly Automatic update from web-platform-tests blink: Switch overflow overrides for replaced elements to used value. Replaced elements support only 2 configs for overflow: visible and clip. Currently we apply this override at style resolution based on the element tag to identify replaced elements. This misses cases where a an element (like img) could be rendered as a non-replaced element if fallback to alt text is used. Avoid this by applying the override when using the value in layout/paint when it's known whether the element will render as a replaced element. See discussion at: w3c/csswg-drafts#7435. Bug: 1321217 Change-Id: Iadf653ea4a531a1ab313e2e797988d082d5ef1c1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3750018 Auto-Submit: Khushal Sagar <[email protected]> Reviewed-by: Chris Harrelson <[email protected]> Commit-Queue: Khushal Sagar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1022859} -- wpt-commits: e8138dce388f65c12feff54c07d07e5755962799 wpt-pr: 34743
css-overflow-3 states rules for determining the computed value of the
overflow
property that depend on whether something is a replaced element:I didn't think computed values could depend on whether something is a replaced element; I don't think that's known at value computation time (e.g., for
<object>
).If that's the case, I'd suggest that the non-replaced rule above apply to all elements, and then the replaced rule be handled at used value time. (This is a behavior change in the behavior of combinations of
visible
on one axis with a value other thanvisible
orclip
on the other axis. However, I suspect that behavior matches implementations today (at least Gecko's), in so far as the difference in behavior on replaced elements is observable.)(Noticed while trying to write edits for #6212.)
The text was updated successfully, but these errors were encountered: