Document replace does not update textarea
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox74 | --- | verified |
People
(Reporter: aruseni.magiku, Assigned: bzbarsky)
References
(Regression)
Details
(Keywords: parity-chrome, regression)
Attachments
(1 file)
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0
Steps to reproduce:
-
Open this page
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<textarea>123</textarea>
</body>
</html> -
Change text in the textarea
-
Run this code
var doc = document.open('text/html'); doc.write('<!DOCTYPE html>\n<html>\n<head>\n<meta charset="utf-8">\n<title></title>\n</head>\n<body>\n<textarea>123</textarea>\n</body>\n</html>'); doc.close();
-
Change text in the textarea again
-
Run this code again
Actual results:
First replace of document: the textarea updates.
Second replace of document: the textarea remains unchanged.
Expected results:
When document is replaced, the textarea updates.
Comment 1•4 years ago
|
||
I can reproduce the issue on Nightly74.0a1 Windows10, but not on Chrome80 dev.
Comment 2•4 years ago
|
||
As far as I've tested, no input
event is fired at running the script that means that setUserInput
is not used. So, it's restored without autocomplete etc. I guess cache does it?
Comment 3•4 years ago
|
||
This problem has been seen since Firefox 67.
Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=2624b1bdee9b2bab41ca9a8c784cf0a7f14c2b7e&tochange=a01586b62cf510bb165057e0bea9a45cc76e961e
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
State restoration is purely in the DOM not in cache.
We used to create a new SHEntry on document.open
, so the new load did not have a layout history state. Now we don't do that, but should probably just clear the state out explicitly on document.open
.
Assignee | ||
Comment 5•4 years ago
|
||
Otherwise we're using state from the pre-open document for whatever content is
being written, which is not likely to be right.
Pushed by bzbarsky@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ec4e3e080c1c document.open should clear form state from the SHEntry. r=smaug
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/21636 for changes under testing/web-platform/tests
Upstream PR was closed without merging
Pushed by bzbarsky@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3e3e0930d279 document.open should clear form state from the SHEntry. r=smaug
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Updated•4 years ago
|
Comment 11•4 years ago
|
||
bugherder |
Upstream PR merged by moz-wptsync-bot
Updated•4 years ago
|
Comment 13•4 years ago
|
||
Reproduced the initial issue on Nightly 74.0a1 (20200109094415).
Verified as fixed on Windows 10 x64, Ubuntu 18.04 and Mac OS X 10.15 using Firefox 74 beta 2 and the latest Nightly 75.0a1.
Description
•