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 11 matching lines...) Expand all Loading... |
22 | 22 |
23 #include "bindings/core/v8/ExceptionState.h" | 23 #include "bindings/core/v8/ExceptionState.h" |
24 #include "core/MediaFeatureNames.h" | 24 #include "core/MediaFeatureNames.h" |
25 #include "core/css/parser/BisonCSSParser.h" | 25 #include "core/css/parser/BisonCSSParser.h" |
26 #include "core/css/CSSStyleSheet.h" | 26 #include "core/css/CSSStyleSheet.h" |
27 #include "core/css/MediaQuery.h" | 27 #include "core/css/MediaQuery.h" |
28 #include "core/css/MediaQueryExp.h" | 28 #include "core/css/MediaQueryExp.h" |
29 #include "core/css/parser/MediaQueryParser.h" | 29 #include "core/css/parser/MediaQueryParser.h" |
30 #include "core/dom/Document.h" | 30 #include "core/dom/Document.h" |
31 #include "core/frame/LocalDOMWindow.h" | 31 #include "core/frame/LocalDOMWindow.h" |
| 32 #include "core/inspector/ConsoleMessage.h" |
32 #include "wtf/text/StringBuilder.h" | 33 #include "wtf/text/StringBuilder.h" |
33 | 34 |
34 namespace WebCore { | 35 namespace WebCore { |
35 | 36 |
36 /* MediaList is used to store 3 types of media related entities which mean the s
ame: | 37 /* MediaList is used to store 3 types of media related entities which mean the s
ame: |
37 * | 38 * |
38 * Media Queries, Media Types and Media Descriptors. | 39 * Media Queries, Media Types and Media Descriptors. |
39 * | 40 * |
40 * Media queries, as described in the Media Queries Level 3 specification, build
on | 41 * Media queries, as described in the Media Queries Level 3 specification, build
on |
41 * the mechanism outlined in HTML4. The syntax of media queries fit into the med
ia | 42 * the mechanism outlined in HTML4. The syntax of media queries fit into the med
ia |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 StringBuilder message; | 267 StringBuilder message; |
267 if (CSSPrimitiveValue::isDotsPerInch(type)) | 268 if (CSSPrimitiveValue::isDotsPerInch(type)) |
268 message.append(String(mediaQueryMessage).replace("%replacementUnits%", m
ediaValueDPI).replace("%lengthUnit%", lengthUnitInch)); | 269 message.append(String(mediaQueryMessage).replace("%replacementUnits%", m
ediaValueDPI).replace("%lengthUnit%", lengthUnitInch)); |
269 else if (CSSPrimitiveValue::isDotsPerCentimeter(type)) | 270 else if (CSSPrimitiveValue::isDotsPerCentimeter(type)) |
270 message.append(String(mediaQueryMessage).replace("%replacementUnits%", m
ediaValueDPCM).replace("%lengthUnit%", lengthUnitCentimeter)); | 271 message.append(String(mediaQueryMessage).replace("%replacementUnits%", m
ediaValueDPCM).replace("%lengthUnit%", lengthUnitCentimeter)); |
271 else | 272 else |
272 ASSERT_NOT_REACHED(); | 273 ASSERT_NOT_REACHED(); |
273 | 274 |
274 message.append(serializedExpression); | 275 message.append(serializedExpression); |
275 | 276 |
276 document->addConsoleMessage(CSSMessageSource, DebugMessageLevel, message.toS
tring()); | 277 document->addConsoleMessage(ConsoleMessage::create(CSSMessageSource, DebugMe
ssageLevel, message.toString())); |
277 } | 278 } |
278 | 279 |
279 static inline bool isResolutionMediaFeature(const String& mediaFeature) | 280 static inline bool isResolutionMediaFeature(const String& mediaFeature) |
280 { | 281 { |
281 return mediaFeature == MediaFeatureNames::resolutionMediaFeature | 282 return mediaFeature == MediaFeatureNames::resolutionMediaFeature |
282 || mediaFeature == MediaFeatureNames::maxResolutionMediaFeature | 283 || mediaFeature == MediaFeatureNames::maxResolutionMediaFeature |
283 || mediaFeature == MediaFeatureNames::minResolutionMediaFeature; | 284 || mediaFeature == MediaFeatureNames::minResolutionMediaFeature; |
284 } | 285 } |
285 | 286 |
286 void reportMediaQueryWarningIfNeeded(Document* document, const MediaQuerySet* me
diaQuerySet) | 287 void reportMediaQueryWarningIfNeeded(Document* document, const MediaQuerySet* me
diaQuerySet) |
(...skipping 27 matching lines...) Expand all Loading... |
314 } | 315 } |
315 } | 316 } |
316 } | 317 } |
317 } | 318 } |
318 | 319 |
319 if (suspiciousType && !dotsPerPixelUsed) | 320 if (suspiciousType && !dotsPerPixelUsed) |
320 addResolutionWarningMessageToConsole(document, mediaQuerySet->mediaText(
), suspiciousType); | 321 addResolutionWarningMessageToConsole(document, mediaQuerySet->mediaText(
), suspiciousType); |
321 } | 322 } |
322 | 323 |
323 } | 324 } |
OLD | NEW |