Bug 1631581 - Part 6: Rename LenientSetter to LegacyLenientSetter r=edgar

Differential Revision: https://phabricator.services.mozilla.com/D111214
This commit is contained in:
Kagami Sascha Rosylight 2021-04-11 03:13:32 +00:00
Родитель 434af579f7
Коммит 074001023e
7 изменённых файлов: 33 добавлений и 30 удалений

Просмотреть файл

@ -3165,7 +3165,7 @@ class AttrDefiner(PropertyDefiner):
attr.readonly
and attr.getExtendedAttribute("PutForwards") is None
and attr.getExtendedAttribute("Replaceable") is None
and attr.getExtendedAttribute("LenientSetter") is None
and attr.getExtendedAttribute("LegacyLenientSetter") is None
):
return "nullptr, nullptr"
if crossOriginOnly and not attr.getExtendedAttribute("CrossOriginWritable"):
@ -11732,7 +11732,7 @@ class CGMemberJITInfo(CGThing):
not self.member.readonly
or self.member.getExtendedAttribute("PutForwards") is not None
or self.member.getExtendedAttribute("Replaceable") is not None
or self.member.getExtendedAttribute("LenientSetter") is not None
or self.member.getExtendedAttribute("LegacyLenientSetter") is not None
):
setterinfo = "%s_setterinfo" % IDLToCIdentifier(
self.member.identifier.name
@ -16111,7 +16111,7 @@ def memberProperties(m, descriptor):
if m.getExtendedAttribute("CrossOriginWritable"):
props.isCrossOriginSetter = True
elif m.getExtendedAttribute("Replaceable") or m.getExtendedAttribute(
"LenientSetter"
"LegacyLenientSetter"
):
if m.getExtendedAttribute("CrossOriginWritable"):
props.isCrossOriginSetter = True
@ -16216,7 +16216,7 @@ class CGDescriptor(CGThing):
needCrossOriginPropertyArrays = True
elif m.getExtendedAttribute("Replaceable"):
cgThings.append(CGSpecializedReplaceableSetter(descriptor, m))
elif m.getExtendedAttribute("LenientSetter"):
elif m.getExtendedAttribute("LegacyLenientSetter"):
# XXX In this case, we need to add an include for mozilla/dom/Document.h to the generated cpp file.
cgThings.append(CGSpecializedLenientSetter(descriptor, m))
if (

Просмотреть файл

@ -5292,35 +5292,36 @@ class IDLAttribute(IDLInterfaceMember):
"appear on the same attribute",
[attr.location, self.location],
)
elif identifier == "LenientSetter":
elif identifier == "LegacyLenientSetter":
if not attr.noArguments():
raise WebIDLError(
"[LenientSetter] must take no arguments", [attr.location]
"[LegacyLenientSetter] must take no arguments", [attr.location]
)
if not self.readonly:
raise WebIDLError(
"[LenientSetter] is only allowed on readonly " "attributes",
"[LegacyLenientSetter] is only allowed on readonly " "attributes",
[attr.location, self.location],
)
if self.type.isPromise():
raise WebIDLError(
"[LenientSetter] is not allowed on " "Promise-typed attributes",
"[LegacyLenientSetter] is not allowed on "
"Promise-typed attributes",
[attr.location, self.location],
)
if self.isStatic():
raise WebIDLError(
"[LenientSetter] is only allowed on non-static " "attributes",
"[LegacyLenientSetter] is only allowed on non-static " "attributes",
[attr.location, self.location],
)
if self.getExtendedAttribute("PutForwards") is not None:
raise WebIDLError(
"[LenientSetter] and [PutForwards] can't both "
"[LegacyLenientSetter] and [PutForwards] can't both "
"appear on the same attribute",
[attr.location, self.location],
)
if self.getExtendedAttribute("Replaceable") is not None:
raise WebIDLError(
"[LenientSetter] and [Replaceable] can't both "
"[LegacyLenientSetter] and [Replaceable] can't both "
"appear on the same attribute",
[attr.location, self.location],
)
@ -6309,9 +6310,9 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
raise WebIDLError(
"Only attributes support [PutForwards]", [attr.location, self.location]
)
elif identifier == "LenientSetter":
elif identifier == "LegacyLenientSetter":
raise WebIDLError(
"Only attributes support [LenientSetter]",
"Only attributes support [LegacyLenientSetter]",
[attr.location, self.location],
)
elif identifier == "LenientFloat":

Просмотреть файл

@ -16,19 +16,19 @@ def should_throw(parser, harness, message, code):
def WebIDLTest(parser, harness):
# The [LenientSetter] extended attribute MUST take no arguments.
# The [LegacyLenientSetter] extended attribute MUST take no arguments.
should_throw(
parser,
harness,
"no arguments",
"""
interface I {
[LenientSetter=X] readonly attribute long A;
[LegacyLenientSetter=X] readonly attribute long A;
};
""",
)
# An attribute with the [LenientSetter] extended attribute MUST NOT
# An attribute with the [LegacyLenientSetter] extended attribute MUST NOT
# also be declared with the [PutForwards] extended attribute.
should_throw(
parser,
@ -36,7 +36,7 @@ def WebIDLTest(parser, harness):
"PutForwards",
"""
interface I {
[PutForwards=B, LenientSetter] readonly attribute J A;
[PutForwards=B, LegacyLenientSetter] readonly attribute J A;
};
interface J {
attribute long B;
@ -44,7 +44,7 @@ def WebIDLTest(parser, harness):
""",
)
# An attribute with the [LenientSetter] extended attribute MUST NOT
# An attribute with the [LegacyLenientSetter] extended attribute MUST NOT
# also be declared with the [Replaceable] extended attribute.
should_throw(
parser,
@ -52,12 +52,12 @@ def WebIDLTest(parser, harness):
"Replaceable",
"""
interface I {
[Replaceable, LenientSetter] readonly attribute J A;
[Replaceable, LegacyLenientSetter] readonly attribute J A;
};
""",
)
# The [LenientSetter] extended attribute MUST NOT be used on an
# The [LegacyLenientSetter] extended attribute MUST NOT be used on an
# attribute that is not read only.
should_throw(
parser,
@ -65,12 +65,12 @@ def WebIDLTest(parser, harness):
"writable attribute",
"""
interface I {
[LenientSetter] attribute long A;
[LegacyLenientSetter] attribute long A;
};
""",
)
# The [LenientSetter] extended attribute MUST NOT be used on a
# The [LegacyLenientSetter] extended attribute MUST NOT be used on a
# static attribute.
should_throw(
parser,
@ -78,7 +78,7 @@ def WebIDLTest(parser, harness):
"static attribute",
"""
interface I {
[LenientSetter] static readonly attribute long A;
[LegacyLenientSetter] static readonly attribute long A;
};
""",
)

Просмотреть файл

@ -120,14 +120,16 @@ def WebIDLTest(parser, harness):
parser.parse(
"""
interface A {
[LenientSetter] readonly attribute Promise<any> attr;
[LegacyLenientSetter] readonly attribute Promise<any> attr;
};
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should not allow [LenientSetter] Promise-typed attributes.")
harness.ok(
threw, "Should not allow [LegacyLenientSetter] Promise-typed attributes."
)
parser = parser.reset()
threw = False

Просмотреть файл

@ -290,11 +290,11 @@ partial interface Document {
partial interface Document {
// Note: Per spec the 'S' in these two is lowercase, but the "Moz"
// versions have it uppercase.
[LenientSetter, Unscopable]
[LegacyLenientSetter, Unscopable]
readonly attribute boolean fullscreen;
[BinaryName="fullscreen"]
readonly attribute boolean mozFullScreen;
[LenientSetter, NeedsCallerType]
[LegacyLenientSetter, NeedsCallerType]
readonly attribute boolean fullscreenEnabled;
[BinaryName="fullscreenEnabled", NeedsCallerType]
readonly attribute boolean mozFullScreenEnabled;

Просмотреть файл

@ -29,7 +29,7 @@ interface mixin DocumentOrShadowRoot {
readonly attribute StyleSheetList styleSheets;
readonly attribute Element? pointerLockElement;
[LenientSetter]
[LegacyLenientSetter]
readonly attribute Element? fullscreenElement;
[BinaryName="fullscreenElement"]
readonly attribute Element? mozFullScreenElement;

Просмотреть файл

@ -82,7 +82,7 @@ interface U2F {
// Returns a Function. It's readonly + [LenientSetter] to keep the Google
// U2F polyfill from stomping on the value.
[LenientSetter, Pure, Cached, Throws]
[LegacyLenientSetter, Pure, Cached, Throws]
readonly attribute object register;
// A way to generate the actual implementation of register()
@ -95,7 +95,7 @@ interface U2F {
// Returns a Function. It's readonly + [LenientSetter] to keep the Google
// U2F polyfill from stomping on the value.
[LenientSetter, Pure, Cached, Throws]
[LegacyLenientSetter, Pure, Cached, Throws]
readonly attribute object sign;
// A way to generate the actual implementation of sign()