Open Bug 1645714 Opened 4 years ago Updated 4 years ago

Assertion failure: !aPrevFrame || (!aPrevFrame->GetNextContinuation() || (((aPrevFrame->GetNextContinuation()->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER)) && ... at src/layout/base/nsFrameManager.cpp:82

Categories

(Core :: Layout, defect)

defect

Tracking

()

ASSIGNED
Tracking Status
firefox78 --- affected
firefox79 --- affected

People

(Reporter: tsmith, Assigned: TYLin)

References

(Blocks 1 open bug)

Details

(Keywords: assertion, testcase)

Attachments

(5 files)

Attached file testcase.html

Assertion failure: !aPrevFrame || (!aPrevFrame->GetNextContinuation() || (((aPrevFrame->GetNextContinuation()->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER)) && !(aPrevFrame->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER))) (aPrevFrame must be the last continuation in its chain!), at /builds/worker/checkouts/gecko/layout/base/nsFrameManager.cpp:82

0|0|libxul.so|nsFrameManager::InsertFrames(nsContainerFrame*, mozilla::layout::FrameChildListID, nsIFrame*, nsFrameList&)|hg:hg.mozilla.org/mozilla-central:layout/base/nsFrameManager.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|76|0x29
0|1|libxul.so|nsCSSFrameConstructor::AppendFramesToParent(nsFrameConstructorState&, nsContainerFrame*, nsFrameList&, nsIFrame*, bool)|hg:hg.mozilla.org/mozilla-central:layout/base/nsCSSFrameConstructor.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|5922|0x11
0|2|libxul.so|nsCSSFrameConstructor::ContentAppended(nsIContent*, nsCSSFrameConstructor::InsertionKind)|hg:hg.mozilla.org/mozilla-central:layout/base/nsCSSFrameConstructor.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|6813|0x23
0|3|libxul.so|mozilla::RestyleManager::ProcessRestyledFrames(nsStyleChangeList&)|hg:hg.mozilla.org/mozilla-central:layout/base/RestyleManager.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|1378|0xa
0|4|libxul.so|mozilla::RestyleManager::DoProcessPendingRestyles(mozilla::ServoTraversalFlags)|hg:hg.mozilla.org/mozilla-central:layout/base/RestyleManager.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|3035|0xb
0|5|libxul.so|mozilla::PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush)|hg:hg.mozilla.org/mozilla-central:layout/base/PresShell.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|4198|0x1c
0|6|libxul.so|mozilla::dom::Document::FlushPendingNotifications(mozilla::ChangesToFlush)|hg:hg.mozilla.org/mozilla-central:dom/base/Document.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|10024|0x23
0|7|libxul.so|mozilla::dom::Element::GetAnimations(mozilla::dom::GetAnimationsOptions const&, nsTArray<RefPtr<mozilla::dom::Animation> >&)|hg:hg.mozilla.org/mozilla-central:dom/base/Element.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|3321|0xa
0|8|libxul.so|mozilla::dom::Element_Binding::getAnimations(JSContext*, JS::Handle<JSObject*>, void*, JSJitMethodCallArgs const&)|s3:gecko-generated-sources:e8a031c9107e01c2944c0e597a46fb06213c4d13a8696763d2262c4869a164133bde64b265f69dce8c4b37d84332ce136336057b822b79c94921e34559675c5a/dom/bindings/ElementBinding.cpp:|5313|0xb
0|9|libxul.so|bool mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::NormalThisPolicy, mozilla::dom::binding_detail::ThrowExceptions>(JSContext*, unsigned int, JS::Value*)|hg:hg.mozilla.org/mozilla-central:dom/bindings/BindingUtils.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|3219|0x21
0|10|libxul.so|CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&)|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|486|0x12
0|11|libxul.so|js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason)|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|578|0xe
0|12|libxul.so|InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason)|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|641|0x10
0|13|libxul.so|Interpret(JSContext*, js::RunState&)|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|645|0xa
0|14|libxul.so|js::RunScript(JSContext*, js::RunState&)|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|458|0xb
0|15|libxul.so|js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason)|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|613|0x8
0|16|libxul.so|InternalCall(JSContext*, js::AnyInvokeArgs const&, js::CallReason)|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|641|0x10
0|17|libxul.so|<name omitted>|hg:hg.mozilla.org/mozilla-central:js/src/vm/Interpreter.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|658|0xb
0|18|libxul.so|JS::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::HandleValueArray const&, JS::MutableHandle<JS::Value>)|hg:hg.mozilla.org/mozilla-central:js/src/jsapi.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|2842|0x23
0|19|libxul.so|mozilla::dom::BlobCallback::Call(mozilla::dom::BindingCallContext&, JS::Handle<JS::Value>, mozilla::dom::Blob*, mozilla::ErrorResult&)|s3:gecko-generated-sources:45e23ecea60d79d0e74a6ca03a7bf65d5911466f51921230f9dcb1fc147c80f74fb56e89926cf54c6321eee03f54c12c3f3dec487fed3336b3d7d31019c38444/dom/bindings/HTMLCanvasElementBinding.cpp:|92|0x15
0|20|libxul.so|mozilla::dom::BlobCallback::Call(mozilla::dom::Blob*, mozilla::ErrorResult&, char const*, mozilla::dom::CallbackObject::ExceptionHandling, JS::Realm*)|s3:gecko-generated-sources:339ce762031c170ca1c531e274455b66c046eeab968b35d4e63d4b9541557ed14b0f9abdeb695d945e5c54aa0d3d6d0b3dcc27e9406ab80a9711c7d267a7251d/dist/include/mozilla/dom/HTMLCanvasElementBinding.h:|180|0x25
0|21|libxul.so|mozilla::dom::CanvasRenderingContextHelper::ToBlob(JSContext*, nsIGlobalObject*, mozilla::dom::BlobCallback&, nsTSubstring<char16_t> const&, JS::Handle<JS::Value>, bool, mozilla::ErrorResult&)::EncodeCallback::ReceiveBlobImpl(already_AddRefed<mozilla::dom::BlobImpl>)|hg:hg.mozilla.org/mozilla-central:dom/canvas/CanvasRenderingContextHelper.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|51|0x20
0|22|libxul.so|mozilla::dom::EncodingCompleteEvent::Run()|hg:hg.mozilla.org/mozilla-central:dom/base/ImageEncoder.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|0|0xb
0|23|libxul.so|nsThread::ProcessNextEvent(bool, bool*)|hg:hg.mozilla.org/mozilla-central:xpcom/threads/nsThread.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|1238|0xe
0|24|libxul.so|NS_ProcessNextEvent(nsIThread*, bool)|hg:hg.mozilla.org/mozilla-central:xpcom/threads/nsThreadUtils.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|501|0xc
0|25|libxul.so|mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*)|hg:hg.mozilla.org/mozilla-central:ipc/glue/MessagePump.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|87|0x7
0|26|libxul.so|MessageLoop::RunInternal()|hg:hg.mozilla.org/mozilla-central:ipc/chromium/src/base/message_loop.cc:ede1c973aa858b334a495870fd9bbc019b0e94f9|315|0x17
0|27|libxul.so|MessageLoop::Run()|hg:hg.mozilla.org/mozilla-central:ipc/chromium/src/base/message_loop.cc:ede1c973aa858b334a495870fd9bbc019b0e94f9|290|0x8
0|28|libxul.so|nsBaseAppShell::Run()|hg:hg.mozilla.org/mozilla-central:widget/nsBaseAppShell.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|137|0xd
0|29|libxul.so|XRE_RunAppShell()|hg:hg.mozilla.org/mozilla-central:toolkit/xre/nsEmbedFunctions.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|913|0xe
0|30|libxul.so|mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*)|hg:hg.mozilla.org/mozilla-central:ipc/glue/MessagePump.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|237|0x5
0|31|libxul.so|MessageLoop::RunInternal()|hg:hg.mozilla.org/mozilla-central:ipc/chromium/src/base/message_loop.cc:ede1c973aa858b334a495870fd9bbc019b0e94f9|315|0x17
0|32|libxul.so|MessageLoop::Run()|hg:hg.mozilla.org/mozilla-central:ipc/chromium/src/base/message_loop.cc:ede1c973aa858b334a495870fd9bbc019b0e94f9|290|0x8
0|33|libxul.so|XRE_InitChildProcess(int, char**, XREChildData const*)|hg:hg.mozilla.org/mozilla-central:toolkit/xre/nsEmbedFunctions.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|744|0x5
0|34|firefox-bin|content_process_main(mozilla::Bootstrap*, int, char**)|hg:hg.mozilla.org/mozilla-central:ipc/contentproc/plugin-container.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|56|0x11
0|35|firefox-bin|main|hg:hg.mozilla.org/mozilla-central:browser/app/nsBrowserApp.cpp:ede1c973aa858b334a495870fd9bbc019b0e94f9|303|0x20
0|36|libc.so.6||||0x21b97
0|37|firefox-bin|<name omitted>|hg:hg.mozilla.org/mozilla-central:mfbt/UniquePtr.h:ede1c973aa858b334a495870fd9bbc019b0e94f9|253|0x17
Flags: in-testsuite?
Flags: needinfo?(aethanyc)

A Pernosco session is available here: https://pernos.co/debug/j2mM-fLCylaqh6Mp7e1ZCg/index.html

The assertion can happen when a new element is appending into a flex container which has a ::after pseudo and the last child is fragmented across multiple flex containers.

Take the testcase in comment 0 for example. The row-oriented flex container has ::before and ::after. When the text is appended, the frame tree is like

FlexContainer frag1
  ::before frag1 (aPrevFrame in nsFrameManager::InsertFrames)
  // We want the new text appended here.
  ::after frag1

FlexContainer frag2
  ::before frag2
  ::after frag2

The assertion in nsFrameManager::InsertFrames is expecting the previous sibling aPrevFrame to be the last non-overflow-container continuation. It's reasonable for frames like block that lays its children out one after another. But for row-oriented flex container, each child can be fragmented across multiple flex container.

nsCSSFrameConstructor has complex logic to find the insertion point when a container has ::after pseudo [1]. I think the insertion point is reasonable, so we should fix the assertion. (But it feels ugly to add a special case in the assertion just for flex container ...)

[1] https://searchfox.org/mozilla-central/rev/5a4aaccb28665807a6fd49cf48367d47fbb5a19a/layout/base/nsCSSFrameConstructor.cpp#6548,6564

Flags: needinfo?(aethanyc)

The severity field is not set for this bug.
:alaskanemily, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(emcdonough)
Severity: -- → S4
Flags: needinfo?(emcdonough)
Assignee: nobody → aethanyc
Status: NEW → ASSIGNED
Attached file 1645714-grid.html

An example that appends a new element into a grid container with ::after. This can trigger the same assertion.

Attached file 1645714-float.html

Similarly, an example that appends a new float element into a block container with a floating ::after. This can trigger the same assertion.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: