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

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

Issue 2871153002: Disable preload for module scripts (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | 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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 return ShouldPreloadLink(type); 534 return ShouldPreloadLink(type);
535 if (Match(tag_impl_, inputTag) && !input_is_image_) 535 if (Match(tag_impl_, inputTag) && !input_is_image_)
536 return false; 536 return false;
537 if (Match(tag_impl_, scriptTag)) { 537 if (Match(tag_impl_, scriptTag)) {
538 ScriptType script_type = ScriptType::kClassic; 538 ScriptType script_type = ScriptType::kClassic;
539 if (!ScriptLoader::IsValidScriptTypeAndLanguage( 539 if (!ScriptLoader::IsValidScriptTypeAndLanguage(
540 type_attribute_value_, language_attribute_value_, 540 type_attribute_value_, language_attribute_value_,
541 ScriptLoader::kAllowLegacyTypeInTypeAttribute, script_type)) { 541 ScriptLoader::kAllowLegacyTypeInTypeAttribute, script_type)) {
542 return false; 542 return false;
543 } 543 }
544 // TODO(kouhei): Enable preload for module scripts, with correct
Kunihiko Sakamoto 2017/05/10 10:07:12 Kouhei, would you mind having your name here? :)
545 // credentials mode.
546 if (type_attribute_value_ == "module")
547 return false;
544 if (ScriptLoader::BlockForNoModule(script_type, 548 if (ScriptLoader::BlockForNoModule(script_type,
545 nomodule_attribute_value_)) { 549 nomodule_attribute_value_)) {
546 return false; 550 return false;
547 } 551 }
548 } 552 }
549 return true; 553 return true;
550 } 554 }
551 555
552 void SetCrossOrigin(const String& cors_setting) { 556 void SetCrossOrigin(const String& cors_setting) {
553 cross_origin_ = GetCrossOriginAttributeValue(cors_setting); 557 cross_origin_ = GetCrossOriginAttributeValue(cors_setting);
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 default_viewport_min_width = document->ViewportDefaultMinWidth(); 966 default_viewport_min_width = document->ViewportDefaultMinWidth();
963 viewport_meta_zero_values_quirk = 967 viewport_meta_zero_values_quirk =
964 document->GetSettings() && 968 document->GetSettings() &&
965 document->GetSettings()->GetViewportMetaZeroValuesQuirk(); 969 document->GetSettings()->GetViewportMetaZeroValuesQuirk();
966 viewport_meta_enabled = document->GetSettings() && 970 viewport_meta_enabled = document->GetSettings() &&
967 document->GetSettings()->GetViewportMetaEnabled(); 971 document->GetSettings()->GetViewportMetaEnabled();
968 referrer_policy = document->GetReferrerPolicy(); 972 referrer_policy = document->GetReferrerPolicy();
969 } 973 }
970 974
971 } // namespace blink 975 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698