Reviewed by Geoffrey Garen.
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 May 2008 18:54:39 +0000 (18:54 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 May 2008 18:54:39 +0000 (18:54 +0000)
        - cross-platform fix for http://bugs.webkit.org/show_bug.cgi?id=17590
          ASSERTION FAILED: subject in jsRegExpExecute()

        * page/Frame.cpp:
        (WebCore::Frame::matchLabelsAgainstElement):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@32984 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/page/Frame.cpp

index e73469c..ac20c67 100644 (file)
@@ -1,3 +1,13 @@
+2008-05-08  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Geoffrey Garen.
+
+        - cross-platform fix for http://bugs.webkit.org/show_bug.cgi?id=17590 
+          ASSERTION FAILED: subject in jsRegExpExecute()
+
+        * page/Frame.cpp:
+        (WebCore::Frame::matchLabelsAgainstElement):
+
 2008-05-08  Holger Hans Peter Freyther  <zecke@selfish.org>
 
         Reviewed by Simon.
index b015554..5fa6273 100644 (file)
@@ -455,6 +455,9 @@ String Frame::searchForLabelsBeforeElement(const Vector<String>& labels, Element
 String Frame::matchLabelsAgainstElement(const Vector<String>& labels, Element* element)
 {
     String name = element->getAttribute(nameAttr);
+    if (name.isEmpty())
+        return String();
+
     // Make numbers and _'s in field names behave like word boundaries, e.g., "address2"
     replace(name, RegularExpression("\\d"), " ");
     name.replace('_', ' ');
@@ -474,7 +477,7 @@ String Frame::matchLabelsAgainstElement(const Vector<String>& labels, Element* e
                 bestPos = pos;
                 bestLength = length;
             }
-            start = pos+1;
+            start = pos + 1;
         }
     } while (pos != -1);