W3C home > Mailing lists > Public > public-html@w3.org > March 2015

<wbr> rendering

From: Andrea Rendine <master.skywalker.88@gmail.com>
Date: Sun, 8 Mar 2015 11:38:20 +0100
Message-ID: <CAGxST9nQ7Hz=BW1u8HNh=nSGf0WyR2V+t4jxtxn+FwAS4DdkqA@mail.gmail.com>
To: public-html@w3.org
Please anybody help me understanding this.

Something like a couple years ago, I filed a bug on the WHATWG HTML Living
Standard project, complaining about how a tag was meant to be rendered. I
received a completely unsatisfying answer, which was basically meant to
tell me to wait. Enough waiting now.

In the spec, <wbr> is meant to be a line break opportunity. The two
examples provided are quite different (a prose with a curious streamlike
formatting, and a code fragment), but this underlines how different use
cases can be.

Now, when reading the prose I thought to myself that this can be a
convenient way to insert hyphenated word breaks, as most languages break
words with a - mark. <wbr> would remove the need for a &shy; soft hyphen.
An alternative to good ol' U+173 Soft Hyphen is needed because such
character is copypasted along with the text itself, and can be fetched by
data-mining tools, while it isn't strictly part of content. <wbr>, on the
other side, is markup and wouldn't appear where only text is to be fetched.

Now, according to the idea of the spec, an author could style such element
so that its rendering fits to the purpose. For instance, <wbr> inside
<code> could be rendered as zero width space, while <wbr> in paragraphs
could become a soft hyphen.

Except, this is impossible: rendering of <wbr> is obtained with a CSS rule
such as
wbr {content: }

Now, in the last 2 years i saw no improvements in the implementation, by
UAs, of the "content" property applied to real (non pseudo) elements. Nor
would I like to see such a thing, which has no practical uses IMO, and
which would break the separation between content and layout the opposite
way (i.e. in the past, HTML was used for layout, while this way CSS would
define the content).

These considerations are mine, though. What is important now is that <wbr>
doesn't work on its own. It breaks words, right, but any empty span element
would do the trick. why not changing its rendering rule such as
wbr::after {content=} so that it becomes really usable?

Thanks for the attention and for any suggestion you will provide.
Andrea
Received on Sunday, 8 March 2015 10:38:47 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:16:42 UTC