| OLD | NEW |
| 1 /* Copyright (C) 2012 Motorola Mobility Inc. All rights reserved. | 1 /* Copyright (C) 2012 Motorola Mobility Inc. All rights reserved. |
| 2 * | 2 * |
| 3 * Redistribution and use in source and binary forms, with or without | 3 * Redistribution and use in source and binary forms, with or without |
| 4 * modification, are permitted provided that the following conditions are | 4 * modification, are permitted provided that the following conditions are |
| 5 * met: | 5 * met: |
| 6 * | 6 * |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above | 9 * 2. Redistributions in binary form must reproduce the above |
| 10 * copyright notice, this list of conditions and the following disclaimer in | 10 * copyright notice, this list of conditions and the following disclaimer in |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "core/css/CSSSupportsRule.h" | 29 #include "core/css/CSSSupportsRule.h" |
| 30 | 30 |
| 31 #include "core/css/CSSRule.h" | 31 #include "core/css/CSSRule.h" |
| 32 #include "core/css/StyleRule.h" | 32 #include "core/css/StyleRule.h" |
| 33 #include "wtf/text/StringBuilder.h" | 33 #include "wtf/text/StringBuilder.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 CSSSupportsRule::CSSSupportsRule(StyleRuleSupports* supportsRule, | 37 CSSSupportsRule::CSSSupportsRule(StyleRuleSupports* supportsRule, |
| 38 CSSStyleSheet* parent) | 38 CSSStyleSheet* parent) |
| 39 : CSSGroupingRule(supportsRule, parent) {} | 39 : CSSConditionRule(supportsRule, parent) {} |
| 40 | 40 |
| 41 String CSSSupportsRule::cssText() const { | 41 String CSSSupportsRule::cssText() const { |
| 42 StringBuilder result; | 42 StringBuilder result; |
| 43 | 43 |
| 44 result.append("@supports "); | 44 result.append("@supports "); |
| 45 result.append(conditionText()); | 45 result.append(conditionText()); |
| 46 result.append(" {\n"); | 46 result.append(" {\n"); |
| 47 appendCSSTextForItems(result); | 47 appendCSSTextForItems(result); |
| 48 result.append('}'); | 48 result.append('}'); |
| 49 | 49 |
| 50 return result.toString(); | 50 return result.toString(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 String CSSSupportsRule::conditionText() const { | |
| 54 return toStyleRuleSupports(m_groupRule.get())->conditionText(); | |
| 55 } | |
| 56 | |
| 57 } // namespace blink | 53 } // namespace blink |
| OLD | NEW |