Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Unified Diff: Source/core/css/MediaQueryEvaluator.cpp

Issue 22258007: [CSSMQ] Use initial values as base for relative units. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/media/mq-relative-constraints-10-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « LayoutTests/fast/media/mq-relative-constraints-10-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698