Diff
Modified: trunk/LayoutTests/ChangeLog (210826 => 210827)
--- trunk/LayoutTests/ChangeLog 2017-01-17 23:24:46 UTC (rev 210826)
+++ trunk/LayoutTests/ChangeLog 2017-01-17 23:33:22 UTC (rev 210827)
@@ -1,3 +1,12 @@
+2017-01-17 Brady Eidson <beid...@apple.com>
+
+ An update to one gamepad's values should only change that gamepad's modified timestamp.
+ <rdar://problem/28620865> and https://bugs.webkit.org/show_bug.cgi?id=167139
+
+ Reviewed by Andy Estes.
+
+ * gamepad/gamepad-timestamp.html:
+
2017-01-17 Youenn Fablet <you...@apple.com>
Refresh WPT tests up to 73f4ad361ca56d890b5f46d62c3bc84371a77e10
Modified: trunk/LayoutTests/gamepad/gamepad-timestamp.html (210826 => 210827)
--- trunk/LayoutTests/gamepad/gamepad-timestamp.html 2017-01-17 23:24:46 UTC (rev 210826)
+++ trunk/LayoutTests/gamepad/gamepad-timestamp.html 2017-01-17 23:33:22 UTC (rev 210827)
@@ -20,11 +20,21 @@
var rafCount = 0;
var increasingTimestampsSeen = 0;
var timestamp = 0;
+var gamepad2Timestamp = -1;
function rafCallback()
{
var gamepad = navigator.getGamepads()[0];
-
+ var gamepad2 = navigator.getGamepads()[1];
+
+ if (gamepad2Timestamp == -1)
+ gamepad2Timestamp = gamepad2.timestamp;
+
+ if (gamepad2Timestamp != gamepad2.timestamp) {
+ log("Timestamp of gamepad 2 should never change throughout this test, but it did!");
+ finishTest();
+ }
+
if (gamepad.timestamp < timestamp) {
log("Timestamp on gamepad is " + gamepad.timestamp + " which is less than " + timestamp);
finishTest();
@@ -68,6 +78,12 @@
testRunner.setMockGamepadButtonValue(0, 0, 1.0);
testRunner.setMockGamepadButtonValue(0, 1, 1.0);
testRunner.connectMockGamepad(0);
+ testRunner.setMockGamepadDetails(1, "Test Joystick 2", 2, 2);
+ testRunner.setMockGamepadAxisValue(1, 0, 0.7);
+ testRunner.setMockGamepadAxisValue(1, 1, -1.0);
+ testRunner.setMockGamepadButtonValue(1, 0, 1.0);
+ testRunner.setMockGamepadButtonValue(1, 1, 1.0);
+ testRunner.connectMockGamepad(1);
}
</script>
Modified: trunk/Source/WebKit2/ChangeLog (210826 => 210827)
--- trunk/Source/WebKit2/ChangeLog 2017-01-17 23:24:46 UTC (rev 210826)
+++ trunk/Source/WebKit2/ChangeLog 2017-01-17 23:33:22 UTC (rev 210827)
@@ -1,3 +1,29 @@
+2017-01-17 Brady Eidson <beid...@apple.com>
+
+ An update to one gamepad's values should only change that gamepad's modified timestamp.
+ <rdar://problem/28620865> and https://bugs.webkit.org/show_bug.cgi?id=167139
+
+ Reviewed by Andy Estes.
+
+ Track the lastModifiedTime for a gamepad in the UI process, and pass it along to web processes.
+
+ * Shared/Gamepad/GamepadData.cpp:
+ (WebKit::GamepadData::GamepadData):
+ (WebKit::GamepadData::encode):
+ (WebKit::GamepadData::decode):
+ * Shared/Gamepad/GamepadData.h:
+ (WebKit::GamepadData::lastUpdateTime):
+
+ * UIProcess/Gamepad/UIGamepad.cpp:
+ (WebKit::UIGamepad::UIGamepad):
+ (WebKit::UIGamepad::updateFromPlatformGamepad):
+ (WebKit::UIGamepad::condensedGamepadData):
+ (WebKit::UIGamepad::fullGamepadData):
+ * UIProcess/Gamepad/UIGamepad.h:
+
+ * WebProcess/Gamepad/WebGamepad.cpp:
+ (WebKit::WebGamepad::updateValues):
+
2017-01-17 Anders Carlsson <ander...@apple.com>
It's not possible to perform a POST request with HTTPBody content in a WKWebView
Modified: trunk/Source/WebKit2/Shared/Gamepad/GamepadData.cpp (210826 => 210827)
--- trunk/Source/WebKit2/Shared/Gamepad/GamepadData.cpp 2017-01-17 23:24:46 UTC (rev 210826)
+++ trunk/Source/WebKit2/Shared/Gamepad/GamepadData.cpp 2017-01-17 23:33:22 UTC (rev 210827)
@@ -33,18 +33,20 @@
namespace WebKit {
-GamepadData::GamepadData(unsigned index, const Vector<double>& axisValues, const Vector<double>& buttonValues)
+GamepadData::GamepadData(unsigned index, const Vector<double>& axisValues, const Vector<double>& buttonValues, double lastUpdateTime)
: m_index(index)
, m_axisValues(axisValues)
, m_buttonValues(buttonValues)
+ , m_lastUpdateTime(lastUpdateTime)
{
}
-GamepadData::GamepadData(unsigned index, const String& id, const Vector<double>& axisValues, const Vector<double>& buttonValues)
+GamepadData::GamepadData(unsigned index, const String& id, const Vector<double>& axisValues, const Vector<double>& buttonValues, double lastUpdateTime)
: m_index(index)
, m_id(id)
, m_axisValues(axisValues)
, m_buttonValues(buttonValues)
+ , m_lastUpdateTime(lastUpdateTime)
{
}
@@ -54,7 +56,7 @@
if (m_isNull)
return;
- encoder << m_index << m_id << m_axisValues << m_buttonValues;
+ encoder << m_index << m_id << m_axisValues << m_buttonValues << m_lastUpdateTime;
}
bool GamepadData::decode(IPC::Decoder& decoder, GamepadData& data)
@@ -77,6 +79,9 @@
if (!decoder.decode(data.m_buttonValues))
return false;
+ if (!decoder.decode(data.m_lastUpdateTime))
+ return false;
+
return true;
}
Modified: trunk/Source/WebKit2/Shared/Gamepad/GamepadData.h (210826 => 210827)
--- trunk/Source/WebKit2/Shared/Gamepad/GamepadData.h 2017-01-17 23:24:46 UTC (rev 210826)
+++ trunk/Source/WebKit2/Shared/Gamepad/GamepadData.h 2017-01-17 23:33:22 UTC (rev 210827)
@@ -44,8 +44,8 @@
{
}
- GamepadData(unsigned index, const Vector<double>& axisValues, const Vector<double>& buttonValues);
- GamepadData(unsigned index, const String& id, const Vector<double>& axisValues, const Vector<double>& buttonValues);
+ GamepadData(unsigned index, const Vector<double>& axisValues, const Vector<double>& buttonValues, double lastUpdateTime);
+ GamepadData(unsigned index, const String& id, const Vector<double>& axisValues, const Vector<double>& buttonValues, double lastUpdateTime);
void encode(IPC::Encoder&) const;
static bool decode(IPC::Decoder&, GamepadData&);
@@ -52,6 +52,7 @@
bool isNull() const { return m_isNull; }
+ double lastUpdateTime() const { return m_lastUpdateTime; }
unsigned index() const { return m_index; }
const String& id() const { return m_id; }
const Vector<double>& axisValues() const { return m_axisValues; }
@@ -62,6 +63,7 @@
String m_id;
Vector<double> m_axisValues;
Vector<double> m_buttonValues;
+ double m_lastUpdateTime { 0.0 };
bool m_isNull { false };
Modified: trunk/Source/WebKit2/UIProcess/Gamepad/UIGamepad.cpp (210826 => 210827)
--- trunk/Source/WebKit2/UIProcess/Gamepad/UIGamepad.cpp 2017-01-17 23:24:46 UTC (rev 210826)
+++ trunk/Source/WebKit2/UIProcess/Gamepad/UIGamepad.cpp 2017-01-17 23:33:22 UTC (rev 210827)
@@ -38,6 +38,7 @@
UIGamepad::UIGamepad(WebCore::PlatformGamepad& platformGamepad)
: m_index(platformGamepad.index())
, m_id(platformGamepad.id())
+ , m_lastUpdateTime(platformGamepad.lastUpdateTime())
{
m_axisValues.resize(platformGamepad.axisValues().size());
m_buttonValues.resize(platformGamepad.buttonValues().size());
@@ -53,16 +54,17 @@
m_axisValues = platformGamepad.axisValues();
m_buttonValues = platformGamepad.buttonValues();
+ m_lastUpdateTime = platformGamepad.lastUpdateTime();
}
GamepadData UIGamepad::condensedGamepadData() const
{
- return { m_index, m_axisValues, m_buttonValues };
+ return { m_index, m_axisValues, m_buttonValues, m_lastUpdateTime };
}
GamepadData UIGamepad::fullGamepadData() const
{
- return { m_index, m_id, m_axisValues, m_buttonValues };
+ return { m_index, m_id, m_axisValues, m_buttonValues, m_lastUpdateTime };
}
Modified: trunk/Source/WebKit2/UIProcess/Gamepad/UIGamepad.h (210826 => 210827)
--- trunk/Source/WebKit2/UIProcess/Gamepad/UIGamepad.h 2017-01-17 23:24:46 UTC (rev 210826)
+++ trunk/Source/WebKit2/UIProcess/Gamepad/UIGamepad.h 2017-01-17 23:33:22 UTC (rev 210827)
@@ -54,6 +54,7 @@
String m_id;
Vector<double> m_axisValues;
Vector<double> m_buttonValues;
+ double m_lastUpdateTime;
};
}
Modified: trunk/Source/WebKit2/WebProcess/Gamepad/WebGamepad.cpp (210826 => 210827)
--- trunk/Source/WebKit2/WebProcess/Gamepad/WebGamepad.cpp 2017-01-17 23:24:46 UTC (rev 210826)
+++ trunk/Source/WebKit2/WebProcess/Gamepad/WebGamepad.cpp 2017-01-17 23:33:22 UTC (rev 210827)
@@ -67,7 +67,7 @@
m_axisValues = gamepadData.axisValues();
m_buttonValues = gamepadData.buttonValues();
- m_lastUpdateTime = monotonicallyIncreasingTime();
+ m_lastUpdateTime = gamepadData.lastUpdateTime();
}
}