if (frame->View()->NeedsLayout() || document->NeedsLayoutTreeUpdate()) {Helmut JanuschkaFrameContentAsText() is on the callstack in less than 7% of the crashes, so this isn't going to fix the bug.
That said, whether it's correct or not to update style and layout here, I'm not convinced. It seems to be called more or less directly from non-Blink code, which in a way suggests that we need to take care of such things, but, then again, didn't someone add these DCHECKs for a reason? And why is ChromeRenderFrameObserver::DidMeaningfulLayout() on the call stack? If we did layout, why do we need layout?
I don't think this is the right fix.
If it is, though, we should call LocalFrameView::UpdateLifecycleToLayoutClean() instead, and without checking for dirtyness.
reverted all frame_content_as_text.cc changes completely, DCHECKs restored,innerText() restored.
The fix/try is now in element_inner_text.cc, guarding the PlainText() calls before they hit the null OffsetMapping.
This covers the most of crashes coming through accessibility callers (like GetInnerTextWithoutUpdate() call sites in ax_node_object.cc/ax_object.cc) that run post-layout and can't rewind the lifecycle.
To your question about DidMeaningfulLayout, its dispatched in WebFrameWidgetImpl::UpdateLifecycle() after GetPage()->UpdateLifecycle() completes.
The 7% FrameContentAsText path goes through innerText() which calls UpdateStyleAndLayoutForNode(), but GetInnerTextWithoutUpdate() itself has the clean-layout DCHECK intentionally commented out (crbug.com/1165850, crbug.com/1166296) acknowledging layout isn't always clean.
let me know if that direction is a feasable one, if not i might need to abandon, as i can't see the forest for the trees anymore.
if (frame->View()->NeedsLayout() || document->NeedsLayoutTreeUpdate()) {Helmut JanuschkaReplace with original DCHECKs.
Done
output.Append(document->documentElement()->GetInnerTextWithoutUpdate());Helmut JanuschkaWhy this?
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |