PrintBrowser doesn't work with compositing |
|||||||||
Issue descriptionChrome Version: 58.0.3029.6 OS: Linux What steps will reproduce the problem? (1) Launch Chrome with --enable-print-browser (2) Navigate to google.com (3) Press F12 What is the expected result? No crashes What happens instead? Renderer crashes. e.g. 172abca920000000 and adec42a920000000 Thread 0 CRASHED [SIGSEGV @ 0x000000ec ] 0x00007fcfae98effb (chrome -Vector.h:987 ) blink::GraphicsLayer::addChildInternal(blink::GraphicsLayer*) 0x00007fcfae98f058 (chrome -GraphicsLayer.cpp:215 ) blink::GraphicsLayer::addChild(blink::GraphicsLayer*) 0x00007fcfacd7f356 (chrome -WebFrameWidgetImpl.h ) blink::PageOverlay::update() 0x00007fcfacd7632b (chrome -InspectorOverlay.cpp:224 ) blink::InspectorOverlay::invalidate() 0x00007fcfad5d3c89 (chrome -ObjectPaintInvalidator.cpp:300 ) blink::ObjectPaintInvalidator::invalidatePaintUsingContainer(blink::LayoutBoxModelObject const&, blink::LayoutRect const&, blink::PaintInvalidationReason) 0x00007fcfad5d5846 (chrome -ObjectPaintInvalidator.cpp:462 ) blink::ObjectPaintInvalidatorWithContext::invalidatePaintIfNeededWithComputedReason(blink::PaintInvalidationReason) 0x00007fcfad5bbbd7 (chrome -BoxPaintInvalidator.cpp:279 ) blink::BoxPaintInvalidator::invalidatePaintIfNeeded() 0x00007fcfad60ee0b (chrome -ViewPaintInvalidator.cpp:15 ) blink::ViewPaintInvalidator::invalidatePaintIfNeeded() 0x00007fcfad4d89e7 (chrome -LayoutView.cpp:425 ) blink::LayoutView::invalidatePaintIfNeeded(blink::PaintInvalidatorContext const&) const 0x00007fcfad611917 (chrome -PaintInvalidator.cpp:441 ) blink::PaintInvalidator::invalidatePaintIfNeeded(blink::LayoutObject const&, blink::PaintInvalidatorContext&) 0x00007fcfad5fef4e (chrome -PrePaintTreeWalk.cpp:235 ) blink::PrePaintTreeWalk::walk(blink::LayoutObject const&, blink::PrePaintTreeWalkContext const&) 0x00007fcfad5feda7 (chrome -PrePaintTreeWalk.cpp:67 ) blink::PrePaintTreeWalk::walk(blink::FrameView&, blink::PrePaintTreeWalkContext const&) 0x00007fcfad5fec49 (chrome -PrePaintTreeWalk.cpp:47 ) blink::PrePaintTreeWalk::walk(blink::FrameView&) 0x00007fcfad1f4a9b (chrome -FrameView.cpp:3154 ) blink::FrameView::prePaint() 0x00007fcfad1f3f5a (chrome -FrameView.cpp:3083 ) blink::FrameView::updateLifecyclePhasesInternal(blink::DocumentLifecycle::LifecycleState) 0x00007fcfacd773af (chrome -InspectorOverlay.cpp:236 ) blink::InspectorOverlay::updateAllLifecyclePhases() 0x00007fcfacd54940 (chrome -WebViewImpl.cpp:2001 ) blink::WebViewImpl::updateAllLifecyclePhases()
,
Mar 10 2017
,
Mar 11 2017
With a crash report like the one above, I don't understand why this is not a Blink issue. Adding Paint since the crash is inside blink::FrameView::prePaint().
,
Mar 11 2017
SPV2 (--enable-slimming-paint-v2) still has several crashes when devtools is open, but I think this specific crash is the interaction between print browsing and paint invalidation. I think this line may be the issue: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/paint/PaintInvalidator.cpp?l=427
,
Mar 11 2017
,
Mar 12 2017
Doesn't seem like CSS?
,
Mar 13 2017
The line pointed out by pdr@ shouldn't execute if printBrowser is enabled though...
,
Mar 13 2017
pdr@ is implying that we would normally return when printing, but with printBrowser we keep on going and crash. I interpret that to mean that something is unsafe when in printing paint mode, but we need that unsafe thing for printBrowser, so we crash.
,
Mar 13 2017
I can't reproduce this on ToT. I guess the original bug was because for DevTools page, paint invalidation is in non-printing mode and painting is in printing mode, causing mismatch of GraphicsLayers. Currently we don't invalidate paint for normal printing paint mode because - We flatten GraphicsLayers when printing, while paint invalidation invalidates on GraphicsLayers. - For printing we always paint on a special canvas instead of GraphicsLayers, and paint invalidation doesn't apply. - There is no update of web page during printing, so no paint invalidation is needed. - Printing paint doesn't happen during document lifecycle update. However, there are a lot of differences in PrintBrowser mode and it seems that we do need to invalidate paint. I have some questions: - Should we create composited layers in PrintBrowser mode? - If we create composited layers, should we flatten the layers during painting? - If we create composited layers and flatten layers during painting, how should we invalidate paint? - Should we show DevTools in printing mode (which looks not good to me)? I think the answers depend on what PrintBrowser is supposed to provide. Where can I find docs of it?
,
Mar 13 2017
I found the design doc: https://docs.google.com/document/d/1G2RoH7yiwh_vosEHsHTwqETBvt2ij8p9ov0D3kIz4ww/edit#
,
Mar 13 2017
After reading the design doc, I try to answer my questions: 1. Should we create composited layers in PrintBrowser mode? A: Yes. We should modify the rendering pipeline as little as possible. 2. If we create composited layers, should we flatten the layers during painting? A: No. Same reason. 3. If we create composited layers and flatten layers during painting, how should we invalidate paint? A: Just normal paint invalidation. 4. Should we show DevTools in printing mode (which looks not good to me)? A: DevTools should be rendered in non-printing mode. This helps developers to debug pages in printing mode. And a new question: 5. What should we do in real printing in PrintBrowser mode? A: We should do exactly the same as in non-PrintBrowser mode. If my answers are agreed, we have the following works to do for PrintBrowser: 2. Painting should not flatten GraphicsLayers for PrintBrowser mode. 4. DevTools should be rendered in non-printing mode. 5. We should distinguish real printing in PrintBrowser mode.
,
Mar 13 2017
I come to different conclusions. If the primary goal is to debug and test the printing pipeline, we need to do as much as we possibly can to maintain the behavior of that pipeline. What we do with layerization etc is as important part of how printed content is generated. e.g. bugs in how we flatten layers for printing will not manifest if we do not flatten. Now if the goal is just to check the layout aspects of printing, e.g. how media settings are applied, then how we render it is less important. But that's not how I interpret the document. Can someone clarify?
,
Mar 13 2017
I modified the summary because I believe the crash was because of the mismatch between painting and other stages about flattening GraphicsLayers. After reading schenney@'s comment, I changed my mind about compositing. I thought it was complex not to create compositing layers in blink compositing, but realized we have already achieved this for SPv2. We just need the same mechanism for PrintBrowser. Note that this is still not the same printing pipeline in which we create composited layers then flatten them during printing, but the difference will disappear in spv2.
,
Mar 22 2017
I see that now PrintBrowser implies SlimmingPaintV2, so this bug seems to no longer exist. Can we close this?
,
Mar 28 2017
I intend to implement PrintBrowser on SPV1 too - to make it stable to use. Let's keep this open in that case?
,
Apr 19 2017
,
Apr 20 2017
Closing this since the objective in #15 has been achieved. |
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by nainar@chromium.org
, Mar 9 2017Status: Available (was: Untriaged)