| Differences between
and this patch
- WebKit/chromium/ChangeLog +18 lines
Lines 1-3 WebKit/chromium/ChangeLog_sec1
1
2009-12-04  James Hawkins  <jhawkins@chromium.org>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        https://bugs.webkit.org/show_bug.cgi?id=32095
6
        Implement WebRegularExpression, a WebKit API for accessing
7
        WebCore::RegularExpression.
8
9
        * WebKit.gyp:
10
        * public/WebRegularExpression.h: Added.
11
        * public/WebTextCaseSensitivity.h: Added.
12
        (WebKit::):
13
        * src/AssertMatchingEnums.cpp:
14
        * src/WebRegularExpression.cpp: Added.
15
        (WebKit::WebRegularExpression::WebRegularExpression):
16
        (WebKit::WebRegularExpression::~WebRegularExpression):
17
        (WebKit::WebRegularExpression::match):
18
1
2009-12-03  Jonathan Dixon  <joth@chromium.org>
19
2009-12-03  Jonathan Dixon  <joth@chromium.org>
2
20
3
        Reviewed by Dimitri Glazkov.
21
        Reviewed by Dimitri Glazkov.
- WebKit/chromium/WebKit.gyp +3 lines
Lines 141-146 WebKit/chromium/WebKit.gyp_sec1
141
                'public/WebPopupMenuInfo.h',
141
                'public/WebPopupMenuInfo.h',
142
                'public/WebRange.h',
142
                'public/WebRange.h',
143
                'public/WebRect.h',
143
                'public/WebRect.h',
144
                'public/WebRegularExpression.h',
144
                'public/WebRuntimeFeatures.h',
145
                'public/WebRuntimeFeatures.h',
145
                'public/WebScreenInfo.h',
146
                'public/WebScreenInfo.h',
146
                'public/WebScriptController.h',
147
                'public/WebScriptController.h',
Lines 160-165 WebKit/chromium/WebKit.gyp_sec2
160
                'public/WebStorageNamespace.h',
161
                'public/WebStorageNamespace.h',
161
                'public/WebString.h',
162
                'public/WebString.h',
162
                'public/WebTextAffinity.h',
163
                'public/WebTextAffinity.h',
164
                'public/WebTextCaseSensitivity.h',
163
                'public/WebTextDirection.h',
165
                'public/WebTextDirection.h',
164
                'public/WebURL.h',
166
                'public/WebURL.h',
165
                'public/WebURLError.h',
167
                'public/WebURLError.h',
Lines 273-278 WebKit/chromium/WebKit.gyp_sec3
273
                'src/WebPopupMenuImpl.cpp',
275
                'src/WebPopupMenuImpl.cpp',
274
                'src/WebPopupMenuImpl.h',
276
                'src/WebPopupMenuImpl.h',
275
                'src/WebRange.cpp',
277
                'src/WebRange.cpp',
278
                'src/WebRegularExpression.cpp',
276
                'src/WebRuntimeFeatures.cpp',
279
                'src/WebRuntimeFeatures.cpp',
277
                'src/WebScriptController.cpp',
280
                'src/WebScriptController.cpp',
278
                'src/WebSearchableFormData.cpp',
281
                'src/WebSearchableFormData.cpp',
- WebKit/chromium/public/WebRegularExpression.h +56 lines
Line 0 WebKit/chromium/public/WebRegularExpression.h_sec1
1
/*
2
 * Copyright (C) 2009 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
#ifndef WebRegularExpression_h
32
#define WebRegularExpression_h
33
34
#include "WebCommon.h"
35
#include "WebNonCopyable.h"
36
#include "WebTextCaseSensitivity.h"
37
38
namespace WebKit {
39
40
class WebRegularExpressionPrivate;
41
class WebString;
42
43
class WebRegularExpression : public WebNonCopyable {
44
public:
45
    WEBKIT_API WebRegularExpression(const WebString& pattern, WebTextCaseSensitivity);
46
    WEBKIT_API ~WebRegularExpression();
47
48
    WEBKIT_API int match(const WebString&, int startFrom = 0, int* matchLength = 0) const;
49
50
private:
51
    WebRegularExpressionPrivate* m_private;
52
};
53
54
} // namespace WebKit
55
56
#endif
0
  + LF
57
  + LF
- WebKit/chromium/public/WebTextCaseSensitivity.h +44 lines
Line 0 WebKit/chromium/public/WebTextCaseSensitivity.h_sec1
1
/*
2
 * Copyright (C) 2009 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
#ifndef WebTextCaseSensitivity_h
32
#define WebTextCaseSensitivity_h
33
34
namespace WebKit {
35
36
// These constants specify the preferred case sensitivity.
37
enum WebTextCaseSensitivity {
38
    WebTextCaseSensitive,   // String matching is case-sensitive.
39
    WebTextCaseInsensitive, // String matching is case-insensitive.
40
};
41
42
} // namespace WebKit
43
44
#endif
0
  + LF
45
  + LF
- WebKit/chromium/src/AssertMatchingEnums.cpp +5 lines
Lines 41-46 WebKit/chromium/src/AssertMatchingEnums.cpp_sec1
41
#include "NotificationPresenter.h"
41
#include "NotificationPresenter.h"
42
#include "PasteboardPrivate.h"
42
#include "PasteboardPrivate.h"
43
#include "PlatformCursor.h"
43
#include "PlatformCursor.h"
44
#include "StringImpl.h"
44
#include "TextAffinity.h"
45
#include "TextAffinity.h"
45
#include "WebAccessibilityObject.h"
46
#include "WebAccessibilityObject.h"
46
#include "WebApplicationCacheHost.h"
47
#include "WebApplicationCacheHost.h"
Lines 51-56 WebKit/chromium/src/AssertMatchingEnums.cpp_sec2
51
#include "WebMediaPlayer.h"
52
#include "WebMediaPlayer.h"
52
#include "WebNotificationPresenter.h"
53
#include "WebNotificationPresenter.h"
53
#include "WebTextAffinity.h"
54
#include "WebTextAffinity.h"
55
#include "WebTextCaseSensitivity.h"
54
#include <wtf/Assertions.h>
56
#include <wtf/Assertions.h>
55
57
56
#define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, webcore_name) \
58
#define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, webcore_name) \
Lines 272-274 COMPILE_ASSERT_MATCHING_ENUM(WebNotifica WebKit/chromium/src/AssertMatchingEnums.cpp_sec3
272
274
273
COMPILE_ASSERT_MATCHING_ENUM(WebTextAffinityUpstream, UPSTREAM);
275
COMPILE_ASSERT_MATCHING_ENUM(WebTextAffinityUpstream, UPSTREAM);
274
COMPILE_ASSERT_MATCHING_ENUM(WebTextAffinityDownstream, DOWNSTREAM);
276
COMPILE_ASSERT_MATCHING_ENUM(WebTextAffinityDownstream, DOWNSTREAM);
277
278
COMPILE_ASSERT_MATCHING_ENUM(WebTextCaseSensitive, TextCaseSensitive);
279
COMPILE_ASSERT_MATCHING_ENUM(WebTextCaseInsensitive, TextCaseInsensitive);
- WebKit/chromium/src/WebRegularExpression.cpp +67 lines
Line 0 WebKit/chromium/src/WebRegularExpression.cpp_sec1
1
/*
2
 * Copyright (C) 2009 Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
#include "config.h"
32
#include "WebRegularExpression.h"
33
34
#include "RegularExpression.h"
35
#include "WebString.h"
36
37
using namespace WebCore;
38
39
namespace WebKit {
40
41
class WebRegularExpressionPrivate : public RegularExpression {
42
};
43
44
WebRegularExpression::WebRegularExpression(const WebString& pattern,
45
                                           WebTextCaseSensitivity caseSensitivity)
46
{
47
    TextCaseSensitivity sensitivity = static_cast<TextCaseSensitivity>(caseSensitivity);
48
    RegularExpression* re = new RegularExpression(pattern, sensitivity);
49
    m_private = static_cast<WebRegularExpressionPrivate*>(re);
50
}
51
52
WebRegularExpression::~WebRegularExpression()
53
{
54
    delete m_private;
55
}
56
57
int WebRegularExpression::match(const WebString& str,
58
                                int startFrom,
59
                                int* matchLength) const
60
{
61
    if (!m_private)
62
        return -1;
63
64
    return m_private->match(str, startFrom, matchLength);
65
}
66
67
} // namespace WebKit

Return to Bug 32095