| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 namespace blink { | 42 namespace blink { |
| 43 | 43 |
| 44 bool DOMWindowCSS::supports(const String& property, const String& value) | 44 bool DOMWindowCSS::supports(const String& property, const String& value) |
| 45 { | 45 { |
| 46 CSSPropertyID unresolvedProperty = unresolvedCSSPropertyID(property); | 46 CSSPropertyID unresolvedProperty = unresolvedCSSPropertyID(property); |
| 47 if (unresolvedProperty == CSSPropertyInvalid) | 47 if (unresolvedProperty == CSSPropertyInvalid) |
| 48 return false; | 48 return false; |
| 49 ASSERT(CSSPropertyMetadata::isEnabledProperty(unresolvedProperty)); | 49 ASSERT(CSSPropertyMetadata::isEnabledProperty(unresolvedProperty)); |
| 50 | 50 |
| 51 // This will return false when !important is present | 51 // This will return false when !important is present |
| 52 RefPtrWillBeRawPtr<MutableStylePropertySet> dummyStyle = MutableStylePropert
ySet::create(HTMLQuirksMode); | 52 RefPtrWillBeRawPtr<MutableStylePropertySet> dummyStyle = MutableStylePropert
ySet::create(HTMLStandardMode); |
| 53 return CSSParser::parseValue(dummyStyle.get(), unresolvedProperty, value, fa
lse, HTMLStandardMode, 0); | 53 return CSSParser::parseValue(dummyStyle.get(), unresolvedProperty, value, fa
lse, 0); |
| 54 } | 54 } |
| 55 | 55 |
| 56 bool DOMWindowCSS::supports(const String& conditionText) | 56 bool DOMWindowCSS::supports(const String& conditionText) |
| 57 { | 57 { |
| 58 return CSSParser::parseSupportsCondition(conditionText); | 58 return CSSParser::parseSupportsCondition(conditionText); |
| 59 } | 59 } |
| 60 | 60 |
| 61 String DOMWindowCSS::escape(const String& ident, ExceptionState& exceptionState) | 61 String DOMWindowCSS::escape(const String& ident, ExceptionState& exceptionState) |
| 62 { | 62 { |
| 63 StringBuilder builder; | 63 StringBuilder builder; |
| 64 if (!serializeIdentifier(ident, builder)) { | 64 if (!serializeIdentifier(ident, builder)) { |
| 65 exceptionState.throwDOMException(InvalidCharacterError, "The string cont
ains an invalid character."); | 65 exceptionState.throwDOMException(InvalidCharacterError, "The string cont
ains an invalid character."); |
| 66 return String(); | 66 return String(); |
| 67 } | 67 } |
| 68 return builder.toString(); | 68 return builder.toString(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 } | 71 } |
| OLD | NEW |