https://bugs.webkit.org/show_bug.cgi?id=81118
Patch by Nima Ghanavatian <nghanavatian@rim.com> on 2012-03-16
Reviewed by Rob Buis.
This is a consolidation of various changes that are in our local dev branch
but do not appear in our upstreamed port.
* WebKitSupport/DumpRenderTreeSupport.cpp:
(DumpRenderTreeSupport::computedStyleIncludingVisitedInfo):
* WebKitSupport/FatFingers.cpp:
(BlackBerry::WebKit::FatFingers::isElementClickable):
* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::spannableTextInRange):
* WebKitSupport/SurfacePool.cpp:
(BlackBerry::WebKit::SurfacePool::createBuffers):
(BlackBerry::WebKit::SurfacePool::releaseBuffers):
* WebKitSupport/TouchEventHandler.cpp:
(BlackBerry::WebKit::TouchEventHandler::handleTouchPoint):
(BlackBerry::WebKit::TouchEventHandler::handleFatFingerPressed):
* WebKitSupport/WebPageCompositor.cpp:
(BlackBerry::WebKit::WebPageCompositor::WebPageCompositor):
* WebKitSupport/WebPageCompositor.h:
(WebPageCompositor):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111087
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-03-16 Nima Ghanavatian <nghanavatian@rim.com>
+
+ [BlackBerry] Syncing up left over bits in WebKitSupport from our local branch to upstream
+ https://bugs.webkit.org/show_bug.cgi?id=81118
+
+ Reviewed by Rob Buis.
+
+ This is a consolidation of various changes that are in our local dev branch
+ but do not appear in our upstreamed port.
+
+ * WebKitSupport/DumpRenderTreeSupport.cpp:
+ (DumpRenderTreeSupport::computedStyleIncludingVisitedInfo):
+ * WebKitSupport/FatFingers.cpp:
+ (BlackBerry::WebKit::FatFingers::isElementClickable):
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::InputHandler::spannableTextInRange):
+ * WebKitSupport/SurfacePool.cpp:
+ (BlackBerry::WebKit::SurfacePool::createBuffers):
+ (BlackBerry::WebKit::SurfacePool::releaseBuffers):
+ * WebKitSupport/TouchEventHandler.cpp:
+ (BlackBerry::WebKit::TouchEventHandler::handleTouchPoint):
+ (BlackBerry::WebKit::TouchEventHandler::handleFatFingerPressed):
+ * WebKitSupport/WebPageCompositor.cpp:
+ (BlackBerry::WebKit::WebPageCompositor::WebPageCompositor):
+ * WebKitSupport/WebPageCompositor.h:
+ (WebPageCompositor):
+
2012-03-16 Nima Ghanavatian <nghanavatian@rim.com>
[BlackBerry] Syncing up left over bits in WebCoreSupport from our local branch to upstream
return JSValueMakeUndefined(context);
JSElement* jsElement = static_cast<JSElement*>(asObject(jsValue));
Element* element = jsElement->impl();
- RefPtr<CSSComputedStyleDeclaration> style = computedStyle(element, true);
+ RefPtr<CSSComputedStyleDeclaration> style = CSSComputedStyleDeclaration::create(element, true);
return toRef(exec, toJS(exec, jsElement->globalObject(), style.get()));
}
// Notice, B is not a hyperlink, or form control, and does not register any mouse event handler. Then B cannot
// be clicked. Suppose B specified the CSS property "cursor: pointer". Then, B will be considered as clickable.
return hasMousePressListener(element)
- || computedStyle(element)->getPropertyValue(cssPropertyID("cursor")) == "pointer";
+ || CSSComputedStyleDeclaration::create(element)->getPropertyValue(cssPropertyID("cursor")) == "pointer";
default:
ASSERT_NOT_REACHED();
}
pst->length = stringLength;
pst->spans_count = 0;
pst->spans = 0;
+
return pst;
}
void SurfacePool::createBuffers()
{
- if (!m_initialized || m_tilePool.isEmpty())
+ if (!m_initialized || m_tilePool.isEmpty() || !m_buffersSuspended)
return;
// Create the tile pool.
void SurfacePool::releaseBuffers()
{
- if (!m_initialized || m_tilePool.isEmpty())
+ if (!m_initialized || m_tilePool.isEmpty() || m_buffersSuspended)
return;
m_buffersSuspended = true;
// Release the tile pool.
for (size_t i = 0; i < m_tilePool.size(); ++i) {
m_tilePool[i]->frontBuffer()->clearRenderedRegion();
+ // Clear the buffer to prevent accidental leakage of (possibly sensitive) pixel data.
+ BlackBerry::Platform::Graphics::clearBuffer(m_tilePool[i]->frontBuffer()->nativeBuffer(), 0, 0, 0, 0);
BlackBerry::Platform::Graphics::destroyPixmapBuffer(m_tilePool[i]->frontBuffer()->nativeBuffer());
}
if (m_visibleTileBuffer) {
m_visibleTileBuffer->frontBuffer()->clearRenderedRegion();
+ BlackBerry::Platform::Graphics::clearBuffer(m_visibleTileBuffer->frontBuffer()->nativeBuffer(), 0, 0, 0, 0);
BlackBerry::Platform::Graphics::destroyPixmapBuffer(m_visibleTileBuffer->frontBuffer()->nativeBuffer());
}
if (backBuffer()) {
backBuffer()->clearRenderedRegion();
+ BlackBerry::Platform::Graphics::clearBuffer(backBuffer()->nativeBuffer(), 0, 0, 0, 0);
BlackBerry::Platform::Graphics::destroyPixmapBuffer(backBuffer()->nativeBuffer());
}
}
} else // Fat finger point in viewport coordinates.
adjustedPoint = m_webPage->mapFromContentsToViewport(m_lastFatFingersResult.adjustedPosition());
- PlatformMouseEvent mouseEvent(adjustedPoint, m_lastScreenPoint, MouseEventReleased, 1, LeftButton, TouchScreen);
+ PlatformMouseEvent mouseEvent(adjustedPoint, m_lastScreenPoint, PlatformEvent::MouseReleased, 1, LeftButton, TouchScreen);
m_webPage->handleMouseEvent(mouseEvent);
m_lastFatFingersResult.reset(); // Reset the fat finger result as its no longer valid when a user's finger is not on the screen.
}
case Platform::TouchPoint::TouchMoved:
if (m_convertTouchToMouse) {
- PlatformMouseEvent mouseEvent(point.m_pos, m_lastScreenPoint, MouseEventMoved, 1, LeftButton, TouchScreen);
+ PlatformMouseEvent mouseEvent(point.m_pos, m_lastScreenPoint, PlatformEvent::MouseMoved, 1, LeftButton, TouchScreen);
m_lastScreenPoint = point.m_screenPos;
if (!m_webPage->handleMouseEvent(mouseEvent)) {
m_convertTouchToMouse = false;
void TouchEventHandler::handleFatFingerPressed()
{
if (!m_didCancelTouch) {
-
// First update the mouse position with a MouseMoved event.
- PlatformMouseEvent mouseMoveEvent(m_webPage->mapFromContentsToViewport(m_lastFatFingersResult.adjustedPosition()), m_lastScreenPoint, MouseEventMoved, 0, LeftButton, TouchScreen);
+ PlatformMouseEvent mouseMoveEvent(m_webPage->mapFromContentsToViewport(m_lastFatFingersResult.adjustedPosition()), m_lastScreenPoint, PlatformEvent::MouseMoved, 0, LeftButton, TouchScreen);
m_webPage->handleMouseEvent(mouseMoveEvent);
// Then send the MousePressed event.
- PlatformMouseEvent mousePressedEvent(m_webPage->mapFromContentsToViewport(m_lastFatFingersResult.adjustedPosition()), m_lastScreenPoint, MouseEventPressed, 1, LeftButton, TouchScreen);
+ PlatformMouseEvent mousePressedEvent(m_webPage->mapFromContentsToViewport(m_lastFatFingersResult.adjustedPosition()), m_lastScreenPoint, PlatformEvent::MousePressed, 1, LeftButton, TouchScreen);
m_webPage->handleMouseEvent(mousePressedEvent);
}
}
WebPageCompositor::WebPageCompositor(WebPagePrivate* page)
: m_webPage(page)
- , m_layerRenderer(LayerRenderer::create(page->m_page))
+ , m_context(GLES2Context::create(page))
+ , m_layerRenderer(LayerRenderer::create(m_context.get()))
, m_generation(0)
, m_compositedGeneration(-1)
, m_backingStoreUsesOpenGL(false)
#if USE(ACCELERATED_COMPOSITING)
+#include "GLES2Context.h"
#include "LayerCompositingThread.h"
#include "LayerRenderer.h"
void animationTimerFired();
WebPagePrivate* m_webPage;
+ // Please maintain this order since m_layerRenderer depends on m_context in initialization list.
+ OwnPtr<GLES2Context> m_context;
OwnPtr<WebCore::LayerRenderer> m_layerRenderer;
RefPtr<WebCore::LayerCompositingThread> m_rootLayer;
WebCore::IntRect m_layoutRectForCompositing;