Skip to content
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] How does max-lines interact with hidden content? #2421

Closed
Loirooriol opened this issue Mar 7, 2018 · 9 comments

Comments

Projects
None yet
5 participants
@Loirooriol
Copy link
Collaborator

commented Mar 7, 2018

<div id="a" style="width: 0; max-lines: 2">
  <div id="b" style="max-lines: 1">Lorem ipsum</div>
  dolor
</div>

Due to #b's max-lines: 1, only Lorem is displayed and ipsum is discarded.

But #a has max-lines: 2. Does ipsum still count as one line, and thus dolor is discarded?

@frivoal frivoal self-assigned this Mar 8, 2018

@frivoal

This comment has been minimized.

Copy link
Collaborator

commented Mar 8, 2018

Excellent question. I think we should only count the lines that are actually there, and therefore not count ipsum and not discard dolor. Otherwise:

  • We have to fake-layout the discarded content for the sole purpose of counting the lines in it
  • We would get the wrong number of lines from the users's point of view.

I think that is actually what the spec says already, since we're only counting line boxes, and ipsum isn't in a line box, but a clarifying note would certainly not hurt.

@fantasai, do you agree?

@Loirooriol

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 8, 2018

We would get the wrong number of lines from the users's point of view.

Yes, but this objective is hard to generalize. What if I use max-height: 1lh; overflow: clip instead of max-lines: 1? Visually it would be the same, but now both lines would be counted...

@frivoal frivoal added the Agenda+ F2F label Mar 28, 2018

@frivoal

This comment has been minimized.

Copy link
Collaborator

commented Mar 28, 2018

The "what about lines in overflow:clip` part question solves itself if:

  • we decide in #1971 that overflow:clip creates a BFC, and
  • we decide in ##2429 that max-lines skips counting lines in descendant BFCs.

I am not expressing either being for or against either of these, but they're dependencies, so we should look into this issue after we look into these.

@fantasai fantasai changed the title [css-overflow] How does max-lines interact with descendants' max-lines? [css-overflow] How does max-lines interact with hidden content? Apr 9, 2018

@frivoal

This comment has been minimized.

Copy link
Collaborator

commented Jul 1, 2018

Given that we've resolved #2429 to make max-lines skip counting lines in descedant BGCs, but #1971 to say that overflow:clip does not create a BFC, the question remains open for overflow:clip.

I don't think there's any technical reason to make max-lines skip the descendants of overflow:clip, so we could close this as no change. On the other hand, maybe it is counter intuitive that we'd be counting invisible lines.

@heycam

This comment has been minimized.

Copy link
Contributor

commented Jul 2, 2018

I agree that overflow: clip shouldn't affect whether a line is counted for max-lines. overflow: clip to me is mostly a visual effect (and I think the name "clip" suggests that too). You can also have lines partially visible when using overflow: clip, another indication that it is working visually rather than fragmenting away content that is overflowing.

@frivoal

This comment has been minimized.

Copy link
Collaborator

commented Jul 2, 2018

Right. We should close this as no change.

@Loirooriol

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 2, 2018

So max-lines: 1 moves the second line to another region and it's not counted, and max-height: 1lh; overflow: clip counts it?

Some clarification would be useful, maybe a note or example.

@frivoal frivoal added Agenda+ and removed Agenda+ F2F labels Jul 8, 2018

@anjia

This comment has been minimized.

Copy link

commented Jul 18, 2018

Yeah, I agree there is no change.

max-lines:1 makes ipsum discarded, because max-lines does the layout.
max-height: 1lh; overflow: clip makes ipsum counted, because max-height does the layout and overflow just does a visual effect.

@css-meeting-bot

This comment has been minimized.

Copy link
Member

commented Jul 18, 2018

The Working Group just discussed How does max-lines interact with hidden content?, and agreed to the following:

  • RESOLVED: keep current definition such that we could all lines in overflow:clip descendant
The full IRC log of that discussion <dael> Topic: How does max-lines interact with hidden content?
<dael> github: https://github.com//issues/2421
<dael> florian: This started much broader and we're almost done. Just a corner case we haven't decided explicitly.
<dael> florian: The broad topic is which lines tdo we count when w have max-lines and a decendent or BFCs or a child also with max-lines. We resolved we skip when you nest max-lines. Resolved for most of overflow. Remaining bit is overflow:clip
<dael> florian: overflow:clip is not a BFC so it implies you could the lines inline overflow:clip. I think close this with no more changes needed.
<dael> Rossen_: Is the issue different if overflow:clip is applied to max-lines container?
<dael> florian: This is on decendant
<dael> Rossen_: How different then when on max-line container?
<dael> florian: On container it doesn't do anything special and overflow not terribly relevent.
<dael> Rossen_: But then you can extract same thing happens with child.
<dael> florian: So you're okay no change?
<dael> Rossen_: Yes
<dael> astearns: WE could lines in decendant with overflow:clip, but only not overflowing?
<dael> florian: Count all the lines
<dael> Rossen_: Overflow:clip doesn't effect count of lines
<dael> florian: Right
<dael> astearns: Gotcha
<dael> astearns: Objections to keep current definition such that we could all lines in overflow:clip decendant?
<dael> fantasai: I think this is correct. Might be initially confusing but it's the right model
<dael> RESOLVED: keep current definition such that we could all lines in overflow:clip descendant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.