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:
Sam Atkins 2025-02-04 16:31:30 +00:00
parent ca5dee4c55
commit 4d0537ee80
Notes: github-actions[bot] 2025-02-06 16:48:56 +00:00
2 changed files with 0 additions and 17 deletions

View file

@ -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
template<typename T>
Parser::ParsedStyleSheet Parser::parse_a_stylesheet(TokenStream<T>& input, Optional<URL::URL> location)

View file

@ -189,11 +189,6 @@ public:
}
}
void copy_state(Badge<Parser>, TokenStream<T> const& other)
{
m_index = other.m_index;
}
private:
// https://drafts.csswg.org/css-syntax/#token-stream-tokens
Span<T const> m_tokens;