<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>131031</bug_id>
          
          <creation_ts>2014-04-01 05:42:44 -0700</creation_ts>
          <short_desc>&lt;pre&gt; line-breaking (and hyphenation) rules overridden by inherited hyphenation</short_desc>
          <delta_ts>2022-07-13 17:13:41 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Matthew Tylee Atkinson">matkinson</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>996237</commentid>
    <comment_count>0</comment_count>
    <who name="Matthew Tylee Atkinson">matkinson</who>
    <bug_when>2014-04-01 05:42:44 -0700</bug_when>
    <thetext>Convention amongst browsers is that the &lt;pre&gt; 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 &lt;body&gt;, it should not be applied to the &lt;pre&gt; element unless the user has explicitly styled the &lt;pre&gt; 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&apos;s OK.

// Test Case (attached)

The following browsers didn&apos;t wrap or hyphenate the contents of the &lt;pre&gt;.

 * IE 11
 * Firefox 28
 * Chrome 33

In the following browsers, wrapping and hyphenation inside the &lt;pre&gt; occurred.

 * WebKit Nightly r166560 (2014-04-01)
 * Safari 7.0.2
 * Safari on iOS 7.1

// Expected Outcomes

1. The &lt;pre&gt; element should not introduce line-breaks as a result of hyphenation being set on a parent element.

2. The &lt;pre&gt; element should ignore hyphenation set on a parent element.

// Justification for desired behaviour

Why ignore an inherited hyphenation style?  Because &lt;pre&gt; is meant to contain &quot;preformatted text&quot; 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 &apos;&lt;pre&gt;&lt;code&gt;...&apos; 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>996239</commentid>
    <comment_count>1</comment_count>
      <attachid>228276</attachid>
    <who name="Matthew Tylee Atkinson">matkinson</who>
    <bug_when>2014-04-01 05:43:23 -0700</bug_when>
    <thetext>Created attachment 228276
test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1883476</commentid>
    <comment_count>2</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2022-07-13 17:13:41 -0700</bug_when>
    <thetext>Safari, Chrome, and Firefox all agree on rendering for this test case. I don&apos;t believe there is any remaining compatibility issue.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>228276</attachid>
            <date>2014-04-01 05:43:23 -0700</date>
            <delta_ts>2014-04-01 05:43:23 -0700</delta_ts>
            <desc>test case</desc>
            <filename>hyphenation-test.html</filename>
            <type>text/html</type>
            <size>439</size>
            <attacher name="Matthew Tylee Atkinson">matkinson</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgogIDxoZWFkPgogICAgPHRpdGxlPkh5cGhlbmF0aW9uIFRl
c3Q8L3RpdGxlPgogICAgPHN0eWxlPgogICAgICBib2R5IHsKICAgICAgICAtd2Via2l0LWh5cGhl
bnM6IGF1dG87CiAgICAgICAgLW1vei1oeXBoZW5zOiBhdXRvOwogICAgICAgIC1tcy1oeXBoZW5z
OiBhdXRvOwogICAgICAgIC1vLWh5cGhlbnM6IGF1dG87CiAgICAgICAgaHlwaGVuczogYXV0bzsK
ICAgICAgfQogICAgPC9zdHlsZT4KICA8L2hlYWQ+CiAgPGJvZHk+CiAgICA8cHJlPkh5cGhlbmF0
aW9uIG9uIHRoZSBib2R5IGVsZW1lbnQgc2hvdWxkIG5vdCBiZSBhcHBsaWVkIGluc2lkZSBoZXJl
LCBhcyB3aGl0ZXNwYWNlIHNob3VsZCBiZSBwcmVzZXJ2ZWQsIGFuZCBjaGFyYWN0ZXJzIHNob3Vs
ZCBub3QgYmUgYWRkZWQuPC9wcmU+CiAgPC9ib2R5Pgo8L2h0bWw+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>