Changeset 148431 in webkit


Ignore:
Timestamp:
Apr 15, 2013 5:02:19 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

color-index media feature not supported
https://bugs.webkit.org/show_bug.cgi?id=114468

Patch by Rune Lillesveen <rune@opera.com> on 2013-04-15
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Support the color-index media feature. Currently assumes that no WebKit
browser will have an output device that uses a color lookup table.

Tests: fast/media/mq-color-index-01.html

fast/media/mq-color-index-02.html

  • css/MediaFeatureNames.h:

(MediaFeatureNames):

  • css/MediaQueryEvaluator.cpp:

(WebCore::color_indexMediaFeatureEval):
(WebCore):
(WebCore::min_color_indexMediaFeatureEval):
(WebCore::max_color_indexMediaFeatureEval):

  • css/MediaQueryExp.cpp:

(WebCore::featureWithPositiveInteger):
(WebCore::featureWithoutValue):

LayoutTests:

Added testcases for checking support and handling invalid values for
the color-index media feature.

  • fast/media/mq-color-index-01-expected.html: Added.
  • fast/media/mq-color-index-01.html: Added.
  • fast/media/mq-color-index-02-expected.txt: Added.
  • fast/media/mq-color-index-02.html: Added.
Location:
trunk
Files:
4 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r148426 r148431  
     12013-04-15  Rune Lillesveen  <rune@opera.com>
     2
     3        color-index media feature not supported
     4        https://bugs.webkit.org/show_bug.cgi?id=114468
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Added testcases for checking support and handling invalid values for
     9        the color-index media feature.
     10
     11        * fast/media/mq-color-index-01-expected.html: Added.
     12        * fast/media/mq-color-index-01.html: Added.
     13        * fast/media/mq-color-index-02-expected.txt: Added.
     14        * fast/media/mq-color-index-02.html: Added.
     15
    1162013-04-15  Seokju Kwon  <seokju.kwon@gmail.com>
    217
  • trunk/Source/WebCore/ChangeLog

    r148430 r148431  
     12013-04-15  Rune Lillesveen  <rune@opera.com>
     2
     3        color-index media feature not supported
     4        https://bugs.webkit.org/show_bug.cgi?id=114468
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Support the color-index media feature. Currently assumes that no WebKit
     9        browser will have an output device that uses a color lookup table.
     10
     11        Tests: fast/media/mq-color-index-01.html
     12               fast/media/mq-color-index-02.html
     13
     14        * css/MediaFeatureNames.h:
     15        (MediaFeatureNames):
     16        * css/MediaQueryEvaluator.cpp:
     17        (WebCore::color_indexMediaFeatureEval):
     18        (WebCore):
     19        (WebCore::min_color_indexMediaFeatureEval):
     20        (WebCore::max_color_indexMediaFeatureEval):
     21        * css/MediaQueryExp.cpp:
     22        (WebCore::featureWithPositiveInteger):
     23        (WebCore::featureWithoutValue):
     24
    1252013-04-15  Balazs Kelemen  <kbalazs@webkit.org>
    226
  • trunk/Source/WebCore/css/MediaFeatureNames.h

    r145255 r148431  
    3434#define CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(macro) \
    3535    macro(color, "color") \
     36    macro(color_index, "color-index") \
    3637    macro(grid, "grid") \
    3738    macro(monochrome, "monochrome") \
     
    4647    macro(device_width, "device-width") \
    4748    macro(max_color, "max-color") \
     49    macro(max_color_index, "max-color-index") \
    4850    macro(max_aspect_ratio, "max-aspect-ratio") \
    4951    macro(max_device_aspect_ratio, "max-device-aspect-ratio") \
     
    5658    macro(max_resolution, "max-resolution") \
    5759    macro(min_color, "min-color") \
     60    macro(min_color_index, "min-color-index") \
    5861    macro(min_aspect_ratio, "min-aspect-ratio") \
    5962    macro(min_device_aspect_ratio, "min-device-aspect-ratio") \
  • trunk/Source/WebCore/css/MediaQueryEvaluator.cpp

    r148186 r148431  
    7070
    7171/*
    72  * FIXME: following media features are not implemented: color_index, scan
     72 * FIXME: following media features are not implemented: scan
    7373 *
    74  * color_index, min-color-index, max_color_index: It's unknown how to retrieve
    75  * the information if the display mode is indexed
    7674 * scan: The "scan" media feature describes the scanning process of
    7775 * tv output devices. It's unknown how to retrieve this information from
     
    219217}
    220218
     219static bool color_indexMediaFeatureEval(CSSValue* value, RenderStyle*, Frame*, MediaFeaturePrefix op)
     220{
     221    // FIXME: It's unknown how to retrieve the information if the display mode is indexed
     222    // Assume we don't support indexed display.
     223    if (!value)
     224        return false;
     225
     226    float number;
     227    return numberValue(value, number) && compareValue(0, static_cast<int>(number), op);
     228}
     229
    221230static bool monochromeMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix op)
    222231{
     
    420429{
    421430    return colorMediaFeatureEval(value, style, frame, MaxPrefix);
     431}
     432
     433static bool min_color_indexMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
     434{
     435    return color_indexMediaFeatureEval(value, style, frame, MinPrefix);
     436}
     437
     438static bool max_color_indexMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
     439{
     440    return color_indexMediaFeatureEval(value, style, frame, MaxPrefix);
    422441}
    423442
  • trunk/Source/WebCore/css/MediaQueryExp.cpp

    r145255 r148431  
    8989        || mediaFeature == MediaFeatureNames::max_colorMediaFeature
    9090        || mediaFeature == MediaFeatureNames::min_colorMediaFeature
     91        || mediaFeature == MediaFeatureNames::color_indexMediaFeature
     92        || mediaFeature == MediaFeatureNames::max_color_indexMediaFeature
     93        || mediaFeature == MediaFeatureNames::min_color_indexMediaFeature
    9194        || mediaFeature == MediaFeatureNames::min_monochromeMediaFeature
    9295        || mediaFeature == MediaFeatureNames::max_monochromeMediaFeature;
     
    131134    return mediaFeature == MediaFeatureNames::monochromeMediaFeature
    132135        || mediaFeature == MediaFeatureNames::colorMediaFeature
     136        || mediaFeature == MediaFeatureNames::color_indexMediaFeature
    133137        || mediaFeature == MediaFeatureNames::gridMediaFeature
    134138        || mediaFeature == MediaFeatureNames::heightMediaFeature
Note: See TracChangeset for help on using the changeset viewer.