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 15 matching lines...) Expand all Loading... |
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 */ | 27 */ |
28 | 28 |
29 #include "core/css/MediaQuery.h" | 29 #include "core/css/MediaQuery.h" |
30 | 30 |
31 #include "core/MediaTypeNames.h" | 31 #include "core/MediaTypeNames.h" |
32 #include "core/css/MediaQueryExp.h" | 32 #include "core/css/MediaQueryExp.h" |
33 #include "core/html/parser/HTMLParserIdioms.h" | 33 #include "core/html/parser/HTMLParserIdioms.h" |
34 #include "wtf/NonCopyingSort.h" | 34 #include "wtf/NonCopyingSort.h" |
35 #include "wtf/text/StringBuilder.h" | 35 #include "wtf/text/StringBuilder.h" |
36 #include <memory> | |
37 | 36 |
38 namespace blink { | 37 namespace blink { |
39 | 38 |
40 // http://dev.w3.org/csswg/cssom/#serialize-a-media-query | 39 // http://dev.w3.org/csswg/cssom/#serialize-a-media-query |
41 String MediaQuery::serialize() const | 40 String MediaQuery::serialize() const |
42 { | 41 { |
43 StringBuilder result; | 42 StringBuilder result; |
44 switch (m_restrictor) { | 43 switch (m_restrictor) { |
45 case MediaQuery::Only: | 44 case MediaQuery::Only: |
46 result.append("only "); | 45 result.append("only "); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 String MediaQuery::cssText() const | 127 String MediaQuery::cssText() const |
129 { | 128 { |
130 if (m_serializationCache.isNull()) | 129 if (m_serializationCache.isNull()) |
131 const_cast<MediaQuery*>(this)->m_serializationCache = serialize(); | 130 const_cast<MediaQuery*>(this)->m_serializationCache = serialize(); |
132 | 131 |
133 return m_serializationCache; | 132 return m_serializationCache; |
134 } | 133 } |
135 | 134 |
136 DEFINE_TRACE(MediaQuery) | 135 DEFINE_TRACE(MediaQuery) |
137 { | 136 { |
138 // We don't support tracing of vectors of OwnPtrs (ie. std::unique_ptr<Vecto
r<std::unique_ptr<MediaQuery>>>). | 137 // 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. | 138 // Since this is a transitional object we are just ifdef'ing it out when oil
pan is not enabled. |
140 visitor->trace(m_expressions); | 139 visitor->trace(m_expressions); |
141 } | 140 } |
142 | 141 |
143 } // namespace blink | 142 } // namespace blink |
OLD | NEW |