Closed Bug 1229743 Opened 8 years ago Closed 8 years ago

text-decoration: underline; vanish at different font-size parts in vertical text mode

Categories

(Core :: Layout: Text and Fonts, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: xmomdo, Assigned: xidorn)

References

(Blocks 1 open bug, )

Details

(Keywords: testcase)

Attachments

(6 files)

Attached file testcase
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:45.0) Gecko/20100101 Firefox/45.0
Build ID: 20151201030226

Steps to reproduce:

following HTML fragment (for more details, see testcase):

<p style="writing-mode:vertical-rl; font-family:'メイリオ', font-size:16px">
ああ<span style="font-size:13px">あ</span>ああ
<p>
<p style="writing-mode:vertical-rl; font-family:Arial, font-size:20px">
aa<span style="font-size:36px">a</span>aa
<p>


Actual results:

Underlines are broken at smaller (or bigger) font text parts.


Expected results:

According to css-text-decor-3 spec (see figure 6) [1]:

> for underlines and overlines the UA must use a single thickness and position on each line for the decorations deriving from a single decorating box. 



[1] https://drafts.csswg.org/css-text-decor-3/#text-underline-position-property
Attached image screen shot (win10)
This is screen shot of testcase.
Component: Untriaged → Layout: Text
Product: Firefox → Core
Version: 45 Branch → unspecified
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:45.0) Gecko/20100101 Firefox/45.0
20151201030226
Blocks: writing-mode
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase
Another test based on xmondo's test:

http://www.gtalbot.org/BugzillaSection/Bug1229743text-decoration-underline-different-font-size.html

xmondo,

I also notice your actual results with your test and with my test. I am using Firefox 45.0a1 buildID=20151201060105 under Linux Kubuntu (trusty) 14.04.03 LTS, KDE 4.13.3, Linux 3.13.0-71-generic x86_64.

In your test, <html lang="ja"> will cause Firefox to comply with 
:root:lang(ja) { text-underline-position: under right; }
and Firefox is today the only browser able to achieve this. In my test, I have removed lang="ja" so that browser rendering comparisons could become possible.

It would be interesting to see how Edge 13.10586 renders both tests.

"See Also" field set to bug 1220438
OS: Unspecified → All
Hardware: Unspecified → All
See Also: → 1220438
Version: unspecified → Trunk
Gérard,
Thanks for your additional testing. 

Also, bug 1175846 might be related.
See Also: → 1175846
Attached file testcase 2
This is supplementary test case.
Mondo, 

When I load attachment 8697756 [details] into Firefox nightly 46.0a1 buildID=20151219081206, I get actual results. But if I remove lang="ja" from document root element from attachment 8697756 [details], then I get expected results: the underline will be consistent, unbroken and using the same thickness. This, I believe, is important to mention.

I assume you are Momdo Nakamura.
If I remove lang="ja" from document root element from attachment 8697756 [details] and if I replace 'text-decoration: underline' with 'text-decoration: overline' , then I get actual results.
In my understanding, the situation of comment 6 is the left side line.
As comment 6, the underlines are the expected results, except that on the left side.

Addtionally, bug 770780 might be related. ("Depends on" or "Blocks" ?)

> I assume you are Momdo Nakamura.
Yeah, that's right :-)
> bug 770780 might be related. ("Depends on" or "Blocks" ?)

It could be "Depends on", it could be "Blocks" and it could be none of them. Bug 770780 is about a first implementation of text-underline-position, as I understand it. While this bug report is more specific and is about consistent rendering of the underline and overline. 

One is for sure: once bug 770780 has been fixed, then we should revisit this bug 1229743 report (and others: bug 1220438, bug 1175846, bug 1163455, etc) and try their testcases and verify the implementation.
Blocks: 1097499
It seems to me this happens only for vertical-rl and only for underline. And this is a blocker of bug 1097499 because tcy relies on the same logic to handle additional overflow area.
Assignee: nobody → bugzilla
This patchset should fix both this bug and bug 1163455 as they are both issues on computation of overflow rect.

I guess reftest for this patchset is probably writtable with Ahem, though...
Given this patch, I actually don't understand why this happens only for vertical-rl. It seems to me the original code should not work for vertical-lr either.
And it seems it still doesn't work with sideways-lr... Probably I need to further investigate it later.
I have modified

http://www.gtalbot.org/BugzillaSection/Bug1229743text-decoration-underline-different-font-size.html

so that it can check, can test all combinations of writing-modes, text-decoration [ underline | overline ] and text-orientation values.

- - - - - - 

> I guess reftest for this patchset is probably writtable with Ahem, though...

The exact position of underline can not be predicted; the only requirement is that it is below the baseline.
Comment on attachment 8739915 [details]
MozReview Request: Bug 1229743 part 1 - Simplify text decoration handling code with lambda function and range-based for loop. r?jfkthame

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/45437/diff/1-2/
Attachment #8739916 - Attachment description: MozReview Request: Bug 1229743 part 2 - Handle vertical-rl properly when computing visual overflow of decoration. r?jfkthame → MozReview Request: Bug 1229743 part 2 - Fix up decoration rect computation for vertical-rl and sideways-lr. r?jfkthame
Comment on attachment 8739916 [details]
MozReview Request: Bug 1229743 part 2 - Fix up decoration rect computation for vertical-rl and sideways-lr. r?jfkthame

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/45439/diff/1-2/
Comment on attachment 8739915 [details]
MozReview Request: Bug 1229743 part 1 - Simplify text decoration handling code with lambda function and range-based for loop. r?jfkthame

https://reviewboard.mozilla.org/r/45437/#review42527

Nice cleanup! :)
Attachment #8739915 - Flags: review?(jfkthame) → review+
Comment on attachment 8739916 [details]
MozReview Request: Bug 1229743 part 2 - Fix up decoration rect computation for vertical-rl and sideways-lr. r?jfkthame

https://reviewboard.mozilla.org/r/45439/#review42529
Attachment #8739916 - Flags: review?(jfkthame) → review+
https://hg.mozilla.org/mozilla-central/rev/d37a1a6cbf8f
https://hg.mozilla.org/mozilla-central/rev/d6091fcaa0b2
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Attached file testcase3
I have made additional test case (testcase3).

In the small text (superscript and subscript) parts, the position of decoration lines run away.
Issue with sup and sub sounds like bug 1262974.
You need to log in before you can comment on or make changes to this bug.