Changeset 209842 in webkit


Ignore:
Timestamp:
Dec 14, 2016, 4:12:21 PM (8 years ago)
Author:
dino@apple.com
Message:

Update prefers-reduced-motion syntax
https://bugs.webkit.org/show_bug.cgi?id=165880
<rdar://problems/29671807>

Reviewed by Sam Weinig.

Source/WebCore:

After discussion in:
https://github.com/w3c/csswg-drafts/issues/442
... the syntax of prefers-reduced-motion was changed
to accept "reduce" or "no-preference".

Updated the tests in fast/media.

  • css/CSSValueKeywords.in: Add no-preference keyword.
  • css/MediaQueryEvaluator.cpp:

(WebCore::prefersReducedMotionEvaluate):

LayoutTests:

  • fast/media/mq-prefers-reduced-motion-forced-value.html:
  • fast/media/mq-prefers-reduced-motion.html:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r209841 r209842  
     12016-12-14  Dean Jackson  <dino@apple.com>
     2
     3        Update prefers-reduced-motion syntax
     4        https://bugs.webkit.org/show_bug.cgi?id=165880
     5        <rdar://problems/29671807>
     6
     7        Reviewed by Sam Weinig.
     8
     9        * fast/media/mq-prefers-reduced-motion-forced-value.html:
     10        * fast/media/mq-prefers-reduced-motion.html:
     11
    1122016-12-14  Sam Weinig  <sam@webkit.org>
    213
  • trunk/LayoutTests/fast/media/mq-prefers-reduced-motion-forced-value.html

    r208899 r209842  
    1919    if (!window.matchMedia("(prefers-reduced-motion)").matches)
    2020        document.getElementById("c").style.color = "green";
    21     if (window.matchMedia("(prefers-reduced-motion: default)").matches)
     21    if (window.matchMedia("(prefers-reduced-motion: no-preference)").matches)
    2222        document.getElementById("d").style.color = "green";
    2323}, false);
  • trunk/LayoutTests/fast/media/mq-prefers-reduced-motion.html

    r207173 r209842  
    1616}
    1717
    18 @media (prefers-reduced-motion: default) {
     18@media (prefers-reduced-motion: no-preference) {
    1919#d { color: green; }
    2020}
  • trunk/Source/WebCore/ChangeLog

    r209841 r209842  
     12016-12-14  Dean Jackson  <dino@apple.com>
     2
     3        Update prefers-reduced-motion syntax
     4        https://bugs.webkit.org/show_bug.cgi?id=165880
     5        <rdar://problems/29671807>
     6
     7        Reviewed by Sam Weinig.
     8
     9        After discussion in:
     10        https://github.com/w3c/csswg-drafts/issues/442
     11        ... the syntax of prefers-reduced-motion was changed
     12        to accept "reduce" or "no-preference".
     13
     14        Updated the tests in fast/media.
     15
     16        * css/CSSValueKeywords.in: Add no-preference keyword.
     17        * css/MediaQueryEvaluator.cpp:
     18        (WebCore::prefersReducedMotionEvaluate):
     19
    1202016-12-14  Sam Weinig  <sam@webkit.org>
    221
  • trunk/Source/WebCore/css/CSSValueKeywords.in

    r209302 r209842  
    13271327// prefers-reduced-motion
    13281328reduce
     1329no-preference
    13291330
    13301331#if defined(ENABLE_CSS_GRID_LAYOUT) && ENABLE_CSS_GRID_LAYOUT
  • trunk/Source/WebCore/css/MediaQueryEvaluator.cpp

    r209241 r209842  
    700700        return userPrefersReducedMotion;
    701701
    702     return downcast<CSSPrimitiveValue>(*value).valueID() == (userPrefersReducedMotion ? CSSValueReduce : CSSValueDefault);
     702    return downcast<CSSPrimitiveValue>(*value).valueID() == (userPrefersReducedMotion ? CSSValueReduce : CSSValueNoPreference);
    703703}
    704704
Note: See TracChangeset for help on using the changeset viewer.