<?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>283765</bug_id>
          
          <creation_ts>2024-11-27 09:37:51 -0800</creation_ts>
          <short_desc>bdo element uses bidi-override instead of isolate-override</short_desc>
          <delta_ts>2024-11-29 17:24:23 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>GoodFirstBug, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Devon Govett">govett</reporter>
          <assigned_to name="Ahmad Saleem">ahmad.saleem792</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>karlcow</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2077912</commentid>
    <comment_count>0</comment_count>
    <who name="Devon Govett">govett</who>
    <bug_when>2024-11-27 09:37:51 -0800</bug_when>
    <thetext>The HTML spec says that the bdo element should use `unicode-bidi: isolate-override` (https://html.spec.whatwg.org/multipage/rendering.html#bidi-rendering), but WebKit currently applies `unicode-bidi: bidi-override` in its user agent stylesheet.

This appears to have changed in the spec around 2013: https://github.com/whatwg/html/commit/d9223afc57f2029eb49f05a1ca555e8036493227#diff-41cf6794ba4200b839c53531555f0f3998df4cbb01a4d5cb0b94e3ca5e23947d. Original spec issue: https://www.w3.org/Bugs/Public/show_bug.cgi?id=23260

Chrome and Firefox appear to match the current spec, whereas Safari does not.

This results in different rendering in some cases. See this example: https://codepen.io/devongovett/pen/XJrWxgz. In Chrome and Firefox, the order is different than in Safari.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2077913</commentid>
    <comment_count>1</comment_count>
    <who name="Devon Govett">govett</who>
    <bug_when>2024-11-27 09:43:27 -0800</bug_when>
    <thetext>For more context, here&apos;s the closed Chrome issue from 2016: https://issues.chromium.org/issues/40373362 and Firefox issue https://bugzilla.mozilla.org/show_bug.cgi?id=1249497</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2077934</commentid>
    <comment_count>2</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-11-27 13:50:53 -0800</bug_when>
    <thetext>Blink Commit - https://chromium.googlesource.com/chromium/src.git/+/549f017c96ad0e70bfce3b6a2248cbf747dde26c

^ Although this is something, we can merge but I think WebKit is actually doing better on WPT here - https://wpt.fyi/results/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters?label=master&amp;label=experimental&amp;aligned&amp;q=isolation

Safari Technology Preview 208 is passing all, we might need to do just do HTMLElement.cpp change and then update `html.css` here: https://searchfox.org/wubkat/rev/795fdaece398b18bdefcd3954e0da2312ca92ee9/Source/WebCore/css/html.css#1433 aligned with web specification: https://html.spec.whatwg.org/#bidi-rendering

bdo, bdo[dir] { unicode-bidi: isolate-override; } 

rather than

bdo {
    unicode-bidi: bidi-override;
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2077935</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-11-27 13:57:48 -0800</bug_when>
    <thetext>Actually HTMLElement.cpp change from Blink is already done. So it might be just updating `html.css` only.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2077936</commentid>
    <comment_count>4</comment_count>
    <who name="Devon Govett">govett</who>
    <bug_when>2024-11-27 14:00:17 -0800</bug_when>
    <thetext>That seems right to me. Adding that css snippet into the codepen example above makes the Safari result match Chrome and Firefox.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2078065</commentid>
    <comment_count>5</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-11-28 08:07:42 -0800</bug_when>
    <thetext>&lt;rdar://problem/140662417&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2078066</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-11-28 08:14:41 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/37228</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2078235</commentid>
    <comment_count>7</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-11-29 17:24:21 -0800</bug_when>
    <thetext>Committed 287175@main (1bf83c07887e): &lt;https://commits.webkit.org/287175@main&gt;

Reviewed commits have been landed. Closing PR #37228 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>