WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
41607
DeviceOrientationEvent should use optional properties
https://bugs.webkit.org/show_bug.cgi?id=41607
Summary
DeviceOrientationEvent should use optional properties
Steve Block
Reported
2010-07-05 05:11:12 PDT
The DeviceOrientation spec (
http://dev.w3.org/geo/api/spec-source-orientation.html
) requires the alpha, beta and gamma properties of DeviceOrientationEvent to all be optional.
Attachments
Patch
(34.11 KB, patch)
2010-07-07 10:53 PDT
,
Steve Block
no flags
Details
Formatted Diff
Diff
Patch
(34.12 KB, patch)
2010-07-07 11:08 PDT
,
Steve Block
no flags
Details
Formatted Diff
Diff
Patch
(34.14 KB, patch)
2010-07-12 04:20 PDT
,
Steve Block
no flags
Details
Formatted Diff
Diff
Patch
(40.86 KB, patch)
2010-07-12 07:36 PDT
,
Steve Block
no flags
Details
Formatted Diff
Diff
Patch
(13.59 KB, patch)
2010-07-12 16:22 PDT
,
Steve Block
no flags
Details
Formatted Diff
Diff
Patch
(41.51 KB, patch)
2010-07-12 16:39 PDT
,
Steve Block
no flags
Details
Formatted Diff
Diff
Patch
(41.53 KB, patch)
2010-07-13 01:42 PDT
,
Steve Block
jorlow
: review+
Details
Formatted Diff
Diff
Show Obsolete
(6)
View All
Add attachment
proposed patch, testcase, etc.
Steve Block
Comment 1
2010-07-07 10:53:33 PDT
Created
attachment 60754
[details]
Patch
Eric Seidel (no email)
Comment 2
2010-07-07 11:02:26 PDT
Attachment 60754
[details]
did not build on mac: Build output:
http://webkit-commit-queue.appspot.com/results/3373471
Steve Block
Comment 3
2010-07-07 11:08:57 PDT
Created
attachment 60756
[details]
Patch
Andreas Kling
Comment 4
2010-07-11 16:25:41 PDT
Comment on
attachment 60756
[details]
Patch
>WebCore/dom/DeviceOrientation.h:66 > + bool m_canProvideAlpha; > + double m_alpha; > + bool m_canProvideBeta; > + double m_beta; > + bool m_canProvideGamma; > + double m_gamma;
This member order will cause unnecessary padding. Better to group the doubles and bools. Patch looks good otherwise.
Steve Block
Comment 5
2010-07-12 04:20:24 PDT
Created
attachment 61208
[details]
Patch
Jeremy Orlow
Comment 6
2010-07-12 05:26:58 PDT
We should avoid adding new custom functions whenever practical. It seems like it might be a bit better to add some new WebCore type that represents a double that could be null. Or have some annotation in the IDL that says to pass a bool/enum ptr to the function and use that to pass back that the result should be null. I'm not completely against the patch as is (hence no r-). Adding japhet to see what he thinks.
Steve Block
Comment 7
2010-07-12 05:38:52 PDT
> We should avoid adding new custom functions whenever practical. It seems like > it might be a bit better to add some new WebCore type that represents a double > that could be null. Or have some annotation in the IDL that says to pass a > bool/enum ptr to the function and use that to pass back that the result should > be null.
Sounds reasonable. I'm totally happy to look into this for a future patch, but it sounds like it might take some time tor reach consensus for the new type/flag. It would be good to land this patch as-is now, as it's blocking progress on DeviceOrientation.
Jeremy Orlow
Comment 8
2010-07-12 06:17:31 PDT
Comment on
attachment 61208
[details]
Patch LayoutTests/fast/dom/DeviceOrientation/script-tests/optional-event-properties.js:39 + event.initDeviceOrientationEvent("", false, false, null, null, null); if you used evalAndLog, then this would be printed to the console too, so it'd be easier to read without much additional effort. WebCore/dom/DeviceOrientation.h:53 + DeviceOrientation() There's enough code here I'd lean towards putting it in a .cpp file. WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp:2 + * Copyright 2010, The Android Open Source Project Since these contributions are for sure from Google, should the copyright just read Google?
Steve Block
Comment 9
2010-07-12 07:01:47 PDT
> LayoutTests/fast/dom/DeviceOrientation/script-tests/optional-event-properties.js:39 > + event.initDeviceOrientationEvent("", false, false, null, null, null); > if you used evalAndLog, then this would be printed to the console too, so it'd be easier to read without much additional effort.
OK, will do
> WebCore/dom/DeviceOrientation.h:53 > + DeviceOrientation() > There's enough code here I'd lean towards putting it in a .cpp file.
OK
> WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp:2 > + * Copyright 2010, The Android Open Source Project > Since these contributions are for sure from Google, should the copyright just read Google?
All of the other DeviceOrientation patches are copyright Android, so I think it's best to stick with this.
Jeremy Orlow
Comment 10
2010-07-12 07:09:50 PDT
(In reply to
comment #9
)
> > LayoutTests/fast/dom/DeviceOrientation/script-tests/optional-event-properties.js:39 > > + event.initDeviceOrientationEvent("", false, false, null, null, null); > > if you used evalAndLog, then this would be printed to the console too, so it'd be easier to read without much additional effort. > OK, will do > > > WebCore/dom/DeviceOrientation.h:53 > > + DeviceOrientation() > > There's enough code here I'd lean towards putting it in a .cpp file. > OK > > > WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp:2 > > + * Copyright 2010, The Android Open Source Project > > Since these contributions are for sure from Google, should the copyright just read Google? > All of the other DeviceOrientation patches are copyright Android, so I think it's best to stick with this.
Theres no reason the copyright needs to match. There also is no strong reason why it needs to be Google rather than the android project beyond the former being closer to WebKit's conventions and the typical reasons for having the latter don't apply in this case (unless there's copied code...?).
Steve Block
Comment 11
2010-07-12 07:36:35 PDT
Created
attachment 61226
[details]
Patch
Jeremy Orlow
Comment 12
2010-07-12 07:49:16 PDT
Comment on
attachment 61226
[details]
Patch r=me
Steve Block
Comment 13
2010-07-12 16:22:24 PDT
Created
attachment 61283
[details]
Patch
Steve Block
Comment 14
2010-07-12 16:39:02 PDT
Created
attachment 61287
[details]
Patch
Steve Block
Comment 15
2010-07-13 01:42:45 PDT
Created
attachment 61345
[details]
Patch
Jeremy Orlow
Comment 16
2010-07-13 02:16:26 PDT
Comment on
attachment 61345
[details]
Patch rubber stamping because I already r+'ed and the diff hasn't changed much in the future, no need to re-upload for minor changes
Steve Block
Comment 17
2010-07-13 02:26:06 PDT
> rubber stamping because I already r+'ed and the diff hasn't changed much
Thanks
> in the future, no need to re-upload for minor changes
I know. I was uploading to use the try-bot to make sure I get the correct incantations for the Windows build. Hopefully this one will work!
Steve Block
Comment 18
2010-07-13 03:37:52 PDT
The Windows EWS bot seems to have given up on my patch. It builds on my local machine, so will land manually and watch the bots.
Steve Block
Comment 19
2010-07-13 04:37:10 PDT
Committed
r63193
: <
http://trac.webkit.org/changeset/63193
>
WebKit Review Bot
Comment 20
2010-07-13 05:00:56 PDT
http://trac.webkit.org/changeset/63193
might have broken GTK Linux 64-bit Debug
Steve Block
Comment 21
2010-07-13 05:38:56 PDT
Fixed with
http://trac.webkit.org/changeset/63195
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug