forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Force DisplayLocks in <img> Layout APIs
Without this patch, width, height, x, and y return zero due to layout being skipped for DisplayLocking. Bug: 1247417 Change-Id: I29f34a20d49be03ac810186ca65983b6e43e4391 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3145934 Commit-Queue: Joey Arhar <jarhar@chromium.org> Reviewed-by: vmpstr <vmpstr@chromium.org> Cr-Commit-Position: refs/heads/main@{#919323}
- Loading branch information
1 parent
9f58b20
commit 0155c8c
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
css/css-contain/content-visibility/content-visibility-img.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,48 @@ | ||
<!DOCTYPE html> | ||
<link rel=author href="mailto:jarhar@chromium.org"> | ||
<link rel=help href="https://bugs.chromium.org/p/chromium/issues/detail?id=1247417"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
|
||
<style> | ||
div { | ||
content-visibility: hidden; | ||
} | ||
</style> | ||
<div id=container1></div> | ||
<div id=container2></div> | ||
<div id=container3></div> | ||
<div id=container4></div> | ||
|
||
<script> | ||
promise_test(async () => { | ||
const img1 = document.createElement('img'); | ||
container1.appendChild(img1); | ||
const img1Load = new Promise(resolve => img1.onload = resolve); | ||
img1.src = 'resources/dice.png'; | ||
await img1Load; | ||
assert_not_equals(img1.height, 0, 'height'); | ||
|
||
const img2 = document.createElement('img'); | ||
container2.appendChild(img2); | ||
const img2Load = new Promise(resolve => img2.onload = resolve); | ||
img2.src = 'resources/dice.png'; | ||
await img2Load; | ||
assert_not_equals(img2.width, 0, 'width'); | ||
|
||
const img3 = document.createElement('img'); | ||
container3.appendChild(img3); | ||
const img3Load = new Promise(resolve => img3.onload = resolve); | ||
img3.src = 'resources/dice.png'; | ||
await img3Load; | ||
assert_not_equals(img3.x, 0, 'x'); | ||
|
||
const img4 = document.createElement('img'); | ||
container4.appendChild(img4); | ||
const img4Load = new Promise(resolve => img4.onload = resolve); | ||
img4.src = 'resources/dice.png'; | ||
await img4Load; | ||
assert_not_equals(img4.y, 0, 'y'); | ||
|
||
}, `c-v:hidden <img> layout APIs shouldn't return zero when accessed from script.`); | ||
</script> |