Bug 230688
Summary: | REGRESSION (Safari 15): Toggling object element display property reloads the object | ||
---|---|---|---|
Product: | WebKit | Reporter: | Ben <ben.browitt> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | ahmad.saleem792, ap, bfulgham, cdumez, mike, rniwa, webkit-bug-importer, zalan |
Priority: | P2 | Keywords: | BrowserCompat, InRadar |
Version: | Safari Technology Preview | ||
Hardware: | All | ||
OS: | iOS 14 |
Ben
When you toggle <object> HTML element between display:block and display:none the object is reloaded.
Didn't happen on iPadOS 14.0 and doesn't happen on Chrome and FireFox.
Tested on iPadOS 15.0, 14.8
To reproduce see that the timestamp on Safari changes every time you click on the 'Toggle Display' button.
On Chrome and Firefox the timestamp doesn't change.
https://jsbin.com/yoboxuhegu/1/edit?html,output
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
</head>
<body>
<button onclick="toggleDisplay()">Toggle Display</button>
<object style="display: block;" data="data:text/html;utf-8,<body onload='document.body.innerText = Date.now()'>hello"></object>
<script>
let el = document.querySelector('object');
let count = 1;
function log() {
el.text = count;
count++;
}
function toggleDisplay() {
let display = el.style.display == 'block' ? 'none' : 'block';
el.style.display = display;
}
</script>
</body>
</html>
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/83534931>
Ahmad Saleem
I am able to reproduce this bug in Safari 15.6 and Technical Preview 150 on macOS 12.5 and toggling "Display" button changes timestamp every time unlike other browsers (Chrome Canary 106 and Firefox Nightly 105). Thanks!
Ahmad Saleem
Adding 'BrowserCompat' since it is still reproducible in STP172.