Bug 16001 - Clarify bidi aspects of <wbr>
Clarify bidi aspects of <wbr>
Status: RESOLVED FIXED
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec
unspecified
PC Linux
: P2 normal
: ---
Assigned To: Silvia Pfeiffer
HTML WG Bugzilla archive list
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-16 15:24 UTC by Aharon Lanin
Modified: 2012-12-07 09:29 UTC (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aharon Lanin 2012-02-16 15:24:49 UTC
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.
Comment 1 Glenn Adams 2012-02-16 16:53:42 UTC
(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 2 contributor 2012-07-18 06:55:44 UTC
This bug was cloned to create bug 17824 as part of operation convergence.
Comment 3 Silvia Pfeiffer 2012-12-07 09:29:20 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If
you are satisfied with this response, please change the state of
this bug to CLOSED. If you have additional information and would
like the Editor to reconsider, please reopen this bug. If you would
like to escalate the issue to the full HTML Working Group, please
add the TrackerRequest keyword to this bug, and suggest title and
text for the Tracker Issue; or you may create a Tracker Issue
yourself, if you are able to do so. For more details, see this
document:   http://dev.w3.org/html5/decision-policy/decision-policy-v2.html

Status: Accepted

Change Description:
https://github.com/w3c/html/commit/a6f336d2308170f262aa5cf38f94a1b9f7aaf949

Rationale: Adopted WHATWG spec patch both for HTML5 and HTML5.1