Move MediaDocument styles into CSS. Set black background for chromium.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jan 2012 09:43:44 +0000 (09:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jan 2012 09:43:44 +0000 (09:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=74123

Source/WebCore:

Patch by Dale Curtis <dalecurtis@chromium.org> on 2012-01-06
Reviewed by Eric Seidel.

Test: platform/chromium/media/video-black-bg-in-media-document.html

* css/mediaControls.css:
(body:-webkit-full-page-media):
(video:-webkit-full-page-media):
* css/mediaControlsChromium.css:
(body:-webkit-full-page-media):
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):

LayoutTests:

Adds a new chromium specific test for ensuring the background is set
properly.

Rebaselines the text portions of media-document-audio-repaint.

Patch by Dale Curtis <dalecurtis@chromium.org> on 2012-01-06
Reviewed by Eric Seidel.

* platform/chromium-gpu-win/media/media-document-audio-repaint-expected.txt:
* platform/chromium-gpu/media/media-document-audio-repaint-expected.txt:
* platform/chromium-win/media/media-document-audio-repaint-expected.txt:
* platform/chromium/media/media-document-audio-repaint-expected.txt:
* platform/chromium/media/video-black-bg-in-media-document-expected.txt: Added.
* platform/chromium/media/video-black-bg-in-media-document.html: Added.
* platform/chromium/test_expectations.txt:

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

12 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/chromium-gpu-win/media/media-document-audio-repaint-expected.txt
LayoutTests/platform/chromium-gpu/media/media-document-audio-repaint-expected.txt
LayoutTests/platform/chromium-win/media/media-document-audio-repaint-expected.txt
LayoutTests/platform/chromium/media/media-document-audio-repaint-expected.txt
LayoutTests/platform/chromium/media/video-black-bg-in-media-document-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/media/video-black-bg-in-media-document.html [new file with mode: 0644]
LayoutTests/platform/chromium/test_expectations.txt
Source/WebCore/ChangeLog
Source/WebCore/css/mediaControls.css
Source/WebCore/css/mediaControlsChromium.css
Source/WebCore/html/MediaDocument.cpp

index d9979fa..5f9973a 100755 (executable)
@@ -1,3 +1,23 @@
+2012-01-06  Dale Curtis  <dalecurtis@chromium.org>
+
+        Move MediaDocument styles into CSS. Set black background for chromium.
+        https://bugs.webkit.org/show_bug.cgi?id=74123
+
+        Adds a new chromium specific test for ensuring the background is set
+        properly.
+
+        Rebaselines the text portions of media-document-audio-repaint.
+
+        Reviewed by Eric Seidel.
+
+        * platform/chromium-gpu-win/media/media-document-audio-repaint-expected.txt:
+        * platform/chromium-gpu/media/media-document-audio-repaint-expected.txt:
+        * platform/chromium-win/media/media-document-audio-repaint-expected.txt:
+        * platform/chromium/media/media-document-audio-repaint-expected.txt:
+        * platform/chromium/media/video-black-bg-in-media-document-expected.txt: Added.
+        * platform/chromium/media/video-black-bg-in-media-document.html: Added.
+        * platform/chromium/test_expectations.txt:
+
 2012-01-06  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         [Qt] Unreviewed gardening. Update Qt specific expected results after r104208.
index 398d594..cbe807f 100644 (file)
@@ -16,7 +16,7 @@ layer at (8,44) size 384x334
       RenderView at (0,0) size 380x330
     layer at (0,0) size 380x330
       RenderBlock {HTML} at (0,0) size 380x330
-        RenderBody {BODY} at (8,8) size 364x314 [bgcolor=#262626]
+        RenderBody {BODY} at (8,8) size 364x314 [bgcolor=#000000]
     layer at (40,164) size 300x1
       RenderVideo {VIDEO} at (40,164) size 300x1
     layer at (40,164) size 300x1
index 16ba4e6..61c5bf6 100644 (file)
@@ -16,7 +16,7 @@ layer at (8,42) size 384x334
       RenderView at (0,0) size 380x330
     layer at (0,0) size 380x330
       RenderBlock {HTML} at (0,0) size 380x330
-        RenderBody {BODY} at (8,8) size 364x314 [bgcolor=#262626]
+        RenderBody {BODY} at (8,8) size 364x314 [bgcolor=#000000]
     layer at (40,164) size 300x1
       RenderVideo {VIDEO} at (40,164) size 300x1
     layer at (40,164) size 300x1
index 62e2529..2e2d48e 100644 (file)
@@ -13,7 +13,7 @@ layer at (0,0) size 800x600
             RenderView at (0,0) size 380x330
           layer at (0,0) size 380x330
             RenderBlock {HTML} at (0,0) size 380x330
-              RenderBody {BODY} at (8,8) size 364x314 [bgcolor=#262626]
+              RenderBody {BODY} at (8,8) size 364x314 [bgcolor=#000000]
           layer at (40,164) size 300x1
             RenderVideo {VIDEO} at (40,164) size 300x1
           layer at (40,164) size 300x1
index 486583c..a0485e4 100644 (file)
@@ -13,7 +13,7 @@ layer at (0,0) size 800x600
             RenderView at (0,0) size 380x330
           layer at (0,0) size 380x330
             RenderBlock {HTML} at (0,0) size 380x330
-              RenderBody {BODY} at (8,8) size 364x314 [bgcolor=#262626]
+              RenderBody {BODY} at (8,8) size 364x314 [bgcolor=#000000]
           layer at (40,164) size 300x1
             RenderVideo {VIDEO} at (40,164) size 300x1
           layer at (40,164) size 300x1
diff --git a/LayoutTests/platform/chromium/media/video-black-bg-in-media-document-expected.txt b/LayoutTests/platform/chromium/media/video-black-bg-in-media-document-expected.txt
new file mode 100644 (file)
index 0000000..6f82009
--- /dev/null
@@ -0,0 +1,6 @@
+Test that video media documents have a black background.
+
+
+EXPECTED (iframeBodyStyle.backgroundColor == 'rgb(0, 0, 0)') OK
+END OF TEST
+
diff --git a/LayoutTests/platform/chromium/media/video-black-bg-in-media-document.html b/LayoutTests/platform/chromium/media/video-black-bg-in-media-document.html
new file mode 100644 (file)
index 0000000..18c74b6
--- /dev/null
@@ -0,0 +1,28 @@
+<html>
+    <head>
+        <script src="../../../media/media-file.js"></script>
+        <script src="../../../media/video-test.js"></script>
+        <script>
+            function iframeLoad() {
+                var iframe = document.querySelector("iframe");
+                var iframeBody = iframe.contentDocument.querySelector("body");
+
+                // Required to be global for testExpected() to work properly.
+                iframeBodyStyle = iframe.contentDocument.defaultView.getComputedStyle(iframeBody, null);
+                testExpected("iframeBodyStyle.backgroundColor", "rgb(0, 0, 0)");
+                endTest();
+            }
+
+            function load() {
+                var iframe = document.querySelector("iframe");
+                iframe.onload = iframeLoad;
+                iframe.src = findMediaFile("video", "../../../media/content/counting");
+            }
+        </script>
+    </head>
+
+    <body onload="load()">
+        <p>Test that video media documents have a black background.</p>
+        <iframe style="width: 200px; height: 200px;"></iframe>
+   </body>
+</html>
index 46a935a..a19c0b7 100644 (file)
@@ -2570,7 +2570,7 @@ BUGWK52414 MAC : fast/overflow/006.html = IMAGE
 BUGWK52414 MAC : fast/overflow/overflow-x-y.html = IMAGE
 
 // MAC CoreGraphics CG not passing the CSS3 elliptical gradient tests. Skia on the
-// mac passes, refer to https://bugs.webkit.org/show_bug.cgi?id=56736 
+// mac passes, refer to https://bugs.webkit.org/show_bug.cgi?id=56736
 BUGWK56736 MAC CPU-CG : fast/gradients/css3-radial-gradients.html = IMAGE
 BUGWK56736 MAC CPU-CG : fast/gradients/css3-radial-gradients2.html = IMAGE
 BUGWK56736 MAC CPU-CG : fast/gradients/css3-radial-gradients3.html = IMAGE
@@ -3879,3 +3879,6 @@ BUGCR109276 LINUX : http/tests/appcache/simple.html = PASS CRASH
 BUGCR109276 LINUX : http/tests/appcache/resource-redirect.html = PASS CRASH
 
 BUGWK75633 : fast/media/viewport-media-query.html = PASS IMAGE+TEXT
+
+// Needs rebaseline after BUGWK74123 goes in.
+BUGWK75505 : media/media-document-audio-repaint.html = IMAGE
\ No newline at end of file
index 83b42a4..b43a1df 100644 (file)
@@ -1,3 +1,20 @@
+2012-01-06  Dale Curtis  <dalecurtis@chromium.org>
+
+        Move MediaDocument styles into CSS. Set black background for chromium.
+        https://bugs.webkit.org/show_bug.cgi?id=74123
+
+        Reviewed by Eric Seidel.
+
+        Test: platform/chromium/media/video-black-bg-in-media-document.html
+
+        * css/mediaControls.css:
+        (body:-webkit-full-page-media):
+        (video:-webkit-full-page-media):
+        * css/mediaControlsChromium.css:
+        (body:-webkit-full-page-media):
+        * html/MediaDocument.cpp:
+        (WebCore::MediaDocumentParser::createDocumentStructure):
+
 2012-01-06  Alice Boxhall  <aboxhall@chromium.org>
 
         Report correct line number for non-native editable text elements.
index 45a7552..31c9d43 100644 (file)
 
 /* media controls */
 
+body:-webkit-full-page-media {
+    background-color: rgb(38, 38, 38);
+}
+
 audio {
     width: 200px;
     height: 16px;
@@ -51,6 +55,15 @@ audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel {
     text-align: right;
 }
 
+video:-webkit-full-page-media {
+    margin: auto;
+    position: absolute;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    left: 0;
+}
+
 video:-webkit-full-page-media::-webkit-media-controls-panel {
     bottom: 0px;
 }
index c0c33c3..508d744 100644 (file)
 
 /* Chromium default media controls */
 
+body:-webkit-full-page-media {
+    background-color: rgb(0, 0, 0);
+}
+
 audio {
     width: 300px;
     height: 32px;
index 1cb867d..cb971f5 100644 (file)
@@ -73,22 +73,20 @@ void MediaDocumentParser::createDocumentStructure()
     ExceptionCode ec;
     RefPtr<Element> rootElement = document()->createElement(htmlTag, false);
     document()->appendChild(rootElement, ec);
+    document()->setCSSTarget(rootElement.get());
     static_cast<HTMLHtmlElement*>(rootElement.get())->insertedByParser();
 
     if (document()->frame())
         document()->frame()->loader()->dispatchDocumentElementAvailable();
         
     RefPtr<Element> body = document()->createElement(bodyTag, false);
-    body->setAttribute(styleAttr, "background-color: rgb(38,38,38);");
-
     rootElement->appendChild(body, ec);
-        
+
     RefPtr<Element> mediaElement = document()->createElement(videoTag, false);
-        
+
     m_mediaElement = static_cast<HTMLVideoElement*>(mediaElement.get());
     m_mediaElement->setAttribute(controlsAttr, "");
     m_mediaElement->setAttribute(autoplayAttr, "");
-    m_mediaElement->setAttribute(styleAttr, "margin: auto; position: absolute; top: 0; right: 0; bottom: 0; left: 0;");
 
     m_mediaElement->setAttribute(nameAttr, "media");
     m_mediaElement->setSrc(document()->url());