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

Side by Side Diff: Source/core/css/MediaQueryEvaluator.cpp

Issue 242883002: Remove MediaValues' dependency on RenderStyle (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Modified minimal recalc tests to represent reduced recalc. Created 6 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * CSS Media Query Evaluator 2 * CSS Media Query Evaluator
3 * 3 *
4 * Copyright (C) 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>. 4 * Copyright (C) 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>.
5 * Copyright (C) 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2013 Intel Corporation. All rights reserved. 6 * Copyright (C) 2013 Intel Corporation. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 , m_expectedResult(mediaFeatureResult) 75 , m_expectedResult(mediaFeatureResult)
76 { 76 {
77 } 77 }
78 78
79 MediaQueryEvaluator::MediaQueryEvaluator(const char* acceptedMediaType, bool med iaFeatureResult) 79 MediaQueryEvaluator::MediaQueryEvaluator(const char* acceptedMediaType, bool med iaFeatureResult)
80 : m_mediaType(acceptedMediaType) 80 : m_mediaType(acceptedMediaType)
81 , m_expectedResult(mediaFeatureResult) 81 , m_expectedResult(mediaFeatureResult)
82 { 82 {
83 } 83 }
84 84
85 MediaQueryEvaluator::MediaQueryEvaluator(const String& acceptedMediaType, LocalF rame* frame, RenderStyle* style) 85 MediaQueryEvaluator::MediaQueryEvaluator(const String& acceptedMediaType, LocalF rame* frame)
86 : m_mediaType(acceptedMediaType) 86 : m_mediaType(acceptedMediaType)
87 , m_expectedResult(false) // Doesn't matter when we have m_frame and m_style . 87 , m_expectedResult(false) // Doesn't matter when we have m_frame and m_style .
88 , m_mediaValues(MediaValuesDynamic::create(frame, style)) 88 , m_mediaValues(MediaValues::createDynamicIfFrameExists(frame))
89 { 89 {
90 } 90 }
91 91
92 MediaQueryEvaluator::MediaQueryEvaluator(const String& acceptedMediaType, const MediaValues& mediaValues) 92 MediaQueryEvaluator::MediaQueryEvaluator(const String& acceptedMediaType, const MediaValues& mediaValues)
93 : m_mediaType(acceptedMediaType) 93 : m_mediaType(acceptedMediaType)
94 , m_expectedResult(false) // Doesn't matter when we have mediaValues. 94 , m_expectedResult(false) // Doesn't matter when we have mediaValues.
95 , m_mediaValues(mediaValues.copy()) 95 , m_mediaValues(mediaValues.copy())
96 { 96 {
97 } 97 }
98 98
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 // Call the media feature evaluation function. Assume no prefix and let 641 // Call the media feature evaluation function. Assume no prefix and let
642 // trampoline functions override the prefix if prefix is used. 642 // trampoline functions override the prefix if prefix is used.
643 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); 643 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl());
644 if (func) 644 if (func)
645 return func(expr->value(), NoPrefix, *m_mediaValues); 645 return func(expr->value(), NoPrefix, *m_mediaValues);
646 646
647 return false; 647 return false;
648 } 648 }
649 649
650 } // namespace 650 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698