mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-05 00:56:39 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
62
Libraries/LibWeb/DOM/Text.h
Normal file
62
Libraries/LibWeb/DOM/Text.h
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <andreas@ladybird.org>
|
||||
* Copyright (c) 2023, Sam Atkins <atkinssj@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/DOM/CharacterData.h>
|
||||
#include <LibWeb/DOM/Element.h>
|
||||
#include <LibWeb/DOM/Slottable.h>
|
||||
|
||||
namespace Web::DOM {
|
||||
|
||||
class Text
|
||||
: public CharacterData
|
||||
, public SlottableMixin {
|
||||
WEB_PLATFORM_OBJECT(Text, CharacterData);
|
||||
JS_DECLARE_ALLOCATOR(Text);
|
||||
|
||||
public:
|
||||
virtual ~Text() override = default;
|
||||
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<Text>> construct_impl(JS::Realm& realm, String const& data);
|
||||
|
||||
// ^Node
|
||||
virtual FlyString node_name() const override { return "#text"_fly_string; }
|
||||
virtual bool is_editable() const override { return m_always_editable || CharacterData::is_editable(); }
|
||||
|
||||
void set_always_editable(bool b) { m_always_editable = b; }
|
||||
|
||||
Optional<size_t> max_length() const { return m_max_length; }
|
||||
void set_max_length(Optional<size_t> max_length) { m_max_length = move(max_length); }
|
||||
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<Text>> split_text(size_t offset);
|
||||
String whole_text();
|
||||
|
||||
bool is_password_input() const { return m_is_password_input; }
|
||||
void set_is_password_input(Badge<HTML::HTMLInputElement>, bool b) { m_is_password_input = b; }
|
||||
|
||||
Optional<Element::Directionality> directionality() const;
|
||||
|
||||
protected:
|
||||
Text(Document&, String const&);
|
||||
Text(Document&, NodeType, String const&);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
private:
|
||||
JS::GCPtr<Element> m_owner;
|
||||
|
||||
bool m_always_editable { false };
|
||||
Optional<size_t> m_max_length {};
|
||||
bool m_is_password_input { false };
|
||||
};
|
||||
|
||||
template<>
|
||||
inline bool Node::fast_is<Text>() const { return is_text(); }
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue