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

eric at webkit.org eric at webkit.org
Wed Apr 7 23:41:00 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 3b23d89e5cd4efe9a0eb7a9c28a2bdad1124266e
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Nov 14 00:09:41 2009 +0000

    2009-11-13  Dominik Röttsches  <dominik.roettsches at access-company.com>
    
            Reviewed by Eric Seidel.
    
            Unify TextBoundaries implementations by only relying on WTF Unicode abstractions
            https://bugs.webkit.org/show_bug.cgi?id=31468
    
            Adding isAlphanumeric abstraction, required
            by TextBoundaries.cpp.
    
            * wtf/unicode/glib/UnicodeGLib.h:
            (WTF::Unicode::isAlphanumeric):
            * wtf/unicode/icu/UnicodeIcu.h:
            (WTF::Unicode::isAlphanumeric):
    2009-11-13  Dominik Röttsches  <dominik.roettsches at access-company.com>
    
            Reviewed by Eric Seidel.
    
            Unify TextBoundaries implementations by only relying on WTF Unicode abstractions
            https://bugs.webkit.org/show_bug.cgi?id=31468
    
            Moving TextBoundariesICU.cpp to TextBoundaries.cpp
            by removing the direct ICU dependency and replacing it
            with WTF functions and WebCore's own TextBreakIterator
            abstractions.
    
            * GNUmakefile.am:
            * platform/graphics/gtk/SimpleFontDataGtk.cpp:
            * platform/text/TextBoundaries.cpp: Added.
            (WebCore::findNextWordFromIndex):
            (WebCore::findWordBoundary):
            * platform/text/TextBoundariesICU.cpp: Removed.
            * platform/text/TextBreakIterator.h:
            * platform/text/TextBreakIteratorICU.cpp:
            (WebCore::textBreakLast):
            (WebCore::textBreakPrevious):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50977 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 896a13f..245ff29 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,18 @@
+2009-11-13  Dominik Röttsches  <dominik.roettsches at access-company.com>
+
+        Reviewed by Eric Seidel.
+
+        Unify TextBoundaries implementations by only relying on WTF Unicode abstractions
+        https://bugs.webkit.org/show_bug.cgi?id=31468
+
+        Adding isAlphanumeric abstraction, required
+        by TextBoundaries.cpp.
+
+        * wtf/unicode/glib/UnicodeGLib.h:
+        (WTF::Unicode::isAlphanumeric):
+        * wtf/unicode/icu/UnicodeIcu.h:
+        (WTF::Unicode::isAlphanumeric):
+
 2009-11-13  Norbert Leser  <norbert.leser&nokia.com>
 
         Reviewed by Eric Seidel.
diff --git a/JavaScriptCore/wtf/unicode/glib/UnicodeGLib.h b/JavaScriptCore/wtf/unicode/glib/UnicodeGLib.h
index c03d3ec..b5e70d4 100644
--- a/JavaScriptCore/wtf/unicode/glib/UnicodeGLib.h
+++ b/JavaScriptCore/wtf/unicode/glib/UnicodeGLib.h
@@ -152,6 +152,11 @@ inline bool isArabicChar(UChar32 c)
     return c >= 0x0600 && c <= 0x06FF;
 }
 
+inline bool isAlphanumeric(UChar32 c)
+{
+    return g_unichar_isalnum(c);
+}
+
 inline bool isFormatChar(UChar32 c)
 {
     return g_unichar_type(c) == G_UNICODE_FORMAT;
diff --git a/JavaScriptCore/wtf/unicode/icu/UnicodeIcu.h b/JavaScriptCore/wtf/unicode/icu/UnicodeIcu.h
index 35c6fbf..a2a5c0a 100644
--- a/JavaScriptCore/wtf/unicode/icu/UnicodeIcu.h
+++ b/JavaScriptCore/wtf/unicode/icu/UnicodeIcu.h
@@ -164,6 +164,11 @@ inline bool isArabicChar(UChar32 c)
       return ublock_getCode(c) == UBLOCK_ARABIC;
 }
 
+inline bool isAlphanumeric(UChar32 c)
+{
+    return u_isalnum(c);
+}
+
 inline bool isSeparatorSpace(UChar32 c)
 {
     return u_charType(c) == U_SPACE_SEPARATOR;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 40faf60..cccf38d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,26 @@
+2009-11-13  Dominik Röttsches  <dominik.roettsches at access-company.com>
+
+        Reviewed by Eric Seidel.
+
+        Unify TextBoundaries implementations by only relying on WTF Unicode abstractions
+        https://bugs.webkit.org/show_bug.cgi?id=31468
+
+        Moving TextBoundariesICU.cpp to TextBoundaries.cpp
+        by removing the direct ICU dependency and replacing it
+        with WTF functions and WebCore's own TextBreakIterator
+        abstractions.
+
+        * GNUmakefile.am:
+        * platform/graphics/gtk/SimpleFontDataGtk.cpp:
+        * platform/text/TextBoundaries.cpp: Added.
+        (WebCore::findNextWordFromIndex):
+        (WebCore::findWordBoundary):
+        * platform/text/TextBoundariesICU.cpp: Removed.
+        * platform/text/TextBreakIterator.h:
+        * platform/text/TextBreakIteratorICU.cpp:
+        (WebCore::textBreakLast):
+        (WebCore::textBreakPrevious):
+
 2009-11-13  Shinichiro Hamaji  <hamaji at chromium.org>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 7f4f429..e759831 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -1639,7 +1639,7 @@ webcore_sources += \
 	WebCore/platform/text/StringImpl.cpp \
 	WebCore/platform/text/StringImpl.h \
 	WebCore/platform/text/TextBoundaries.h \
-	WebCore/platform/text/TextBoundariesICU.cpp \
+	WebCore/platform/text/TextBoundaries.cpp \
 	WebCore/platform/text/TextBreakIterator.h \
 	WebCore/platform/text/TextBreakIteratorICU.cpp \
 	WebCore/platform/text/TextBreakIteratorInternalICU.h \
@@ -2031,7 +2031,6 @@ if USE_ICU_UNICODE
 webcoregtk_sources += \
 	WebCore/platform/text/TextCodecICU.cpp \
 	WebCore/platform/text/TextCodecICU.h
-
 endif
 
 # ----
diff --git a/WebCore/platform/graphics/gtk/SimpleFontDataGtk.cpp b/WebCore/platform/graphics/gtk/SimpleFontDataGtk.cpp
index 9a616f4..df25393 100644
--- a/WebCore/platform/graphics/gtk/SimpleFontDataGtk.cpp
+++ b/WebCore/platform/graphics/gtk/SimpleFontDataGtk.cpp
@@ -39,8 +39,6 @@
 #include "FontDescription.h"
 #include "GlyphBuffer.h"
 #include <cairo.h>
-#include <unicode/uchar.h>
-#include <unicode/unorm.h>
 #include <wtf/MathExtras.h>
 
 namespace WebCore {
diff --git a/WebCore/platform/text/TextBoundaries.cpp b/WebCore/platform/text/TextBoundaries.cpp
new file mode 100644
index 0000000..1b6c379
--- /dev/null
+++ b/WebCore/platform/text/TextBoundaries.cpp
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
+ * Copyright (C) 2009 Dominik Röttsches <dominik.roettsches at access-company.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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 "TextBoundaries.h"
+
+#include "StringImpl.h"
+#include "TextBreakIterator.h"
+#include <Unicode.h>
+
+using namespace WTF;
+using namespace Unicode;
+
+namespace WebCore {
+
+int findNextWordFromIndex(const UChar* chars, int len, int position, bool forward)
+{
+    TextBreakIterator* it = wordBreakIterator(chars, len);
+
+    if (forward) {
+        position = textBreakFollowing(it, position);
+        while (position != TextBreakDone) {
+            // We stop searching when the character preceeding the break
+            // is alphanumeric.
+            if (position < len && isAlphanumeric(chars[position - 1]))
+                return position;
+
+            position = textBreakFollowing(it, position);
+        }
+
+        return len;
+    } else {
+        position = textBreakPreceding(it, position);
+        while (position != TextBreakDone) {
+            // We stop searching when the character following the break
+            // is alphanumeric.
+            if (position > 0 && isAlphanumeric(chars[position]))
+                return position;
+
+            position = textBreakPreceding(it, position);
+        }
+
+        return 0;
+    }
+}
+
+void findWordBoundary(const UChar* chars, int len, int position, int* start, int* end)
+{
+    TextBreakIterator* it = wordBreakIterator(chars, len);
+    *end = textBreakFollowing(it, position);
+    if (*end < 0)
+        *end = textBreakLast(it);
+    *start = textBreakPrevious(it);
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/text/TextBoundariesICU.cpp b/WebCore/platform/text/TextBoundariesICU.cpp
deleted file mode 100644
index b1e8ee2..0000000
--- a/WebCore/platform/text/TextBoundariesICU.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 Apple 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:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. 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.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``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 APPLE COMPUTER, INC. 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 "TextBoundaries.h"
-
-#include <unicode/ubrk.h>
-#include <unicode/uchar.h>
-
-#include "StringImpl.h"
-#include "TextBreakIterator.h"
-
-namespace WebCore {
-
-int findNextWordFromIndex(const UChar* chars, int len, int position, bool forward)
-{
-    UBreakIterator* it = wordBreakIterator(chars, len);
-
-    if (forward) {
-        position = ubrk_following(it, position);
-        while (position != UBRK_DONE) {
-            // We stop searching when the character preceeding the break
-            // is alphanumeric.
-            if (position < len && u_isalnum(chars[position - 1]))
-                return position;
-
-            position = ubrk_following(it, position);
-        }
-
-        return len;
-    } else {
-        position = ubrk_preceding(it, position);
-        while (position != UBRK_DONE) {
-            // We stop searching when the character following the break
-            // is alphanumeric.
-            if (position > 0 && u_isalnum(chars[position]))
-                return position;
-
-            position = ubrk_preceding(it, position);
-        }
-
-        return 0;
-    }
-}
-
-void findWordBoundary(const UChar* chars, int len, int position, int* start, int* end)
-{
-    UBreakIterator* it = wordBreakIterator(chars, len);
-    *end = ubrk_following(it, position);
-    if (*end < 0)
-        *end = ubrk_last(it);
-    *start = ubrk_previous(it);
-}
-
-} // namespace WebCore
diff --git a/WebCore/platform/text/TextBreakIterator.h b/WebCore/platform/text/TextBreakIterator.h
index 7b3b963..17cf5f0 100644
--- a/WebCore/platform/text/TextBreakIterator.h
+++ b/WebCore/platform/text/TextBreakIterator.h
@@ -47,7 +47,9 @@ namespace WebCore {
     TextBreakIterator* sentenceBreakIterator(const UChar*, int length);
 
     int textBreakFirst(TextBreakIterator*);
+    int textBreakLast(TextBreakIterator*);
     int textBreakNext(TextBreakIterator*);
+    int textBreakPrevious(TextBreakIterator*);
     int textBreakCurrent(TextBreakIterator*);
     int textBreakPreceding(TextBreakIterator*, int);
     int textBreakFollowing(TextBreakIterator*, int);
diff --git a/WebCore/platform/text/TextBreakIteratorICU.cpp b/WebCore/platform/text/TextBreakIteratorICU.cpp
index c922fbc..44423c0 100644
--- a/WebCore/platform/text/TextBreakIteratorICU.cpp
+++ b/WebCore/platform/text/TextBreakIteratorICU.cpp
@@ -90,11 +90,21 @@ int textBreakFirst(TextBreakIterator* bi)
     return ubrk_first(bi);
 }
 
+int textBreakLast(TextBreakIterator* bi)
+{
+    return ubrk_last(bi);
+}
+
 int textBreakNext(TextBreakIterator* bi)
 {
     return ubrk_next(bi);
 }
 
+int textBreakPrevious(TextBreakIterator* bi)
+{
+    return ubrk_previous(bi);
+}
+
 int textBreakPreceding(TextBreakIterator* bi, int pos)
 {
     return ubrk_preceding(bi, pos);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list