summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Layout/LayoutPosition.cpp
diff options
context:
space:
mode:
authorasynts <asynts@gmail.com>2020-12-01 23:36:12 +0100
committerAndreas Kling <kling@serenityos.org>2020-12-09 21:05:06 +0100
commit43dc47a4941d6aaa99ed847f879b4601094f6d4a (patch)
tree484a4fc15166c7c368018199dbe698ef3c97d818 /Libraries/LibWeb/Layout/LayoutPosition.cpp
parentbbcc5a93321fa34b537e5b635040357c4d49f5d6 (diff)
downloadserenity-43dc47a4941d6aaa99ed847f879b4601094f6d4a.zip
LibWeb: Add support for range deletion.
Diffstat (limited to 'Libraries/LibWeb/Layout/LayoutPosition.cpp')
-rw-r--r--Libraries/LibWeb/Layout/LayoutPosition.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Libraries/LibWeb/Layout/LayoutPosition.cpp b/Libraries/LibWeb/Layout/LayoutPosition.cpp
index b2b46b7343..811e9d5067 100644
--- a/Libraries/LibWeb/Layout/LayoutPosition.cpp
+++ b/Libraries/LibWeb/Layout/LayoutPosition.cpp
@@ -53,4 +53,12 @@ LayoutRange LayoutRange::normalized() const
return { m_end, m_start };
}
+DOM::Range LayoutRange::to_dom_range() const
+{
+ if (!is_valid())
+ return {};
+
+ return { m_start.to_dom_position(), m_end.to_dom_position() };
+}
+
}