Changeset 39663 in webkit


Ignore:
Timestamp:
Jan 6, 2009 2:19:41 PM (15 years ago)
Author:
dino@apple.com
Message:

2009-01-06 Dean Jackson <dino@apple.com>

Reviewed by Dave Hyatt.

Extend Media Queries to cover transitions,
animations, transform-2d and transform-3d
http://webkit.org/specs/MediaQueriesExtensions.html
Note that the implementation uses -webkit- prefixes
even though the spec doesn't have them.
https://bugs.webkit.org/show_bug.cgi?id=22494

Tests: fast/media/mq-animation.html

fast/media/mq-transform-01.html
fast/media/mq-transform-02.html
fast/media/mq-transform-03.html
fast/media/mq-transform-04.html
fast/media/mq-transition.html

  • css/MediaFeatureNames.h:
  • css/MediaQueryEvaluator.cpp: (WebCore::animationMediaFeatureEval): (WebCore::transitionMediaFeatureEval): (WebCore::transform_2dMediaFeatureEval): (WebCore::transform_3dMediaFeatureEval):
Location:
trunk
Files:
12 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r39662 r39663  
     12009-01-06  Dean Jackson  <dino@apple.com>
     2
     3        Reviewed by Dave Hyatt.
     4
     5        Tests for Media Query extensions covering transitions,
     6        animations, transform-2d and transform-3d
     7        http://webkit.org/specs/MediaQueriesExtensions.html
     8        https://bugs.webkit.org/show_bug.cgi?id=22494
     9
     10        * fast/media/mq-animation.html: Added.
     11        * fast/media/mq-transform-01.html: Added.
     12        * fast/media/mq-transform-02.html: Added.
     13        * fast/media/mq-transform-03.html: Added.
     14        * fast/media/mq-transform-04.html: Added.
     15        * fast/media/mq-transition.html: Added.
     16        * platform/mac/fast/media/mq-animation-expected.txt: Added.
     17        * platform/mac/fast/media/mq-transform-01-expected.txt: Added.
     18        * platform/mac/fast/media/mq-transform-02-expected.txt: Added.
     19        * platform/mac/fast/media/mq-transform-03-expected.txt: Added.
     20        * platform/mac/fast/media/mq-transform-04-expected.txt: Added.
     21        * platform/mac/fast/media/mq-transition-expected.txt: Added.
     22
    1232009-01-06  Justin Garcia  <justin.garcia@apple.com>
    224
  • trunk/WebCore/ChangeLog

    r39661 r39663  
     12009-01-06  Dean Jackson  <dino@apple.com>
     2
     3        Reviewed by Dave Hyatt.
     4
     5        Extend Media Queries to cover transitions,
     6        animations, transform-2d and transform-3d
     7        http://webkit.org/specs/MediaQueriesExtensions.html
     8        Note that the implementation uses -webkit- prefixes
     9        even though the spec doesn't have them.
     10        https://bugs.webkit.org/show_bug.cgi?id=22494
     11
     12        Tests: fast/media/mq-animation.html
     13               fast/media/mq-transform-01.html
     14               fast/media/mq-transform-02.html
     15               fast/media/mq-transform-03.html
     16               fast/media/mq-transform-04.html
     17               fast/media/mq-transition.html
     18
     19        * css/MediaFeatureNames.h:
     20        * css/MediaQueryEvaluator.cpp:
     21        (WebCore::animationMediaFeatureEval):
     22        (WebCore::transitionMediaFeatureEval):
     23        (WebCore::transform_2dMediaFeatureEval):
     24        (WebCore::transform_3dMediaFeatureEval):
     25
    1262009-01-06  Eric Seidel  <eric@webkit.org>
    227
  • trunk/WebCore/css/MediaFeatureNames.h

    r29663 r39663  
    5454    macro(min_monochrome, "min-monochrome") \
    5555    macro(min_width, "min-width") \
     56    macro(transform_2d, "-webkit-transform-2d") \
     57    macro(transform_3d, "-webkit-transform-3d") \
     58    macro(transition, "-webkit-transition") \
     59    macro(animation, "-webkit-animation") \
    5660// end of macro
    5761
  • trunk/WebCore/css/MediaQueryEvaluator.cpp

    r39601 r39663  
    389389}
    390390
     391static bool animationMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame,  MediaFeaturePrefix op)
     392{
     393    if (value) {
     394        float number;
     395        return numberValue(value, number) && compareValue(1, static_cast<int>(number), op);
     396    }
     397    return true;
     398}
     399
     400static bool transitionMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame,  MediaFeaturePrefix op)
     401{
     402    if (value) {
     403        float number;
     404        return numberValue(value, number) && compareValue(1, static_cast<int>(number), op);
     405    }
     406    return true;
     407}
     408
     409static bool transform_2dMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame,  MediaFeaturePrefix op)
     410{
     411    if (value) {
     412        float number;
     413        return numberValue(value, number) && compareValue(1, static_cast<int>(number), op);
     414    }
     415    return true;
     416}
     417
     418static bool transform_3dMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame,  MediaFeaturePrefix op)
     419{
     420    if (value) {
     421        float number;
     422        return numberValue(value, number) && compareValue(0, static_cast<int>(number), op);
     423    }
     424    return false;
     425}
     426
    391427static void createFunctionMap()
    392428{
Note: See TracChangeset for help on using the changeset viewer.