Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2024-01-29 15:31:31 +08:00
commit 0db181d2b7
21 changed files with 1554 additions and 998 deletions

View file

@ -544,6 +544,7 @@ HTML5_ATOM(ondragleave, "ondragleave")
HTML5_ATOM(startoffset, "startoffset")
HTML5_ATOM(startOffset, "startOffset")
HTML5_ATOM(start, "start")
HTML5_ATOM(as, "as")
HTML5_ATOM(axis, "axis")
HTML5_ATOM(bias, "bias")
HTML5_ATOM(colspan, "colspan")

File diff suppressed because one or more lines are too long

View file

@ -655,6 +655,7 @@ class nsHtml5AttributeName
static nsHtml5AttributeName* ATTR_ONDRAGLEAVE;
static nsHtml5AttributeName* ATTR_STARTOFFSET;
static nsHtml5AttributeName* ATTR_START;
static nsHtml5AttributeName* ATTR_AS;
static nsHtml5AttributeName* ATTR_AXIS;
static nsHtml5AttributeName* ATTR_BIAS;
static nsHtml5AttributeName* ATTR_COLSPAN;

View file

@ -230,6 +230,54 @@ nsHtml5TreeBuilder::createElement(int32_t aNamespace,
mSpeculativeLoadQueue.AppendElement()->InitPreconnect(
url, crossOrigin);
}
} else if (rel.LowerCaseEqualsASCII("preload") && nsContentUtils::IsPreloadEnabled()) {
nsHtml5String url =
aAttributes->getValue(nsHtml5AttributeName::ATTR_HREF);
if (url) {
nsHtml5String preloadAs =
aAttributes->getValue(nsHtml5AttributeName::ATTR_AS);
if (preloadAs.LowerCaseEqualsASCII("script")) {
nsHtml5String charset =
aAttributes->getValue(nsHtml5AttributeName::ATTR_CHARSET);
nsHtml5String type =
aAttributes->getValue(nsHtml5AttributeName::ATTR_TYPE);
nsHtml5String crossOrigin =
aAttributes->getValue(nsHtml5AttributeName::ATTR_CROSSORIGIN);
nsHtml5String integrity =
aAttributes->getValue(nsHtml5AttributeName::ATTR_INTEGRITY);
mSpeculativeLoadQueue.AppendElement()->InitScript(
url,
charset,
type,
crossOrigin,
integrity,
mode == nsHtml5TreeBuilder::IN_HEAD,
false,
false,
false);
mCurrentHtmlScriptIsAsyncOrDefer = false;
} else if (preloadAs.LowerCaseEqualsASCII("style")) {
nsHtml5String charset =
aAttributes->getValue(nsHtml5AttributeName::ATTR_CHARSET);
nsHtml5String crossOrigin =
aAttributes->getValue(nsHtml5AttributeName::ATTR_CROSSORIGIN);
nsHtml5String integrity =
aAttributes->getValue(nsHtml5AttributeName::ATTR_INTEGRITY);
mSpeculativeLoadQueue.AppendElement()->InitStyle(
url, charset, crossOrigin, integrity);
} else if (preloadAs.LowerCaseEqualsASCII("image")) {
nsHtml5String srcset =
aAttributes->getValue(nsHtml5AttributeName::ATTR_SRCSET);
nsHtml5String crossOrigin =
aAttributes->getValue(nsHtml5AttributeName::ATTR_CROSSORIGIN);
nsHtml5String referrerPolicy =
aAttributes->getValue(nsHtml5AttributeName::ATTR_REFERRERPOLICY);
nsHtml5String sizes =
aAttributes->getValue(nsHtml5AttributeName::ATTR_SIZES);
mSpeculativeLoadQueue.AppendElement()->InitImage(
url, crossOrigin, referrerPolicy, srcset, sizes);
}
}
}
}
} else if (nsHtml5Atoms::video == aName) {