Add color-gamut media query support
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Apr 2016 22:10:50 +0000 (22:10 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Apr 2016 22:10:50 +0000 (22:10 +0000)
commit26edf351b4b453bfff841d5fc15159ea6422629f
tree5e2690de52542ca381cf1fe249f3a361b97bb428
parentfc0019b8d467eb693a58b67a404309f5cf921238
Add color-gamut media query support
https://bugs.webkit.org/show_bug.cgi?id=155994
<rdar://problem/23282326>

Reviewed by Darin Adler.

Source/WebCore:

Add the new CSS media query: color-gamut
https://drafts.csswg.org/mediaqueries-4/#color-gamut

This ultimately calls into screenSupportsExtendedColor,
which has only been implemented on iOS at the moment.
All displays will match the "srgb" keyword, but only
iOS devices with an extended color screen will
match against "p3" (e.g. the iPad Pro 9.7").
Nothing will match against "rec2020".

Test: fast/media/mq-color-gamut.html

* css/CSSValueKeywords.in: Add "p3" and "rec2020".
* css/MediaFeatureNames.h: Add "color-gamut"
* css/MediaQueryEvaluator.cpp:
(WebCore::color_gamutMediaFeatureEval): Call
screenSupportsExtendedColor to see if we're srgb or p3.
* css/MediaQueryExp.cpp:
(WebCore::featureWithCSSValueID):
* platform/efl/PlatformScreenEfl.cpp: Add empty implementation.
(WebCore::screenSupportsExtendedColor):
* platform/gtk/PlatformScreenGtk.cpp: Ditto.
(WebCore::screenSupportsExtendedColor):
* platform/win/PlatformScreenWin.cpp: Ditto.
(WebCore::screenSupportsExtendedColor):

LayoutTests:

New test for color-gamut.

* fast/media/mq-color-gamut-expected.html: Added.
* fast/media/mq-color-gamut.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199024 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/media/mq-color-gamut-expected.html [new file with mode: 0644]
LayoutTests/fast/media/mq-color-gamut.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/css/MediaFeatureNames.h
Source/WebCore/css/MediaQueryEvaluator.cpp
Source/WebCore/css/MediaQueryExp.cpp
Source/WebCore/platform/efl/PlatformScreenEfl.cpp
Source/WebCore/platform/gtk/PlatformScreenGtk.cpp
Source/WebCore/platform/win/PlatformScreenWin.cpp