Backed out 2 changesets (bug 1828674) for causing build bustage on nsGenericHTMLElement.cpp CLOSED TREE

Backed out changeset 40ab13fb03c1 (bug 1828674)
Backed out changeset 1f7322b59dfb (bug 1828674)
This commit is contained in:
Norisz Fay 2023-05-15 15:22:29 +03:00
parent d1207003f0
commit f60cf6bfa8
9 changed files with 39 additions and 45 deletions

View File

@ -329,8 +329,6 @@ class nsAttrValue {
: tag(aTag), value(static_cast<int16_t>(aValue)) {
static_assert(mozilla::EnumTypeFitsWithin<T, int16_t>::value,
"aValue must be an enum that fits within int16_t");
// TODO: statically assert there are no duplicate values, otherwise
// `GetEnumString()` above will return wrong values.
}
/** The string the value maps to */

View File

@ -184,20 +184,12 @@ nsresult nsGenericHTMLElement::CopyInnerTo(Element* aDst) {
static const nsAttrValue::EnumTable kDirTable[] = {
{"ltr", eDir_LTR}, {"rtl", eDir_RTL}, {"auto", eDir_Auto}, {nullptr, 0}};
namespace {
// See <https://html.spec.whatwg.org/#the-popover-attribute>.
enum class PopoverAttributeKeyword : uint8_t { Auto, EmptyString, Manual };
} // namespace
static const nsAttrValue::EnumTable kPopoverTable[] = {
{"auto", PopoverAttributeKeyword::Auto},
{"", PopoverAttributeKeyword::EmptyString},
{"manual", PopoverAttributeKeyword::Manual},
{"auto", PopoverState::Auto},
{"manual", PopoverState::Manual},
{nullptr, 0}};
// See <https://html.spec.whatwg.org/#the-popover-attribute>.
static const nsAttrValue::EnumTable* kPopoverTableInvalidValueDefault =
&kPopoverTable[2];
static const nsAttrValue::EnumTable* kPopoverTableDefault = &kPopoverTable[1];
void nsGenericHTMLElement::AddToNameTable(nsAtom* aName) {
MOZ_ASSERT(HasName(), "Node doesn't have name?");
@ -661,36 +653,22 @@ void nsGenericHTMLElement::BeforeSetAttr(int32_t aNamespaceID, nsAtom* aName,
aNotify);
}
namespace {
constexpr PopoverState ToPopoverState(
PopoverAttributeKeyword aPopoverAttributeKeyword) {
// See <https://html.spec.whatwg.org/#the-popover-attribute>.
switch (aPopoverAttributeKeyword) {
case PopoverAttributeKeyword::Auto:
return PopoverState::Auto;
case PopoverAttributeKeyword::EmptyString:
return PopoverState::Auto;
case PopoverAttributeKeyword::Manual:
return PopoverState::Manual;
}
}
} // namespace
void nsGenericHTMLElement::AfterSetPopoverAttr() {
const nsAttrValue* newValue = GetParsedAttr(nsGkAtoms::popover);
// https://html.spec.whatwg.org/multipage/popover.html#attr-popover
PopoverState newState;
if (newValue) {
MOZ_ASSERT(newValue->Type() == nsAttrValue::eEnum);
const PopoverAttributeKeyword popoverAttributeKeyword =
static_cast<PopoverAttributeKeyword>(newValue->GetEnumValue());
newState = ToPopoverState(popoverAttributeKeyword);
if (newValue->Type() == nsAttrValue::eEnum) {
newState = static_cast<dom::PopoverState>(newValue->GetEnumValue());
} else {
// The invalid value default is the manual state
newState = PopoverState::Manual;
}
} else {
// The missing value default is the no popover state, see
// <https://html.spec.whatwg.org/multipage/popover.html#attr-popover>.
// The missing value default is the no popover state.
newState = PopoverState::None;
}
PopoverState oldState = GetPopoverState();
if (newState != oldState) {
if (oldState != PopoverState::None) {
@ -979,7 +957,7 @@ bool nsGenericHTMLElement::ParseAttribute(int32_t aNamespaceID,
if (aAttribute == nsGkAtoms::popover &&
StaticPrefs::dom_element_popover_enabled()) {
return aResult.ParseEnumValue(aValue, kPopoverTable, false,
kPopoverTableInvalidValueDefault);
kPopoverTableDefault);
}
if (aAttribute == nsGkAtoms::tabindex) {

View File

@ -0,0 +1,7 @@
[popover-anchor-nesting.html]
expected:
if not debug and (os == "android"): [OK, ERROR]
if not debug and (os == "linux"): [OK, ERROR]
if not debug and (os == "mac"): [OK, ERROR]
[Nested popovers (inside anchor elements) do not affect light dismiss]
expected: FAIL

View File

@ -1,3 +0,0 @@
[popover-dialog-appearance.html]
# Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1831057
expected: TIMEOUT

View File

@ -1,3 +0,0 @@
[popover-dialog-crash.html]
# Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1831057
expected: TIMEOUT

View File

@ -1,6 +1,4 @@
[popover-light-dismiss.html]
# Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1821732
expected: ERROR
[Clicking outside a popover will dismiss the popover]
expected: FAIL

View File

@ -1,2 +1,6 @@
[popover-open-overflow-display.tentative.html]
max-asserts: 2
expected:
# bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1832251
if os == "win": FAIL
if os == "linux": [PASS, FAIL]
max-asserts: 3

View File

@ -1,7 +1,13 @@
[popover-shadow-dom.html]
[anchor references do not cross shadow boundaries]
expected: FAIL
[anchor references use the flat tree not the DOM tree]
expected: FAIL
[The popover stack is preserved across shadow-inclusive ancestors]
expected: FAIL
[Popover ancestor relationships are within a root, not within the document]
expected: FAIL

View File

@ -1,4 +1,10 @@
[popover-stacking.html]
[Direct DOM children]
expected: FAIL
[Grandchildren]
expected: FAIL
[popovertarget attribute relationship]
expected: FAIL
@ -16,3 +22,6 @@
[popovers should be closed by dialogs]
expected: FAIL
[dialogs should not be closed by popovers]
expected: FAIL