<?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>163592</bug_id>
          
          <creation_ts>2016-10-18 01:48:41 -0700</creation_ts>
          <short_desc>Shadow hosts aren&apos;t automatically containing blocks for positioned descendants</short_desc>
          <delta_ts>2017-07-25 17:05:39 -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>Layout and Rendering</component>
          <version>Safari 10</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Antoine Quint">graouts</reporter>
          <assigned_to name="Antoine Quint">graouts</assigned_to>
          <cc>ap</cc>
    
    <cc>graouts</cc>
    
    <cc>koivisto</cc>
    
    <cc>rniwa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1241384</commentid>
    <comment_count>0</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2016-10-18 01:48:41 -0700</bug_when>
    <thetext>As of http://trac.webkit.org/changeset/207436, turning on the Development &gt; Experimental Features &gt; Modern Media Controls flag will use a different codebase for media controls. While it&apos;s limited in terms of feature right now (more patches are going to land throughout the week), it has the basic functionality of showing a play button over a &lt;video&gt; element on macOS and allowing for that button to be clicked to show a whole set of controls laid out in a controls bar at the bottom of the video as it starts playing. Right now, the initial play displays correctly, but once clicked the controls bar doesn&apos;t appear. Showing the Web Inspector makes the controls bar render correctly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1241386</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2016-10-18 01:49:32 -0700</bug_when>
    <thetext>&lt;rdar://problem/28820129&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1241387</commentid>
    <comment_count>2</comment_count>
      <attachid>291933</attachid>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2016-10-18 02:19:30 -0700</bug_when>
    <thetext>Created attachment 291933
Testcase</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1241436</commentid>
    <comment_count>3</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2016-10-18 08:06:23 -0700</bug_when>
    <thetext>--- Source/WebCore/Modules/modern-media-controls/controls/media-controls.css	(revision 207457)
+++ Source/WebCore/Modules/modern-media-controls/controls/media-controls.css	(working copy)
@@ -23,7 +23,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-.media-controls,
+.media-controls {
+    position: relative;
+}
 .media-controls &gt; .controls-bar {
     position: absolute;

makes them show up</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1241458</commentid>
    <comment_count>4</comment_count>
      <attachid>291950</attachid>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2016-10-18 09:34:15 -0700</bug_when>
    <thetext>Created attachment 291950
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1241462</commentid>
    <comment_count>5</comment_count>
      <attachid>291950</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2016-10-18 09:52:21 -0700</bug_when>
    <thetext>Comment on attachment 291950
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=291950&amp;action=review

&gt; Source/WebCore/ChangeLog:12
&gt; +        instead, which removes the rendering issues.

What bug tracks fixing the root cause?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1241466</commentid>
    <comment_count>6</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2016-10-18 10:04:10 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; Comment on attachment 291950 [details]
&gt; Patch
&gt; 
&gt; View in context:
&gt; https://bugs.webkit.org/attachment.cgi?id=291950&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/ChangeLog:12
&gt; &gt; +        instead, which removes the rendering issues.
&gt; 
&gt; What bug tracks fixing the root cause?

I suppose this should be kept as the bug tracking the original issue. I doubt it&apos;ll get fixed once we have a workaround though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1241485</commentid>
    <comment_count>7</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2016-10-18 10:30:00 -0700</bug_when>
    <thetext>Root cause appears to be in RenderImage (where RenderMedia inherits it). Since position:absolute makes little sense in UA shadow tree root element I don&apos;t think there is any particular desire to fix this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1241488</commentid>
    <comment_count>8</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2016-10-18 10:35:33 -0700</bug_when>
    <thetext>Not that I&apos;m stopping anyone.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1241493</commentid>
    <comment_count>9</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2016-10-18 10:41:51 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; Root cause appears to be in RenderImage (where RenderMedia inherits it).
&gt; Since position:absolute makes little sense in UA shadow tree root element I
&gt; don&apos;t think there is any particular desire to fix this.

What about RenderImage?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1241498</commentid>
    <comment_count>10</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2016-10-18 10:48:45 -0700</bug_when>
    <thetext>&gt; What about RenderImage?

What about it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1241500</commentid>
    <comment_count>11</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2016-10-18 10:50:27 -0700</bug_when>
    <thetext>You say &quot;Root cause appears to be in RenderImage&quot; but don&apos;t explain what it is.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1241501</commentid>
    <comment_count>12</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2016-10-18 10:54:30 -0700</bug_when>
    <thetext>The issue is about UA shadow trees of renderers derived from RenderImage using absolute positioning in their shadows.

This is what I said in a mail about this

&quot;The problem appears to be that you are using absolute positioned container as the rendering root of your shadow tree. Absolute positioning inside shadow trees works the same as it does outside so your controls end up being relative to the body, not &lt;video&gt;. Not sure why it doesn’t show up at all, maybe something to do with the wackiness of RenderImage::layoutShadowControls.&quot;

and

&quot;I’m not sure I would even call it a workaround. Using absolute positioning in the root of a shadow tree is strange since the host element is not going to be your containing block. It is very easy to get such shadow to render outside the host (for example left:0px top:0px will put it to the top left corner of the document).&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1241524</commentid>
    <comment_count>13</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2016-10-18 11:39:15 -0700</bug_when>
    <thetext>Yes, it doesn&apos;t seem to make sense indeed. Can an assertion be added to catch trying to do this in UA shadow trees?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1241527</commentid>
    <comment_count>14</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2016-10-18 11:41:36 -0700</bug_when>
    <thetext>Should the spec say that shadow roots always have position: relative (or words about acting as containing block and/or stacking context)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1241536</commentid>
    <comment_count>15</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2016-10-18 12:06:01 -0700</bug_when>
    <thetext>(In reply to comment #14)
&gt; Should the spec say that shadow roots always have position: relative (or
&gt; words about acting as containing block and/or stacking context)?

Shadow roots have no rendering at all. Children of shadow root act like direct children of the host. The host can be also be inline.

I&apos;m not sure there is problem to solve as position:relative should generally give you what you want and position:absolute behavior is still consistent (bugs in special-renderer UA shadow trees notwithstanding).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1241594</commentid>
    <comment_count>16</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2016-10-18 13:40:01 -0700</bug_when>
    <thetext>(In reply to comment #14)
&gt; Should the spec say that shadow roots always have position: relative (or
&gt; words about acting as containing block and/or stacking context)?

There was a discussion to use display: block as the default styling for shadow roots:
https://github.com/w3c/webcomponents/issues/426</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1241597</commentid>
    <comment_count>17</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2016-10-18 13:41:58 -0700</bug_when>
    <thetext>The current discussion hinges on adding a &quot;lightweight&quot; way to style custom elements: https://github.com/w3c/webcomponents/issues/468</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1241632</commentid>
    <comment_count>18</comment_count>
    <who name="Antti Koivisto">koivisto</who>
    <bug_when>2016-10-18 14:59:47 -0700</bug_when>
    <thetext>&gt; There was a discussion to use display: block as the default styling for
&gt; shadow roots:

Shadow hosts. And this wouldn&apos;t be useful here as the host is a replaced inline element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1332170</commentid>
    <comment_count>19</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2017-07-25 17:05:39 -0700</bug_when>
    <thetext>The current behavior matches the spec. We need to modify the host&apos;s style in order to do this, and nobody wanted attaching a shadow root to have that kind of side-effect in style.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>291933</attachid>
            <date>2016-10-18 02:19:30 -0700</date>
            <delta_ts>2016-10-18 02:19:30 -0700</delta_ts>
            <desc>Testcase</desc>
            <filename>simple-video.html</filename>
            <type>text/html</type>
            <size>230</size>
            <attacher name="Antoine Quint">graouts</attacher>
            
              <data encoding="base64">PHZpZGVvIHNyYz0iaHR0cDovL21vdmlldHJhaWxlcnMuYXBwbGUuY29tL21vdmllcy9kaXNuZXkv
aW5zaWRlb3V0L2luc2lkZW91dC11c2NhLXRscjJfNDgwcC5tb3YiIHBvc3Rlcj0iaHR0cDovL3Ry
YWlsZXJzLmFwcGxlLmNvbS90cmFpbGVycy9kaXNuZXkvaW5zaWRlb3V0L2ltYWdlcy90aHVtYm5h
aWxfc291cmNlXzIxMDAxLmpwZyIgc3R5bGU9IndpZHRoOiA4NDhweCIgY29udHJvbHM+PC92aWRl
bz4=
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>291950</attachid>
            <date>2016-10-18 09:34:15 -0700</date>
            <delta_ts>2016-10-18 10:20:49 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-163592-20161018183040.patch</filename>
            <type>text/plain</type>
            <size>1738</size>
            <attacher name="Antoine Quint">graouts</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjA3NDY0CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggOWRmYmY2Yzc5ZGYwZTQ0
MzI3YmM2MGE3ZjgxNmI1MmEyNzc4MTQyOS4uNTZmYjk0NjUyZTQzYmE3MjQ2MzdhYmIyZTZkNzYw
OWE1NTQ5NzM5ZSAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDIwIEBACisyMDE2LTEwLTE4ICBBbnRv
aW5lIFF1aW50ICA8Z3Jhb3V0c0BhcHBsZS5jb20+CisKKyAgICAgICAgTW9kZXJuIG1lZGlhI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