Title: [111024] trunk/Source/WebKit/blackberry
- Revision
- 111024
- Author
- [email protected]
- Date
- 2012-03-16 10:17:03 -0700 (Fri, 16 Mar 2012)
Log Message
[BlackBerry] Syncing up left over bits in Api from our local branch to upstream
https://bugs.webkit.org/show_bug.cgi?id=81105
Patch by Nima Ghanavatian <[email protected]> on 2012-03-16
Reviewed by Rob Buis.
This patches fixes up a previous sync done in this directory and adds some new bits
as well. This is accurate as of ddea1528b37b29925638fe1183318b3c3994f1f8 in our
local repo.
* Api/BackingStore.cpp:
(BlackBerry::WebKit::BackingStorePrivate::drawAndBlendLayersForDirectRendering):
(WebKit):
(BlackBerry::WebKit::BackingStorePrivate::drawLayersOnCommitIfNeeded):
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::webContext):
(BlackBerry::WebKit::WebPage::webContext):
(BlackBerry::WebKit::WebPagePrivate::handleMouseEvent):
* Api/WebPage.h:
* Api/WebPage_p.h:
(WebPagePrivate):
Modified Paths
Diff
Modified: trunk/Source/WebKit/blackberry/Api/BackingStore.cpp (111023 => 111024)
--- trunk/Source/WebKit/blackberry/Api/BackingStore.cpp 2012-03-16 17:14:30 UTC (rev 111023)
+++ trunk/Source/WebKit/blackberry/Api/BackingStore.cpp 2012-03-16 17:17:03 UTC (rev 111024)
@@ -2568,7 +2568,47 @@
blendCompositingSurface(visibleDirtyRect);
#endif
}
+
+bool BackingStorePrivate::drawLayersOnCommitIfNeeded()
+{
+ // Check if rendering caused a commit and we need to redraw the layers
+ if (!m_needsDrawLayersOnCommit)
+ return false;
+
+ m_needsDrawLayersOnCommit = false;
+ m_webPage->d->drawLayersOnCommit();
+
+ return true;
+}
+
+void BackingStorePrivate::drawAndBlendLayersForDirectRendering(const Platform::IntRect& dirtyRect)
+{
+ ASSERT(BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread());
+ if (!BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread())
+ return;
+
+ // Because we're being called sync from the WebKit thread, we can use
+ // regular WebPage size and transformation functions without concerns.
+ WebCore::IntRect contentsRect = visibleContentsRect();
+ WebCore::FloatRect untransformedContentsRect = m_webPage->d->mapFromTransformedFloatRect(WebCore::FloatRect(contentsRect));
+ WebCore::IntRect contentsScreenRect = m_client->mapFromTransformedContentsToTransformedViewport(contentsRect);
+ WebCore::IntRect dstRect = intersection(contentsScreenRect,
+ WebCore::IntRect(WebCore::IntPoint(0, 0), m_webPage->d->transformedViewportSize()));
+
+ // Check if rendering caused a commit and we need to redraw the layers.
+ m_needsDrawLayersOnCommit = false;
+ m_webPage->d->drawSubLayers(dstRect, untransformedContentsRect);
+
+#if ENABLE_COMPOSITING_SURFACE
+ // See above comment about sync calling, visibleContentsRect() is safe here.
+ Platform::IntRect visibleDirtyRect = dirtyRect;
+ visibleDirtyRect.intersect(visibleContentsRect());
+ visibleDirtyRect = m_client->mapFromTransformedContentsToTransformedViewport(visibleDirtyRect);
+
+ blendCompositingSurface(visibleDirtyRect);
#endif
+}
+#endif
bool BackingStorePrivate::isActive() const
{
Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (111023 => 111024)
--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2012-03-16 17:14:30 UTC (rev 111023)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2012-03-16 17:17:03 UTC (rev 111024)
@@ -55,6 +55,7 @@
#include "HTMLFrameOwnerElement.h"
#include "HTMLImageElement.h"
#include "HTMLInputElement.h"
+#include "HTMLMediaElement.h"
#include "HTMLNames.h"
#include "HTMLParserIdioms.h"
#include "HTTPParsers.h"
@@ -2008,9 +2009,9 @@
return true;
}
-ActiveNodeContext WebPagePrivate::activeNodeContext(TargetDetectionStrategy strategy)
+Platform::WebContext WebPagePrivate::webContext(TargetDetectionStrategy strategy)
{
- ActiveNodeContext context;
+ Platform::WebContext context;
RefPtr<Node> node = contextNode(strategy);
m_currentContextNode = node;
@@ -2029,10 +2030,10 @@
String pattern = findPatternStringForUrl(href);
if (!pattern.isEmpty())
- context.setPattern(pattern);
+ context.setPattern(pattern.utf8().data());
if (!href.string().isEmpty()) {
- context.setUrl(href.string());
+ context.setUrl(href.string().utf8().data());
// Links are non-selectable by default, but selection should be allowed
// providing the page is selectable, use the parent to determine it.
@@ -2042,58 +2043,75 @@
}
if (!nodeAllowSelectionOverride && !node->canStartSelection())
- context.resetFlag(ActiveNodeContext::IsSelectable);
+ context.resetFlag(Platform::WebContext::IsSelectable);
if (node->isHTMLElement()) {
HTMLImageElement* imageElement = 0;
+ HTMLMediaElement* mediaElement = 0;
+
if (node->hasTagName(HTMLNames::imgTag))
imageElement = static_cast<HTMLImageElement*>(node.get());
else if (node->hasTagName(HTMLNames::areaTag))
imageElement = static_cast<HTMLAreaElement*>(node.get())->imageElement();
+
+ if (static_cast<HTMLElement*>(node.get())->isMediaElement())
+ mediaElement = static_cast<HTMLMediaElement*>(node.get());
+
if (imageElement && imageElement->renderer()) {
+ context.setFlag(Platform::WebContext::IsImage);
// FIXME: At the mean time, we only show "Save Image" when the image data is available.
if (CachedResource* cachedResource = imageElement->cachedImage()) {
if (cachedResource->isLoaded() && cachedResource->data()) {
String url = ""
- context.setImageSrc(node->document()->completeURL(url).string());
+ context.setSrc(node->document()->completeURL(url).string().utf8().data());
}
}
String alt = imageElement->altText();
if (!alt.isNull())
- context.setImageAlt(alt);
+ context.setAlt(alt.utf8().data());
}
+
+ if (mediaElement) {
+ if (mediaElement->hasAudio())
+ context.setFlag(Platform::WebContext::IsAudio);
+ if (mediaElement->hasVideo())
+ context.setFlag(Platform::WebContext::IsVideo);
+
+ String src = ""
+ context.setSrc(node->document()->completeURL(src).string().utf8().data());
+ }
}
if (node->isTextNode()) {
Text* curText = static_cast<Text*>(node.get());
if (!curText->wholeText().isEmpty())
- context.setText(curText->wholeText());
+ context.setText(curText->wholeText().utf8().data());
}
if (node->isElementNode()) {
Element* element = static_cast<Element*>(node->shadowAncestorNode());
if (DOMSupport::isTextBasedContentEditableElement(element)) {
- context.setFlag(ActiveNodeContext::IsInput);
+ context.setFlag(Platform::WebContext::IsInput);
if (element->hasTagName(HTMLNames::inputTag))
- context.setFlag(ActiveNodeContext::IsSingleLine);
+ context.setFlag(Platform::WebContext::IsSingleLine);
if (DOMSupport::isPasswordElement(element))
- context.setFlag(ActiveNodeContext::IsPassword);
+ context.setFlag(Platform::WebContext::IsPassword);
String elementText(DOMSupport::inputElementText(element));
if (!elementText.stripWhiteSpace().isEmpty())
- context.setText(elementText);
+ context.setText(elementText.utf8().data());
}
}
if (node->isFocusable())
- context.setFlag(ActiveNodeContext::IsFocusable);
+ context.setFlag(Platform::WebContext::IsFocusable);
return context;
}
-ActiveNodeContext WebPage::activeNodeContext(TargetDetectionStrategy strategy) const
+Platform::WebContext WebPage::webContext(TargetDetectionStrategy strategy) const
{
- return d->activeNodeContext(strategy);
+ return d->webContext(strategy);
}
void WebPagePrivate::updateCursor()
@@ -3549,6 +3567,7 @@
}
if (mouseEvent.type() == WebCore::PlatformEvent::MousePressed) {
+ m_inputHandler->enableInputMode();
if (m_inputHandler->willOpenPopupForNode(node)) {
// Do not allow any human generated mouse or keyboard events to select <option>s in the list box
// because we use a pop up dialog to handle the actual selections. This prevents options from
Modified: trunk/Source/WebKit/blackberry/Api/WebPage.h (111023 => 111024)
--- trunk/Source/WebKit/blackberry/Api/WebPage.h 2012-03-16 17:14:30 UTC (rev 111023)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.h 2012-03-16 17:17:03 UTC (rev 111024)
@@ -19,10 +19,12 @@
#ifndef WebPage_h
#define WebPage_h
-#include "ActiveNodeContext.h"
#include "BlackBerryGlobal.h"
+#include "WebString.h"
+
#include <BlackBerryPlatformGuardedPointer.h>
#include <BlackBerryPlatformInputEvents.h>
+#include <BlackBerryPlatformWebContext.h>
#include <imf/input_data.h>
#include <network/NetworkRequest.h>
@@ -257,7 +259,7 @@
WebString textHasAttribute(const WebString& query) const;
- ActiveNodeContext activeNodeContext(TargetDetectionStrategy) const;
+ Platform::WebContext webContext(TargetDetectionStrategy) const;
typedef intptr_t BackForwardId;
struct BackForwardEntry {
Modified: trunk/Source/WebKit/blackberry/Api/WebPage_p.h (111023 => 111024)
--- trunk/Source/WebKit/blackberry/Api/WebPage_p.h 2012-03-16 17:14:30 UTC (rev 111023)
+++ trunk/Source/WebKit/blackberry/Api/WebPage_p.h 2012-03-16 17:17:03 UTC (rev 111024)
@@ -266,7 +266,7 @@
void notifyPluginRectChanged(int id, const WebCore::IntRect& rectChanged);
// Context Methods.
- ActiveNodeContext activeNodeContext(TargetDetectionStrategy);
+ Platform::WebContext webContext(TargetDetectionStrategy);
PassRefPtr<WebCore::Node> contextNode(TargetDetectionStrategy);
#if ENABLE(VIEWPORT_REFLOW)
Modified: trunk/Source/WebKit/blackberry/ChangeLog (111023 => 111024)
--- trunk/Source/WebKit/blackberry/ChangeLog 2012-03-16 17:14:30 UTC (rev 111023)
+++ trunk/Source/WebKit/blackberry/ChangeLog 2012-03-16 17:17:03 UTC (rev 111024)
@@ -1,3 +1,26 @@
+2012-03-16 Nima Ghanavatian <[email protected]>
+
+ [BlackBerry] Syncing up left over bits in Api from our local branch to upstream
+ https://bugs.webkit.org/show_bug.cgi?id=81105
+
+ Reviewed by Rob Buis.
+
+ This patches fixes up a previous sync done in this directory and adds some new bits
+ as well. This is accurate as of ddea1528b37b29925638fe1183318b3c3994f1f8 in our
+ local repo.
+
+ * Api/BackingStore.cpp:
+ (BlackBerry::WebKit::BackingStorePrivate::drawAndBlendLayersForDirectRendering):
+ (WebKit):
+ (BlackBerry::WebKit::BackingStorePrivate::drawLayersOnCommitIfNeeded):
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::webContext):
+ (BlackBerry::WebKit::WebPage::webContext):
+ (BlackBerry::WebKit::WebPagePrivate::handleMouseEvent):
+ * Api/WebPage.h:
+ * Api/WebPage_p.h:
+ (WebPagePrivate):
+
2012-03-16 Mike Fenton <[email protected]>
[BlackBerry] Input processing mode should be cancelled when processing hot keys
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes