mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
Bug 1631581 - Part 5: Rename TreatNullAs=EmptyString to LegacyNullToEmptyString r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D111213
This commit is contained in:
parent
20a3a7aaff
commit
434af579f7
@ -7045,7 +7045,7 @@ def getJSToNativeConversionInfo(
|
||||
undefinedBehavior = "eNull"
|
||||
else:
|
||||
undefinedBehavior = "eStringify"
|
||||
if type.treatNullAsEmpty:
|
||||
if type.legacyNullToEmptyString:
|
||||
treatNullAs = "EmptyString"
|
||||
else:
|
||||
treatNullAs = "Default"
|
||||
|
@ -13,7 +13,7 @@ import runpy
|
||||
|
||||
|
||||
def generateLine(propName, extendedAttrs):
|
||||
return " [%s] attribute [TreatNullAs=EmptyString] UTF8String %s;\n" % (
|
||||
return " [%s] attribute [LegacyNullToEmptyString] UTF8String %s;\n" % (
|
||||
", ".join(extendedAttrs),
|
||||
propName,
|
||||
)
|
||||
|
@ -2337,7 +2337,7 @@ class IDLType(IDLObject):
|
||||
IDLObject.__init__(self, location)
|
||||
self.name = name
|
||||
self.builtin = False
|
||||
self.treatNullAsEmpty = False
|
||||
self.legacyNullToEmptyString = False
|
||||
self._clamp = False
|
||||
self._enforceRange = False
|
||||
self._allowShared = False
|
||||
@ -2349,7 +2349,7 @@ class IDLType(IDLObject):
|
||||
+ hash(self.name)
|
||||
+ hash(self._clamp)
|
||||
+ hash(self._enforceRange)
|
||||
+ hash(self.treatNullAsEmpty)
|
||||
+ hash(self.legacyNullToEmptyString)
|
||||
+ hash(self._allowShared)
|
||||
)
|
||||
|
||||
@ -2360,7 +2360,7 @@ class IDLType(IDLObject):
|
||||
and self.name == other.name
|
||||
and self._clamp == other.hasClamp()
|
||||
and self._enforceRange == other.hasEnforceRange()
|
||||
and self.treatNullAsEmpty == other.treatNullAsEmpty
|
||||
and self.legacyNullToEmptyString == other.legacyNullToEmptyString
|
||||
and self._allowShared == other.hasAllowShared()
|
||||
)
|
||||
|
||||
@ -2737,9 +2737,9 @@ class IDLNullableType(IDLParametrizedType):
|
||||
[self.location],
|
||||
)
|
||||
if self.inner.isDOMString():
|
||||
if self.inner.treatNullAsEmpty:
|
||||
if self.inner.legacyNullToEmptyString:
|
||||
raise WebIDLError(
|
||||
"[TreatNullAs] not allowed on a nullable DOMString",
|
||||
"[LegacyNullToEmptyString] not allowed on a nullable DOMString",
|
||||
[self.location, self.inner.location],
|
||||
)
|
||||
|
||||
@ -3508,14 +3508,14 @@ class IDLBuiltinType(IDLType):
|
||||
type,
|
||||
clamp=False,
|
||||
enforceRange=False,
|
||||
treatNullAsEmpty=False,
|
||||
legacyNullToEmptyString=False,
|
||||
allowShared=False,
|
||||
attrLocation=[],
|
||||
):
|
||||
"""
|
||||
The mutually exclusive clamp/enforceRange/treatNullAsEmpty/allowShared arguments are used
|
||||
The mutually exclusive clamp/enforceRange/legacyNullToEmptyString/allowShared arguments are used
|
||||
to create instances of this type with the appropriate attributes attached. Use .clamped(),
|
||||
.rangeEnforced(), .withTreatNullAs() and .withAllowShared().
|
||||
.rangeEnforced(), .withLegacyNullToEmptyString() and .withAllowShared().
|
||||
|
||||
attrLocation is an array of source locations of these attributes for error reporting.
|
||||
"""
|
||||
@ -3524,7 +3524,7 @@ class IDLBuiltinType(IDLType):
|
||||
self._typeTag = type
|
||||
self._clamped = None
|
||||
self._rangeEnforced = None
|
||||
self._withTreatNullAs = None
|
||||
self._withLegacyNullToEmptyString = None
|
||||
self._withAllowShared = None
|
||||
if self.isInteger():
|
||||
if clamp:
|
||||
@ -3540,12 +3540,14 @@ class IDLBuiltinType(IDLType):
|
||||
"Non-integer types cannot be [Clamp] or [EnforceRange]", attrLocation
|
||||
)
|
||||
if self.isDOMString() or self.isUTF8String():
|
||||
if treatNullAsEmpty:
|
||||
self.treatNullAsEmpty = True
|
||||
if legacyNullToEmptyString:
|
||||
self.legacyNullToEmptyString = True
|
||||
self.name = "NullIsEmpty" + self.name
|
||||
self._extendedAttrDict["TreatNullAs"] = ["EmptyString"]
|
||||
elif treatNullAsEmpty:
|
||||
raise WebIDLError("Non-string types cannot be [TreatNullAs]", attrLocation)
|
||||
self._extendedAttrDict["LegacyNullToEmptyString"] = True
|
||||
elif legacyNullToEmptyString:
|
||||
raise WebIDLError(
|
||||
"Non-string types cannot be [LegacyNullToEmptyString]", attrLocation
|
||||
)
|
||||
if self.isBufferSource():
|
||||
if allowShared:
|
||||
self._allowShared = True
|
||||
@ -3587,16 +3589,16 @@ class IDLBuiltinType(IDLType):
|
||||
)
|
||||
return self._rangeEnforced
|
||||
|
||||
def withTreatNullAs(self, attrLocation):
|
||||
if not self._withTreatNullAs:
|
||||
self._withTreatNullAs = IDLBuiltinType(
|
||||
def withLegacyNullToEmptyString(self, attrLocation):
|
||||
if not self._withLegacyNullToEmptyString:
|
||||
self._withLegacyNullToEmptyString = IDLBuiltinType(
|
||||
self.location,
|
||||
self.name,
|
||||
self._typeTag,
|
||||
treatNullAsEmpty=True,
|
||||
legacyNullToEmptyString=True,
|
||||
attrLocation=attrLocation,
|
||||
)
|
||||
return self._withTreatNullAs
|
||||
return self._withLegacyNullToEmptyString
|
||||
|
||||
def withAllowShared(self, attrLocation):
|
||||
if not self._withAllowShared:
|
||||
@ -3814,26 +3816,21 @@ class IDLBuiltinType(IDLType):
|
||||
[self.location, attribute.location],
|
||||
)
|
||||
ret = self.rangeEnforced([self.location, attribute.location])
|
||||
elif identifier == "TreatNullAs":
|
||||
elif identifier == "LegacyNullToEmptyString":
|
||||
if not (self.isDOMString() or self.isUTF8String()):
|
||||
raise WebIDLError(
|
||||
"[TreatNullAs] only allowed on DOMStrings and UTF8Strings",
|
||||
"[LegacyNullToEmptyString] only allowed on DOMStrings and UTF8Strings",
|
||||
[self.location, attribute.location],
|
||||
)
|
||||
assert not self.nullable()
|
||||
if not attribute.hasValue():
|
||||
if attribute.hasValue():
|
||||
raise WebIDLError(
|
||||
"[TreatNullAs] must take an identifier argument",
|
||||
"[LegacyNullToEmptyString] must take no identifier argument",
|
||||
[attribute.location],
|
||||
)
|
||||
value = attribute.value()
|
||||
if value != "EmptyString":
|
||||
raise WebIDLError(
|
||||
"[TreatNullAs] must take the identifier "
|
||||
"'EmptyString', not '%s'" % value,
|
||||
[attribute.location],
|
||||
)
|
||||
ret = self.withTreatNullAs([self.location, attribute.location])
|
||||
ret = self.withLegacyNullToEmptyString(
|
||||
[self.location, attribute.location]
|
||||
)
|
||||
elif identifier == "AllowShared":
|
||||
if not attribute.noArguments():
|
||||
raise WebIDLError(
|
||||
@ -4130,8 +4127,8 @@ class IDLValue(IDLObject):
|
||||
)
|
||||
|
||||
return IDLValue(self.location, type, self.value)
|
||||
elif self.type.isDOMString() and type.treatNullAsEmpty:
|
||||
# TreatNullAsEmpty is a different type for resolution reasons,
|
||||
elif self.type.isDOMString() and type.legacyNullToEmptyString:
|
||||
# LegacyNullToEmptyString is a different type for resolution reasons,
|
||||
# however once you have a value it doesn't matter
|
||||
return self
|
||||
|
||||
@ -5019,7 +5016,7 @@ class IDLAttribute(IDLInterfaceMember):
|
||||
self.type.hasClamp()
|
||||
or self.type.hasEnforceRange()
|
||||
or self.type.hasAllowShared()
|
||||
or self.type.treatNullAsEmpty
|
||||
or self.type.legacyNullToEmptyString
|
||||
):
|
||||
raise WebIDLError(
|
||||
"A readonly attribute cannot be [Clamp] or [EnforceRange] or [AllowShared]",
|
||||
@ -5563,7 +5560,7 @@ class IDLArgument(IDLObjectWithIdentifier):
|
||||
if self.allowTypeAttributes and (
|
||||
identifier == "EnforceRange"
|
||||
or identifier == "Clamp"
|
||||
or identifier == "TreatNullAs"
|
||||
or identifier == "LegacyNullToEmptyString"
|
||||
or identifier == "AllowShared"
|
||||
):
|
||||
self.type = self.type.withExtendedAttributes([attribute])
|
||||
@ -5622,9 +5619,10 @@ class IDLArgument(IDLObjectWithIdentifier):
|
||||
# codegen doesn't have to special-case this.
|
||||
self.defaultValue = IDLUndefinedValue(self.location)
|
||||
|
||||
if self.dictionaryMember and self.type.treatNullAsEmpty:
|
||||
if self.dictionaryMember and self.type.legacyNullToEmptyString:
|
||||
raise WebIDLError(
|
||||
"Dictionary members cannot be [TreatNullAs]", [self.location]
|
||||
"Dictionary members cannot be [LegacyNullToEmptyString]",
|
||||
[self.location],
|
||||
)
|
||||
# Now do the coercing thing; this needs to happen after the
|
||||
# above creation of a default value.
|
||||
|
@ -10,7 +10,7 @@ def WebIDLTest(parser, harness):
|
||||
"""
|
||||
typedef [EnforceRange] long Foo;
|
||||
typedef [Clamp] long Bar;
|
||||
typedef [TreatNullAs=EmptyString] DOMString Baz;
|
||||
typedef [LegacyNullToEmptyString] DOMString Baz;
|
||||
dictionary A {
|
||||
required [EnforceRange] long a;
|
||||
required [Clamp] long b;
|
||||
@ -21,12 +21,12 @@ def WebIDLTest(parser, harness):
|
||||
attribute Foo typedefFoo;
|
||||
attribute [EnforceRange] long foo;
|
||||
attribute [Clamp] long bar;
|
||||
attribute [TreatNullAs=EmptyString] DOMString baz;
|
||||
attribute [LegacyNullToEmptyString] DOMString baz;
|
||||
void method([EnforceRange] long foo, [Clamp] long bar,
|
||||
[TreatNullAs=EmptyString] DOMString baz);
|
||||
[LegacyNullToEmptyString] DOMString baz);
|
||||
void method2(optional [EnforceRange] long foo, optional [Clamp] long bar,
|
||||
optional [TreatNullAs=EmptyString] DOMString baz);
|
||||
void method3(optional [TreatNullAs=EmptyString] UTF8String foo = "");
|
||||
optional [LegacyNullToEmptyString] DOMString baz);
|
||||
void method3(optional [LegacyNullToEmptyString] UTF8String foo = "");
|
||||
};
|
||||
interface C {
|
||||
attribute [EnforceRange] long? foo;
|
||||
@ -56,9 +56,9 @@ def WebIDLTest(parser, harness):
|
||||
)
|
||||
harness.check(results[1].innerType.hasClamp(), True, "Bar is [Clamp]")
|
||||
harness.check(
|
||||
results[2].innerType.treatNullAsEmpty,
|
||||
results[2].innerType.legacyNullToEmptyString,
|
||||
True,
|
||||
"Baz is [TreatNullAs=EmptyString]",
|
||||
"Baz is [LegacyNullToEmptyString]",
|
||||
)
|
||||
A = results[3]
|
||||
harness.check(
|
||||
@ -80,9 +80,9 @@ def WebIDLTest(parser, harness):
|
||||
)
|
||||
harness.check(B.members[2].type.hasClamp(), True, "B.bar is [Clamp]")
|
||||
harness.check(
|
||||
B.members[3].type.treatNullAsEmpty,
|
||||
B.members[3].type.legacyNullToEmptyString,
|
||||
True,
|
||||
"B.baz is [TreatNullAs=EmptyString]",
|
||||
"B.baz is [LegacyNullToEmptyString]",
|
||||
)
|
||||
method = B.members[4].signatures()[0][1]
|
||||
harness.check(
|
||||
@ -94,9 +94,9 @@ def WebIDLTest(parser, harness):
|
||||
method[1].type.hasClamp(), True, "bar argument of method is [Clamp]"
|
||||
)
|
||||
harness.check(
|
||||
method[2].type.treatNullAsEmpty,
|
||||
method[2].type.legacyNullToEmptyString,
|
||||
True,
|
||||
"baz argument of method is [TreatNullAs=EmptyString]",
|
||||
"baz argument of method is [LegacyNullToEmptyString]",
|
||||
)
|
||||
method2 = B.members[5].signatures()[0][1]
|
||||
harness.check(
|
||||
@ -108,16 +108,16 @@ def WebIDLTest(parser, harness):
|
||||
method2[1].type.hasClamp(), True, "bar argument of method2 is [Clamp]"
|
||||
)
|
||||
harness.check(
|
||||
method2[2].type.treatNullAsEmpty,
|
||||
method2[2].type.legacyNullToEmptyString,
|
||||
True,
|
||||
"baz argument of method2 is [TreatNullAs=EmptyString]",
|
||||
"baz argument of method2 is [LegacyNullToEmptyString]",
|
||||
)
|
||||
|
||||
method3 = B.members[6].signatures()[0][1]
|
||||
harness.check(
|
||||
method3[0].type.treatNullAsEmpty,
|
||||
method3[0].type.legacyNullToEmptyString,
|
||||
True,
|
||||
"bar argument of method2 is [TreatNullAs=EmptyString]",
|
||||
"bar argument of method2 is [LegacyNullToEmptyString]",
|
||||
)
|
||||
harness.check(
|
||||
method3[0].defaultValue.type.isUTF8String(),
|
||||
@ -220,7 +220,7 @@ def WebIDLTest(parser, harness):
|
||||
ATTRIBUTES = [
|
||||
("[Clamp]", "long"),
|
||||
("[EnforceRange]", "long"),
|
||||
("[TreatNullAs=EmptyString]", "DOMString"),
|
||||
("[LegacyNullToEmptyString]", "DOMString"),
|
||||
("[AllowShared]", "ArrayBufferView"),
|
||||
]
|
||||
TEMPLATES = [
|
||||
@ -462,42 +462,44 @@ def WebIDLTest(parser, harness):
|
||||
try:
|
||||
parser.parse(
|
||||
"""
|
||||
typedef [TreatNullAs=EmptyString] long Foo;
|
||||
typedef [LegacyNullToEmptyString] long Foo;
|
||||
"""
|
||||
)
|
||||
parser.finish()
|
||||
except:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Should not allow [TreatNullAs] on long")
|
||||
harness.ok(threw, "Should not allow [LegacyNullToEmptyString] on long")
|
||||
|
||||
parser = parser.reset()
|
||||
threw = False
|
||||
try:
|
||||
parser.parse(
|
||||
"""
|
||||
typedef [TreatNullAs=EmptyString] JSString Foo;
|
||||
typedef [LegacyNullToEmptyString] JSString Foo;
|
||||
"""
|
||||
)
|
||||
parser.finish()
|
||||
except:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Should not allow [TreatNullAs] on JSString")
|
||||
harness.ok(threw, "Should not allow [LegacyNullToEmptyString] on JSString")
|
||||
|
||||
parser = parser.reset()
|
||||
threw = False
|
||||
try:
|
||||
parser.parse(
|
||||
"""
|
||||
typedef [TreatNullAs=EmptyString] DOMString? Foo;
|
||||
typedef [LegacyNullToEmptyString] DOMString? Foo;
|
||||
"""
|
||||
)
|
||||
parser.finish()
|
||||
except:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Should not allow [TreatNullAs] on nullable DOMString")
|
||||
harness.ok(
|
||||
threw, "Should not allow [LegacyNullToEmptyString] on nullable DOMString"
|
||||
)
|
||||
|
||||
parser = parser.reset()
|
||||
threw = False
|
||||
|
@ -160,7 +160,7 @@ def WebIDLTest(parser, harness):
|
||||
parser.parse(
|
||||
"""
|
||||
dictionary A {
|
||||
[TreatNullAs=EmptyString] DOMString foo;
|
||||
[LegacyNullToEmptyString] DOMString foo;
|
||||
};
|
||||
"""
|
||||
)
|
||||
@ -168,7 +168,9 @@ def WebIDLTest(parser, harness):
|
||||
except:
|
||||
threw = True
|
||||
|
||||
harness.ok(threw, "Should not allow [TreatNullAs] on dictionary members")
|
||||
harness.ok(
|
||||
threw, "Should not allow [LegacyNullToEmptyString] on dictionary members"
|
||||
)
|
||||
|
||||
parser = parser.reset()
|
||||
threw = False
|
||||
|
@ -1401,7 +1401,7 @@ interface TestCEReactionsInterface {
|
||||
|
||||
typedef [EnforceRange] octet OctetRange;
|
||||
typedef [Clamp] octet OctetClamp;
|
||||
typedef [TreatNullAs=EmptyString] DOMString NullEmptyString;
|
||||
typedef [LegacyNullToEmptyString] DOMString NullEmptyString;
|
||||
// typedef [TreatNullAs=EmptyString] JSString NullEmptyJSString;
|
||||
|
||||
dictionary TestAttributesOnDictionaryMembers {
|
||||
|
@ -102,9 +102,9 @@ interface BrowsingContext {
|
||||
|
||||
readonly attribute boolean ancestorsAreCurrent;
|
||||
|
||||
[SetterThrows] attribute [TreatNullAs=EmptyString] DOMString customPlatform;
|
||||
[SetterThrows] attribute [LegacyNullToEmptyString] DOMString customPlatform;
|
||||
|
||||
[SetterThrows] attribute [TreatNullAs=EmptyString] DOMString customUserAgent;
|
||||
[SetterThrows] attribute [LegacyNullToEmptyString] DOMString customUserAgent;
|
||||
|
||||
readonly attribute DOMString embedderElementType;
|
||||
|
||||
|
@ -16,7 +16,7 @@ namespace InspectorUtils {
|
||||
sequence<StyleSheet> getAllStyleSheets(Document document, optional boolean documentOnly = false);
|
||||
sequence<CSSStyleRule> getCSSStyleRules(
|
||||
Element element,
|
||||
optional [TreatNullAs=EmptyString] DOMString pseudo = "",
|
||||
optional [LegacyNullToEmptyString] DOMString pseudo = "",
|
||||
optional boolean relevantLinkVisited = false);
|
||||
unsigned long getRuleLine(CSSRule rule);
|
||||
unsigned long getRuleColumn(CSSRule rule);
|
||||
@ -31,7 +31,7 @@ namespace InspectorUtils {
|
||||
Element element,
|
||||
CSSStyleRule rule,
|
||||
unsigned long selectorIndex,
|
||||
optional [TreatNullAs=EmptyString] DOMString pseudo = "",
|
||||
optional [LegacyNullToEmptyString] DOMString pseudo = "",
|
||||
optional boolean includeVisitedStyle = false);
|
||||
boolean isInheritedProperty(UTF8String property);
|
||||
sequence<DOMString> getCSSPropertyNames(optional PropertyNamesOptions options = {});
|
||||
@ -77,7 +77,7 @@ namespace InspectorUtils {
|
||||
boolean hasPseudoClassLock(Element element, DOMString pseudoClass);
|
||||
void clearPseudoClassLocks(Element element);
|
||||
[Throws] void parseStyleSheet(CSSStyleSheet sheet, UTF8String input);
|
||||
boolean isCustomElementName([TreatNullAs=EmptyString] DOMString name,
|
||||
boolean isCustomElementName([LegacyNullToEmptyString] DOMString name,
|
||||
DOMString? namespaceURI);
|
||||
|
||||
boolean isElementThemed(Element element);
|
||||
|
@ -25,7 +25,7 @@ interface CSSStyleDeclaration {
|
||||
UTF8String getPropertyValue(UTF8String property);
|
||||
UTF8String getPropertyPriority(UTF8String property);
|
||||
[CEReactions, NeedsSubjectPrincipal=NonSystem, Throws]
|
||||
void setProperty(UTF8String property, [TreatNullAs=EmptyString] UTF8String value, optional [TreatNullAs=EmptyString] UTF8String priority = "");
|
||||
void setProperty(UTF8String property, [LegacyNullToEmptyString] UTF8String value, optional [LegacyNullToEmptyString] UTF8String priority = "");
|
||||
[CEReactions, Throws]
|
||||
UTF8String removeProperty(UTF8String property);
|
||||
|
||||
|
@ -192,7 +192,7 @@ interface mixin CanvasFillStrokeStyles {
|
||||
[Pref="canvas.createConicGradient.enabled", NewObject]
|
||||
CanvasGradient createConicGradient(double angle, double cx, double cy);
|
||||
[NewObject, Throws]
|
||||
CanvasPattern? createPattern(CanvasImageSource image, [TreatNullAs=EmptyString] DOMString repetition);
|
||||
CanvasPattern? createPattern(CanvasImageSource image, [LegacyNullToEmptyString] DOMString repetition);
|
||||
};
|
||||
|
||||
interface mixin CanvasShadowStyles {
|
||||
|
@ -13,7 +13,7 @@
|
||||
[Exposed=Window]
|
||||
interface CharacterData : Node {
|
||||
[Pure, SetterThrows]
|
||||
attribute [TreatNullAs=EmptyString] DOMString data;
|
||||
attribute [LegacyNullToEmptyString] DOMString data;
|
||||
[Pure]
|
||||
readonly attribute unsigned long length;
|
||||
[Throws]
|
||||
|
@ -20,7 +20,7 @@ interface DOMImplementation {
|
||||
DOMString systemId);
|
||||
[Throws]
|
||||
Document createDocument(DOMString? namespace,
|
||||
[TreatNullAs=EmptyString] DOMString qualifiedName,
|
||||
[LegacyNullToEmptyString] DOMString qualifiedName,
|
||||
optional DocumentType? doctype = null);
|
||||
[Throws]
|
||||
Document createHTMLDocument(optional DOMString title);
|
||||
|
@ -267,11 +267,11 @@ partial interface Document {
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/obsolete.html#other-elements%2C-attributes-and-apis
|
||||
partial interface Document {
|
||||
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString fgColor;
|
||||
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString linkColor;
|
||||
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString vlinkColor;
|
||||
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString alinkColor;
|
||||
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString bgColor;
|
||||
[CEReactions] attribute [LegacyNullToEmptyString] DOMString fgColor;
|
||||
[CEReactions] attribute [LegacyNullToEmptyString] DOMString linkColor;
|
||||
[CEReactions] attribute [LegacyNullToEmptyString] DOMString vlinkColor;
|
||||
[CEReactions] attribute [LegacyNullToEmptyString] DOMString alinkColor;
|
||||
[CEReactions] attribute [LegacyNullToEmptyString] DOMString bgColor;
|
||||
|
||||
[SameObject] readonly attribute HTMLCollection anchors;
|
||||
[SameObject] readonly attribute HTMLCollection applets;
|
||||
|
@ -241,9 +241,9 @@ partial interface Element {
|
||||
// http://domparsing.spec.whatwg.org/#extensions-to-the-element-interface
|
||||
partial interface Element {
|
||||
[CEReactions, SetterNeedsSubjectPrincipal=NonSystem, Pure, SetterThrows, GetterCanOOM]
|
||||
attribute [TreatNullAs=EmptyString] DOMString innerHTML;
|
||||
attribute [LegacyNullToEmptyString] DOMString innerHTML;
|
||||
[CEReactions, Pure, SetterThrows]
|
||||
attribute [TreatNullAs=EmptyString] DOMString outerHTML;
|
||||
attribute [LegacyNullToEmptyString] DOMString outerHTML;
|
||||
[CEReactions, Throws]
|
||||
void insertAdjacentHTML(DOMString position, DOMString text);
|
||||
};
|
||||
|
@ -19,15 +19,15 @@ interface HTMLBodyElement : HTMLElement {
|
||||
|
||||
partial interface HTMLBodyElement {
|
||||
[CEReactions, SetterThrows]
|
||||
attribute [TreatNullAs=EmptyString] DOMString text;
|
||||
attribute [LegacyNullToEmptyString] DOMString text;
|
||||
[CEReactions, SetterThrows]
|
||||
attribute [TreatNullAs=EmptyString] DOMString link;
|
||||
attribute [LegacyNullToEmptyString] DOMString link;
|
||||
[CEReactions, SetterThrows]
|
||||
attribute [TreatNullAs=EmptyString] DOMString vLink;
|
||||
attribute [LegacyNullToEmptyString] DOMString vLink;
|
||||
[CEReactions, SetterThrows]
|
||||
attribute [TreatNullAs=EmptyString] DOMString aLink;
|
||||
attribute [LegacyNullToEmptyString] DOMString aLink;
|
||||
[CEReactions, SetterThrows]
|
||||
attribute [TreatNullAs=EmptyString] DOMString bgColor;
|
||||
attribute [LegacyNullToEmptyString] DOMString bgColor;
|
||||
[CEReactions, SetterThrows]
|
||||
attribute DOMString background;
|
||||
};
|
||||
|
@ -26,7 +26,7 @@ interface HTMLElement : Element {
|
||||
attribute DOMString dir;
|
||||
|
||||
[CEReactions, GetterThrows, Pure]
|
||||
attribute [TreatNullAs=EmptyString] DOMString innerText;
|
||||
attribute [LegacyNullToEmptyString] DOMString innerText;
|
||||
|
||||
// user interaction
|
||||
[CEReactions, SetterThrows, Pure]
|
||||
|
@ -15,7 +15,7 @@
|
||||
interface HTMLFontElement : HTMLElement {
|
||||
[HTMLConstructor] constructor();
|
||||
|
||||
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString color;
|
||||
[CEReactions, SetterThrows] attribute [LegacyNullToEmptyString] DOMString color;
|
||||
[CEReactions, SetterThrows] attribute DOMString face;
|
||||
[CEReactions, SetterThrows] attribute DOMString size;
|
||||
};
|
||||
|
@ -32,9 +32,9 @@ interface HTMLFrameElement : HTMLElement {
|
||||
readonly attribute WindowProxy? contentWindow;
|
||||
|
||||
[CEReactions, SetterThrows]
|
||||
attribute [TreatNullAs=EmptyString] DOMString marginHeight;
|
||||
attribute [LegacyNullToEmptyString] DOMString marginHeight;
|
||||
[CEReactions, SetterThrows]
|
||||
attribute [TreatNullAs=EmptyString] DOMString marginWidth;
|
||||
attribute [LegacyNullToEmptyString] DOMString marginWidth;
|
||||
};
|
||||
|
||||
HTMLFrameElement includes MozFrameLoaderOwner;
|
||||
|
@ -50,9 +50,9 @@ partial interface HTMLIFrameElement {
|
||||
attribute DOMString longDesc;
|
||||
|
||||
[CEReactions, SetterThrows, Pure]
|
||||
attribute [TreatNullAs=EmptyString] DOMString marginHeight;
|
||||
attribute [LegacyNullToEmptyString] DOMString marginHeight;
|
||||
[CEReactions, SetterThrows, Pure]
|
||||
attribute [TreatNullAs=EmptyString] DOMString marginWidth;
|
||||
attribute [LegacyNullToEmptyString] DOMString marginWidth;
|
||||
};
|
||||
|
||||
partial interface HTMLIFrameElement {
|
||||
|
@ -63,7 +63,7 @@ partial interface HTMLImageElement {
|
||||
[CEReactions, SetterThrows]
|
||||
attribute DOMString longDesc;
|
||||
|
||||
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString border;
|
||||
[CEReactions, SetterThrows] attribute [LegacyNullToEmptyString] DOMString border;
|
||||
};
|
||||
|
||||
// [Update me: not in whatwg spec yet]
|
||||
|
@ -93,7 +93,7 @@ interface HTMLInputElement : HTMLElement {
|
||||
[CEReactions, Pure, SetterThrows]
|
||||
attribute DOMString defaultValue;
|
||||
[CEReactions, Pure, SetterThrows, NeedsCallerType]
|
||||
attribute [TreatNullAs=EmptyString] DOMString value;
|
||||
attribute [LegacyNullToEmptyString] DOMString value;
|
||||
[Throws]
|
||||
attribute object? valueAsDate;
|
||||
[Pure, SetterThrows]
|
||||
|
@ -70,7 +70,7 @@ partial interface HTMLObjectElement {
|
||||
attribute DOMString codeType;
|
||||
|
||||
[CEReactions, Pure, SetterThrows]
|
||||
attribute [TreatNullAs=EmptyString] DOMString border;
|
||||
attribute [LegacyNullToEmptyString] DOMString border;
|
||||
};
|
||||
|
||||
partial interface HTMLObjectElement {
|
||||
|
@ -51,5 +51,5 @@ partial interface HTMLTableCellElement {
|
||||
attribute DOMString vAlign;
|
||||
|
||||
[CEReactions, SetterThrows]
|
||||
attribute [TreatNullAs=EmptyString] DOMString bgColor;
|
||||
attribute [LegacyNullToEmptyString] DOMString bgColor;
|
||||
};
|
||||
|
@ -56,9 +56,9 @@ partial interface HTMLTableElement {
|
||||
attribute DOMString width;
|
||||
|
||||
[CEReactions, SetterThrows]
|
||||
attribute [TreatNullAs=EmptyString] DOMString bgColor;
|
||||
attribute [LegacyNullToEmptyString] DOMString bgColor;
|
||||
[CEReactions, SetterThrows]
|
||||
attribute [TreatNullAs=EmptyString] DOMString cellPadding;
|
||||
attribute [LegacyNullToEmptyString] DOMString cellPadding;
|
||||
[CEReactions, SetterThrows]
|
||||
attribute [TreatNullAs=EmptyString] DOMString cellSpacing;
|
||||
attribute [LegacyNullToEmptyString] DOMString cellSpacing;
|
||||
};
|
||||
|
@ -35,5 +35,5 @@ partial interface HTMLTableRowElement {
|
||||
attribute DOMString vAlign;
|
||||
|
||||
[CEReactions, SetterThrows]
|
||||
attribute [TreatNullAs=EmptyString] DOMString bgColor;
|
||||
attribute [LegacyNullToEmptyString] DOMString bgColor;
|
||||
};
|
||||
|
@ -51,7 +51,7 @@ interface HTMLTextAreaElement : HTMLElement {
|
||||
readonly attribute DOMString type;
|
||||
[CEReactions, Throws, Pure]
|
||||
attribute DOMString defaultValue;
|
||||
[CEReactions, SetterThrows] attribute [TreatNullAs=EmptyString] DOMString value;
|
||||
[CEReactions, SetterThrows] attribute [LegacyNullToEmptyString] DOMString value;
|
||||
[BinaryName="getTextLength"]
|
||||
readonly attribute unsigned long textLength;
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
[Exposed=Window]
|
||||
interface MediaList {
|
||||
stringifier attribute [TreatNullAs=EmptyString] UTF8String mediaText;
|
||||
stringifier attribute [LegacyNullToEmptyString] UTF8String mediaText;
|
||||
|
||||
readonly attribute unsigned long length;
|
||||
getter UTF8String? item(unsigned long index);
|
||||
|
@ -19,10 +19,10 @@ interface mixin ParentNode {
|
||||
|
||||
[ChromeOnly]
|
||||
HTMLCollection getElementsByAttribute(DOMString name,
|
||||
[TreatNullAs=EmptyString] DOMString value);
|
||||
[LegacyNullToEmptyString] DOMString value);
|
||||
[ChromeOnly, Throws]
|
||||
HTMLCollection getElementsByAttributeNS(DOMString? namespaceURI, DOMString name,
|
||||
[TreatNullAs=EmptyString] DOMString value);
|
||||
[LegacyNullToEmptyString] DOMString value);
|
||||
|
||||
[CEReactions, Throws, Unscopable]
|
||||
void prepend((Node or DOMString)... nodes);
|
||||
|
@ -28,7 +28,7 @@ interface ShadowRoot : DocumentFragment
|
||||
|
||||
// https://w3c.github.io/DOM-Parsing/#the-innerhtml-mixin
|
||||
[CEReactions, SetterThrows]
|
||||
attribute [TreatNullAs=EmptyString] DOMString innerHTML;
|
||||
attribute [LegacyNullToEmptyString] DOMString innerHTML;
|
||||
|
||||
// When JS invokes importNode or createElement, the binding code needs to
|
||||
// create a reflector, and so invoking those methods directly on the content
|
||||
|
@ -239,7 +239,7 @@ typedef OfflineResourceList ApplicationCache;
|
||||
[Replaceable, Throws, CrossOriginReadable] readonly attribute WindowProxy? parent;
|
||||
[Throws, NeedsSubjectPrincipal] readonly attribute Element? frameElement;
|
||||
//[Throws] WindowProxy? open(optional USVString url = "about:blank", optional DOMString target = "_blank", [TreatNullAs=EmptyString] optional DOMString features = "");
|
||||
[Throws] WindowProxy? open(optional USVString url = "", optional DOMString target = "", optional [TreatNullAs=EmptyString] DOMString features = "");
|
||||
[Throws] WindowProxy? open(optional USVString url = "", optional DOMString target = "", optional [LegacyNullToEmptyString] DOMString features = "");
|
||||
getter object (DOMString name);
|
||||
|
||||
// the user agent
|
||||
|
@ -56,7 +56,7 @@ interface XSLTProcessor {
|
||||
* @param value The new value of the XSLT parameter
|
||||
*/
|
||||
[Throws]
|
||||
void setParameter([TreatNullAs=EmptyString] DOMString namespaceURI,
|
||||
void setParameter([LegacyNullToEmptyString] DOMString namespaceURI,
|
||||
DOMString localName,
|
||||
any value);
|
||||
|
||||
@ -69,7 +69,7 @@ interface XSLTProcessor {
|
||||
* @return nsIVariant The value of the XSLT parameter
|
||||
*/
|
||||
[Throws]
|
||||
nsIVariant? getParameter([TreatNullAs=EmptyString] DOMString namespaceURI,
|
||||
nsIVariant? getParameter([LegacyNullToEmptyString] DOMString namespaceURI,
|
||||
DOMString localName);
|
||||
/**
|
||||
* Removes a parameter, if set. This will make the processor use the
|
||||
@ -79,7 +79,7 @@ interface XSLTProcessor {
|
||||
* @param localName The local name of the XSLT parameter
|
||||
*/
|
||||
[Throws]
|
||||
void removeParameter([TreatNullAs=EmptyString] DOMString namespaceURI,
|
||||
void removeParameter([LegacyNullToEmptyString] DOMString namespaceURI,
|
||||
DOMString localName);
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user