mozilla :: #apz

15 May 2017
19:21tnikkelrbarker: botond: what should i be expecting a ping about? :)
19:22rbarkertnikkel: I have a problem where the root content document is not getting marked as such.
19:23rbarkertnikkel: So we a test page I have goes full screen, I don't get notified that the rcd has resized and thus the toolbar doesn't get hidden.
19:23rbarkertnikkel: This only happens the first time. As soon as I touch the screen, it gets marked correctly and every thing works as expected.
19:24rbarkerbotond|home: thought there might be an optimization from an early return prevent the frame metric from getting marked as the root.
19:24botondtnikkel: we've traced it to this early return being hit: http://searchfox.org/mozilla-central/source/layout/painting/nsDisplayList.cpp#6252
19:24botondtnikkel: which is in turn caused by ignoreViewportScrolling being set to false: http://searchfox.org/mozilla-central/source/layout/generic/nsSubDocumentFrame.cpp#534
19:25rbarkerbotond: thanks I was just looking for your links from Friday :)
19:27botondtnikkel: so the ping to ask if you know why ignoreViewportScrolling might not be set in fullscreen mode
19:27tnikkelokay, so why is ignore viewport scrolling false?
19:28tnikkelis it false on the presshell? or do we not enter the if where it can be set to true?
19:30rbarkertnikkel: sorry, let me add some logging and find out. one sec.
19:38tnikkelif i had to guess i'd say we don't hit this line http://searchfox.org/mozilla-central/source/layout/base/nsLayoutUtils.cpp#1381 because one of the conditions in the if fails for some reason
19:58rbarkertnikkel: it looks like it is because there is no subdocRootFrame in the if check in layout/generic/nsSubDocumentFrame.cpp:nsSubDocumentFrame::BuildDisplayList()
20:00tnikkelrbarker: no subdocrootframe?? or no rootscrollframe?
20:01rbarkertnikkel: this if is failing: if (subdocRootFrame) {
20:02rbarkerso ignoreViewportScrolling stays false.
20:02rbarkerwhich doesn't make an sense...
20:02rbarkerone sec...
20:03tnikkelyeah, if thats failing then we can't paint anything at all in the content document
20:05rbarkertnikkel: it looks correct, my else for the if (subdocRootFrame) { is being printed to the log and presContext->IsRootContentDocument()=TRUE
20:06rbarkertnikkel: I have a WebGL canvas that is covering the entire draw area.
20:06rbarkerso I wouldn't know if it wasn't drawing.
20:07tnikkelrbarker: the webgl canvas is in the content doc?
20:08rbarkertnikkel: it goes: <body><div><canvas> basically.
20:09rbarkerfrom what I can tell.
20:09tnikkelokay, so its in the content doc
20:10tnikkelthis is quite wierd, probably something about how fullscreen docs that i&#39;m not familiar with
20:10rbarkertnikkel: it hits this condition with out going into fullscreen.
20:10rbarkertnikkel: It just doesn&#39;t present until I go into fullscreen
20:10rbarkertnikkel: because the toolbar doesn&#39;t hide.
20:12tnikkelrbarker: perhaps it&#39;s a different document then the one we are interested in?
20:12rbarkertnikkel: not sure I follow.
20:13rbarkertnikkel: I&#39;m printing out from the presContext if it is the rcd. It is.
20:14tnikkelrbarker: there isn&#39;t one RCD. RCD just means its a content document with no content document parent
20:14rbarkertnikkel: okay. But I only see one in the log.
20:15tnikkelrbarker: okay. if we don&#39;t have a subdocRootFrame then i don&#39;t see how we can be drawing anything in that document at all
20:16rbarkertnikkel: let me add a log to see if it ever goes into the if block, one sec.
20:17tnikkelwe can fail to have a subdocRootFrame early in the loading of the page. so i&#39;d expect it to happen some times, but not the usual case
20:29rbarkertnikkel: yeah, it looks like that is what I was seeing. Adding more logging...
20:31rbarkertnikkel: in nsLayoutUtils::SetDisplayPortMargins(), rootScrollFrame is null.
20:32rbarkerbut is not null by the time nsSubDocumentFrame::BuildDisplayList is called.
20:33rbarkerbecause it gets into if (nsIFrame* rootScrollFrame = presShell->GetRootScrollFrame()) {
20:33rbarkerbut does not get into if (ignoreViewportScrolling) {
20:39tnikkelrbarker: can you verify if we call SetIgnoreViewportScrolling unconditionally in nsLayoutUtils::SetDisplayPortMargins that it fixes the problem?
20:40rbarkerone sec...
21:02rbarkertnikkel: so making it unconditional didn&#39;t help.
21:04rbarkertnikkel: Either it&#39;s the wrong presShell or something else is setting it back to false?
21:05rbarkerbecause the presShell is still returning false.
21:05rbarkerI put a log in and aPresShell->SetIgnoreViewportScrolling(true) is being called...
21:14tnikkelrbarker: i don&#39;t see how it can be set to false, so maybe its a different presshell? can you log the presshell pointer to find out?
21:15rbarkertnikkel: was just doing that.
21:20rbarkertnikkel: they are different presShells.
21:25tnikkelrbarker: are we are sure the two presshells are for the same document? say aContent in SetDisplayPortMargins matches rootScrollFrame->GetContent() in nsSubdocumentFrame::BuildDisplayList?
21:25rbarkertnikkel: let me check.
21:33rbarkertnikkel: different content too.
21:37tnikkelrbarker: is it a different document? GetOwnerDoc() on the content node...
21:40rbarkerchecking
21:43rbarkertnikkel: the content nodes (nsIContent) don&#39;t have a GetOwerDoc() function?
21:44tnikkellet me find the name of that function
21:44rbarkertnikkel: sorry, found it GetOwnerDocument
21:55rbarkertnikkel: different owner docs.
21:57tnikkelrbarker: ok so the SetDisplayPortMargins call doesn&#39;t seem related to what we are looking at then
21:57tnikkelrbarker: does the document we care about even get a displayport?
22:10rbarkertnikkel: rootScrollFrame->GetContent()->GetProperty(nsGkAtoms::DisplayPort) ?
22:10rbarkerit returns null.
22:12tnikkelrbarker: no, the haveDisplayPort var in subdocument frame
22:12tnikkel::DisplayPort is only used for displayport rects, which we mostly dont use in favor of margins now
22:18rbarkertnikkel: no display port.
22:19rbarkertnikkel: however after going full screen, it gets one if I tap the screen.
22:27tnikkelrbarker: so if we&#39;re depending on scrollable metrics we either need to put them on all the time, or make sure we always have a displayport
22:35rbarkertnikkel: It doesn&#39;t have to come from frame metrics I guess. I really just need to know when the size of the visible page changes.
22:54tnikkelrbarker: frame metrics is probably the best way for that. i can&#39;t think of anything offhand that would be better
22:55rbarkertnikkel: I&#39;m looking into getting it from a different place from the frame metrics.
23:07rbarkertnikkel: okay, so I guess I do need the frame metric set to root if it actually is for the root.
23:09tnikkelrbarker: it gets frame metrics? they just aren&#39;t marked root?
23:10rbarkertnikkel: I&#39;ve got my self confused. I think the original issue was when AsyncPanZoomController::NotifyLayersUpdated is called.
23:11rbarkerif (aLayerMetrics.IsRootContent()) { is false.
23:12rbarkertnikkel: but now I&#39;m looking at this, maybe I should be using mFrameMetrics instead?
23:50rbarkertnikkel: okay, I think I have a better picture of what is going on.
23:51rbarkertnikkel: So AsyncPanZoomController::NotifyLayersUpdated doesn&#39;t seem to be called for the root content when not scrollalbe?
23:53botondrbarker: if it doesn&#39;t get a FrameMetrics, it won&#39;t be called
23:54rbarkerbotond: it has a frame metrics. because I am able to get it in AsyncCompositionManager::ApplyAsyncContentTransformToTree
23:57botondrbarker: oh, i guess it might have an empty framemetrics
23:58botondrbarker: but yeah, if the metrics has IsScrollable() = false, then there will no be APZC
23:59rbarkerbotond: I&#39;m able to get the correct composition size in AsyncCompositionManager::ApplyAsyncContentTransformToTree
23:59rbarkerbotond: so I guess I should hook in there...
23:59botondrbarker: from the metrics?
23:59rbarkerbotond: yes.
16 May 2017
No messages
   
Last message: 95 days and 17 hours ago