-
Notifications
You must be signed in to change notification settings - Fork 707
[css-display] Display values for <br> and <wbr> #610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Further discussion at https://lists.w3.org/Archives/Public/www-style/2016Mar/0378.html and https://lists.w3.org/Archives/Public/www-style/2016Mar/0379.html Note that the Web platform specs have had a longstanding tradition that the behavior in a spec is required, but the specific algorithms used to implement it are not. It is entirely possible for the CSS and HTML specs to describe |
The CSSWG concluded that we are not adding new display types for
should be enough to implement this in the HTML spec. |
As mentioned in #610 (comment), a remaining issue is that the content property does not normally apply to elements; it only works on pseudo elements. However, the suggested UA stylesheet uses that. So how does it work? |
I don't think #610 (comment) is an accurate reflection of the WG discussion, key excerpts of which were:
(Yes, @fantasai proposed an alternative in the [...] bit, but I don't think we accepted that in the resolution.) |
Er, I guess I got confused -- I suppose it is basically equivalent, although the description above is much less clear that implementations are allowed (perhaps even expected) to have a different implementation. However, it only works under the assumption that it's actually true that no CSS properties apply -- except I'm not sure it is. |
@frivoal The content property applies to elements in Level 3, no? |
It does for now, but that spec “is a very rough draft, and is not ready for implementation” (cf its status section). By the time it matures, I expect it will no longer allow it, at least not without some syntax shenanigans, because of a major web compat problem. The problem is that lots of sites who meant to write this something like this .clearfix::after {
content: ".";
visibility: hidden;
display: block;
clear: both;
height: 0;
} would instead write: .clearfix {
content: ".";
visibility: hidden;
display: block;
clear: both;
height: 0;
} Same thing without the If we were to make I believe presto-based opera actually tried, and rolled it back because of that. I have not checked recently if that was still true, but I would be surprised if it had gone away. That would be a good surprise, but a surprise still. |
We actually explicitly resolved to not allow |
|
|
Here.
Any further problems? |
Given that existing browsers do not let authors set the content property on I guess the only potentially observable differences between this and and “ |
Further problem is that |
|
Correct, it's rendered "magically" with equivalent effects to that code. Use |
As I said above, the problem with soft hyphen is that it behaves erratically when text is copypasted. It might be turned into a hyphen, or generate a mojibake. That's why I hoped |
The technique will still work if you use an element other than |
No, it cannot be used. I use for three years Before write an official definition of stylesheet of BTW. https://stackoverflow.com/questions/7596647/ignore-br-with-css |
wbr::before and the same for br, does not work for me in Chrome. As it does not work for img. |
https://bugs.webkit.org/show_bug.cgi?id=208646 <rdar://problem/60086589> Reviewed by Antti Koivisto. Source/WebCore: Test: fast/inline/out-of-flow-positioned-line-break.html We need to treat line breaks as statically positioned inline content. In the long run we should do something along these lines: w3c/csswg-drafts#610 * layout/integration/LayoutIntegrationBoxTree.cpp: (WebCore::LayoutIntegration::BoxTree::buildTree): LayoutTests: * fast/inline/out-of-flow-positioned-line-break-expected.txt: Added. * fast/inline/out-of-flow-positioned-line-break.html: Added. Canonical link: https://commits.webkit.org/221559@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257928 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Further reading on this issue: - w3c/csswg-drafts#610 - whatwg/html#2298 - https://stackoverflow.com/a/45143493/4633524 To test the native behavior of <br> in and out of a flexbox: https://jsfiddle.net/jko4fh9y/
Further reading on this issue: - w3c/csswg-drafts#610 - whatwg/html#2298 - https://stackoverflow.com/a/45143493/4633524 To test the native behavior of <br> in and out of a flexbox: https://jsfiddle.net/jko4fh9y/
display-outside values
<br>
and<wbr>
elements were originally meant to be rendered according to acontent
property. That was first changed for<br>
, probably becausecontent
is not optimized for performance. Nor was that property usable with::after
for legacy reasons: it could break those pages usingbr::after
, because authors' rule would override the line break instead of adding something to it. The pseudo-element could have been used for<wbr>
, though.On September 2014, when
<br>
had been turned intodisplay-outside: newline
since at least two months, it was decided that<wbr>
could become something similar: and thusdisplay-outside: break-opportunity
was born.Two years have passed and still there's no trace of either display value. Googling it out, I noticed that it was discussed briefly on Feb 23, 2015 (one year and a half ago), when performance considerations were the only obstacle to reverting both elements back to the
content
scenario (and as of now content apparently applies to real elements only with image and URL values - which is not sure either).Now I'd like to ask you a couple of questions:
display-outside
solution deemed not viable, despite the fact that browser vendors would have preferred such a solution? What are the considerations against it?content: <string>
applies to at least a subset of HTML elements and how bad would the performance impact be?<br>
(and possibly<wbr>
)?Related issue: w3c/html#586
The text was updated successfully, but these errors were encountered: