Changeset 142220 in webkit
- Timestamp:
- Feb 7, 2013 7:01:40 PM (11 years ago)
- Location:
- trunk/Source/WebKit/blackberry
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/blackberry/Api/WebPage.cpp
r142137 r142220 423 423 #endif 424 424 , m_pendingOrientation(-1) 425 , m_fullscreen VideoNode(0)425 , m_fullscreenNode(0) 426 426 , m_hasInRegionScrollableAreas(false) 427 427 , m_updateDelegatedOverlaysDispatched(false) … … 2504 2504 m_touchEventHandler->resetLastFatFingersResult(); 2505 2505 2506 // NOTE: m_fullscreen VideoNode, m_fullScreenPluginView and m_pluginViews2506 // NOTE: m_fullscreenNode, m_fullScreenPluginView and m_pluginViews 2507 2507 // are cleared in other methods already. 2508 2508 } … … 3839 3839 // When leaving fullscreen mode, restore the scale and scroll position if needed. 3840 3840 // We also need to make sure the scale and scroll position won't cause over scale or over scroll. 3841 if (m_scaleBeforeFullScreen > 0 && !m_fullscreen VideoNode) {3841 if (m_scaleBeforeFullScreen > 0 && !m_fullscreenNode) { 3842 3842 // Restore the scale when leaving fullscreen. We can't use TransformationMatrix::scale(double) here, 3843 3843 // as it will multiply the scale rather than set the scale. … … 5158 5158 UNUSED_PARAM(done); 5159 5159 #if ENABLE(VIDEO) 5160 if (d->m_webSettings->fullScreenVideoCapable()) { 5161 if (HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(d->m_fullscreenVideoNode.get())) 5162 mediaElement->exitFullscreen(); 5163 } else { 5160 Element* element = toElement(d->m_fullscreenNode.get()); 5161 if (!element) 5162 return; 5163 if (d->m_webSettings->fullScreenVideoCapable() && element->hasTagName(HTMLNames::videoTag)) 5164 static_cast<HTMLMediaElement*>(element)->exitFullscreen(); 5164 5165 #if ENABLE(FULLSCREEN_API) 5165 if (Element* element = static_cast<Element*>(d->m_fullscreenVideoNode.get())) 5166 element->document()->webkitCancelFullScreen(); 5167 #endif 5168 } 5166 else 5167 element->document()->webkitCancelFullScreen(); 5168 #endif 5169 5169 #endif 5170 5170 } … … 5782 5782 5783 5783 mmrPlayer->setFullscreenWebPageClient(m_client); 5784 m_fullscreen VideoNode = node;5784 m_fullscreenNode = node; 5785 5785 m_client->fullscreenStart(contextName, window, mmrPlayer->getWindowScreenRect()); 5786 5786 #endif … … 5790 5790 { 5791 5791 #if ENABLE(VIDEO) 5792 if (m_fullscreen VideoNode.get()) {5792 if (m_fullscreenNode.get()) { 5793 5793 m_client->fullscreenStop(); 5794 m_fullscreen VideoNode = 0;5794 m_fullscreenNode = 0; 5795 5795 } 5796 5796 … … 5812 5812 5813 5813 #if ENABLE(FULLSCREEN_API) 5814 // TODO: We should remove this helper class when we decide to support all elements.5815 static bool containsVideoTags(Element* element)5816 {5817 for (Node* node = element->firstChild(); node; node = NodeTraversal::next(node, element)) {5818 if (node->hasTagName(HTMLNames::videoTag))5819 return true;5820 }5821 return false;5822 }5823 5824 5814 void WebPagePrivate::enterFullScreenForElement(Element* element) 5825 5815 { 5826 5816 #if ENABLE(VIDEO) 5827 // TODO: We should not check video tag when we decide to support all elements. 5828 if (!element || (!element->hasTagName(HTMLNames::videoTag) && !containsVideoTags(element))) 5829 return; 5830 if (m_webSettings->fullScreenVideoCapable()) { 5817 if (!element) 5818 return; 5819 if (m_webSettings->fullScreenVideoCapable() && element->hasTagName(HTMLNames::videoTag)) { 5831 5820 // The Browser chrome has its own fullscreen video widget it wants to 5832 5821 // use, and this is a video element. The only reason that … … 5860 5849 // This is where we would hide the browser's chrome if we wanted to. 5861 5850 client()->fullscreenStart(); 5862 m_fullscreen VideoNode = element;5851 m_fullscreenNode = element; 5863 5852 } 5864 5853 #endif … … 5868 5857 { 5869 5858 #if ENABLE(VIDEO) 5870 // TODO: We should not check video tag when we decide to support all elements. 5871 if (!element || (!element->hasTagName(HTMLNames::videoTag) && !containsVideoTags(element))) 5872 return; 5873 if (m_webSettings->fullScreenVideoCapable()) { 5859 if (!element) 5860 return; 5861 if (m_webSettings->fullScreenVideoCapable() && element->hasTagName(HTMLNames::videoTag)) { 5874 5862 // The Browser chrome has its own fullscreen video widget. 5875 5863 exitFullscreenForNode(element); … … 5878 5866 // if hidden above. 5879 5867 client()->fullscreenStop(); 5880 m_fullscreen VideoNode = 0;5868 m_fullscreenNode = 0; 5881 5869 } 5882 5870 #endif … … 5888 5876 // If we are in fullscreen video mode, and we change the FrameView::viewportRect, 5889 5877 // we need to adjust the media container to the new size. 5890 if (!m_fullscreen VideoNode || !m_fullscreenVideoNode->renderer()5891 || !m_fullscreen VideoNode->document() || !m_fullscreenVideoNode->document()->fullScreenRenderer())5892 return; 5893 5894 ASSERT(m_fullscreen VideoNode->isElementNode());5895 ASSERT(static_cast<Element*>(m_fullscreen VideoNode.get())->isMediaElement());5896 5897 Document* document = m_fullscreen VideoNode->document();5878 if (!m_fullscreenNode || !m_fullscreenNode->renderer() 5879 || !m_fullscreenNode->document() || !m_fullscreenNode->document()->fullScreenRenderer()) 5880 return; 5881 5882 ASSERT(m_fullscreenNode->isElementNode()); 5883 ASSERT(static_cast<Element*>(m_fullscreenNode.get())->isMediaElement()); 5884 5885 Document* document = m_fullscreenNode->document(); 5898 5886 RenderStyle* fullScreenStyle = document->fullScreenRenderer()->style(); 5899 5887 ASSERT(fullScreenStyle); -
trunk/Source/WebKit/blackberry/Api/WebPage_p.h
r140816 r142220 583 583 int m_pendingOrientation; 584 584 585 RefPtr<WebCore::Node> m_fullscreen VideoNode;585 RefPtr<WebCore::Node> m_fullscreenNode; 586 586 RefPtr<WebCore::PluginView> m_fullScreenPluginView; 587 587 -
trunk/Source/WebKit/blackberry/ChangeLog
r142137 r142220 1 2013-02-07 Mary Wu <mary.wu@torchmobile.com.cn> 2 3 [BlackBerry] Enable non-video element enter/exit fullscreen. 4 https://bugs.webkit.org/show_bug.cgi?id=108314 5 6 Reviewed by Antonio Gomes. 7 8 Webkit support non-video element (like div) to enter/exit 9 fullscreen. We should pass this capability in blackberry porting. 10 11 RIM PR 256370, internally reviewed by Max Feil. 12 13 * Api/WebPage.cpp: 14 (BlackBerry::WebKit::WebPagePrivate::WebPagePrivate): 15 (BlackBerry::WebKit::WebPagePrivate::clearDocumentData): 16 (BlackBerry::WebKit::WebPagePrivate::setViewportSize): 17 (BlackBerry::WebKit::WebPage::notifyFullScreenVideoExited): 18 (BlackBerry::WebKit::WebPagePrivate::enterFullscreenForNode): 19 (BlackBerry::WebKit::WebPagePrivate::exitFullscreenForNode): 20 (WebKit): 21 (BlackBerry::WebKit::WebPagePrivate::enterFullScreenForElement): 22 (BlackBerry::WebKit::WebPagePrivate::exitFullScreenForElement): 23 (BlackBerry::WebKit::WebPagePrivate::adjustFullScreenElementDimensionsIfNeeded): 24 * Api/WebPage_p.h: 25 (WebPagePrivate): 26 1 27 2013-02-07 Jakob Petsovits <jpetsovits@rim.com> 2 28
Note: See TracChangeset
for help on using the changeset viewer.