mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 19:19:30 +00:00
LibWeb/CSS: Make CSS Parser non-copyable/movable
We never actually need to do this, and doing so was complicated because of the token stream, so just disable it altogether.
This commit is contained in:
parent
ca5dee4c55
commit
4d0537ee80
Notes:
github-actions[bot]
2025-02-06 16:48:56 +00:00
Author: https://github.com/AtkinsSJ
Commit: 4d0537ee80
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3464
Reviewed-by: https://github.com/ADKaster
2 changed files with 0 additions and 17 deletions
|
@ -43,18 +43,6 @@ Parser::Parser(ParsingContext const& context, Vector<Token> tokens)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Parser::Parser(Parser&& other)
|
|
||||||
: m_context(other.m_context)
|
|
||||||
, m_tokens(move(other.m_tokens))
|
|
||||||
, m_token_stream(m_tokens)
|
|
||||||
{
|
|
||||||
// Moving the TokenStream directly from `other` would break it, because TokenStream holds
|
|
||||||
// a reference to the Vector<Token>, so it would be pointing at the old Parser's tokens.
|
|
||||||
// So instead, we create a new TokenStream from this Parser's tokens, and then tell it to
|
|
||||||
// copy the other TokenStream's state. This is quite hacky.
|
|
||||||
m_token_stream.copy_state({}, other.m_token_stream);
|
|
||||||
}
|
|
||||||
|
|
||||||
// https://drafts.csswg.org/css-syntax/#parse-stylesheet
|
// https://drafts.csswg.org/css-syntax/#parse-stylesheet
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Parser::ParsedStyleSheet Parser::parse_a_stylesheet(TokenStream<T>& input, Optional<URL::URL> location)
|
Parser::ParsedStyleSheet Parser::parse_a_stylesheet(TokenStream<T>& input, Optional<URL::URL> location)
|
||||||
|
|
|
@ -189,11 +189,6 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void copy_state(Badge<Parser>, TokenStream<T> const& other)
|
|
||||||
{
|
|
||||||
m_index = other.m_index;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// https://drafts.csswg.org/css-syntax/#token-stream-tokens
|
// https://drafts.csswg.org/css-syntax/#token-stream-tokens
|
||||||
Span<T const> m_tokens;
|
Span<T const> m_tokens;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue