Open Bug 1848982 Opened 2 years ago Updated 1 year ago

Button `disabled` state is wrongly persisted across a full page refresh

Categories

(Core :: DOM: Navigation, defect)

Firefox 117
Desktop
All
defect

Tracking

()

Tracking Status
firefox-esr115 --- affected
firefox121 --- affected
firefox122 --- affected
firefox123 --- affected

People

(Reporter: daniel, Unassigned)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36

Steps to reproduce:

I enabled a button with JavaScript, and then performed a full page refresh.

https://stackblitz.com/edit/web-platform-npfqoj?file=index.html

Actual results:

This button remains enabled even though the incoming HTML specifies it should be disabled.

Expected results:

I expected the button to be disabled as the incoming HTML specified.

See Also: → 46845

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Core & HTML' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core

Thank you for the report!

Just so that I don't misunderstand anything here. When you say full page refresh, you mean something equivalent with hitting F5?

Flags: needinfo?(daniel)

Exactly so. I mean to distinguish from a SPA transition or similar JS-powered DOM change or reload.

Can you reproduce with the sandbox I provided? It uses a normal a link to replicate this behaviour.

Let me know if I can provide anything else.

Flags: needinfo?(daniel)
Attached video notreproduced.webm

Unfortunately I can't reproduce it, I attached a video of me trying to do it, basically just hitting 'Activate' and then the reload button in the browser UI. Was that how I was supposed to do it?

Flags: needinfo?(daniel)

This is most likely Session Restore related. Moving it there for further triage.

Component: DOM: Core & HTML → Session Restore
Product: Core → Firefox

I think you would need to click the small reload button above the rendered page.

Alternatively, to make it simpler and show that it's not related to the sandbox environment, try visiting https://firefox-repro.vercel.app. You'll see it's just the HTML and it should display the bug clearly when you click the refresh button in the browser UI.

Flags: needinfo?(daniel)

Hi Andreas, are you thinking this is more on the gecko side of session restore? This doesn't look like anything we'd deal with on the UI-end of session restore.

Flags: needinfo?(afarre)

Turns out it's not a session restore thing at all. We don't collect button data at all. Could this be a bfcache thing :smaug?

Component: Session Restore → DOM: Navigation
Flags: needinfo?(afarre) → needinfo?(smaug)
Product: Firefox → Core

Isn't this plain old form state restoration? bfcache doesn't kick in when doing reloads.

Flags: needinfo?(smaug)
Severity: -- → S3

I can confirm the reproduction of the steps above in Windows 10, Mac OS 11 and Ubuntu 22 using steps:

  1. Load https://firefox-repro.vercel.app/
  2. Click "Activate me" button.
    Observe that the "button" button gets activated (not grayed out / not disabled)
  3. Click the "Reload current page" button.
    Observe that the "button" button is still activated (not grayed out / not disabled)
  4. Press CTRL + SHIFT + R (hard refresh)
    Observe that the "button" button gets disabled (grayed out)

Reproduced in all the latest versions of every channel.
Thank you for your contribution!

Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Unspecified → All
Hardware: Unspecified → Desktop
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: