Chromium Code Reviews| Index: Source/core/css/MediaQueryEvaluator.cpp |
| diff --git a/Source/core/css/MediaQueryEvaluator.cpp b/Source/core/css/MediaQueryEvaluator.cpp |
| index 900a6271c08e1f5992d9d651f9106da4b5b3b172..3b32f8efa808a494afc9b28525c240be522ac53b 100644 |
| --- a/Source/core/css/MediaQueryEvaluator.cpp |
| +++ b/Source/core/css/MediaQueryEvaluator.cpp |
| @@ -337,7 +337,7 @@ static bool gridMediaFeatureEval(CSSValue* value, RenderStyle*, Frame*, MediaFea |
| return false; |
| } |
| -static bool computeLength(CSSValue* value, bool strict, RenderStyle* style, RenderStyle* rootStyle, int& result) |
| +static bool computeLength(CSSValue* value, bool strict, RenderStyle* style, int& result) |
| { |
| if (!value->isPrimitiveValue()) |
| return false; |
| @@ -350,7 +350,7 @@ static bool computeLength(CSSValue* value, bool strict, RenderStyle* style, Rend |
| } |
| if (primitiveValue->isLength()) { |
| - result = primitiveValue->computeLength<int>(style, rootStyle, 1.0 /* multiplier */, true /* computingFontSize */); |
| + result = primitiveValue->computeLength<int>(style, style, 1.0 /* multiplier */, true /* computingFontSize */); |
|
kenneth.r.christiansen
2013/08/07 10:49:28
Could we add some /* */ to know what it means, esp
rune
2013/08/07 11:46:09
Done.
|
| return true; |
| } |
| @@ -361,11 +361,10 @@ static bool deviceHeightMediaFeatureEval(CSSValue* value, RenderStyle* style, Fr |
| { |
| if (value) { |
| FloatRect sg = screenRect(frame->page()->mainFrame()->view()); |
| - RenderStyle* rootStyle = frame->document()->documentElement()->renderStyle(); |
| int length; |
| long height = sg.height(); |
| InspectorInstrumentation::applyScreenHeightOverride(frame, &height); |
| - return computeLength(value, !frame->document()->inQuirksMode(), style, rootStyle, length) && compareValue(static_cast<int>(height), length, op); |
| + return computeLength(value, !frame->document()->inQuirksMode(), style, length) && compareValue(static_cast<int>(height), length, op); |
| } |
| // ({,min-,max-}device-height) |
| // assume if we have a device, assume non-zero |
| @@ -376,11 +375,10 @@ static bool deviceWidthMediaFeatureEval(CSSValue* value, RenderStyle* style, Fra |
| { |
| if (value) { |
| FloatRect sg = screenRect(frame->page()->mainFrame()->view()); |
| - RenderStyle* rootStyle = frame->document()->documentElement()->renderStyle(); |
| int length; |
| long width = sg.width(); |
| InspectorInstrumentation::applyScreenWidthOverride(frame, &width); |
| - return computeLength(value, !frame->document()->inQuirksMode(), style, rootStyle, length) && compareValue(static_cast<int>(width), length, op); |
| + return computeLength(value, !frame->document()->inQuirksMode(), style, length) && compareValue(static_cast<int>(width), length, op); |
| } |
| // ({,min-,max-}device-width) |
| // assume if we have a device, assume non-zero |
| @@ -395,9 +393,8 @@ static bool heightMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* f |
| if (value) { |
| if (RenderView* renderView = frame->document()->renderView()) |
| height = adjustForAbsoluteZoom(height, renderView); |
| - RenderStyle* rootStyle = frame->document()->documentElement()->renderStyle(); |
| int length; |
| - return computeLength(value, !frame->document()->inQuirksMode(), style, rootStyle, length) && compareValue(height, length, op); |
| + return computeLength(value, !frame->document()->inQuirksMode(), style, length) && compareValue(height, length, op); |
| } |
| return height; |
| @@ -411,9 +408,8 @@ static bool widthMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* fr |
| if (value) { |
| if (RenderView* renderView = frame->document()->renderView()) |
| width = adjustForAbsoluteZoom(width, renderView); |
| - RenderStyle* rootStyle = frame->document()->documentElement()->renderStyle(); |
| int length; |
| - return computeLength(value, !frame->document()->inQuirksMode(), style, rootStyle, length) && compareValue(width, length, op); |
| + return computeLength(value, !frame->document()->inQuirksMode(), style, length) && compareValue(width, length, op); |
| } |
| return width; |