[Webkit-unassigned] [Bug 127720] CSS 2.2: Support scientific notations for all numbers in CSS

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 28 03:03:47 PST 2014


https://bugs.webkit.org/show_bug.cgi?id=127720





--- Comment #2 from Dirk Schulze <krit at webkit.org>  2014-01-28 03:01:10 PST ---
(In reply to comment #0)
> CSS 2.2 will support scientific notations for all number values. We support scientific numbers for SVG in the CSSParser. We should do for all values now:
> 
> See line 11711 in CSSParser.cpp:
> 
> #if ENABLE(SVG)
>         // Use SVG parser for numbers on SVG presentation attributes.
>         if (m_context.mode == SVGAttributeMode) {
>             // We need to take care of units like 'em' or 'ex'.
>             SrcCharacterType* character = currentCharacter<SrcCharacterType>();
>             if (isASCIIAlphaCaselessEqual(*character, 'e')) {
>                 ASSERT(character - tokenStart<SrcCharacterType>() > 0);
>                 ++character;
>                 if (*character == '-' || *character == '+' || isASCIIDigit(*character)) {
>                     ++character;
>                     while (isASCIIDigit(*character))
>                         ++character;
>                     // Use FLOATTOKEN if the string contains exponents.
>                     dotSeen = true;
>                     currentCharacter<SrcCharacterType>() = character;
>                 }
>             }
>             if (!parseSVGNumber(tokenStart<SrcCharacterType>(), character - tokenStart<SrcCharacterType>(), yylval->number))
>                 break;
>         } else
> #endif
>             yylval->number = charactersToDouble(tokenStart<SrcCharacterType>(), currentCharacter<SrcCharacterType>() - tokenStart<SrcCharacterType>());

It is of course easy to remove the if (m_context.mode == SVGAttributeMode) check, but I don't know how it impacts performance. This might need to be checked. In SVG (where we use this code all of the time) the code never stood out on performance measurements though.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list