Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: Source/core/css/RuleSetTest.cpp

Issue 778003003: List marker pseudo elements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 29 matching lines...) Expand all
40 CSSTestHelper helper; 40 CSSTestHelper helper;
41 41
42 helper.addCSSRules("summary::-webkit-details-marker { }"); 42 helper.addCSSRules("summary::-webkit-details-marker { }");
43 RuleSet& ruleSet = helper.ruleSet(); 43 RuleSet& ruleSet = helper.ruleSet();
44 AtomicString str("-webkit-details-marker"); 44 AtomicString str("-webkit-details-marker");
45 const TerminatedArray<RuleData>* rules = ruleSet.shadowPseudoElementRules(st r); 45 const TerminatedArray<RuleData>* rules = ruleSet.shadowPseudoElementRules(st r);
46 ASSERT_EQ(1u, rules->size()); 46 ASSERT_EQ(1u, rules->size());
47 ASSERT_EQ(str, rules->at(0).selector().value()); 47 ASSERT_EQ(str, rules->at(0).selector().value());
48 } 48 }
49 49
50 TEST(RuleSetTest, findBestRuleSetAndAdd_MarkerElementNotAllowedInNonUAStyle)
51 {
52 CSSTestHelper helper;
53
54 helper.tryAddCSSRules("li::marker { }");
55 RuleSet& ruleSet = helper.ruleSet();
56 AtomicString str("li");
57 const TerminatedArray<RuleData>* rules = ruleSet.tagRules(str);
58 ASSERT_EQ(0u, rules->size());
59 }
Julien - ping for review 2015/02/04 01:56:33 We should split this fix / test outside of this ch
dsinclair 2015/02/04 04:41:32 This is the test for UA only pseudo elements. That
60
50 TEST(RuleSetTest, findBestRuleSetAndAdd_Id) 61 TEST(RuleSetTest, findBestRuleSetAndAdd_Id)
51 { 62 {
52 CSSTestHelper helper; 63 CSSTestHelper helper;
53 64
54 helper.addCSSRules("#id { }"); 65 helper.addCSSRules("#id { }");
55 RuleSet& ruleSet = helper.ruleSet(); 66 RuleSet& ruleSet = helper.ruleSet();
56 AtomicString str("id"); 67 AtomicString str("id");
57 const TerminatedArray<RuleData>* rules = ruleSet.idRules(str); 68 const TerminatedArray<RuleData>* rules = ruleSet.idRules(str);
58 ASSERT_EQ(1u, rules->size()); 69 ASSERT_EQ(1u, rules->size());
59 ASSERT_EQ(str, rules->at(0).selector().value()); 70 ASSERT_EQ(str, rules->at(0).selector().value());
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 { 215 {
205 CSSTestHelper helper; 216 CSSTestHelper helper;
206 217
207 helper.addCSSRules(".foo:host-context(*) { }"); 218 helper.addCSSRules(".foo:host-context(*) { }");
208 RuleSet& ruleSet = helper.ruleSet(); 219 RuleSet& ruleSet = helper.ruleSet();
209 const WillBeHeapVector<RuleData>* rules = ruleSet.shadowHostRules(); 220 const WillBeHeapVector<RuleData>* rules = ruleSet.shadowHostRules();
210 ASSERT_EQ(0u, rules->size()); 221 ASSERT_EQ(0u, rules->size());
211 } 222 }
212 223
213 } // namespace blink 224 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698