mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Make transition order return -1 and 1 instead of 0 and 1
The old behavior was plain incorrect for a sorting function.
This commit is contained in:
parent
2c4f2a3cb6
commit
e0b5bd7894
Notes:
github-actions[bot]
2025-11-11 20:58:52 +00:00
Author: https://github.com/Psychpsyo
Commit: e0b5bd7894
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6795
Reviewed-by: https://github.com/gmta ✅
3 changed files with 8 additions and 5 deletions
|
|
@ -78,7 +78,7 @@ int CSSTransition::class_specific_composite_order(GC::Ref<Animations::Animation>
|
|||
// property name of each transition (i.e. without attempting case conversion and such that ‘-moz-column-width’
|
||||
// sorts before ‘column-width’).
|
||||
// FIXME: This should operate on Unicode strings, not StringViews.
|
||||
return transition_property() > other->transition_property();
|
||||
return transition_property().compare(other->transition_property());
|
||||
}
|
||||
|
||||
CSSTransition::CSSTransition(JS::Realm& realm, DOM::AbstractElement abstract_element, PropertyID property_id, size_t transition_generation,
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Order: left, right, top
|
||||
Order: bottom, height, left, right, top, width
|
||||
|
|
|
|||
|
|
@ -2,20 +2,23 @@
|
|||
<html>
|
||||
<style>
|
||||
#foo {
|
||||
transition-property: top, left, right;
|
||||
transition-property: top, right, left, width, height, bottom;
|
||||
transition-duration: 1s;
|
||||
}
|
||||
</style>
|
||||
<div id="foo" style="top: 0; left: 0; right: 0"></div>
|
||||
<div id="foo" style="top: 0; left: 0; right: 0; width: 0; height: 0; bottom: 0"></div>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
promiseTest(async () => {
|
||||
await animationFrame();
|
||||
await animationFrame();
|
||||
|
||||
foo.style.left = "10px";
|
||||
foo.style.top = "10px";
|
||||
foo.style.right = "10px";
|
||||
foo.style.left = "10px";
|
||||
foo.style.width = "10px";
|
||||
foo.style.height = "10px";
|
||||
foo.style.bottom = "10px";
|
||||
|
||||
println("Order: " + document.getAnimations().map(animation => animation.transitionProperty).join(", "));
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue