This repository has been archived by the owner on Aug 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1585882 - Fix needs_frame() check to account for the case where a…
…n ancestor of us has been reconstructed regularly, not via lazy frame construction. r=heycam This is a pre-existing bug, and this would be enough to fix the website, but this is still not 100% correct. More on that in a second. Differential Revision: https://phabricator.services.mozilla.com/D48134
- Loading branch information
Showing
3 changed files
with
74 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
testing/web-platform/tests/css/cssom/getComputedStyle-animations-replaced-into-ib-split.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!doctype html> | ||
<title>getComputedStyle() returns the right style for animating nodes that have been just inserted into the document, and that have an ancestor whose layout tree was recreated (like an IB-split)</title> | ||
<link rel="help" href="https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle"> | ||
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1585882"> | ||
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> | ||
<link rel="author" title="Mozilla" href="https://mozilla.org"> | ||
<script src=/resources/testharness.js></script> | ||
<script src=/resources/testharnessreport.js></script> | ||
<style> | ||
@keyframes my-animation { | ||
from { color: green; } | ||
to { color: green; } | ||
} | ||
div { | ||
color: red; | ||
animation: my-animation 1s infinite linear paused; | ||
} | ||
</style> | ||
<span> | ||
<div></div> | ||
</span> | ||
<script> | ||
test(() => { | ||
let oldDiv = document.querySelector("div"); | ||
window.unused = oldDiv.getBoundingClientRect(); // update layout | ||
|
||
assert_equals(getComputedStyle(oldDiv).color, "rgb(0, 128, 0)", "Should take color from the animation"); | ||
|
||
let newDiv = document.createElement("div"); | ||
oldDiv.replaceWith(newDiv); | ||
|
||
assert_equals(getComputedStyle(newDiv).color, "rgb(0, 128, 0)", "Should take color from the animation (just inserted into the document)"); | ||
}, "getComputedStyle() should return animation styles for nodes just inserted into the document, even if they're in an IB-split"); | ||
</script> |
30 changes: 30 additions & 0 deletions
30
...eb-platform/tests/css/cssom/getComputedStyle-layout-dependent-replaced-into-ib-split.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!doctype html> | ||
<title>getComputedStyle() returns the right style for layout-dependent properties for nodes that have been just inserted into the document, and that have an ancestor whose layout tree was recreated (like an IB-split)</title> | ||
<link rel="help" href="https://drafts.csswg.org/cssom/#dom-window-getcomputedstyle"> | ||
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1585882"> | ||
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> | ||
<link rel="author" title="Mozilla" href="https://mozilla.org"> | ||
<script src=/resources/testharness.js></script> | ||
<script src=/resources/testharnessreport.js></script> | ||
<style> | ||
div { | ||
width: 100%; | ||
} | ||
</style> | ||
<span> | ||
<div></div> | ||
</span> | ||
<script> | ||
test(() => { | ||
let oldDiv = document.querySelector("div"); | ||
window.unused = oldDiv.getBoundingClientRect(); // update layout | ||
|
||
let oldWidth = getComputedStyle(oldDiv).width; | ||
assert_true(oldWidth.indexOf("px") !== -1, "Should return the used value for width"); | ||
|
||
let newDiv = document.createElement("div"); | ||
oldDiv.replaceWith(newDiv); | ||
|
||
assert_equals(getComputedStyle(newDiv).width, oldWidth, "Should return the used value for width (just inserted into the document)"); | ||
}, "getComputedStyle() should return used value correctly for nodes just inserted into the document, even if they're in an IB-split"); | ||
</script> |