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

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

Issue 989173003: Fix template angle bracket syntax in css (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « Source/core/css/MediaQueryEvaluator.h ('k') | Source/core/css/MediaQueryList.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 // Assume true if we are at the end of the list, otherwise assume false. 137 // Assume true if we are at the end of the list, otherwise assume false.
138 return applyRestrictor(query->restrictor(), expressions.size() == i); 138 return applyRestrictor(query->restrictor(), expressions.size() == i);
139 } 139 }
140 140
141 bool MediaQueryEvaluator::eval(const MediaQuerySet* querySet, MediaQueryResultLi st* viewportDependentMediaQueryResults) const 141 bool MediaQueryEvaluator::eval(const MediaQuerySet* querySet, MediaQueryResultLi st* viewportDependentMediaQueryResults) const
142 { 142 {
143 if (!querySet) 143 if (!querySet)
144 return true; 144 return true;
145 145
146 const WillBeHeapVector<OwnPtrWillBeMember<MediaQuery> >& queries = querySet- >queryVector(); 146 const WillBeHeapVector<OwnPtrWillBeMember<MediaQuery>>& queries = querySet-> queryVector();
147 if (!queries.size()) 147 if (!queries.size())
148 return true; // Empty query list evaluates to true. 148 return true; // Empty query list evaluates to true.
149 149
150 // Iterate over queries, stop if any of them eval to true (OR semantics). 150 // Iterate over queries, stop if any of them eval to true (OR semantics).
151 bool result = false; 151 bool result = false;
152 for (size_t i = 0; i < queries.size() && !result; ++i) 152 for (size_t i = 0; i < queries.size() && !result; ++i)
153 result = eval(queries[i].get(), viewportDependentMediaQueryResults); 153 result = eval(queries[i].get(), viewportDependentMediaQueryResults);
154 154
155 return result; 155 return result;
156 } 156 }
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 // Call the media feature evaluation function. Assume no prefix and let 662 // Call the media feature evaluation function. Assume no prefix and let
663 // trampoline functions override the prefix if prefix is used. 663 // trampoline functions override the prefix if prefix is used.
664 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl()); 664 EvalFunc func = gFunctionMap->get(expr->mediaFeature().impl());
665 if (func) 665 if (func)
666 return func(expr->expValue(), NoPrefix, *m_mediaValues); 666 return func(expr->expValue(), NoPrefix, *m_mediaValues);
667 667
668 return false; 668 return false;
669 } 669 }
670 670
671 } // namespace 671 } // namespace
OLDNEW
« no previous file with comments | « Source/core/css/MediaQueryEvaluator.h ('k') | Source/core/css/MediaQueryList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698