<?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>201110</bug_id>
          
          <creation_ts>2019-08-23 17:48:26 -0700</creation_ts>
          <short_desc>&lt;foreignObject&gt; root element should be a stacking context</short_desc>
          <delta_ts>2019-12-22 14:02:15 -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>SVG</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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>
          
          <blocked>200143</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Said Abou-Hallawa">sabouhallawa</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>minhtranite</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1564730</commentid>
    <comment_count>0</comment_count>
      <attachid>377187</attachid>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2019-08-23 17:48:26 -0700</bug_when>
    <thetext>Created attachment 377187
test case

Open the attached test case:

Result: The light gray box is drawn underneath the other two rectangles.
Expected: The light gray box should be drawn on top of the other two rectangles.

The test case has an SVG which contains a &lt;foreignObject&gt;. This &lt;foreignObject&gt; has two &lt;div&gt; elements whose z indices are 1 and 2. The order of drawing these two rectangles is correct. The problem is the &lt;foreignObject&gt; should be a stacking context which means the z order of its elements should not interfere with the oder of the other elements outside the &lt;svg&gt; element. The SVG should be at the end drawn as one layer with the z-index of the &lt;svg&gt; element. In this test case, the z-index of the &lt;svg&gt; element is 0. Since the light gray &lt;div&gt; has also z-index = 0 but it comes after &lt;svg&gt; element, it should be drawn on top of the SVG.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1564732</commentid>
    <comment_count>1</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2019-08-23 17:49:44 -0700</bug_when>
    <thetext>Related failed WPT test:

https://wpt.fyi/results/svg/extensibility/foreignObject/stacking-context.html?label=master&amp;label=experimental&amp;aligned</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>377187</attachid>
            <date>2019-08-23 17:48:26 -0700</date>
            <delta_ts>2019-08-23 17:48:26 -0700</delta_ts>
            <desc>test case</desc>
            <filename>test005.html</filename>
            <type>text/html</type>
            <size>669</size>
            <attacher name="Said Abou-Hallawa">sabouhallawa</attacher>
            
              <data encoding="base64">PHN0eWxlPgogICAgKiB7CiAgICAgICAgbWFyZ2luOiAwOwogICAgfQogICAgLmJveCB7CiAgICAg
ICAgd2lkdGg6IDEwMHB4OwogICAgICAgIGhlaWdodDogMTAwcHg7CiAgICAgICAgYm9yZGVyOiAx
cHggc29saWQgYmxhY2s7CiAgICB9Cjwvc3R5bGU+Cjxib2R5PgogICAgPHN2ZyBzdHlsZT0id2lk
dGg6IDIwMHB4OyBoZWlnaHQ6IDIwMHB4OyBvdmVyZmxvdzogdmlzaWJsZTsgZGlzcGxheTogYmxv
Y2siPgogICAgICAgIDxmb3JlaWduT2JqZWN0IHdpZHRoPTIwMCBoZWlnaHQ9MjAwPgogICAgICAg
ICAgICA8ZGl2IGNsYXNzPSJib3giIHN0eWxlPSJwb3NpdGlvbjogYWJzb2x1dGU7IHotaW5kZXg6
IDE7IHRvcDogNDBweDsgbGVmdDogNDBweDsgYmFja2dyb3VuZDogbGlnaHRibHVlOyI+PC9kaXY+
CiAgICAgICAgICAgIDxkaXYgY2xhc3M9ImJveCIgc3R5bGU9InBvc2l0aW9uOiBhYnNvbHV0ZTsg
ei1pbmRleDogMjsgdG9wOiAyMHB4OyBsZWZ0OiAyMHB4OyBiYWNrZ3JvdW5kOiBsaWdodGdyZWVu
OyI+PC9kaXY+CiAgICAgICAgPC9mb3JlaWduT2JqZWN0PgogICAgPC9zdmc+CiAgICA8ZGl2IGNs
YXNzPSJib3giIHN0eWxlPSJwb3NpdGlvbjogYWJzb2x1dGU7IHRvcDogNjBweDsgbGVmdDogNjBw
eDsgIGJhY2tncm91bmQ6IGxpZ2h0Z3JheTsiPjwvZGl2Pgo8L2JvZHk+
</data>

          </attachment>
      

    </bug>

</bugzilla>