Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp |
| diff --git a/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp b/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp |
| index 9c1d3c612f0796af666e3d709e173c53185144b5..0ad899428c97e32a630591295ce521b5d248c7b9 100644 |
| --- a/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp |
| +++ b/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp |
| @@ -231,13 +231,12 @@ static String parseCSSStringOrURL(const String& string) { |
| void CSSPreloadScanner::emitRule(const SegmentedString& source) { |
| if (equalIgnoringCase(m_rule, "import")) { |
| String url = parseCSSStringOrURL(m_ruleValue.toString()); |
| - if (!url.isEmpty()) { |
|
Yoav Weiss
2016/10/24 14:43:54
Why create a request for empty URLs?
Charlie Harrison
2016/10/24 14:49:31
I moved the isEmpty check to the PreloadRequest cl
Yoav Weiss
2016/10/24 15:00:32
OK, thanks!
|
| - TextPosition position = |
| - TextPosition(source.currentLine(), source.currentColumn()); |
| - std::unique_ptr<PreloadRequest> request = |
| - PreloadRequest::create(FetchInitiatorTypeNames::css, position, url, |
| - *m_predictedBaseElementURL, |
| - Resource::CSSStyleSheet, m_referrerPolicy); |
| + TextPosition position = |
| + TextPosition(source.currentLine(), source.currentColumn()); |
| + std::unique_ptr<PreloadRequest> request = PreloadRequest::create( |
| + FetchInitiatorTypeNames::css, position, url, *m_predictedBaseElementURL, |
| + Resource::CSSStyleSheet, m_referrerPolicy); |
| + if (request) { |
| // FIXME: Should this be including the charset in the preload request? |
| m_requests->append(std::move(request)); |
| } |