Skip to content
Permalink
Browse files
2011-02-15 Jer Noble <jer.noble@apple.com>
        Reviewed by Darin Adler.

        Built-in HTML5 <audio> (and sometimes <video>) UI doesn't update playhead location or time displays
        https://bugs.webkit.org/show_bug.cgi?id=46142

        Added a repaint test which ensures the timeline controls repaint in an audio-only MediaDocument.  Since
        the change also affects in-page audio, also added a repaint test for those cases as well.

        Other platforms will need to have results generated.

        * media/audio-repaint.html: Added.
        * media/media-document-audio-repaint-expected.txt: Added.
        * media/media-document-audio-repaint.html: Added.
        * platform/mac/media/audio-repaint-expected.checksum: Added.
        * platform/mac/media/audio-repaint-expected.png: Added.
        * platform/mac/media/audio-repaint-expected.txt: Added.
        * platform/mac/media/media-document-audio-repaint-expected.checksum: Added.
        * platform/mac/media/media-document-audio-repaint-expected.png: Added.
2011-02-15  Jer Noble  <jer.noble@apple.com>

        Reviewed by Darin Adler.

        Built-in HTML5 <audio> (and sometimes <video>) UI doesn't update playhead location or time displays
        https://bugs.webkit.org/show_bug.cgi?id=46142

        Push a LayoutStateMaintainer in RenderMedia::layout() before calling layout() on the
        container elements.  This is necessary because, during layout(), the child renderers
        query the current LayoutState to determine where they will be repainting.  If a new
        LayoutState is not pushed here, child renderers will attempt to repaint relative to
        their grandparent's origin instead of their parents', and repaint operations will fail.

        * rendering/RenderMedia.cpp:
        (WebCore::RenderMedia::layout):

Canonical link: https://commits.webkit.org/69241@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79318 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
jernoble committed Feb 22, 2011
1 parent 1ebf61a commit 74f01e14b8e3ea7258ed311a487ce4b8bf5e527e
@@ -1,3 +1,24 @@
2011-02-15 Jer Noble <jer.noble@apple.com>

Reviewed by Darin Adler.

Built-in HTML5 <audio> (and sometimes <video>) UI doesn't update playhead location or time displays
https://bugs.webkit.org/show_bug.cgi?id=46142

Added a repaint test which ensures the timeline controls repaint in an audio-only MediaDocument. Since
the change also affects in-page audio, also added a repaint test for those cases as well.

Other platforms will need to have results generated.

* media/audio-repaint.html: Added.
* media/media-document-audio-repaint-expected.txt: Added.
* media/media-document-audio-repaint.html: Added.
* platform/mac/media/audio-repaint-expected.checksum: Added.
* platform/mac/media/audio-repaint-expected.png: Added.
* platform/mac/media/audio-repaint-expected.txt: Added.
* platform/mac/media/media-document-audio-repaint-expected.checksum: Added.
* platform/mac/media/media-document-audio-repaint-expected.png: Added.

2011-02-22 Philippe Normand <pnormand@igalia.com>

Unreviewed, skip crashing inspector test on GTK
@@ -0,0 +1,48 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderBlock {P} at (0,0) size 784x18
RenderText {#text} at (0,0) size 741x18
text run at (0,0) width 651: "This tests that in a standalone media document with audio content, the media element repaints correctly "
text run at (651,0) width 90: "while playing."
RenderBlock (anonymous) at (0,34) size 784x154
RenderMedia {AUDIO} at (0,0) size 200x25
RenderBR {BR} at (200,25) size 0x0
RenderBR {BR} at (200,75) size 0x0
RenderBR {BR} at (200,154) size 0x0
layer at (8,67) size 200x25
RenderMedia {AUDIO} at (0,25) size 200x25
layer at (8,67) size 200x25
RenderBlock (relative positioned) {DIV} at (0,0) size 200x25
layer at (8,67) size 200x25
RenderFlexibleBox (positioned) {DIV} at (0,0) size 200x25
RenderButton {INPUT} at (6,3) size 18x18
RenderButton {INPUT} at (32,4) size 16x16
RenderFlexibleBox {DIV} at (49,1) size 126x22
RenderSlider {INPUT} at (0,5) size 126x13
RenderBlock {DIV} at (18,2) size 10x8
RenderButton {INPUT} at (177,6) size 14x12
layer at (8,42) size 200x25
RenderBlock (relative positioned) {DIV} at (0,0) size 200x25
layer at (8,42) size 200x25
RenderFlexibleBox (positioned) {DIV} at (0,0) size 200x25
RenderButton {INPUT} at (6,3) size 18x18
RenderButton {INPUT} at (32,4) size 16x16
RenderFlexibleBox {DIV} at (49,1) size 126x22
RenderSlider {INPUT} at (0,5) size 126x13
RenderBlock {DIV} at (18,2) size 10x8
RenderButton {INPUT} at (177,6) size 14x12
layer at (8,144) size 200x25
RenderMedia {AUDIO} at (0,102) size 200x25
layer at (8,144) size 200x25
RenderBlock (relative positioned) {DIV} at (0,0) size 200x25
layer at (8,144) size 200x25
RenderFlexibleBox (positioned) {DIV} at (0,0) size 200x25
RenderButton {INPUT} at (6,3) size 18x18
RenderButton {INPUT} at (32,4) size 16x16
RenderFlexibleBox {DIV} at (49,1) size 126x22
RenderSlider {INPUT} at (0,5) size 126x13
RenderBlock {DIV} at (18,2) size 10x8
RenderButton {INPUT} at (177,6) size 14x12
@@ -0,0 +1,19 @@
<p>
This tests that in a standalone media document with audio content, the media element repaints correctly
while playing.
</p>
<audio controls autoplay src="content/test.wav"></audio><br/>
<audio controls autoplay src="content/test.wav" style="margin-bottom:25px; -webkit-box-reflect:below;"></audio><br/>
<audio controls autoplay src="content/test.wav" style="margin:27px 0; -webkit-transform: rotate(15deg);"></audio><br>
<script>
if (window.layoutTestController)
layoutTestController.waitUntilDone();

if (window.layoutTestController)
layoutTestController.display();

setTimeout(function() {
if (window.layoutTestController)
layoutTestController.notifyDone();
}, 1500);
</script>
@@ -0,0 +1,41 @@
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderBlock {P} at (0,0) size 784x18
RenderText {#text} at (0,0) size 741x18
text run at (0,0) width 651: "This tests that in a standalone media document with audio content, the media element repaints correctly "
text run at (651,0) width 90: "while playing."
RenderBlock (anonymous) at (0,34) size 784x334
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (0,0) size 0x0
layer at (8,42) size 384x334
RenderPartObject {IFRAME} at (0,0) size 384x334 [border: (2px inset #000000)]
layer at (0,0) size 380x330
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]
layer at (40,164) size 300x1
RenderVideo {VIDEO} at (40,164) size 300x1
layer at (40,164) size 300x1
RenderBlock (relative positioned) {DIV} at (0,0) size 300x1
layer at (40,165) size 300x25
RenderFlexibleBox (positioned) {DIV} at (0,1) size 300x25
RenderButton {INPUT} at (6,3) size 18x18
RenderButton {INPUT} at (32,4) size 16x16
RenderFlexibleBox {DIV} at (49,5) size 226x15
RenderSlider {INPUT} at (45,2) size 136x13
RenderBlock {DIV} at (23,2) size 10x8
RenderButton {INPUT} at (277,6) size 14x12
layer at (89,172) size 45x11
RenderFlexibleBox {DIV} at (0,2) size 45x11 [color=#FFFFFF]
RenderBlock (anonymous) at (9,0) size 26x11
RenderText {#text} at (0,0) size 26x11
text run at (0,0) width 26: "00:01"
layer at (270,172) size 45x11
RenderFlexibleBox {DIV} at (181,2) size 45x11 [color=#FFFFFF]
RenderBlock (anonymous) at (7,0) size 31x11
RenderText {#text} at (0,0) size 31x11
text run at (0,0) width 31: "-00:06"
@@ -0,0 +1,20 @@
<p>
This tests that in a standalone media document with audio content, the media element repaints correctly
while playing.
</p>
<iframe src="content/test.wav" width=380 height=330 onload="frameLoaded()"></iframe>
<script>
if (window.layoutTestController)
layoutTestController.waitUntilDone();

function frameLoaded()
{
if (window.layoutTestController)
layoutTestController.display();

setTimeout(function() {
if (window.layoutTestController)
layoutTestController.notifyDone();
}, 1500);
}
</script>
@@ -0,0 +1 @@
6b05a8d77b8da28f5dca1e2800b1738e
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1 @@
9d3b8f0d93b62576cfeb140f2c2d62e8
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -1,3 +1,19 @@
2011-02-15 Jer Noble <jer.noble@apple.com>

Reviewed by Darin Adler.

Built-in HTML5 <audio> (and sometimes <video>) UI doesn't update playhead location or time displays
https://bugs.webkit.org/show_bug.cgi?id=46142

Push a LayoutStateMaintainer in RenderMedia::layout() before calling layout() on the
container elements. This is necessary because, during layout(), the child renderers
query the current LayoutState to determine where they will be repainting. If a new
LayoutState is not pushed here, child renderers will attempt to repaint relative to
their grandparent's origin instead of their parents', and repaint operations will fail.

* rendering/RenderMedia.cpp:
(WebCore::RenderMedia::layout):

2011-02-22 Benjamin Poulain <benjamin.poulain@nokia.com>

Reviewed by Kenneth Rohde Christiansen.
@@ -31,6 +31,7 @@
#include "HTMLMediaElement.h"
#include "MediaControlElements.h"
#include "MediaControls.h"
#include "RenderView.h"

namespace WebCore {

@@ -80,17 +81,24 @@ void RenderMedia::layout()
if (!controlsRenderer)
return;
IntSize newSize = contentBoxRect().size();
if (newSize != oldSize || controlsRenderer->needsLayout()) {
if (newSize == oldSize && !controlsRenderer->needsLayout())
return;

// When calling layout() on a child node, a parent must either push a LayoutStateMaintainter, or
// call view()->disableLayoutState(). Since using a LayoutStateMaintainer is slightly more efficient,
// and this method will be called many times per second during playback, use a LayoutStateMaintainer:
LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode());

m_controls->updateTimeDisplayVisibility();

m_controls->updateTimeDisplayVisibility();
controlsRenderer->setLocation(borderLeft() + paddingLeft(), borderTop() + paddingTop());
controlsRenderer->style()->setHeight(Length(newSize.height(), Fixed));
controlsRenderer->style()->setWidth(Length(newSize.width(), Fixed));
controlsRenderer->setNeedsLayout(true, false);
controlsRenderer->layout();
setChildNeedsLayout(false);

controlsRenderer->setLocation(borderLeft() + paddingLeft(), borderTop() + paddingTop());
controlsRenderer->style()->setHeight(Length(newSize.height(), Fixed));
controlsRenderer->style()->setWidth(Length(newSize.width(), Fixed));
controlsRenderer->setNeedsLayout(true, false);
controlsRenderer->layout();
setChildNeedsLayout(false);
}
statePusher.pop();
}

void RenderMedia::updateFromElement()

0 comments on commit 74f01e1

Please sign in to comment.