OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014, Google Inc. All rights reserved. | 2 * Copyright (c) 2014, Google 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
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 copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 { | 43 { |
44 } | 44 } |
45 | 45 |
46 CSSTestHelper::CSSTestHelper() | 46 CSSTestHelper::CSSTestHelper() |
47 { | 47 { |
48 m_document = Document::create(); | 48 m_document = Document::create(); |
49 TextPosition position; | 49 TextPosition position; |
50 m_styleSheet = CSSStyleSheet::createInline(m_document.get(), KURL(), positio
n, "UTF-8"); | 50 m_styleSheet = CSSStyleSheet::createInline(m_document.get(), KURL(), positio
n, "UTF-8"); |
51 } | 51 } |
52 | 52 |
| 53 CSSRuleList* CSSTestHelper::cssRules() |
| 54 { |
| 55 return m_styleSheet->cssRules().get(); |
| 56 } |
| 57 |
53 RuleSet& CSSTestHelper::ruleSet() | 58 RuleSet& CSSTestHelper::ruleSet() |
54 { | 59 { |
55 RuleSet& ruleSet = m_styleSheet->contents()->ensureRuleSet(MediaQueryEvaluat
or(), RuleHasNoSpecialState); | 60 RuleSet& ruleSet = m_styleSheet->contents()->ensureRuleSet(MediaQueryEvaluat
or(), RuleHasNoSpecialState); |
56 ruleSet.compactRulesIfNeeded(); | 61 ruleSet.compactRulesIfNeeded(); |
57 return ruleSet; | 62 return ruleSet; |
58 } | 63 } |
59 | 64 |
60 void CSSTestHelper::addCSSRules(const char* cssText) | 65 void CSSTestHelper::addCSSRules(const char* cssText) |
61 { | 66 { |
62 TextPosition position; | 67 TextPosition position; |
63 unsigned sheetLength = m_styleSheet->length(); | 68 unsigned sheetLength = m_styleSheet->length(); |
64 m_styleSheet->contents()->parseStringAtPosition(cssText, position); | 69 m_styleSheet->contents()->parseStringAtPosition(cssText, position); |
65 ASSERT_TRUE(m_styleSheet->length() > sheetLength); | 70 ASSERT_TRUE(m_styleSheet->length() > sheetLength); |
66 } | 71 } |
67 | 72 |
68 } // namespace blink | 73 } // namespace blink |
OLD | NEW |