Index: Source/core/css/CSSParser.cpp |
diff --git a/Source/core/css/CSSParser.cpp b/Source/core/css/CSSParser.cpp |
index 796162de1413454a8f11eb9559f2339d29a61ee4..63f4985f1b3bc2c8b5277d6e41a0f856b0f58336 100644 |
--- a/Source/core/css/CSSParser.cpp |
+++ b/Source/core/css/CSSParser.cpp |
@@ -10681,6 +10681,7 @@ restartAfterComment: |
case CharacterSlash: |
// Ignore comments. They are not even considered as white spaces. |
if (*currentCharacter<SrcCharacterType>() == '*') { |
+ const CSSParserLocation startLocation = currentLocation(); |
if (m_sourceDataHandler) { |
unsigned startOffset = (is8BitSource() ? currentCharacter<LChar>() - m_dataStart8.get() : currentCharacter<UChar>() - m_dataStart16.get()) - 1; // Start with a slash. |
m_sourceDataHandler->startComment(startOffset - m_parsedTextPrefixLength); |
@@ -10692,6 +10693,7 @@ restartAfterComment: |
if (*currentCharacter<SrcCharacterType>() == '\0') { |
// Unterminated comments are simply ignored. |
currentCharacter<SrcCharacterType>() -= 2; |
+ reportError(startLocation, UnterminatedCommentError); |
break; |
} |
++currentCharacter<SrcCharacterType>(); |
@@ -11139,6 +11141,11 @@ void CSSParser::reportError(const CSSParserLocation& location, ErrorType error) |
builder.appendLiteral("Invalid CSS keyframe selector: "); |
break; |
+ case UnterminatedCommentError: |
+ content.setLength(0); |
+ builder.appendLiteral("Unterminated CSS comment"); |
+ break; |
+ |
default: |
builder.appendLiteral("Unexpected CSS token: "); |
} |