summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--LayoutTests/storage/indexeddb/database-description-expected.txt74
-rw-r--r--LayoutTests/storage/indexeddb/database-description.html13
-rw-r--r--LayoutTests/storage/indexeddb/script-tests/database-description.js56
-rw-r--r--LayoutTests/storage/sql-error-codes-expected.txt11
-rw-r--r--WebCore/config.h4
-rw-r--r--WebCore/rendering/HitTestResult.cpp17
-rw-r--r--WebCore/rendering/RenderBlock.cpp9
-rw-r--r--WebCore/rendering/RenderBox.cpp5
-rw-r--r--WebCore/rendering/RenderLayer.cpp6
-rw-r--r--WebCore/rendering/RenderLineBoxList.cpp3
-rw-r--r--WebCore/rendering/RenderSVGRoot.cpp7
-rw-r--r--WebKit/android/jni/WebViewCore.cpp22
-rw-r--r--WebKit/android/nav/WebView.cpp3
13 files changed, 168 insertions, 62 deletions
diff --git a/LayoutTests/storage/indexeddb/database-description-expected.txt b/LayoutTests/storage/indexeddb/database-description-expected.txt
new file mode 100644
index 0000000..c90d33d
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/database-description-expected.txt
@@ -0,0 +1,74 @@
+Test IDBFactory.open's description parameter.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS 'indexedDB' in window is true
+PASS indexedDB == null is false
+indexedDB.open('abcd', 'first')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.result.description is "first"
+indexedDB.open('abcd', 'second')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS firstDB.description is "first"
+PASS secondDB.description is "second"
+indexedDB.open('abcd')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'abort' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'abort' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS firstDB.description is "first"
+PASS secondDB.description is "second"
+PASS event.result.description is "second"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/database-description.html b/LayoutTests/storage/indexeddb/database-description.html
new file mode 100644
index 0000000..ca6a4d6
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/database-description.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../fast/js/resources/js-test-post-function.js"></script>
+<script src="resources/shared.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/database-description.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/script-tests/database-description.js b/LayoutTests/storage/indexeddb/script-tests/database-description.js
new file mode 100644
index 0000000..bb4acba
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/script-tests/database-description.js
@@ -0,0 +1,56 @@
+description("Test IDBFactory.open's description parameter.");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function test()
+{
+ shouldBeTrue("'indexedDB' in window");
+ shouldBeFalse("indexedDB == null");
+
+ result = evalAndLog("indexedDB.open('abcd', 'first')");
+ verifyResult(result);
+ result.onsuccess = firstSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function firstSuccess()
+{
+ verifySuccessEvent(event);
+ window.firstDB = event.result;
+
+ shouldBeEqualToString('event.result.description', 'first');
+
+ result = evalAndLog("indexedDB.open('abcd', 'second')");
+ verifyResult(result);
+ result.onsuccess = secondSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function secondSuccess()
+{
+ verifySuccessEvent(event);
+ window.secondDB = event.result;
+
+ shouldBeEqualToString('firstDB.description', 'first');
+ shouldBeEqualToString('secondDB.description', 'second');
+
+ result = evalAndLog("indexedDB.open('abcd')");
+ verifyResult(result);
+ result.onsuccess = thirdSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function thirdSuccess()
+{
+ verifySuccessEvent(event);
+
+ shouldBeEqualToString('firstDB.description', 'first');
+ shouldBeEqualToString('secondDB.description', 'second');
+ shouldBeEqualToString('event.result.description', 'second');
+
+ done();
+}
+
+test();
+
+var successfullyParsed = true;
diff --git a/LayoutTests/storage/sql-error-codes-expected.txt b/LayoutTests/storage/sql-error-codes-expected.txt
new file mode 100644
index 0000000..1a9caa7
--- /dev/null
+++ b/LayoutTests/storage/sql-error-codes-expected.txt
@@ -0,0 +1,11 @@
+CONSOLE MESSAGE: line 0: Exception thrown in transaction callback.
+CONSOLE MESSAGE: line 0: Cannot call toString() on this object.
+This test tests the error codes reported in exceptional situations.
+PASS: expected and got error code UNKNOWN_ERR
+PASS: expected and got error code UNKNOWN_ERR
+PASS: expected and got error code SYNTAX_ERR
+PASS: expected and got error code SYNTAX_ERR
+PASS: expected and got error code UNKNOWN_ERR
+PASS: expected and got error code QUOTA_ERR
+PASS: expected and got error code VERSION_ERR
+
diff --git a/WebCore/config.h b/WebCore/config.h
index 0575422..188f212 100644
--- a/WebCore/config.h
+++ b/WebCore/config.h
@@ -200,9 +200,6 @@
// Enable prefetching when specified via the rel element of <link> elements.
#define ENABLE_LINK_PREFETCH 1
-// Enable hit test with point plus a size
-#define ANDROID_HITTEST_WITHSIZE
-
// Enable scrollable divs in separate layers. This might be upstreamed to
// webkit.org but for now, it is just an Android feature.
#define ENABLE_ANDROID_OVERFLOW_SCROLL 1
@@ -318,4 +315,3 @@ typedef float CGFloat;
#if PLATFORM(WIN) && PLATFORM(CG)
#define WTF_USE_SAFARI_THEME 1
#endif
-
diff --git a/WebCore/rendering/HitTestResult.cpp b/WebCore/rendering/HitTestResult.cpp
index 8a986d6..dd96e0e 100644
--- a/WebCore/rendering/HitTestResult.cpp
+++ b/WebCore/rendering/HitTestResult.cpp
@@ -57,13 +57,9 @@ HitTestResult::HitTestResult(const IntPoint& centerPoint, const IntSize& padding
: m_point(centerPoint)
, m_isOverWidget(false)
{
-#ifdef ANDROID_HITTEST_WITHSIZE
- m_isRectBased = !padding.isEmpty();
-#else
// If a zero padding is passed in or either width or height is negative, then it
// is not a valid padding and hence not a rect based hit test.
m_isRectBased = !(padding.isZero() || (padding.width() < 0 || padding.height() < 0));
-#endif
m_padding = m_isRectBased ? padding : IntSize();
}
@@ -76,16 +72,12 @@ HitTestResult::HitTestResult(const HitTestResult& other)
, m_scrollbar(other.scrollbar())
, m_isOverWidget(other.isOverWidget())
{
-#ifndef ANDROID_HITTEST_WITHSIZE
// Only copy the padding and ListHashSet in case of rect hit test.
// Copying the later is rather expensive.
if ((m_isRectBased = other.isRectBasedTest())) {
-#endif
m_padding = other.padding();
m_rectBasedTestResult = other.rectBasedTestResult();
-#ifndef ANDROID_HITTEST_WITHSIZE
}
-#endif
}
HitTestResult::~HitTestResult()
@@ -101,16 +93,12 @@ HitTestResult& HitTestResult::operator=(const HitTestResult& other)
m_innerURLElement = other.URLElement();
m_scrollbar = other.scrollbar();
m_isOverWidget = other.isOverWidget();
-#ifndef ANDROID_HITTEST_WITHSIZE
// Only copy the padding and ListHashSet in case of rect hit test.
// Copying the later is rather expensive.
if ((m_isRectBased = other.isRectBasedTest())) {
-#endif
m_padding = other.padding();
m_rectBasedTestResult = other.rectBasedTestResult();
-#ifndef ANDROID_HITTEST_WITHSIZE
}
-#endif
return *this;
}
@@ -404,17 +392,12 @@ bool HitTestResult::addNodeToRectBasedTestResult(Node* node, int x, int y, const
if (!isRectBasedTest())
return false;
-#ifdef ANDROID_HITTEST_WITHSIZE
- if (node)
- m_rectBasedTestResult.add(node);
-#else
// If node is null, return true so the hit test can continue.
if (!node)
return true;
node = node->shadowAncestorNode();
m_rectBasedTestResult.add(node);
-#endif
return !rect.contains(rectFromPoint(x, y));
}
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index 574d389..02b0079 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -3774,17 +3774,8 @@ bool RenderBlock::nodeAtPoint(const HitTestRequest& request, HitTestResult& resu
if ((hitTestAction == HitTestBlockBackground || hitTestAction == HitTestChildBlockBackground) && isPointInOverflowControl(result, _x, _y, tx, ty)) {
updateHitTestResult(result, IntPoint(_x - tx, _y - ty));
// FIXME: isPointInOverflowControl() doesn't handle rect-based tests yet.
-#ifdef ANDROID_HITTEST_WITHSIZE
- // FIXME: This looks wrong - the return value does not depend on the hit test result.
- result.addNodeToRectBasedTestResult(node(), _x, _y);
- if (result.isRectBasedTest())
- ASSERT(node() || isAnonymous());
- else
- return true;
-#else
if (!result.addNodeToRectBasedTestResult(node(), _x, _y))
return true;
-#endif
}
// If we have clipping, then we can't have any spillout.
diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp
index 8a3ea8e..d614081 100644
--- a/WebCore/rendering/RenderBox.cpp
+++ b/WebCore/rendering/RenderBox.cpp
@@ -35,9 +35,6 @@
#include "htmlediting.h"
#include "HTMLElement.h"
#include "HTMLNames.h"
-#ifdef ANDROID_HITTEST_WITHSIZE
-#include "HitTestResult.h"
-#endif
#include "ImageBuffer.h"
#include "FloatQuad.h"
#include "Frame.h"
@@ -563,6 +560,8 @@ bool RenderBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result
}
}
+ // Check our bounds next. For this purpose always assume that we can only be hit in the
+ // foreground phase (which is true for replaced elements like images).
IntRect boundsRect = IntRect(tx, ty, width(), height());
if (visibleToHitTesting() && action == HitTestForeground && boundsRect.intersects(result.rectFromPoint(xPos, yPos))) {
updateHitTestResult(result, IntPoint(xPos - tx, yPos - ty));
diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp
index 7c63af9..df80a7c 100644
--- a/WebCore/rendering/RenderLayer.cpp
+++ b/WebCore/rendering/RenderLayer.cpp
@@ -2997,15 +2997,9 @@ RenderLayer* RenderLayer::hitTestList(Vector<RenderLayer*>* list, RenderLayer* r
result.append(tempResult);
if (isHitCandidate(hitLayer, depthSortDescendants, zOffset, unflattenedTransformState)) {
-#ifdef ANDROID_HITTEST_WITHSIZE
- if (!result.isRectBasedTest())
- resultLayer = hitLayer;
- result = tempResult;
-#else
resultLayer = hitLayer;
if (!result.isRectBasedTest())
result = tempResult;
-#endif
if (!depthSortDescendants)
break;
}
diff --git a/WebCore/rendering/RenderLineBoxList.cpp b/WebCore/rendering/RenderLineBoxList.cpp
index d8b4e75..4d0dcd6 100644
--- a/WebCore/rendering/RenderLineBoxList.cpp
+++ b/WebCore/rendering/RenderLineBoxList.cpp
@@ -31,9 +31,6 @@
#include "HitTestResult.h"
#include "InlineTextBox.h"
-#ifdef ANDROID_HITTEST_WITHSIZE
-#include "HitTestResult.h"
-#endif
#include "RenderArena.h"
#include "RenderInline.h"
#include "RenderView.h"
diff --git a/WebCore/rendering/RenderSVGRoot.cpp b/WebCore/rendering/RenderSVGRoot.cpp
index 75e2bd2..b66a870 100644
--- a/WebCore/rendering/RenderSVGRoot.cpp
+++ b/WebCore/rendering/RenderSVGRoot.cpp
@@ -334,14 +334,7 @@ bool RenderSVGRoot::nodeAtPoint(const HitTestRequest& request, HitTestResult& re
updateHitTestResult(result, pointInBorderBox);
// FIXME: nodeAtFloatPoint() doesn't handle rect-based hit tests yet.
result.addNodeToRectBasedTestResult(child->node(), _x, _y);
-#ifdef ANDROID_HITTEST_WITHSIZE
- if (result.isRectBasedTest())
- ASSERT(node() || isAnonymous());
- else
- return true;
-#else
return true;
-#endif
}
}
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index e81e335..42aa718 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -1403,7 +1403,6 @@ Vector<IntRect> WebViewCore::getTouchHighlightRects(int x, int y, int slop)
{
Vector<IntRect> rects;
m_mousePos = IntPoint(x - m_scrollOffsetX, y - m_scrollOffsetY);
-#ifdef ANDROID_HITTEST_WITHSIZE
HitTestResult hitTestResult = m_mainFrame->eventHandler()->hitTestResultAtPoint(IntPoint(x, y),
false, false, DontHitTestScrollbars, HitTestRequest::Active | HitTestRequest::ReadOnly, IntSize(slop, slop));
if (!hitTestResult.innerNode() || !hitTestResult.innerNode()->inDocument()) {
@@ -1437,7 +1436,7 @@ Vector<IntRect> WebViewCore::getTouchHighlightRects(int x, int y, int slop)
found = true;
break;
}
- // the nodes in the rawNodeList() are ordered based on z-index during hit testing.
+ // the nodes in the rectBasedTestResult() are ordered based on z-index during hit testing.
// so do not search for the eventNode across explicit z-index border.
// TODO: this is a hard one to call. z-index is quite complicated as its value only
// matters when you compare two RenderLayer in the same hierarchy level. e.g. in
@@ -1618,7 +1617,6 @@ Vector<IntRect> WebViewCore::getTouchHighlightRects(int x, int y, int slop)
m_scrollOffsetX, m_scrollOffsetY);
}
}
-#endif
return rects;
}
@@ -2340,15 +2338,15 @@ void WebViewCore::touchUp(int touchGeneration,
frame = 0;
DBG_NAV_LOGD("touch up on (%d, %d), scrollOffset is (%d, %d), node:%p, frame:%p", m_mousePos.x() + m_scrollOffsetX, m_mousePos.y() + m_scrollOffsetY, m_scrollOffsetX, m_scrollOffsetY, node, frame);
} else {
- if (m_touchGeneration > touchGeneration) {
- DBG_NAV_LOGD("m_touchGeneration=%d > touchGeneration=%d"
- " x=%d y=%d", m_touchGeneration, touchGeneration, x, y);
- return; // short circuit if a newer touch has been generated
- }
- // This moves m_mousePos to the correct place, and handleMouseClick uses
- // m_mousePos to determine where the click happens.
- moveMouse(frame, x, y);
- m_lastGeneration = touchGeneration;
+ if (m_touchGeneration > touchGeneration) {
+ DBG_NAV_LOGD("m_touchGeneration=%d > touchGeneration=%d"
+ " x=%d y=%d", m_touchGeneration, touchGeneration, x, y);
+ return; // short circuit if a newer touch has been generated
+ }
+ // This moves m_mousePos to the correct place, and handleMouseClick uses
+ // m_mousePos to determine where the click happens.
+ moveMouse(frame, x, y);
+ m_lastGeneration = touchGeneration;
}
if (frame && CacheBuilder::validNode(m_mainFrame, frame, 0)) {
frame->loader()->resetMultipleFormSubmissionProtection();
diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp
index c061461..e12dc52 100644
--- a/WebKit/android/nav/WebView.cpp
+++ b/WebKit/android/nav/WebView.cpp
@@ -265,7 +265,7 @@ void nativeRecordButtons(bool hasFocus, bool pressed, bool invalidate)
// button
if (!hasFocus) {
state = WebCore::RenderSkinAndroid::kNormal;
- } else if (pressed) {
+ } else if (pressed || m_ring.m_isPressed) {
state = WebCore::RenderSkinAndroid::kPressed;
} else {
state = WebCore::RenderSkinAndroid::kFocused;
@@ -957,6 +957,7 @@ void showCursorTimed()
void showCursorUntimed()
{
DBG_NAV_LOG("");
+ m_ring.m_isPressed = false;
m_ringAnimationEnd = UINT_MAX;
viewInvalidate();
}