Changeset 145233 in webkit


Ignore:
Timestamp:
Mar 8, 2013 9:19:58 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

@media queries do not take zooming into account
https://bugs.webkit.org/show_bug.cgi?id=53186

Patch by John Mellor <johnme@chromium.org> on 2013-03-08
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Fixes @media width and height to take into account full page zoom, by
adding code to MediaQueryEvaluator's width/heightMediaFeatureEval,
corresponding to the existing code in Element::clientWidth which makes
document.documentElement.clientWidth take into account page zoom.

Test: fast/media/mq-width-pagezoom.html

  • css/MediaQueryEvaluator.cpp:

(WebCore::heightMediaFeatureEval):
(WebCore::widthMediaFeatureEval):

LayoutTests:

  • fast/media/mq-width-pagezoom-expected.html: Added.
  • fast/media/mq-width-pagezoom.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r145231 r145233  
     12013-03-08  John Mellor  <johnme@chromium.org>
     2
     3        @media queries do not take zooming into account
     4        https://bugs.webkit.org/show_bug.cgi?id=53186
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        * fast/media/mq-width-pagezoom-expected.html: Added.
     9        * fast/media/mq-width-pagezoom.html: Added.
     10
    1112013-03-08  Chris Fleizach  <cfleizach@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r145232 r145233  
     12013-03-08  John Mellor  <johnme@chromium.org>
     2
     3        @media queries do not take zooming into account
     4        https://bugs.webkit.org/show_bug.cgi?id=53186
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Fixes @media width and height to take into account full page zoom, by
     9        adding code to MediaQueryEvaluator's width/heightMediaFeatureEval,
     10        corresponding to the existing code in Element::clientWidth which makes
     11        document.documentElement.clientWidth take into account page zoom.
     12
     13        Test: fast/media/mq-width-pagezoom.html
     14
     15        * css/MediaQueryEvaluator.cpp:
     16        (WebCore::heightMediaFeatureEval):
     17        (WebCore::widthMediaFeatureEval):
     18
    1192013-03-08  Carlos Garcia Campos  <cgarcia@igalia.com>
    220
  • trunk/Source/WebCore/css/MediaQueryEvaluator.cpp

    r132633 r145233  
    479479
    480480    if (value) {
     481        int height = view->layoutHeight();
     482        if (RenderView* renderView = frame->document()->renderView())
     483            height = adjustForAbsoluteZoom(height, renderView);
    481484        RenderStyle* rootStyle = frame->document()->documentElement()->renderStyle();
    482485        int length;
    483         return computeLength(value, !frame->document()->inQuirksMode(), style, rootStyle, length) && compareValue(view->layoutHeight(), length, op);
     486        return computeLength(value, !frame->document()->inQuirksMode(), style, rootStyle, length) && compareValue(height, length, op);
    484487    }
    485488
     
    492495
    493496    if (value) {
     497        int width = view->layoutWidth();
     498        if (RenderView* renderView = frame->document()->renderView())
     499            width = adjustForAbsoluteZoom(width, renderView);
    494500        RenderStyle* rootStyle = frame->document()->documentElement()->renderStyle();
    495501        int length;
    496         return computeLength(value, !frame->document()->inQuirksMode(), style, rootStyle, length) && compareValue(view->layoutWidth(), length, op);
     502        return computeLength(value, !frame->document()->inQuirksMode(), style, rootStyle, length) && compareValue(width, length, op);
    497503    }
    498504
Note: See TracChangeset for help on using the changeset viewer.