Changeset 119119 in webkit
- Timestamp:
- May 31, 2012 10:33:39 AM (12 years ago)
- Location:
- trunk/Source/WebKit/blackberry
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/blackberry/Api/WebPage.cpp
r119105 r119119 161 161 162 162 #if ENABLE(ACCELERATED_2D_CANVAS) 163 #include "GrContext.h" 163 164 #include "SharedGraphicsContext3D.h" 164 #include "GrContext.h"165 165 #endif 166 166 … … 2261 2261 2262 2262 if (node->isTextNode()) { 2263 Text* curText = static_cast<Text*>(node.get());2263 Text* curText = toText(node.get()); 2264 2264 if (!curText->wholeText().isEmpty()) 2265 2265 context.setText(curText->wholeText().utf8().data()); … … 5483 5483 UNUSED_PARAM(done); 5484 5484 #if ENABLE(VIDEO) 5485 if (HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(d->m_fullscreenVideoNode.get())) 5486 mediaElement->exitFullscreen(); 5485 if (d->m_webSettings->fullScreenVideoCapable()) { 5486 if (HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(d->m_fullscreenVideoNode.get())) 5487 mediaElement->exitFullscreen(); 5488 } else { 5489 #if ENABLE(FULLSCREEN_API) 5490 if (Element* element = static_cast<Element*>(d->m_fullscreenVideoNode.get())) 5491 element->document()->webkitCancelFullScreen(); 5492 #endif 5493 } 5487 5494 #endif 5488 5495 } … … 6037 6044 #endif 6038 6045 } 6046 6047 #if ENABLE(FULLSCREEN_API) 6048 // TODO: We should remove this helper class when we decide to support all elements. 6049 static bool containsVideoTags(Element* element) 6050 { 6051 for (Node* node = element->firstChild(); node; node = node->traverseNextNode(element)) { 6052 if (node->hasTagName(HTMLNames::videoTag)) 6053 return true; 6054 } 6055 return false; 6056 } 6057 6058 void WebPagePrivate::enterFullScreenForElement(Element* element) 6059 { 6060 #if ENABLE(VIDEO) 6061 // TODO: We should not check video tag when we decide to support all elements. 6062 if (!element || (!element->hasTagName(HTMLNames::videoTag) && !containsVideoTags(element))) 6063 return; 6064 if (m_webSettings->fullScreenVideoCapable()) { 6065 // The Browser chrome has its own fullscreen video widget it wants to 6066 // use, and this is a video element. The only reason that 6067 // webkitWillEnterFullScreenForElement() and 6068 // webkitDidEnterFullScreenForElement() are still called in this case 6069 // is so that exitFullScreenForElement() gets called later. 6070 enterFullscreenForNode(element); 6071 } else { 6072 // No fullscreen video widget has been made available by the Browser 6073 // chrome, or this is not a video element. The webkitRequestFullScreen 6074 // Javascript call is often made on a div element. 6075 // This is where we would hide the browser's chrome if we wanted to. 6076 client()->fullscreenStart(); 6077 m_fullscreenVideoNode = element; 6078 } 6079 #endif 6080 } 6081 6082 void WebPagePrivate::exitFullScreenForElement(Element* element) 6083 { 6084 #if ENABLE(VIDEO) 6085 // TODO: We should not check video tag when we decide to support all elements. 6086 if (!element || !element->hasTagName(HTMLNames::videoTag)) 6087 return; 6088 if (m_webSettings->fullScreenVideoCapable()) { 6089 // The Browser chrome has its own fullscreen video widget. 6090 exitFullscreenForNode(element); 6091 } else { 6092 // This is where we would restore the browser's chrome 6093 // if hidden above. 6094 client()->fullscreenStop(); 6095 m_fullscreenVideoNode = 0; 6096 } 6097 #endif 6098 } 6099 #endif 6039 6100 6040 6101 void WebPagePrivate::didChangeSettings(WebSettings* webSettings) -
trunk/Source/WebKit/blackberry/Api/WebPageClient.h
r118719 r119119 232 232 virtual void downloadRequested(Platform::FilterStream*, const WebString& suggestedFilename) = 0; 233 233 234 virtual int fullscreenStart() = 0; 234 235 virtual int fullscreenStart(const char* contextName, Platform::Graphics::Window*, unsigned x, unsigned y, unsigned width, unsigned height) = 0; 235 236 -
trunk/Source/WebKit/blackberry/Api/WebPage_p.h
r119046 r119119 42 42 class DOMWrapperWorld; 43 43 class Document; 44 class Element; 44 45 class Frame; 45 46 class GeolocationControllerClientBlackBerry; … … 192 193 void enterFullscreenForNode(WebCore::Node*); 193 194 void exitFullscreenForNode(WebCore::Node*); 195 #if ENABLE(FULLSCREEN_API) 196 void enterFullScreenForElement(WebCore::Element*); 197 void exitFullScreenForElement(WebCore::Element*); 198 #endif 194 199 void contentsSizeChanged(const WebCore::IntSize&); 195 200 void overflowExceedsContentsSize() { m_overflowExceedsContentsSize = true; } -
trunk/Source/WebKit/blackberry/ChangeLog
r119105 r119119 1 2012-05-31 Chris Guan <chris.guan@torchmobile.com.cn> 2 3 [Blackberry] WebKit's fullscreen mode needs to notify page client. 4 https://bugs.webkit.org/show_bug.cgi?id=87337 5 6 Reviewed by Antonio Gomes. 7 8 Move "fullScreenVideoCapable" into webpagePrivate to make code 9 clean for "fullScreenForElement/Node" of cromeClientBlackberry, 10 All Video checks and code path selections are in webpagePrivate now. 11 For some UX and secure reasons, we could not apply fullscreen capacity 12 for all elements, So we use client's fullscreenStart/Stop only for 13 those video elements and those elements containing video tags. 14 15 * Api/WebPage.cpp: 16 (BlackBerry::WebKit::WebPagePrivate::webContext): 17 (BlackBerry::WebKit::WebPage::notifyFullScreenVideoExited): 18 (WebKit): 19 (BlackBerry::WebKit::containsVideoTags): 20 (BlackBerry::WebKit::WebPagePrivate::enterFullScreenForElement): 21 (BlackBerry::WebKit::WebPagePrivate::exitFullScreenForElement): 22 * Api/WebPageClient.h: 23 * Api/WebPage_p.h: 24 (WebCore): 25 (WebPagePrivate): 26 * WebCoreSupport/ChromeClientBlackBerry.cpp: 27 (WebCore::ChromeClientBlackBerry::enterFullScreenForElement): 28 (WebCore::ChromeClientBlackBerry::exitFullScreenForElement): 29 1 30 2012-05-31 Arvid Nilsson <anilsson@rim.com> 2 31 -
trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp
r118696 r119119 728 728 { 729 729 element->document()->webkitWillEnterFullScreenForElement(element); 730 if (supportsFullscreenForNode(element) && m_webPagePrivate->m_webSettings->fullScreenVideoCapable()) { 731 // The Browser chrome has its own fullscreen video widget it wants to 732 // use, and this is a video element. The only reason that 733 // webkitWillEnterFullScreenForElement() and 734 // webkitDidEnterFullScreenForElement() are still called in this case 735 // is so that exitFullScreenForElement() gets called later. 736 enterFullscreenForNode(element); 737 } else { 738 // No fullscreen video widget has been made available by the Browser 739 // chrome, or this is not a video element. The webkitRequestFullScreen 740 // Javascript call is often made on a div element. 741 // This is where we would hide the browser's chrome if we wanted to. 742 } 730 m_webPagePrivate->enterFullScreenForElement(element); 743 731 element->document()->webkitDidEnterFullScreenForElement(element); 744 732 } … … 747 735 { 748 736 element->document()->webkitWillExitFullScreenForElement(element); 749 if (supportsFullscreenForNode(element) && m_webPagePrivate->m_webSettings->fullScreenVideoCapable()) { 750 // The Browser chrome has its own fullscreen video widget. 751 exitFullscreenForNode(element); 752 } else { 753 // This is where we would restore the browser's chrome 754 // if hidden above. 755 } 737 m_webPagePrivate->exitFullScreenForElement(element); 756 738 element->document()->webkitDidExitFullScreenForElement(element); 757 739 }
Note: See TracChangeset
for help on using the changeset viewer.