mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 20:07:30 +09:00
Issue #2158 - Part 2: Handle and expose preload link destination to DOM
This also defines known preload destinations and ensures it is reflected in JS.
This commit is contained in:
parent
8e1b3db048
commit
24189770aa
11 changed files with 98 additions and 5 deletions
|
|
@ -242,6 +242,11 @@ HTMLLinkElement::ParseAttribute(int32_t aNamespaceID,
|
|||
return true;
|
||||
}
|
||||
|
||||
if (aAttribute == nsGkAtoms::as) {
|
||||
ParseDestinationValue(aValue, aResult);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (aAttribute == nsGkAtoms::sizes) {
|
||||
aResult.ParseAtomArray(aValue);
|
||||
return true;
|
||||
|
|
@ -374,6 +379,8 @@ HTMLLinkElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
|||
aName == nsGkAtoms::title ||
|
||||
aName == nsGkAtoms::media ||
|
||||
aName == nsGkAtoms::type ||
|
||||
aName == nsGkAtoms::as ||
|
||||
aName == nsGkAtoms::crossorigin ||
|
||||
(LINK_DISABLED && aName == nsGkAtoms::disabled))) {
|
||||
bool dropSheet = false;
|
||||
if (aName == nsGkAtoms::rel) {
|
||||
|
|
@ -471,6 +478,7 @@ static const DOMTokenListSupportedToken sSupportedRelValues[] = {
|
|||
"preconnect",
|
||||
"icon",
|
||||
"search",
|
||||
"preload",
|
||||
nullptr
|
||||
};
|
||||
|
||||
|
|
@ -602,6 +610,12 @@ HTMLLinkElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
|||
return HTMLLinkElementBinding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
void
|
||||
HTMLLinkElement::GetAs(nsAString& aResult)
|
||||
{
|
||||
GetEnumAttr(nsGkAtoms::as, EmptyCString().get(), aResult);
|
||||
}
|
||||
|
||||
already_AddRefed<nsIDocument>
|
||||
HTMLLinkElement::GetImport()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue