The default bug view has changed. See this FAQ.

IDEOGRAPHIC SPACE (U+3000) should cause line break after a white space

RESOLVED FIXED in mozilla16

Status

()

Core
Layout: Text
RESOLVED FIXED
5 years ago
3 months ago

People

(Reporter: masayuki, Assigned: masayuki)

Tracking

({intl})

Trunk
mozilla16
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments, 1 obsolete attachment)

(Assignee)

Description

5 years ago
Created attachment 633446 [details]
testcase

Reported from fxinput: http://input.mozilla.org/opinion/3001588

It says that this page layout is broken only on Fx.
http://www.mikariole.com/shop/index.html

The page specifies the width of table as 760px but actual width is wider than it because there is a line which has only IDEOGRAPHIC SPACEs (U+3000).

See the attached testcase. On WebKit and Opera, the line is broken between them. I'm not sure for IE9. IE9 doesn't break the page layout but doesn't break lines on the testcase.

Anyway, we should break lines before IDEOGRAPHIC SPACE after a white space.
(Assignee)

Comment 1

5 years ago
Created attachment 633447 [details] [diff] [review]
Patch
Attachment #633447 - Flags: review?(roc)
Comment on attachment 633447 [details] [diff] [review]
Patch

Review of attachment 633447 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/base/src/nsLineBreaker.cpp
@@ +225,5 @@
> +        mBreakHere ||
> +        // U+3000 is IDEOGRAPHIC SPACE.  Japanese authors may use it instead of
> +        // ASCII white space accidentally.  Like WebKit and Opera, we should
> +        // allow to break lines before it.
> +        (mAfterBreakableSpace && (!isBreakableSpace || ch == 0x3000)) ||

This is a bit complicated.

This code is trying not to break inside runs of breakable spaces, only at the end of a run of breakable spaces. For normal spaces that usually can't produce long lines since runs normal spaces are compressed by default. But 0x3000 isn't compressed by nsTextFrameUtils::TransformText (and they're not compressed by any other browser, so we shouldn't start doing that.

Opera and Webkit allow breaking both before and after 0x3000, which your patch doesn't do.

Could we remove 0x3000 from IsSpace and/or NS_IsSpace, and rely on nsILineBreaker to return allowed break positions before and after 0x3000? That might be the cleanest way to fix this.
(Assignee)

Updated

5 years ago
Summary: IDEOGRAPHIC SPACE (U+3000) should cause like break after a white space → IDEOGRAPHIC SPACE (U+3000) should cause line break after a white space
(Assignee)

Comment 3

5 years ago
Created attachment 633794 [details] [diff] [review]
Patch

Okay, this doesn't hurt other parts calling the method.
Attachment #633447 - Attachment is obsolete: true
Attachment #633447 - Flags: review?(roc)
Attachment #633794 - Flags: review?(roc)
(Assignee)

Comment 4

5 years ago
see also https://tbpl.mozilla.org/?tree=Try&usebuildbot=1&rev=a41b43d0bea0
Attachment #633794 - Flags: review?(roc) → review+
(Assignee)

Comment 5

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/6ebd8e4ceb51
Target Milestone: --- → mozilla16
https://hg.mozilla.org/mozilla-central/rev/6ebd8e4ceb51
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
See Also: → bug 1325807
You need to log in before you can comment on or make changes to this bug.