<?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>78594</bug_id>
          
          <creation_ts>2012-02-14 02:50:43 -0800</creation_ts>
          <short_desc>unicode-bidi:plaintext should make all-neutral paragraphs LTR</short_desc>
          <delta_ts>2022-10-04 10:52:31 -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>Text</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>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>50910</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Aharon (Vladimir) Lanin">aharon</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>eric</cc>
    
    <cc>igor.oliveira</cc>
    
    <cc>leviw</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>playmobil</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>xji</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>556166</commentid>
    <comment_count>0</comment_count>
      <attachid>126948</attachid>
    <who name="Aharon (Vladimir) Lanin">aharon</who>
    <bug_when>2012-02-14 02:50:43 -0800</bug_when>
    <thetext>Created attachment 126948
test case being submitted to W3C&apos;s HTML5 test suite

Currently, in a unicode-bidi:-webkit-plaintext element, paragraphs that contain no strongly left-to-right (bidi class L) or right-to-left (bidi class R and AL) characters default to the element&apos;s computed direction style. This is bad because it does not conform to http://www.w3.org/TR/css3-writing-modes/, which states that &quot;the base directionality of each bidi paragraph for which the element forms the containing block is determined not by the element&apos;s computed ‘direction’ as usual, but by following the heuristic in rules P2 and P3 of the Unicode bidirectional algorithm&quot;. In turn, http://unicode.org/reports/tr9/#P3 states that  &quot;if a character is found in P2 and it is of type AL or R, then set the paragraph embedding level to one; otherwise, set it to zero.&quot; Paragraph level 0 is LTR.

Gecko&apos;s implementation of unicode-bidi:plaintext suffers from the exact same problem, but they are about to fix it. See https://bugzilla.mozilla.org/show_bug.cgi?id=726420.

Please note that the exact definition of unicode-bidi:plaintext is relevant even when the element has dir=auto (which assigns unicode-bidi:plaintext by default for &lt;pre&gt; and &lt;textarea&gt;, and is probably more likely to be used than unicode-bidi:plaintext directly), even though part of the definition of dir=auto is that the element is assigned a CSS direction using the first-strong algorithm. The exact definition of still makes a difference in a case like this:

&lt;pre dir=auto&gt;
א!
--&gt;
&lt;/pre&gt;

This will result in the second line being displayed &lt;-- if unicode-bidi:plaintext for all-neutral paragraphs depends on the computed direction of the element, but it being displayed --&gt; if all-neutral paragraphs are always LTR. The test case I am attaching is elaboration of this example.

Despite all of the above, I think that there is room for &quot;fudging&quot; a little and making the direction of a completely empty (not just all-neutral) paragraph match the direction of the preceding paragraph, and if there is none, then the computed direction. The purpose of this would be just to set the alignment (when text-align is start or end) such that when typing a sequence of RTL paragraphs in a unicode-bidi:plaintext textarea, one will not initially start off with the caret on the left for each new paragraph. This little tweak will have no affect whatsoever on the display of text outside of a textarea, where the direction of an empty paragraph is a moot point. But this is just icing; the basic point of this bug is that all-neutral paragraphs should default to LTR.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>562936</commentid>
    <comment_count>1</comment_count>
    <who name="Aharon (Vladimir) Lanin">aharon</who>
    <bug_when>2012-02-23 00:54:11 -0800</bug_when>
    <thetext>Please note that the corresponding bug has now been fixed in Mozilla, see https://bugzilla.mozilla.org/show_bug.cgi?id=726420</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>987664</commentid>
    <comment_count>2</comment_count>
    <who name="Igor Trindade Oliveira">igor.oliveira</who>
    <bug_when>2014-03-06 05:53:43 -0800</bug_when>
    <thetext>Related patch in blink: https://src.chromium.org/viewvc/blink?revision=156664&amp;view=revision</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1872821</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-05-30 14:56:47 -0700</bug_when>
    <thetext>This issue is still reproducible in Safari 15.5 on macOS 12.4. All other browsers Chrome and Firefox matches each other. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1873026</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-05-31 10:22:34 -0700</bug_when>
    <thetext>&lt;rdar://problem/94161105&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1901032</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-09-25 10:40:40 -0700</bug_when>
    <thetext>I am not able to reproduce this now in Safari 16 and Safari Technology Preview 154 using attached testcase and both look same.

Is it something fixed since Safari 15.5? Can someone confirm besides myself? Thanks!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>126948</attachid>
            <date>2012-02-14 02:50:43 -0800</date>
            <delta_ts>2012-02-14 02:50:43 -0800</delta_ts>
            <desc>test case being submitted to W3C&apos;s HTML5 test suite</desc>
            <filename>dir_auto-textarea-N-between-Rs.html</filename>
            <type>text/html</type>
            <size>2519</size>
            <attacher name="Aharon (Vladimir) Lanin">aharon</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCiAgPGhlYWQ+DQogICAgPG1ldGEgY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