mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:47:34 +00:00
LibWeb: Move get_element_by_id() to a NonElementParentNode mixin class
This matches the current version of the DOM spec. And since C++ doesn't have mixins this is actually a CRTP class.
This commit is contained in:
parent
95cc4c7e74
commit
660ec504ca
5 changed files with 68 additions and 17 deletions
|
@ -37,6 +37,7 @@
|
|||
#include <LibJS/Forward.h>
|
||||
#include <LibWeb/CSS/StyleResolver.h>
|
||||
#include <LibWeb/CSS/StyleSheet.h>
|
||||
#include <LibWeb/DOM/NonElementParentNode.h>
|
||||
#include <LibWeb/DOM/ParentNode.h>
|
||||
|
||||
namespace Web {
|
||||
|
@ -50,7 +51,9 @@ class LayoutNode;
|
|||
class StyleResolver;
|
||||
class StyleSheet;
|
||||
|
||||
class Document : public ParentNode {
|
||||
class Document
|
||||
: public ParentNode
|
||||
, public NonElementParentNode<Document> {
|
||||
public:
|
||||
using WrapperType = Bindings::DocumentWrapper;
|
||||
|
||||
|
@ -119,7 +122,6 @@ public:
|
|||
|
||||
void schedule_style_update();
|
||||
|
||||
const Element* get_element_by_id(const String&) const;
|
||||
Vector<const Element*> get_elements_by_name(const String&) const;
|
||||
|
||||
const String& source() const { return m_source; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue