mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-04 08:01:51 +00:00
LibWeb/DOM: Rename ElementReference to AbstractElement
This isn't some kind of identifier, it's a handle on an actual Element or PseudoElement.
This commit is contained in:
parent
e7c2f0dd52
commit
ce380a59c7
Notes:
github-actions[bot]
2025-06-19 11:37:42 +00:00
Author: https://github.com/AtkinsSJ
Commit: ce380a59c7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5132
Reviewed-by: https://github.com/tcl3
10 changed files with 73 additions and 23 deletions
37
Libraries/LibWeb/DOM/AbstractElement.h
Normal file
37
Libraries/LibWeb/DOM/AbstractElement.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* Copyright (c) 2025, Sam Atkins <sam@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibGC/Cell.h>
|
||||
#include <LibWeb/CSS/Selector.h>
|
||||
#include <LibWeb/DOM/Element.h>
|
||||
|
||||
namespace Web::DOM {
|
||||
|
||||
// Either an Element or a PseudoElement
|
||||
class AbstractElement {
|
||||
public:
|
||||
AbstractElement(GC::Ref<Element>, Optional<CSS::PseudoElement> = {});
|
||||
|
||||
Element& element() { return m_element; }
|
||||
Element const& element() const { return m_element; }
|
||||
Optional<CSS::PseudoElement> pseudo_element() const { return m_pseudo_element; }
|
||||
|
||||
GC::Ptr<Element const> parent_element() const;
|
||||
GC::Ptr<CSS::ComputedProperties const> computed_properties() const;
|
||||
|
||||
CSS::CountersSet& ensure_counters_set();
|
||||
void set_counters_set(OwnPtr<CSS::CountersSet>&&);
|
||||
|
||||
void visit(GC::Cell::Visitor& visitor) const;
|
||||
|
||||
private:
|
||||
GC::Ref<Element> m_element;
|
||||
Optional<CSS::PseudoElement> m_pseudo_element;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue