mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibWeb: Implement getComputedStyle() pseudoElement parameter
Right now, we deviate from the CSSOM spec regarding our CSSStyleDeclaration classes, so this is not as close to the spec as I'd like. But it works, which means we'll be able to test pseudo-element styling a lot more easily. :^)
This commit is contained in:
committed by
Andreas Kling
parent
dae9c9be40
commit
14611de362
Notes:
github-actions[bot]
2024-08-07 14:15:51 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/14611de362d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/994
@@ -7,6 +7,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/CSS/CSSStyleDeclaration.h>
|
||||
#include <LibWeb/CSS/Selector.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
@@ -15,7 +16,7 @@ class ResolvedCSSStyleDeclaration final : public CSSStyleDeclaration {
|
||||
JS_DECLARE_ALLOCATOR(ResolvedCSSStyleDeclaration);
|
||||
|
||||
public:
|
||||
[[nodiscard]] static JS::NonnullGCPtr<ResolvedCSSStyleDeclaration> create(DOM::Element&);
|
||||
[[nodiscard]] static JS::NonnullGCPtr<ResolvedCSSStyleDeclaration> create(DOM::Element&, Optional<Selector::PseudoElement::Type> = {});
|
||||
|
||||
virtual ~ResolvedCSSStyleDeclaration() override = default;
|
||||
|
||||
@@ -32,13 +33,14 @@ public:
|
||||
virtual WebIDL::ExceptionOr<void> set_css_text(StringView) override;
|
||||
|
||||
private:
|
||||
explicit ResolvedCSSStyleDeclaration(DOM::Element&);
|
||||
explicit ResolvedCSSStyleDeclaration(DOM::Element&, Optional<CSS::Selector::PseudoElement::Type>);
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
RefPtr<StyleValue const> style_value_for_property(Layout::NodeWithStyle const&, PropertyID) const;
|
||||
|
||||
JS::NonnullGCPtr<DOM::Element> m_element;
|
||||
Optional<CSS::Selector::PseudoElement::Type> m_pseudo_element;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user