mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 06:45:42 +00:00
Bug 679689. Allow empty string values to be associtated to enumerated attributes. r=sicking
This commit is contained in:
parent
67f63c4d47
commit
bf3b0da94a
2
content/base/crashtests/679689-1.html
Normal file
2
content/base/crashtests/679689-1.html
Normal file
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user