diff options
author | Andreas Kling <kling@serenityos.org> | 2021-03-13 20:11:33 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-13 22:41:32 +0100 |
commit | 0759f54bd33f3900c094f27d81481da76b9b4a03 (patch) | |
tree | 8967e6685c88d4107102f3aa2e3d57bce4f9b18e | |
parent | e44fbbe5c0959e257f29852f82b7bcc772112d01 (diff) | |
download | serenity-0759f54bd33f3900c094f27d81481da76b9b4a03.zip |
LibWeb: Rename StyleDeclaration => CSSStyleDeclaration to match CSSOM
-rw-r--r-- | Userland/Libraries/LibWeb/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/CSSRule.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp (renamed from Userland/Libraries/LibWeb/CSS/StyleDeclaration.cpp) | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h (renamed from Userland/Libraries/LibWeb/CSS/StyleDeclaration.h) | 10 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/CSSStyleRule.h | 10 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp | 10 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Element.h | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Forward.h | 2 |
10 files changed, 25 insertions, 25 deletions
diff --git a/Userland/Libraries/LibWeb/CMakeLists.txt b/Userland/Libraries/LibWeb/CMakeLists.txt index 7e219dc4a8..ea774a9bc7 100644 --- a/Userland/Libraries/LibWeb/CMakeLists.txt +++ b/Userland/Libraries/LibWeb/CMakeLists.txt @@ -11,6 +11,7 @@ set(SOURCES Bindings/Wrappable.cpp CSS/CSSImportRule.cpp CSS/CSSRule.cpp + CSS/CSSStyleDeclaration.cpp CSS/CSSStyleRule.cpp CSS/CSSStyleSheet.cpp CSS/DefaultStyleSheetSource.cpp @@ -24,7 +25,6 @@ set(SOURCES CSS/QuirksModeStyleSheetSource.cpp CSS/Selector.cpp CSS/SelectorEngine.cpp - CSS/StyleDeclaration.cpp CSS/StyleInvalidator.cpp CSS/StyleProperties.cpp CSS/StyleResolver.cpp diff --git a/Userland/Libraries/LibWeb/CSS/CSSRule.h b/Userland/Libraries/LibWeb/CSS/CSSRule.h index de2a365252..63fa5c1868 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSRule.h @@ -28,8 +28,8 @@ #include <AK/RefCounted.h> #include <AK/String.h> +#include <LibWeb/CSS/CSSStyleDeclaration.h> #include <LibWeb/CSS/Selector.h> -#include <LibWeb/CSS/StyleDeclaration.h> namespace Web::CSS { diff --git a/Userland/Libraries/LibWeb/CSS/StyleDeclaration.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp index eb56b94625..04b291298a 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleDeclaration.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp @@ -24,16 +24,16 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <LibWeb/CSS/StyleDeclaration.h> +#include <LibWeb/CSS/CSSStyleDeclaration.h> namespace Web::CSS { -StyleDeclaration::StyleDeclaration(Vector<StyleProperty>&& properties) +CSSStyleDeclaration::CSSStyleDeclaration(Vector<StyleProperty>&& properties) : m_properties(move(properties)) { } -StyleDeclaration::~StyleDeclaration() +CSSStyleDeclaration::~CSSStyleDeclaration() { } diff --git a/Userland/Libraries/LibWeb/CSS/StyleDeclaration.h b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h index 787429eb15..b81b08dcdc 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleDeclaration.h +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.h @@ -38,19 +38,19 @@ struct StyleProperty { bool important { false }; }; -class StyleDeclaration : public RefCounted<StyleDeclaration> { +class CSSStyleDeclaration : public RefCounted<CSSStyleDeclaration> { public: - static NonnullRefPtr<StyleDeclaration> create(Vector<StyleProperty>&& properties) + static NonnullRefPtr<CSSStyleDeclaration> create(Vector<StyleProperty>&& properties) { - return adopt(*new StyleDeclaration(move(properties))); + return adopt(*new CSSStyleDeclaration(move(properties))); } - ~StyleDeclaration(); + ~CSSStyleDeclaration(); const Vector<StyleProperty>& properties() const { return m_properties; } private: - explicit StyleDeclaration(Vector<StyleProperty>&&); + explicit CSSStyleDeclaration(Vector<StyleProperty>&&); Vector<StyleProperty> m_properties; }; diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp index daaf83d467..72e3791deb 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp @@ -28,7 +28,7 @@ namespace Web::CSS { -CSSStyleRule::CSSStyleRule(Vector<Selector>&& selectors, NonnullRefPtr<StyleDeclaration>&& declaration) +CSSStyleRule::CSSStyleRule(Vector<Selector>&& selectors, NonnullRefPtr<CSSStyleDeclaration>&& declaration) : m_selectors(move(selectors)) , m_declaration(move(declaration)) { diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.h b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.h index bfee3c0b6d..e8db816f6c 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.h @@ -29,8 +29,8 @@ #include <AK/NonnullRefPtrVector.h> #include <LibWeb/CSS/CSSRule.h> +#include <LibWeb/CSS/CSSStyleDeclaration.h> #include <LibWeb/CSS/Selector.h> -#include <LibWeb/CSS/StyleDeclaration.h> namespace Web::CSS { @@ -39,7 +39,7 @@ class CSSStyleRule : public CSSRule { AK_MAKE_NONMOVABLE(CSSStyleRule); public: - static NonnullRefPtr<CSSStyleRule> create(Vector<Selector>&& selectors, NonnullRefPtr<StyleDeclaration>&& declaration) + static NonnullRefPtr<CSSStyleRule> create(Vector<Selector>&& selectors, NonnullRefPtr<CSSStyleDeclaration>&& declaration) { return adopt(*new CSSStyleRule(move(selectors), move(declaration))); } @@ -47,16 +47,16 @@ public: ~CSSStyleRule(); const Vector<Selector>& selectors() const { return m_selectors; } - const StyleDeclaration& declaration() const { return m_declaration; } + const CSSStyleDeclaration& declaration() const { return m_declaration; } virtual StringView class_name() const { return "CSSStyleRule"; }; virtual Type type() const { return Type::Style; }; private: - CSSStyleRule(Vector<Selector>&&, NonnullRefPtr<StyleDeclaration>&&); + CSSStyleRule(Vector<Selector>&&, NonnullRefPtr<CSSStyleDeclaration>&&); Vector<Selector> m_selectors; - NonnullRefPtr<StyleDeclaration> m_declaration; + NonnullRefPtr<CSSStyleDeclaration> m_declaration; }; } diff --git a/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp index f565186ef2..3c6b0e15f3 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp @@ -808,7 +808,7 @@ public: return; } - rules.append(CSS::CSSStyleRule::create(move(current_rule.selectors), CSS::StyleDeclaration::create(move(current_rule.properties)))); + rules.append(CSS::CSSStyleRule::create(move(current_rule.selectors), CSS::CSSStyleDeclaration::create(move(current_rule.properties)))); } Optional<String> parse_string() @@ -947,7 +947,7 @@ public: return CSS::CSSStyleSheet::create(move(rules)); } - RefPtr<CSS::StyleDeclaration> parse_standalone_declaration() + RefPtr<CSS::CSSStyleDeclaration> parse_standalone_declaration() { consume_whitespace_or_comments(); for (;;) { @@ -958,7 +958,7 @@ public: if (!peek()) break; } - return CSS::StyleDeclaration::create(move(current_rule.properties)); + return CSS::CSSStyleDeclaration::create(move(current_rule.properties)); } private: @@ -993,10 +993,10 @@ RefPtr<CSS::CSSStyleSheet> parse_css(const CSS::ParsingContext& context, const S return parser.parse_sheet(); } -RefPtr<CSS::StyleDeclaration> parse_css_declaration(const CSS::ParsingContext& context, const StringView& css) +RefPtr<CSS::CSSStyleDeclaration> parse_css_declaration(const CSS::ParsingContext& context, const StringView& css) { if (css.is_empty()) - return CSS::StyleDeclaration::create({}); + return CSS::CSSStyleDeclaration::create({}); CSSParser parser(context, css); return parser.parse_standalone_declaration(); } diff --git a/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.h b/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.h index bf1da4229e..e03c83ba59 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.h @@ -49,7 +49,7 @@ private: namespace Web { RefPtr<CSS::CSSStyleSheet> parse_css(const CSS::ParsingContext&, const StringView&); -RefPtr<CSS::StyleDeclaration> parse_css_declaration(const CSS::ParsingContext&, const StringView&); +RefPtr<CSS::CSSStyleDeclaration> parse_css_declaration(const CSS::ParsingContext&, const StringView&); RefPtr<CSS::StyleValue> parse_css_value(const CSS::ParsingContext&, const StringView&, CSS::PropertyID property_id = CSS::PropertyID::Invalid); Optional<CSS::Selector> parse_selector(const CSS::ParsingContext&, const StringView&); diff --git a/Userland/Libraries/LibWeb/DOM/Element.h b/Userland/Libraries/LibWeb/DOM/Element.h index a9462caf5b..fdafd19fd8 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.h +++ b/Userland/Libraries/LibWeb/DOM/Element.h @@ -90,7 +90,7 @@ public: const CSS::StyleProperties* specified_css_values() const { return m_specified_css_values.ptr(); } NonnullRefPtr<CSS::StyleProperties> computed_style(); - const CSS::StyleDeclaration* inline_style() const { return m_inline_style; } + const CSS::CSSStyleDeclaration* inline_style() const { return m_inline_style; } // FIXME: innerHTML also appears on shadow roots. https://w3c.github.io/DOM-Parsing/#dom-innerhtml String inner_html() const; @@ -116,7 +116,7 @@ private: QualifiedName m_qualified_name; Vector<Attribute> m_attributes; - RefPtr<CSS::StyleDeclaration> m_inline_style; + RefPtr<CSS::CSSStyleDeclaration> m_inline_style; RefPtr<CSS::StyleProperties> m_specified_css_values; diff --git a/Userland/Libraries/LibWeb/Forward.h b/Userland/Libraries/LibWeb/Forward.h index 5a90a41bb0..3b8e4c4222 100644 --- a/Userland/Libraries/LibWeb/Forward.h +++ b/Userland/Libraries/LibWeb/Forward.h @@ -30,11 +30,11 @@ namespace Web::CSS { class CSSRule; class CSSImportRule; +class CSSStyleDeclaration; class CSSStyleRule; class CSSStyleSheet; class Length; class Selector; -class StyleDeclaration; class StyleProperties; class StyleResolver; class StyleSheet; |