Open Bug 1909069 Opened 1 year ago Updated 1 year ago

editing/run/inserthorizontalrule.html non-fatally asserts after bug 1789166 because it's trying to call nsTextFrame::GetTrimmedOffsets on a hidden subtree

Categories

(Core :: Layout: Text and Fonts, defect, P3)

defect

Tracking

()

People

(Reporter: emilio, Unassigned)

References

(Blocks 1 open bug)

Details

Due to this test: https://searchfox.org/mozilla-central/rev/92799fbeac12191d1524eed3695625dd312af38c/testing/web-platform/tests/editing/data/inserthorizontalrule.js#252

It is expected that the text is unreflowed due to it being content-visibility: hidden, and ultimately it is a pre-existing issue... But maybe editing should treat stuff inside content-visibility: hidden subtrees more like display: none?

I'm not sure. It seems that Chrome does not touch content in <details> according to the result of the test.

On the other hand, the assertion failure is not related to the editor module. It's a request from ContentEventHandler whose user (ContentCacheInChild) tries to send content data to the parent process to make ContentCacheInParent can return content info to IME when it's requested.

0:22.82 pid:51028 [Child 55532, Main Thread] ###!!! ASSERTION: Can only call this on frames that have been reflowed: '!HasAnyStateBits(NS_FRAME_FIRST_REFLOW) || GetParent()->HasAnyStateBits(NS_FRAME_TOO_DEEP_IN_FRAME_TREE)', file M:/src/layout/generic/nsTextFrame.cpp:3075
 0:28.89 pid:51028 #01: NS_DebugBreak (M:\src\xpcom\base\nsDebugImpl.cpp:493)
 0:28.91 pid:51028 #02: nsTextFrame::GetTrimmedOffsets (M:\src\layout\generic\nsTextFrame.cpp:3076)
 0:28.91 pid:51028 #03: nsTextFrame::PeekOffsetCharacter (M:\src\layout\generic\nsTextFrame.cpp:8030)
 0:28.93 pid:51028 #04: mozilla::ContentEventHandler::ExpandToClusterBoundary (M:\src\dom\events\ContentEventHandler.cpp:1146)
 0:28.94 pid:51028 #05: mozilla::ContentEventHandler::ConvertFlatTextOffsetToDOMRangeBase<mozilla::ContentEventHandler::SimpleRangeBase<RefPtr<nsINode>,mozilla::RangeBoundaryBase<nsCOMPtr<nsINode>,nsCOMPtr<nsIContent> > >,RefPtr<mozilla::dom::Text> > (M:\src\dom\events\ContentEventHandler.cpp:1227)
 0:28.94 pid:51028 #06: mozilla::ContentEventHandler::OnQueryTextRect (M:\src\dom\events\ContentEventHandler.cpp:2494)
 0:28.94 pid:51028 #07: mozilla::ContentEventHandler::OnQueryCaretRect (M:\src\dom\events\ContentEventHandler.cpp:2874)
 0:28.94 pid:51028 #08: mozilla::ContentEventHandler::HandleQueryContentEvent (M:\src\dom\events\ContentEventHandler.cpp:1428)
 0:28.96 pid:51028 #09: mozilla::IMEContentObserver::HandleQueryContentEvent (M:\src\dom\events\IMEContentObserver.cpp:698)
 0:28.97 pid:51028 #10: mozilla::EventStateManager::HandleQueryContentEvent (M:\src\dom\events\EventStateManager.cpp:1528)
 0:28.97 pid:51028 #11: mozilla::EventStateManager::PreHandleEvent (M:\src\dom\events\EventStateManager.cpp:955)
 0:28.99 pid:51028 #12: mozilla::PresShell::EventHandler::DispatchEvent (M:\src\layout\base\PresShell.cpp:8517)
 0:28.99 pid:51028 #13: mozilla::PresShell::EventHandler::HandleEventWithCurrentEventInfo (M:\src\layout\base\PresShell.cpp:8488)
 0:29.00 pid:51028 #14: mozilla::PresShell::EventHandler::HandleEventAtFocusedContent (M:\src\layout\base\PresShell.cpp:8229)
 0:29.00 pid:51028 #15: mozilla::PresShell::EventHandler::HandleEvent (M:\src\layout\base\PresShell.cpp:7136)
 0:29.00 pid:51028 #16: mozilla::PresShell::HandleEvent (M:\src\layout\base\PresShell.cpp:7054)
 0:29.01 pid:51028 #17: nsViewManager::DispatchEvent (M:\src\view\nsViewManager.cpp:651)
 0:29.02 pid:51028 #18: nsView::HandleEvent (M:\src\view\nsView.cpp:1067)
 0:29.02 pid:51028 #19: mozilla::widget::PuppetWidget::DispatchEvent (M:\src\widget\PuppetWidget.cpp:348)
 0:29.03 pid:51028 #20: mozilla::ContentCacheInChild::CacheCaret (M:\src\widget\ContentCache.cpp:259)
 0:29.03 pid:51028 #21: mozilla::ContentCacheInChild::CacheCaretAndTextRects (M:\src\widget\ContentCache.cpp:314)
 0:29.03 pid:51028 #22: mozilla::ContentCacheInChild::CacheSelection (M:\src\widget\ContentCache.cpp:234)
 0:29.04 pid:51028 #23: mozilla::ContentCacheInChild::CacheText (M:\src\widget\ContentCache.cpp:382)
 0:29.04 pid:51028 #24: mozilla::ContentCacheInChild::CacheAll (M:\src\widget\ContentCache.cpp:184)
 0:29.04 pid:51028 #25: mozilla::widget::PuppetWidget::NotifyIMEOfFocusChange (M:\src\widget\PuppetWidget.cpp:757)
 0:29.05 pid:51028 #26: mozilla::widget::TextEventDispatcher::NotifyIME (M:\src\widget\TextEventDispatcher.cpp:490)
 0:29.05 pid:51028 #27: nsBaseWidget::NotifyIME (M:\src\widget\nsBaseWidget.cpp:1924)
 0:29.06 pid:51028 #28: mozilla::IMEStateManager::NotifyIME (M:\src\dom\events\IMEStateManager.cpp:0)
 0:29.06 pid:51028 #29: mozilla::IMEContentObserver::IMENotificationSender::SendFocusSet (M:\src\dom\events\IMEContentObserver.cpp:1932)
 0:29.07 pid:51028 #30: mozilla::IMEContentObserver::IMENotificationSender::Run (M:\src\dom\events\IMEContentObserver.cpp:1803)
 0:29.07 pid:51028 #31: mozilla::IMEContentObserver::TryToFlushPendingNotifications (M:\src\dom\events\IMEContentObserver.cpp:1639)
 0:29.07 pid:51028 #32: mozilla::IMEStateManager::OnFocusInEditor (M:\src\dom\events\IMEStateManager.cpp:1060)
 0:29.08 pid:51028 #33: mozilla::EditorBase::OnFocus (M:\src\editor\libeditor\EditorBase.cpp:6030)
 0:29.09 pid:51028 #34: mozilla::HTMLEditor::OnFocus (M:\src\editor\libeditor\HTMLEditor.cpp:822)
 0:29.10 pid:51028 #35: mozilla::EditorEventListener::Focus (M:\src\editor\libeditor\EditorEventListener.cpp:1172)
 0:29.10 pid:51028 #36: mozilla::EditorEventListener::HandleEvent (M:\src\editor\libeditor\EditorEventListener.cpp:476)
 0:29.11 pid:51028 #37: mozilla::HTMLEditorEventListener::HandleEvent (M:\src\editor\libeditor\HTMLEditorEventListener.cpp:102)
 0:29.11 pid:51028 #38: mozilla::EventListenerManager::HandleEventSingleListener (M:\src\dom\events\EventListenerManager.cpp:1344)
 0:29.11 pid:51028 #39: mozilla::EventListenerManager::HandleEventWithListenerArray (M:\src\dom\events\EventListenerManager.cpp:1662)
 0:29.11 pid:51028 #40: mozilla::EventListenerManager::HandleEventInternal (M:\src\dom\events\EventListenerManager.cpp:1559)
 0:29.12 pid:51028 #41: mozilla::EventTargetChainItem::HandleEvent (M:\src\dom\events\EventDispatcher.cpp:368)
 0:29.12 pid:51028 #42: mozilla::EventTargetChainItem::HandleEventTargetChain (M:\src\dom\events\EventDispatcher.cpp:532)
 0:29.12 pid:51028 #43: mozilla::EventTargetChainItem::HandleEventTargetChain (M:\src\dom\events\EventDispatcher.cpp:688)
 0:29.12 pid:51028 #44: mozilla::EventDispatcher::Dispatch (M:\src\dom\events\EventDispatcher.cpp:1221)
 0:29.14 pid:51028 #45: FocusBlurEvent::Run (M:\src\dom\base\nsFocusManager.cpp:2789)
 0:29.15 pid:51028 #46: nsContentUtils::AddScriptRunner (M:\src\dom\base\nsContentUtils.cpp:6322)
 0:29.15 pid:51028 #47: nsContentUtils::AddScriptRunner (M:\src\dom\base\nsContentUtils.cpp:6328)
 0:29.15 pid:51028 #48: nsFocusManager::FireFocusOrBlurEvent (M:\src\dom\base\nsFocusManager.cpp:2941)
 0:29.16 pid:51028 #49: nsFocusManager::SendFocusOrBlurEvent (M:\src\dom\base\nsFocusManager.cpp:2901)
 0:29.16 pid:51028 #50: nsFocusManager::Focus (M:\src\dom\base\nsFocusManager.cpp:2719)
 0:29.16 pid:51028 #51: nsFocusManager::SetFocusInner (M:\src\dom\base\nsFocusManager.cpp:1809)
 0:29.16 pid:51028 #52: nsFocusManager::SetFocus (M:\src\dom\base\nsFocusManager.cpp:485)
 0:29.17 pid:51028 #53: mozilla::dom::Selection::StyledRanges::MaybeFocusCommonEditingHost (M:\src\dom\base\Selection.cpp:3719)
 0:29.18 pid:51028 #54: mozilla::dom::Selection::NotifySelectionListeners (M:\src\dom\base\Selection.cpp:3769)
 0:29.18 pid:51028 #55: mozilla::dom::Selection::AddRangeAndSelectFramesAndNotifyListenersInternal (M:\src\dom\base\Selection.cpp:2409)
 0:29.18 pid:51028 #56: mozilla::dom::Selection::AddRangeJS (M:\src\dom\base\Selection.cpp:2322)
 0:29.19 pid:51028 #57: mozilla::dom::Selection_Binding::addRange (M:\fx64-dbg\dom\bindings\SelectionBinding.cpp:424)
 0:29.20 pid:51028 #58: mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::NormalThisPolicy,mozilla::dom::binding_detail::ThrowExceptions> (M:\src\dom\bindings\BindingUtils.cpp:3270)

Okay, we should not use the frame here if its PeekOffset won't work due to the reason.

Well, but it seems that there is no meaningful API to check the state from outside of the layout module. (I think that it does not make sense to check the flag check outside the layout module does not make sense, there should be an API like nsIFrame::IsPeekOffsetAvailable.)

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