OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Motorola Mobility Inc. All rights reserved. | 2 * Copyright (C) 2012 Motorola Mobility Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above | 10 * 2. Redistributions in binary form must reproduce the above |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "config.h" | 30 #include "config.h" |
31 #include "core/css/DOMWindowCSS.h" | 31 #include "core/css/DOMWindowCSS.h" |
32 | 32 |
33 #include "core/css/CSSPropertyMetadata.h" | 33 #include "core/css/CSSPropertyMetadata.h" |
34 #include "core/css/StylePropertySet.h" | 34 #include "core/css/StylePropertySet.h" |
35 #include "core/css/parser/CSSParser.h" | 35 #include "core/css/parser/CSSParser.h" |
36 #include "wtf/text/WTFString.h" | 36 #include "wtf/text/WTFString.h" |
37 | 37 |
38 namespace blink { | 38 namespace blink { |
39 | 39 |
40 PassRefPtrWillBeRawPtr<DOMWindowCSS> DOMWindowCSS::create() | 40 bool DOMWindowCSS::supports(const String& property, const String& value) |
41 { | |
42 return adoptRefWillBeNoop(new DOMWindowCSS()); | |
43 } | |
44 | |
45 bool DOMWindowCSS::supports(const String& property, const String& value) const | |
46 { | 41 { |
47 CSSPropertyID unresolvedProperty = unresolvedCSSPropertyID(property); | 42 CSSPropertyID unresolvedProperty = unresolvedCSSPropertyID(property); |
48 if (unresolvedProperty == CSSPropertyInvalid) | 43 if (unresolvedProperty == CSSPropertyInvalid) |
49 return false; | 44 return false; |
50 ASSERT(CSSPropertyMetadata::isEnabledProperty(unresolvedProperty)); | 45 ASSERT(CSSPropertyMetadata::isEnabledProperty(unresolvedProperty)); |
51 | 46 |
52 // This will return false when !important is present | 47 // This will return false when !important is present |
53 RefPtrWillBeRawPtr<MutableStylePropertySet> dummyStyle = MutableStylePropert
ySet::create(); | 48 RefPtrWillBeRawPtr<MutableStylePropertySet> dummyStyle = MutableStylePropert
ySet::create(); |
54 return CSSParser::parseValue(dummyStyle.get(), unresolvedProperty, value, fa
lse, HTMLStandardMode, 0); | 49 return CSSParser::parseValue(dummyStyle.get(), unresolvedProperty, value, fa
lse, HTMLStandardMode, 0); |
55 } | 50 } |
56 | 51 |
57 bool DOMWindowCSS::supports(const String& conditionText) const | 52 bool DOMWindowCSS::supports(const String& conditionText) |
58 { | 53 { |
59 return CSSParser::parseSupportsCondition(conditionText); | 54 return CSSParser::parseSupportsCondition(conditionText); |
60 } | 55 } |
61 | 56 |
62 } | 57 } |
OLD | NEW |