Bug 964529: Support scientific (exponential) notation for CSS <number> values, including percentages and dimensions (but not <integer> values). r=SimonSapin

Resolved for <number> on 2012-08-15:
http://lists.w3.org/Archives/Public/www-style/2012Aug/0900.html

Resolved for percentages and dimensions in CSS teleconference 2013-04-17:
http://lists.w3.org/Archives/Public/www-style/2013Apr/0428.html
This commit is contained in:
L. David Baron 2014-01-31 12:27:59 -08:00
parent 4f9115d4b7
commit 78d68d5ddd
2 changed files with 10 additions and 6 deletions

View File

@ -881,7 +881,7 @@ nsCSSScanner::ScanNumber(nsCSSToken& aToken)
}
bool gotE = false;
if (IsSVGMode() && (c == 'e' || c == 'E')) {
if (c == 'e' || c == 'E') {
int32_t expSignChar = Peek(1);
int32_t nextChar = Peek(2);
if (IsDigit(expSignChar) ||

View File

@ -2855,8 +2855,8 @@ var gCSSProperties = {
domProp: "opacity",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "1", "17", "397.376" ],
other_values: [ "0", "0.4", "0.0000", "-3" ],
initial_values: [ "1", "17", "397.376", "3e1", "3e+1", "3e0", "3e+0", "3e-0" ],
other_values: [ "0", "0.4", "0.0000", "-3", "3e-1" ],
invalid_values: [ "0px", "1px" ]
},
"-moz-orient": {
@ -2875,7 +2875,7 @@ var gCSSProperties = {
// XXX requires display:block
initial_values: [ "2" ],
other_values: [ "1", "7" ],
invalid_values: [ "0", "-1", "0px", "3px" ]
invalid_values: [ "0", "-1", "0px", "3px", "3e1" ]
},
"outline": {
domProp: "outline",
@ -3347,7 +3347,7 @@ var gCSSProperties = {
// XXX requires display:block
initial_values: [ "2" ],
other_values: [ "1", "7" ],
invalid_values: [ "0", "-1", "0px", "3px" ]
invalid_values: [ "0", "-1", "0px", "3px", "3e1" ]
},
"width": {
domProp: "width",
@ -3358,6 +3358,10 @@ var gCSSProperties = {
initial_values: [ " auto" ],
/* XXX these have prerequisites */
other_values: [ "15px", "3em", "15%", "-moz-max-content", "-moz-min-content", "-moz-fit-content", "-moz-available",
"3e1px", "3e+1px", "3e0px", "3e+0px", "3e-0px", "3e-1px",
"3.2e1px", "3.2e+1px", "3.2e0px", "3.2e+0px", "3.2e-0px", "3.2e-1px",
"3e1%", "3e+1%", "3e0%", "3e+0%", "3e-0%", "3e-1%",
"3.2e1%", "3.2e+1%", "3.2e0%", "3.2e+0%", "3.2e-0%", "3.2e-1%",
/* valid -moz-calc() values */
"-moz-calc(-2px)",
"-moz-calc(2px)",
@ -3492,7 +3496,7 @@ var gCSSProperties = {
/* XXX requires position */
initial_values: [ "auto" ],
other_values: [ "0", "3", "-7000", "12000" ],
invalid_values: [ "3.0", "17.5" ]
invalid_values: [ "3.0", "17.5", "3e1" ]
}
,
"clip-path": {