You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-text][text-spacing] Visual regressions of line-start at portals and news sites #9511
From dogfooding a prototype, the space-first turned out to regresss portal sites and news sites. The regressions were found at MSN Japan and Google News, occuring multiple times a day. Some consider this a minor visual regression, while others consider a critically blocking regression.
For other sites, trim-auto is ideal. space-first is a) less ideal for body text, b) quite strange for headlines, and c) critically regresses headline lists seen in portal top pages, news sites, blog sites, etc. (note the criticalness is controversial, some people consider it's minor in all cases, while others think critically blocking.)
From the feedback so far to the CSS prorotype, Android, and iOS, I think users/authors are particular about:
Line start >>>> autospace >> adjuscent > line end
At this point, I can't find options other than defining a new value that doesn't trim line-start at all, and make it initial.
@kojiishi Thanks for reporting this. Real world experience here is very useful.
At this point, I can't find options other than defining a new value that doesn't trim line-start at all, and make it initial.
I am not sure I follow, as you also said that most people though that trim-auto was the ideal value. Is it because not trimming at all gives results that are more consistent than space-first, even if they're not great?
Maybe we do need a new value, but I wonder how much of this problem we can address using UA stylesheets, for example by setting text-spacing: trim-auto on h1, h2… and maybe also on dt, dd, li… even if the initial value remains space-first?
@frivoal's idea of augmenting the UA stylesheet to have fine-tuned defaults balancing compat and ideal rendering taken in account seems reasonable to me. Might be hard, but worth experimenting.
Is it because not trimming at all gives results that are more consistent than space-first, even if they're not great?
Yes, it's acceptable, though not great. It doesn't change the visual of line-start from without the feature implemented, so no improvements on line-start, but it doesn't regress. In these examples screenshot of space-first (1, 2), a) trimming both open parenthesis at line 1 and line 2 is ideal, b) not triming both is acceptable, and c) trimming only one of them is quite bad, especially for headlines. It's the desired behavior for some styles of novel body text though, and hence space-first is defined so.
Maybe we do need a new value, but I wonder how much of this problem we can address using UA stylesheets, for example by setting text-spacing: trim-auto on h1, h2… and maybe also on dt, dd, li… even if the initial value remains space-first?
Good idea. This is not easy though, as the problem is about web-compat of existing sites, and they use <div> quite often.
If we were to make trim-auto as the default, Aozorabunko for example uses <div> and <br>.
The criticalness of regressions for existing content by changing the initial behavior vary by who you ask, this table shows the "worst - best" personal opinion range for each case from the Japanese discussion:
Thanks for summarizing the criticalness on each case. I'd like to add my opinion.
I think the "Headline lists" with space-first will be "Regress or Okay" rather than "Critical" and it won't be a show-stopper for us. (As I wrote in the Japanese ML, I feel space-first is better than "No trimming at line-start" in this case, but I understand some people may feel this is a regression.)
Also the "Body with text-indented" with space-first will be "Okay" rather than "Regress". See the example below:
The result of "No trimming at line-start" will be:
「あいうえお」かきくけこさしすせそ
「たちつてとなにぬねの」はひふへほま
みむめもやゆよ。
And the result of "space-first" will be:
「あいうえお」かきくけこさしすせそ
「たちつてとなにぬねの」はひふへほま
みむめもやゆよ。
I feel the result of "space-first" is much better than "No trimming at line-start".
And I think there are more cases where trim-auto will be "Critical" or "Regress". Some web pages with elaborate visual design may use positioning properties for span with fullwidth opening brackets (e.g. <span style="position: …">「</span>) to adjust the spacing or to achieve a hanging opening punctuation effect or some special effect. In such cases, the layout will be broken if trim-auto becomes the default.
(update: I will take back the following part, as this is the style EBPAJ EPUB 3 File Creation Guide recommends)
One comment. I am not sure if the “Novel” row can be generalized as a novel in general. The text data mentioned in #2462 is created in a specific way to workaround missing functionalities in CSS. To achieve half-width space before the opening bracket in the full-width indentation style, it inserts a full-width space except when the first character of the paragraph is an opening bracket. The first row is representing text data prepared in this specific way.
Related to my previous comment, is there a way to achieve the “one full-width” indentation style? The text-indent property in the Text Module Level 4 does not seem to support it but it might be just my misunderstanding.
I feel the result of "space-first" is much better than "No trimming at line-start".
I personally don't agree, the table in #9511 (comment) is to pick up all voices, so updated. It was "the worst case list" but now updated to "the worst - best range list". I hope this looks better.
One comment. I am not sure if the “Novel” row can be generalized as a novel in general.
How about e-Books? Or if you have suggestion, that helps. I agree the style sometimes happens in non-novels or non-e-Books sites, but IIUC it's considered "critical" for e-Books sites, no?
I personally don't agree, the table in #9511 (comment) is to pick up all voices, so updated. It was "the worst case list" but now updated to "the worst - best range list". I hope this looks better.
Thanks! Now this table looks very good and interesting. In my feeling, all "Ok"s in the space-first column will be "Better", as I commented before ("I feel space-first is better than "No trimming at line-start" in this case, but I understand some people may feel this is a regression.").
Activity
frivoal commentedon Oct 23, 2023
@kojiishi Thanks for reporting this. Real world experience here is very useful.
I am not sure I follow, as you also said that most people though that
trim-autowas the ideal value. Is it because not trimming at all gives results that are more consistent thanspace-first, even if they're not great?Maybe we do need a new value, but I wonder how much of this problem we can address using UA stylesheets, for example by setting
text-spacing: trim-autoonh1,h2… and maybe also ondt,dd,li… even if the initial value remainsspace-first?kidayasuo commentedon Oct 23, 2023
kojiishi commentedon Oct 23, 2023
nt1m commentedon Oct 23, 2023
@frivoal's idea of augmenting the UA stylesheet to have fine-tuned defaults balancing compat and ideal rendering taken in account seems reasonable to me. Might be hard, but worth experimenting.
kojiishi commentedon Oct 23, 2023
@frivoal
Yes, it's acceptable, though not great. It doesn't change the visual of line-start from without the feature implemented, so no improvements on line-start, but it doesn't regress. In these examples screenshot of
space-first(1, 2), a) trimming both open parenthesis at line 1 and line 2 is ideal, b) not triming both is acceptable, and c) trimming only one of them is quite bad, especially for headlines. It's the desired behavior for some styles of novel body text though, and hencespace-firstis defined so.Good idea. This is not easy though, as the problem is about web-compat of existing sites, and they use
<div>quite often.trim-autoas the default, Aozorabunko for example uses<div>and<br>.space-firstas the default, MSN Japan, Google News Japan for examples use<div>.kojiishi commentedon Oct 23, 2023
I mean, adding UA stylesheet can't help improving the initial value due to web-compat, but adding
trim-autotoh1,h2,li, etc. is a great idea.kidayasuo commentedon Oct 23, 2023
Thank you @kojiishi for summarizing the discussion on the JLReq TF mailing list.
I agree with @nt1m that @frivoal’s idea is worth pursuing as it can apply the ideal
trim-autoon headings and lists while maintaining compatibility.kojiishi commentedon Oct 23, 2023
The criticalness of regressions for existing content by changing the initial behavior vary by who you ask, this table shows the "worst - best" personal opinion range for each case from the Japanese discussion:
trim-autospace-firsttext-indented (rare)The "no trimming" option was more favored decades ago, but I think the trend is gradually moving towards
trim-auto.Kobayashi-sensei said he will give more thoughts on each use cases, so this is preliminary.
MurakamiShinyu commentedon Oct 23, 2023
Thanks for summarizing the criticalness on each case. I'd like to add my opinion.
I think the "Headline lists" with
space-firstwill be "Regress or Okay" rather than "Critical" and it won't be a show-stopper for us. (As I wrote in the Japanese ML, I feelspace-firstis better than "No trimming at line-start" in this case, but I understand some people may feel this is a regression.)Also the "Body with
text-indented" withspace-firstwill be "Okay" rather than "Regress". See the example below:The result of "No trimming at line-start" will be:
And the result of "space-first" will be:
I feel the result of "space-first" is much better than "No trimming at line-start".
And I think there are more cases where
trim-autowill be "Critical" or "Regress". Some web pages with elaborate visual design may use positioning properties for span with fullwidth opening brackets (e.g.<span style="position: …">「</span>) to adjust the spacing or to achieve a hanging opening punctuation effect or some special effect. In such cases, the layout will be broken iftrim-autobecomes the default.kidayasuo commentedon Oct 24, 2023
Thank you @kojiishi for the summary.
(update: I will take back the following part, as this is the style EBPAJ EPUB 3 File Creation Guide recommends)
One comment. I am not sure if the “Novel” row can be generalized as a novel in general. The text data mentioned in #2462 is created in a specific way to workaround missing functionalities in CSS. To achieve half-width space before the opening bracket in the full-width indentation style, it inserts a full-width space except when the first character of the paragraph is an opening bracket. The first row is representing text data prepared in this specific way.
kidayasuo commentedon Oct 24, 2023
Related to my previous comment, is there a way to achieve the “one full-width” indentation style? The
text-indentproperty in the Text Module Level 4 does not seem to support it but it might be just my misunderstanding.kojiishi commentedon Oct 24, 2023
I personally don't agree, the table in #9511 (comment) is to pick up all voices, so updated. It was "the worst case list" but now updated to "the worst - best range list". I hope this looks better.
kojiishi commentedon Oct 24, 2023
How about e-Books? Or if you have suggestion, that helps. I agree the style sometimes happens in non-novels or non-e-Books sites, but IIUC it's considered "critical" for e-Books sites, no?
MurakamiShinyu commentedon Oct 24, 2023
@kojiishi
Thanks! Now this table looks very good and interesting. In my feeling, all "Ok"s in the
space-firstcolumn will be "Better", as I commented before ("I feelspace-firstis better than "No trimming at line-start" in this case, but I understand some people may feel this is a regression.").kojiishi commentedon Oct 24, 2023
Done.
59 remaining items
[text-autospace][text-spacing-trim] Update `text-spacing` shorthand
[text-autospace][text-spacing-trim] Update `text-spacing` shorthand
[text-autospace][text-spacing-trim] Update `text-spacing` shorthand
[text-autospace][text-spacing-trim] Update `text-spacing` shorthand
[text-autospace][text-spacing-trim] Update `text-spacing` shorthand
[text-autospace][text-spacing-trim] Update `text-spacing` shorthand
Bug 1876262 [wpt PR 44162] - [text-autospace][text-spacing-trim] Upda…
Bug 1876262 [wpt PR 44162] - [text-autospace][text-spacing-trim] Upda…
Bug 1876262 [wpt PR 44162] - [text-autospace][text-spacing-trim] Upda…
Adjust syntax of text-spacing[-trim] to match CSSWG resolution
Adjust behavior of existing tests to match CSS spec change
[text-autospace][text-spacing-trim] Update `text-spacing` shorthand
Bug 1871221 [wpt PR 43766] - Text spacing trim revamp, a=testonly
Bug 1871221 [wpt PR 43766] - Text spacing trim revamp, a=testonly
Bug 1876262 [wpt PR 44162] - [text-autospace][text-spacing-trim] Upda…