OLD | NEW |
1 /* | 1 /* |
2 * CSS Media Query | 2 * CSS Media Query |
3 * | 3 * |
4 * Copyright (C) 2005, 2006 Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>. | 4 * Copyright (C) 2005, 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 * | 6 * |
7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
9 * are met: | 9 * are met: |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 return result.toString(); | 70 return result.toString(); |
71 } | 71 } |
72 | 72 |
73 static bool expressionCompare(const OwnPtrWillBeMember<MediaQueryExp>& a, const
OwnPtrWillBeMember<MediaQueryExp>& b) | 73 static bool expressionCompare(const OwnPtrWillBeMember<MediaQueryExp>& a, const
OwnPtrWillBeMember<MediaQueryExp>& b) |
74 { | 74 { |
75 return codePointCompare(a->serialize(), b->serialize()) < 0; | 75 return codePointCompare(a->serialize(), b->serialize()) < 0; |
76 } | 76 } |
77 | 77 |
78 PassOwnPtrWillBeRawPtr<MediaQuery> MediaQuery::createNotAll() | 78 PassOwnPtrWillBeRawPtr<MediaQuery> MediaQuery::createNotAll() |
79 { | 79 { |
80 return adoptPtrWillBeNoop(new MediaQuery(MediaQuery::Not, "all", nullptr)); | 80 return adoptPtrWillBeNoop(new MediaQuery(MediaQuery::Not, MediaTypeNames::al
l, nullptr)); |
81 } | 81 } |
82 | 82 |
83 MediaQuery::MediaQuery(Restrictor r, const String& mediaType, PassOwnPtrWillBeRa
wPtr<ExpressionHeapVector> expressions) | 83 MediaQuery::MediaQuery(Restrictor r, const String& mediaType, PassOwnPtrWillBeRa
wPtr<ExpressionHeapVector> expressions) |
84 : m_restrictor(r) | 84 : m_restrictor(r) |
85 , m_mediaType(attemptStaticStringCreation(mediaType.lower())) | 85 , m_mediaType(attemptStaticStringCreation(mediaType.lower())) |
86 , m_expressions(expressions) | 86 , m_expressions(expressions) |
87 { | 87 { |
88 if (!m_expressions) { | 88 if (!m_expressions) { |
89 m_expressions = adoptPtrWillBeNoop(new ExpressionHeapVector); | 89 m_expressions = adoptPtrWillBeNoop(new ExpressionHeapVector); |
90 return; | 90 return; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 void MediaQuery::trace(Visitor* visitor) | 136 void MediaQuery::trace(Visitor* visitor) |
137 { | 137 { |
138 // We don't support tracing of vectors of OwnPtrs (ie. OwnPtr<Vector<OwnPtr<
MediaQuery> > >). | 138 // We don't support tracing of vectors of OwnPtrs (ie. OwnPtr<Vector<OwnPtr<
MediaQuery> > >). |
139 // Since this is a transitional object we are just ifdef'ing it out when oil
pan is not enabled. | 139 // Since this is a transitional object we are just ifdef'ing it out when oil
pan is not enabled. |
140 #if ENABLE(OILPAN) | 140 #if ENABLE(OILPAN) |
141 visitor->trace(m_expressions); | 141 visitor->trace(m_expressions); |
142 #endif | 142 #endif |
143 } | 143 } |
144 | 144 |
145 } | 145 } |
OLD | NEW |