Title: [169234] trunk/Source/WebCore
- Revision
- 169234
- Author
- [email protected]
- Date
- 2014-05-22 18:04:43 -0700 (Thu, 22 May 2014)
Log Message
Captions layout incorrectly in fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=133175
Patch by Jeremy Jones <[email protected]> on 2014-05-22
Reviewed by Eric Carlson.
When doing layout for fullscreen, geometry should be absolute so it is not influenced
by the rest of the page. This change adds style for CSSPropertyPosition, CSSPropertyLeft,
and CSSPropertyTop.
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay):
Refactor style changes into updateStyleForTextTrackRepresentation().
(WebCore::MediaControlTextTrackContainerElement::updateTimerFired):
Refactor style changes into updateStyleForTextTrackRepresentation().
(WebCore::MediaControlTextTrackContainerElement::clearTextTrackRepresentation):
Refactor style changes into updateStyleForTextTrackRepresentation().
(WebCore::MediaControlTextTrackContainerElement::updateStyleForTextTrackRepresentation):
Consolidate style changes here. Include the two existing and three new style changes.
* html/shadow/MediaControlElements.h:
Declare updateStyleForTextTrackRepresentation().
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (169233 => 169234)
--- trunk/Source/WebCore/ChangeLog 2014-05-23 00:40:23 UTC (rev 169233)
+++ trunk/Source/WebCore/ChangeLog 2014-05-23 01:04:43 UTC (rev 169234)
@@ -1,3 +1,26 @@
+2014-05-22 Jeremy Jones <[email protected]>
+
+ Captions layout incorrectly in fullscreen.
+ https://bugs.webkit.org/show_bug.cgi?id=133175
+
+ Reviewed by Eric Carlson.
+
+ When doing layout for fullscreen, geometry should be absolute so it is not influenced
+ by the rest of the page. This change adds style for CSSPropertyPosition, CSSPropertyLeft,
+ and CSSPropertyTop.
+
+ * html/shadow/MediaControlElements.cpp:
+ (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
+ Refactor style changes into updateStyleForTextTrackRepresentation().
+ (WebCore::MediaControlTextTrackContainerElement::updateTimerFired):
+ Refactor style changes into updateStyleForTextTrackRepresentation().
+ (WebCore::MediaControlTextTrackContainerElement::clearTextTrackRepresentation):
+ Refactor style changes into updateStyleForTextTrackRepresentation().
+ (WebCore::MediaControlTextTrackContainerElement::updateStyleForTextTrackRepresentation):
+ Consolidate style changes here. Include the two existing and three new style changes.
+ * html/shadow/MediaControlElements.h:
+ Declare updateStyleForTextTrackRepresentation().
+
2014-05-22 Simon Fraser <[email protected]>
REGRESSION (r155977): Very stuttery 3D css animation on jtechcommunications.com
Modified: trunk/Source/WebCore/html/shadow/MediaControlElements.cpp (169233 => 169234)
--- trunk/Source/WebCore/html/shadow/MediaControlElements.cpp 2014-05-23 00:40:23 UTC (rev 169233)
+++ trunk/Source/WebCore/html/shadow/MediaControlElements.cpp 2014-05-23 01:04:43 UTC (rev 169234)
@@ -1359,8 +1359,7 @@
mediaElement->setTextTrackRepresentation(m_textTrackRepresentation.get());
m_textTrackRepresentation->update();
- setInlineStyleProperty(CSSPropertyWidth, m_videoDisplaySize.size().width(), CSSPrimitiveValue::CSS_PX);
- setInlineStyleProperty(CSSPropertyHeight, m_videoDisplaySize.size().height(), CSSPrimitiveValue::CSS_PX);
+ updateStyleForTextTrackRepresentation();
}
} else {
hide();
@@ -1373,11 +1372,9 @@
if (!document().page())
return;
- if (m_textTrackRepresentation) {
- setInlineStyleProperty(CSSPropertyWidth, m_videoDisplaySize.size().width(), CSSPrimitiveValue::CSS_PX);
- setInlineStyleProperty(CSSPropertyHeight, m_videoDisplaySize.size().height(), CSSPrimitiveValue::CSS_PX);
- }
-
+ if (m_textTrackRepresentation)
+ updateStyleForTextTrackRepresentation();
+
HTMLMediaElement* mediaElement = parentMediaElement(this);
if (!mediaElement)
return;
@@ -1402,13 +1399,26 @@
if (HTMLMediaElement* mediaElement = parentMediaElement(this))
mediaElement->setTextTrackRepresentation(nullptr);
m_textTrackRepresentation = nullptr;
- removeInlineStyleProperty(CSSPropertyPosition);
- removeInlineStyleProperty(CSSPropertyWidth);
- removeInlineStyleProperty(CSSPropertyHeight);
- removeInlineStyleProperty(CSSPropertyLeft);
- removeInlineStyleProperty(CSSPropertyTop);
+ updateStyleForTextTrackRepresentation();
}
+void MediaControlTextTrackContainerElement::updateStyleForTextTrackRepresentation()
+{
+ if (m_textTrackRepresentation) {
+ setInlineStyleProperty(CSSPropertyWidth, m_videoDisplaySize.size().width(), CSSPrimitiveValue::CSS_PX);
+ setInlineStyleProperty(CSSPropertyHeight, m_videoDisplaySize.size().height(), CSSPrimitiveValue::CSS_PX);
+ setInlineStyleProperty(CSSPropertyPosition, CSSValueAbsolute);
+ setInlineStyleProperty(CSSPropertyLeft, 0, CSSPrimitiveValue::CSS_PX);
+ setInlineStyleProperty(CSSPropertyTop, 0, CSSPrimitiveValue::CSS_PX);
+ } else {
+ removeInlineStyleProperty(CSSPropertyPosition);
+ removeInlineStyleProperty(CSSPropertyWidth);
+ removeInlineStyleProperty(CSSPropertyHeight);
+ removeInlineStyleProperty(CSSPropertyLeft);
+ removeInlineStyleProperty(CSSPropertyTop);
+ }
+}
+
void MediaControlTextTrackContainerElement::enteredFullscreen()
{
updateSizes(true);
Modified: trunk/Source/WebCore/html/shadow/MediaControlElements.h (169233 => 169234)
--- trunk/Source/WebCore/html/shadow/MediaControlElements.h 2014-05-23 00:40:23 UTC (rev 169233)
+++ trunk/Source/WebCore/html/shadow/MediaControlElements.h 2014-05-23 01:04:43 UTC (rev 169234)
@@ -487,6 +487,7 @@
virtual PassRefPtr<Image> createTextTrackRepresentationImage() override;
virtual void textTrackRepresentationBoundsChanged(const IntRect&) override;
void clearTextTrackRepresentation();
+ void updateStyleForTextTrackRepresentation();
OwnPtr<TextTrackRepresentation> m_textTrackRepresentation;
Timer<MediaControlTextTrackContainerElement> m_updateTimer;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes