mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 08:17:35 +00:00
LibWeb: Use any_of() for DOM::Element::has_class()
This commit is contained in:
parent
7c6de80e81
commit
e6712fcd82
1 changed files with 2 additions and 5 deletions
|
@ -24,6 +24,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <AK/AnyOf.h>
|
||||||
#include <AK/StringBuilder.h>
|
#include <AK/StringBuilder.h>
|
||||||
#include <LibWeb/CSS/Length.h>
|
#include <LibWeb/CSS/Length.h>
|
||||||
#include <LibWeb/CSS/Parser/CSSParser.h>
|
#include <LibWeb/CSS/Parser/CSSParser.h>
|
||||||
|
@ -104,11 +105,7 @@ void Element::remove_attribute(const FlyString& name)
|
||||||
|
|
||||||
bool Element::has_class(const FlyString& class_name) const
|
bool Element::has_class(const FlyString& class_name) const
|
||||||
{
|
{
|
||||||
for (auto& class_ : m_classes) {
|
return any_of(m_classes.begin(), m_classes.end(), [&](auto& it) { return it == class_name; });
|
||||||
if (class_ == class_name)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<Layout::Node> Element::create_layout_node()
|
RefPtr<Layout::Node> Element::create_layout_node()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue