Move MediaDocument styles into CSS. Set black background for chromium.

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: http://svn.webkit.org/repository/webkit/trunk@104278 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 81c3381b
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.
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
Test that video media documents have a black background.
EXPECTED (iframeBodyStyle.backgroundColor == 'rgb(0, 0, 0)') OK
END OF TEST
<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>
......@@ -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
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.
......@@ -24,6 +24,10 @@
/* 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;
}
......
......@@ -25,6 +25,10 @@
/* Chromium default media controls */
body:-webkit-full-page-media {
background-color: rgb(0, 0, 0);
}
audio {
width: 300px;
height: 32px;
......
......@@ -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());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment