<?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>58684</bug_id>
          
          <creation_ts>2011-04-15 13:02:47 -0700</creation_ts>
          <short_desc>REGRESSION: CSS leaks in shadow DOM</short_desc>
          <delta_ts>2011-04-17 07:13:34 -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>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>OS X 10.6</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>52917</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Marc Hoyois">marc.hoyois</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>dglazkov</cc>
    
    <cc>eric.carlson</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>386857</commentid>
    <comment_count>0</comment_count>
    <who name="Marc Hoyois">marc.hoyois</who>
    <bug_when>2011-04-15 13:02:47 -0700</bug_when>
    <thetext>Overview:
CSS selectors apply to shadow DOM elements that should only be targetable using pseudo-elements.
For example, if a pseudo-element is a &lt;div&gt; in the shadow DOM, then any rule in div { … } will apply to it.

Steps to reproduce:
Open the attached HTML page. It contains a simple &lt;video&gt; element and two CSS selectors, div and input.

Expected result:
The video element should look as it does in Safari 5.0.5.

Actual result:
Buttons in the video controls are replaced by red backgrounds, and the font-size of text in the controls is 30px.

Build:
Tested with WebKit 6533.21.1, r83831 on OS X 10.6.7. Works fine in Safari 5.0.5.
I have heard that the bug also happens in Safari 5.1.

Notes:
The shadow DOM of the video controls in this example is

&lt;div&gt;&lt;div&gt;&lt;input&gt;&lt;input&gt;&lt;input&gt;&lt;div&gt;Loading...&lt;/div&gt;&lt;div&gt;&lt;div&gt;00:00&lt;/div&gt;&lt;input precision=&quot;float&quot; max=&quot;60.08&quot;&gt;&lt;div&gt;-01:00&lt;/div&gt;&lt;/div&gt;&lt;input&gt;&lt;input&gt;&lt;input&gt;&lt;input&gt;&lt;input&gt;&lt;div&gt;&lt;input precision=&quot;float&quot; max=&quot;1&quot; value=&quot;1&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

(This can be seen in Safari 5.0.5 through the relatedTarget property of a mouseout event; a bug that appears to be fixed in the nightlies). However, the CSS should not apply since these elements are not in the DOM.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>386859</commentid>
    <comment_count>1</comment_count>
      <attachid>89839</attachid>
    <who name="Marc Hoyois">marc.hoyois</who>
    <bug_when>2011-04-15 13:03:17 -0700</bug_when>
    <thetext>Created attachment 89839
Simple HTML file reproducing the bug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>387348</commentid>
    <comment_count>2</comment_count>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2011-04-17 07:13:34 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 52917 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>89839</attachid>
            <date>2011-04-15 13:03:17 -0700</date>
            <delta_ts>2011-04-15 13:03:17 -0700</delta_ts>
            <desc>Simple HTML file reproducing the bug</desc>
            <filename>shadowDOMleakCSS.html</filename>
            <type>text/html</type>
            <size>342</size>
            <attacher name="Marc Hoyois">marc.hoyois</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KICAgIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+
CiAgICA8IS0tCiAgICAgICAgZGl2IHsKICAgICAgICAgICAgZm9udC1zaXplOiAzMHB4OwogICAg
ICAgIH0KICAgICAgICBpbnB1dCB7CiAgICAgICAgICAgIC13ZWJraXQtYXBwZWFyYW5jZTogbm9u
ZTsKICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogcmVkOwogICAgICAgIH0KICAgIC0tPgog
ICAgPC9zdHlsZT4KPC9oZWFkPgo8Ym9keT4KICAgIDx2aWRlbyBjb250cm9scyBzcmM9Imh0dHA6
Ly9jbGlwcy52b3J3YWVydHMtZ21iaC5kZS9WZkVfaHRtbDUubXA0Ij48L3ZpZGVvPgo8L2JvZHk+
</data>

          </attachment>
      

    </bug>

</bugzilla>