-
Notifications
You must be signed in to change notification settings - Fork 661
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-overflow-4] Line-clamp and IFC #10323
Comments
To expand on the difficulties found when trying not to establish an IFC:
|
The CSS Working Group just discussed
The full IRC log of that discussion<fantasai> florian: This and the next issue are similar context<fantasai> florian: for line-clamp we currently have a spec that uses something called 'continue: discard' which invokes fragmentation <fantasai> florian: some discussion about an alternative approach that relies on visibility-hidden type thing instead <fantasai> florian: awhile back we resolved to spec both and figure it out <fantasai> florian: So Andreu has been prototyping both <fantasai> florian: and we are developing spec for both <fantasai> florian: We're looking at cases where the effects are accidentally differnet rather than intentionally <fantasai> florian: Trying to harmonize them where possible <fantasai> florian: this is one o them. <fantasai> florian: When we initially drafted line-clamp using continue: discard <fantasai> florian: we decided it shouldn't automatically become an independent formatting context <fantasai> florian: it seemed possible to do so; and authors could always opt in using e.g. `display: flow-root` <fantasai> florian: Driven by making it more nice, not by specific use cases <fantasai> florian: Andreu found it was significantly simpler to implement if it was an independent formatting context <fantasai> florian: so proposal is to do that instead <fantasai> andreubotella: -webkit-line-clamp creates an independent formatting context due to creating a flexbox <fantasai> andreubotella: For continue:discard there's also an aspect of complexity <fantasai> andreubotella: it is assumed that every fragmentation container is an IFC <fantasai> andreubotella: not clear what happens to floats if you have them break in the middle of a fragmentation container that isn't an IFC <fantasai> andreubotella: Perhaps fragmentation spec that maybe all fragmentation containers should be IFC <florian> s/making it more nice/making it more generic <fantasai> andreubotella: When implementing it, it was clear that assuming IFC was so much easier that I didn't even attempt to not <fantasai> andreubotella: For continue:collapse the considerations are different <fantasai> andreubotella: I visualized that everything after clamp point should work like there's no content in the tree beyond the clamp point <fantasai> andreubotella: That means clamped floats should not affect the outside <fantasai> andreubotella: but what happens within the clamped function? should those floats affect each other? <fantasai> andreubotella: in the end it was a lot easier to just not have that interaction with the outside of the line-clamp container by making it an IFC also <emilio> q+ <fantasai> andreubotella: It could still be possible to implement, but would be significantly more complex to implement <fantasai> andreubotella: and as Florian said, there's no significant use case for not making IFC <astearns> ack emilio <fantasai> iank_: It'll also be a lot easier for developers to transition to the new line-clamp because existing prefixed version establishes IFC <fantasai> emilio: Agree <astearns> ack dbaron <fantasai> dbaron: The argument that you made at the end, that we don't want floats clipped by line-clamp to influence floats outside, seems like a good theoretical argument for why this is a sensible behavior that fits with everything else <fantasai> dbaron: so I'm also in favor <fantasai> astearns: Proposed resolution that line-clamp establishes an independent formatting context <fantasai> emilio: When applied to blocks it creates an IFC <dbaron> a BFC <dbaron> (block formatting context) <fantasai> RESOLVED: line-clamp establishes an independent formatting context <dbaron> (I had just asked about whether we were talking about a block formatting context.) |
As was recently resolved in w3c/csswg-drafts#10323 and w3c/csswg-drafts#10324, `(-webkit-)line-clamp` should always create an independent formatting context whenever it applies. Furthermore, the `display: -webkit-box` property will not cause the box to become a flexbox, but it will be an independent block formatting context instead (even for `line-clamp`, which doesn't require `display: -webkit-box` to apply). This patch adds some tests for it, and makes some other tests no longer tentative.
Done in dcc75ed |
As was recently resolved in w3c/csswg-drafts#10323 and w3c/csswg-drafts#10324, `(-webkit-)line-clamp` should always create an independent formatting context whenever it applies. Furthermore, the `display: -webkit-box` property will not cause the box to become a flexbox, but it will be an independent block formatting context instead (even for `line-clamp`, which doesn't require `display: -webkit-box` to apply). This patch adds some tests for it, and makes some other tests no longer tentative. Co-authored-by: Florian Rivoal <[email protected]>
…, a=testonly Automatic update from web-platform-tests Add BFC tests for `(-webkit-)line-clamp` (#46734) As was recently resolved in w3c/csswg-drafts#10323 and w3c/csswg-drafts#10324, `(-webkit-)line-clamp` should always create an independent formatting context whenever it applies. Furthermore, the `display: -webkit-box` property will not cause the box to become a flexbox, but it will be an independent block formatting context instead (even for `line-clamp`, which doesn't require `display: -webkit-box` to apply). This patch adds some tests for it, and makes some other tests no longer tentative. Co-authored-by: Florian Rivoal <[email protected]> -- wpt-commits: 839f93860707392c70f55d99b895f7277b115622 wpt-pr: 46734
…, a=testonly Automatic update from web-platform-tests Add BFC tests for `(-webkit-)line-clamp` (#46734) As was recently resolved in w3c/csswg-drafts#10323 and w3c/csswg-drafts#10324, `(-webkit-)line-clamp` should always create an independent formatting context whenever it applies. Furthermore, the `display: -webkit-box` property will not cause the box to become a flexbox, but it will be an independent block formatting context instead (even for `line-clamp`, which doesn't require `display: -webkit-box` to apply). This patch adds some tests for it, and makes some other tests no longer tentative. Co-authored-by: Florian Rivoal <[email protected]> -- wpt-commits: 839f93860707392c70f55d99b895f7277b115622 wpt-pr: 46734
…, a=testonly Automatic update from web-platform-tests Add BFC tests for `(-webkit-)line-clamp` (#46734) As was recently resolved in w3c/csswg-drafts#10323 and w3c/csswg-drafts#10324, `(-webkit-)line-clamp` should always create an independent formatting context whenever it applies. Furthermore, the `display: -webkit-box` property will not cause the box to become a flexbox, but it will be an independent block formatting context instead (even for `line-clamp`, which doesn't require `display: -webkit-box` to apply). This patch adds some tests for it, and makes some other tests no longer tentative. Co-authored-by: Florian Rivoal <gitflorian.rivoal.net> -- wpt-commits: 839f93860707392c70f55d99b895f7277b115622 wpt-pr: 46734 UltraBlame original commit: 4ae391e291d3e9aab8671a8e8b714a57830125e0
…, a=testonly Automatic update from web-platform-tests Add BFC tests for `(-webkit-)line-clamp` (#46734) As was recently resolved in w3c/csswg-drafts#10323 and w3c/csswg-drafts#10324, `(-webkit-)line-clamp` should always create an independent formatting context whenever it applies. Furthermore, the `display: -webkit-box` property will not cause the box to become a flexbox, but it will be an independent block formatting context instead (even for `line-clamp`, which doesn't require `display: -webkit-box` to apply). This patch adds some tests for it, and makes some other tests no longer tentative. Co-authored-by: Florian Rivoal <gitflorian.rivoal.net> -- wpt-commits: 839f93860707392c70f55d99b895f7277b115622 wpt-pr: 46734 UltraBlame original commit: 4ae391e291d3e9aab8671a8e8b714a57830125e0
…, a=testonly Automatic update from web-platform-tests Add BFC tests for `(-webkit-)line-clamp` (#46734) As was recently resolved in w3c/csswg-drafts#10323 and w3c/csswg-drafts#10324, `(-webkit-)line-clamp` should always create an independent formatting context whenever it applies. Furthermore, the `display: -webkit-box` property will not cause the box to become a flexbox, but it will be an independent block formatting context instead (even for `line-clamp`, which doesn't require `display: -webkit-box` to apply). This patch adds some tests for it, and makes some other tests no longer tentative. Co-authored-by: Florian Rivoal <[email protected]> -- wpt-commits: 839f93860707392c70f55d99b895f7277b115622 wpt-pr: 46734
Tests were added in web-platform-tests/wpt#46734 |
Currently,
line-clamp
, throughcontinue: discard
, is defined not to establish and Independent Formatting Context.In @andreubotella 's experimmental implementation of it, he found it easier to implement as creating an Independent Formatting Context. Also, in his exploration of the variant of line clamp based on hiding visibility rather than fragmentaiton, (so-called
continue: collapse
), he found that variant too to be simpler to implement and reason about if we can assume an Independent Formatting Context.The original idea not to set up an IFC was not particularly driven by use cases, but rather by a theoretical argument: if we can get away without an IFC, it's more flexible, and authors can always opt into having an IFC if they need one. However, the priority of constituencies tells us to put implementation considerations ahead of theoretical concerns, so in the absence of a clear author need, we should keep it simple.
Therefore, the proposal is that, regardless of which approach we take to get to
line-clamp
, we do establish an IFC.The text was updated successfully, but these errors were encountered: