Index: Source/core/html/parser/HTMLPreloadScanner.cpp |
diff --git a/Source/core/html/parser/HTMLPreloadScanner.cpp b/Source/core/html/parser/HTMLPreloadScanner.cpp |
index a98df60e30f99459ef336dd255f28deb2d1f4c31..83b1e5f221ba2c31b6c0f796338d9d8164abd431 100644 |
--- a/Source/core/html/parser/HTMLPreloadScanner.cpp |
+++ b/Source/core/html/parser/HTMLPreloadScanner.cpp |
@@ -515,8 +515,11 @@ template<typename Token> |
void TokenPreloadScanner::updatePredictedBaseURL(const Token& token) |
{ |
ASSERT(m_predictedBaseElementURL.isEmpty()); |
- if (const typename Token::Attribute* hrefAttribute = token.getAttributeItem(hrefAttr)) |
- m_predictedBaseElementURL = KURL(m_documentURL, stripLeadingAndTrailingHTMLSpaces(hrefAttribute->value)).copy(); |
+ if (const typename Token::Attribute* hrefAttribute = token.getAttributeItem(hrefAttr)) { |
+ KURL url(m_documentURL, stripLeadingAndTrailingHTMLSpaces(hrefAttribute->value)); |
+ if (url.isValid()) |
+ m_predictedBaseElementURL = url.copy(); |
+ } |
Yoav Weiss
2015/03/31 11:04:43
What does the parser do in case of an invalid base
kouhei (in TOK)
2015/03/31 11:15:38
Good point. Let me verify.
kouhei (in TOK)
2015/04/01 03:49:05
It seems that the parser would set empty url as th
|
} |
HTMLPreloadScanner::HTMLPreloadScanner(const HTMLParserOptions& options, const KURL& documentURL, PassRefPtr<MediaValues> mediaValues) |