Title: [138389] trunk/Source/WebKit/blackberry
Revision
138389
Author
[email protected]
Date
2012-12-21 10:57:43 -0800 (Fri, 21 Dec 2012)

Log Message

[BlackBerry] Fullscreen video fixed position container horizontal position is wrong
https://bugs.webkit.org/show_bug.cgi?id=105488

Patch by Max Feil <[email protected]> on 2012-12-21
Reviewed by George Staikos.

The fix for https://bugs.webkit.org/show_bug.cgi?id=105333 has
broken fullscreen video, which was compensating by doing its
own positioning in x. My patch fixes things by making vertical
and horizontal handling symmetrical.
NOTE: This function was not upstreamed before, so you can't
actually see my diff. See the bug.

* Api/WebPage.cpp:
(WebKit):
(BlackBerry::WebKit::WebPagePrivate::adjustFullScreenElementDimensionsIfNeeded):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (138388 => 138389)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-12-21 18:53:16 UTC (rev 138388)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-12-21 18:57:43 UTC (rev 138389)
@@ -5839,6 +5839,40 @@
     }
 #endif
 }
+
+// FIXME: Move this method to WebCore.
+void WebPagePrivate::adjustFullScreenElementDimensionsIfNeeded()
+{
+    // If we are in fullscreen video mode, and we change the FrameView::viewportRect,
+    // we need to adjust the media container to the new size.
+    if (!m_fullscreenVideoNode || !m_fullscreenVideoNode->renderer()
+        || !m_fullscreenVideoNode->document() || !m_fullscreenVideoNode->document()->fullScreenRenderer())
+        return;
+
+    ASSERT(m_fullscreenVideoNode->isElementNode());
+    ASSERT(static_cast<Element*>(m_fullscreenVideoNode.get())->isMediaElement());
+
+    Document* document = m_fullscreenVideoNode->document();
+    RenderStyle* fullScreenStyle = document->fullScreenRenderer()->style();
+    ASSERT(fullScreenStyle);
+
+    // In order to compensate possible round errors when we scale the fullscreen
+    // container element to fit to the viewport, lets make the fullscreen 1px wider
+    // than the viewport size on the right, and one pixel longer at the bottom
+    // of the scroll position.
+    IntRect viewportRect = m_mainFrame->view()->visibleContentRect();
+    int viewportWidth = viewportRect.width() + 1;
+    int viewportHeight = viewportRect.height() + 1;
+
+    fullScreenStyle->setWidth(Length(viewportWidth, WebCore::Fixed));
+    fullScreenStyle->setHeight(Length(viewportHeight, WebCore::Fixed));
+    fullScreenStyle->setLeft(Length(0, WebCore::Fixed));
+    fullScreenStyle->setTop(Length(0, WebCore::Fixed));
+    fullScreenStyle->setBackgroundColor(Color::black);
+
+    document->fullScreenRenderer()->setNeedsLayoutAndPrefWidthsRecalc();
+    document->recalcStyle(Node::Force);
+}
 #endif
 
 void WebPagePrivate::didChangeSettings(WebSettings* webSettings)

Modified: trunk/Source/WebKit/blackberry/ChangeLog (138388 => 138389)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-12-21 18:53:16 UTC (rev 138388)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-12-21 18:57:43 UTC (rev 138389)
@@ -1,3 +1,21 @@
+2012-12-21  Max Feil  <[email protected]>
+
+        [BlackBerry] Fullscreen video fixed position container horizontal position is wrong
+        https://bugs.webkit.org/show_bug.cgi?id=105488
+
+        Reviewed by George Staikos.
+
+        The fix for https://bugs.webkit.org/show_bug.cgi?id=105333 has
+        broken fullscreen video, which was compensating by doing its
+        own positioning in x. My patch fixes things by making vertical
+        and horizontal handling symmetrical.
+        NOTE: This function was not upstreamed before, so you can't
+        actually see my diff. See the bug.
+
+        * Api/WebPage.cpp:
+        (WebKit):
+        (BlackBerry::WebKit::WebPagePrivate::adjustFullScreenElementDimensionsIfNeeded):
+
 2012-12-18  Nima Ghanavatian  <[email protected]>
 
         [BlackBerry] Calculate correct word offsets for form elements.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to