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

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

Issue 2329463004: ABANDONED CL: Changes needed to make things compile after running rewrite_to_chrome_style tool. (Closed)
Patch Set: More fixes - things build fine at this point. Created 3 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 776 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 return false; 787 return false;
788 } 788 }
789 789
790 // This is for some compilers that do not understand that it can't be reached. 790 // This is for some compilers that do not understand that it can't be reached.
791 NOTREACHED(); 791 NOTREACHED();
792 return false; 792 return false;
793 } 793 }
794 794
795 void MediaQueryEvaluator::init() { 795 void MediaQueryEvaluator::init() {
796 // Create the table. 796 // Create the table.
797 gFunctionMap = new FunctionMap; 797 g_function_map = new FunctionMap;
798 #define ADD_TO_FUNCTIONMAP(name) \ 798 #define ADD_TO_FUNCTIONMAP(constantPrefix, methodPrefix) \
799 gFunctionMap->set(name##MediaFeature.impl(), name##MediaFeatureEval); 799 g_function_map->Set(constantPrefix##MediaFeature.Impl(), \
800 methodPrefix##MediaFeatureEval);
800 CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(ADD_TO_FUNCTIONMAP); 801 CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(ADD_TO_FUNCTIONMAP);
801 #undef ADD_TO_FUNCTIONMAP 802 #undef ADD_TO_FUNCTIONMAP
802 } 803 }
803 804
804 bool MediaQueryEvaluator::eval(const MediaQueryExp* expr) const { 805 bool MediaQueryEvaluator::eval(const MediaQueryExp* expr) const {
805 if (!m_mediaValues || !m_mediaValues->hasValues()) 806 if (!m_mediaValues || !m_mediaValues->hasValues())
806 return true; 807 return true;
807 808
808 DCHECK(gFunctionMap); 809 DCHECK(gFunctionMap);
809 810
810 // Call the media feature evaluation function. Assume no prefix and let 811 // Call the media feature evaluation function. Assume no prefix and let
811 // trampoline functions override the prefix if prefix is used. 812 // trampoline functions override the prefix if prefix is used.
812 EvalFunc func = gFunctionMap->at(expr->mediaFeature().impl()); 813 EvalFunc func = gFunctionMap->at(expr->mediaFeature().impl());
813 if (func) 814 if (func)
814 return func(expr->expValue(), NoPrefix, *m_mediaValues); 815 return func(expr->expValue(), NoPrefix, *m_mediaValues);
815 816
816 return false; 817 return false;
817 } 818 }
818 819
819 } // namespace blink 820 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/ElementRuleCollector.cpp ('k') | third_party/WebKit/Source/core/css/StylePropertySet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698