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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp

Issue 2685843003: 'data:' may not be used as a document's base URL. (Closed)
Patch Set: Tests. Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ 3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/
4 * Copyright (C) 2010 Google Inc. All Rights Reserved. 4 * Copyright (C) 2010 Google Inc. All Rights Reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 } 855 }
856 } 856 }
857 857
858 template <typename Token> 858 template <typename Token>
859 void TokenPreloadScanner::updatePredictedBaseURL(const Token& token) { 859 void TokenPreloadScanner::updatePredictedBaseURL(const Token& token) {
860 ASSERT(m_predictedBaseElementURL.isEmpty()); 860 ASSERT(m_predictedBaseElementURL.isEmpty());
861 if (const typename Token::Attribute* hrefAttribute = 861 if (const typename Token::Attribute* hrefAttribute =
862 token.getAttributeItem(hrefAttr)) { 862 token.getAttributeItem(hrefAttr)) {
863 KURL url(m_documentURL, stripLeadingAndTrailingHTMLSpaces( 863 KURL url(m_documentURL, stripLeadingAndTrailingHTMLSpaces(
864 hrefAttribute->value8BitIfNecessary())); 864 hrefAttribute->value8BitIfNecessary()));
865 m_predictedBaseElementURL = url.isValid() ? url.copy() : KURL(); 865 m_predictedBaseElementURL =
866 url.isValid() && !url.protocolIsData() ? url.copy() : KURL();
866 } 867 }
867 } 868 }
868 869
869 HTMLPreloadScanner::HTMLPreloadScanner( 870 HTMLPreloadScanner::HTMLPreloadScanner(
870 const HTMLParserOptions& options, 871 const HTMLParserOptions& options,
871 const KURL& documentURL, 872 const KURL& documentURL,
872 std::unique_ptr<CachedDocumentParameters> documentParameters, 873 std::unique_ptr<CachedDocumentParameters> documentParameters,
873 const MediaValuesCached::MediaValuesCachedData& mediaValuesCachedData) 874 const MediaValuesCached::MediaValuesCachedData& mediaValuesCachedData)
874 : m_scanner(documentURL, 875 : m_scanner(documentURL,
875 std::move(documentParameters), 876 std::move(documentParameters),
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 defaultViewportMinWidth = document->viewportDefaultMinWidth(); 926 defaultViewportMinWidth = document->viewportDefaultMinWidth();
926 viewportMetaZeroValuesQuirk = 927 viewportMetaZeroValuesQuirk =
927 document->settings() && 928 document->settings() &&
928 document->settings()->getViewportMetaZeroValuesQuirk(); 929 document->settings()->getViewportMetaZeroValuesQuirk();
929 viewportMetaEnabled = 930 viewportMetaEnabled =
930 document->settings() && document->settings()->getViewportMetaEnabled(); 931 document->settings() && document->settings()->getViewportMetaEnabled();
931 referrerPolicy = document->getReferrerPolicy(); 932 referrerPolicy = document->getReferrerPolicy();
932 } 933 }
933 934
934 } // namespace blink 935 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698