140 L"a { border: 10px; }\n"
141 L"bcdef { text-decoration: underline; }\n"
142 L"* { padding: 0; }\n";
143 EXPECT_TRUE(sheet_->LoadBuffer(buf));
144 ASSERT_EQ(3u, sheet_->CountRules());
148 EXPECT_EQ(1u, style->CountSelectorLists());
149 EXPECT_TRUE(HasSelector(style, L"a"));
151 decl_ = style->GetDeclaration();
153 EXPECT_EQ(4u, decl_->PropertyCountForTesting());
164 style = sheet_->GetRule(1);
166 EXPECT_EQ(1u, style->CountSelectorLists());
167 EXPECT_TRUE(HasSelector(style, L"bcdef"));
168 EXPECT_FALSE(HasSelector(style, L"bcde"));
170 decl_ = style->GetDeclaration();
172 EXPECT_EQ(1u, decl_->PropertyCountForTesting());
176 style = sheet_->GetRule(2);
178 EXPECT_EQ(1u, style->CountSelectorLists());
179 EXPECT_TRUE(HasSelector(style, L"*"));
181 decl_ = style->GetDeclaration();
183 EXPECT_EQ(4u, decl_->PropertyCountForTesting());
195 const wchar_t* buf = L"a b c { border: 10px; }";
196 EXPECT_TRUE(sheet_->LoadBuffer(buf));
197 EXPECT_EQ(1u, sheet_->CountRules());
201 EXPECT_EQ(1u, style->CountSelectorLists());
203 const auto* sel = style->GetSelectorList(0);
205 EXPECT_EQ(FX_HashCode_GetLoweredW(L"c"), sel->name_hash());
207 sel = sel->next_selector();
209 EXPECT_EQ(FX_HashCode_GetLoweredW(L"b"), sel->name_hash());
211 sel = sel->next_selector();
213 EXPECT_EQ(FX_HashCode_GetLoweredW(L"a"), sel->name_hash());
215 sel = sel->next_selector();
218 decl_ = style->GetDeclaration();
220 EXPECT_EQ(4u, decl_->PropertyCountForTesting());
233 const wchar_t* buf = L"a > b { padding: 0; }";
234 EXPECT_TRUE(sheet_->LoadBuffer(buf));
235 EXPECT_EQ(0u, sheet_->CountRules());
237 buf = L"a[first] { 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());
245 buf = L"a ^ b { padding: 0; }";
246 EXPECT_TRUE(sheet_->LoadBuffer(buf));
247 EXPECT_EQ(0u, sheet_->CountRules());