mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:58:12 +00:00
Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch moves the Lib*/ directories into Libraries/.
This commit is contained in:
parent
63814ffebf
commit
04b9dc2d30
328 changed files with 36 additions and 36 deletions
35
Libraries/LibHTML/CSS/Selector.cpp
Normal file
35
Libraries/LibHTML/CSS/Selector.cpp
Normal file
|
@ -0,0 +1,35 @@
|
|||
#include <LibHTML/CSS/Selector.h>
|
||||
|
||||
Selector::Selector(Vector<Component>&& components)
|
||||
: m_components(move(components))
|
||||
{
|
||||
}
|
||||
|
||||
Selector::~Selector()
|
||||
{
|
||||
}
|
||||
|
||||
Specificity Selector::specificity() const
|
||||
{
|
||||
unsigned ids = 0;
|
||||
unsigned tag_names = 0;
|
||||
unsigned classes = 0;
|
||||
|
||||
for (auto& component : m_components) {
|
||||
switch (component.type) {
|
||||
case Component::Type::Id:
|
||||
++ids;
|
||||
break;
|
||||
case Component::Type::Class:
|
||||
++classes;
|
||||
break;
|
||||
case Component::Type::TagName:
|
||||
++tag_names;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return { ids, classes, tag_names };
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue