WebCore:
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Dec 2007 19:21:09 +0000 (19:21 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Dec 2007 19:21:09 +0000 (19:21 +0000)
commit4dcc5d791e50d7996de7209d370bae84ddb2affe
tree4d2ec1cfcf3a26bd479223bd0fdddb4f06f6ac6c
parentf91d2665db9be3207f7553e4c04e47a43a60434f
WebCore:

        Reviewed by Adele.

        Fix <rdar://problem/5624802>
        Controller displays outside of <video> element when width and height aren't specified

        - Explicitly adjust size of the controls tree root.
        - Switch RenderMedia base class back to RenderReplaced. It is easier to manage the shadow tree
          by hand. This also allows better code sharing with other replaced element classes.
        - Move duplicated layout and painting code from subclasses up to RenderReplaced.

        Test: media/video-controls-rendering.html

        * rendering/RenderHTMLCanvas.cpp:
        (WebCore::RenderHTMLCanvas::paintReplaced):
        * rendering/RenderHTMLCanvas.h:
            Share code.
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::paintReplaced):
        (WebCore::RenderImage::minimumReplacedHeight):
        * rendering/RenderImage.h:
            Share code.
        * rendering/RenderMedia.cpp:
        (WebCore::RenderMediaControlShadowRoot::RenderMediaControlShadowRoot):
        (WebCore::RenderMediaControlShadowRoot::setParent):
            Add a subclass just to get through encapsulation to use setParent().
        (WebCore::MediaControlShadowRootElement::MediaControlShadowRootElement):
            Move initialization to the constructor.
        (WebCore::RenderMedia::RenderMedia):
        (WebCore::RenderMedia::~RenderMedia):
        (WebCore::RenderMedia::layout):
            Resize and layout the controller root by hand.
        (WebCore::RenderMedia::firstChild):
        (WebCore::RenderMedia::lastChild):
        (WebCore::RenderMedia::removeChild):
            Support one child renderer for controls.
        (WebCore::RenderMedia::createControlsShadowRoot):
        * rendering/RenderMedia.h:
        (WebCore::RenderMedia::isMedia):
            Switch base class to RenderReplaced, delete the now unnecessary stuff.
        * rendering/RenderReplaced.cpp:
        (WebCore::RenderReplaced::layout):
        (WebCore::RenderReplaced::paint):
        * rendering/RenderReplaced.h:
        (WebCore::RenderReplaced::minimumReplacedHeight):
        (WebCore::RenderReplaced::paintReplaced):
            Share code.
        * rendering/RenderVideo.cpp:
        (WebCore::RenderVideo::videoSizeChanged):
            Simplify, just request relayout.
        (WebCore::RenderVideo::paintReplaced):
        (WebCore::RenderVideo::layout):
        * rendering/RenderVideo.h:
            Share code.

LayoutTests:

        Reviewed by Adele.

        Test for <rdar://problem/5624802>
        Controller displays outside of <video> element when width and height aren't specified

        * media/remove-from-document.html: Improve coverage by doing relayout before finishing.
        * media/video-controls-rendering.html: Added.
        * platform/mac/media/video-controls-rendering-expected.checksum: Added.
        * platform/mac/media/video-controls-rendering-expected.png: Added.
        * platform/mac/media/video-controls-rendering-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28397 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
LayoutTests/ChangeLog
LayoutTests/media/remove-from-document.html
LayoutTests/media/video-controls-rendering.html [new file with mode: 0644]
LayoutTests/platform/mac/media/video-controls-rendering-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/media/video-controls-rendering-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/media/video-controls-rendering-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderHTMLCanvas.cpp
WebCore/rendering/RenderHTMLCanvas.h
WebCore/rendering/RenderImage.cpp
WebCore/rendering/RenderImage.h
WebCore/rendering/RenderMedia.cpp
WebCore/rendering/RenderMedia.h
WebCore/rendering/RenderReplaced.cpp
WebCore/rendering/RenderReplaced.h
WebCore/rendering/RenderVideo.cpp
WebCore/rendering/RenderVideo.h