ladybird/Userland/Libraries/LibWeb/DOM/Text.h
Andreas Kling 7e1bf4d300 LibWeb: Compute element style in Layout::TreeBuilder
Instead of making each Layout::Node compute style for itself, we now
compute it in TreeBuilder before even calling create_layout_node().

For non-element DOM nodes, we create the style and layout tree node
in TreeBuilder. This allows us to move create_layout_node() from
DOM::Node to DOM::Element.
2022-02-05 22:50:39 +01:00

34 lines
835 B
C++

/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/FlyString.h>
#include <AK/String.h>
#include <LibWeb/DOM/CharacterData.h>
namespace Web::DOM {
class Text final : public CharacterData {
public:
using WrapperType = Bindings::TextWrapper;
explicit Text(Document&, const String&);
virtual ~Text() override;
static NonnullRefPtr<Text> create_with_global_object(Bindings::WindowObject& window, String const& data);
// ^Node
virtual FlyString node_name() const override { return "#text"; }
virtual bool is_editable() const override { return m_always_editable || CharacterData::is_editable(); }
void set_always_editable(bool b) { m_always_editable = b; }
private:
bool m_always_editable { false };
};
}