Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit b04b803

Browse files
Update prefers-reduced-motion syntax
https://bugs.webkit.org/show_bug.cgi?id=165880 Reviewed by Sam Weinig. Source/WebCore: After discussion in: w3c/csswg-drafts#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: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@209842 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 37dd666 commit b04b803

File tree

6 files changed

+34
-3
lines changed

6 files changed

+34
-3
lines changed

LayoutTests/ChangeLog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2016-12-14 Dean Jackson
2+
3+
Update prefers-reduced-motion syntax
4+
https://bugs.webkit.org/show_bug.cgi?id=165880
5+
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+
112
2016-12-14 Sam Weinig
213

314
REGRESSION (204679): Google notifications never load (expecting DOMStringList rather than JS array for Location.ancestorOrigins)

LayoutTests/fast/media/mq-prefers-reduced-motion-forced-value.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
window.internals.settings.forcedPrefersReducedMotionAccessibilityValue = "off";
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);
2424
script>

LayoutTests/fast/media/mq-prefers-reduced-motion.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#b { color: green; }
1616
}
1717

18-
@media (prefers-reduced-motion: default) {
18+
@media (prefers-reduced-motion: no-preference) {
1919
#d { color: green; }
2020
}
2121
style>

Source/WebCore/ChangeLog

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
2016-12-14 Dean Jackson
2+
3+
Update prefers-reduced-motion syntax
4+
https://bugs.webkit.org/show_bug.cgi?id=165880
5+
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+
120
2016-12-14 Sam Weinig
221

322
REGRESSION (204679): Google notifications never load (expecting DOMStringList rather than JS array for Location.ancestorOrigins)

Source/WebCore/css/CSSValueKeywords.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,6 +1326,7 @@ display-p3
13261326

13271327
// prefers-reduced-motion
13281328
reduce
1329+
no-preference
13291330

13301331
#if defined(ENABLE_CSS_GRID_LAYOUT) && ENABLE_CSS_GRID_LAYOUT
13311332
// auto-repeat

Source/WebCore/css/MediaQueryEvaluator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ static bool prefersReducedMotionEvaluate(CSSValue* value, const CSSToLengthConve
699699
if (!value)
700700
return userPrefersReducedMotion;
701701

702-
return downcast(*value).valueID() == (userPrefersReducedMotion ? CSSValueReduce : CSSValueDefault);
702+
return downcast(*value).valueID() == (userPrefersReducedMotion ? CSSValueReduce : CSSValueNoPreference);
703703
}
704704

705705
// Use this function instead of calling add directly to avoid inlining.

0 commit comments

Comments
 (0)