| Differences between
and this patch
- WebCore/ChangeLog +52 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.mk:
16
        * Android.jscbindings.mk:
17
        * Android.v8bindings.mk:
18
        * CMakeLists.txt:
19
        * GNUmakefile.am:
20
        * WebCore.gypi:
21
        * WebCore.pro:
22
        * WebCore.vcproj/WebCore.vcproj:
23
        * WebCore.xcodeproj/project.pbxproj:
24
        * bindings/js/JSBindingsAllInOne.cpp:
25
        * bindings/js/JSDeviceOrientationEventCustom.cpp: Added.
26
        (WebCore::JSDeviceOrientationEvent::alpha):
27
        (WebCore::JSDeviceOrientationEvent::beta):
28
        (WebCore::JSDeviceOrientationEvent::gamma):
29
        (WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
30
        * bindings/v8/custom/V8DeviceOrientationEventCustom.cpp: Added.
31
        (WebCore::V8DeviceOrientationEvent::alphaAccessorGetter):
32
        (WebCore::V8DeviceOrientationEvent::betaAccessorGetter):
33
        (WebCore::V8DeviceOrientationEvent::gammaAccessorGetter):
34
        (WebCore::V8DeviceOrientationEvent::initDeviceOrientationEventCallback):
35
        * dom/DeviceOrientation.cpp: Added.
36
        * dom/DeviceOrientation.h: Added.
37
        (WebCore::DeviceOrientation::create):
38
        (WebCore::DeviceOrientation::canProvideAlpha):
39
        (WebCore::DeviceOrientation::alpha):
40
        (WebCore::DeviceOrientation::canProvideBeta):
41
        (WebCore::DeviceOrientation::beta):
42
        (WebCore::DeviceOrientation::canProvideGamma):
43
        (WebCore::DeviceOrientation::gamma):
44
        (WebCore::DeviceOrientation::DeviceOrientation):
45
        * dom/DeviceOrientationEvent.cpp:
46
        (WebCore::DeviceOrientationEvent::DeviceOrientationEvent):
47
        (WebCore::DeviceOrientationEvent::initDeviceOrientationEvent):
48
        * dom/DeviceOrientationEvent.h:
49
        (WebCore::DeviceOrientationEvent::create):
50
        (WebCore::DeviceOrientationEvent::orientation):
51
        * dom/DeviceOrientationEvent.idl:
52
1
2010-07-12  Eric Seidel  <eric@webkit.org>
53
2010-07-12  Eric Seidel  <eric@webkit.org>
2
54
3
        Unreviewed.  Attempt to fix Chromium Windows build.
55
        Unreviewed.  Attempt to fix Chromium Windows build.
- WebCore/CMakeLists.txt +2 lines
Lines 584-589 SET(WebCore_SOURCES WebCore/CMakeLists.txt_sec1
584
    bindings/js/JSDataGridDataSource.cpp
584
    bindings/js/JSDataGridDataSource.cpp
585
    bindings/js/JSDebugWrapperSet.cpp
585
    bindings/js/JSDebugWrapperSet.cpp
586
    bindings/js/JSDedicatedWorkerContextCustom.cpp
586
    bindings/js/JSDedicatedWorkerContextCustom.cpp
587
    bindings/js/JSDeviceOrientationEventCustom.cpp
587
    bindings/js/JSDocumentCustom.cpp
588
    bindings/js/JSDocumentCustom.cpp
588
    bindings/js/JSDOMApplicationCacheCustom.cpp
589
    bindings/js/JSDOMApplicationCacheCustom.cpp
589
    bindings/js/JSDOMBinding.cpp
590
    bindings/js/JSDOMBinding.cpp
Lines 778-783 SET(WebCore_SOURCES WebCore/CMakeLists.txt_sec2
778
    dom/CustomEvent.cpp
779
    dom/CustomEvent.cpp
779
    dom/DatasetDOMStringMap.cpp
780
    dom/DatasetDOMStringMap.cpp
780
    dom/DecodedDataDocumentParser.cpp
781
    dom/DecodedDataDocumentParser.cpp
782
    dom/DeviceOrientation.cpp
781
    dom/DeviceOrientationController.cpp
783
    dom/DeviceOrientationController.cpp
782
    dom/DeviceOrientationEvent.cpp
784
    dom/DeviceOrientationEvent.cpp
783
    dom/Document.cpp
785
    dom/Document.cpp
- WebCore/GNUmakefile.am +3 lines
Lines 452-457 webcore_sources += \ WebCore/GNUmakefile.am_sec1
452
	WebCore/bindings/js/JSDOMWindowShell.h \
452
	WebCore/bindings/js/JSDOMWindowShell.h \
453
	WebCore/bindings/js/JSDOMWrapper.cpp \
453
	WebCore/bindings/js/JSDOMWrapper.cpp \
454
	WebCore/bindings/js/JSDOMWrapper.h \
454
	WebCore/bindings/js/JSDOMWrapper.h \
455
	WebCore/bindings/js/JSDeviceOrientationEventCustom.cpp \
455
	WebCore/bindings/js/JSDocumentCustom.cpp \
456
	WebCore/bindings/js/JSDocumentCustom.cpp \
456
	WebCore/bindings/js/JSElementCustom.cpp \
457
	WebCore/bindings/js/JSElementCustom.cpp \
457
	WebCore/bindings/js/JSEventCustom.cpp \
458
	WebCore/bindings/js/JSEventCustom.cpp \
Lines 800-805 webcore_sources += \ WebCore/GNUmakefile.am_sec2
800
	WebCore/dom/DatasetDOMStringMap.h \
801
	WebCore/dom/DatasetDOMStringMap.h \
801
	WebCore/dom/DecodedDataDocumentParser.cpp \
802
	WebCore/dom/DecodedDataDocumentParser.cpp \
802
	WebCore/dom/DecodedDataDocumentParser.h \
803
	WebCore/dom/DecodedDataDocumentParser.h \
804
	WebCore/dom/DeviceOrientation.cpp \
805
	WebCore/dom/DeviceOrientation.h \
803
	WebCore/dom/DeviceOrientationClient.h \
806
	WebCore/dom/DeviceOrientationClient.h \
804
	WebCore/dom/DeviceOrientationController.cpp \
807
	WebCore/dom/DeviceOrientationController.cpp \
805
	WebCore/dom/DeviceOrientationController.h \
808
	WebCore/dom/DeviceOrientationController.h \
- WebCore/WebCore.gypi +4 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.cpp',
1125
            'dom/DeviceOrientation.h',
1122
            'dom/DeviceOrientationClient.h',
1126
            'dom/DeviceOrientationClient.h',
1123
            'dom/DeviceOrientationController.cpp',
1127
            'dom/DeviceOrientationController.cpp',
1124
            'dom/DeviceOrientationController.h',
1128
            'dom/DeviceOrientationController.h',
- WebCore/WebCore.vcproj/WebCore.vcproj +60 lines
Lines 32381-32386 WebCore/WebCore.vcproj/WebCore.vcproj_sec1
32381
				>
32381
				>
32382
			</File>
32382
			</File>
32383
			<File
32383
			<File
32384
				RelativePath="..\dom\DeviceOrientation.cpp"
32385
				>
32386
			</File>
32387
			<File
32388
				RelativePath="..\dom\DeviceOrientation.h"
32389
				>
32390
			</File>
32391
			<File
32384
				RelativePath="..\dom\DeviceOrientationClient.h"
32392
				RelativePath="..\dom\DeviceOrientationClient.h"
32385
				>
32393
				>
32386
			</File>
32394
			</File>
Lines 42688-42693 WebCore/WebCore.vcproj/WebCore.vcproj_sec2
42688
					</FileConfiguration>
42696
					</FileConfiguration>
42689
				</File>
42697
				</File>
42690
				<File
42698
				<File
42699
					RelativePath="..\bindings\js\JSDeviceOrientationEventCustom.cpp"
42700
					>
42701
					<FileConfiguration
42702
						Name="Debug|Win32"
42703
						ExcludedFromBuild="true"
42704
						>
42705
						<Tool
42706
							Name="VCCLCompilerTool"
42707
						/>
42708
					</FileConfiguration>
42709
					<FileConfiguration
42710
						Name="Release|Win32"
42711
						ExcludedFromBuild="true"
42712
						>
42713
						<Tool
42714
							Name="VCCLCompilerTool"
42715
						/>
42716
					</FileConfiguration>
42717
					<FileConfiguration
42718
						Name="Debug_Internal|Win32"
42719
						ExcludedFromBuild="true"
42720
						>
42721
						<Tool
42722
							Name="VCCLCompilerTool"
42723
						/>
42724
					</FileConfiguration>
42725
					<FileConfiguration
42726
						Name="Debug_Cairo|Win32"
42727
						ExcludedFromBuild="true"
42728
						>
42729
						<Tool
42730
							Name="VCCLCompilerTool"
42731
						/>
42732
					</FileConfiguration>
42733
					<FileConfiguration
42734
						Name="Release_Cairo|Win32"
42735
						ExcludedFromBuild="true"
42736
						>
42737
						<Tool
42738
							Name="VCCLCompilerTool"
42739
						/>
42740
					</FileConfiguration>
42741
					<FileConfiguration
42742
						Name="Debug_All|Win32"
42743
						ExcludedFromBuild="true"
42744
						>
42745
						<Tool
42746
							Name="VCCLCompilerTool"
42747
						/>
42748
					</FileConfiguration>
42749
				</File>
42750
				<File
42691
					RelativePath="..\bindings\js\JSEventCustom.cpp"
42751
					RelativePath="..\bindings\js\JSEventCustom.cpp"
42692
					>
42752
					>
42693
					<FileConfiguration
42753
					<FileConfiguration
- WebCore/bindings/js/JSBindingsAllInOne.cpp +1 lines
Lines 62-67 WebCore/bindings/js/JSBindingsAllInOne.cpp_sec1
62
#include "JSDebugWrapperSet.cpp"
62
#include "JSDebugWrapperSet.cpp"
63
#include "JSDedicatedWorkerContextCustom.cpp"
63
#include "JSDedicatedWorkerContextCustom.cpp"
64
#include "JSDesktopNotificationsCustom.cpp"
64
#include "JSDesktopNotificationsCustom.cpp"
65
#include "JSDeviceOrientationEventCustom.cpp"
65
#include "JSDocumentCustom.cpp"
66
#include "JSDocumentCustom.cpp"
66
#include "JSElementCustom.cpp"
67
#include "JSElementCustom.cpp"
67
#include "JSEventCustom.cpp"
68
#include "JSEventCustom.cpp"
- 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
- 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>

Return to Bug 41607