mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
LibWeb: Record position information in CSS Tokens
This is a requirement to be able to use the Tokens for syntax highlighting.
This commit is contained in:
parent
9a2eecaca4
commit
ecf5368535
Notes:
sideshowbarker
2024-07-18 01:58:56 +09:00
Author: https://github.com/AtkinsSJ
Commit: ecf5368535
Pull-request: https://github.com/SerenityOS/serenity/pull/10563
Reviewed-by: https://github.com/alimpfard ✅
3 changed files with 30 additions and 2 deletions
|
@ -56,6 +56,12 @@ public:
|
|||
Number,
|
||||
};
|
||||
|
||||
struct Position {
|
||||
size_t line { 0 };
|
||||
size_t column { 0 };
|
||||
};
|
||||
|
||||
Type type() const { return m_type; }
|
||||
bool is(Type type) const { return m_type == type; }
|
||||
|
||||
StringView ident() const
|
||||
|
@ -136,6 +142,9 @@ public:
|
|||
|
||||
String to_debug_string() const;
|
||||
|
||||
Position const& start_position() const { return m_start_position; }
|
||||
Position const& end_position() const { return m_end_position; }
|
||||
|
||||
private:
|
||||
Type m_type { Type::Invalid };
|
||||
|
||||
|
@ -143,6 +152,9 @@ private:
|
|||
StringBuilder m_unit;
|
||||
HashType m_hash_type { HashType::Unrestricted };
|
||||
NumberType m_number_type { NumberType::Integer };
|
||||
|
||||
Position m_start_position;
|
||||
Position m_end_position;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue