mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-07 10:06:03 +00:00
LibWeb: Port text segmentation to the ICU text segmenter
This commit is contained in:
parent
14071c52f9
commit
12f177e9e9
Notes:
sideshowbarker
2024-07-17 03:27:40 +09:00
Author: https://github.com/trflynn89
Commit: 12f177e9e9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/218
5 changed files with 40 additions and 20 deletions
|
@ -7,6 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <LibLocale/Forward.h>
|
||||
#include <LibWeb/DOM/ChildNode.h>
|
||||
#include <LibWeb/DOM/Node.h>
|
||||
#include <LibWeb/DOM/NonDocumentTypeChildNode.h>
|
||||
|
@ -22,7 +23,7 @@ class CharacterData
|
|||
JS_DECLARE_ALLOCATOR(CharacterData);
|
||||
|
||||
public:
|
||||
virtual ~CharacterData() override = default;
|
||||
virtual ~CharacterData() override;
|
||||
|
||||
String const& data() const { return m_data; }
|
||||
void set_data(String const&);
|
||||
|
@ -40,6 +41,8 @@ public:
|
|||
WebIDL::ExceptionOr<void> delete_data(size_t offset_in_utf16_code_units, size_t count_in_utf16_code_units);
|
||||
WebIDL::ExceptionOr<void> replace_data(size_t offset_in_utf16_code_units, size_t count_in_utf16_code_units, String const&);
|
||||
|
||||
Locale::Segmenter& segmenter();
|
||||
|
||||
protected:
|
||||
CharacterData(Document&, NodeType, String const&);
|
||||
|
||||
|
@ -47,6 +50,8 @@ protected:
|
|||
|
||||
private:
|
||||
String m_data;
|
||||
|
||||
OwnPtr<Locale::Segmenter> m_segmenter;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue