-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync DeviceMotionEvent
as per web specification
#26001
base: main
Are you sure you want to change the base?
Sync DeviceMotionEvent
as per web specification
#26001
Conversation
EWS run on previous version of this PR (hash 36efca1) |
36efca1
to
d29e964
Compare
EWS run on previous version of this PR (hash d29e964) |
d29e964
to
6063077
Compare
EWS run on previous version of this PR (hash 6063077) |
[ | ||
Conditional=DEVICE_ORIENTATION, | ||
Exposed=Window | ||
] interface DeviceMotionEvent : Event { | ||
// FIXME: Add `constructor` by uncommenting below. | ||
// constructor(DOMString type, optional DeviceMotionEventInit eventInitDict = {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should just add constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ahmad-S792 did you have a chance to check this? Or do you need help.
I'm asking because of the recent bug
https://bugs.webkit.org/show_bug.cgi?id=271891
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't looked into it yet but I manage to fix another [SecureContext]
issue in these though. So some progress but not directly on constructor
side. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@karlcow - I just rebased it and added few more alignments but still working on how to add 'constructor'. Although it did progressed one or two WPT tests.
6063077
to
60ce731
Compare
EWS run on previous version of this PR (hash 60ce731) |
DeviceMotionEvent.initDeviceMotionEvent
DeviceMotionEvent
as per web specification
https://bugs.webkit.org/show_bug.cgi?id=271098 rdar://problem/125271931 Reviewed by NOBODY (OOPS!). This patch aligns WebKit with Blink / Chrome and Web Specification [1]: [1] https://w3c.github.io/deviceorientation/#device-motion-event-api By removing `initDeviceMotionEvent`, WebKit aligns with Web Specification and Blink also removed it in 2017 via below commit: Reference: https://chromium.googlesource.com/chromium/src.git/+/0921e8319f228e406019b434701ac9f181ee8ea1 Additionally, it adds [SecureContext] and also make 'interval' non-nullable. Also adding '=null' values for 'Accelerate' and 'Rotate' dictonaries. NOTE: We cannot update test to leverage constructor, since we don't have support for it. e.g., `event.initDeviceMotionEvent` changed to `event = new DeviceMotionEvent` Additionally, we have same test as WPT with similar name. Although, it is `https` due to being `SecureContext`. For future, I am adding few FIXME as well in IDL file to align with web specification. * Source/WebCore/dom/DeviceMotionEvent.cpp: (convert): DeviceMotionEvent::Acceleration (convert): DeviceMotionEvent::RotationRate (DeviceMotionEvent::initDeviceMotionEvent): * Source/WebCore/dom/DeviceMotionEvent.h: * Source/WebCore/dom/DeviceMotionEvent.idl: * Source/WebCore/bindings/js/WebCoreBuiltinNames.h: Add macro for 'SecureContext' * Source/WebCore/dom/DeviceMotionData.cpp: (DeviceMotionData::create): Update argument to remove std::optional<> (DeviceMotionData::DeviceMotionData): Ditto * Source/WebCore/dom/DeviceMotionData.h: * Source/WebCore/dom/DeviceMotionEvent.cpp: (DeviceMotionEvent::interval): * Source/WebCore/dom/DeviceMotionEvent.h: * LayoutTests/fast/dom/DeviceMotion/optional-event-properties.html: Rebaselined * LayoutTests/fast/dom/DeviceMotion/optional-event-properties-expected.txt: Rebaselined
60ce731
to
4db865a
Compare
EWS run on current version of this PR (hash 4db865a) |
Just rebasing and will see if I can fix it. |
4db865a