WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
131031
<pre> line-breaking (and hyphenation) rules overridden by inherited hyphenation
https://bugs.webkit.org/show_bug.cgi?id=131031
Summary
<pre> line-breaking (and hyphenation) rules overridden by inherited hyphenation
Matthew Tylee Atkinson
Reported
2014-04-01 05:42:44 PDT
Convention amongst browsers is that the <pre> element should not have any line wrapping by default, and browsers should not add any extra characters to its contents. Even if hyphenation is set on the <body>, it should not be applied to the <pre> element unless the user has explicitly styled the <pre> element (justification for this can be found below). This appears to be related to
bug 67770
--
https://bugs.webkit.org/show_bug.cgi?id=67770
-- but is not quite the same situation (the applicable CSS is different), hence I am reporting it as a separate bug; hope that's OK. // Test Case (attached) The following browsers didn't wrap or hyphenate the contents of the <pre>. * IE 11 * Firefox 28 * Chrome 33 In the following browsers, wrapping and hyphenation inside the <pre> occurred. * WebKit Nightly
r166560
(2014-04-01) * Safari 7.0.2 * Safari on iOS 7.1 // Expected Outcomes 1. The <pre> element should not introduce line-breaks as a result of hyphenation being set on a parent element. 2. The <pre> element should ignore hyphenation set on a parent element. // Justification for desired behaviour Why ignore an inherited hyphenation style? Because <pre> is meant to contain "preformatted text" according to the spec [1], which implies no further formatting is desired on the part of the content author. This also applies to line-breaks, as '<pre><code>...' is often used for computer code samples, whose authors expect that code could be copied and pasted from the browser; extra line-breaks would cause code errors in some cases. The spec also cites examples of ASCII art and free-form poetry, which would be affected similarly. [1]
http://www.w3.org/TR/html/grouping-content.html#the-pre-element
Attachments
test case
(439 bytes, text/html)
2014-04-01 05:43 PDT
,
Matthew Tylee Atkinson
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Matthew Tylee Atkinson
Comment 1
2014-04-01 05:43:23 PDT
Created
attachment 228276
[details]
test case
Brent Fulgham
Comment 2
2022-07-13 17:13:41 PDT
Safari, Chrome, and Firefox all agree on rendering for this test case. I don't believe there is any remaining compatibility issue.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug