diff options
-rwxr-xr-x | LayoutTests/platform/android/layout_test_directories.txt | 1 | ||||
-rw-r--r-- | WebCore/config.h | 3 | ||||
-rw-r--r-- | WebCore/dom/Document.cpp | 3 | ||||
-rw-r--r-- | WebCore/dom/Document.h | 8 | ||||
-rw-r--r-- | WebCore/dom/Element.cpp | 3 | ||||
-rw-r--r-- | WebCore/page/Settings.cpp | 6 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/GLUtils.cpp | 5 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/GraphicsContextAndroid.cpp | 11 | ||||
-rw-r--r-- | WebKit/android/jni/DeviceMotionAndOrientationManager.cpp | 3 | ||||
-rw-r--r-- | WebKit/android/jni/WebCoreFrameBridge.cpp | 10 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 3 | ||||
-rw-r--r-- | WebKit/android/nav/CacheBuilder.cpp | 14 | ||||
-rw-r--r-- | WebKit/android/nav/CachedFrame.cpp | 25 | ||||
-rw-r--r-- | WebKit/android/nav/FindCanvas.h | 5 | ||||
-rw-r--r-- | WebKit/android/nav/WebView.cpp | 2 |
15 files changed, 64 insertions, 38 deletions
diff --git a/LayoutTests/platform/android/layout_test_directories.txt b/LayoutTests/platform/android/layout_test_directories.txt index a6abb82..da81ffd 100755 --- a/LayoutTests/platform/android/layout_test_directories.txt +++ b/LayoutTests/platform/android/layout_test_directories.txt @@ -24,7 +24,6 @@ fast/dom/HTMLTableSectionElement fast/dom/Node fast/dom/NodeList fast/dom/Selection -fast/dom/StyleSheet fast/dom/Text fast/dom/TreeWalker fast/dom/beforeload diff --git a/WebCore/config.h b/WebCore/config.h index 70f8a20..5c3a48c 100644 --- a/WebCore/config.h +++ b/WebCore/config.h @@ -202,6 +202,9 @@ // apple-touch-icon support in <link> tags #define ANDROID_APPLE_TOUCH_ICON +// track changes to the style that may change what is drawn +#define ANDROID_STYLE_VERSION + // Enable prefetching when specified via the rel element of <link> elements. #define ENABLE_LINK_PREFETCH 1 diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp index 9dfe6a3..9ad263c 100644 --- a/WebCore/dom/Document.cpp +++ b/WebCore/dom/Document.cpp @@ -371,6 +371,9 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML, con , m_compatibilityMode(NoQuirksMode) , m_compatibilityModeLocked(false) , m_domTreeVersion(0) +#ifdef ANDROID_STYLE_VERSION + , m_styleVersion(0) +#endif , m_styleSheets(StyleSheetList::create(this)) , m_readyState(Complete) , m_styleRecalcTimer(this, &Document::styleRecalcTimerFired) diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h index 1fb7079..25122b5 100644 --- a/WebCore/dom/Document.h +++ b/WebCore/dom/Document.h @@ -873,6 +873,11 @@ public: void incDOMTreeVersion() { ++m_domTreeVersion; } unsigned domTreeVersion() const { return m_domTreeVersion; } +#ifdef ANDROID_STYLE_VERSION + void incStyleVersion() { ++m_styleVersion; } + unsigned styleVersion() const { return m_styleVersion; } +#endif + void setDocType(PassRefPtr<DocumentType>); #if ENABLE(XPATH) @@ -1164,6 +1169,9 @@ private: mutable RefPtr<Element> m_documentElement; unsigned m_domTreeVersion; +#ifdef ANDROID_STYLE_VERSION + unsigned m_styleVersion; +#endif HashSet<NodeIterator*> m_nodeIterators; HashSet<Range*> m_ranges; diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp index 83e129e..10ba71b 100644 --- a/WebCore/dom/Element.cpp +++ b/WebCore/dom/Element.cpp @@ -930,6 +930,9 @@ void Element::recalcStyle(StyleChange change) #endif if ((change > NoChange || needsStyleRecalc())) { +#ifdef ANDROID_STYLE_VERSION + document()->incStyleVersion(); +#endif if (hasRareData()) rareData()->resetComputedStyle(); } diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp index 8e8d43b..aa758c4 100644 --- a/WebCore/page/Settings.cpp +++ b/WebCore/page/Settings.cpp @@ -160,12 +160,12 @@ Settings::Settings(Page* page) , m_interactiveFormValidation(false) , m_usePreHTML5ParserQuirks(false) , m_hyperlinkAuditingEnabled(false) -#if ENABLE(WEB_AUTOFILL) - , m_autoFillEnabled(false) -#endif #ifdef ANDROID_PLUGINS , m_pluginsOnDemand(false) #endif +#if ENABLE(WEB_AUTOFILL) + , m_autoFillEnabled(false) +#endif { // A Frame may not have been created yet, so we initialize the AtomicString // hash before trying to use it. diff --git a/WebCore/platform/graphics/android/GLUtils.cpp b/WebCore/platform/graphics/android/GLUtils.cpp index e9c0796..1c84fe2 100644 --- a/WebCore/platform/graphics/android/GLUtils.cpp +++ b/WebCore/platform/graphics/android/GLUtils.cpp @@ -121,14 +121,15 @@ bool GLUtils::isEGLImageSupported() { const char* eglExtensions = eglQueryString(eglGetCurrentDisplay(), EGL_EXTENSIONS); const char* glExtensions = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)); - return strstr(eglExtensions, "EGL_KHR_image_base") && + return eglExtensions && glExtensions && + strstr(eglExtensions, "EGL_KHR_image_base") && strstr(eglExtensions, "EGL_KHR_gl_texture_2D_image") && strstr(glExtensions, "GL_OES_EGL_image"); } bool GLUtils::isEGLFenceSyncSupported() { const char* eglExtensions = eglQueryString(eglGetCurrentDisplay(), EGL_EXTENSIONS); - return strstr(eglExtensions, "EGL_KHR_fence_sync"); + return eglExtensions && strstr(eglExtensions, "EGL_KHR_fence_sync"); } ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp b/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp index b76f5d5..5d38295 100644 --- a/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp +++ b/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp @@ -70,7 +70,7 @@ template <typename T> T* deepCopyPtr(const T* src) // Is Color premultiplied or not? If it is, then I can't blindly pass it to paint.setColor() struct ShadowRec { - SkScalar blur; // >0 means valid shadow + SkScalar blur; // >=0 means valid shadow SkScalar dx; SkScalar dy; SkColor color; @@ -149,13 +149,13 @@ public: bool setupShadowPaint(SkPaint* paint, SkPoint* offset) { - if (shadow.blur > 0) { + if (shadow.blur >= 0) { paint->setAntiAlias(true); paint->setDither(true); paint->setXfermodeMode(mode); paint->setColor(shadow.color); paint->setMaskFilter(SkBlurMaskFilter::Create(shadow.blur, - SkBlurMaskFilter::kNormal_BlurStyle))->unref(); + SkBlurMaskFilter::kNormal_BlurStyle))->safeUnref(); offset->set(shadow.dx, shadow.dy); return true; } @@ -253,7 +253,7 @@ public: paint->setAntiAlias(m_state->useAA); paint->setDither(true); paint->setXfermodeMode(m_state->mode); - if (m_state->shadow.blur > 0) { + if (m_state->shadow.blur >= 0) { SkDrawLooper* looper = new SkBlurDrawLooper(m_state->shadow.blur, m_state->shadow.dx, m_state->shadow.dy, @@ -944,9 +944,6 @@ void GraphicsContext::setPlatformShadow(const FloatSize& size, float blur, const if (paintingDisabled()) return; - if (blur <= 0) - this->clearPlatformShadow(); - SkColor c; if (color.isValid()) c = color.rgb(); diff --git a/WebKit/android/jni/DeviceMotionAndOrientationManager.cpp b/WebKit/android/jni/DeviceMotionAndOrientationManager.cpp index 9db83a3..8beb372 100644 --- a/WebKit/android/jni/DeviceMotionAndOrientationManager.cpp +++ b/WebKit/android/jni/DeviceMotionAndOrientationManager.cpp @@ -53,8 +53,7 @@ void DeviceMotionAndOrientationManager::useMock() void DeviceMotionAndOrientationManager::setMockMotion(PassRefPtr<DeviceMotionData> motion) { - if (m_useMock) - ; // TODO: There is not yet a DeviceMotion mock. + // TODO: There is not yet a DeviceMotion mock. } void DeviceMotionAndOrientationManager::onMotionChange(PassRefPtr<DeviceMotionData> motion) diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp index 04db4a9..85314cc 100644 --- a/WebKit/android/jni/WebCoreFrameBridge.cpp +++ b/WebKit/android/jni/WebCoreFrameBridge.cpp @@ -585,7 +585,7 @@ WebFrame::loadStarted(WebCore::Frame* frame) return; JNIEnv* env = getJNIEnv(); - WTF::String urlString(url.string()); + const WTF::String& urlString = url.string(); // If this is the main frame and we already have a favicon in the database, // send it along with the page started notification. jobject favicon = NULL; @@ -650,7 +650,7 @@ WebFrame::didFinishLoad(WebCore::Frame* frame) bool isMainFrame = (!frame->tree() || !frame->tree()->parent()); WebCore::FrameLoadType loadType = loader->loadType(); - WTF::String urlString(url.string()); + const WTF::String& urlString = url.string(); jstring urlStr = WtfStringToJstring(env, urlString); env->CallVoidMethod(mJavaFrame->frame(env).get(), mJavaFrame->mLoadFinished, urlStr, (int)loadType, isMainFrame); @@ -784,7 +784,7 @@ WebFrame::updateVisitedHistory(const WebCore::KURL& url, bool reload) #ifdef ANDROID_INSTRUMENT TimeCounterAuto counter(TimeCounter::JavaCallbackTimeCounter); #endif - WTF::String urlStr(url.string()); + const WTF::String& urlStr = url.string(); JNIEnv* env = getJNIEnv(); jstring jUrlStr = WtfStringToJstring(env, urlStr); @@ -802,14 +802,14 @@ WebFrame::canHandleRequest(const WebCore::ResourceRequest& request) // always handle "POST" in place if (equalIgnoringCase(request.httpMethod(), "POST")) return true; - WebCore::KURL requestUrl = request.url(); + const WebCore::KURL& requestUrl = request.url(); bool isUserGesture = UserGestureIndicator::processingUserGesture(); if (!mUserInitiatedAction && !isUserGesture && (requestUrl.protocolIs("http") || requestUrl.protocolIs("https") || requestUrl.protocolIs("file") || requestUrl.protocolIs("about") || WebCore::protocolIsJavaScript(requestUrl.string()))) return true; - WTF::String url(request.url().string()); + const WTF::String& url = requestUrl.string(); // Empty urls should not be sent to java if (url.isEmpty()) return true; diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index deae37f..64b53c4 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -675,7 +675,8 @@ void WebViewCore::recordPictureSet(PictureSet* content) // as domTreeVersion only increment, we can just check the sum to see // whether we need to update the frame cache for (Frame* frame = m_mainFrame; frame; frame = frame->tree()->traverseNext()) { - latestVersion += frame->document()->domTreeVersion(); + const Document* doc = frame->document(); + latestVersion += doc->domTreeVersion() + doc->styleVersion(); } } DBG_NAV_LOGD("m_lastFocused=%p oldFocusNode=%p" diff --git a/WebKit/android/nav/CacheBuilder.cpp b/WebKit/android/nav/CacheBuilder.cpp index a7015e7..1643a0d 100644 --- a/WebKit/android/nav/CacheBuilder.cpp +++ b/WebKit/android/nav/CacheBuilder.cpp @@ -2835,9 +2835,11 @@ tryNextCheckType: while ((index = exported->find(',', index)) >= 0) exported->replace(index, 1, escapedComma); } break; - case EMAIL_CACHEDNODETYPE: + case EMAIL_CACHEDNODETYPE: { + String encoded = WebCore::encodeWithURLEscapeSequences(*exported); + exported->swap(encoded); exported->insert(WTF::String("mailto:"), 0); - break; + } break; case PHONE_CACHEDNODETYPE: exported->insert(WTF::String("tel:"), 0); break; @@ -2853,9 +2855,13 @@ noTextMatch: bool CacheBuilder::IsMailboxChar(UChar ch) { - static const unsigned body[] = {0x03ff6000, 0x87fffffe, 0x07fffffe}; // 0-9 . - A-Z _ a-z + // According to http://en.wikipedia.org/wiki/Email_address + // ! # $ % & ' * + - . / 0-9 = ? + // A-Z ^ _ + // ` a-z { | } ~ + static const unsigned body[] = {0xa3ffecfa, 0xc7fffffe, 0x7fffffff}; ch -= 0x20; - if (ch > 'z' - 0x20) + if (ch > '~' - 0x20) return false; return (body[ch >> 5] & 1 << (ch & 0x1f)) != 0; } diff --git a/WebKit/android/nav/CachedFrame.cpp b/WebKit/android/nav/CachedFrame.cpp index e331464..8f0df7a 100644 --- a/WebKit/android/nav/CachedFrame.cpp +++ b/WebKit/android/nav/CachedFrame.cpp @@ -52,13 +52,15 @@ WebCore::IntRect CachedFrame::adjustBounds(const CachedNode* node, #if USE(ACCELERATED_COMPOSITING) const CachedLayer* cachedLayer = layer(node); const WebCore::LayerAndroid* rootLayer = mRoot->rootLayer(); - IntRect rrect = cachedLayer->adjustBounds(rootLayer, rect); - if (!cachedLayer->layer(rootLayer)->contentIsScrollable()) - rrect.move(-mViewBounds.x(), -mViewBounds.y()); - return rrect; -#else - return rect; + const LayerAndroid* aLayer = cachedLayer->layer(rootLayer); + if (aLayer) { + IntRect rrect = cachedLayer->adjustBounds(rootLayer, rect); + if (!aLayer->contentIsScrollable()) + rrect.move(-mViewBounds.x(), -mViewBounds.y()); + return rrect; + } #endif + return rect; } // This is for nodes inside a layer. It takes an IntRect that has been @@ -71,10 +73,13 @@ WebCore::IntRect CachedFrame::unadjustBounds(const CachedNode* node, if (node->isInLayer()) { const CachedLayer* cachedLayer = layer(node); const WebCore::LayerAndroid* rootLayer = mRoot->rootLayer(); - IntRect rrect = cachedLayer->unadjustBounds(rootLayer, rect); - if (!cachedLayer->layer(rootLayer)->contentIsScrollable()) - rrect.move(mViewBounds.x(), mViewBounds.y()); - return rrect; + const LayerAndroid* aLayer = cachedLayer->layer(rootLayer); + if (aLayer) { + IntRect rrect = cachedLayer->unadjustBounds(rootLayer, rect); + if (!aLayer->contentIsScrollable()) + rrect.move(mViewBounds.x(), mViewBounds.y()); + return rrect; + } } #endif return rect; diff --git a/WebKit/android/nav/FindCanvas.h b/WebKit/android/nav/FindCanvas.h index 903279c..2aba8e0 100644 --- a/WebKit/android/nav/FindCanvas.h +++ b/WebKit/android/nav/FindCanvas.h @@ -33,8 +33,9 @@ #include "SkPicture.h" #include "SkRegion.h" #include "SkTDArray.h" -#include "icu/unicode/umachine.h" -#include "wtf/Vector.h" + +#include <unicode/umachine.h> +#include <wtf/Vector.h> namespace android { diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index d754af5..9579509 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -885,7 +885,7 @@ void selectBestAt(const WebCore::IntRect& rect) { const CachedFrame* frame; int rx, ry; - CachedRoot* root = getFrameCache(DontAllowNewer); + CachedRoot* root = getFrameCache(AllowNewer); const CachedNode* node = findAt(root, rect, &frame, &rx, &ry); if (!node) { |