Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Unified Diff: Source/WebCore/html/shadow/MediaControlElements.cpp

Issue 10412040: Merge 116900 - Volume slider needs to be displayed below the mute button (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/html/shadow/MediaControlElements.cpp
===================================================================
--- Source/WebCore/html/shadow/MediaControlElements.cpp (revision 118042)
+++ Source/WebCore/html/shadow/MediaControlElements.cpp (working copy)
@@ -256,8 +256,6 @@
setInlineStyleProperty(CSSPropertyOpacity, 0.0, CSSPrimitiveValue::CSS_NUMBER);
m_opaque = false;
-
- startTimer();
}
void MediaControlPanelElement::defaultEventHandler(Event* event)
@@ -322,6 +320,36 @@
// ----------------------------
+class RenderMediaVolumeSliderContainer : public RenderBlock {
+public:
+ RenderMediaVolumeSliderContainer(Node*);
+
+private:
+ virtual void layout();
+};
+
+RenderMediaVolumeSliderContainer::RenderMediaVolumeSliderContainer(Node* node)
+ : RenderBlock(node)
+{
+}
+
+void RenderMediaVolumeSliderContainer::layout()
+{
+ RenderBlock::layout();
+
+ if (style()->display() == NONE || !nextSibling() || !nextSibling()->isBox())
+ return;
+
+ RenderBox* buttonBox = toRenderBox(nextSibling());
+ int absoluteOffsetTop = buttonBox->localToAbsolute(FloatPoint(0, -size().height())).y();
+
+ LayoutStateDisabler layoutStateDisabler(view());
+
+ // If the slider would be rendered outside the page, it should be moved below the controls.
+ if (UNLIKELY(absoluteOffsetTop < 0))
+ setY(buttonBox->offsetTop() + theme()->volumeSliderOffsetFromMuteButton(buttonBox, pixelSnappedSize()).y());
+}
+
inline MediaControlVolumeSliderContainerElement::MediaControlVolumeSliderContainerElement(Document* document)
: MediaControlElement(document)
{
@@ -334,6 +362,11 @@
return element.release();
}
+RenderObject* MediaControlVolumeSliderContainerElement::createRenderer(RenderArena* arena, RenderStyle*)
+{
+ return new (arena) RenderMediaVolumeSliderContainer(this);
+}
+
void MediaControlVolumeSliderContainerElement::defaultEventHandler(Event* event)
{
if (!event->isMouseEvent() || event->type() != eventNames().mouseoutEvent)
« no previous file with comments | « Source/WebCore/html/shadow/MediaControlElements.h ('k') | Source/WebCore/html/shadow/MediaControlRootElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698