Closed Bug 2033652 Opened 6 months ago Closed 5 months ago

Assertion failure: AllowsAutoSizes() (Should only be called if allows auto sizing), at dom/html/HTMLImageElement.cpp:698

Categories

(Core :: DOM: Core & HTML, defect)

defect

Tracking

()

RESOLVED FIXED
152 Branch
Tracking Status
firefox-esr140 --- unaffected
firefox150 + wontfix
firefox151 + wontfix
firefox152 + fixed

People

(Reporter: tsmith, Assigned: ltenenbaum)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: assertion, pernosco, regression)

Attachments

(2 files)

Found with m-c 20260419-a6f8f17f2231 (--enable-debug)

This was found by visiting a live website with a debug build.

STR:

  • Launch browser and visit site

This issue was triggered by visiting https://www.momoxfashion.com/collections/damen-bekleidung. A Pernosco session is available here: https://pernos.co/debug/2PQ-RSmS0HzDNVca1S7P8w/index.html

Assertion failure: AllowsAutoSizes() (Should only be called if allows auto sizing), at dom/html/HTMLImageElement.cpp:698

0|0|libxul.so|mozilla::dom::HTMLImageElement::MaybeRecomputeAutoSizes(bool)|git:github.com/mozilla-firefox/firefox:dom/html/HTMLImageElement.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|698|0x172
0|1|libxul.so|mozilla::dom::Document::ObserveAutoSizesImage(mozilla::dom::HTMLImageElement&)::$_0::__invoke<mozilla::dom::Sequence<mozilla::OwningNonNull<mozilla::dom::ResizeObserverEntry> > >(mozilla::dom::Sequence<mozilla::OwningNonNull<mozilla::dom::ResizeObserverEntry> > const&)|git:github.com/mozilla-firefox/firefox:dom/base/Document.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|14660|0x7d
0|2|libxul.so|mozilla::dom::ResizeObserver::BroadcastActiveObservations()|git:github.com/mozilla-firefox/firefox:dom/base/ResizeObserver.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|410|0x2f0
0|3|libxul.so|mozilla::dom::Document::BroadcastAllActiveResizeObservations()|git:github.com/mozilla-firefox/firefox:dom/base/Document.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|19247|0x71
0|4|libxul.so|mozilla::dom::Document::DetermineProximityToViewportAndNotifyResizeObservers()|git:github.com/mozilla-firefox/firefox:dom/base/Document.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|19173|0x427
0|5|libxul.so|nsRefreshDriver::RunRenderingPhase<nsRefreshDriver::Tick(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp, nsRefreshDriver::IsExtraTick)::$_11>(mozilla::RenderingPhase, nsRefreshDriver::Tick(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp, nsRefreshDriver::IsExtraTick)::$_11&&, bool (*)(mozilla::dom::Document const&))|git:github.com/mozilla-firefox/firefox:layout/base/nsRefreshDriver.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|1290|0x274
0|6|libxul.so|nsRefreshDriver::Tick(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp, nsRefreshDriver::IsExtraTick)|git:github.com/mozilla-firefox/firefox:layout/base/nsRefreshDriver.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|2509|0x87c
0|7|libxul.so|mozilla::RefreshDriverTimer::TickRefreshDrivers(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp, nsTArray<RefPtr<nsRefreshDriver> >&)|git:github.com/mozilla-firefox/firefox:layout/base/nsRefreshDriver.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|342|0x91
0|8|libxul.so|mozilla::RefreshDriverTimer::Tick(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp)|git:github.com/mozilla-firefox/firefox:layout/base/nsRefreshDriver.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|358|0x60
0|9|libxul.so|mozilla::VsyncRefreshDriverTimer::RunRefreshDrivers(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp)|git:github.com/mozilla-firefox/firefox:layout/base/nsRefreshDriver.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|948|0xd
0|10|libxul.so|mozilla::VsyncRefreshDriverTimer::TickRefreshDriver(mozilla::layers::BaseTransactionId<mozilla::VsyncIdType>, mozilla::TimeStamp)|git:github.com/mozilla-firefox/firefox:layout/base/nsRefreshDriver.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|858|0x12a
0|11|libxul.so|mozilla::VsyncRefreshDriverTimer::RefreshDriverVsyncObserver::NotifyVsyncTimerOnMainThread()|git:github.com/mozilla-firefox/firefox:layout/base/nsRefreshDriver.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|589|0xb6
0|12|libxul.so|mozilla::dom::VsyncMainChild::RecvNotify(mozilla::VsyncEvent const&, float const&)|git:github.com/mozilla-firefox/firefox:dom/ipc/VsyncMainChild.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|64|0xe3
0|13|libxul.so|mozilla::dom::PVsyncChild::OnMessageReceived(IPC::Message const&)|s3:gecko-generated-sources:c294870d67d0bbadd275438a6525424fddb8b38154eb580d457ebcc3630c01b36abfb7b18ef9d2f595e6422e0ac45b6bf46d6bb856f9a8561beaa4e44a3a2531/ipc/ipdl/PVsyncChild.cpp:|229|0x306
0|14|libxul.so|mozilla::ipc::PBackgroundChild::OnMessageReceived(IPC::Message const&)|s3:gecko-generated-sources:9a2337f6ae4fa417e709171e246b7c52e5c7a3c59f095d3981b0e5d46794e718a2dae6bea0cc42f9b47b21fdbc7bdb27347f05d979cafa46c62bfc60b446ef0a/ipc/ipdl/PBackgroundChild.cpp:|4942|0x18a
0|15|libxul.so|mozilla::ipc::MessageChannel::DispatchAsyncMessage(mozilla::ipc::ActorLifecycleProxy*, IPC::Message const&)|git:github.com/mozilla-firefox/firefox:ipc/glue/MessageChannel.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|1798|0x128
0|16|libxul.so|mozilla::ipc::MessageChannel::DispatchMessage(mozilla::ipc::ActorLifecycleProxy*, std::unique_ptr<IPC::Message, std::default_delete<IPC::Message> >)|git:github.com/mozilla-firefox/firefox:ipc/glue/MessageChannel.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|1724|0x254
0|17|libxul.so|mozilla::ipc::MessageChannel::RunMessage(mozilla::ipc::ActorLifecycleProxy*, mozilla::ipc::MessageChannel::MessageTask&)|git:github.com/mozilla-firefox/firefox:ipc/glue/MessageChannel.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|1513|0x178
0|18|libxul.so|mozilla::ipc::MessageChannel::MessageTask::Run()|git:github.com/mozilla-firefox/firefox:ipc/glue/MessageChannel.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|1615|0xcd
0|19|libxul.so|mozilla::RunnableTask::Run()|git:github.com/mozilla-firefox/firefox:xpcom/threads/TaskController.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|719|0x17
0|20|libxul.so|mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&)|git:github.com/mozilla-firefox/firefox:xpcom/threads/TaskController.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|1358|0x5b2
0|21|libxul.so|mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&)|git:github.com/mozilla-firefox/firefox:xpcom/threads/TaskController.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|1181|0x57
0|22|libxul.so|mozilla::TaskController::ProcessPendingMTTask(bool)|git:github.com/mozilla-firefox/firefox:xpcom/threads/TaskController.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|655|0x65
0|23|libxul.so|mozilla::detail::RunnableFunction<mozilla::TaskController::TaskController()::$_0>::Run()|git:github.com/mozilla-firefox/firefox:xpcom/threads/nsThreadUtils.h:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|547|0x16
0|24|libxul.so|nsThread::ProcessNextEvent(bool, bool*)|git:github.com/mozilla-firefox/firefox:xpcom/threads/nsThread.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|1179|0x5ca
0|25|libxul.so|NS_ProcessNextEvent(nsIThread*, bool)|git:github.com/mozilla-firefox/firefox:xpcom/threads/nsThreadUtils.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|465|0x4f
0|26|libxul.so|mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*)|git:github.com/mozilla-firefox/firefox:ipc/glue/MessagePump.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|83|0xc0
0|27|libxul.so|MessageLoop::Run()|git:github.com/mozilla-firefox/firefox:ipc/chromium/src/base/message_loop.cc:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|346|0x61
0|28|libxul.so|nsBaseAppShell::Run()|git:github.com/mozilla-firefox/firefox:widget/nsBaseAppShell.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|151|0x28
0|29|libxul.so|nsAppShell::Run()|git:github.com/mozilla-firefox/firefox:widget/gtk/nsAppShell.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|553|0x114
0|30|libxul.so|XRE_RunAppShell()|git:github.com/mozilla-firefox/firefox:toolkit/xre/nsEmbedFunctions.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|652|0x6b
0|31|libxul.so|mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*)|git:github.com/mozilla-firefox/firefox:ipc/glue/MessagePump.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|233|0x3c
0|32|libxul.so|MessageLoop::Run()|git:github.com/mozilla-firefox/firefox:ipc/chromium/src/base/message_loop.cc:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|346|0x61
0|33|libxul.so|XRE_InitChildProcess(int, char**, XREChildData const*)|git:github.com/mozilla-firefox/firefox:toolkit/xre/nsEmbedFunctions.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|590|0x938
0|34|firefox-bin|main|git:github.com/mozilla-firefox/firefox:browser/app/nsBrowserApp.cpp:b80e0bfbb9ad899ab751f0452709e85856b3c1cd|466|0x21c

Hi Leo, could you take a look? Thanks :)

Flags: needinfo?(ltenenbaum)
Keywords: regression
Regressed by: 1819581

Set release status flags based on info from the regressing bug 1819581

Attached file minimal.html —

Oh I think the problem is this:

static resizeObserver = new ResizeObserver(
      e => {
        e.forEach(
          e => {
            e.target.images.forEach(
              t => {
                t.setAttribute('sizes', Math.ceil(e.contentRect.width) + 'px')
              }
            )
          }
        )
      }
    );

The assertion can fail if a resize observer causes an image to no longer be auto-sizing (because the ResizeObservers are all called in a row with the observations, so you can get observations for an element even if a previous ResizeObserver caused it to be unobserved).
Should be a pretty easy fix :)

Assignee: nobody → ltenenbaum
Status: NEW → ASSIGNED
Flags: needinfo?(ltenenbaum)
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch

The patch landed in nightly and beta is affected.
:ltenenbaum, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(ltenenbaum)
Flags: needinfo?(ltenenbaum)
Regressions: 2035843
Regressions: 2035695

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/59623 for changes under testing/web-platform/tests

Upstream PR merged by moz-wptsync-bot

QA Whiteboard: [qa-triage-done-c153/b152]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: