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

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

Issue 853483003: Add support for 'display-mode' MQ defined in Manifest spec (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 5 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/MediaQueryEvaluatorTest.cpp ('k') | Source/core/css/MediaValues.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 2 * CSS Media Query
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) 2010 Nokia Corporation and/or its subsidiary(-ies). 5 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
6 * Copyright (C) 2013 Apple Inc. All rights reserved. 6 * Copyright (C) 2013 Apple Inc. 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 29 matching lines...) Expand all
40 40
41 namespace blink { 41 namespace blink {
42 42
43 using namespace MediaFeatureNames; 43 using namespace MediaFeatureNames;
44 44
45 static inline bool featureWithCSSValueID(const String& mediaFeature, const CSSPa rserValue* value) 45 static inline bool featureWithCSSValueID(const String& mediaFeature, const CSSPa rserValue* value)
46 { 46 {
47 if (!value->id) 47 if (!value->id)
48 return false; 48 return false;
49 49
50 return mediaFeature == orientationMediaFeature 50 return mediaFeature == displayModeMediaFeature
51 || mediaFeature == orientationMediaFeature
51 || mediaFeature == pointerMediaFeature 52 || mediaFeature == pointerMediaFeature
52 || mediaFeature == anyPointerMediaFeature 53 || mediaFeature == anyPointerMediaFeature
53 || mediaFeature == hoverMediaFeature 54 || mediaFeature == hoverMediaFeature
54 || mediaFeature == anyHoverMediaFeature 55 || mediaFeature == anyHoverMediaFeature
55 || mediaFeature == scanMediaFeature; 56 || mediaFeature == scanMediaFeature;
56 } 57 }
57 58
58 static inline bool featureWithValidIdent(const String& mediaFeature, CSSValueID ident) 59 static inline bool featureWithValidIdent(const String& mediaFeature, CSSValueID ident)
59 { 60 {
61 if (mediaFeature == displayModeMediaFeature)
62 return ident == CSSValueFullscreen || ident == CSSValueStandalone || ide nt == CSSValueMinimalUi || ident == CSSValueBrowser;
63
60 if (mediaFeature == orientationMediaFeature) 64 if (mediaFeature == orientationMediaFeature)
61 return ident == CSSValuePortrait || ident == CSSValueLandscape; 65 return ident == CSSValuePortrait || ident == CSSValueLandscape;
62 66
63 if (mediaFeature == pointerMediaFeature || mediaFeature == anyPointerMediaFe ature) 67 if (mediaFeature == pointerMediaFeature || mediaFeature == anyPointerMediaFe ature)
64 return ident == CSSValueNone || ident == CSSValueCoarse || ident == CSSV alueFine; 68 return ident == CSSValueNone || ident == CSSValueCoarse || ident == CSSV alueFine;
65 69
66 if (mediaFeature == hoverMediaFeature || mediaFeature == anyHoverMediaFeatur e) 70 if (mediaFeature == hoverMediaFeature || mediaFeature == anyHoverMediaFeatur e)
67 return ident == CSSValueNone || ident == CSSValueOnDemand || ident == CS SValueHover; 71 return ident == CSSValueNone || ident == CSSValueOnDemand || ident == CS SValueHover;
68 72
69 if (mediaFeature == scanMediaFeature) 73 if (mediaFeature == scanMediaFeature)
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 output.append('/'); 341 output.append('/');
338 output.append(printNumber(denominator)); 342 output.append(printNumber(denominator));
339 } else if (isID) { 343 } else if (isID) {
340 output.append(getValueName(id)); 344 output.append(getValueName(id));
341 } 345 }
342 346
343 return output.toString(); 347 return output.toString();
344 } 348 }
345 349
346 } // namespace 350 } // namespace
OLDNEW
« no previous file with comments | « Source/core/css/MediaQueryEvaluatorTest.cpp ('k') | Source/core/css/MediaValues.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698