<?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>277862</bug_id>
          
          <creation_ts>2024-08-09 10:10:28 -0700</creation_ts>
          <short_desc>[Text Directionality] Fix directionality for shadow tree</short_desc>
          <delta_ts>2024-08-26 21:46:46 -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>DOM</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=278698</see_also>
          <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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Said Abou-Hallawa">sabouhallawa</reporter>
          <assigned_to name="Said Abou-Hallawa">sabouhallawa</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2051677</commentid>
    <comment_count>0</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2024-08-09 10:10:28 -0700</bug_when>
    <thetext>https://wpt.fyi/html/dom/elements/global-attributes/dir-shadow-06.html
https://wpt.fyi/html/dom/elements/global-attributes/dir-shadow-36.html
https://wpt.fyi/html/dom/elements/global-attributes/dir-shadow-38.html
https://wpt.fyi/html/dom/elements/global-attributes/dir-shadow-39.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2051678</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2024-08-09 10:10:50 -0700</bug_when>
    <thetext>&lt;rdar://problem/133549820&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2051735</commentid>
    <comment_count>2</comment_count>
      <attachid>472104</attachid>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2024-08-09 12:33:00 -0700</bug_when>
    <thetext>Created attachment 472104
test case

I am attaching a test case. It contains two host &lt;div&gt; elements. Both hosts have &lt;p&gt; elements with Arabic text and undefined dir property. We insert a `&lt;slot dir=&quot;auto&quot;&gt;&lt;/slot&gt;` in the shadow tree of the first &lt;div&gt; host. This will add the first child of this host as a slotted element to `&lt;slot&gt;` element which is the &lt;p&gt; element.

According to the specs if the dir property is &quot;undefined&quot;: Return the parent directionality of element.

So I am not sure what the parent of the first &lt;p&gt; should be.
Should it be its host &lt;div&gt; which also has undefined dir property?
Or should it be the &lt;slot&gt; element which has dir=&quot;auto&quot;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2054197</commentid>
    <comment_count>3</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2024-08-20 13:39:52 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/32482</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2054872</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2024-08-22 21:16:23 -0700</bug_when>
    <thetext>Committed 282648@main (b6ee5d981582): &lt;https://commits.webkit.org/282648@main&gt;

Reviewed commits have been landed. Closing PR #32482 and removing active labels.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>472104</attachid>
            <date>2024-08-09 12:33:00 -0700</date>
            <delta_ts>2024-08-09 12:33:00 -0700</delta_ts>
            <desc>test case</desc>
            <filename>dir-shadow-06.html</filename>
            <type>text/html</type>
            <size>1286</size>
            <attacher name="Said Abou-Hallawa">sabouhallawa</attacher>
            
              <data encoding="base64">PHN0eWxlPgogICAgYm9keSB7CiAgICAgICAgd2lkdGg6IDYwMHB4OwogICAgfQogICAgZGl2IHsK
ICAgICAgICBib3JkZXI6IDFweCBzb2xpZCBncmF5OwogICAgICAgIG1hcmdpbjogMWVtOwogICAg
fQogICAgZGl2IHAgewogICAgICAgIHdpZHRoOiA1MCU7CiAgICAgICAgYm9yZGVyOiAxcHggZG90
dGVkOwogICAgfQo8L3N0eWxlPgo8Ym9keT4KICAgIDxwPmBkaXI9YXV0b2Agb24gdGhlICZsdDtz
bG90Jmd0OywgcGFyYWdyYXBoIGluIHRoZSBsaWdodCB0cmVlPC9wPgogICAgPGRpdiBpZD0iaG9z
dDEiPjxwPiYjMTU3NTsmIzE1ODI7JiMxNTc4OyYjMTU3NjsmIzE1ODU7LjwvcD48L2Rpdj4KICAg
IDxkaXYgaWQ9Imhvc3QyIj48cD4mIzE1NzU7JiMxNTgyOyYjMTU3ODsmIzE1NzY7JiMxNTg1Oy48
L3A+PC9kaXY+CiAgICA8cCBpZD0icmVzdWx0MSI+VGhlIEhUTUwgZGlyZWN0aW9uIC8gY29tcHV0
ZWQgQ1NTIGBkaXJlY3Rpb25gIHZhbHVlIGZvciBwYXJhZ3JhcGggMSBpczogPC9wPgogICAgPHAg
aWQ9InJlc3VsdDIiPlRoZSBIVE1MIGRpcmVjdGlvbiAvIGNvbXB1dGVkIENTUyBgZGlyZWN0aW9u
YCB2YWx1ZSBmb3IgcGFyYWdyYXBoIDIgaXM6IDwvcD4KCiAgICA8c2NyaXB0PgogICAgICAgIGZ1
bmN0aW9uIGh0bWxfZGlyZWN0aW9uKGVsZW1lbnQpIHsKICAgICAgICAgICAgbGV0IGlzX2x0ciA9
IGVsZW1lbnQubWF0Y2hlcygiOmRpcihsdHIpIik7CiAgICAgICAgICAgIGxldCBpc19ydGwgPSBl
bGVtZW50Lm1hdGNoZXMoIjpkaXIocnRsKSIpOwogICAgICAgICAgICBpZiAoaXNfbHRyID09IGlz
X3J0bCkgewogICAgICAgICAgICAgICAgcmV0dXJuICJlcnJvciI7CiAgICAgICAgICAgIH0KICAg
ICAgICAgICAgcmV0dXJuIGlzX2x0ciA/ICJsdHIiIDogInJ0bCI7CiAgICAgICAgfQoKICAgICAg
ICBsZXQgcm9vdDEgPSBob3N0MS5hdHRhY2hTaGFkb3coe21vZGU6Im9wZW4ifSk7CiAgICAgICAg
cm9vdDEuaW5uZXJIVE1MID0gYDxzbG90IGRpcj0iYXV0byI+PC9zbG90PmA7CgogICAgICAgIHJl
c3VsdDEuaW5uZXJIVE1MICs9IGh0bWxfZGlyZWN0aW9uKGhvc3QxLmZpcnN0Q2hpbGQpICsgIiAv
ICIgKyBnZXRDb21wdXRlZFN0eWxlKGhvc3QxLmZpcnN0Q2hpbGQpLmRpcmVjdGlvbiArICcuJzsK
ICAgICAgICByZXN1bHQyLmlubmVySFRNTCArPSBodG1sX2RpcmVjdGlvbihob3N0Mi5maXJzdENo
aWxkKSArICIgLyAiICsgZ2V0Q29tcHV0ZWRTdHlsZShob3N0Mi5maXJzdENoaWxkKS5kaXJlY3Rp
b24gKyAnLic7CiAgICA8L3NjcmlwdD4KPC9ib2R5Pgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>