Bug 190245

Summary: [WPE] Text incorrectly rendered when using SimpleLineLayout
Product: WebKit Reporter: Miguel Gomez <magomez>
Component: WPE WebKitAssignee: Miguel Gomez <magomez>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, koivisto, mcatanzaro, simon.fraser, zalan
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 90342    
Bug Blocks:    
Attachments:
Description Flags
Testcase
none
Patch
none
Patch zalan: review-

Miguel Gomez
Reported 2018-10-03 03:38:27 PDT
Created attachment 351505 [details] Testcase I'm attaching a simple testcase to reproduce this problem. In the test, we have a div with its own GraphicsLayer, and inside that div there's a text element. Then the text is changed at the same time than the style of the layer is changed. This should cause that both the div and the text were repainted but that's not happening (unless we're always using complex text). What happens is: - RenderText::setText is called because of the changed text, and it invalidates its simpleLineLayout - RenderLayerCompositor::layerStyleChanged is called because of the div style change. This calls RenderLayerBacking::updateAfterDescendants which calls RenderLayerBacking::updateDrawsContent. This one traverses the children to check whether its children are visible. As the child RenderText can't provide a simpleLineLayout (it won't be recreated until the layout happens), the boundingBox gotten for the text is empty, so RenderLayerBacking thinks that it doesn't have anything to paint and call GraphicsLayer::setDrawsContent with false. - The layout happens, and it requests a display of the layer contents through RenderLayerBacking::setContentsNeedDisplay, but as the associated GraphicsLayer has drawsContent to false, it's discarded - then the layout properly calculates the size for the new text and sets the GraphicsLayer drawsContent to true, but it's too late cause there isn't any new call to RenderLayerBacking::setContentsNeedDisplay - in the end, the GraphicsLayer is not repainted because it wasn't set a dirty rectangle to repaint.
Attachments
Testcase (632 bytes, text/html)
2018-10-03 03:38 PDT, Miguel Gomez
no flags
Patch (2.07 KB, patch)
2018-10-03 05:26 PDT, Miguel Gomez
no flags
Patch (4.88 KB, patch)
2018-10-09 02:03 PDT, Miguel Gomez
zalan: review-
Miguel Gomez
Comment 1 2018-10-03 05:26:34 PDT
Michael Catanzaro
Comment 2 2018-10-03 07:18:14 PDT
We are always using complex text. The simple text codepath is all dead code for our ports. How are you getting simple text?
Miguel Gomez
Comment 3 2018-10-03 07:23:57 PDT
(In reply to Michael Catanzaro from comment #2) > We are always using complex text. The simple text codepath is all dead code > for our ports. How are you getting simple text? We are forcing complex text for wkgtk but not for wpe.
Miguel Gomez
Comment 4 2018-10-09 02:03:15 PDT
Miguel Gomez
Comment 5 2018-10-09 02:06:48 PDT
Antti, could you please give a look to this? Thanks in advance!!
Antti Koivisto
Comment 6 2018-10-16 01:21:45 PDT
Zalan should take a look
zalan
Comment 7 2018-10-16 07:40:03 PDT
Comment on attachment 351871 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=351871&action=review > Source/WebCore/rendering/RenderLayer.cpp:-6098 > - if (renderText.linesBoundingBox().isEmpty()) > - continue; The bounding box value is totally invalid here and we should not make any painting decision based on that. We end up using the value from the previous layout which could be very different from what we might get as the result of the style/content change. This function should either not be called when the tree is dirty (Simon?) or skip geometry checks on dirty renderers completely.
zalan
Comment 8 2018-10-16 07:43:41 PDT
(In reply to Michael Catanzaro from comment #2) > We are always using complex text. The simple text codepath is all dead code > for our ports. How are you getting simple text? Simple line layout != simple text. Simple line layout is about whether the inline content can be laid out in a simple way without generating line boxes (RootInlineBox, InlineTextBox etc)
Simon Fraser (smfr)
Comment 9 2018-10-16 14:23:15 PDT
I think the patch in bug 90342 will fix this.
Miguel Gomez
Comment 10 2018-11-16 01:47:22 PST
(In reply to Simon Fraser (smfr) from comment #9) > I think the patch in bug 90342 will fix this. Yes, this became fixed with that patch, so closing bug.
Note You need to log in before you can comment on or make changes to this bug.