1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:37:45 +00:00

LibWeb: Add LayoutRange::normalized()

We use this to ensure that we're always working with a selection where
the start() is before the end() in document order. That simplifies all
the logic around this.
This commit is contained in:
Andreas Kling 2020-06-29 00:24:35 +02:00
parent 706fc3d1aa
commit 9177eea8fe
5 changed files with 61 additions and 1 deletions

View file

@ -78,6 +78,8 @@ public:
const LayoutPosition& start() const { return m_start; }
const LayoutPosition& end() const { return m_end; }
LayoutRange normalized() const;
private:
LayoutPosition m_start;
LayoutPosition m_end;