Title: [87232] branches/safari-534-branch/Source

Diff

Modified: branches/safari-534-branch/Source/WebCore/ChangeLog (87231 => 87232)


--- branches/safari-534-branch/Source/WebCore/ChangeLog	2011-05-24 23:49:30 UTC (rev 87231)
+++ branches/safari-534-branch/Source/WebCore/ChangeLog	2011-05-25 00:00:48 UTC (rev 87232)
@@ -1,5 +1,85 @@
 2011-05-24  Lucas Forschler  <lforsch...@apple.com>
 
+    Merged r87102.
+
+    2011-05-20  Jeremy Noble  <jer.no...@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Video looks squished when animating to full screen.
+        https://bugs.webkit.org/show_bug.cgi?id=61220
+
+        No new tests, because DumpRenderTree does not currently "animate" the full-screen transition.
+
+        There are three issues animating video content to full screen which this patch is meant to
+        address:
+        1) The animation scales between the client sizes of the element before and after full-screen.
+        Because these sizes have different aspect ratios, the video appears "squished" for part of
+        the animation. Instead, we will animate between the content box sizes before and after full
+        screen which, in the case of video now and object-fit content in the future, will have the
+        same aspect ratio before and after full screen.
+        2) Now that we are animating the full-screen video element's content box, the black letterbox
+        bars appear above and below the video (depending on the video's aspect ratio) as soon as the
+        animation begins. This is extremely jarring, so set the background color to clear. The
+        full-screen renderer's background color will serve the same purpose (providing the letterbox
+        background) once the animation completes.
+        3) Now that the letterbox color is gone, the full screen controls can appear to float in thin
+        air beneath the video (again, depending on aspect ratio) during the animation, so to avoid
+        that effect and to make the animation consistent with the old webkitenterfullscreen()
+        animation, we will hide the controls during the animation by adding a new CSS pseudo class
+        -webkit-animating-full-screen-transition.
+
+        Added a new css pseudo-class: -webkit-animating-full-screen.  During the transition animation, this
+        pseudo-class will be applied to the current full-screen element.  Styles have been added to 
+        fullscreenQuickTime.css to hide the video element's built-in controller during the full-screen
+        animation.
+
+        To accomplish this, the ivar tracking whether the full-screen animation is taking place has been moved
+        from the RenderFullScreen renderer, to the current full-screen Document.  Because changing 
+        isAnimatingFullScreen causes style changes, make sure to call recalcStyle on the full-screen element
+        after changing.
+
+        This extra transition caused assertions in HTMLFormControlElement::updateFromElementCallback. A
+        full-screen media control's renderer is disabled during the style recalculation when exiting full
+        screen. This assertion was exposed by the extra recalcStyle() issued during the exit transition, and
+        has been removed.
+
+        * WebCore.exp.in:
+        * css/CSSSelector.cpp:
+        (WebCore::CSSSelector::pseudoId): Add support for new pseudo class -webkit-animate-full-screen-transition.
+        (WebCore::nameToPseudoTypeMap): Ditto.
+        (WebCore::CSSSelector::extractPseudoType): Ditto.
+        * css/CSSSelector.h:
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector): Ditto.
+        * css/fullscreen.css: 
+        (video:-webkit-full-screen): Set full screen video background color to clear.
+        * css/fullscreenQuickTime.css: 
+        (video:-webkit-full-screen::-webkit-media-controls-panel): Set a default opacity transition.
+        (video:-webkit-animating-full-screen::-webkit-media-controls-panel): Set the opacity to 0 and 
+            disable the transition.
+        * dom/Document.cpp:
+        (WebCore::Document::Document):
+        (WebCore::Document::webkitWillEnterFullScreenForElement): Call our new setAnimatingFullScreen function.
+        (WebCore::Document::webkitDidEnterFullScreenForElement): Ditto.
+        (WebCore::Document::webkitWillExitFullScreenForElement): Ditto.
+        (WebCore::Document::webkitDidExitFullScreenForElement): Ditto.
+        (WebCore::Document::isAnimatingFullScreen): Moved here from RenderFullScreen.
+        (WebCore::Document::setAnimatingFullScreen): Ditto.
+        * dom/Document.h:
+        * html/HTMLFormControlElement.cpp: 
+        (WebCore::updateFromElementCallback): Use the Document's isAnimatingFullScreen function.
+        * page/FrameView.cpp:
+        (WebCore::isDocumentRunningFullScreenAnimation): Ditto.
+        * rendering/RenderFullScreen.cpp:
+        * rendering/RenderFullScreen.h:
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): Ditto.
+        (WebCore::RenderLayerCompositor::requiresCompositingForFullScreen): Ditto.
+        * rendering/style/RenderStyleConstants.h:
+
+2011-05-24  Lucas Forschler  <lforsch...@apple.com>
+
     Merged r87083.
 
     2011-05-23  Abhishek Arya  <infe...@chromium.org>

Modified: branches/safari-534-branch/Source/WebCore/WebCore.exp.in (87231 => 87232)


--- branches/safari-534-branch/Source/WebCore/WebCore.exp.in	2011-05-24 23:49:30 UTC (rev 87231)
+++ branches/safari-534-branch/Source/WebCore/WebCore.exp.in	2011-05-25 00:00:48 UTC (rev 87232)
@@ -1479,6 +1479,7 @@
 __ZN7WebCore13GraphicsLayer17removeAllChildrenEv
 __ZN7WebCore13GraphicsLayer6createEPNS_19GraphicsLayerClientE
 __ZNK7WebCore18RenderLayerBacking20compositingLayerTypeEv
+__ZNK7WebCore18RenderLayerBacking11contentsBoxEv
 #endif
 
 #if ENABLE(CONTEXT_MENUS)

Modified: branches/safari-534-branch/Source/WebCore/css/CSSSelector.cpp (87231 => 87232)


--- branches/safari-534-branch/Source/WebCore/css/CSSSelector.cpp	2011-05-24 23:49:30 UTC (rev 87231)
+++ branches/safari-534-branch/Source/WebCore/css/CSSSelector.cpp	2011-05-25 00:00:48 UTC (rev 87232)
@@ -167,6 +167,8 @@
         return FULL_SCREEN_DOCUMENT;
     case PseudoFullScreenMediaDocument:
         return FULL_SCREEN_MEDIA_DOCUMENT;
+    case PseudoAnimatingFullScreenTransition:
+        return ANIMATING_FULL_SCREEN_TRANSITION;
 #endif
             
     case PseudoInputListButton:
@@ -322,6 +324,7 @@
     DEFINE_STATIC_LOCAL(AtomicString, fullScreen, ("-webkit-full-screen"));
     DEFINE_STATIC_LOCAL(AtomicString, fullScreenDocument, ("-webkit-full-screen-document"));
     DEFINE_STATIC_LOCAL(AtomicString, fullScreenMediaDocument, ("-webkit-full-screen-media-document"));
+    DEFINE_STATIC_LOCAL(AtomicString, animatingFullScreenTransition, ("-webkit-animating-full-screen-transition"));
 #endif
     DEFINE_STATIC_LOCAL(AtomicString, inRange, ("in-range"));
     DEFINE_STATIC_LOCAL(AtomicString, outOfRange, ("out-of-range"));
@@ -410,6 +413,7 @@
         nameToPseudoType->set(fullScreen.impl(), CSSSelector::PseudoFullScreen);
         nameToPseudoType->set(fullScreenDocument.impl(), CSSSelector::PseudoFullScreenDocument);
         nameToPseudoType->set(fullScreenMediaDocument.impl(), CSSSelector::PseudoFullScreenMediaDocument);
+        nameToPseudoType->set(animatingFullScreenTransition.impl(), CSSSelector::PseudoAnimatingFullScreenTransition);
 #endif
         nameToPseudoType->set(inRange.impl(), CSSSelector::PseudoInRange);
         nameToPseudoType->set(outOfRange.impl(), CSSSelector::PseudoOutOfRange);
@@ -520,6 +524,7 @@
     case PseudoFullScreen:
     case PseudoFullScreenDocument:
     case PseudoFullScreenMediaDocument:
+    case PseudoAnimatingFullScreenTransition:
 #endif
     case PseudoInRange:
     case PseudoOutOfRange:

Modified: branches/safari-534-branch/Source/WebCore/css/CSSSelector.h (87231 => 87232)


--- branches/safari-534-branch/Source/WebCore/css/CSSSelector.h	2011-05-24 23:49:30 UTC (rev 87231)
+++ branches/safari-534-branch/Source/WebCore/css/CSSSelector.h	2011-05-25 00:00:48 UTC (rev 87232)
@@ -190,6 +190,7 @@
             PseudoFullScreen,
             PseudoFullScreenDocument,
             PseudoFullScreenMediaDocument,
+            PseudoAnimatingFullScreenTransition,
 #endif
             PseudoInRange,
             PseudoOutOfRange,

Modified: branches/safari-534-branch/Source/WebCore/css/CSSStyleSelector.cpp (87231 => 87232)


--- branches/safari-534-branch/Source/WebCore/css/CSSStyleSelector.cpp	2011-05-24 23:49:30 UTC (rev 87231)
+++ branches/safari-534-branch/Source/WebCore/css/CSSStyleSelector.cpp	2011-05-25 00:00:48 UTC (rev 87232)
@@ -2903,9 +2903,11 @@
                     return true;
                 if (!e->document()->webkitIsFullScreen())
                     return false;
+                return e == e->document()->webkitCurrentFullScreenElement();
+            case CSSSelector::PseudoAnimatingFullScreenTransition:
                 if (e != e->document()->webkitCurrentFullScreenElement())
                     return false;
-                return true;
+                return e->document()->isAnimatingFullScreen();
             case CSSSelector::PseudoFullScreenMediaDocument:
                 if (!e->document()->webkitIsFullScreen())
                     return false;

Modified: branches/safari-534-branch/Source/WebCore/css/fullscreen.css (87231 => 87232)


--- branches/safari-534-branch/Source/WebCore/css/fullscreen.css	2011-05-24 23:49:30 UTC (rev 87231)
+++ branches/safari-534-branch/Source/WebCore/css/fullscreen.css	2011-05-25 00:00:48 UTC (rev 87232)
@@ -13,7 +13,7 @@
 }
 
 video:-webkit-full-screen {
-    background-color: black !important;
+    background-color: transparent !important;
     position: static !important;
     margin: 0 !important;
     height: 100% !important;

Modified: branches/safari-534-branch/Source/WebCore/css/fullscreenQuickTime.css (87231 => 87232)


--- branches/safari-534-branch/Source/WebCore/css/fullscreenQuickTime.css	2011-05-24 23:49:30 UTC (rev 87231)
+++ branches/safari-534-branch/Source/WebCore/css/fullscreenQuickTime.css	2011-05-25 00:00:48 UTC (rev 87232)
@@ -54,8 +54,15 @@
         inset 0 -1px 0 0px   rgba(202, 202, 202, 0.09),
         0  0   0 1px rgba(0, 0, 0, 0.5);
     -webkit-border-radius: 8px;
+
+    -webkit-transition: opacity 0.3s linear;
 }
 
+video:-webkit-animating-full-screen-transition::-webkit-media-controls-panel {
+    opacity: 0 ! important;
+    -webkit-transition: opacity 0 ! important;
+}
+
 video:-webkit-full-screen::-webkit-media-controls-mute-button {
     display: none;
 }

Modified: branches/safari-534-branch/Source/WebCore/dom/Document.cpp (87231 => 87232)


--- branches/safari-534-branch/Source/WebCore/dom/Document.cpp	2011-05-24 23:49:30 UTC (rev 87231)
+++ branches/safari-534-branch/Source/WebCore/dom/Document.cpp	2011-05-25 00:00:48 UTC (rev 87232)
@@ -415,6 +415,7 @@
     , m_areKeysEnabledInFullScreen(0)
     , m_fullScreenRenderer(0)
     , m_fullScreenChangeDelayTimer(this, &Document::fullScreenChangeDelayTimerFired)
+    , m_isAnimatingFullScreen(false)
 #endif
     , m_loadEventDelayCount(0)
     , m_loadEventDelayTimer(this, &Document::loadEventDelayTimerFired)
@@ -4880,7 +4881,7 @@
     recalcStyle(Force);
     
     if (m_fullScreenRenderer) {
-        m_fullScreenRenderer->setAnimating(true);
+        setAnimatingFullScreen(true);
 #if USE(ACCELERATED_COMPOSITING)
         view()->updateCompositingLayers();
         if (m_fullScreenRenderer->layer()->isComposited())
@@ -4891,11 +4892,13 @@
     
 void Document::webkitDidEnterFullScreenForElement(Element*)
 {
+    ASSERT(m_fullScreenElement);
+
     if (m_fullScreenRenderer) {
 #if USE(ACCELERATED_COMPOSITING)
         page()->chrome()->client()->setRootFullScreenLayer(0);
 #endif
-        m_fullScreenRenderer->setAnimating(false);
+        setAnimatingFullScreen(false);
 #if USE(ACCELERATED_COMPOSITING)
         view()->updateCompositingLayers();
 #endif
@@ -4909,7 +4912,7 @@
     setContainsFullScreenElementRecursively(ownerElement(), false);
     
     if (m_fullScreenRenderer) {
-        m_fullScreenRenderer->setAnimating(true);
+        setAnimatingFullScreen(true);
 #if USE(ACCELERATED_COMPOSITING)
         view()->updateCompositingLayers();
         if (m_fullScreenRenderer->layer()->isComposited())
@@ -4921,6 +4924,7 @@
 void Document::webkitDidExitFullScreenForElement(Element*)
 {
     m_areKeysEnabledInFullScreen = false;
+    setAnimatingFullScreen(false);
 
     if (m_fullScreenRenderer)
         m_fullScreenRenderer->remove();
@@ -4933,7 +4937,7 @@
 #if USE(ACCELERATED_COMPOSITING)
     page()->chrome()->client()->setRootFullScreenLayer(0);
 #endif
-    recalcStyle(Force);
+    scheduleForcedStyleRecalc();
     
     m_fullScreenChangeDelayTimer.startOneShot(0);
 }
@@ -5013,7 +5017,33 @@
     if (elementInSubtree)
         fullScreenElementRemoved();
 }
+
+bool Document::isAnimatingFullScreen() const
+{
+    return m_isAnimatingFullScreen;
+}
+
+void Document::setAnimatingFullScreen(bool flag)
+{
+    if (m_isAnimatingFullScreen == flag)
+        return;
+    m_isAnimatingFullScreen = flag;
+
+    if (m_fullScreenElement) {
+        m_fullScreenElement->setNeedsStyleRecalc();
+        scheduleStyleRecalc();
+    }
+
+#if USE(ACCELERATED_COMPOSITING)
+    if (m_fullScreenRenderer && m_fullScreenRenderer->layer()) {
+        m_fullScreenRenderer->layer()->contentChanged(RenderLayer::FullScreenChanged);
+        // Clearing the layer's backing will force the compositor to reparent
+        // the layer the next time layers are synchronized.
+        m_fullScreenRenderer->layer()->clearBacking();
+    }
 #endif
+}
+#endif
 
 void Document::decrementLoadEventDelayCount()
 {

Modified: branches/safari-534-branch/Source/WebCore/dom/Document.h (87231 => 87232)


--- branches/safari-534-branch/Source/WebCore/dom/Document.h	2011-05-24 23:49:30 UTC (rev 87231)
+++ branches/safari-534-branch/Source/WebCore/dom/Document.h	2011-05-25 00:00:48 UTC (rev 87232)
@@ -1073,6 +1073,8 @@
     bool fullScreenIsAllowedForElement(Element*) const;
     void fullScreenElementRemoved();
     void removeFullScreenElementOfSubtree(Node*, bool amongChildrenOnly = false);
+    bool isAnimatingFullScreen() const;
+    void setAnimatingFullScreen(bool);
 #endif
 
     // Used to allow element that loads data without going through a FrameLoader to delay the 'load' event.
@@ -1388,6 +1390,7 @@
     RenderFullScreen* m_fullScreenRenderer;
     Timer<Document> m_fullScreenChangeDelayTimer;
     Deque<RefPtr<Element> > m_fullScreenChangeEventTargetQueue;
+    bool m_isAnimatingFullScreen;
 #endif
 
     int m_loadEventDelayCount;

Modified: branches/safari-534-branch/Source/WebCore/page/FrameView.cpp (87231 => 87232)


--- branches/safari-534-branch/Source/WebCore/page/FrameView.cpp	2011-05-24 23:49:30 UTC (rev 87231)
+++ branches/safari-534-branch/Source/WebCore/page/FrameView.cpp	2011-05-25 00:00:48 UTC (rev 87232)
@@ -596,7 +596,7 @@
 #if ENABLE(FULLSCREEN_API) && USE(ACCELERATED_COMPOSITING)
 static bool isDocumentRunningFullScreenAnimation(Document* document)
 {
-    return document->webkitIsFullScreen() && document->fullScreenRenderer() && document->fullScreenRenderer()->isAnimating();
+    return document->webkitIsFullScreen() && document->fullScreenRenderer() && document->isAnimatingFullScreen();
 }
 #endif
     

Modified: branches/safari-534-branch/Source/WebCore/rendering/RenderFullScreen.cpp (87231 => 87232)


--- branches/safari-534-branch/Source/WebCore/rendering/RenderFullScreen.cpp	2011-05-24 23:49:30 UTC (rev 87231)
+++ branches/safari-534-branch/Source/WebCore/rendering/RenderFullScreen.cpp	2011-05-25 00:00:48 UTC (rev 87232)
@@ -36,22 +36,6 @@
 
 using namespace WebCore;
 
-void RenderFullScreen::setAnimating(bool animating)
-{
-    if (m_isAnimating == animating)
-        return;
-
-    m_isAnimating = animating;
-#if USE(ACCELERATED_COMPOSITING)
-    if (layer()) {
-        layer()->contentChanged(RenderLayer::FullScreenChanged);
-        // Clearing the layer's backing will force the compositor to reparent
-        // the layer the next time layers are synchronized.
-        layer()->clearBacking();
-    }
-#endif
-}
-
 PassRefPtr<RenderStyle> RenderFullScreen::createFullScreenStyle()
 {
     RefPtr<RenderStyle> fullscreenStyle = RenderStyle::createDefaultStyle();

Modified: branches/safari-534-branch/Source/WebCore/rendering/RenderFullScreen.h (87231 => 87232)


--- branches/safari-534-branch/Source/WebCore/rendering/RenderFullScreen.h	2011-05-24 23:49:30 UTC (rev 87231)
+++ branches/safari-534-branch/Source/WebCore/rendering/RenderFullScreen.h	2011-05-25 00:00:48 UTC (rev 87232)
@@ -37,9 +37,6 @@
     virtual bool isRenderFullScreen() const { return true; }
     virtual const char* renderName() const { return "RenderFullScreen"; }
     
-    bool isAnimating() const { return m_isAnimating; }
-    void setAnimating(bool);
-    
     static PassRefPtr<RenderStyle> createFullScreenStyle();
     
 protected:

Modified: branches/safari-534-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp (87231 => 87232)


--- branches/safari-534-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp	2011-05-24 23:49:30 UTC (rev 87231)
+++ branches/safari-534-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp	2011-05-25 00:00:48 UTC (rev 87232)
@@ -884,7 +884,7 @@
         // For the sake of clients of the full screen renderer, don't reparent
         // the full screen layer out from under them if they're in the middle of
         // animating.
-        if (layer->renderer()->isRenderFullScreen() && toRenderFullScreen(layer->renderer())->isAnimating())
+        if (layer->renderer()->isRenderFullScreen() && m_renderView->document()->isAnimatingFullScreen())
             return;
 #endif
         childLayersOfEnclosingLayer.append(layerBacking->childForSuperlayers());
@@ -1414,7 +1414,7 @@
 bool RenderLayerCompositor::requiresCompositingForFullScreen(RenderObject* renderer) const
 {
 #if ENABLE(FULLSCREEN_API)
-    return renderer->isRenderFullScreen() && toRenderFullScreen(renderer)->isAnimating();
+    return renderer->isRenderFullScreen() && m_renderView->document()->isAnimatingFullScreen();
 #else
     UNUSED_PARAM(renderer);
     return false;

Modified: branches/safari-534-branch/Source/WebCore/rendering/style/RenderStyleConstants.h (87231 => 87232)


--- branches/safari-534-branch/Source/WebCore/rendering/style/RenderStyleConstants.h	2011-05-24 23:49:30 UTC (rev 87231)
+++ branches/safari-534-branch/Source/WebCore/rendering/style/RenderStyleConstants.h	2011-05-25 00:00:48 UTC (rev 87232)
@@ -74,7 +74,7 @@
     INPUT_LIST_BUTTON, INPUT_SPEECH_BUTTON, INNER_SPIN_BUTTON, OUTER_SPIN_BUTTON, VISITED_LINK,
     METER_BAR, METER_OPTIMUM, METER_SUBOPTIMAL, METER_EVEN_LESS_GOOD,
     AFTER_LAST_INTERNAL_PSEUDOID,
-    FULL_SCREEN, FULL_SCREEN_DOCUMENT, FULL_SCREEN_MEDIA_DOCUMENT,
+    FULL_SCREEN, FULL_SCREEN_DOCUMENT, FULL_SCREEN_MEDIA_DOCUMENT, ANIMATING_FULL_SCREEN_TRANSITION,
     FIRST_PUBLIC_PSEUDOID = FIRST_LINE,
     FIRST_INTERNAL_PSEUDOID = FILE_UPLOAD_BUTTON,
     PUBLIC_PSEUDOID_MASK = ((1 << FIRST_INTERNAL_PSEUDOID) - 1) & ~((1 << FIRST_PUBLIC_PSEUDOID) - 1)

Modified: branches/safari-534-branch/Source/WebKit2/ChangeLog (87231 => 87232)


--- branches/safari-534-branch/Source/WebKit2/ChangeLog	2011-05-24 23:49:30 UTC (rev 87231)
+++ branches/safari-534-branch/Source/WebKit2/ChangeLog	2011-05-25 00:00:48 UTC (rev 87232)
@@ -1,5 +1,28 @@
 2011-05-24  Lucas Forschler  <lforsch...@apple.com>
 
+    Merged r87102.
+
+    2011-05-20  Jer Noble  <jer.no...@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Video looks squished when animating to full screen.
+        https://bugs.webkit.org/show_bug.cgi?id=61220
+
+        Instead of scaling between the client sizes of the full-screen element before and after 
+        entering full-screen, scale between their content boxes.  The difference is that the client
+        sizes can have different aspect ratios, and thus the animation can end up "squishing" the
+        content at one end of the animation.  When animating between the two content box sizes, their
+        aspect ratios (for the case of video) are equal, so the animation will appear to scale 
+        smoothly between the two states without "squishing" the content.
+
+        * WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm:
+        (WebKit::WebFullScreenManagerMac::beginEnterFullScreenAnimation): Set the destination frame
+            to be the content box of the current full screen element.
+        (WebKit::WebFullScreenManagerMac::beginExitFullScreenAnimation): Ditto.
+
+2011-05-24  Lucas Forschler  <lforsch...@apple.com>
+
     Merged r87113.
 
     2011-05-23  Jeremy Noble  <jer.no...@apple.com>

Modified: branches/safari-534-branch/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm (87231 => 87232)


--- branches/safari-534-branch/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm	2011-05-24 23:49:30 UTC (rev 87231)
+++ branches/safari-534-branch/Source/WebKit2/WebProcess/FullScreen/mac/WebFullScreenManagerMac.mm	2011-05-25 00:00:48 UTC (rev 87232)
@@ -38,6 +38,9 @@
 #import <WebCore/FrameView.h>
 #import <WebCore/GraphicsLayer.h>
 #import <WebCore/Page.h>
+#import <WebCore/RenderLayer.h>
+#import <WebCore/RenderLayerBacking.h>
+#import <WebCore/RenderObject.h>
 #import <WebCore/Settings.h>
 #import <WebKitSystemInterface.h>
 
@@ -196,6 +199,11 @@
     m_element->document()->setFullScreenRendererSize(destinationFrame.size());
     m_rootLayer->syncCompositingState();
 
+    RenderLayer* layer = m_element->renderer() ? m_element->renderer()->enclosingLayer() : 0;
+    RenderLayerBacking* backing = layer ? layer->backing() : 0;
+    if (backing)
+        destinationFrame.setSize(backing->contentsBox().size());
+
     // FIXME: Once we gain the ability to do native WebKit animations of generated
     // content, this can change to use them.  Meanwhile, we'll have to animate the
     // CALayer directly:
@@ -250,6 +258,11 @@
     m_element->document()->setFullScreenRendererSize(destinationFrame.size());
     m_rootLayer->syncCompositingState();
 
+    RenderLayer* layer = m_element->renderer() ? m_element->renderer()->enclosingLayer() : 0;
+    RenderLayerBacking* backing = layer ? layer->backing() : 0;
+    if (backing)
+        destinationFrame.setSize(backing->contentsBox().size());
+
     // FIXME: Once we gain the ability to do native WebKit animations of generated
     // content, this can change to use them.  Meanwhile, we'll have to animate the
     // CALayer directly:
@@ -260,14 +273,13 @@
     // the fullscreen element appears to move from its starting position and size to its
     // final one.
     CGPoint destinationPosition = [presentationLayer position];
-    CGRect destinationBounds = [presentationLayer bounds];
     CGPoint layerAnchor = [caLayer anchorPoint];
     CGPoint initialPosition = CGPointMake(
         m_initialFrame.x() + m_initialFrame.width() * layerAnchor.x,
         m_initialFrame.y() + m_initialFrame.height() * layerAnchor.y);
     CATransform3D shrinkTransform = CATransform3DMakeScale(
-        static_cast<CGFloat>(m_initialFrame.width()) / destinationBounds.size.width,
-        static_cast<CGFloat>(m_initialFrame.height()) / destinationBounds.size.height, 1);
+        static_cast<CGFloat>(m_initialFrame.width()) / destinationFrame.width(),
+        static_cast<CGFloat>(m_initialFrame.height()) / destinationFrame.height(), 1);
     CATransform3D shiftTransform = CATransform3DMakeTranslation(
         initialPosition.x - destinationPosition.x,
         // Drawing is flipped here, and so must be the translation transformation
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to