diff options
-rw-r--r-- | WebCore/Android.derived.jscbindings.mk | 7 | ||||
-rw-r--r-- | WebCore/Android.derived.mk | 9 | ||||
-rw-r--r-- | WebCore/Android.derived.v8bindings.mk | 4 | ||||
-rw-r--r-- | WebCore/Android.jscbindings.mk | 4 | ||||
-rw-r--r-- | WebCore/Android.mk | 19 | ||||
-rw-r--r-- | WebCore/Android.v8bindings.mk | 4 | ||||
-rw-r--r-- | WebCore/config.h | 2 | ||||
-rw-r--r-- | WebCore/platform/PlatformTouchPoint.h | 1 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | 11 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/LayerAndroid.cpp | 18 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/LayerAndroid.h | 22 | ||||
-rw-r--r-- | WebCore/platform/qt/PlatformTouchPointQt.cpp | 1 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 8 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.h | 1 | ||||
-rw-r--r-- | WebKit/android/nav/CachedPrefix.h | 7 |
15 files changed, 97 insertions, 21 deletions
diff --git a/WebCore/Android.derived.jscbindings.mk b/WebCore/Android.derived.jscbindings.mk index 380b138..00f272a 100644 --- a/WebCore/Android.derived.jscbindings.mk +++ b/WebCore/Android.derived.jscbindings.mk @@ -49,7 +49,7 @@ js_binding_scripts := $(addprefix $(LOCAL_PATH)/,\ bindings/scripts/generate-bindings.pl \ ) -FEATURE_DEFINES := ENABLE_ORIENTATION_EVENTS=1 ENABLE_TOUCH_EVENTS=1 ENABLE_DATABASE=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1 ENABLE_DOM_STORAGE=1 ENABLE_VIDEO=1 ENABLE_GEOLOCATION=1 ENABLE_CONNECTION=1 ENABLE_APPLICATION_INSTALLED=1 +FEATURE_DEFINES := ENABLE_ORIENTATION_EVENTS=1 ENABLE_TOUCH_EVENTS=1 ENABLE_DATABASE=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1 ENABLE_DOM_STORAGE=1 ENABLE_VIDEO=1 ENABLE_GEOLOCATION=1 ENABLE_CONNECTION=1 ENABLE_APPLICATION_INSTALLED=1 ENABLE_XPATH=1 # CSS GEN := \ @@ -537,6 +537,11 @@ GEN := \ $(intermediates)/xml/JSXMLHttpRequestProgressEvent.h \ $(intermediates)/xml/JSXMLHttpRequestUpload.h \ $(intermediates)/xml/JSXMLSerializer.h \ + $(intermediates)/xml/JSXPathException.h \ + $(intermediates)/xml/JSXPathExpression.h \ + $(intermediates)/xml/JSXPathEvaluator.h \ + $(intermediates)/xml/JSXPathNSResolver.h \ + $(intermediates)/xml/JSXPathResult.h \ $(intermediates)/xml/JSXSLTProcessor.h $(GEN): PRIVATE_PATH := $(LOCAL_PATH) $(GEN): PRIVATE_CUSTOM_TOOL = perl -I$(PRIVATE_PATH)/bindings/scripts $(PRIVATE_PATH)/bindings/scripts/generate-bindings.pl --defines "$(FEATURE_DEFINES) LANGUAGE_JAVASCRIPT" --generator JS --include dom --include html --outputdir $(dir $@) $< diff --git a/WebCore/Android.derived.mk b/WebCore/Android.derived.mk index c678e60..c4ae2f1 100644 --- a/WebCore/Android.derived.mk +++ b/WebCore/Android.derived.mk @@ -100,6 +100,15 @@ $(GEN): $(LOCAL_BISON) LOCAL_GENERATED_SOURCES += $(GEN) +# XPath grammar + +GEN := $(intermediates)/XPathGrammar.cpp +$(GEN) : PRIVATE_YACCFLAGS := -p xpathyy +$(GEN): $(LOCAL_PATH)/xml/XPathGrammar.y + $(call local-transform-y-to-cpp,.cpp) +$(GEN): $(LOCAL_BISON) + +LOCAL_GENERATED_SOURCES += $(GEN) # user agent style sheets style_sheets := $(LOCAL_PATH)/css/html.css $(LOCAL_PATH)/css/quirks.css $(LOCAL_PATH)/css/view-source.css $(LOCAL_PATH)/css/mediaControls.css diff --git a/WebCore/Android.derived.v8bindings.mk b/WebCore/Android.derived.v8bindings.mk index c385111..d043842 100644 --- a/WebCore/Android.derived.v8bindings.mk +++ b/WebCore/Android.derived.v8bindings.mk @@ -31,7 +31,7 @@ js_binding_scripts := \ $(LOCAL_PATH)/bindings/scripts/generate-bindings.pl # Add ACCELERATED_COMPOSITING=1 and ENABLE_3D_RENDERING=1 for layers support -FEATURE_DEFINES := ENABLE_ORIENTATION_EVENTS=1 ENABLE_TOUCH_EVENTS=1 V8_BINDING ENABLE_DATABASE=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1 ENABLE_DOM_STORAGE=1 ENABLE_VIDEO=1 ENABLE_GEOLOCATION=1 ENABLE_CONNECTION=1 ENABLE_APPLICATION_INSTALLED=1 +FEATURE_DEFINES := ENABLE_ORIENTATION_EVENTS=1 ENABLE_TOUCH_EVENTS=1 V8_BINDING ENABLE_DATABASE=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1 ENABLE_DOM_STORAGE=1 ENABLE_VIDEO=1 ENABLE_GEOLOCATION=1 ENABLE_CONNECTION=1 ENABLE_APPLICATION_INSTALLED=1 ENABLE_XPATH=1 # CSS GEN := \ @@ -543,6 +543,8 @@ GEN := \ $(intermediates)/bindings/V8XMLHttpRequestUpload.h \ $(intermediates)/bindings/V8XMLSerializer.h \ $(intermediates)/bindings/V8XPathException.h \ + $(intermediates)/bindings/V8XPathExpression.h \ + $(intermediates)/bindings/V8XPathEvaluator.h \ $(intermediates)/bindings/V8XPathNSResolver.h \ $(intermediates)/bindings/V8XPathResult.h diff --git a/WebCore/Android.jscbindings.mk b/WebCore/Android.jscbindings.mk index a0a47d5..8b8ed77 100644 --- a/WebCore/Android.jscbindings.mk +++ b/WebCore/Android.jscbindings.mk @@ -199,3 +199,7 @@ LOCAL_SRC_FILES += \ bridge/runtime_method.cpp \ bridge/runtime_object.cpp \ bridge/runtime_root.cpp + +# For XPath. +LOCAL_SRC_FILES += \ + bindings/js/JSCustomXPathNSResolver.cpp diff --git a/WebCore/Android.mk b/WebCore/Android.mk index 90d92ed..54c11f0 100644 --- a/WebCore/Android.mk +++ b/WebCore/Android.mk @@ -939,3 +939,22 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ xml/XMLHttpRequest.cpp \ xml/XMLHttpRequestUpload.cpp \ xml/XMLSerializer.cpp + +# For XPath +LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ + xml/XPathEvaluator.cpp \ + xml/XPathExpression.cpp \ + xml/XPathExpressionNode.cpp \ + xml/XPathFunctions.cpp \ + xml/XPathNSResolver.cpp \ + xml/XPathNamespace.cpp \ + xml/XPathNodeSet.cpp \ + xml/XPathParser.cpp \ + xml/XPathPath.cpp \ + xml/XPathPredicate.cpp \ + xml/XPathResult.cpp \ + xml/XPathStep.cpp \ + xml/XPathUtil.cpp \ + xml/XPathValue.cpp \ + xml/XPathVariableReference.cpp \ + xml/NativeXPathNSResolver.cpp diff --git a/WebCore/Android.v8bindings.mk b/WebCore/Android.v8bindings.mk index fb09c00..29ae3f9 100644 --- a/WebCore/Android.v8bindings.mk +++ b/WebCore/Android.v8bindings.mk @@ -200,3 +200,7 @@ LOCAL_SRC_FILES += \ bridge/jni/v8/JavaClassV8.cpp \ bridge/jni/v8/JavaInstanceV8.cpp \ bridge/jni/v8/JavaNPObjectV8.cpp + +# For XPath. +LOCAL_SRC_FILES += \ + bindings/v8/custom/V8CustomXPathNSResolver.cpp diff --git a/WebCore/config.h b/WebCore/config.h index cdbc0a4..00b5d05 100644 --- a/WebCore/config.h +++ b/WebCore/config.h @@ -110,7 +110,7 @@ #define ENABLE_XBL 0 #define ENABLE_XHTMLMP 0 -#define ENABLE_XPATH 0 +#define ENABLE_XPATH 1 #define ENABLE_XSLT 0 #undef ENABLE_ARCHIVE // Enabled by default in Platform.h #define ENABLE_ARCHIVE 0 diff --git a/WebCore/platform/PlatformTouchPoint.h b/WebCore/platform/PlatformTouchPoint.h index d4f855e..90a3ace 100644 --- a/WebCore/platform/PlatformTouchPoint.h +++ b/WebCore/platform/PlatformTouchPoint.h @@ -40,7 +40,6 @@ public: TouchReleased, TouchPressed, TouchMoved, - TouchStationary, TouchCancelled }; diff --git a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index b8a3610..201022a 100644 --- a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -451,7 +451,7 @@ bool GraphicsLayerAndroid::repaint(const FloatRect& rect) this, rect.x(), rect.y(), rect.width(), rect.height(), gPaused, m_needsRepaint, m_haveContents); - if (!gPaused && m_haveContents && m_needsRepaint) { + if (!gPaused && m_haveContents && m_needsRepaint && !m_haveImage) { SkAutoPictureRecord arp(m_contentLayer->recordContext(), m_size.width(), m_size.height()); SkCanvas* recordingCanvas = arp.getRecordingCanvas(); @@ -814,11 +814,10 @@ void GraphicsLayerAndroid::setContentsToImage(Image* image) TLOG("(%x) setContentsToImage", this, image); if (image) { m_haveContents = true; - if (!m_haveImage) { - m_haveImage = true; - setNeedsDisplay(); - askForSync(); - } + m_haveImage = true; + m_contentLayer->setContentsImage(image->nativeImageForCurrentFrame()); + setNeedsDisplay(); + askForSync(); } } diff --git a/WebCore/platform/graphics/android/LayerAndroid.cpp b/WebCore/platform/graphics/android/LayerAndroid.cpp index d6ba0a1..7c3f5d4 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.cpp +++ b/WebCore/platform/graphics/android/LayerAndroid.cpp @@ -5,6 +5,7 @@ #include "AndroidAnimation.h" #include "DrawExtra.h" +#include "SkBitmapRef.h" #include "SkCanvas.h" #include "SkDrawFilter.h" #include "SkPaint.h" @@ -50,6 +51,7 @@ LayerAndroid::LayerAndroid(bool isRootLayer) : SkLayer(), m_doRotation(false), m_isFixed(false), m_recordingPicture(0), + m_contentsImage(0), m_extra(0), m_uniqueId(++gUniqueId) { @@ -69,6 +71,8 @@ LayerAndroid::LayerAndroid(const LayerAndroid& layer) : SkLayer(layer), { m_doRotation = layer.m_doRotation; m_isFixed = layer.m_isFixed; + m_contentsImage = layer.m_contentsImage; + m_contentsImage->safeRef(); m_angleTransform = layer.m_angleTransform; m_translation = layer.m_translation; @@ -106,6 +110,7 @@ LayerAndroid::LayerAndroid(SkPicture* picture) : SkLayer(), m_doRotation(false), m_isFixed(false), m_recordingPicture(picture), + m_contentsImage(0), m_extra(0), m_uniqueId(-1) { @@ -120,6 +125,7 @@ LayerAndroid::LayerAndroid(SkPicture* picture) : SkLayer(), LayerAndroid::~LayerAndroid() { removeChildren(); + m_contentsImage->safeUnref(); m_recordingPicture->safeUnref(); m_animations.clear(); gDebugLayerAndroidInstances--; @@ -318,6 +324,10 @@ void LayerAndroid::updatePositions() { } } +void LayerAndroid::setContentsImage(SkBitmapRef* img) { + SkRefCnt_SafeAssign(m_contentsImage, img); +} + void LayerAndroid::onDraw(SkCanvas* canvas, SkScalar opacity) { if (m_haveClip) { SkRect r; @@ -335,7 +345,13 @@ void LayerAndroid::onDraw(SkCanvas* canvas, SkScalar opacity) { if (canvasOpacity < 255) canvas->setDrawFilter(new OpacityDrawFilter(canvasOpacity)); - canvas->drawPicture(*m_recordingPicture); + if (m_contentsImage) { + SkRect dest; + dest.set(0, 0, getSize().width(), getSize().height()); + canvas->drawBitmapRect(m_contentsImage->bitmap(), 0, dest); + } else { + canvas->drawPicture(*m_recordingPicture); + } if (m_extra) m_extra->draw(canvas, this); diff --git a/WebCore/platform/graphics/android/LayerAndroid.h b/WebCore/platform/graphics/android/LayerAndroid.h index e9416c1..2b106d1 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.h +++ b/WebCore/platform/graphics/android/LayerAndroid.h @@ -25,6 +25,14 @@ #include "StringHash.h" #include <wtf/HashMap.h> +#ifndef BZERO_DEFINED +#define BZERO_DEFINED +// http://www.opengroup.org/onlinepubs/000095399/functions/bzero.html +// For maximum portability, it is recommended to replace the function call to bzero() as follows: +#define bzero(b,len) (memset((b), '\0', (len)), (void) 0) +#endif + +class SkBitmapRef; class SkCanvas; class SkMatrix; class SkPicture; @@ -167,6 +175,13 @@ public: int getFixedWidth() { return m_fixedWidth; } int getFixedHeight() { return m_fixedHeight; } + /** This sets a content image -- calling it means we will use + the image directly when drawing the layer instead of using + the content painted by WebKit. See comments below for + m_recordingPicture and m_contentsImage. + */ + void setContentsImage(SkBitmapRef* img); + protected: virtual void onDraw(SkCanvas*, SkScalar opacity); @@ -202,7 +217,14 @@ private: SkScalar m_angleTransform; SkColor m_backgroundColor; + // Note that m_recordingPicture and m_contentsImage are mutually exclusive; + // m_recordingPicture is used when WebKit is asked to paint the layer's + // content, while m_contentsImage contains an image that we directly + // composite, using the layer's dimensions as a destination rect. + // We do this as if the layer only contains an image, directly compositing + // it is a much faster method than using m_recordingPicture. SkPicture* m_recordingPicture; + SkBitmapRef* m_contentsImage; typedef HashMap<String, RefPtr<AndroidAnimation> > KeyframesMap; KeyframesMap m_animations; diff --git a/WebCore/platform/qt/PlatformTouchPointQt.cpp b/WebCore/platform/qt/PlatformTouchPointQt.cpp index c293212..6afe4a1 100644 --- a/WebCore/platform/qt/PlatformTouchPointQt.cpp +++ b/WebCore/platform/qt/PlatformTouchPointQt.cpp @@ -35,7 +35,6 @@ PlatformTouchPoint::PlatformTouchPoint(const QTouchEvent::TouchPoint& point) case Qt::TouchPointReleased: m_state = TouchReleased; break; case Qt::TouchPointMoved: m_state = TouchMoved; break; case Qt::TouchPointPressed: m_state = TouchPressed; break; - case Qt::TouchPointStationary: m_state = TouchStationary; break; } m_screenPos = point.screenPos().toPoint(); m_pos = point.pos().toPoint(); diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 70e96cd..14fd44e 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -2075,14 +2075,6 @@ bool WebViewCore::handleTouchEvent(int action, int x, int y, int metaState) // Track previous touch and if stationary set the state. WebCore::IntPoint pt(x - m_scrollOffsetX, y - m_scrollOffsetY); -// handleTouchEvent() in EventHandler.cpp doesn't handle TouchStationary, which -// causes preventDefault be false when it returns. As our Java side may continue -// process the events if WebKit doesn't, it can cause unexpected result. -// if (type == WebCore::TouchMove && pt == m_lastTouchPoint) -// touchState = WebCore::PlatformTouchPoint::TouchStationary; - - m_lastTouchPoint = pt; - WebCore::PlatformTouchEvent te(pt, type, touchState, metaState); preventDefault = m_mainFrame->eventHandler()->handleTouchEvent(te); #endif diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h index 056dba1..4ed17bf 100644 --- a/WebKit/android/jni/WebViewCore.h +++ b/WebKit/android/jni/WebViewCore.h @@ -558,7 +558,6 @@ namespace android { #if ENABLE(TOUCH_EVENTS) bool m_forwardingTouchEvents; - IntPoint m_lastTouchPoint; #endif #if DEBUG_NAV_UI diff --git a/WebKit/android/nav/CachedPrefix.h b/WebKit/android/nav/CachedPrefix.h index b682288..73a5c2c 100644 --- a/WebKit/android/nav/CachedPrefix.h +++ b/WebKit/android/nav/CachedPrefix.h @@ -43,4 +43,11 @@ #define OFFSETOF(type, field) ((char*)&(((type*)1)->field) - (char*)1) // avoids gnu warning +#ifndef BZERO_DEFINED +#define BZERO_DEFINED +// http://www.opengroup.org/onlinepubs/000095399/functions/bzero.html +// For maximum portability, it is recommended to replace the function call to bzero() as follows: +#define bzero(b,len) (memset((b), '\0', (len)), (void) 0) +#endif + #endif |