| 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> |
| 36 | 37 |
| 37 namespace blink { | 38 namespace blink { |
| 38 | 39 |
| 39 // http://dev.w3.org/csswg/cssom/#serialize-a-media-query | 40 // http://dev.w3.org/csswg/cssom/#serialize-a-media-query |
| 40 String MediaQuery::serialize() const | 41 String MediaQuery::serialize() const |
| 41 { | 42 { |
| 42 StringBuilder result; | 43 StringBuilder result; |
| 43 switch (m_restrictor) { | 44 switch (m_restrictor) { |
| 44 case MediaQuery::Only: | 45 case MediaQuery::Only: |
| 45 result.append("only "); | 46 result.append("only "); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 String MediaQuery::cssText() const | 128 String MediaQuery::cssText() const |
| 128 { | 129 { |
| 129 if (m_serializationCache.isNull()) | 130 if (m_serializationCache.isNull()) |
| 130 const_cast<MediaQuery*>(this)->m_serializationCache = serialize(); | 131 const_cast<MediaQuery*>(this)->m_serializationCache = serialize(); |
| 131 | 132 |
| 132 return m_serializationCache; | 133 return m_serializationCache; |
| 133 } | 134 } |
| 134 | 135 |
| 135 DEFINE_TRACE(MediaQuery) | 136 DEFINE_TRACE(MediaQuery) |
| 136 { | 137 { |
| 137 // 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. std::unique_ptr<Vecto
r<std::unique_ptr<MediaQuery>>>). |
| 138 // 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. |
| 139 visitor->trace(m_expressions); | 140 visitor->trace(m_expressions); |
| 140 } | 141 } |
| 141 | 142 |
| 142 } // namespace blink | 143 } // namespace blink |
| OLD | NEW |