Ignore:
Timestamp:
Dec 3, 2008, 12:46:49 PM (16 years ago)
Author:
[email protected]
Message:

2008-12-03 Dean Jackson <[email protected]>

Reviewed by Dan Bernstein.

JavaScriptCore:

Helper functions for turn -> degrees.
https://bugs.webkit.org/show_bug.cgi?id=22497

  • wtf/MathExtras.h: (turn2deg): (deg2turn):

WebCore:

Implement CSS 3 <angle> turn unit and support it
in rotations.
https://bugs.webkit.org/show_bug.cgi?id=22497

  • css/CSSGrammar.y:
  • css/CSSParser.cpp: (WebCore::CSSParser::validUnit): (WebCore::unitFromString): (WebCore::CSSParser::lex):
  • css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::cssText): (WebCore::CSSPrimitiveValue::parserValue):
  • css/CSSPrimitiveValue.h: (WebCore::CSSPrimitiveValue::):
  • css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::createTransformOperations):
  • css/tokenizer.flex:

LayoutTests:

Tests for CSS 3 <angle> turn unit
https://bugs.webkit.org/show_bug.cgi?id=22497

  • transforms/2d/transform-2d-expected.txt:
  • transforms/2d/transform-2d.html:
  • transforms/transform-value-types-expected.txt:
  • transforms/transform-value-types.html:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/MathExtras.h

    r38699 r38959  
    198198inline double deg2grad(double d) { return d * 400.0 / 360.0; }
    199199inline double grad2deg(double g) { return g * 360.0 / 400.0; }
     200inline double turn2deg(double t) { return t * 360.0; }
     201inline double deg2turn(double d) { return d / 360.0; }
    200202inline double rad2grad(double r) { return r * 200.0 / piDouble; }
    201203inline double grad2rad(double g) { return g * piDouble / 200.0; }
     
    205207inline float deg2grad(float d) { return d * 400.0f / 360.0f; }
    206208inline float grad2deg(float g) { return g * 360.0f / 400.0f; }
     209inline float turn2deg(float t) { return t * 360.0f; }
     210inline float deg2turn(float d) { return d / 360.0f; }
    207211inline float rad2grad(float r) { return r * 200.0f / piFloat; }
    208212inline float grad2rad(float g) { return g * piFloat / 200.0f; }
Note: See TracChangeset for help on using the changeset viewer.