LibWeb/CSS: Stop invalidating style when setting an animation's effect
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run

This reverts 6d25bf3aac

Invalidating the style here means that transitions can cause an element
to leave style computation with its "needs style update" flag set to
true. This then causes a VERIFY to fail in the TreeBuilder.

This invalidation does not otherwise seem to have any effect. The
original commit suggests this was to fix a bug, but it's not clear what
bug that was. If it reappears, we can try to solve the issue in a
different way.
This commit is contained in:
Sam Atkins 2024-10-01 14:35:24 +01:00 committed by Tim Flynn
parent 63d9ed9d8c
commit 81596b4145
Notes: github-actions[bot] 2024-10-15 12:44:23 +00:00
4 changed files with 19 additions and 4 deletions

View file

@ -0,0 +1 @@
PASS (didn't crash)

View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<script src="../include.js"></script>
<style>
.foo {
opacity: 0;
transition: opacity 200ms;
}
</style>
<ul>
<li class="foo"></li>
<li></li>
</ul>
<video src=""></video>
<script>
test(() => {
println("PASS (didn't crash)");
});
</script>

View file

@ -11,7 +11,6 @@
#include <LibWeb/Bindings/AnimationEffectPrototype.h>
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/CSS/Parser/Parser.h>
#include <LibWeb/DOM/Element.h>
#include <LibWeb/WebIDL/ExceptionOr.h>
namespace Web::Animations {
@ -205,8 +204,6 @@ WebIDL::ExceptionOr<void> AnimationEffect::update_timing(OptionalEffectTiming ti
void AnimationEffect::set_associated_animation(JS::GCPtr<Animation> value)
{
m_associated_animation = value;
if (auto* target = this->target())
target->invalidate_style(DOM::StyleInvalidationReason::AnimationEffectSetAssociatedAnimation);
}
// https://www.w3.org/TR/web-animations-1/#animation-direction

View file

@ -54,7 +54,6 @@ enum class FragmentSerializationMode {
#define ENUMERATE_STYLE_INVALIDATION_REASONS(X) \
X(AdoptedStyleSheetsList) \
X(AnimationEffectSetAssociatedAnimation) \
X(CSSFontLoaded) \
X(CSSImportRule) \
X(DidLoseFocus) \