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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 { | 227 { |
228 ASSERT(mediaQueries); | 228 ASSERT(mediaQueries); |
229 m_mediaQueries = mediaQueries; | 229 m_mediaQueries = mediaQueries; |
230 } | 230 } |
231 | 231 |
232 static void addResolutionWarningMessageToConsole(Document* document, const Strin
g& serializedExpression, const CSSPrimitiveValue* value) | 232 static void addResolutionWarningMessageToConsole(Document* document, const Strin
g& serializedExpression, const CSSPrimitiveValue* value) |
233 { | 233 { |
234 ASSERT(document); | 234 ASSERT(document); |
235 ASSERT(value); | 235 ASSERT(value); |
236 | 236 |
237 DEFINE_STATIC_LOCAL(String, mediaQueryMessage, (ASCIILiteral("Consider using
'dppx' units instead of '%replacementUnits%', as in CSS '%replacementUnits%' me
ans dots-per-CSS-%lengthUnit%, not dots-per-physical-%lengthUnit%, so does not c
orrespond to the actual '%replacementUnits%' of a screen. In media query express
ion: "))); | 237 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: ")); |
238 DEFINE_STATIC_LOCAL(String, mediaValueDPI, (ASCIILiteral("dpi"))); | 238 DEFINE_STATIC_LOCAL(String, mediaValueDPI, ("dpi")); |
239 DEFINE_STATIC_LOCAL(String, mediaValueDPCM, (ASCIILiteral("dpcm"))); | 239 DEFINE_STATIC_LOCAL(String, mediaValueDPCM, ("dpcm")); |
240 DEFINE_STATIC_LOCAL(String, lengthUnitInch, (ASCIILiteral("inch"))); | 240 DEFINE_STATIC_LOCAL(String, lengthUnitInch, ("inch")); |
241 DEFINE_STATIC_LOCAL(String, lengthUnitCentimeter, (ASCIILiteral("centimeter"
))); | 241 DEFINE_STATIC_LOCAL(String, lengthUnitCentimeter, ("centimeter")); |
242 | 242 |
243 String message; | 243 String message; |
244 if (value->isDotsPerInch()) | 244 if (value->isDotsPerInch()) |
245 message = String(mediaQueryMessage).replace("%replacementUnits%", mediaV
alueDPI).replace("%lengthUnit%", lengthUnitInch); | 245 message = String(mediaQueryMessage).replace("%replacementUnits%", mediaV
alueDPI).replace("%lengthUnit%", lengthUnitInch); |
246 else if (value->isDotsPerCentimeter()) | 246 else if (value->isDotsPerCentimeter()) |
247 message = String(mediaQueryMessage).replace("%replacementUnits%", mediaV
alueDPCM).replace("%lengthUnit%", lengthUnitCentimeter); | 247 message = String(mediaQueryMessage).replace("%replacementUnits%", mediaV
alueDPCM).replace("%lengthUnit%", lengthUnitCentimeter); |
248 else | 248 else |
249 ASSERT_NOT_REACHED(); | 249 ASSERT_NOT_REACHED(); |
250 | 250 |
251 message.append(serializedExpression); | 251 message.append(serializedExpression); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(cssV
alue); | 285 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(cssV
alue); |
286 if (primitiveValue->isDotsPerInch() || primitiveValue->isDot
sPerCentimeter()) | 286 if (primitiveValue->isDotsPerInch() || primitiveValue->isDot
sPerCentimeter()) |
287 addResolutionWarningMessageToConsole(document, mediaQuer
ySet->mediaText(), primitiveValue); | 287 addResolutionWarningMessageToConsole(document, mediaQuer
ySet->mediaText(), primitiveValue); |
288 } | 288 } |
289 } | 289 } |
290 } | 290 } |
291 } | 291 } |
292 } | 292 } |
293 | 293 |
294 } | 294 } |
OLD | NEW |