| Differences between
and this patch
- a/ChangeLog +13 lines
Lines 1-3 a/ChangeLog_sec1
1
2012-02-20  Kihong Kwon  <kihong.kwon@samsung.com>
2
3
        Add a new API for the Vibration API(W3C).
4
        https://bugs.webkit.org/show_bug.cgi?id=72010
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Add Implementation for the Vibration API to the WebKit-EFL port.
9
        http://dev.w3.org/2009/dap/vibration/
10
11
        * Source/cmake/OptionsEfl.cmake: Add ENABLE_VIBRATION feature.
12
        * Source/cmakeconfig.h.cmake:
13
1
2012-02-20  Martin Robinson  <mrobinson@igalia.com>
14
2012-02-20  Martin Robinson  <mrobinson@igalia.com>
2
15
3
        Fix WebKit2GTK+ for 'make distcheck'.
16
        Fix WebKit2GTK+ for 'make distcheck'.
- a/LayoutTests/ChangeLog +16 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2012-02-20  Kihong Kwon  <kihong.kwon@samsung.com>
2
3
        Add a new test case for the Vibration API.
4
        https://bugs.webkit.org/show_bug.cgi?id=72010
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * fast/dom/navigator-vibration-expected.txt: Added.
9
        * fast/dom/navigator-vibration.html: Added.
10
        * platform/chromium/test_expectations.txt:
11
        * platform/gtk/Skipped:
12
        * platform/mac/Skipped:
13
        * platform/qt/Skipped:
14
        * platform/win/Skipped:
15
        * platform/wincairo/Skipped:
16
1
2012-02-20  Shinya Kawanaka  <shinyak@chromium.org>
17
2012-02-20  Shinya Kawanaka  <shinyak@chromium.org>
2
18
3
        Attached/Detached state must be testable
19
        Attached/Detached state must be testable
- a/LayoutTests/fast/dom/navigator-vibration-expected.txt +15 lines
Line 0 a/LayoutTests/fast/dom/navigator-vibration-expected.txt_sec1
1
Test for the Vibration API.
2
3
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6
PASS navigator.webkitVibrate(0); is undefined
7
PASS navigator.webkitVibrate([]); is undefined
8
PASS navigator.webkitVibrate(1000); is undefined
9
PASS navigator.webkitVibrate([1000, 300, 500]); is undefined
10
PASS navigator.webkitVibrate(4294967295); is undefined
11
PASS navigator.webkitVibrate(); threw exception TypeError: Type error.
12
PASS successfullyParsed is true
13
14
TEST COMPLETE
15
- a/LayoutTests/fast/dom/navigator-vibration.html +18 lines
Line 0 a/LayoutTests/fast/dom/navigator-vibration.html_sec1
1
<html>
2
<head>
3
<script src="../js/resources/js-test-pre.js"></script>
4
</head>
5
<body>
6
<script>
7
description('Test for the Vibration API.');
8
9
shouldBe("navigator.webkitVibrate(0);", "undefined");
10
shouldBe("navigator.webkitVibrate([]);", "undefined");
11
shouldBe("navigator.webkitVibrate(1000);", "undefined");
12
shouldBe("navigator.webkitVibrate([1000, 300, 500]);", "undefined");
13
shouldBe("navigator.webkitVibrate(4294967295);", "undefined");
14
shouldThrow("navigator.webkitVibrate();");
15
</script>
16
<script src="../js/resources/js-test-post.js"></script>
17
</body>
18
</html>
- a/LayoutTests/platform/chromium/test_expectations.txt +3 lines
Lines 112-117 BUGNOEL : svg/carto.net/selectionlist.svg = IMAGE+TEXT IMAGE a/LayoutTests/platform/chromium/test_expectations.txt_sec1
112
// New test, needs baselines.
112
// New test, needs baselines.
113
113
114
114
115
// Vibration API is not supported yet in the chromium port.
116
BUGWK72010 SKIP : fast/dom/navigator-vibration.html = FAIL
117
115
// -----------------------------------------------------------------
118
// -----------------------------------------------------------------
116
// WONTFIX TESTS
119
// WONTFIX TESTS
117
// -----------------------------------------------------------------
120
// -----------------------------------------------------------------
- a/LayoutTests/platform/gtk/Skipped +3 lines
Lines 393-398 http/tests/security/webgl-remote-read-remote-image-allowed.html a/LayoutTests/platform/gtk/Skipped_sec1
393
http/tests/security/webgl-remote-read-remote-image-blocked-no-crossorigin.html
393
http/tests/security/webgl-remote-read-remote-image-blocked-no-crossorigin.html
394
http/tests/security/webgl-remote-read-remote-image-allowed-with-credentials.html
394
http/tests/security/webgl-remote-read-remote-image-allowed-with-credentials.html
395
395
396
#Vibration API support not yet. http://webkit.org/b/72010
397
fast/dom/navigator-vibration.html
398
396
###############################################################################
399
###############################################################################
397
# TESTS FAILING
400
# TESTS FAILING
398
###############################################################################
401
###############################################################################
- a/LayoutTests/platform/mac/Skipped +4 lines
Lines 550-552 media/W3C/video/canPlayType/canPlayType_two_implies_one_6.html a/LayoutTests/platform/mac/Skipped_sec1
550
# Fails because MutationObservers are not notified at end-of-task
550
# Fails because MutationObservers are not notified at end-of-task
551
# https://bugs.webkit.org/show_bug.cgi?id=78290
551
# https://bugs.webkit.org/show_bug.cgi?id=78290
552
fast/mutation/end-of-task-delivery.html
552
fast/mutation/end-of-task-delivery.html
553
554
# https://bugs.webkit.org/show_bug.cgi?id=72010
555
# Needs PageClients::vibrationClient() implementation.
556
fast/dom/navigator-vibration.html
- a/LayoutTests/platform/qt/Skipped +3 lines
Lines 333-338 fast/parser/pre-html5-parser-quirks.html a/LayoutTests/platform/qt/Skipped_sec1
333
# https://bugs.webkit.org/show_bug.cgi?id=72363
333
# https://bugs.webkit.org/show_bug.cgi?id=72363
334
fast/dom/Window/window-postmessage-arrays.html
334
fast/dom/Window/window-postmessage-arrays.html
335
335
336
#Vibration API is not implemented.
337
fast/dom/navigator-vibration.html
338
336
# =========================================================================== #
339
# =========================================================================== #
337
#       Drag and Drop Support in DRT.                                         #
340
#       Drag and Drop Support in DRT.                                         #
338
# =========================================================================== #
341
# =========================================================================== #
- a/LayoutTests/platform/win/Skipped +3 lines
Lines 1652-1654 fast/encoding/utf-16-little-endian.html a/LayoutTests/platform/win/Skipped_sec1
1652
fast/inline/continuation-outlines-with-layers-2.html
1652
fast/inline/continuation-outlines-with-layers-2.html
1653
fast/inline/continuation-outlines-with-layers.html
1653
fast/inline/continuation-outlines-with-layers.html
1654
fast/repaint/transform-absolute-in-positioned-container.html
1654
fast/repaint/transform-absolute-in-positioned-container.html
1655
1656
#Vibration API is not implemented.
1657
fast/dom/navigator-vibration.html
- a/LayoutTests/platform/wincairo/Skipped +3 lines
Lines 2045-2047 fast/canvas/webgl/arraybuffer-transfer-of-control.html a/LayoutTests/platform/wincairo/Skipped_sec1
2045
# Fails because MutationObservers are not notified at end-of-task
2045
# Fails because MutationObservers are not notified at end-of-task
2046
# https://bugs.webkit.org/show_bug.cgi?id=78290
2046
# https://bugs.webkit.org/show_bug.cgi?id=78290
2047
fast/mutation/end-of-task-delivery.html
2047
fast/mutation/end-of-task-delivery.html
2048
2049
#Vibration API is not implemented.
2050
fast/dom/navigator-vibration.html
- a/Source/WebCore/CMakeLists.txt +13 lines
Lines 2252-2257 IF (ENABLE_REQUEST_ANIMATION_FRAME) a/Source/WebCore/CMakeLists.txt_sec1
2252
    )
2252
    )
2253
ENDIF ()
2253
ENDIF ()
2254
2254
2255
IF (ENABLE_VIBRATION)
2256
    LIST(APPEND WebCore_INCLUDE_DIRECTORIES
2257
        ${WEBCORE_DIR}/Modules/vibration
2258
    )
2259
    LIST(APPEND WebCore_IDL_FILES
2260
        Modules/vibration/NavigatorVibration.idl
2261
    )
2262
    LIST(APPEND WebCore_SOURCES
2263
        Modules/vibration/NavigatorVibration.cpp
2264
        Modules/vibration/Vibration.cpp
2265
    )
2266
ENDIF ()
2267
2255
# Modules that the bindings generator scripts may use
2268
# Modules that the bindings generator scripts may use
2256
SET(SCRIPTS_RESOLVE_SUPPLEMENTAL
2269
SET(SCRIPTS_RESOLVE_SUPPLEMENTAL
2257
    ${WEBCORE_DIR}/bindings/scripts/IDLParser.pm
2270
    ${WEBCORE_DIR}/bindings/scripts/IDLParser.pm
- a/Source/WebCore/ChangeLog +53 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2012-02-20  Kihong Kwon  <kihong.kwon@samsung.com>
2
3
        Add a new API for the Vibration API(W3C).
4
        https://bugs.webkit.org/show_bug.cgi?id=72010
5
6
        http://dev.w3.org/2009/dap/vibration/
7
        This patch implements navigator.webkitvibrate() API.
8
        This API operates differently depending upon a given parameter:
9
        1. It cancels vibration when given 0 or [].
10
        2. It gives a vibration duration in milliseconds when given as a single integer value.
11
        3. It gives a vibration pattern when given as an integer array. For instance, [1000 300 1000] generates a vibration of 1000ms followed by 300ms of idle time, and then creates another vibration of 1000ms.
12
13
        Reviewed by NOBODY (OOPS!).
14
15
        Test: fast/dom/navigator-vibration.html
16
17
        * CMakeLists.txt:
18
        * Modules/vibration/NavigatorVibration.cpp: Added.
19
        (WebCore):
20
        (WebCore::NavigatorVibration::NavigatorVibration):
21
        (WebCore::NavigatorVibration::~NavigatorVibration):
22
        (WebCore::NavigatorVibration::webkitVibrate):
23
        Add webkitVibrate method to get an array or single integer parameter for vibrating.
24
        They check vibration is activated in the platform, and then call vibrate() in the Vibration class.
25
        * Modules/vibration/NavigatorVibration.h: Added.
26
        (WebCore):
27
        (NavigatorVibration):
28
        * Modules/vibration/NavigatorVibration.idl: Added.
29
        * Modules/vibration/Vibration.cpp: Added.
30
        This class implements the entire vibration logic.
31
        (WebCore):
32
        (WebCore::Vibration::Vibration):
33
        (WebCore::Vibration::~Vibration):
34
        (WebCore::Vibration::create):
35
        (WebCore::Vibration::vibrate):
36
        (WebCore::Vibration::cancelVibration):
37
        (WebCore::Vibration::suspendVibration):
38
        (WebCore::Vibration::resumeVibration):
39
        (WebCore::Vibration::timerStartFired):
40
        (WebCore::Vibration::timerStopFired):
41
        (WebCore::Vibration::supplementName):
42
        (WebCore::Vibration::isActive):
43
        (WebCore::provideVibrationTo):
44
        * Modules/vibration/Vibration.h: Added.
45
        (WebCore):
46
        (Vibration):
47
        (WebCore::Vibration::from):
48
        * Modules/vibration/VibrationClient.h: Added.
49
        vibrate() and cancelVibrate() need to be implemented in the VibrationClient.
50
        (WebCore):
51
        (VibrationClient):
52
        (WebCore::VibrationClient::~VibrationClient):
53
1
2012-02-20  Shinya Kawanaka  <shinyak@chromium.org>
54
2012-02-20  Shinya Kawanaka  <shinyak@chromium.org>
2
55
3
        Attached/Detached state must be testable
56
        Attached/Detached state must be testable
- a/Source/WebCore/Modules/vibration/NavigatorVibration.cpp +81 lines
Line 0 a/Source/WebCore/Modules/vibration/NavigatorVibration.cpp_sec1
1
/*
2
 *  Copyright (C) 2012 Samsung Electronics
3
 *
4
 *  This library is free software; you can redistribute it and/or
5
 *  modify it under the terms of the GNU Library General Public
6
 *  License as published by the Free Software Foundation; either
7
 *  version 2 of the License, or (at your option) any later version.
8
 *
9
 *  This library is distributed in the hope that it will be useful,
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 *  Library General Public License for more details.
13
 *
14
 *  You should have received a copy of the GNU Library General Public License
15
 *  along with this library; see the file COPYING.LIB.  If not, write to
16
 *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
 *  Boston, MA 02110-1301, USA.
18
 */
19
20
#include "config.h"
21
#include "NavigatorVibration.h"
22
23
#if ENABLE(VIBRATION)
24
25
#include "ExceptionCode.h"
26
#include "Frame.h"
27
#include "Navigator.h"
28
#include "Page.h"
29
#include "Vibration.h"
30
#include <wtf/Uint32Array.h>
31
32
namespace WebCore {
33
34
NavigatorVibration::NavigatorVibration()
35
{
36
}
37
38
NavigatorVibration::~NavigatorVibration()
39
{
40
}
41
42
void NavigatorVibration::webkitVibrate(Navigator* navigator, unsigned long time, ExceptionCode& ec)
43
{
44
    if (!navigator->frame()->page())
45
        return;
46
47
#if ENABLE(PAGE_VISIBILITY_API)
48
    if (navigator->frame()->page()->visibilityState() == PageVisibilityStateHidden)
49
        return;
50
#endif
51
52
    if (!Vibration::isActive(navigator->frame()->page())) {
53
        ec = NOT_SUPPORTED_ERR;
54
        return;
55
    }
56
57
    Vibration::from(navigator->frame()->page())->vibrate(time);
58
}
59
60
void NavigatorVibration::webkitVibrate(Navigator* navigator, const VibrationPattern& pattern, ExceptionCode& ec)
61
{
62
    if (!navigator->frame()->page())
63
        return;
64
65
#if ENABLE(PAGE_VISIBILITY_API)
66
    if (navigator->frame()->page()->visibilityState() == PageVisibilityStateHidden)
67
        return;
68
#endif
69
70
    if (!Vibration::isActive(navigator->frame()->page())) {
71
        ec = NOT_SUPPORTED_ERR;
72
        return;
73
    }
74
75
    Vibration::from(navigator->frame()->page())->vibrate(pattern);
76
}
77
78
} // namespace WebCore
79
80
#endif // ENABLE(VIBRATION)
81
- a/Source/WebCore/Modules/vibration/NavigatorVibration.h +50 lines
Line 0 a/Source/WebCore/Modules/vibration/NavigatorVibration.h_sec1
1
/*
2
 *  Copyright (C) 2012 Samsung Electronics
3
 *
4
 *  This library is free software; you can redistribute it and/or
5
 *  modify it under the terms of the GNU Library General Public
6
 *  License as published by the Free Software Foundation; either
7
 *  version 2 of the License, or (at your option) any later version.
8
 *
9
 *  This library is distributed in the hope that it will be useful,
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 *  Library General Public License for more details.
13
 *
14
 *  You should have received a copy of the GNU Library General Public License
15
 *  along with this library; see the file COPYING.LIB.  If not, write to
16
 *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
 *  Boston, MA 02110-1301, USA.
18
 */
19
20
#ifndef NavigatorVibration_h
21
#define NavigatorVibration_h
22
23
#if ENABLE(VIBRATION)
24
25
#include "ExceptionCode.h"
26
#include <wtf/Vector.h>
27
28
namespace WebCore {
29
30
class Navigator;
31
class Uint32Array;
32
33
class NavigatorVibration {
34
public:
35
    typedef Vector<unsigned long> VibrationPattern;
36
37
    static void webkitVibrate(Navigator*, unsigned long time, ExceptionCode&);
38
    static void webkitVibrate(Navigator*, const VibrationPattern&, ExceptionCode&);
39
40
private:
41
    NavigatorVibration();
42
    ~NavigatorVibration();
43
};
44
45
} // namespace WebCore
46
47
#endif // ENABLE(VIBRATION)
48
49
#endif // NavigatorVibration_h
50
- a/Source/WebCore/Modules/vibration/NavigatorVibration.idl +30 lines
Line 0 a/Source/WebCore/Modules/vibration/NavigatorVibration.idl_sec1
1
/*
2
 *  Copyright (C) 2012 Samsung Electronics
3
 *
4
 *  This library is free software; you can redistribute it and/or
5
 *  modify it under the terms of the GNU Library General Public
6
 *  License as published by the Free Software Foundation; either
7
 *  version 2 of the License, or (at your option) any later version.
8
 *
9
 *  This library is distributed in the hope that it will be useful,
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 *  Library General Public License for more details.
13
 *
14
 *  You should have received a copy of the GNU Library General Public License
15
 *  along with this library; see the file COPYING.LIB.  If not, write to
16
 *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
 *  Boston, MA 02110-1301, USA.
18
 */
19
20
module window {
21
22
    interface [
23
        Conditional=VIBRATION,
24
        Supplemental=Navigator
25
    ] NavigatorVibration {
26
        void webkitVibrate(in unsigned long[] pattern) raises(DOMException);
27
        void webkitVibrate(in unsigned long time) raises(DOMException);
28
    };
29
30
}
- a/Source/WebCore/Modules/vibration/Vibration.cpp +144 lines
Line 0 a/Source/WebCore/Modules/vibration/Vibration.cpp_sec1
1
/*
2
 *  Copyright (C) 2012 Samsung Electronics
3
 *
4
 *  This library is free software; you can redistribute it and/or
5
 *  modify it under the terms of the GNU Library General Public
6
 *  License as published by the Free Software Foundation; either
7
 *  version 2 of the License, or (at your option) any later version.
8
 *
9
 *  This library is distributed in the hope that it will be useful,
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 *  Library General Public License for more details.
13
 *
14
 *  You should have received a copy of the GNU Library General Public License
15
 *  along with this library; see the file COPYING.LIB.  If not, write to
16
 *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
 *  Boston, MA 02110-1301, USA.
18
 */
19
20
#include "config.h"
21
#include "Vibration.h"
22
23
#if ENABLE(VIBRATION)
24
25
#include "VibrationClient.h"
26
27
namespace WebCore {
28
29
Vibration::Vibration(VibrationClient* client)
30
    : m_vibrationClient(client)
31
    , m_timerStart(this, &Vibration::timerStartFired)
32
    , m_timerStop(this, &Vibration::timerStopFired)
33
    , m_isVibrating(false)
34
{
35
}
36
37
Vibration::~Vibration()
38
{
39
    m_vibrationClient->vibrationDestroyed();
40
}
41
42
PassOwnPtr<Vibration> Vibration::create(VibrationClient* client)
43
{
44
    return adoptPtr(new Vibration(client));
45
}
46
47
void Vibration::vibrate(const unsigned long& time)
48
{
49
    if (!time) {
50
        cancelVibration();
51
        return;
52
    }
53
    m_pattern.append(time);
54
    m_timerStart.startOneShot(0);
55
}
56
57
void Vibration::vibrate(const VibrationPattern& pattern)
58
{
59
    int length = pattern.size();
60
61
    if (m_isVibrating)
62
        cancelVibration();
63
64
    if (!length || (length == 1 && !pattern[0]))
65
        return;
66
67
    if (m_timerStart.isActive())
68
        m_timerStart.stop();
69
70
    m_pattern = pattern;
71
    m_timerStart.startOneShot(0);
72
}
73
74
void Vibration::cancelVibration()
75
{
76
    if (m_isVibrating) {
77
        m_vibrationClient->cancelVibration();
78
        m_isVibrating = false;
79
        m_timerStop.stop();
80
    }
81
}
82
83
void Vibration::suspendVibration()
84
{
85
    if (!m_isVibrating)
86
        return;
87
88
    m_pattern.insert(0, m_timerStop.nextFireInterval());
89
    m_timerStop.stop();
90
    cancelVibration();
91
}
92
93
void Vibration::resumeVibration()
94
{
95
    m_timerStart.startOneShot(0);
96
}
97
98
void Vibration::timerStartFired(Timer<Vibration>* timer)
99
{
100
    ASSERT_UNUSED(timer, timer == &m_timerStart);
101
102
    m_timerStart.stop();
103
104
    if (m_pattern.size()) {
105
        m_isVibrating = true;
106
        m_vibrationClient->vibrate(m_pattern[0]);
107
        m_timerStop.startOneShot(m_pattern[0] / 1000.0);
108
        m_pattern.remove(0);
109
    }
110
}
111
112
void Vibration::timerStopFired(Timer<Vibration>* timer)
113
{
114
    ASSERT_UNUSED(timer, timer == &m_timerStop);
115
116
    m_timerStop.stop();
117
    m_isVibrating = false;
118
119
    if (m_pattern.size()) {
120
        m_timerStart.startOneShot(m_pattern[0] / 1000.0);
121
        m_pattern.remove(0);
122
    }
123
}
124
125
const AtomicString& Vibration::supplementName()
126
{
127
    DEFINE_STATIC_LOCAL(AtomicString, name, ("vibration"));
128
    return name;
129
}
130
131
bool Vibration::isActive(Page* page)
132
{
133
    return static_cast<bool>(Vibration::from(page));
134
}
135
136
void provideVibrationTo(Page* page, VibrationClient* client)
137
{
138
    PageSupplement::provideTo(page, Vibration::supplementName(), Vibration::create(client));
139
}
140
141
} // namespace WebCore
142
143
#endif // ENABLE(VIBRATION)
144
- a/Source/WebCore/Modules/vibration/Vibration.h +71 lines
Line 0 a/Source/WebCore/Modules/vibration/Vibration.h_sec1
1
/*
2
 *  Copyright (C) 2012 Samsung Electronics
3
 *
4
 *  This library is free software; you can redistribute it and/or
5
 *  modify it under the terms of the GNU Library General Public
6
 *  License as published by the Free Software Foundation; either
7
 *  version 2 of the License, or (at your option) any later version.
8
 *
9
 *  This library is distributed in the hope that it will be useful,
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 *  Library General Public License for more details.
13
 *
14
 *  You should have received a copy of the GNU Library General Public License
15
 *  along with this library; see the file COPYING.LIB.  If not, write to
16
 *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
 *  Boston, MA 02110-1301, USA.
18
 */
19
20
#ifndef Vibration_h
21
#define Vibration_h
22
23
#if ENABLE(VIBRATION)
24
25
#include "PageSupplement.h"
26
#include "Timer.h"
27
#include <wtf/PassOwnPtr.h>
28
29
namespace WebCore {
30
31
class Navigator;
32
class Page;
33
class VibrationClient;
34
35
class Vibration : public PageSupplement {
36
public:
37
    typedef Vector<unsigned long> VibrationPattern;
38
39
    Vibration(VibrationClient*);
40
    ~Vibration();
41
42
    static PassOwnPtr<Vibration> create(VibrationClient*);
43
44
    void vibrate(const unsigned long& time);
45
    void vibrate(const VibrationPattern&);
46
    void cancelVibration();
47
48
    // FIXME : Add suspendVibration() and resumeVibration() to the page visibility feature, when the document.hidden attribute is changed.
49
    void suspendVibration();
50
    void resumeVibration();
51
    void timerStartFired(Timer<Vibration>*);
52
    void timerStopFired(Timer<Vibration>*);
53
54
    static const AtomicString& supplementName();
55
    static Vibration* from(Page* page) { return static_cast<Vibration*>(PageSupplement::from(page, supplementName())); }
56
    static bool isActive(Page*);
57
58
private:
59
    VibrationClient* m_vibrationClient;
60
    Timer<Vibration> m_timerStart;
61
    Timer<Vibration> m_timerStop;
62
    bool m_isVibrating;
63
    VibrationPattern m_pattern;
64
};
65
66
} // namespace WebCore
67
68
#endif // ENABLE(VIBRATION)
69
70
#endif // Vibration_h
71
- a/Source/WebCore/Modules/vibration/VibrationClient.h +42 lines
Line 0 a/Source/WebCore/Modules/vibration/VibrationClient.h_sec1
1
/*
2
 *  Copyright (C) 2012 Samsung Electronics
3
 *
4
 *  This library is free software; you can redistribute it and/or
5
 *  modify it under the terms of the GNU Library General Public
6
 *  License as published by the Free Software Foundation; either
7
 *  version 2 of the License, or (at your option) any later version.
8
 *
9
 *  This library is distributed in the hope that it will be useful,
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 *  Library General Public License for more details.
13
 *
14
 *  You should have received a copy of the GNU Library General Public License
15
 *  along with this library; see the file COPYING.LIB.  If not, write to
16
 *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
 *  Boston, MA 02110-1301, USA.
18
 */
19
20
#ifndef VibrationClient_h
21
#define VibrationClient_h
22
23
namespace WebCore {
24
25
class Page;
26
27
class VibrationClient {
28
public:
29
    virtual ~VibrationClient() { }
30
31
    virtual void vibrate(const unsigned long& time) = 0;
32
    virtual void cancelVibration() = 0;
33
34
    virtual void vibrationDestroyed() = 0;
35
};
36
37
void provideVibrationTo(Page*, VibrationClient*);
38
39
} // namespace WebCore
40
41
#endif // VibrationClient_h
42
- a/Source/WebKit/efl/CMakeListsEfl.txt +10 lines
Lines 115-120 LIST(APPEND WebKit_LIBRARIES a/Source/WebKit/efl/CMakeListsEfl.txt_sec1
115
    ${LIBSOUP24_LIBRARIES}
115
    ${LIBSOUP24_LIBRARIES}
116
)
116
)
117
117
118
IF (ENABLE_VIBRATION)
119
    LIST(APPEND WebKit_INCLUDE_DIRECTORIES
120
        ${WEBCORE_DIR}/Modules/vibration
121
    )
122
    LIST(APPEND WebKit_SOURCES
123
        efl/WebCoreSupport/VibrationClientEfl.cpp
124
    )
125
ENDIF ()
126
127
118
SET(WebKit_THEME_DEFINITION "")
128
SET(WebKit_THEME_DEFINITION "")
119
IF (ENABLE_PROGRESS_TAG)
129
IF (ENABLE_PROGRESS_TAG)
120
  LIST(APPEND WebKit_THEME_DEFINITION "-DENABLE_PROGRESS_TAG")
130
  LIST(APPEND WebKit_THEME_DEFINITION "-DENABLE_PROGRESS_TAG")
- a/Source/WebKit/efl/ChangeLog +28 lines
Lines 1-3 a/Source/WebKit/efl/ChangeLog_sec1
1
2012-02-20  Kihong Kwon  <kihong.kwon@samsung.com>
2
3
        Add a new API for the Vibration API(W3C).
4
        https://bugs.webkit.org/show_bug.cgi?id=72010
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Implementation for the Vibration API feature to the EFL-port layer.
9
        http://dev.w3.org/2009/dap/vibration/
10
        There are two methods for vibration API.
11
        - vibrate : Vibrate device for receiving as a parameter.
12
        - cancelVibrate : Cancel current vibration.
13
14
        * CMakeListsEfl.txt:
15
        * WebCoreSupport/VibrationClientEfl.cpp: Added.
16
        (WebCore):
17
        (WebCore::VibrationClientEfl::VibrationClientEfl):
18
        (WebCore::VibrationClientEfl::vibrate):
19
        (WebCore::VibrationClientEfl::cancelVibration):
20
        (WebCore::VibrationClientEfl::vibrationDestroyed):
21
        * WebCoreSupport/VibrationClientEfl.h: Added.
22
        (WebCore):
23
        (VibrationClientEfl):
24
        (WebCore::VibrationClientEfl::~VibrationClientEfl):
25
        * ewk/ewk_view.cpp:
26
        (_Ewk_View_Private_Data):
27
        (_ewk_view_priv_new):
28
1
2012-02-17  Raphael Kubo da Costa  <kubo@profusion.mobi>
29
2012-02-17  Raphael Kubo da Costa  <kubo@profusion.mobi>
2
30
3
        [EFL] Unreviewed, adapt to the changes introduced in r107973.
31
        [EFL] Unreviewed, adapt to the changes introduced in r107973.
- a/Source/WebKit/efl/WebCoreSupport/VibrationClientEfl.cpp +50 lines
Line 0 a/Source/WebKit/efl/WebCoreSupport/VibrationClientEfl.cpp_sec1
1
/*
2
 *  Copyright (C) 2012 Samsung Electronics
3
 *
4
 *  This library is free software; you can redistribute it and/or
5
 *  modify it under the terms of the GNU Library General Public
6
 *  License as published by the Free Software Foundation; either
7
 *  version 2 of the License, or (at your option) any later version.
8
 *
9
 *  This library is distributed in the hope that it will be useful,
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 *  Library General Public License for more details.
13
 *
14
 *  You should have received a copy of the GNU Library General Public License
15
 *  along with this library; see the file COPYING.LIB.  If not, write to
16
 *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
 *  Boston, MA 02110-1301, USA.
18
 */
19
20
#include "config.h"
21
#include "VibrationClientEfl.h"
22
23
#if ENABLE(VIBRATION)
24
25
namespace WebCore {
26
27
VibrationClientEfl::VibrationClientEfl(Evas_Object* view)
28
    : m_view(view)
29
{
30
}
31
32
void VibrationClientEfl::vibrate(const unsigned long& time)
33
{
34
    evas_object_smart_callback_call(m_view, "vibration,vibrate", (void*)&time);
35
}
36
37
void VibrationClientEfl::cancelVibration()
38
{
39
    evas_object_smart_callback_call(m_view, "vibration,cancel", 0);
40
}
41
42
void VibrationClientEfl::vibrationDestroyed()
43
{
44
    delete this;
45
}
46
47
} // namespace WebCore
48
49
#endif // ENABLE(VIBRATION)
50
- a/Source/WebKit/efl/WebCoreSupport/VibrationClientEfl.h +45 lines
Line 0 a/Source/WebKit/efl/WebCoreSupport/VibrationClientEfl.h_sec1
1
/*
2
 *  Copyright (C) 2012 Samsung Electronics
3
 *
4
 *  This library is free software; you can redistribute it and/or
5
 *  modify it under the terms of the GNU Library General Public
6
 *  License as published by the Free Software Foundation; either
7
 *  version 2 of the License, or (at your option) any later version.
8
 *
9
 *  This library is distributed in the hope that it will be useful,
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 *  Library General Public License for more details.
13
 *
14
 *  You should have received a copy of the GNU Library General Public License
15
 *  along with this library; see the file COPYING.LIB.  If not, write to
16
 *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17
 *  Boston, MA 02110-1301, USA.
18
 */
19
20
#ifndef VibrationClientEfl_h
21
#define VibrationClientEfl_h
22
23
#include "VibrationClient.h"
24
#include <Evas.h>
25
26
namespace WebCore {
27
28
class VibrationClientEfl : public VibrationClient {
29
public:
30
    VibrationClientEfl(Evas_Object* view);
31
    virtual ~VibrationClientEfl() { }
32
33
    virtual void vibrate(const unsigned long& time);
34
    virtual void cancelVibration();
35
36
    virtual void vibrationDestroyed();
37
38
private:
39
    Evas_Object* m_view;
40
};
41
42
} // namespace WebCore
43
44
#endif // VibrationClientEfl_h
45
- a/Source/WebKit/efl/ewk/ewk_view.cpp -1 / +9 lines
Lines 1-6 a/Source/WebKit/efl/ewk/ewk_view.cpp_sec1
1
/*
1
/*
2
    Copyright (C) 2009-2010 ProFUSION embedded systems
2
    Copyright (C) 2009-2010 ProFUSION embedded systems
3
    Copyright (C) 2009-2011 Samsung Electronics
3
    Copyright (C) 2009-2012 Samsung Electronics
4
4
5
    This library is free software; you can redistribute it and/or
5
    This library is free software; you can redistribute it and/or
6
    modify it under the terms of the GNU Library General Public
6
    modify it under the terms of the GNU Library General Public
Lines 70-75 a/Source/WebKit/efl/ewk/ewk_view.cpp_sec2
70
#include "DeviceOrientationClientEfl.h"
70
#include "DeviceOrientationClientEfl.h"
71
#endif
71
#endif
72
72
73
#if ENABLE(VIBRATION)
74
#include "VibrationClientEfl.h"
75
#endif
76
73
static const float zoomMinimum = 0.05;
77
static const float zoomMinimum = 0.05;
74
static const float zoomMaximum = 4.0;
78
static const float zoomMaximum = 4.0;
75
79
Lines 617-622 static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData) a/Source/WebKit/efl/ewk/ewk_view.cpp_sec3
617
    WebCore::provideDeviceOrientationTo(priv->page, new WebCore::DeviceOrientationClientEfl);
621
    WebCore::provideDeviceOrientationTo(priv->page, new WebCore::DeviceOrientationClientEfl);
618
#endif
622
#endif
619
623
624
#if ENABLE(VIBRATION)
625
    WebCore::provideVibrationTo(priv->page, new WebCore::VibrationClientEfl(smartData->self));
626
#endif
627
620
    priv->pageSettings = priv->page->settings();
628
    priv->pageSettings = priv->page->settings();
621
    if (!priv->pageSettings) {
629
    if (!priv->pageSettings) {
622
        CRITICAL("Could not get page settings.");
630
        CRITICAL("Could not get page settings.");
- a/Source/cmake/OptionsEfl.cmake +1 lines
Lines 95-100 WEBKIT_FEATURE(ENABLE_SVG "Enable SVG" DEFAULT ON) a/Source/cmake/OptionsEfl.cmake_sec1
95
WEBKIT_FEATURE(ENABLE_SVG_FONTS "Enable SVG fonts" DEFAULT ON)
95
WEBKIT_FEATURE(ENABLE_SVG_FONTS "Enable SVG fonts" DEFAULT ON)
96
WEBKIT_FEATURE(ENABLE_TOUCH_EVENTS "Enable Touch Events" DEFAULT OFF)
96
WEBKIT_FEATURE(ENABLE_TOUCH_EVENTS "Enable Touch Events" DEFAULT OFF)
97
WEBKIT_FEATURE(ENABLE_TOUCH_ICON_LOADING "Enable Touch Icon Loading" DEFAULT OFF)
97
WEBKIT_FEATURE(ENABLE_TOUCH_ICON_LOADING "Enable Touch Icon Loading" DEFAULT OFF)
98
WEBKIT_FEATURE(ENABLE_VIBRATION "Enable vibration" DEFAULT ON)
98
WEBKIT_FEATURE(ENABLE_VIDEO "Enable video" DEFAULT ON)
99
WEBKIT_FEATURE(ENABLE_VIDEO "Enable video" DEFAULT ON)
99
WEBKIT_FEATURE(ENABLE_WEB_SOCKETS "Enable web sockets" DEFAULT ON)
100
WEBKIT_FEATURE(ENABLE_WEB_SOCKETS "Enable web sockets" DEFAULT ON)
100
WEBKIT_FEATURE(ENABLE_WEBGL "Enable WebGL" DEFAULT OFF)
101
WEBKIT_FEATURE(ENABLE_WEBGL "Enable WebGL" DEFAULT OFF)
- a/Source/cmakeconfig.h.cmake +1 lines
Lines 39-44 a/Source/cmakeconfig.h.cmake_sec1
39
#cmakedefine01 ENABLE_SVG_FONTS
39
#cmakedefine01 ENABLE_SVG_FONTS
40
#cmakedefine01 ENABLE_TOUCH_EVENTS
40
#cmakedefine01 ENABLE_TOUCH_EVENTS
41
#cmakedefine01 ENABLE_TOUCH_ICON_LOADING
41
#cmakedefine01 ENABLE_TOUCH_ICON_LOADING
42
#cmakedefine01 ENABLE_VIBRATION
42
#cmakedefine01 ENABLE_VIDEO
43
#cmakedefine01 ENABLE_VIDEO
43
#cmakedefine01 ENABLE_WEBGL
44
#cmakedefine01 ENABLE_WEBGL
44
#cmakedefine01 ENABLE_WEB_SOCKETS
45
#cmakedefine01 ENABLE_WEB_SOCKETS
- a/Tools/ChangeLog +9 lines
Lines 1-3 a/Tools/ChangeLog_sec1
1
2012-02-20  Kihong Kwon  <kihong.kwon@samsung.com>
2
3
        Add a new API for the Vibration API(W3C).
4
        https://bugs.webkit.org/show_bug.cgi?id=72010
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * Scripts/build-webkit: Enable ENABLE_VIBRATION feature.
9
1
2012-02-20  Jochen Eisinger  <jochen@chromium.org>
10
2012-02-20  Jochen Eisinger  <jochen@chromium.org>
2
11
3
        [chromium] check that we're not running multiple modal dialogs at the same time
12
        [chromium] check that we're not running multiple modal dialogs at the same time
- a/Tools/Scripts/build-webkit +4 lines
Lines 128-133 my ( a/Tools/Scripts/build-webkit_sec1
128
    $tiledBackingStoreSupport,
128
    $tiledBackingStoreSupport,
129
    $touchEventsSupport,
129
    $touchEventsSupport,
130
    $touchIconLoadingSupport,
130
    $touchIconLoadingSupport,
131
    $vibrationSupport,
131
    $videoSupport,
132
    $videoSupport,
132
    $videoTrackSupport,
133
    $videoTrackSupport,
133
    $webAudioSupport,
134
    $webAudioSupport,
Lines 329-334 my @features = ( a/Tools/Scripts/build-webkit_sec2
329
    { option => "touch-icon-loading", desc => "Toggle Touch Icon Loading Support",
330
    { option => "touch-icon-loading", desc => "Toggle Touch Icon Loading Support",
330
      define => "ENABLE_TOUCH_ICON_LOADING", default => 0, value => \$touchIconLoadingSupport },
331
      define => "ENABLE_TOUCH_ICON_LOADING", default => 0, value => \$touchIconLoadingSupport },
331
332
333
    { option => "vibration", desc => "Toggle Video support",
334
      define => "ENABLE_VIBRATION", default => isEfl(), value => \$vibrationSupport },
335
332
    { option => "video", desc => "Toggle Video support",
336
    { option => "video", desc => "Toggle Video support",
333
      define => "ENABLE_VIDEO", default => (isAppleWebKit() || isGtk() || isBlackBerry() || isEfl()), value => \$videoSupport },
337
      define => "ENABLE_VIDEO", default => (isAppleWebKit() || isGtk() || isBlackBerry() || isEfl()), value => \$videoSupport },
334
338

Return to Bug 72010