Open kojiishi opened 4 years ago
I don't think the Edge behavior is desirable here. It would mean that rendering of underlines will be broken in the presence of subscripts: <u>H<sub>2</sub>O</u>
will forever look bad.
The inconsistency between behavior when the child box is moved down vs when it is moved up also seems bad. (What about the case of overlines? Would the opposite apply there?)
IMO the spec should be kept as is, because this is the better behavior; it gives authors simple, consistent behavior, and makes it easy to get the result that is usually "right". With the proposed change here, it would become extremely difficult for an author to produce the effect of a continuous underline on text that includes subscripts.
I'm aware there are sites that would exhibit a "regression", but the nature of the regression is that it's a visual glitch rather than something that seriously impacts functionality, and it's easily fixed by correcting the text-decoration styling. It's currently difficult to persuade site authors to care about fixing it because the dominant browser doesn't follow the spec, but if Chrome fixes this behavior, "broken" (not really broken, but visually glitched) sites will suddenly have a greater incentive to correct their content.
if Chrome fixes this behavior, "broken" (not really broken, but visually glitched) sites will suddenly have a greater incentive to correct their content.
From my experience in the past, what would happen is that they file bugs against Chromium rather than fixing their sites, and our default choice is to revert the change. Even before that, if regression is known beforehand, our community will not approve shipping the change. It is possible to try to convince the community, but I guess we need more investigations if we want to try that.
Two things I can think of:
<u>H<sub>2</sub>O</u>
isn't optimal, but the spec behavior is not optimal either, looking at the screenshot above, especially with ink skipping on. Are there any other options?Also noticed that for <u>H<sub>2</sub>O</u>
, really the right thing is font-variant-position: sub
, no?
Also noticed that for
<u>H<sub>2</sub>O</u>
, really the right thing isfont-variant-position: sub
, no?
Possibly, but that doesn't seem to be very widely supported at the moment.
I agree that Edge's behavior on H2O isn't optimal, but the spec behavior is not optimal either, looking at the screenshot above, especially with ink skipping on.
IMO the spec behavior is the most reasonable result: the line must be uniform across the entire decorated box. If an author expects to have a lot of subscripts, and doesn't like how that interacts with ink-skipping, the two options would be to turn off skipping (so that the underline cuts through the subscripts), or to use text-underline-position: under
or text-underline-offset
to move the line lower for all the content.
What is categorically wrong, IMO, is for the line to jump up and down on baseline-shifted children of the decorated box. If that result is desired, the decoration should be applied separately to each of the child elements.
what would happen is that they file bugs against Chromium rather than fixing their sites
I'm sure that is true, just as they file bugs against Firefox today. But if Chromium (in addition to Firefox) provides clear messaging that "this is the correct behavior, and if your site looks bad, it's on you to fix it" there will be a much stronger incentive than when it's only Firefox trying to hold that line.
Have you contacted to site owners you know look bad with the spec behavior?
Yes, at least in some cases; I'm afraid I don't know details of how many such contacts there have been, or how often it has led to a site being fixed. In the case of the BBC site reported in https://bugzilla.mozilla.org/show_bug.cgi?id=1584348, for example, the problem is still present. I suspect that if their site started looking bad in Chrome, however, they'd probably get around to fixing it.
Whether you could convince them to fix it before Chrome actually ships a change that "breaks" their site is more questionable, I guess. People love to put things off for another day...
Re. font-variant-position: sub
, Florian covered this at https://wiki.csswg.org/faq
For what it's worth I agree with @jfkthame. I don't see how you can change the behaviour to match Chrome's rendering without breaking Gecko's rendering (and also our rendering) in the process.
The CSS Working Group just discussed Underline Position for decorating box
.
Test: https://jsbin.com/tewugik/edit?html,output
Gecko positions the underline at the decorating box, while Edge seems to take the lower of the decorating box and the default position of the node.
This difference, along with Blink/WebKit not supporting decorating box yet (crbug.com/1008951), is causing web compat issue for Mozilla. https://bugzilla.mozilla.org/show_bug.cgi?id=1387206 The actual site: https://www.bbc.com/sport/formula1
Can we take Edge's behavior? When actual regressions are known at multiple sites, it'd be difficult for us to match the spec.
/cc @jfkthame