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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 MediaList::MediaList(MediaQuerySet* mediaQueries, CSSStyleSheet* parentSheet) | 170 MediaList::MediaList(MediaQuerySet* mediaQueries, CSSStyleSheet* parentSheet) |
171 : m_mediaQueries(mediaQueries) | 171 : m_mediaQueries(mediaQueries) |
172 , m_parentStyleSheet(parentSheet) | 172 , m_parentStyleSheet(parentSheet) |
173 , m_parentRule(nullptr) | 173 , m_parentRule(nullptr) |
174 { | 174 { |
175 } | 175 } |
176 | 176 |
177 MediaList::MediaList(MediaQuerySet* mediaQueries, CSSRule* parentRule) | 177 MediaList::MediaList(MediaQuerySet* mediaQueries, CSSRule* parentRule) |
178 : m_mediaQueries(mediaQueries) | 178 : m_mediaQueries(mediaQueries) |
179 , m_parentStyleSheet(0) | 179 , m_parentStyleSheet(nullptr) |
180 , m_parentRule(parentRule) | 180 , m_parentRule(parentRule) |
181 { | 181 { |
182 } | 182 } |
183 | 183 |
184 MediaList::~MediaList() | 184 MediaList::~MediaList() |
185 { | 185 { |
186 } | 186 } |
187 | 187 |
188 void MediaList::setMediaText(const String& value) | 188 void MediaList::setMediaText(const String& value) |
189 { | 189 { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 | 232 |
233 void MediaList::reattach(MediaQuerySet* mediaQueries) | 233 void MediaList::reattach(MediaQuerySet* mediaQueries) |
234 { | 234 { |
235 ASSERT(mediaQueries); | 235 ASSERT(mediaQueries); |
236 m_mediaQueries = mediaQueries; | 236 m_mediaQueries = mediaQueries; |
237 } | 237 } |
238 | 238 |
239 void MediaList::trace(Visitor* visitor) | 239 void MediaList::trace(Visitor* visitor) |
240 { | 240 { |
241 visitor->trace(m_mediaQueries); | 241 visitor->trace(m_mediaQueries); |
| 242 visitor->trace(m_parentStyleSheet); |
242 visitor->trace(m_parentRule); | 243 visitor->trace(m_parentRule); |
243 } | 244 } |
244 | 245 |
245 static void addResolutionWarningMessageToConsole(Document* document, const Strin
g& serializedExpression, const CSSPrimitiveValue* value) | 246 static void addResolutionWarningMessageToConsole(Document* document, const Strin
g& serializedExpression, const CSSPrimitiveValue* value) |
246 { | 247 { |
247 ASSERT(document); | 248 ASSERT(document); |
248 ASSERT(value); | 249 ASSERT(value); |
249 | 250 |
250 DEFINE_STATIC_LOCAL(String, mediaQueryMessage, ("Consider using 'dppx' units
instead of '%replacementUnits%', as in CSS '%replacementUnits%' means dots-per-
CSS-%lengthUnit%, not dots-per-physical-%lengthUnit%, so does not correspond to
the actual '%replacementUnits%' of a screen. In media query expression: ")); | 251 DEFINE_STATIC_LOCAL(String, mediaQueryMessage, ("Consider using 'dppx' units
instead of '%replacementUnits%', as in CSS '%replacementUnits%' means dots-per-
CSS-%lengthUnit%, not dots-per-physical-%lengthUnit%, so does not correspond to
the actual '%replacementUnits%' of a screen. In media query expression: ")); |
251 DEFINE_STATIC_LOCAL(String, mediaValueDPI, ("dpi")); | 252 DEFINE_STATIC_LOCAL(String, mediaValueDPI, ("dpi")); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(cssV
alue); | 299 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(cssV
alue); |
299 if (primitiveValue->isDotsPerInch() || primitiveValue->isDot
sPerCentimeter()) | 300 if (primitiveValue->isDotsPerInch() || primitiveValue->isDot
sPerCentimeter()) |
300 addResolutionWarningMessageToConsole(document, mediaQuer
ySet->mediaText(), primitiveValue); | 301 addResolutionWarningMessageToConsole(document, mediaQuer
ySet->mediaText(), primitiveValue); |
301 } | 302 } |
302 } | 303 } |
303 } | 304 } |
304 } | 305 } |
305 } | 306 } |
306 | 307 |
307 } | 308 } |
OLD | NEW |