Commit graph

13 commits

Author SHA1 Message Date
Sam Atkins
431a9938a8 LibWeb: Rename StyleRule -> Rule
This name is what's used in the spec, and is a little less confusing.
2022-04-12 23:03:46 +02:00
Sam Atkins
cf24dc2e0c LibWeb: Break friendship between CSS StyleRule and Parser
As before, this requires deviating from the spec slightly to create the
StyleRule fully-formed instead of creating it empty and then modifying
its internals.
2022-04-12 23:03:46 +02:00
Sam Atkins
4bdfc2bb32 LibWeb: Make StyleRule.m_at_rule_name a FlyString 2022-04-12 23:03:46 +02:00
Sam Atkins
7272997b1b LibWeb: Move StyleRule to Parser namespace 2022-04-12 23:03:46 +02:00
Sam Atkins
3e49036edf LibWeb: Move/rename StyleBlockRule to Parser::Block 2022-04-12 23:03:46 +02:00
Sam Atkins
fff2c35f51 LibWeb: Move ComponentValue to CSS::Parser namespace 2022-04-12 23:03:46 +02:00
Sam Atkins
c449cabae3 LibWeb: Move CSS Parser into new Web::CSS::Parser namespace
The goal here is to move the parser-internal classes into this namespace
so they can have more convenient names without causing collisions. The
Parser itself won't collide, and would be more convenient to just
remain `CSS::Parser`, but having a namespace and a class with the same
name makes C++ unhappy.
2022-04-12 23:03:46 +02:00
Sam Atkins
8b538b1578 LibWeb: Rename StyleComponentValueRule -> ComponentValue
"Component value" is the term used in the spec, and it doesn't conflict
 with any other types, so let's use the shorter name. :^)

Also, this doesn't need to be friends with the Parser any more.
2022-04-07 21:20:14 +02:00
Sam Atkins
6a0adbefc7 LibWeb: Tidy up StyleRule API
Constantly accessing private `m_foo` fields feels uncomfortable and
doesn't fit well with our code style.
2022-03-30 18:43:07 +02:00
Hendiadyoin1
89086c337c LibWeb: Fix constness of return type from StyleRule::block()
We want to return a view to a constant object, not a constant view,
which we can implicitly copy to get a mutable reference to the object.

Clang-Tidy helpfully pointed this out.
2022-03-21 12:49:00 +01:00
Guilherme Gonçalves
a456759d7a LibWeb: Ignore malformed at-rules in CSS parser
Fixes #12405.
2022-02-12 11:24:17 +01:00
Sam Atkins
e2c32a6c65 Everywhere: Use my shiny new serenityos.org email :^) 2021-09-03 12:22:36 +02:00
Sam Atkins
82d12b170a LibWeb: Merge CSS Parser's QualifiedStyleRule and AtStyleRule
AtStyleRule being a subclass of QualifiedStyleRule was causing
problems when trying to distinguish between them. Combining them
and then distinguishing between them with a Type enum makes that
check simpler, and is in line with how similar checks are done
elsewhere in the parser.
2021-07-11 23:19:56 +02:00
Renamed from Userland/Libraries/LibWeb/CSS/Parser/QualifiedStyleRule.h (Browse further)