Closed Bug 880932 Opened 11 years ago Closed 11 years ago

APZC: Page stops repainting and zoom/pan stops updating

Categories

(Core :: Graphics: Layers, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24
blocking-b2g leo+
Tracking Status
firefox22 --- wontfix
firefox23 --- wontfix
firefox24 --- fixed
b2g18 --- fixed
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- wontfix
b2g-v1.1hd --- fixed

People

(Reporter: ajones, Assigned: ajones)

References

()

Details

(Whiteboard: TaipeiWW)

Attachments

(1 file, 2 obsolete files)

Repainting stalls. Happens most of the time but not always. Steps to reproduce:

* Go to http://www.jesters-pies.co.nz/
* Zoom in
* Select menu
* Zoom in some more

Expected results:

Text gets bigger on zoom.

Actual results:

Text gets pixelated and is unreadable.
I'm confident that I know a good way to fix this. I will work on it on Monday.
Assignee: nobody → ajones
Attachment #760269 - Flags: review?(bgirard)
Attachment #760269 - Flags: feedback?(faraojh)
Comment on attachment 760269 [details] [diff] [review]
Fixed lack of response to APZC paint requests;  paint requests get tagged with the current nsPresShellId. TabChild will

Review of attachment 760269 [details] [diff] [review]:
-----------------------------------------------------------------

Sounds like we're just using this to work around a problem with the APZC. We should fix this in the right spot rather then force a ProcessUpdateFrame.

::: dom/ipc/TabChild.cpp
@@ +1473,5 @@
>      uint32_t presShellId;
>      nsresult rv = utils->GetPresShellId(&presShellId);
>      MOZ_ASSERT(NS_SUCCEEDED(rv));
>      if (NS_SUCCEEDED(rv) && aFrameMetrics.mPresShellId != presShellId) {
> +        return ProcessUpdateFrame(mLastMetrics);

The difference here is very subtle 'mLastMetrics vs aLastMetrics'. It's not clear if the pressShellId why you even want to ProcessUpdateFrame(mLastMetrics). This needs a clear comment.
Attachment #760269 - Flags: review?(bgirard) → review-
(In reply to Benoit Girard (:BenWa) from comment #3)
> Sounds like we're just using this to work around a problem with the APZC. We
> should fix this in the right spot rather then force a ProcessUpdateFrame.

The problem is that we need to reply to every request otherwise APZC thinks that the content process is still painting. The way it is currently set up is that the replies are sent by the painting code.

Ideally we'd have a system where we continuously send updates to the content process and it would always process the most recent. Sadly we don't have the infrastructure to do that yet.

There is no direct messaging from TabChild to APZC. There may be some value in rethinking the messaging model. I'd prefer to do it when we're a little further along on the fennec stuff.

> The difference here is very subtle 'mLastMetrics vs aLastMetrics'. It's not
> clear if the pressShellId why you even want to
> ProcessUpdateFrame(mLastMetrics). This needs a clear comment.

Good point.
Hi Anthony, here is my small suggestion for this problem.

1. Passing updated PresShellID when it is changed on the same web page.
   
2. If it is needed we check and adjust the scale on UpdateZoomConstraints()
   when I try to zoom in on a bing.com page just right before APZC get UpdateZoomConstraints() called, I was able to zoom in/out the bing.com web page.
Comment on attachment 760811 [details] [diff] [review]
Fixed blocked repainting requests and Zoom level mismatch

Review of attachment 760811 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/layers/ipc/AsyncPanZoomController.cpp
@@ +1275,5 @@
>      SetPageRect(mFrameMetrics.mScrollableRect);
>  
>      mState = NOTHING;
>    } else if (!mFrameMetrics.mScrollableRect.IsEqualEdges(aViewportFrame.mScrollableRect)) {
> +    mFrameMetrics.mPresShellId = aViewportFrame.mPresShellId;

We want to do this always. It could either be in NotifyLayersUpdated() or RequestContentRepaint(). Perhaps at the top of this function is best.

@@ +1477,5 @@
>                                                     float aMinZoom,
>                                                     float aMaxZoom) {
> + 
> +  float userZoom = mFrameMetrics.mZoom.width;
> +  if(aAllowZoom == false && aMaxZoom < userZoom || aMinZoom > userZoom) {

&& is higher precedence than || so this is equivalent to:

    (aAllowZoom == false && aMaxZoom < userZoom) || aMinZoom > userZoom

I'm not sure that is what is intended. The style convention would be !aAllowZoom instead of == false.

What problem are we trying to fix here? Is it a problem that could be better fixed elsewhere?
Attachment #760269 - Attachment is obsolete: true
Attachment #760269 - Flags: feedback?(faraojh)
Attachment #761276 - Flags: review?(bgirard)
Attachment #760811 - Attachment is obsolete: true
Attachment #760811 - Flags: feedback?(ajones)
Attachment #761276 - Flags: review?(bgirard) → review+
(In reply to Anthony Jones (:kentuckyfriedtakahe) from comment #7)
> I'm not sure that is what is intended. The style convention would be
> !aAllowZoom instead of == false.
> 
> What problem are we trying to fix here? Is it a problem that could be better
> fixed elsewhere?

Thank you for your feedback.

Here is the problem and the steps to reproduce.
Problem : non-zoomable page can be zoom in/out before setting the constraints on zooming by UpdateZoomConstraints(). 
After this happened and changed aAllowZoom to false by the method, User are not able to adjust the zoomimg anymore badly. 

  Steps 
   1. open google.com
   2. zoom in on the page
   3. input bing.com on URL input box and click the arrow(->)
   4. before loading whole page, keep doing zoom in action on the screen.

  reproduce rate : 10% (I think it's kinds of timing error.)

For resolving this problem and make sure Bug 868047 are not reproducable anymore, Im suggesting the code.
(In reply to JinhoHwang from comment #11)
>   reproduce rate : 10% (I think it's kinds of timing error.)

This probably means that UpdateZoomConstraints() is happening after NotifyLayersUpdated(). That means that the zoom constraints are wrong at the point where we reset the zoom and we're still able to adjust it.
https://hg.mozilla.org/mozilla-central/rev/14cf0572b788
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Please renominate if we suspect that any major web properties are affected.
blocking-b2g: leo? → -
This bug is fairly annoying when it happens and it's not specific to this web page. It is an oversight in the fix for 868047 so I'd prefer to see either both or neither of these patches applied.
Anthony, can we have some risk assessment on this patch? Partner would like to see this on leo if the risk is low.

Hi Alex, renoming per comment 15 as usability and also partner concern.
blocking-b2g: - → leo?
Flags: needinfo?(ajones)
Whiteboard: TaipeiWW
The fix for 868047 eliminates a paint which is causing it to stop painting altogether. This fix makes it act more like it did before so I'm confident that it's a low risk fix. The down side is that you get an bit of unnecessary paint processing on pages that come up quickly. The extra processing is not significant.
Flags: needinfo?(ajones)
blocking-b2g: leo? → leo+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: