This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 17824 - Clarify bidi aspects of <wbr>
Summary: Clarify bidi aspects of <wbr>
Status: CLOSED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-18 06:55 UTC by contributor
Modified: 2012-11-25 08:31 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2012-07-18 06:55:41 UTC
This was was cloned from bug 16001 as part of operation convergence.
Originally filed: 2012-02-16 15:24:00 +0000
Original reporter: Aharon Lanin <aharon.lists.lanin@gmail.com>

================================================================================
 #0   Aharon Lanin                                    2012-02-16 15:24:49 +0000 
--------------------------------------------------------------------------------
The <wbr> element is currently described as follows: "The wbr element represents a line break opportunity." There is no indication in this description of its effects on the bidi ordering of the content around it. One might think that it has the same effect as as <br>, or as U+FFFC OBJECT REPLACEMENT CHARACTER, or as as a space, or as a zero-width space, or as nothing at all. It turns out that these are very different possibilities. Nor is it clear whether it has the same effects when it actually breaks the line and when its opportunity is not acted upon. 

Experimentation with current versions of Firefox, Chrome and IE show that they interpret <wbr> differently. In IE, at least when <wbr> does not wrap the line, it seems to have no effect on the bidi ordering. In Firefox and Chrome, however, it has the same effect as a space. Thus, they display <div dir=rtl>12<wbr>34</div> as 3412. In IE9, it is displayed as 1234 (which seems to me to be a lot more useful).

If one looks closer at the spec, in the default style sheet section, one gets more information on <wbr>, though. The style sheet says:

wbr { content: '\200B'; }

U+200B, the ZERO WIDTH SPACE, is of bidi class BN, which effectively has no effect on the bidi ordering of the content around it. This is consistent with what IE does, but not with what Firefox and Chrome do. Strangely enough, however, while Firefiox and Chrome display <div dir=rtl>12&#x200B;34</div> correctly, as 1234, IE 9 displays it incorrectly, as 3412...

It would be best if the bidi effects of <wbr> were specified explicitly, up front, in the section on the wbr element. For example, it could state that <wbr> must have the same effect on the bidi ordering as U+200B, the ZERO WIDTH SPACE, i.e. no effect at all.
================================================================================
 #1   Glenn Adams                                     2012-02-16 16:53:42 +0000 
--------------------------------------------------------------------------------
(In reply to comment #0)

> If one looks closer at the spec, in the default style sheet section, one gets
> more information on <wbr>, though. The style sheet says:
> 
> wbr { content: '\200B'; }
> 
> U+200B, the ZERO WIDTH SPACE, is of bidi class BN, which effectively has no
> effect on the bidi ordering of the content around it. This is consistent with
> what IE does, but not with what Firefox and Chrome do. Strangely enough,
> however, while Firefiox and Chrome display <div dir=rtl>12&#x200B;34</div>
> correctly, as 1234, IE 9 displays it incorrectly, as 3412...
> 
> It would be best if the bidi effects of <wbr> were specified explicitly, up
> front, in the section on the wbr element. For example, it could state that
> <wbr> must have the same effect on the bidi ordering as U+200B, the ZERO WIDTH
> SPACE, i.e. no effect at all.

Better would be to specify that its bidi level be equal to the resolved bidi level of its content. If its content is the default \200B, then it is the same as ZWSP; but if its content is redefined to another character or character sequence, then that content should apply.  For example, if the default style sheet is overridden as:

wbr { content: '\200E'; }

then it would be treated as LRM, a non-neutral.

On the other hand, the current definition of wbr [1] says:

"Any content inside wbr elements must not be considered part of the surrounding text."

So it is unclear what role the content property has in this regard.

[1] http://dev.w3.org/html5/spec/Overview.html#the-wbr-element
================================================================================
Comment 1 Ian 'Hixie' Hickson 2012-11-25 04:08:59 UTC
Note #1 confuses CSS rendering with HTML semantics, which really have only the loosest of relationships.

As far as the original topic goes, I've added a requirement that it have no effect (or that it be implemented as per the rendering section).
Comment 2 contributor 2012-11-25 04:09:30 UTC
Checked in as WHATWG revision r7538.
Check-in comment: Clarify the requirements for <wbr>.
http://html5.org/tools/web-apps-tracker?from=7537&to=7538