Bug 1297306 - part5:create enum constructors for EnumTable. r=baku
Enable nsAttrValue::EnumTable to be initialized with enum. So, we could get rid
of the castings in EnumTable. Fix EnumTable initialization comment.
For those untyped enumerations, declare them with uint8_t, as to other typed
enumerations with type size larger than int16_t, force casting to int16_t.
Use {nullptr,0} instead of {0} to represent the last entry.
MozReview-Commit-ID: 7Dma3Apkmxj
This commit is contained in:
@@ -178,7 +178,7 @@ static const nsAttrValue::EnumTable kInputTypeTable[] = {
|
||||
{ "time", NS_FORM_INPUT_TIME },
|
||||
{ "url", NS_FORM_INPUT_URL },
|
||||
{ "week", NS_FORM_INPUT_WEEK },
|
||||
{ 0 }
|
||||
{ nullptr, 0 }
|
||||
};
|
||||
|
||||
// Default type is 'text'.
|
||||
@@ -200,7 +200,7 @@ static const nsAttrValue::EnumTable kInputInputmodeTable[] = {
|
||||
{ "lowercase", NS_INPUT_INPUTMODE_LOWERCASE },
|
||||
{ "titlecase", NS_INPUT_INPUTMODE_TITLECASE },
|
||||
{ "autocapitalized", NS_INPUT_INPUTMODE_AUTOCAPITALIZED },
|
||||
{ 0 }
|
||||
{ nullptr, 0 }
|
||||
};
|
||||
|
||||
// Default inputmode value is "auto".
|
||||
|
||||
Reference in New Issue
Block a user