connect.microsoft.com - Description text is chopped off [msft ref# 1965342]
URL: https://connect.microsoft.com/IE/Feedback/Details/1168255 Browser / Version: Firefox 36.0 Operating System: Mac OS X 10.10 Problem type: Looks like the website has a bug. Site owner: No
Steps to Reproduce
- Navigate to: https://connect.microsoft.com/IE/Feedback/Details/1168255
- Look at the text below the "Description" heading (it starts with "Most Microsoft, Mac,")
Expected Behavior: Should be able to read the entire Description text Actual Behavior: Description text is chopped off partway through and the field can't be scrolled either, so it's impossible to read the rest of it
Thanks @onlyusesphp
- First of all the viewport is large: 958px in all browsers. It doesn't resize with smaller viewports.
- The text is contained in a pre element, itself wrapped in a
spanelement :japanese_ogre:
<span class="FeedbackDetailsDescriptionText">
<pre>Most Microsoft, …</pre>
</span>
the pre has
pre {
color: rgb(51, 51, 51);
font-family: "Segoe UI";
word-wrap: break-word;
}
The CSS will not be effective on pre because by default at the browser level, pre is defined with:
xmp, pre, plaintext {
display: block;
font-family: -moz-fixed;
white-space: pre;
margin: 1em 0;
}
if locally the pre was made as white-space: normal, that would work.
All of that said is it really a bug of the CSS or someone who used a pre here when they should not have?
cc @TheWebJustWorks
Some variety in between browsers. To note that word-wrap: break-word; in blink takes precedence over white-space: pre;.
To note that
word-wrap: break-word;in blink takes precedence overwhite-space: pre;.
@dholbert do you have an opinion on that?
This is a Blink bug. Gecko is correct to ignore word-wrap on elements with white-space:pre.
Both properties are defined in http://dev.w3.org/csswg/css-text-3/ . The word-wrap spec-text there explicitly says:
It only has an effect when
white-spaceallows wrapping
http://dev.w3.org/csswg/css-text-3/#overflow-wrap-property
And the pre value for white-space does not allow wrapping. (This is particularly explicit in the definition of white-space:nowrap, which says:
like
pre, it does not allow wrapping.
http://dev.w3.org/csswg/css-text-3/#propdef-white-space
If someone wants a <pre> element that allows wrapping (as is the case here), they should give it white-space:pre-wrap. I can fix the original URL here by adding white-space:pre-wrap to the
element, using Firefox's devtools.That's the correct fix here, I think, on the site side.
Looks like I filed a Blink bug for this issue already, last year: https://code.google.com/p/chromium/issues/detail?id=373502
And there's a WebKit bug on this that's been open since 2010: https://bugs.webkit.org/show_bug.cgi?id=38222
~~Since this is a M$ site, I'm guessing IE has the same incorrect behavior as Blink? (I don't have a Windows machine to test myself.)~~
Edit: Ah, yeah, apparently IE matches Chrome. Any IE bug report for that?
Not that I'm aware of. Would you be up for filing one?
Thanks, I filed one!
thanks for reporting! we have a bug filed (as mentioned by @gregwhitworth) and are investigating whether we could change our behavior or push FF and the spec to change.
Note that the spec seems to have changed radically to the point where nothing much is defined in the editor's draft :) http://dev.w3.org/csswg/css-text-4/ version 4
In version 3 http://dev.w3.org/csswg/css-text-3/#white-space-property I read for white-space: pre:
This value prevents user agents from collapsing sequences of white space. Segment breaks such as line feeds and carriage returns are preserved as forced line breaks. Lines only break at forced line breaks; content that does not fit within the block container overflows it.
The summary table is quite clear. There is an additional property for wrapping in a pre element: pre-wrap
Note that the spec seems to have changed radically [...] version 4
To be clear, that's a different spec - the (apparently very early-stages) css-text "level 4" spec. (It's not "version 4" in the sense of replacing "version 3" -- instead, it builds on level 3.)
Quoting the CSS level definition: "Each level of CSS builds on the previous, refining definitions and adding features". So we can expect the final css-text-4 to be reasonably backwards-compatible with css-text-3.
This is a Blink bug. Gecko is correct to ignore word-wrap on elements with white-space:pre.
Both properties are defined in http://dev.w3.org/csswg/css-text-3/ . The word-wrap spec-text there explicitly says:
It only has an effect when white-space allows wrapping
http://dev.w3.org/csswg/css-text-3/#overflow-wrap-property
And the pre value for white-space does not allow wrapping. (This is particularly explicit in the definition of white-space:nowrap, which says:
like pre, it does not allow wrapping.
http://dev.w3.org/csswg/css-text-3/#propdef-white-space
@TheWebJustWorks Cool for the clarifications.
So I guess back to contacting Connect Web site, would you do that? :) thanks.
yep:) thanks @karlcow !
Still an issue ;)
@TheWebJustWorks ping ping ;)
I'm reading through the comments and trying to understand the call to action for Connect. Does this occur on Chrome as well? The correct behavior is only seen in Firefox?
@cew6992 Connect currently uses both word-wrap: break-word and white-space: pre, which is not a sensical combination. The CSS Text spec says that word-wrap should be ignored when white-space is pre (among other cases).
To address this, https://github.com/webcompat/web-bugs/issues/773#issuecomment-77808500 suggests that Connect switch from white-space: pre to white-space:pre-wrap.
I guess an alternate approach could be to make the <pre> horizontally scrollable.
Firefox obeys the CSS Text spec, which with Connect's current CSS, causes the text to not wrap, which is undesirable. Chrome & IE don't currently obey the CSS Text spec, which with Connect's current CSS, causes the text to wrap, which is desirable.
We've followed up with the connect.microsoft.com team and asked them to update this thread.
Not fixed as of today