138 L"a { border: 10px; }\n"
139 L"bcdef { text-decoration: underline; }\n"
140 L"* { padding: 0; }\n";
141 EXPECT_TRUE(sheet_->LoadBuffer(buf));
142 ASSERT_EQ(3u, sheet_->CountRules());
146 EXPECT_EQ(1u, style->CountSelectorLists());
147 EXPECT_TRUE(HasSelector(style, L"a"));
149 decl_ = style->GetDeclaration();
151 EXPECT_EQ(4u, decl_->PropertyCountForTesting());
162 style = sheet_->GetRule(1);
164 EXPECT_EQ(1u, style->CountSelectorLists());
165 EXPECT_TRUE(HasSelector(style, L"bcdef"));
166 EXPECT_FALSE(HasSelector(style, L"bcde"));
168 decl_ = style->GetDeclaration();
170 EXPECT_EQ(1u, decl_->PropertyCountForTesting());
174 style = sheet_->GetRule(2);
176 EXPECT_EQ(1u, style->CountSelectorLists());
177 EXPECT_TRUE(HasSelector(style, L"*"));
179 decl_ = style->GetDeclaration();
181 EXPECT_EQ(4u, decl_->PropertyCountForTesting());
191 const wchar_t* buf = L"a b c { border: 10px; }";
192 EXPECT_TRUE(sheet_->LoadBuffer(buf));
193 EXPECT_EQ(1u, sheet_->CountRules());
197 EXPECT_EQ(1u, style->CountSelectorLists());
199 const auto* sel = style->GetSelectorList(0);
201 EXPECT_EQ(FX_HashCode_GetLoweredW(L"c"), sel->name_hash());
203 sel = sel->next_selector();
205 EXPECT_EQ(FX_HashCode_GetLoweredW(L"b"), sel->name_hash());
207 sel = sel->next_selector();
209 EXPECT_EQ(FX_HashCode_GetLoweredW(L"a"), sel->name_hash());
211 sel = sel->next_selector();
214 decl_ = style->GetDeclaration();
216 EXPECT_EQ(4u, decl_->PropertyCountForTesting());
229 const wchar_t* buf = L"a > b { padding: 0; }";
230 EXPECT_TRUE(sheet_->LoadBuffer(buf));
231 EXPECT_EQ(0u, sheet_->CountRules());
233 buf = L"a[first] { padding: 0; }";
234 EXPECT_TRUE(sheet_->LoadBuffer(buf));
235 EXPECT_EQ(0u, sheet_->CountRules());
237 buf = L"a+b { padding: 0; }";
238 EXPECT_TRUE(sheet_->LoadBuffer(buf));
239 EXPECT_EQ(0u, sheet_->CountRules());
241 buf = L"a ^ b { padding: 0; }";
242 EXPECT_TRUE(sheet_->LoadBuffer(buf));
243 EXPECT_EQ(0u, sheet_->CountRules());