PASS emptyTouch.pageY is 0
PASS emptyTouch.screenX is 0
PASS emptyTouch.screenY is 0
+PASS badParamsTouch is non-null.
+PASS badParamsTouch.target is null
+PASS badParamsTouch.identifier is 0
+PASS badParamsTouch.pageX is 0
+PASS badParamsTouch.pageY is 0
+PASS badParamsTouch.screenX is 0
+PASS badParamsTouch.screenY is 104
PASS successfullyParsed is true
TEST COMPLETE
shouldBe("emptyTouch.screenX", "0");
shouldBe("emptyTouch.screenY", "0");
+// Try invoking with incorrect parameter types.
+var badParamsTouch = document.createTouch(function(x) { return x; }, 12, 'a', 'b', 'c', function(x) { return x; }, 104);
+shouldBeNonNull("badParamsTouch");
+shouldBeNull("badParamsTouch.target");
+shouldBe("badParamsTouch.identifier", "0");
+shouldBe("badParamsTouch.pageX", "0");
+shouldBe("badParamsTouch.pageY", "0");
+shouldBe("badParamsTouch.screenX", "0");
+shouldBe("badParamsTouch.screenY", "104");
+
successfullyParsed = true;
isSuccessfullyParsed();
#endif
#if ENABLE(TOUCH_EVENTS)
-PassRefPtr<Touch> Document::createTouch(DOMWindow* window, Node* target, int identifier, int pageX, int pageY, int screenX, int screenY, ExceptionCode&) const
+PassRefPtr<Touch> Document::createTouch(DOMWindow* window, EventTarget* target, int identifier, int pageX, int pageY, int screenX, int screenY, ExceptionCode&) const
{
+ // FIXME: It's not clear from the documentation at
+ // http://developer.apple.com/library/safari/#documentation/UserExperience/Reference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html
+ // when this method should throw and nor is it by inspection of iOS behavior. It would be nice to verify any cases where it throws under iOS
+ // and implement them here. See https://bugs.webkit.org/show_bug.cgi?id=47819
+ // Ditto for the createTouchList method below.
Frame* frame = window ? window->frame() : this->frame();
return Touch::create(frame, target, identifier, screenX, screenY, pageX, pageY);
}
void setContainsValidityStyleRules() { m_containsValidityStyleRules = true; }
#if ENABLE(TOUCH_EVENTS)
- PassRefPtr<Touch> createTouch(DOMWindow*, Node*, int identifier, int pageX, int pageY, int screenX, int screenY, ExceptionCode&) const;
+ PassRefPtr<Touch> createTouch(DOMWindow*, EventTarget*, int identifier, int pageX, int pageY, int screenX, int screenY, ExceptionCode&) const;
PassRefPtr<TouchList> createTouchList(ExceptionCode&) const;
#endif
attribute [DontEnum] EventListener ontouchmove;
attribute [DontEnum] EventListener ontouchend;
attribute [DontEnum] EventListener ontouchcancel;
+#endif
+#endif
+
+#if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
[ReturnsNew] Touch createTouch(in DOMWindow window,
- in Node target,
+ in EventTarget target,
in long identifier,
in long pageX,
in long pageY,
[ReturnsNew] TouchList createTouchList()
raises (DOMException);
#endif
-#endif
+
};
}