Bug 1594449 - <link rel="preload"> implemented as a speculative load initiated during the prescan phase in the HTML5 parser, disabled by default, only supports "script" and "styles" types, r=ckerschb

Differential Revision: https://phabricator.services.mozilla.com/D52019
This commit is contained in:
Honza Bambas
2019-11-27 21:45:12 +00:00
parent 749f21e24e
commit 4ae17bd66f
15 changed files with 151 additions and 43 deletions

View File

@@ -13,6 +13,7 @@
#include "mozilla/EventStates.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/Preferences.h"
#include "mozilla/StaticPrefs_network.h"
#include "mozilla/dom/BindContext.h"
#include "mozilla/dom/DocumentInlines.h"
#include "mozilla/dom/HTMLLinkElementBinding.h"
@@ -402,7 +403,8 @@ static const DOMTokenListSupportedToken sSupportedRelValues[] = {
nsDOMTokenList* HTMLLinkElement::RelList() {
if (!mRelList) {
if (Preferences::GetBool("network.preload")) {
if (Preferences::GetBool("network.preload") ||
StaticPrefs::network_preload_experimental()) {
mRelList = new nsDOMTokenList(this, nsGkAtoms::rel, sSupportedRelValues);
} else {
mRelList =