-
Notifications
You must be signed in to change notification settings - Fork 707
[css-text] 'tab-size' de facto applies to inline boxes #5489
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
Matching reality is good, so yes, we should change. But what is the behavior exactly? A tab character isn't a shift by a particular amount, it is a shit to a tab stop. I guess we just compute the potential tab stops independently for each preserved tab character? If so, the following sentence
just needs to be changed to
I think that's what browsers do. An alternative model where tab stops of different sizes somehow stack up seems complicated and unnecessary. |
Made a couple of basic WPT tests backing this proposed resolution up: web-platform-tests/wpt#25373 They pass in Safari and Chrome, and would pass in Firefox if used the -moz- prefixed syntax instead of the unprefixed one, which Firefox does not yet support. |
The reason the spec defines it on the block container and not the inline is so that tab stops line up even when the font changes within the paragraph. It was very intentionally specced this way. |
@fantasai What about saying that This would still give authors more freedom to change the Though current implementations do break the alignment when the font changes. Testcase |
The CSS Working Group just discussed
The full IRC log of that discussion<dael> Topic: [css-text] 'tab-size' de facto applies to inline boxes<dael> github: https://github.com//issues/5489 <dael> florian: Currently applies to block but in impl applies to inline as well. Question is how? Stack or independant? From tests seems independent <dael> florian: If you have a prserve-tab with a value of 7 you measure frmo edge and push to next independent of if other ones. All browsers seem to do this so would like to spec it <astearns> ack fantasai <Zakim> fantasai, you wanted to ask where to put this and to <chris> sounds like we could standardize reality there <chris> ok, fair enough <dael> fantasai: Defined to apply to block so when font changes in paragraph tab stops line up. We knew at time impl didn't do that. I think it's not a question about line up with realitiy, there's a reason the spec is different. We can decide we can't do thing that is correct, but there's a reason why it was spec as different. <dael> florian: I did not know that, thank you <dael> oriol: I prop in issue that maybe could go in between current spec and current impl. Could say property applies to inlines and let authors change values in line boxes. If value spec is a number say it refers to advance size of space character of containing block. <dael> oriol: In common cases keep good alignment but closer to current impl <dael> fantasai: Works for me <dael> astearns: And likely more web compat <dael> florian: Works for me <dael> astearns: Prop: Change the spec to say tab size applies to inlines but when that happens the number values apply to advance width from block container <dael> astearns: That would change for all browsers? <dael> oriol: Yeah, right now they use width of space of inline box. <dael> florian: I will add a test for that <dael> astearns: Objections? <dael> RESOLVED: Change the spec to say tab size applies to inlines but when that happens the number values apply to advance width from block container <dael> astearns: Thanks oriol for the solution |
From https://drafts.csswg.org/css-text-3/#propdef-tab-size
However, all Chromium, WebKit and Firefox also support it in inline boxes. Testcase
looks more or less like
So I guess the spec should be changed to reflect reality?
The text was updated successfully, but these errors were encountered: