Fullscreen element should not share styles with it's siblings.
authorcharles.wei@torchmobile.com.cn <charles.wei@torchmobile.com.cn@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Jan 2013 03:02:58 +0000 (03:02 +0000)
committercharles.wei@torchmobile.com.cn <charles.wei@torchmobile.com.cn@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Jan 2013 03:02:58 +0000 (03:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=106888

Reviewed by George Staikos.

Source/WebCore:

Test: fullscreen/full-screen-no-style-sharing.html

* css/StyleResolver.cpp:
(WebCore::StyleResolver::canShareStyleWithElement):

LayoutTests:

* fullscreen/full-screen-no-style-sharing-expected.txt: Added.
* fullscreen/full-screen-no-style-sharing.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139824 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fullscreen/full-screen-no-style-sharing-expected.txt [new file with mode: 0644]
LayoutTests/fullscreen/full-screen-no-style-sharing.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/StyleResolver.cpp

index 75a02dd3e8cee80c4d9c9b5b67e9bf5b81197598..edeb512a284485144da16e16fb48c6a03b9187b2 100644 (file)
@@ -1,3 +1,13 @@
+2013-01-15  Charles Wei  <charles.wei@torchmobile.com.cn>
+
+        Fullscreen element should not share styles with it's siblings.
+        https://bugs.webkit.org/show_bug.cgi?id=106888
+
+        Reviewed by George Staikos.
+
+        * fullscreen/full-screen-no-style-sharing-expected.txt: Added.
+        * fullscreen/full-screen-no-style-sharing.html: Added.
+
 2013-01-15  Dominic Cooney   <dominicc@chromium.org>
 
         [Chromium] Unreviewed gardening.
diff --git a/LayoutTests/fullscreen/full-screen-no-style-sharing-expected.txt b/LayoutTests/fullscreen/full-screen-no-style-sharing-expected.txt
new file mode 100644 (file)
index 0000000..1539960
--- /dev/null
@@ -0,0 +1,3 @@
+EVENT(webkitfullscreenchange) TEST(video2.clientWidth==document.body.clientWidth) OK
+END OF TEST
+
diff --git a/LayoutTests/fullscreen/full-screen-no-style-sharing.html b/LayoutTests/fullscreen/full-screen-no-style-sharing.html
new file mode 100644 (file)
index 0000000..fbefbbf
--- /dev/null
@@ -0,0 +1,17 @@
+<body>
+    <video id="video1" width="1"></video>
+    <video id="video2" width="1"></video>
+    <script src="full-screen-test.js"></script>
+    <script src=../media/media-file.js></script>
+    <script>
+        var video2 = document.getElementById('video2');
+        // Bail out early if the full screen API is not enabled or is missing:
+        if (Element.prototype.webkitRequestFullScreen == undefined) {
+            logResult(false, "Element.prototype.webkitRequestFullScreen == undefined");
+            endTest();
+        } else {
+            waitForEventTestAndEnd(document, 'webkitfullscreenchange', "video2.clientWidth==document.body.clientWidth");
+            runWithKeyDown(function(){video2.webkitRequestFullScreen()});
+        }
+    </script>
+</body>
index 87ea92cf5e882fb948937fa91f58acd98744f2fd..3fc308d46ffd61a12442ed423c8e1be41fd15bd5 100644 (file)
@@ -1,3 +1,15 @@
+2013-01-15  Charles Wei  <charles.wei@torchmobile.com.cn>
+
+        Fullscreen element should not share styles with it's siblings.
+        https://bugs.webkit.org/show_bug.cgi?id=106888
+
+        Reviewed by George Staikos.
+
+        Test: fullscreen/full-screen-no-style-sharing.html
+
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::canShareStyleWithElement):
+
 2013-01-15  Tim Horton  <timothy_horton@apple.com>
 
         Clamp TileCache visibleRect to WKView's visibleRect
index 9dea08810d729f5464e726074a279aa5ccaa03b0..8d75a93efbf4c391f58bb7f22f7ab1aeb9649471 100644 (file)
@@ -1245,6 +1245,10 @@ bool StyleResolver::canShareStyleWithElement(StyledElement* element) const
         return false;
 #endif
 
+#if ENABLE(FULLSCREEN_API)
+    if (element == element->document()->webkitCurrentFullScreenElement() || m_element == m_element->document()->webkitCurrentFullScreenElement())
+        return false;
+#endif
     return true;
 }