[Webkit-unassigned] [Bug 131031] New: <pre> line-breaking (and hyphenation) rules overridden by inherited hyphenation

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 1 05:42:25 PDT 2014


           Summary: <pre> line-breaking (and hyphenation) rules overridden
                    by inherited hyphenation
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: CSS
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: matkinson at paciellogroup.com

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

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list