Upstream version 7.35.139.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / inspector / ContentSearchUtils.cpp
index af65fb6..e7bce54 100644 (file)
@@ -164,8 +164,6 @@ static String findMagicComment(const String& content, const String& name, MagicC
             closingCommentPos = content.find("*/", equalSignPos + 1);
             if (closingCommentPos == kNotFound)
                 return String();
-            if (!content.substring(closingCommentPos + 2).containsOnlyWhitespace())
-                return String();
         }
 
         break;
@@ -180,12 +178,16 @@ static String findMagicComment(const String& content, const String& name, MagicC
     String match = commentType == CSSMagicComment
         ? content.substring(urlPos, closingCommentPos - urlPos)
         : content.substring(urlPos);
+
+    size_t newLine = match.find("\n");
+    if (newLine != kNotFound)
+        match = match.substring(0, newLine);
     match = match.stripWhiteSpace();
 
-    String disallowedChars("\"' \t\n\r");
+    String disallowedChars("\"' \t");
     for (unsigned i = 0; i < match.length(); ++i) {
         if (disallowedChars.find(match[i]) != kNotFound)
-            return String();
+            return "";
     }
 
     return match;