OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2006, 2010, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2006, 2010, 2012 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 m_queries[i] = o.m_queries[i]->copy(); | 58 m_queries[i] = o.m_queries[i]->copy(); |
59 } | 59 } |
60 | 60 |
61 MediaQuerySet* MediaQuerySet::create(const String& mediaString) { | 61 MediaQuerySet* MediaQuerySet::create(const String& mediaString) { |
62 if (mediaString.isEmpty()) | 62 if (mediaString.isEmpty()) |
63 return MediaQuerySet::create(); | 63 return MediaQuerySet::create(); |
64 | 64 |
65 return MediaQueryParser::parseMediaQuerySet(mediaString); | 65 return MediaQueryParser::parseMediaQuerySet(mediaString); |
66 } | 66 } |
67 | 67 |
68 MediaQuerySet* MediaQuerySet::createOffMainThread(const String& mediaString) { | |
69 if (mediaString.isEmpty()) | |
70 return MediaQuerySet::create(); | |
71 | |
72 return MediaQueryParser::parseMediaQuerySet(mediaString); | |
73 } | |
74 | |
75 bool MediaQuerySet::set(const String& mediaString) { | 68 bool MediaQuerySet::set(const String& mediaString) { |
76 MediaQuerySet* result = create(mediaString); | 69 MediaQuerySet* result = create(mediaString); |
77 m_queries.swap(result->m_queries); | 70 m_queries.swap(result->m_queries); |
78 return true; | 71 return true; |
79 } | 72 } |
80 | 73 |
81 bool MediaQuerySet::add(const String& queryString) { | 74 bool MediaQuerySet::add(const String& queryString) { |
82 // To "parse a media query" for a given string means to follow "the parse | 75 // To "parse a media query" for a given string means to follow "the parse |
83 // a media query list" steps and return "null" if more than one media query | 76 // a media query list" steps and return "null" if more than one media query |
84 // is returned, or else the returned media query. | 77 // is returned, or else the returned media query. |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 m_mediaQueries = mediaQueries; | 207 m_mediaQueries = mediaQueries; |
215 } | 208 } |
216 | 209 |
217 DEFINE_TRACE(MediaList) { | 210 DEFINE_TRACE(MediaList) { |
218 visitor->trace(m_mediaQueries); | 211 visitor->trace(m_mediaQueries); |
219 visitor->trace(m_parentStyleSheet); | 212 visitor->trace(m_parentStyleSheet); |
220 visitor->trace(m_parentRule); | 213 visitor->trace(m_parentRule); |
221 } | 214 } |
222 | 215 |
223 } // namespace blink | 216 } // namespace blink |
OLD | NEW |