RESOLVED FIXED 266846
MutationObserver doesn't observe style attribute change when resizing element
https://bugs.webkit.org/show_bug.cgi?id=266846
Summary MutationObserver doesn't observe style attribute change when resizing element
alanas.00
Reported 2023-12-23 06:05:05 PST
Created attachment 469188 [details] open this in epiphany replicated in (content of "about:", "|" separates lines): • Epiphany Technology Preview | Version 45.0-71-gb47be5405+ | A simple, clean, beautiful view of the web | WebKitGTK 2.43.3 • Web | Version 45.1 | A simple, clean, beautiful view of the web | WebKitGTK 2.42.3 steps to reproduce: 1. open test.html in epiphany 2. resize textarea using bottom right corner actual results (what happens in epiphany): • textarea value stays "resize me using bottom right corner" expected results (what happens in pale moon, firefox, chromium): • textarea value changes to value of style attribute
Attachments
open this in epiphany (680 bytes, text/html)
2023-12-23 06:05 PST, alanas.00
no flags
STP185 vs Chrome Canary 122 (2.95 MB, video/quicktime)
2024-01-02 21:26 PST, Ahmad Saleem
no flags
Karl Dubost
Comment 1 2023-12-24 22:05:05 PST
This is happening on STP 184 on macOS. The values are not dynamically adjusted. The script in the attachment above: ``` function update_text(){ resize_me.value=resize_me.getAttribute("style") } new MutationObserver(update_text).observe(resize_me,{ attributes:true, attributeFilter:["style"] }) resize_js_button.onclick=function(){ resize_me.setAttribute("style","width:200px;height:100px") } update_text_button.onclick=update_text ``` Probably there is a need for WPT too. This should return a hit for Safari. https://wpt.fyi/results/?label=master&label=experimental&aligned&q=mutationobserver%20safari%3Afail old similar bug in https://stackoverflow.com/questions/57778941/reactjs-web-app-mutationobserver-use-in-safari-browser-not-as-expected Maybe the MutationObserver reacts to the attribute change, but not to the value inside the attributes. It doesn't fix the difference in between the browsers, but there is resizeObserver which should be working here.
Radar WebKit Bug Importer
Comment 2 2023-12-24 22:05:16 PST
Ryosuke Niwa
Comment 3 2024-01-02 10:39:47 PST
I can't reproduce this on STP177 or STP185.
Ahmad Saleem
Comment 4 2024-01-02 21:26:20 PST
Created attachment 469271 [details] STP185 vs Chrome Canary 122 Reference Video - Safari 185 & Chrome Canary 122 to highlight issue.
Anne van Kesteren
Comment 5 2024-12-13 03:07:08 PST
EWS
Comment 6 2024-12-13 23:03:29 PST
Committed 287833@main (270c2df6a704): <https://commits.webkit.org/287833@main> Reviewed commits have been landed. Closing PR #37902 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.