| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 116 |
| 117 helper.addCSSRules("div[attr]#id { }"); | 117 helper.addCSSRules("div[attr]#id { }"); |
| 118 RuleSet& ruleSet = helper.ruleSet(); | 118 RuleSet& ruleSet = helper.ruleSet(); |
| 119 AtomicString str("id"); | 119 AtomicString str("id"); |
| 120 const TerminatedArray<RuleData>* rules = ruleSet.idRules(str); | 120 const TerminatedArray<RuleData>* rules = ruleSet.idRules(str); |
| 121 ASSERT_EQ(1u, rules->size()); | 121 ASSERT_EQ(1u, rules->size()); |
| 122 AtomicString tagStr("div"); | 122 AtomicString tagStr("div"); |
| 123 ASSERT_EQ(tagStr, rules->at(0).selector().tagQName().localName()); | 123 ASSERT_EQ(tagStr, rules->at(0).selector().tagQName().localName()); |
| 124 } | 124 } |
| 125 | 125 |
| 126 TEST(RuleSetTest, findBestRuleSetAndAdd_DivWithContent) | |
| 127 { | |
| 128 CSSTestHelper helper; | |
| 129 | |
| 130 helper.addCSSRules("div::content { }"); | |
| 131 RuleSet& ruleSet = helper.ruleSet(); | |
| 132 AtomicString str("div"); | |
| 133 const TerminatedArray<RuleData>* rules = ruleSet.tagRules(str); | |
| 134 ASSERT_EQ(1u, rules->size()); | |
| 135 AtomicString valueStr("content"); | |
| 136 ASSERT_EQ(valueStr, rules->at(0).selector().value()); | |
| 137 } | |
| 138 | |
| 139 } // namespace WebCore | 126 } // namespace WebCore |
| OLD | NEW |