Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1122)

Unified Diff: Source/core/inspector/ContentSearchUtils.cpp

Issue 256543002: DevTools: do not recognize inline sourceURL, require it to end with the crlf. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: For landing Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/inspector/sources/debugger/source-url-comment-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/ContentSearchUtils.cpp
diff --git a/Source/core/inspector/ContentSearchUtils.cpp b/Source/core/inspector/ContentSearchUtils.cpp
index ca8a2ac71add76f5324b394fbeb26c042c80aed5..473968b02467f180f0687fd24ce17f7a47eceae6 100644
--- a/Source/core/inspector/ContentSearchUtils.cpp
+++ b/Source/core/inspector/ContentSearchUtils.cpp
@@ -159,12 +159,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 match.substring(0, i);
+ return "";
}
return match;
« no previous file with comments | « LayoutTests/inspector/sources/debugger/source-url-comment-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698