mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb/CSS: Commit transaction when parsing valid anchor()
I'm honestly not sure how this worked before.
This commit is contained in:
parent
1b1bb3b897
commit
2bbf578737
Notes:
github-actions[bot]
2025-11-03 11:25:14 +00:00
Author: https://github.com/AtkinsSJ
Commit: 2bbf578737
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6646
Reviewed-by: https://github.com/tcl3
1 changed files with 2 additions and 0 deletions
|
|
@ -877,6 +877,7 @@ RefPtr<StyleValue const> Parser::parse_anchor(TokenStream<ComponentValue>& token
|
|||
// <anchor()> = anchor( <anchor-name>? && <anchor-side>, <length-percentage>? )
|
||||
|
||||
auto transaction = tokens.begin_transaction();
|
||||
tokens.discard_whitespace();
|
||||
auto const& function_token = tokens.consume_a_token();
|
||||
if (!function_token.is_function("anchor"sv))
|
||||
return {};
|
||||
|
|
@ -937,6 +938,7 @@ RefPtr<StyleValue const> Parser::parse_anchor(TokenStream<ComponentValue>& token
|
|||
if (!anchor_side_value)
|
||||
return {};
|
||||
|
||||
transaction.commit();
|
||||
return AnchorStyleValue::create(anchor_name, anchor_side_value.release_nonnull(), fallback_value);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue