Bug 58684 - REGRESSION: CSS leaks in shadow DOM
Summary: REGRESSION: CSS leaks in shadow DOM
Status: RESOLVED DUPLICATE of bug 52917
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) OS X 10.6
: P1 Normal
Assignee: Nobody
Depends on:
Reported: 2011-04-15 13:02 PDT by Marc Hoyois
Modified: 2011-04-17 07:13 PDT (History)
3 users (show)

See Also:

Simple HTML file reproducing the bug (342 bytes, text/html)
2011-04-15 13:03 PDT, Marc Hoyois
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Hoyois 2011-04-15 13:02:47 PDT
CSS selectors apply to shadow DOM elements that should only be targetable using pseudo-elements.
For example, if a pseudo-element is a <div> 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 <video> 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.

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.

The shadow DOM of the video controls in this example is

<div><div><input><input><input><div>Loading...</div><div><div>00:00</div><input precision="float" max="60.08"><div>-01:00</div></div><input><input><input><input><input><div><input precision="float" max="1" value="1"></div></div></div>

(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.
Comment 1 Marc Hoyois 2011-04-15 13:03:17 PDT
Created attachment 89839 [details]
Simple HTML file reproducing the bug
Comment 2 Dimitri Glazkov (Google) 2011-04-17 07:13:34 PDT

*** This bug has been marked as a duplicate of bug 52917 ***