Issue #2158 - Part 4: Dispatch load/error events upon parsing preload links

This commit is contained in:
FranklinDM 2024-01-27 16:38:43 +08:00 committed by roytam1
commit 95490b25eb
7 changed files with 408 additions and 25 deletions

View file

@ -116,10 +116,25 @@ public:
nsWrapperCache::FlagsType aRequestedFlag);
// This is called by HTMLLinkElement.
void TryDNSPrefetchPreconnectOrPrefetch();
void TrySpeculativeLoadFeature();
void UpdatePreload(nsIAtom* aName,
const nsAttrValue* aValue,
const nsAttrValue* aOldValue);
void CancelPrefetch();
static void ParseDestinationValue(const nsAString& aValue, nsAttrValue& aResult);
static bool CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
Element* aElement);
static bool CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
nsIAtom* aName,
const nsAString& aValue,
Element* aElement);
static bool CheckPreloadAttrs(nsContentPolicyType& aPolicyType,
const nsAString& aAs,
const nsAString& aType,
const nsAString& aMedia,
nsIDocument* aDocument);
static nsContentPolicyType DestinationToContentPolicy(const nsAttrValue& aValue);
protected:
virtual ~Link();