зеркало из https://github.com/mozilla/gecko-dev.git
Bug 679689. Allow empty string values to be associtated to enumerated attributes. r=sicking
This commit is contained in:
Родитель
132e794bdd
Коммит
f2fdc3b216
|
@ -0,0 +1,2 @@
|
|||
<!DOCTYPE html>
|
||||
<img crossorigin>
|
|
@ -93,3 +93,4 @@ load 642022-1.html
|
|||
load 646184.html
|
||||
load 658845-1.svg
|
||||
load 667336-1.html
|
||||
load 679689-1.html
|
||||
|
|
|
@ -1250,10 +1250,14 @@ nsAttrValue::SetMiscAtomOrString(const nsAString* aValue)
|
|||
"Trying to re-set atom or string!");
|
||||
if (aValue) {
|
||||
PRUint32 len = aValue->Length();
|
||||
// We're allowing eCSSStyleRule attributes to store empty strings as it
|
||||
// can be beneficial to store an empty style attribute as a parsed rule.
|
||||
// * We're allowing eCSSStyleRule attributes to store empty strings as it
|
||||
// can be beneficial to store an empty style attribute as a parsed rule.
|
||||
// * We're allowing enumerated values because sometimes the empty
|
||||
// string corresponds to a particular enumerated value, especially
|
||||
// for enumerated values that are not limited enumerated.
|
||||
// Add other types as needed.
|
||||
NS_ASSERTION(len || Type() == eCSSStyleRule, "Empty string?");
|
||||
NS_ASSERTION(len || Type() == eCSSStyleRule || Type() == eEnum,
|
||||
"Empty string?");
|
||||
MiscContainer* cont = GetMiscContainer();
|
||||
if (len <= NS_ATTRVALUE_MAX_STRINGLENGTH_ATOM) {
|
||||
nsIAtom* atom = NS_NewAtom(*aValue);
|
||||
|
|
Загрузка…
Ссылка в новой задаче