Diff
Modified: trunk/LayoutTests/ChangeLog (258468 => 258469)
--- trunk/LayoutTests/ChangeLog 2020-03-14 19:01:48 UTC (rev 258468)
+++ trunk/LayoutTests/ChangeLog 2020-03-14 19:19:16 UTC (rev 258469)
@@ -1,3 +1,14 @@
+2020-03-14 Peng Liu <peng.l...@apple.com>
+
+ Cleanup RenderMediaControls.cpp and RenderMediaControlElements.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=209008
+
+ Reviewed by Daniel Bates.
+
+ Remove unused code in a test.
+
+ * media/track/track-cue-rendering-rtl.html:
+
2020-03-14 Zalan Bujtas <za...@apple.com>
[Tree building] Reset the fragmented flow status before calling child.willBeRemovedFromTree.
Modified: trunk/LayoutTests/media/track/track-cue-rendering-rtl.html (258468 => 258469)
--- trunk/LayoutTests/media/track/track-cue-rendering-rtl.html 2020-03-14 19:01:48 UTC (rev 258468)
+++ trunk/LayoutTests/media/track/track-cue-rendering-rtl.html 2020-03-14 19:19:16 UTC (rev 258469)
@@ -21,11 +21,6 @@
";1234تجربة",
"\t०१२३४५६७८९ \t"];
- function testCueStyle()
- {
- endTest();
- }
-
function seeked()
{
testCueDisplayBox = textTrackDisplayElement(video, 'display');
Modified: trunk/Source/WebCore/ChangeLog (258468 => 258469)
--- trunk/Source/WebCore/ChangeLog 2020-03-14 19:01:48 UTC (rev 258468)
+++ trunk/Source/WebCore/ChangeLog 2020-03-14 19:19:16 UTC (rev 258469)
@@ -1,3 +1,31 @@
+2020-03-14 Peng Liu <peng.l...@apple.com>
+
+ Cleanup RenderMediaControls.cpp and RenderMediaControlElements.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=209008
+
+ Reviewed by Daniel Bates.
+
+ Merge RenderMediaControls.[h|cpp] and RenderMediaControlElements.[h|cpp].
+ Remove class RenderMediaVolumeSliderContainer because we can use RenderBlockFlow
+ to render MediaControlTextTrackContainerElement.
+
+ No new tests, no functional change.
+
+ * Sources.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/shadow/MediaControlElementTypes.cpp:
+ * html/shadow/MediaControlElements.cpp:
+ (WebCore::MediaControlTextTrackContainerElement::createElementRenderer):
+ * rendering/RenderMediaControlElements.cpp: Removed.
+ * rendering/RenderMediaControlElements.h: Removed.
+ * rendering/RenderMediaControls.cpp:
+ (WebCore::RenderMediaVolumeSliderContainer::RenderMediaVolumeSliderContainer):
+ (WebCore::RenderMediaVolumeSliderContainer::layout):
+ (WebCore::RenderMediaControlTimelineContainer::RenderMediaControlTimelineContainer):
+ (WebCore::RenderMediaControlTimelineContainer::layout):
+ * rendering/RenderMediaControls.h:
+ * rendering/RenderThemeMac.mm:
+
2020-03-14 Daniel Bates <daba...@apple.com>
Share HitTestResult::addNodeToListBasedTestResult() impl for LayoutRect and FloatRect overloads
Modified: trunk/Source/WebCore/Sources.txt (258468 => 258469)
--- trunk/Source/WebCore/Sources.txt 2020-03-14 19:01:48 UTC (rev 258468)
+++ trunk/Source/WebCore/Sources.txt 2020-03-14 19:19:16 UTC (rev 258469)
@@ -2159,7 +2159,6 @@
rendering/RenderListMarker.cpp
rendering/RenderMarquee.cpp
rendering/RenderMedia.cpp
-rendering/RenderMediaControlElements.cpp
rendering/RenderMediaControls.cpp
rendering/RenderMenuList.cpp
rendering/RenderMeter.cpp
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (258468 => 258469)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-03-14 19:01:48 UTC (rev 258468)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-03-14 19:19:16 UTC (rev 258469)
@@ -4560,7 +4560,7 @@
DE5F86591FA2AF24006DB63A /* UnifiedSource60-mm.mm in Sources */ = {isa = PBXBuildFile; fileRef = DE5F863A1FA2AF07006DB63A /* UnifiedSource60-mm.mm */; };
DE5F86591FA2AF24006DB63B /* UnifiedSource61-mm.mm in Sources */ = {isa = PBXBuildFile; fileRef = DE5F863A1FA2AF07006DB63B /* UnifiedSource61-mm.mm */; };
DE7710861FA2F0D600460016 /* WebArchiveDumpSupport.mm in Sources */ = {isa = PBXBuildFile; fileRef = A1763F3C1E205234001D58DE /* WebArchiveDumpSupport.mm */; };
- DEBCCDD216646E8200A452E1 /* RenderMediaControlElements.h in Headers */ = {isa = PBXBuildFile; fileRef = DE49B308165F2FE10010338D /* RenderMediaControlElements.h */; };
+ DEBCCDD216646E8200A452E1 /* RenderMediaControls.h in Headers */ = {isa = PBXBuildFile; fileRef = DE49B308165F2FE10010338D /* RenderMediaControls.h */; };
DEBCCDD416646EAF00A452E1 /* MediaControlElementTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = DE49B300165F2FC60010338D /* MediaControlElementTypes.h */; };
DECA7D931F9E67B500E3B661 /* UnifiedSource131.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DECA7D6D1F9E61CF00E3B661 /* UnifiedSource131.cpp */; };
DECA7D941F9E67B500E3B661 /* UnifiedSource132.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DECA7D7E1F9E61E300E3B661 /* UnifiedSource132.cpp */; };
@@ -14508,8 +14508,8 @@
DD763BB10992C2C900740B8E /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = /usr/lib/libxml2.dylib; sourceTree = "<absolute>"; };
DE49B2FF165F2FC60010338D /* MediaControlElementTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaControlElementTypes.cpp; sourceTree = "<group>"; };
DE49B300165F2FC60010338D /* MediaControlElementTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaControlElementTypes.h; sourceTree = "<group>"; };
- DE49B307165F2FE10010338D /* RenderMediaControlElements.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMediaControlElements.cpp; sourceTree = "<group>"; };
- DE49B308165F2FE10010338D /* RenderMediaControlElements.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMediaControlElements.h; sourceTree = "<group>"; };
+ DE49B307165F2FE10010338D /* RenderMediaControls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMediaControls.cpp; sourceTree = "<group>"; };
+ DE49B308165F2FE10010338D /* RenderMediaControls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMediaControls.h; sourceTree = "<group>"; };
DE5F83B21FA18676006DB63A /* UnifiedSource301.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnifiedSource301.cpp; path = "DerivedSources/WebCore/unified-sources/UnifiedSource301.cpp"; sourceTree = BUILT_PRODUCTS_DIR; };
DE5F83B31FA18677006DB63A /* UnifiedSource355.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnifiedSource355.cpp; path = "DerivedSources/WebCore/unified-sources/UnifiedSource355.cpp"; sourceTree = BUILT_PRODUCTS_DIR; };
DE5F83B41FA18678006DB63A /* UnifiedSource378.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnifiedSource378.cpp; path = "DerivedSources/WebCore/unified-sources/UnifiedSource378.cpp"; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -27916,8 +27916,8 @@
0F56028D0E4B76580065B038 /* RenderMarquee.h */,
E4C279560CF9741900E97B98 /* RenderMedia.cpp */,
E4C279570CF9741900E97B98 /* RenderMedia.h */,
- DE49B307165F2FE10010338D /* RenderMediaControlElements.cpp */,
- DE49B308165F2FE10010338D /* RenderMediaControlElements.h */,
+ DE49B307165F2FE10010338D /* RenderMediaControls.cpp */,
+ DE49B308165F2FE10010338D /* RenderMediaControls.h */,
ABDDFE730A5C6E6F00A3E11D /* RenderMenuList.cpp */,
ABDDFE740A5C6E7000A3E11D /* RenderMenuList.h */,
A454424C119B3687009BE912 /* RenderMeter.cpp */,
@@ -31178,7 +31178,6 @@
B2FA3D570AB75A6F000E5AC4 /* JSSVGAnimationElement.h in Headers */,
B2FA3D590AB75A6F000E5AC4 /* JSSVGCircleElement.h in Headers */,
B2FA3D5B0AB75A6F000E5AC4 /* JSSVGClipPathElement.h in Headers */,
- E45A6C772417BA59006E4CD5 /* PseudoClassChangeInvalidation.h in Headers */,
B2FA3D5F0AB75A6F000E5AC4 /* JSSVGComponentTransferFunctionElement.h in Headers */,
B2FA3D610AB75A6F000E5AC4 /* JSSVGCursorElement.h in Headers */,
B2FA3D630AB75A6F000E5AC4 /* JSSVGDefsElement.h in Headers */,
@@ -31987,6 +31986,7 @@
372ADA38197F47B900FC501E /* ProtectionSpaceCocoa.h in Headers */,
51A052561058874000CC9E95 /* ProtectionSpaceHash.h in Headers */,
1AF8E11A1256592600230FF7 /* ProxyServer.h in Headers */,
+ E45A6C772417BA59006E4CD5 /* PseudoClassChangeInvalidation.h in Headers */,
FF945ECC161F7F3600971BC8 /* PseudoElement.h in Headers */,
57D8462E1FEAF69900CA3682 /* PublicKeyCredential.h in Headers */,
57303BE92009748D00355965 /* PublicKeyCredentialCreationOptions.h in Headers */,
@@ -32116,7 +32116,7 @@
439046EC12DA25E800AF80A9 /* RenderMathMLToken.h in Headers */,
439046EA12DA25E800AF80A2 /* RenderMathMLUnderOver.h in Headers */,
E4C279590CF9741900E97B98 /* RenderMedia.h in Headers */,
- DEBCCDD216646E8200A452E1 /* RenderMediaControlElements.h in Headers */,
+ DEBCCDD216646E8200A452E1 /* RenderMediaControls.h in Headers */,
ABDDFE7A0A5C6E7000A3E11D /* RenderMenuList.h in Headers */,
A454424F119B3687009BE912 /* RenderMeter.h in Headers */,
1A3586E015264C450022A659 /* RenderMultiColumnFlow.h in Headers */,
Modified: trunk/Source/WebCore/html/shadow/MediaControlElementTypes.cpp (258468 => 258469)
--- trunk/Source/WebCore/html/shadow/MediaControlElementTypes.cpp 2020-03-14 19:01:48 UTC (rev 258468)
+++ trunk/Source/WebCore/html/shadow/MediaControlElementTypes.cpp 2020-03-14 19:19:16 UTC (rev 258469)
@@ -37,7 +37,7 @@
#include "HTMLNames.h"
#include "MouseEvent.h"
#include "RenderMedia.h"
-#include "RenderMediaControlElements.h"
+#include "RenderMediaControls.h"
#include "StyleProperties.h"
#include <wtf/IsoMallocInlines.h>
Modified: trunk/Source/WebCore/html/shadow/MediaControlElements.cpp (258468 => 258469)
--- trunk/Source/WebCore/html/shadow/MediaControlElements.cpp 2020-03-14 19:01:48 UTC (rev 258468)
+++ trunk/Source/WebCore/html/shadow/MediaControlElements.cpp 2020-03-14 19:19:16 UTC (rev 258469)
@@ -52,7 +52,7 @@
#include "Page.h"
#include "PageGroup.h"
#include "RenderLayer.h"
-#include "RenderMediaControlElements.h"
+#include "RenderMediaControls.h"
#include "RenderSlider.h"
#include "RenderTheme.h"
#include "RenderVideo.h"
@@ -1106,7 +1106,7 @@
RenderPtr<RenderElement> MediaControlTextTrackContainerElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
{
- return createRenderer<RenderMediaControlTextTrackContainer>(*this, WTFMove(style));
+ return createRenderer<RenderBlockFlow>(*this, WTFMove(style));
}
static bool compareCueIntervalForDisplay(const CueInterval& one, const CueInterval& two)
Deleted: trunk/Source/WebCore/rendering/RenderMediaControlElements.cpp (258468 => 258469)
--- trunk/Source/WebCore/rendering/RenderMediaControlElements.cpp 2020-03-14 19:01:48 UTC (rev 258468)
+++ trunk/Source/WebCore/rendering/RenderMediaControlElements.cpp 2020-03-14 19:19:16 UTC (rev 258469)
@@ -1,114 +0,0 @@
-/*
- * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
- * Copyright (C) 2012 Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(VIDEO)
-#include "RenderMediaControlElements.h"
-
-#include "MediaControlElements.h"
-#include "RenderLayoutState.h"
-#include "RenderTheme.h"
-#include "RenderView.h"
-#include <wtf/IsoMallocInlines.h>
-
-namespace WebCore {
-
-WTF_MAKE_ISO_ALLOCATED_IMPL(RenderMediaVolumeSliderContainer);
-WTF_MAKE_ISO_ALLOCATED_IMPL(RenderMediaControlTimelineContainer);
-#if ENABLE(VIDEO_TRACK)
-WTF_MAKE_ISO_ALLOCATED_IMPL(RenderMediaControlTextTrackContainer);
-#endif
-
-RenderMediaVolumeSliderContainer::RenderMediaVolumeSliderContainer(Element& element, RenderStyle&& style)
- : RenderBlockFlow(element, WTFMove(style))
-{
-}
-
-void RenderMediaVolumeSliderContainer::layout()
-{
- RenderBlockFlow::layout();
-
- if (style().display() == DisplayType::None || !is<RenderBox>(nextSibling()))
- return;
-
- RenderBox& buttonBox = downcast<RenderBox>(*nextSibling());
- int absoluteOffsetTop = buttonBox.localToAbsolute(FloatPoint(0, -size().height())).y();
-
- LayoutStateDisabler layoutStateDisabler(view().frameView().layoutContext());
-
- // 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, size()).y());
-}
-
-// ----------------------------
-
-RenderMediaControlTimelineContainer::RenderMediaControlTimelineContainer(Element& element, RenderStyle&& style)
- : RenderFlexibleBox(element, WTFMove(style))
-{
-}
-
-// We want the timeline slider to be at least 100 pixels wide.
-// FIXME: Eliminate hard-coded widths altogether.
-static const int minWidthToDisplayTimeDisplays = 45 + 100 + 45;
-
-void RenderMediaControlTimelineContainer::layout()
-{
- RenderFlexibleBox::layout();
-
- LayoutStateDisabler layoutStateDisabler(view().frameView().layoutContext());
- MediaControlTimelineContainerElement* container = static_cast<MediaControlTimelineContainerElement*>(element());
- container->setTimeDisplaysHidden(width().toInt() < minWidthToDisplayTimeDisplays);
-}
-
-// ----------------------------
-
-#if ENABLE(VIDEO_TRACK)
-
-RenderMediaControlTextTrackContainer::RenderMediaControlTextTrackContainer(Element& element, RenderStyle&& style)
- : RenderBlockFlow(element, WTFMove(style))
-{
-}
-
-void RenderMediaControlTextTrackContainer::layout()
-{
- RenderBlockFlow::layout();
- if (style().display() == DisplayType::None)
- return;
-
- ASSERT(mediaControlElementType(element()) == MediaTextTrackDisplayContainer);
-
- LayoutStateDisabler layoutStateDisabler(view().frameView().layoutContext());
-}
-
-#endif // ENABLE(VIDEO_TRACK)
-
-} // namespace WebCore
-
-#endif // ENABLE(VIDEO)
-
Deleted: trunk/Source/WebCore/rendering/RenderMediaControlElements.h (258468 => 258469)
--- trunk/Source/WebCore/rendering/RenderMediaControlElements.h 2020-03-14 19:01:48 UTC (rev 258468)
+++ trunk/Source/WebCore/rendering/RenderMediaControlElements.h 2020-03-14 19:19:16 UTC (rev 258469)
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
- * Copyright (C) 2012 Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if ENABLE(VIDEO)
-
-#include "RenderBlockFlow.h"
-#include "RenderFlexibleBox.h"
-
-namespace WebCore {
-
-class RenderMediaVolumeSliderContainer final : public RenderBlockFlow {
- WTF_MAKE_ISO_ALLOCATED(RenderMediaVolumeSliderContainer);
-public:
- RenderMediaVolumeSliderContainer(Element&, RenderStyle&&);
-
-private:
- void layout() override;
-};
-
-// ----------------------------
-
-class RenderMediaControlTimelineContainer final : public RenderFlexibleBox {
- WTF_MAKE_ISO_ALLOCATED(RenderMediaControlTimelineContainer);
-public:
- RenderMediaControlTimelineContainer(Element&, RenderStyle&&);
-
-private:
- void layout() override;
- bool isFlexibleBoxImpl() const override { return true; }
-};
-
-// ----------------------------
-
-#if ENABLE(VIDEO_TRACK)
-
-class RenderMediaControlTextTrackContainer final : public RenderBlockFlow {
- WTF_MAKE_ISO_ALLOCATED(RenderMediaControlTextTrackContainer);
-public:
- RenderMediaControlTextTrackContainer(Element&, RenderStyle&&);
-
-private:
- void layout() override;
-};
-
-#endif // ENABLE(VIDEO_TRACK)
-
-} // namespace WebCore
-
-#endif // ENABLE(VIDEO)
Modified: trunk/Source/WebCore/rendering/RenderMediaControls.cpp (258468 => 258469)
--- trunk/Source/WebCore/rendering/RenderMediaControls.cpp 2020-03-14 19:01:48 UTC (rev 258468)
+++ trunk/Source/WebCore/rendering/RenderMediaControls.cpp 2020-03-14 19:19:16 UTC (rev 258469)
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2009-2017 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Google Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -20,21 +22,77 @@
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "RenderMediaControls.h"
-#if ENABLE(VIDEO) && PLATFORM(WIN) && USE(CG)
+#if ENABLE(VIDEO)
+#include "MediaControlElements.h"
+#include "RenderLayoutState.h"
+#include "RenderTheme.h"
+#include "RenderView.h"
+#include <wtf/IsoMallocInlines.h>
+
namespace WebCore {
+WTF_MAKE_ISO_ALLOCATED_IMPL(RenderMediaVolumeSliderContainer);
+WTF_MAKE_ISO_ALLOCATED_IMPL(RenderMediaControlTimelineContainer);
+
+RenderMediaVolumeSliderContainer::RenderMediaVolumeSliderContainer(Element& element, RenderStyle&& style)
+ : RenderBlockFlow(element, WTFMove(style))
+{
+}
+
+void RenderMediaVolumeSliderContainer::layout()
+{
+ RenderBlockFlow::layout();
+
+ if (style().display() == DisplayType::None || !is<RenderBox>(nextSibling()))
+ return;
+
+ RenderBox& buttonBox = downcast<RenderBox>(*nextSibling());
+ int absoluteOffsetTop = buttonBox.localToAbsolute(FloatPoint(0, -size().height())).y();
+
+ LayoutStateDisabler layoutStateDisabler(view().frameView().layoutContext());
+
+ // 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, size()).y());
+}
+
+// ----------------------------
+
+RenderMediaControlTimelineContainer::RenderMediaControlTimelineContainer(Element& element, RenderStyle&& style)
+ : RenderFlexibleBox(element, WTFMove(style))
+{
+}
+
+// We want the timeline slider to be at least 100 pixels wide.
+// FIXME: Eliminate hard-coded widths altogether.
+static const int minWidthToDisplayTimeDisplays = 45 + 100 + 45;
+
+void RenderMediaControlTimelineContainer::layout()
+{
+ RenderFlexibleBox::layout();
+
+ LayoutStateDisabler layoutStateDisabler(view().frameView().layoutContext());
+ MediaControlTimelineContainerElement* container = static_cast<MediaControlTimelineContainerElement*>(element());
+ container->setTimeDisplaysHidden(width().toInt() < minWidthToDisplayTimeDisplays);
+}
+
+#if PLATFORM(WIN) && USE(CG)
+
void RenderMediaControls::adjustMediaSliderThumbSize(RenderStyle& style)
{
ASSERT_NOT_REACHED();
}
-}
+#endif // PLATFORM(WIN) && USE(CG)
-#endif
+} // namespace WebCore
+
+#endif // ENABLE(VIDEO)
+
Modified: trunk/Source/WebCore/rendering/RenderMediaControls.h (258468 => 258469)
--- trunk/Source/WebCore/rendering/RenderMediaControls.h 2020-03-14 19:01:48 UTC (rev 258468)
+++ trunk/Source/WebCore/rendering/RenderMediaControls.h 2020-03-14 19:19:16 UTC (rev 258469)
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Google Inc.
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -20,22 +22,48 @@
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
-#if ENABLE(VIDEO) && PLATFORM(WIN) && USE(CG)
+#if ENABLE(VIDEO)
+#include "RenderBlockFlow.h"
+#include "RenderFlexibleBox.h"
+
namespace WebCore {
-class RenderStyle;
+class RenderMediaVolumeSliderContainer final : public RenderBlockFlow {
+ WTF_MAKE_ISO_ALLOCATED(RenderMediaVolumeSliderContainer);
+public:
+ RenderMediaVolumeSliderContainer(Element&, RenderStyle&&);
+private:
+ void layout() override;
+};
+
+// ----------------------------
+
+class RenderMediaControlTimelineContainer final : public RenderFlexibleBox {
+ WTF_MAKE_ISO_ALLOCATED(RenderMediaControlTimelineContainer);
+public:
+ RenderMediaControlTimelineContainer(Element&, RenderStyle&&);
+
+private:
+ void layout() override;
+ bool isFlexibleBoxImpl() const override { return true; }
+};
+
+#if PLATFORM(WIN) && USE(CG)
+
class RenderMediaControls {
public:
static void adjustMediaSliderThumbSize(RenderStyle&);
};
+#endif // PLATFORM(WIN) && USE(CG)
+
} // namespace WebCore
-#endif // ENABLE(VIDEO) && PLATFORM(WIN) && USE(CG)
+#endif // ENABLE(VIDEO)
Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (258468 => 258469)
--- trunk/Source/WebCore/rendering/RenderThemeMac.mm 2020-03-14 19:01:48 UTC (rev 258468)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm 2020-03-14 19:19:16 UTC (rev 258469)
@@ -55,7 +55,7 @@
#import "RenderAttachment.h"
#import "RenderLayer.h"
#import "RenderMedia.h"
-#import "RenderMediaControlElements.h"
+#import "RenderMediaControls.h"
#import "RenderProgress.h"
#import "RenderSlider.h"
#import "RenderSnapshottedPlugIn.h"