gecko-dev/dom/webidl/HTMLLinkElement.webidl
Emilio Cobos Álvarez 60a57d4109 Bug 1281135 - Make <link disabled> work and HTMLLinkElement.disabled reflect that attribute. r=bzbarsky
...instead of forwarding to the sheet like HTMLStyleElement does.

I've proposed this behavior in:

  https://github.com/whatwg/html/issues/3840#issuecomment-480894419

I think this is one of the sane behaviors we can have, what Blink / WebKit do
makes no sense to me.

Alternative potentially-sane behavior is making the initial value of the
stylesheet's disabled bit the same as the content attribute, and both reflect
and forward the attribute from the setter.

That means that setAttribute does something different than setting `disabled`,
which means that you can get into all sorts of funny states when reloading the
sheet... So I rather not do that.

Differential Revision: https://phabricator.services.mozilla.com/D26573

--HG--
extra : moz-landing-system : lando
2019-04-18 07:48:55 +00:00

60 lines
2.2 KiB
Plaintext

/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* The origin of this IDL file is
* http://www.whatwg.org/specs/web-apps/current-work/#the-link-element
* http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
* © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
* Opera Software ASA. You are granted a license to use, reproduce
* and create derivative works of this document.
*/
// http://www.whatwg.org/specs/web-apps/current-work/#the-link-element
[HTMLConstructor]
interface HTMLLinkElement : HTMLElement {
[CEReactions, SetterThrows, Pure]
attribute boolean disabled;
[CEReactions, SetterNeedsSubjectPrincipal=NonSystem, SetterThrows, Pure]
attribute DOMString href;
[CEReactions, SetterThrows, Pure]
attribute DOMString? crossOrigin;
[CEReactions, SetterThrows, Pure]
attribute DOMString rel;
[PutForwards=value]
readonly attribute DOMTokenList relList;
[CEReactions, SetterThrows, Pure]
attribute DOMString media;
[CEReactions, SetterThrows, Pure]
attribute DOMString hreflang;
[CEReactions, SetterThrows, Pure]
attribute DOMString type;
[CEReactions, SetterThrows, Pure]
attribute DOMString referrerPolicy;
[PutForwards=value] readonly attribute DOMTokenList sizes;
};
HTMLLinkElement implements LinkStyle;
// http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis
partial interface HTMLLinkElement {
[CEReactions, SetterThrows, Pure]
attribute DOMString charset;
[CEReactions, SetterThrows, Pure]
attribute DOMString rev;
[CEReactions, SetterThrows, Pure]
attribute DOMString target;
};
// https://w3c.github.io/webappsec/specs/subresourceintegrity/#htmllinkelement-1
partial interface HTMLLinkElement {
[CEReactions, SetterThrows]
attribute DOMString integrity;
};
//https://w3c.github.io/preload/
partial interface HTMLLinkElement {
[SetterThrows, Pure]
attribute DOMString as;
};