gecko-dev/dom/webidl/CSSStyleDeclaration.webidl
Emilio Cobos Álvarez bc36653df5 Bug 1449861 - Use UTF8String for some CSSOM APIs. r=bzbarsky
In particular, the ones where we transcode unconditionally atm (property names
and such).

There are others like cssText getters and setters which are a bit harder,
because I either need to rewrite all our serialization code to work with UTF8
(which is fine, but a lot of work), or teach webidl to have a setter that takes
UTF8String as input but returns DOMString as output (which is at best hacky).

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

--HG--
extra : moz-landing-system : lando
2020-01-04 10:36:49 +00:00

34 lines
1.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://dev.w3.org/csswg/cssom/
*/
// Because of getComputedStyle, many CSSStyleDeclaration objects can be
// short-living.
[ProbablyShortLivingWrapper,
Exposed=Window]
interface CSSStyleDeclaration {
[CEReactions, SetterNeedsSubjectPrincipal=NonSystem, SetterThrows]
attribute DOMString cssText;
readonly attribute unsigned long length;
getter UTF8String item(unsigned long index);
[Throws, ChromeOnly]
sequence<UTF8String> getCSSImageURLs(UTF8String property);
[Throws]
DOMString getPropertyValue(UTF8String property);
DOMString getPropertyPriority(UTF8String property);
[CEReactions, NeedsSubjectPrincipal=NonSystem, Throws]
void setProperty(UTF8String property, [TreatNullAs=EmptyString] UTF8String value, optional [TreatNullAs=EmptyString] DOMString priority = "");
[CEReactions, Throws]
DOMString removeProperty(UTF8String property);
readonly attribute CSSRule? parentRule;
};