| Differences between
and this patch
- WebCore/ChangeLog +49 lines
Lines 1-3 WebCore/ChangeLog_sec1
1
2010-07-12  Steve Block  <steveblock@google.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        DeviceOrientationEvent should use optional properties
6
        https://bugs.webkit.org/show_bug.cgi?id=41607
7
8
        This change adds a new DeviceOrientation class which takes care of which of the
9
        optional properties are present. DeviceOrientationEvent owns an instance of
10
        DeviceOrientation, rather than owning the properties directly.
11
        DeviceOrientationEvent now requires custom bindings.
12
13
        Test: fast/dom/DeviceOrientation/optional-event-properties.html
14
15
        * Android.jscbindings.mk:
16
        * Android.v8bindings.mk:
17
        * CMakeLists.txt:
18
        * GNUmakefile.am:
19
        * WebCore.gypi:
20
        * WebCore.pro:
21
        * WebCore.vcproj/WebCore.vcproj:
22
        * WebCore.xcodeproj/project.pbxproj:
23
        * bindings/js/JSDeviceOrientationEventCustom.cpp: Added.
24
        (WebCore::JSDeviceOrientationEvent::alpha):
25
        (WebCore::JSDeviceOrientationEvent::beta):
26
        (WebCore::JSDeviceOrientationEvent::gamma):
27
        (WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
28
        * bindings/v8/custom/V8DeviceOrientationEventCustom.cpp: Added.
29
        (WebCore::V8DeviceOrientationEvent::alphaAccessorGetter):
30
        (WebCore::V8DeviceOrientationEvent::betaAccessorGetter):
31
        (WebCore::V8DeviceOrientationEvent::gammaAccessorGetter):
32
        (WebCore::V8DeviceOrientationEvent::initDeviceOrientationEventCallback):
33
        * dom/DeviceOrientation.h: Added.
34
        (WebCore::DeviceOrientation::create):
35
        (WebCore::DeviceOrientation::canProvideAlpha):
36
        (WebCore::DeviceOrientation::alpha):
37
        (WebCore::DeviceOrientation::canProvideBeta):
38
        (WebCore::DeviceOrientation::beta):
39
        (WebCore::DeviceOrientation::canProvideGamma):
40
        (WebCore::DeviceOrientation::gamma):
41
        (WebCore::DeviceOrientation::DeviceOrientation):
42
        * dom/DeviceOrientationEvent.cpp:
43
        (WebCore::DeviceOrientationEvent::DeviceOrientationEvent):
44
        (WebCore::DeviceOrientationEvent::initDeviceOrientationEvent):
45
        * dom/DeviceOrientationEvent.h:
46
        (WebCore::DeviceOrientationEvent::create):
47
        (WebCore::DeviceOrientationEvent::orientation):
48
        * dom/DeviceOrientationEvent.idl:
49
1
2010-07-12  Pavel Feldman  <pfeldman@chromium.org>
50
2010-07-12  Pavel Feldman  <pfeldman@chromium.org>
2
51
3
        Not reviewed. Chromium tests fix.
52
        Not reviewed. Chromium tests fix.
- WebCore/Android.jscbindings.mk -3 / +4 lines
Lines 80-98 LOCAL_SRC_FILES += \ WebCore/Android.jscbindings.mk_sec1
80
	bindings/js/JSCustomSQLTransactionCallback.cpp \
80
	bindings/js/JSCustomSQLTransactionCallback.cpp \
81
	bindings/js/JSCustomSQLTransactionErrorCallback.cpp \
81
	bindings/js/JSCustomSQLTransactionErrorCallback.cpp \
82
	bindings/js/JSCustomVoidCallback.cpp \
82
	bindings/js/JSCustomVoidCallback.cpp \
83
	bindings/js/JSDatabaseCallback.cpp \
84
	bindings/js/JSDesktopNotificationsCustom.cpp \
85
	bindings/js/JSDOMApplicationCacheCustom.cpp \
83
	bindings/js/JSDOMApplicationCacheCustom.cpp \
86
	bindings/js/JSDOMBinding.cpp \
84
	bindings/js/JSDOMBinding.cpp \
87
  bindings/js/JSDOMFormDataCustom.cpp \
85
	bindings/js/JSDOMFormDataCustom.cpp \
88
	bindings/js/JSDOMGlobalObject.cpp \
86
	bindings/js/JSDOMGlobalObject.cpp \
89
	bindings/js/JSDOMWindowBase.cpp \
87
	bindings/js/JSDOMWindowBase.cpp \
90
	bindings/js/JSDOMWindowCustom.cpp \
88
	bindings/js/JSDOMWindowCustom.cpp \
91
	bindings/js/JSDOMWindowShell.cpp \
89
	bindings/js/JSDOMWindowShell.cpp \
90
	bindings/js/JSDatabaseCallback.cpp \
92
	bindings/js/JSDataGridColumnListCustom.cpp \
91
	bindings/js/JSDataGridColumnListCustom.cpp \
93
	bindings/js/JSDataGridDataSource.cpp \
92
	bindings/js/JSDataGridDataSource.cpp \
94
	bindings/js/JSDatabaseCustom.cpp \
93
	bindings/js/JSDatabaseCustom.cpp \
95
	bindings/js/JSDedicatedWorkerContextCustom.cpp \
94
	bindings/js/JSDedicatedWorkerContextCustom.cpp \
95
	bindings/js/JSDesktopNotificationsCustom.cpp \
96
	bindings/js/JSDeviceOrientationEventCustom.cpp \
96
	bindings/js/JSDocumentCustom.cpp \
97
	bindings/js/JSDocumentCustom.cpp \
97
	bindings/js/JSElementCustom.cpp \
98
	bindings/js/JSElementCustom.cpp \
98
	bindings/js/JSEventCustom.cpp \
99
	bindings/js/JSEventCustom.cpp \
- WebCore/Android.v8bindings.mk +1 lines
Lines 108-113 LOCAL_SRC_FILES += \ WebCore/Android.v8bindings.mk_sec1
108
	bindings/v8/custom/V8DatabaseCallback.cpp \
108
	bindings/v8/custom/V8DatabaseCallback.cpp \
109
	bindings/v8/custom/V8DatabaseCustom.cpp \
109
	bindings/v8/custom/V8DatabaseCustom.cpp \
110
	bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp \
110
	bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp \
111
	bindings/v8/custom/V8DeviceOrientationEventCustom.cpp \
111
	bindings/v8/custom/V8DocumentCustom.cpp \
112
	bindings/v8/custom/V8DocumentCustom.cpp \
112
	bindings/v8/custom/V8DocumentLocationCustom.cpp \
113
	bindings/v8/custom/V8DocumentLocationCustom.cpp \
113
	bindings/v8/custom/V8ElementCustom.cpp \
114
	bindings/v8/custom/V8ElementCustom.cpp \
- WebCore/CMakeLists.txt +1 lines
Lines 583-588 SET(WebCore_SOURCES WebCore/CMakeLists.txt_sec1
583
    bindings/js/JSDataGridDataSource.cpp
583
    bindings/js/JSDataGridDataSource.cpp
584
    bindings/js/JSDebugWrapperSet.cpp
584
    bindings/js/JSDebugWrapperSet.cpp
585
    bindings/js/JSDedicatedWorkerContextCustom.cpp
585
    bindings/js/JSDedicatedWorkerContextCustom.cpp
586
    bindings/js/JSDeviceOrientationEventCustom.cpp
586
    bindings/js/JSDocumentCustom.cpp
587
    bindings/js/JSDocumentCustom.cpp
587
    bindings/js/JSDOMApplicationCacheCustom.cpp
588
    bindings/js/JSDOMApplicationCacheCustom.cpp
588
    bindings/js/JSDOMBinding.cpp
589
    bindings/js/JSDOMBinding.cpp
- WebCore/GNUmakefile.am +2 lines
Lines 446-451 webcore_sources += \ WebCore/GNUmakefile.am_sec1
446
	WebCore/bindings/js/JSDOMWindowShell.h \
446
	WebCore/bindings/js/JSDOMWindowShell.h \
447
	WebCore/bindings/js/JSDOMWrapper.cpp \
447
	WebCore/bindings/js/JSDOMWrapper.cpp \
448
	WebCore/bindings/js/JSDOMWrapper.h \
448
	WebCore/bindings/js/JSDOMWrapper.h \
449
	WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp \
449
	WebCore/bindings/js/JSDocumentCustom.cpp \
450
	WebCore/bindings/js/JSDocumentCustom.cpp \
450
	WebCore/bindings/js/JSElementCustom.cpp \
451
	WebCore/bindings/js/JSElementCustom.cpp \
451
	WebCore/bindings/js/JSEventCustom.cpp \
452
	WebCore/bindings/js/JSEventCustom.cpp \
Lines 794-799 webcore_sources += \ WebCore/GNUmakefile.am_sec2
794
	WebCore/dom/DatasetDOMStringMap.h \
795
	WebCore/dom/DatasetDOMStringMap.h \
795
	WebCore/dom/DecodedDataDocumentParser.cpp \
796
	WebCore/dom/DecodedDataDocumentParser.cpp \
796
	WebCore/dom/DecodedDataDocumentParser.h \
797
	WebCore/dom/DecodedDataDocumentParser.h \
798
	WebCore/dom/DeviceOrientation.h \
797
	WebCore/dom/DeviceOrientationClient.h \
799
	WebCore/dom/DeviceOrientationClient.h \
798
	WebCore/dom/DeviceOrientationController.cpp \
800
	WebCore/dom/DeviceOrientationController.cpp \
799
	WebCore/dom/DeviceOrientationController.h \
801
	WebCore/dom/DeviceOrientationController.h \
- WebCore/WebCore.gypi +3 lines
Lines 542-547 WebCore/WebCore.gypi_sec1
542
            'bindings/js/JSDedicatedWorkerContextCustom.cpp',
542
            'bindings/js/JSDedicatedWorkerContextCustom.cpp',
543
            'bindings/js/JSDebugWrapperSet.cpp',
543
            'bindings/js/JSDebugWrapperSet.cpp',
544
            'bindings/js/JSDebugWrapperSet.h',
544
            'bindings/js/JSDebugWrapperSet.h',
545
            'bindings/js/JSDeviceOrientationEventCustom.cpp',
545
            'bindings/js/JSDocumentCustom.cpp',
546
            'bindings/js/JSDocumentCustom.cpp',
546
            'bindings/js/JSDOMApplicationCacheCustom.cpp',
547
            'bindings/js/JSDOMApplicationCacheCustom.cpp',
547
            'bindings/js/JSDOMBinding.cpp',
548
            'bindings/js/JSDOMBinding.cpp',
Lines 737-742 WebCore/WebCore.gypi_sec2
737
            'bindings/v8/custom/V8DatabaseSyncCustom.cpp',
738
            'bindings/v8/custom/V8DatabaseSyncCustom.cpp',
738
            'bindings/v8/custom/V8DataGridColumnListCustom.cpp',
739
            'bindings/v8/custom/V8DataGridColumnListCustom.cpp',
739
            'bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp',
740
            'bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp',
741
            'bindings/v8/custom/V8DeviceOrientationEventCustom.cpp',
740
            'bindings/v8/custom/V8DocumentLocationCustom.cpp',
742
            'bindings/v8/custom/V8DocumentLocationCustom.cpp',
741
            'bindings/v8/custom/V8DOMFormDataCustom.cpp',
743
            'bindings/v8/custom/V8DOMFormDataCustom.cpp',
742
            'bindings/v8/custom/V8DOMWindowCustom.cpp',
744
            'bindings/v8/custom/V8DOMWindowCustom.cpp',
Lines 1119-1124 WebCore/WebCore.gypi_sec3
1119
            'dom/DatasetDOMStringMap.h',
1121
            'dom/DatasetDOMStringMap.h',
1120
            'dom/DecodedDataDocumentParser.cpp',
1122
            'dom/DecodedDataDocumentParser.cpp',
1121
            'dom/DecodedDataDocumentParser.h',
1123
            'dom/DecodedDataDocumentParser.h',
1124
            'dom/DeviceOrientation.h',
1122
            'dom/DeviceOrientationClient.h',
1125
            'dom/DeviceOrientationClient.h',
1123
            'dom/DeviceOrientationController.cpp',
1126
            'dom/DeviceOrientationController.cpp',
1124
            'dom/DeviceOrientationController.h',
1127
            'dom/DeviceOrientationController.h',
- WebCore/WebCore.pro +2 lines
Lines 286-291 SOURCES += \ WebCore/WebCore.pro_sec1
286
    bindings/js/JSDataGridDataSource.cpp \
286
    bindings/js/JSDataGridDataSource.cpp \
287
    bindings/js/JSDebugWrapperSet.cpp \
287
    bindings/js/JSDebugWrapperSet.cpp \
288
    bindings/js/JSDesktopNotificationsCustom.cpp \
288
    bindings/js/JSDesktopNotificationsCustom.cpp \
289
    bindings/js/JSDeviceOrientationEventCustom.cpp \
289
    bindings/js/JSDocumentCustom.cpp \
290
    bindings/js/JSDocumentCustom.cpp \
290
    bindings/js/JSDOMFormDataCustom.cpp \
291
    bindings/js/JSDOMFormDataCustom.cpp \
291
    bindings/js/JSDOMGlobalObject.cpp \
292
    bindings/js/JSDOMGlobalObject.cpp \
Lines 1219-1224 HEADERS += \ WebCore/WebCore.pro_sec2
1219
    dom/CSSMappedAttributeDeclaration.h \
1220
    dom/CSSMappedAttributeDeclaration.h \
1220
    dom/CustomEvent.h \
1221
    dom/CustomEvent.h \
1221
    dom/default/PlatformMessagePortChannel.h \
1222
    dom/default/PlatformMessagePortChannel.h \
1223
    dom/DeviceOrientation.h \
1222
    dom/DeviceOrientationClient.h \
1224
    dom/DeviceOrientationClient.h \
1223
    dom/DeviceOrientationController.h \
1225
    dom/DeviceOrientationController.h \
1224
    dom/DeviceOrientationEvent.h \
1226
    dom/DeviceOrientationEvent.h \
- WebCore/WebCore.vcproj/WebCore.vcproj +56 lines
Lines 32365-32370 WebCore/WebCore.vcproj/WebCore.vcproj_sec1
32365
				>
32365
				>
32366
			</File>
32366
			</File>
32367
			<File
32367
			<File
32368
				RelativePath="..\dom\DeviceOrientation.h"
32369
				>
32370
			</File>
32371
			<File
32368
				RelativePath="..\dom\DeviceOrientationClient.h"
32372
				RelativePath="..\dom\DeviceOrientationClient.h"
32369
				>
32373
				>
32370
			</File>
32374
			</File>
Lines 42620-42625 WebCore/WebCore.vcproj/WebCore.vcproj_sec2
42620
					>
42624
					>
42621
				</File>
42625
				</File>
42622
				<File
42626
				<File
42627
					RelativePath="..\bindings\js\JSDeviceOrientationEventCustom.cpp"
42628
					>
42629
					<FileConfiguration
42630
						Name="Debug|Win32"
42631
						ExcludedFromBuild="true"
42632
						>
42633
						<Tool
42634
							Name="VCCLCompilerTool"
42635
						/>
42636
					</FileConfiguration>
42637
					<FileConfiguration
42638
						Name="Release|Win32"
42639
						ExcludedFromBuild="true"
42640
						>
42641
						<Tool
42642
							Name="VCCLCompilerTool"
42643
						/>
42644
					</FileConfiguration>
42645
					<FileConfiguration
42646
						Name="Debug_Internal|Win32"
42647
						ExcludedFromBuild="true"
42648
						>
42649
						<Tool
42650
							Name="VCCLCompilerTool"
42651
						/>
42652
					</FileConfiguration>
42653
					<FileConfiguration
42654
						Name="Debug_Cairo|Win32"
42655
						ExcludedFromBuild="true"
42656
						>
42657
						<Tool
42658
							Name="VCCLCompilerTool"
42659
						/>
42660
					</FileConfiguration>
42661
					<FileConfiguration
42662
						Name="Release_Cairo|Win32"
42663
						ExcludedFromBuild="true"
42664
						>
42665
						<Tool
42666
							Name="VCCLCompilerTool"
42667
						/>
42668
					</FileConfiguration>
42669
					<FileConfiguration
42670
						Name="Debug_All|Win32"
42671
						ExcludedFromBuild="true"
42672
						>
42673
						<Tool
42674
							Name="VCCLCompilerTool"
42675
						/>
42676
					</FileConfiguration>
42677
				</File>
42678
				<File
42623
					RelativePath="..\bindings\js\JSElementCustom.cpp"
42679
					RelativePath="..\bindings\js\JSElementCustom.cpp"
42624
					>
42680
					>
42625
					<FileConfiguration
42681
					<FileConfiguration
- WebCore/WebCore.xcodeproj/project.pbxproj +8 lines
Lines 1182-1187 WebCore/WebCore.xcodeproj/project.pbxproj_sec1
1182
		54C50F7B0E801DF3009832A0 /* XMLDocumentParserLibxml2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 54C50F7A0E801DF3009832A0 /* XMLDocumentParserLibxml2.cpp */; };
1182
		54C50F7B0E801DF3009832A0 /* XMLDocumentParserLibxml2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 54C50F7A0E801DF3009832A0 /* XMLDocumentParserLibxml2.cpp */; };
1183
		550A0BC9085F6039007353D6 /* QualifiedName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 550A0BC7085F6039007353D6 /* QualifiedName.cpp */; };
1183
		550A0BC9085F6039007353D6 /* QualifiedName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 550A0BC7085F6039007353D6 /* QualifiedName.cpp */; };
1184
		550A0BCA085F6039007353D6 /* QualifiedName.h in Headers */ = {isa = PBXBuildFile; fileRef = 550A0BC8085F6039007353D6 /* QualifiedName.h */; settings = {ATTRIBUTES = (Private, ); }; };
1184
		550A0BCA085F6039007353D6 /* QualifiedName.h in Headers */ = {isa = PBXBuildFile; fileRef = 550A0BC8085F6039007353D6 /* QualifiedName.h */; settings = {ATTRIBUTES = (Private, ); }; };
1185
		590E1B4911E4EF4B0069F784 /* DeviceOrientation.h in Headers */ = {isa = PBXBuildFile; fileRef = 590E1B4811E4EF4B0069F784 /* DeviceOrientation.h */; };
1186
		590E1B4B11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 590E1B4A11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp */; };
1185
		5913953B110758450083EC55 /* JNIBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 5913953A110758450083EC55 /* JNIBridge.h */; };
1187
		5913953B110758450083EC55 /* JNIBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 5913953A110758450083EC55 /* JNIBridge.h */; };
1186
		5913953D1107584E0083EC55 /* JNIBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5913953C1107584E0083EC55 /* JNIBridge.cpp */; };
1188
		5913953D1107584E0083EC55 /* JNIBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5913953C1107584E0083EC55 /* JNIBridge.cpp */; };
1187
		596229781133EFD700DC4CBB /* GeolocationPositionCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 596229771133EFD700DC4CBB /* GeolocationPositionCache.cpp */; };
1189
		596229781133EFD700DC4CBB /* GeolocationPositionCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 596229771133EFD700DC4CBB /* GeolocationPositionCache.cpp */; };
Lines 6920-6925 WebCore/WebCore.xcodeproj/project.pbxproj_sec2
6920
		54C50F7A0E801DF3009832A0 /* XMLDocumentParserLibxml2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLDocumentParserLibxml2.cpp; sourceTree = "<group>"; };
6922
		54C50F7A0E801DF3009832A0 /* XMLDocumentParserLibxml2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLDocumentParserLibxml2.cpp; sourceTree = "<group>"; };
6921
		550A0BC7085F6039007353D6 /* QualifiedName.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = QualifiedName.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
6923
		550A0BC7085F6039007353D6 /* QualifiedName.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = QualifiedName.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
6922
		550A0BC8085F6039007353D6 /* QualifiedName.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = QualifiedName.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
6924
		550A0BC8085F6039007353D6 /* QualifiedName.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = QualifiedName.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
6925
		590E1B4811E4EF4B0069F784 /* DeviceOrientation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceOrientation.h; sourceTree = "<group>"; };
6926
		590E1B4A11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDeviceOrientationEventCustom.cpp; sourceTree = "<group>"; };
6923
		5913953A110758450083EC55 /* JNIBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JNIBridge.h; sourceTree = "<group>"; };
6927
		5913953A110758450083EC55 /* JNIBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JNIBridge.h; sourceTree = "<group>"; };
6924
		5913953C1107584E0083EC55 /* JNIBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JNIBridge.cpp; sourceTree = "<group>"; };
6928
		5913953C1107584E0083EC55 /* JNIBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JNIBridge.cpp; sourceTree = "<group>"; };
6925
		596229771133EFD700DC4CBB /* GeolocationPositionCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GeolocationPositionCache.cpp; sourceTree = "<group>"; };
6929
		596229771133EFD700DC4CBB /* GeolocationPositionCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GeolocationPositionCache.cpp; sourceTree = "<group>"; };
Lines 15719-15724 WebCore/WebCore.xcodeproj/project.pbxproj_sec3
15719
		BC4EDEF70C08F414007EDD49 /* Custom */ = {
15723
		BC4EDEF70C08F414007EDD49 /* Custom */ = {
15720
			isa = PBXGroup;
15724
			isa = PBXGroup;
15721
			children = (
15725
			children = (
15726
				590E1B4A11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp */,
15722
				BC275CB211C5E85C00C9206C /* JSArrayBufferCustom.cpp */,
15727
				BC275CB211C5E85C00C9206C /* JSArrayBufferCustom.cpp */,
15723
				492273A21083B3B100EE5C84 /* JSArrayBufferViewCustom.cpp */,
15728
				492273A21083B3B100EE5C84 /* JSArrayBufferViewCustom.cpp */,
15724
				86243D0011BC31F700CC006A /* JSArrayBufferViewHelper.h */,
15729
				86243D0011BC31F700CC006A /* JSArrayBufferViewHelper.h */,
Lines 16816-16821 WebCore/WebCore.xcodeproj/project.pbxproj_sec4
16816
		F523D32402DE4478018635CA /* dom */ = {
16821
		F523D32402DE4478018635CA /* dom */ = {
16817
			isa = PBXGroup;
16822
			isa = PBXGroup;
16818
			children = (
16823
			children = (
16824
				590E1B4811E4EF4B0069F784 /* DeviceOrientation.h */,
16819
				E1C4DE6D0EA75C650023CCD6 /* ActiveDOMObject.cpp */,
16825
				E1C4DE6D0EA75C650023CCD6 /* ActiveDOMObject.cpp */,
16820
				E1C4DE680EA75C1E0023CCD6 /* ActiveDOMObject.h */,
16826
				E1C4DE680EA75C1E0023CCD6 /* ActiveDOMObject.h */,
16821
				A8C4A7FC09D563270003AC8D /* Attr.cpp */,
16827
				A8C4A7FC09D563270003AC8D /* Attr.cpp */,
Lines 19768-19773 WebCore/WebCore.xcodeproj/project.pbxproj_sec5
19768
				C585A6FA11D4FB3D004C3E4B /* IndexedDatabase.h in Headers */,
19774
				C585A6FA11D4FB3D004C3E4B /* IndexedDatabase.h in Headers */,
19769
				C585A6FC11D4FB3D004C3E4B /* IndexedDatabaseImpl.h in Headers */,
19775
				C585A6FC11D4FB3D004C3E4B /* IndexedDatabaseImpl.h in Headers */,
19770
				C585A6FE11D4FB3D004C3E4B /* IndexedDatabaseRequest.h in Headers */,
19776
				C585A6FE11D4FB3D004C3E4B /* IndexedDatabaseRequest.h in Headers */,
19777
				590E1B4911E4EF4B0069F784 /* DeviceOrientation.h in Headers */,
19771
			);
19778
			);
19772
			runOnlyForDeploymentPostprocessing = 0;
19779
			runOnlyForDeploymentPostprocessing = 0;
19773
		};
19780
		};
Lines 22153-22158 WebCore/WebCore.xcodeproj/project.pbxproj_sec6
22153
				C585A6F911D4FB3D004C3E4B /* IndexedDatabase.cpp in Sources */,
22160
				C585A6F911D4FB3D004C3E4B /* IndexedDatabase.cpp in Sources */,
22154
				C585A6FB11D4FB3D004C3E4B /* IndexedDatabaseImpl.cpp in Sources */,
22161
				C585A6FB11D4FB3D004C3E4B /* IndexedDatabaseImpl.cpp in Sources */,
22155
				C585A6FD11D4FB3D004C3E4B /* IndexedDatabaseRequest.cpp in Sources */,
22162
				C585A6FD11D4FB3D004C3E4B /* IndexedDatabaseRequest.cpp in Sources */,
22163
				590E1B4B11E4EF700069F784 /* JSDeviceOrientationEventCustom.cpp in Sources */,
22156
			);
22164
			);
22157
			runOnlyForDeploymentPostprocessing = 0;
22165
			runOnlyForDeploymentPostprocessing = 0;
22158
		};
22166
		};
- WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp +83 lines
Line 0 WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp_sec1
1
/*
2
 * Copyright 2010, The Android Open Source Project
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *  * Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 *  * Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "JSDeviceOrientationEvent.h"
28
29
#if ENABLE(DEVICE_ORIENTATION)
30
31
#include "DeviceOrientation.h"
32
#include "DeviceOrientationEvent.h"
33
34
using namespace JSC;
35
36
namespace WebCore {
37
38
JSValue JSDeviceOrientationEvent::alpha(ExecState* exec) const
39
{
40
    DeviceOrientationEvent* imp = static_cast<DeviceOrientationEvent*>(impl());
41
    if (!imp->orientation()->canProvideAlpha())
42
        return jsNull();
43
    return jsNumber(exec, imp->orientation()->alpha());
44
}
45
46
JSValue JSDeviceOrientationEvent::beta(ExecState* exec) const
47
{
48
    DeviceOrientationEvent* imp = static_cast<DeviceOrientationEvent*>(impl());
49
    if (!imp->orientation()->canProvideBeta())
50
        return jsNull();
51
    return jsNumber(exec, imp->orientation()->beta());
52
}
53
54
JSValue JSDeviceOrientationEvent::gamma(ExecState* exec) const
55
{
56
    DeviceOrientationEvent* imp = static_cast<DeviceOrientationEvent*>(impl());
57
    if (!imp->orientation()->canProvideGamma())
58
        return jsNull();
59
    return jsNumber(exec, imp->orientation()->gamma());
60
}
61
62
JSValue JSDeviceOrientationEvent::initDeviceOrientationEvent(ExecState* exec)
63
{
64
    const String& type = ustringToString(exec->argument(0).toString(exec));
65
    bool bubbles = exec->argument(1).toBoolean(exec);
66
    bool cancelable = exec->argument(2).toBoolean(exec);
67
    // If alpha, beta or gamma are null or undefined, mark them as not provided.
68
    // Otherwise, use the standard JavaScript conversion.
69
    bool alphaProvided = !exec->argument(3).isUndefinedOrNull();
70
    double alpha = exec->argument(3).toNumber(exec);
71
    bool betaProvided = !exec->argument(4).isUndefinedOrNull();
72
    double beta = exec->argument(4).toNumber(exec);
73
    bool gammaProvided = !exec->argument(5).isUndefinedOrNull();
74
    double gamma = exec->argument(5).toNumber(exec);
75
    RefPtr<DeviceOrientation> orientation = DeviceOrientation::create(alphaProvided, alpha, betaProvided, beta, gammaProvided, gamma);
76
    DeviceOrientationEvent* imp = static_cast<DeviceOrientationEvent*>(impl());
77
    imp->initDeviceOrientationEvent(type, bubbles, cancelable, orientation.get());
78
    return jsUndefined();
79
}
80
81
} // namespace WebCore
82
83
#endif // ENABLE(DEVICE_ORIENTATION)
- WebCore/bindings/v8/custom/V8DeviceOrientationEventCustom.cpp +90 lines
Line 0 WebCore/bindings/v8/custom/V8DeviceOrientationEventCustom.cpp_sec1
1
/*
2
 * Copyright 2010, The Android Open Source Project
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *  * Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 *  * Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "V8DeviceOrientationEvent.h"
28
29
#if ENABLE(DEVICE_ORIENTATION)
30
31
#include "DeviceOrientation.h"
32
#include "V8Binding.h"
33
#include "V8Proxy.h"
34
35
#include <v8.h>
36
37
namespace WebCore {
38
39
v8::Handle<v8::Value> V8DeviceOrientationEvent::alphaAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
40
{
41
    INC_STATS("DOM.DeviceOrientationEvent.alpha._get");
42
    v8::Handle<v8::Object> holder = info.Holder();
43
    DeviceOrientationEvent* imp = V8DeviceOrientationEvent::toNative(holder);
44
    if (!imp->orientation()->canProvideAlpha())
45
        return v8::Null();
46
    return v8::Number::New(imp->orientation()->alpha());
47
}
48
49
v8::Handle<v8::Value> V8DeviceOrientationEvent::betaAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
50
{
51
    INC_STATS("DOM.DeviceOrientationEvent.beta._get");
52
    v8::Handle<v8::Object> holder = info.Holder();
53
    DeviceOrientationEvent* imp = V8DeviceOrientationEvent::toNative(holder);
54
    if (!imp->orientation()->canProvideBeta())
55
        return v8::Null();
56
    return v8::Number::New(imp->orientation()->beta());
57
}
58
59
v8::Handle<v8::Value> V8DeviceOrientationEvent::gammaAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
60
{
61
    INC_STATS("DOM.DeviceOrientationEvent.gamma._get");
62
    v8::Handle<v8::Object> holder = info.Holder();
63
    DeviceOrientationEvent* imp = V8DeviceOrientationEvent::toNative(holder);
64
    if (!imp->orientation()->canProvideGamma())
65
        return v8::Null();
66
    return v8::Number::New(imp->orientation()->gamma());
67
}
68
69
v8::Handle<v8::Value> V8DeviceOrientationEvent::initDeviceOrientationEventCallback(const v8::Arguments& args)
70
{
71
    DeviceOrientationEvent* imp = V8DeviceOrientationEvent::toNative(args.Holder());
72
    V8Parameter<> type = args[0];
73
    bool bubbles = args[1]->BooleanValue();
74
    bool cancelable = args[2]->BooleanValue();
75
    // If alpha, beta or gamma are null or undefined, mark them as not provided.
76
    // Otherwise, use the standard JavaScript conversion.
77
    bool alphaProvided = !isUndefinedOrNull(args[3]);
78
    double alpha = static_cast<double>(args[3]->NumberValue());
79
    bool betaProvided = !isUndefinedOrNull(args[4]);
80
    double beta = static_cast<double>(args[4]->NumberValue());
81
    bool gammaProvided = !isUndefinedOrNull(args[5]);
82
    double gamma = static_cast<double>(args[5]->NumberValue());
83
    RefPtr<DeviceOrientation> orientation = DeviceOrientation::create(alphaProvided, alpha, betaProvided, beta, gammaProvided, gamma);
84
    imp->initDeviceOrientationEvent(type, bubbles, cancelable, orientation.get());
85
    return v8::Handle<v8::Value>();
86
}
87
88
} // namespace WebCore
89
90
#endif // ENABLE(DEVICE_ORIENTATION)
- WebCore/dom/DeviceOrientation.h +76 lines
Line 0 WebCore/dom/DeviceOrientation.h_sec1
1
/*
2
 * Copyright 2010, The Android Open Source Project
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 *  * Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 *  * Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
14
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#ifndef DeviceOrientation_h
27
#define DeviceOrientation_h
28
29
#include <wtf/RefCounted.h>
30
31
namespace WebCore {
32
33
class DeviceOrientation : public RefCounted<DeviceOrientation> {
34
public:
35
    static PassRefPtr<DeviceOrientation> create()
36
    {
37
        return adoptRef(new DeviceOrientation);
38
    }
39
40
    static PassRefPtr<DeviceOrientation> create(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
41
    {
42
        return adoptRef(new DeviceOrientation(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma));
43
    }
44
45
    double alpha() const { return m_alpha; }
46
    double beta() const { return m_beta; }
47
    double gamma() const { return m_gamma; }
48
    bool canProvideAlpha() const { return m_canProvideAlpha; }
49
    bool canProvideBeta() const { return m_canProvideBeta; }
50
    bool canProvideGamma() const { return m_canProvideGamma; }
51
52
private:
53
    DeviceOrientation()
54
        : m_canProvideAlpha(false)
55
        , m_canProvideBeta(false)
56
        , m_canProvideGamma(false) {}
57
58
    DeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
59
        : m_canProvideAlpha(canProvideAlpha)
60
        , m_canProvideBeta(canProvideBeta)
61
        , m_canProvideGamma(canProvideGamma)
62
        , m_alpha(alpha)
63
        , m_beta(beta)
64
        , m_gamma(gamma) {}
65
66
    bool m_canProvideAlpha;
67
    bool m_canProvideBeta;
68
    bool m_canProvideGamma;
69
    double m_alpha;
70
    double m_beta;
71
    double m_gamma;
72
};
73
74
} // namespace WebCore
75
76
#endif // DeviceOrientation_h
- WebCore/dom/DeviceOrientationEvent.cpp -13 / +8 lines
Lines 26-60 WebCore/dom/DeviceOrientationEvent.cpp_sec1
26
#include "config.h"
26
#include "config.h"
27
#include "DeviceOrientationEvent.h"
27
#include "DeviceOrientationEvent.h"
28
28
29
#include "DeviceOrientation.h"
30
29
#if ENABLE(DEVICE_ORIENTATION)
31
#if ENABLE(DEVICE_ORIENTATION)
30
32
31
namespace WebCore {
33
namespace WebCore {
32
34
33
DeviceOrientationEvent::DeviceOrientationEvent()
35
DeviceOrientationEvent::DeviceOrientationEvent()
34
    : m_alpha(0)
36
    : m_orientation(DeviceOrientation::create())
35
    , m_beta(0)
36
    , m_gamma(0)
37
{
37
{
38
}
38
}
39
39
40
DeviceOrientationEvent::DeviceOrientationEvent(const AtomicString& eventType, double alpha, double beta, double gamma)
40
DeviceOrientationEvent::DeviceOrientationEvent(const AtomicString& eventType, DeviceOrientation* orientation)
41
    : Event(eventType, false, false) // Can't bubble, not cancelable
41
    : Event(eventType, false, false) // Can't bubble, not cancelable
42
    , m_alpha(alpha)
42
    , m_orientation(orientation)
43
    , m_beta(beta)
44
    , m_gamma(gamma)
45
{
43
{
46
}
44
}
47
45
48
void DeviceOrientationEvent::initDeviceOrientationEvent(const AtomicString& eventType, bool canBubble, bool cancelable, double alpha, double beta, double gamma)
46
void DeviceOrientationEvent::initDeviceOrientationEvent(const AtomicString& type, bool bubbles, bool cancelable, DeviceOrientation* orientation)
49
{
47
{
50
    if (dispatched())
48
    if (dispatched())
51
        return;
49
        return;
52
50
53
    initEvent(eventType, canBubble, cancelable);
51
    initEvent(type, bubbles, cancelable);
54
52
    m_orientation = orientation;
55
    m_alpha = alpha;
56
    m_beta = beta;
57
    m_gamma = gamma;
58
}
53
}
59
54
60
} // namespace WebCore
55
} // namespace WebCore
- WebCore/dom/DeviceOrientationEvent.h -10 / +9 lines
Lines 30-60 WebCore/dom/DeviceOrientationEvent.h_sec1
30
30
31
namespace WebCore {
31
namespace WebCore {
32
32
33
class DeviceOrientation;
34
33
class DeviceOrientationEvent : public Event {
35
class DeviceOrientationEvent : public Event {
34
public:
36
public:
35
    static PassRefPtr<DeviceOrientationEvent> create()
37
    static PassRefPtr<DeviceOrientationEvent> create()
36
    {
38
    {
37
        return adoptRef(new DeviceOrientationEvent);
39
        return adoptRef(new DeviceOrientationEvent);
38
    }
40
    }
39
    static PassRefPtr<DeviceOrientationEvent> create(const AtomicString& eventType, double alpha, double beta, double gamma)
41
    static PassRefPtr<DeviceOrientationEvent> create(const AtomicString& eventType, DeviceOrientation* orientation)
40
    {
42
    {
41
        return adoptRef(new DeviceOrientationEvent(eventType, alpha, beta, gamma));
43
        return adoptRef(new DeviceOrientationEvent(eventType, orientation));
42
    }
44
    }
43
45
44
    void initDeviceOrientationEvent(const AtomicString& eventType, bool canBubble, bool cancelable, double alpha, double beta, double gamma);
46
    void initDeviceOrientationEvent(const AtomicString& type, bool bubbles, bool cancelable, DeviceOrientation*);
45
    double alpha() const { return m_alpha; }
46
    double beta() const { return m_beta; }
47
    double gamma() const { return m_gamma; }
48
47
49
    virtual bool isDeviceOrientationEvent() const { return true; }
48
    virtual bool isDeviceOrientationEvent() const { return true; }
50
49
50
    DeviceOrientation* orientation() const { return m_orientation.get(); }
51
51
private:
52
private:
52
    DeviceOrientationEvent();
53
    DeviceOrientationEvent();
53
    DeviceOrientationEvent(const AtomicString& eventType, double alpha, double beta, double gamma);
54
    DeviceOrientationEvent(const AtomicString& eventType, DeviceOrientation*);
54
55
55
    double m_alpha;
56
    RefPtr<DeviceOrientation> m_orientation;
56
    double m_beta;
57
    double m_gamma;
58
};
57
};
59
58
60
} // namespace WebCore
59
} // namespace WebCore
- WebCore/dom/DeviceOrientationEvent.idl -4 / +4 lines
Lines 28-37 module core { WebCore/dom/DeviceOrientationEvent.idl_sec1
28
    interface [
28
    interface [
29
        Conditional=DEVICE_ORIENTATION
29
        Conditional=DEVICE_ORIENTATION
30
    ] DeviceOrientationEvent : Event {
30
    ] DeviceOrientationEvent : Event {
31
        readonly attribute double alpha;
31
        readonly attribute [Custom] double alpha;
32
        readonly attribute double beta;
32
        readonly attribute [Custom] double beta;
33
        readonly attribute double gamma;
33
        readonly attribute [Custom] double gamma;
34
        void initDeviceOrientationEvent(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in double alpha, in double beta, in double gamma);
34
        [Custom] void initDeviceOrientationEvent(in DOMString type, in boolean bubbles, in boolean cancelable, in double alpha, in double beta, in double gamma);
35
    };
35
    };
36
36
37
}
37
}
- LayoutTests/ChangeLog +11 lines
Lines 1-3 LayoutTests/ChangeLog_sec1
1
2010-07-12  Steve Block  <steveblock@google.com>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        DeviceOrientationEvent should use optional properties
6
        https://bugs.webkit.org/show_bug.cgi?id=41607
7
8
        * fast/dom/DeviceOrientation/optional-event-properties-expected.txt: Added.
9
        * fast/dom/DeviceOrientation/optional-event-properties.html: Added.
10
        * fast/dom/DeviceOrientation/script-tests/optional-event-properties.js: Added.
11
1
2010-07-12  Steve Block  <steveblock@google.com>
12
2010-07-12  Steve Block  <steveblock@google.com>
2
13
3
        Reviewed by Alexey Proskuryakov.
14
        Reviewed by Alexey Proskuryakov.
- LayoutTests/fast/dom/DeviceOrientation/optional-event-properties-expected.txt +30 lines
Line 0 LayoutTests/fast/dom/DeviceOrientation/optional-event-properties-expected.txt_sec1
1
Tests the optional properties of DeviceOrientationEvent. Each property should be null if not set, or set to null or undefined.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS event.alpha == null is true
7
PASS event.beta == null is true
8
PASS event.gamma == null is true
9
PASS event.alpha == 0 is true
10
PASS event.beta == 1 is true
11
PASS event.gamma == 2 is true
12
PASS event.alpha == null is true
13
PASS event.beta == null is true
14
PASS event.gamma == null is true
15
PASS event.alpha == 0 is true
16
PASS event.beta == 0 is true
17
PASS event.gamma == 0 is true
18
PASS event.alpha == null is true
19
PASS event.beta == null is true
20
PASS event.gamma == null is true
21
PASS event.alpha == 0 is true
22
PASS event.beta == 0 is true
23
PASS event.gamma == 0 is true
24
PASS event.alpha == null is true
25
PASS event.beta == null is true
26
PASS event.gamma == null is true
27
PASS successfullyParsed is true
28
29
TEST COMPLETE
30
- LayoutTests/fast/dom/DeviceOrientation/optional-event-properties.html +12 lines
Line 0 LayoutTests/fast/dom/DeviceOrientation/optional-event-properties.html_sec1
1
<html>
2
<head>
3
<link rel="stylesheet" href="../../js/resources/js-test-style.css">
4
<script src="../../js/resources/js-test-pre.js"></script>
5
</head>
6
<body>
7
<p id="description"></p>
8
<div id="console"></div>
9
<script src="script-tests/optional-event-properties.js"></script>
10
<script src="../../js/resources/js-test-post.js"></script>
11
</body>
12
</html>
- LayoutTests/fast/dom/DeviceOrientation/script-tests/optional-event-properties.js +45 lines
Line 0 LayoutTests/fast/dom/DeviceOrientation/script-tests/optional-event-properties.js_sec1
1
description("Tests the optional properties of DeviceOrientationEvent. Each property should be null if not set, or set to null or undefined.");
2
3
var event = document.createEvent('DeviceOrientationEvent');
4
5
shouldBeTrue("event.alpha == null");
6
shouldBeTrue("event.beta == null");
7
shouldBeTrue("event.gamma == null");
8
9
event.initDeviceOrientationEvent("", false, false, 0, 1, 2);
10
11
shouldBeTrue("event.alpha == 0");
12
shouldBeTrue("event.beta == 1");
13
shouldBeTrue("event.gamma == 2");
14
15
event.initDeviceOrientationEvent();
16
17
shouldBeTrue("event.alpha == null");
18
shouldBeTrue("event.beta == null");
19
shouldBeTrue("event.gamma == null");
20
21
event.initDeviceOrientationEvent("", false, false, [], [], []);
22
23
shouldBeTrue("event.alpha == 0");
24
shouldBeTrue("event.beta == 0");
25
shouldBeTrue("event.gamma == 0");
26
27
event.initDeviceOrientationEvent("", false, false, undefined, undefined, undefined);
28
29
shouldBeTrue("event.alpha == null");
30
shouldBeTrue("event.beta == null");
31
shouldBeTrue("event.gamma == null");
32
33
event.initDeviceOrientationEvent("", false, false, "", "", "");
34
35
shouldBeTrue("event.alpha == 0");
36
shouldBeTrue("event.beta == 0");
37
shouldBeTrue("event.gamma == 0");
38
39
event.initDeviceOrientationEvent("", false, false, null, null, null);
40
41
shouldBeTrue("event.alpha == null");
42
shouldBeTrue("event.beta == null");
43
shouldBeTrue("event.gamma == null");
44
45
window.successfullyParsed = true;

Return to Bug 41607