Bug 1963845 - Use Span for EnumTable. r=emilio,smaug
This patch makes the usage of `EnumTable`s safer by using `Span`s instead of relying on an empty element at the end. Also the name has been changed from `EnumTable` to `EnumTableEntry` to be more precise. Differential Revision: https://phabricator.services.mozilla.com/D247453
This commit is contained in:
committed by
jjaschke@mozilla.com
parent
6db653dc92
commit
b3debf824d
@@ -4947,12 +4947,12 @@ bool HTMLMediaElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
|
||||
nsIPrincipal* aMaybeScriptedPrincipal,
|
||||
nsAttrValue& aResult) {
|
||||
// Mappings from 'preload' attribute strings to an enumeration.
|
||||
static const nsAttrValue::EnumTable kPreloadTable[] = {
|
||||
static const nsAttrValue::EnumTableEntry kPreloadTable[] = {
|
||||
{"", HTMLMediaElement::PRELOAD_ATTR_EMPTY},
|
||||
{"none", HTMLMediaElement::PRELOAD_ATTR_NONE},
|
||||
{"metadata", HTMLMediaElement::PRELOAD_ATTR_METADATA},
|
||||
{"auto", HTMLMediaElement::PRELOAD_ATTR_AUTO},
|
||||
{nullptr, 0}};
|
||||
};
|
||||
|
||||
if (aNamespaceID == kNameSpaceID_None) {
|
||||
if (aAttribute == nsGkAtoms::crossorigin) {
|
||||
|
||||
Reference in New Issue
Block a user