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 23494 - What content can be there inside an "empty"-content-model element? Aside, user agents should consider making <wbr> stylable for different purposes (e.g. syllable separation)
Summary: What content can be there inside an "empty"-content-model element? Aside, use...
Status: RESOLVED WORKSFORME
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: 2013-10-14 19:43 UTC by contributor
Modified: 2013-11-22 19:13 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2013-10-14 19:43:50 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html
Multipage: http://www.whatwg.org/C#the-wbr-element
Complete: http://www.whatwg.org/c#the-wbr-element
Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/

Comment:
What content can be there inside an "empty"-content-model element? Aside, user
agents should consider making <wbr> stylable for different purposes (e.g.
syllable separation)

Posted from: 94.39.33.9 by master.skywalker.88@gmail.com
User agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.69 Safari/537.36
Comment 1 Ian 'Hixie' Hickson 2013-10-14 22:15:08 UTC
I don't really understand what you're asking. Are you asking what's allowed? What's possible if you violate the spec? Something else?
Comment 2 Andrea Rendine 2013-10-15 00:19:04 UTC
(In reply to Ian 'Hixie' Hickson from comment #1)
When I first wrote my comment I referred to a sentence in the spec that I found confusing:
"Any content inside wbr elements must not be considered part of the surrounding text." (http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-wbr-element)
I thought it was an error, as no content is allowed inside empty elements, while the sentence suggests that a content can exist, although it mustn't be considered.  Then I noticed that all empty element descriptions contain similar caveats for (invalid) content. I apologize for the useless question.
Maybe the "aside" is a major concern for me now. I have read some articles about extensive testing with <wbr> (and I tested it on my own) and I wonder whether it can be also used for syllables division, instead of the inclusion of a soft hyphen (&shy; or &#173;). It turns out that it can't, because of 2 reasons:
1. CSS property {content} isn't perfectly supported when applied on element (while it is good for pseudo-elements), but in 2 cases (Internet Explorer and Firefox) out of the 5 major browsers the use of the soft hyphen via CSS appears after a <span>, either used as container or as empty separator. In Chrome and Opera words break witout any graphical sign, while Safari apparently ignores span:after with (soft) hyphens as a possible word break (in all cases I refer to latest versions).
2. Anyway for some reasons it NEVER appears when applied on wbr:after, which would be the best case. <wbr> seems not to be "stylable", so it can't be used for this kind of internal division, although it would be good.
Is there a way to address this issue to user agent so that they can achieve a consistent and correct behavior? I know this is a rendering issue, but it would help in the content, in getting rid of &shy; in text nodes.
Comment 3 Andrea Rendine 2013-10-15 12:23:25 UTC
Edit: in order to achieve the mentioned behavior (i.e. showing a soft hyphen when necessary at the end of a line), empty separatory <span>s must not be styled as inline-block elements. So if <wbr> were to produce the same behavior it should have display:inline as default rendering.
Comment 4 Ian 'Hixie' Hickson 2013-11-15 17:11:30 UTC
(In reply to Andrea Rendine from comment #2)
> (In reply to Ian 'Hixie' Hickson from comment #1)
> When I first wrote my comment I referred to a sentence in the spec that I
> found confusing:
> "Any content inside wbr elements must not be considered part of the
> surrounding text."
> (http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-
> semantics.html#the-wbr-element)
> I thought it was an error, as no content is allowed inside empty elements,
> while the sentence suggests that a content can exist, although it mustn't be
> considered.  Then I noticed that all empty element descriptions contain
> similar caveats for (invalid) content. I apologize for the useless question.

No worries. For what it's worth, this section may be of further interest:

   http://whatwg.org/html/#how-to-read-this-specification

It talks about this particular case, since it does seem to be unintuitive at first. You're not the first to have gotten tripped up by this.


> Maybe the "aside" is a major concern for me now. [...]

<wbr> is really constrained by legacy user agent behaviour, so there's not much we can do here. Styling should get better once browsers pick up element-based 'content', but that might take some time.
Comment 5 Ian 'Hixie' Hickson 2013-11-22 19:13:15 UTC
Marking WORKSFORME based on comment 4. Please reopen if I missed something that should still be changed.