[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 00:20:38 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit c57291537f12496b9995381f827bafdfd1543dea
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Dec 5 00:24:28 2009 +0000

    2009-12-04  James Hawkins  <jhawkins at chromium.org>
    
            Reviewed by Darin Fisher.
    
            https://bugs.webkit.org/show_bug.cgi?id=32095
            Implement WebRegularExpression, a WebKit API for accessing
            WebCore::RegularExpression.
    
            * WebKit.gyp:
            * public/WebRegularExpression.h: Added.
            * public/WebTextCaseSensitivity.h: Added.
            (WebKit::):
            * src/AssertMatchingEnums.cpp:
            * src/WebRegularExpression.cpp: Added.
            (WebKit::WebRegularExpression::WebRegularExpression):
            (WebKit::WebRegularExpression::~WebRegularExpression):
            (WebKit::WebRegularExpression::match):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51720 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 2697e6d..445f9ca 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,21 @@
+2009-12-04  James Hawkins  <jhawkins at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        https://bugs.webkit.org/show_bug.cgi?id=32095
+        Implement WebRegularExpression, a WebKit API for accessing
+        WebCore::RegularExpression.
+
+        * WebKit.gyp:
+        * public/WebRegularExpression.h: Added.
+        * public/WebTextCaseSensitivity.h: Added.
+        (WebKit::):
+        * src/AssertMatchingEnums.cpp:
+        * src/WebRegularExpression.cpp: Added.
+        (WebKit::WebRegularExpression::WebRegularExpression):
+        (WebKit::WebRegularExpression::~WebRegularExpression):
+        (WebKit::WebRegularExpression::match):
+
 2009-12-04  Peter Kasting  <pkasting at google.com>
 
         Reviewed by Darin Fisher.
diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp
index ab08dc9..d7bd30d 100644
--- a/WebKit/chromium/WebKit.gyp
+++ b/WebKit/chromium/WebKit.gyp
@@ -141,6 +141,7 @@
                 'public/WebPopupMenuInfo.h',
                 'public/WebRange.h',
                 'public/WebRect.h',
+                'public/WebRegularExpression.h',
                 'public/WebRuntimeFeatures.h',
                 'public/WebScreenInfo.h',
                 'public/WebScriptController.h',
@@ -160,6 +161,7 @@
                 'public/WebStorageNamespace.h',
                 'public/WebString.h',
                 'public/WebTextAffinity.h',
+                'public/WebTextCaseSensitivity.h',
                 'public/WebTextDirection.h',
                 'public/WebURL.h',
                 'public/WebURLError.h',
@@ -273,6 +275,7 @@
                 'src/WebPopupMenuImpl.cpp',
                 'src/WebPopupMenuImpl.h',
                 'src/WebRange.cpp',
+                'src/WebRegularExpression.cpp',
                 'src/WebRuntimeFeatures.cpp',
                 'src/WebScriptController.cpp',
                 'src/WebSearchableFormData.cpp',
diff --git a/WebKit/chromium/public/WebRegularExpression.h b/WebKit/chromium/public/WebRegularExpression.h
new file mode 100644
index 0000000..bdf72d8
--- /dev/null
+++ b/WebKit/chromium/public/WebRegularExpression.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebRegularExpression_h
+#define WebRegularExpression_h
+
+#include "WebCommon.h"
+#include "WebNonCopyable.h"
+#include "WebTextCaseSensitivity.h"
+
+namespace WebKit {
+
+class WebRegularExpressionPrivate;
+class WebString;
+
+class WebRegularExpression : public WebNonCopyable {
+public:
+    WEBKIT_API WebRegularExpression(const WebString& pattern, WebTextCaseSensitivity);
+    WEBKIT_API ~WebRegularExpression();
+
+    WEBKIT_API int match(const WebString&, int startFrom = 0, int* matchLength = 0) const;
+
+private:
+    WebRegularExpressionPrivate* m_private;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebTextCaseSensitivity.h b/WebKit/chromium/public/WebTextCaseSensitivity.h
new file mode 100644
index 0000000..ae5860c
--- /dev/null
+++ b/WebKit/chromium/public/WebTextCaseSensitivity.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebTextCaseSensitivity_h
+#define WebTextCaseSensitivity_h
+
+namespace WebKit {
+
+// These constants specify the preferred case sensitivity.
+enum WebTextCaseSensitivity {
+    WebTextCaseSensitive,   // String matching is case-sensitive.
+    WebTextCaseInsensitive, // String matching is case-insensitive.
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/src/AssertMatchingEnums.cpp b/WebKit/chromium/src/AssertMatchingEnums.cpp
index f349cc3..35e2057 100644
--- a/WebKit/chromium/src/AssertMatchingEnums.cpp
+++ b/WebKit/chromium/src/AssertMatchingEnums.cpp
@@ -41,6 +41,7 @@
 #include "NotificationPresenter.h"
 #include "PasteboardPrivate.h"
 #include "PlatformCursor.h"
+#include "StringImpl.h"
 #include "TextAffinity.h"
 #include "WebAccessibilityObject.h"
 #include "WebApplicationCacheHost.h"
@@ -51,6 +52,7 @@
 #include "WebMediaPlayer.h"
 #include "WebNotificationPresenter.h"
 #include "WebTextAffinity.h"
+#include "WebTextCaseSensitivity.h"
 #include <wtf/Assertions.h>
 
 #define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, webcore_name) \
@@ -272,3 +274,6 @@ COMPILE_ASSERT_MATCHING_ENUM(WebNotificationPresenter::PermissionDenied, Notific
 
 COMPILE_ASSERT_MATCHING_ENUM(WebTextAffinityUpstream, UPSTREAM);
 COMPILE_ASSERT_MATCHING_ENUM(WebTextAffinityDownstream, DOWNSTREAM);
+
+COMPILE_ASSERT_MATCHING_ENUM(WebTextCaseSensitive, TextCaseSensitive);
+COMPILE_ASSERT_MATCHING_ENUM(WebTextCaseInsensitive, TextCaseInsensitive);
diff --git a/WebKit/chromium/src/WebRegularExpression.cpp b/WebKit/chromium/src/WebRegularExpression.cpp
new file mode 100644
index 0000000..558b750
--- /dev/null
+++ b/WebKit/chromium/src/WebRegularExpression.cpp
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebRegularExpression.h"
+
+#include "RegularExpression.h"
+#include "WebString.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+class WebRegularExpressionPrivate : public RegularExpression {
+};
+
+WebRegularExpression::WebRegularExpression(const WebString& pattern,
+                                           WebTextCaseSensitivity caseSensitivity)
+{
+    TextCaseSensitivity sensitivity = static_cast<TextCaseSensitivity>(caseSensitivity);
+    RegularExpression* re = new RegularExpression(pattern, sensitivity);
+    m_private = static_cast<WebRegularExpressionPrivate*>(re);
+}
+
+WebRegularExpression::~WebRegularExpression()
+{
+    delete m_private;
+}
+
+int WebRegularExpression::match(const WebString& str,
+                                int startFrom,
+                                int* matchLength) const
+{
+    if (!m_private)
+        return -1;
+
+    return m_private->match(str, startFrom, matchLength);
+}
+
+} // namespace WebKit

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list