| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 for (size_t i = 0; i < m_queries.size(); ++i) { | 162 for (size_t i = 0; i < m_queries.size(); ++i) { |
| 163 if (!first) | 163 if (!first) |
| 164 text.appendLiteral(", "); | 164 text.appendLiteral(", "); |
| 165 else | 165 else |
| 166 first = false; | 166 first = false; |
| 167 text.append(m_queries[i]->cssText()); | 167 text.append(m_queries[i]->cssText()); |
| 168 } | 168 } |
| 169 return text.toString(); | 169 return text.toString(); |
| 170 } | 170 } |
| 171 | 171 |
| 172 void MediaQuerySet::trace(Visitor* visitor) | |
| 173 { | |
| 174 } | |
| 175 | |
| 176 MediaList::MediaList(MediaQuerySet* mediaQueries, CSSStyleSheet* parentSheet) | 172 MediaList::MediaList(MediaQuerySet* mediaQueries, CSSStyleSheet* parentSheet) |
| 177 : m_mediaQueries(mediaQueries) | 173 : m_mediaQueries(mediaQueries) |
| 178 , m_parentStyleSheet(parentSheet) | 174 , m_parentStyleSheet(parentSheet) |
| 179 , m_parentRule(nullptr) | 175 , m_parentRule(nullptr) |
| 180 { | 176 { |
| 181 } | 177 } |
| 182 | 178 |
| 183 MediaList::MediaList(MediaQuerySet* mediaQueries, CSSRule* parentRule) | 179 MediaList::MediaList(MediaQuerySet* mediaQueries, CSSRule* parentRule) |
| 184 : m_mediaQueries(mediaQueries) | 180 : m_mediaQueries(mediaQueries) |
| 185 , m_parentStyleSheet(nullptr) | 181 , m_parentStyleSheet(nullptr) |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 if (m_parentStyleSheet) | 231 if (m_parentStyleSheet) |
| 236 m_parentStyleSheet->didMutate(); | 232 m_parentStyleSheet->didMutate(); |
| 237 } | 233 } |
| 238 | 234 |
| 239 void MediaList::reattach(MediaQuerySet* mediaQueries) | 235 void MediaList::reattach(MediaQuerySet* mediaQueries) |
| 240 { | 236 { |
| 241 ASSERT(mediaQueries); | 237 ASSERT(mediaQueries); |
| 242 m_mediaQueries = mediaQueries; | 238 m_mediaQueries = mediaQueries; |
| 243 } | 239 } |
| 244 | 240 |
| 245 void MediaList::trace(Visitor* visitor) | |
| 246 { | |
| 247 visitor->trace(m_mediaQueries); | |
| 248 visitor->trace(m_parentStyleSheet); | |
| 249 visitor->trace(m_parentRule); | |
| 250 } | |
| 251 | |
| 252 static void addResolutionWarningMessageToConsole(Document* document, const Strin
g& serializedExpression, CSSPrimitiveValue::UnitType type) | 241 static void addResolutionWarningMessageToConsole(Document* document, const Strin
g& serializedExpression, CSSPrimitiveValue::UnitType type) |
| 253 { | 242 { |
| 254 ASSERT(document); | 243 ASSERT(document); |
| 255 | 244 |
| 256 DEFINE_STATIC_LOCAL(String, mediaQueryMessage, ("Consider using 'dppx' units
, as in CSS '%replacementUnits%' means dots-per-CSS-%lengthUnit%, not dots-per-p
hysical-%lengthUnit%, so does not correspond to the actual '%replacementUnits%'
of a screen. In media query expression: ")); | 245 DEFINE_STATIC_LOCAL(String, mediaQueryMessage, ("Consider using 'dppx' units
, as in CSS '%replacementUnits%' means dots-per-CSS-%lengthUnit%, not dots-per-p
hysical-%lengthUnit%, so does not correspond to the actual '%replacementUnits%'
of a screen. In media query expression: ")); |
| 257 DEFINE_STATIC_LOCAL(String, mediaValueDPI, ("dpi")); | 246 DEFINE_STATIC_LOCAL(String, mediaValueDPI, ("dpi")); |
| 258 DEFINE_STATIC_LOCAL(String, mediaValueDPCM, ("dpcm")); | 247 DEFINE_STATIC_LOCAL(String, mediaValueDPCM, ("dpcm")); |
| 259 DEFINE_STATIC_LOCAL(String, lengthUnitInch, ("inch")); | 248 DEFINE_STATIC_LOCAL(String, lengthUnitInch, ("inch")); |
| 260 DEFINE_STATIC_LOCAL(String, lengthUnitCentimeter, ("centimeter")); | 249 DEFINE_STATIC_LOCAL(String, lengthUnitCentimeter, ("centimeter")); |
| 261 | 250 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 } | 299 } |
| 311 } | 300 } |
| 312 } | 301 } |
| 313 } | 302 } |
| 314 | 303 |
| 315 if (suspiciousType && !dotsPerPixelUsed) | 304 if (suspiciousType && !dotsPerPixelUsed) |
| 316 addResolutionWarningMessageToConsole(document, mediaQuerySet->mediaText(
), suspiciousType); | 305 addResolutionWarningMessageToConsole(document, mediaQuerySet->mediaText(
), suspiciousType); |
| 317 } | 306 } |
| 318 | 307 |
| 319 } | 308 } |
| OLD | NEW |