Closed
Bug 898580
Opened 11 years ago
Closed 11 years ago
Contents needs to inform APZC about scroll events on Metro
Categories
(Core :: Graphics: Layers, defect)
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: botond, Assigned: botond)
References
Details
(Whiteboard: [preview] [depends on patch for bug 895905])
Attachments
(3 files, 6 obsolete files)
2.85 KB,
patch
|
botond
:
review+
|
Details | Diff | Splinter Review |
12.20 KB,
patch
|
botond
:
review+
|
Details | Diff | Splinter Review |
2.39 KB,
patch
|
botond
:
review+
|
Details | Diff | Splinter Review |
As a result of the fix to bug 859929, APZC needs to be informed about scroll events. This was implemented for Fenec in bug 859929, and for B2G in bug 895905. While I haven't looked into it, it's likely that something will have to be done specifically for Metro as well.
Assignee | ||
Updated•11 years ago
|
Updated•11 years ago
|
Blocks: metro-apzc
Updated•11 years ago
|
Whiteboard: [preview]
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → botond
Assignee | ||
Comment 1•11 years ago
|
||
Now that multi-APZC has landed, the fix for this bug needs to take that into account as well. That is, when content informs APZC about a scroll event, it needs to along send along information that identifies the (sub)frame that was scrolled.
Comment 2•11 years ago
|
||
How's this going botond?
Assignee | ||
Comment 3•11 years ago
|
||
(In reply to Brian R. Bondy [:bbondy] from comment #2)
> How's this going botond?
Fairly well. I have worked out a strategy for getting the required info to the APZC in the presence of multi-APZC, and I'm starting to implement it now. It will depend on some changes in bug 895905.
One thing that is holding up bug 895905 from landing is that there are some multi-APZC-related regressions in B2G, and as a result I couldn't test my patch for that properly.
I will hopefully have a patch for this bug later today. (Testing that, in turn, may be held up a bit by multi-APZC-related regressions on Metro).
Comment 4•11 years ago
|
||
Sounds great, thanks!
Assignee | ||
Comment 5•11 years ago
|
||
> I have worked out a strategy for getting the required info to
> the APZC in the presence of multi-APZC
Just to summarize this strategy:
- Modify the "scroll" async message sent in ContentScroll.sendScroll()
browser/metro/base/content/bindings/browser.js to include
- the view ID of the element being scrolled
- the pres shell ID of the pres shell associated with the element
- the scroll offset
This info can be gathered in JS code in roughly the same way as it's
gathered in C++ code in TabChild::HandleEvent() in the patch for
bug 895905.
- The handler in browser/metro/base/content/bindings/browser.xml can
probably ignore "scroll" async messages that do not pertain to the
root scroll frame.
- Add a new handler for the "scroll" async message in
browser/metro/base/content/apzc.js, and in response to it, forward
the information to C++ code via the observer mechanism.
- Handle the message in C++ code (probably in MetroWidget.cpp) by calling
APZCTreeManager::UpdateScrollOffset().
Any feedback is appreciated.
Comment 6•11 years ago
|
||
That sounds right to me.
Assignee | ||
Comment 7•11 years ago
|
||
Patch that implements the strategy outlined above.
Attachment #788384 -
Flags: review?(netzen)
Attachment #788384 -
Flags: review?(bugmail.mozilla)
Comment 8•11 years ago
|
||
Comment on attachment 788384 [details] [diff] [review]
bug898580.patch
Review of attachment 788384 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with commit message fixed and nits addressed.
::: browser/metro/base/content/apzc.js
@@ +50,5 @@
> break;
> }
> case 'TabClose': {
> let browser = aEvent.originalTarget.linkedBrowser;
> + browser.removeEventListener("pageshow", this, true);
By default I would lean towards putting this fix into another patch, but if brian thinks this is fine then I have no problems with it.
@@ +126,5 @@
> } else if (aTopic == "apzc-handle-pan-end") {
> Util.dumpLn("APZC pan-end");
> }
> + },
> + receiveMessage: function(aMessage) {
blank line above receiveMessage
::: browser/metro/base/content/bindings/browser.js
@@ +688,4 @@
>
> + if (target == content.document) {
> + if (this._scrollOffset.x == scrollOffset.x && this._scrollOffset.y == scrollOffset.y)
> + return;
Braces on the if
@@ +688,5 @@
>
> + if (target == content.document) {
> + if (this._scrollOffset.x == scrollOffset.x && this._scrollOffset.y == scrollOffset.y)
> + return;
> + else {
No need for the else after the return
@@ +694,5 @@
> + isRoot = true;
> + }
> + }
> + }
> + else {
} else {
::: dom/interfaces/base/nsIDOMWindowUtils.idl
@@ +1193,5 @@
> /**
> + * Find the view ID for a given element. This is the reverse of
> + * findElementWithViewId().
> + */
> + nsViewID getViewId(in nsIDOMElement aElement);
Whenever making changes to these scriptable IDL files you need to change the uuid at the top of the IDL file. You can generate a new uuid by asking firebot on IRC or using the uuidgen command-line tool if you have that installed.
Attachment #788384 -
Flags: review?(bugmail.mozilla) → review+
Comment 9•11 years ago
|
||
Comment on attachment 788384 [details] [diff] [review]
bug898580.patch
Review of attachment 788384 [details] [diff] [review]:
-----------------------------------------------------------------
This is looking good but I think I still experience the issue this should solve.
If I scroll down the page with the mouse scrollbar, then try to pan with touch, it jumps back up to the top of the page for a second and then back down to continue the pan.
::: browser/metro/base/content/apzc.js
@@ +50,5 @@
> break;
> }
> case 'TabClose': {
> let browser = aEvent.originalTarget.linkedBrowser;
> + browser.removeEventListener("pageshow", this, true);
This is fine.
::: dom/base/nsDOMWindowUtils.cpp
@@ +1695,4 @@
> }
>
> NS_IMETHODIMP
> +nsDOMWindowUtils::GetViewId(nsIDOMElement* aElement, nsViewID* aResult)
Please split this out for someone in DOM to review.
::: widget/windows/winrt/MetroWidget.cpp
@@ +1478,5 @@
> +
> +NS_IMETHODIMP
> +MetroWidget::Observe(nsISupports *subject, const char *topic, const PRUnichar *data)
> +{
> + LogFunction();
nit: this probably isn't too useful of a logged function moving forward
@@ +1492,5 @@
> + &presShellId,
> + &scrollOffset.x,
> + &scrollOffset.y);
> + if (matched != 4)
> + return NS_ERROR_UNEXPECTED;
nit: Please log a warning here
Attachment #788384 -
Flags: review?(netzen) → feedback+
Assignee | ||
Comment 10•11 years ago
|
||
(In reply to Brian R. Bondy [:bbondy] from comment #9)
> This is looking good but I think I still experience the issue this should
> solve.
> If I scroll down the page with the mouse scrollbar, then try to pan with
> touch, it jumps back up to the top of the page for a second and then back
> down to continue the pan.
I can't reproduce this. Could you give me an example of a website for which you see this?
Flags: needinfo?(netzen)
Comment 11•11 years ago
|
||
I rebuilt incrementally and see this on all websites, maybe it didn't pick something up though. I'm doing a clobber right now with the patch applied though so I'll report back when that's done.
Flags: needinfo?(netzen)
Assignee | ||
Comment 12•11 years ago
|
||
Split out addition to nsIDOMWindowUtils for separate review.
Attachment #788956 -
Flags: review?(bugs)
Assignee | ||
Comment 13•11 years ago
|
||
Rest of patch, with review comments addressed.
Attachment #788384 -
Attachment is obsolete: true
Attachment #788957 -
Flags: review?(netzen)
Assignee | ||
Comment 14•11 years ago
|
||
Try server results: https://tbpl.mozilla.org/?tree=Try&rev=f53309798180
Comment 15•11 years ago
|
||
Comment on attachment 788957 [details] [diff] [review]
bug898580.patch
Review of attachment 788957 [details] [diff] [review]:
-----------------------------------------------------------------
drive by nits -
::: widget/windows/winrt/MetroWidget.cpp
@@ +847,5 @@
> +
> + nsresult rv;
> + nsCOMPtr<nsIObserverService> observerService = do_GetService("@mozilla.org/observer-service;1", &rv);
> + if (NS_SUCCEEDED(rv)) {
> + observerService->AddObserver(this, "scroll-offset-changed", false);
You add this, but you don't remove it. You can remove them in Destroy(). See the patch in bug 901607.
::: widget/windows/winrt/MetroWidget.h
@@ +206,5 @@
> mMetroInput = aMetroInput;
> }
>
> + // nsIObserver implementation
> + NS_IMETHOD Observe(nsISupports *subject, const char *topic, const PRUnichar *data);
you can use
NS_DECL_NSIOBSERVER
Updated•11 years ago
|
OS: Linux → Windows 8 Metro
Assignee | ||
Updated•11 years ago
|
Whiteboard: [preview] → [preview] [depends on patch for bug 895905]
Assignee | ||
Comment 16•11 years ago
|
||
Updated patch to address :jimm's review comments.
Attachment #788957 -
Attachment is obsolete: true
Attachment #788957 -
Flags: review?(netzen)
Attachment #789145 -
Flags: review?(netzen)
Comment 17•11 years ago
|
||
Comment on attachment 789145 [details] [diff] [review]
Part 1 - Inform APZC about scroll events on Metro
Review of attachment 789145 [details] [diff] [review]:
-----------------------------------------------------------------
I'm not sure if there is a problem here or somewhere else but I'm still experiencing the jumping.
I can reproduce it every time and it seems to happen on any site.
Steps to reproduce:
1. Load slashdot.org
2. Scroll by using your mouse left button and dragging the scrollbar down on the right of the window
3. Try to pan with touch
Actual results:
It jumps to the old location before you scrolled with, and then immediately goes back to where you are panning
Expected results:
No jumping.
It would be nice to try and reproduce / fix this during the time that you have to wait anyway for the dependent patch to land.
Attachment #789145 -
Flags: review?(netzen) → review+
Assignee | ||
Comment 18•11 years ago
|
||
Removed the old scroll offset updating code in AsyncPanZoomController::NotifyLayersUpdated. Now that the new mechanism is in place for Fennec, B2G, and Metro, nothing needs it anymore.
Attachment #789739 -
Flags: review?(bugmail.mozilla)
Assignee | ||
Updated•11 years ago
|
Attachment #789739 -
Flags: review?(netzen)
Updated•11 years ago
|
Attachment #789739 -
Flags: review?(bugmail.mozilla) → review+
Updated•11 years ago
|
Attachment #789739 -
Flags: review?(netzen) → review+
Comment 19•11 years ago
|
||
I still have that problem with it jumping up even with the new patch. Also I get the whole screen turning black after panning issue again. I don't think the later one is related to this bug though.
Comment 20•11 years ago
|
||
Comment on attachment 788956 [details] [diff] [review]
bug898580-dom.patch
> NS_IMETHODIMP
>+nsDOMWindowUtils::GetViewId(nsIDOMElement* aElement, nsViewID* aResult)
>+{
>+ nsCOMPtr<nsIContent> content = do_QueryInterface(aElement);
>+ if (content && nsLayoutUtils::FindIDFor(content, aResult))
>+ return NS_OK;
>+ return NS_ERROR_NOT_AVAILABLE;
>+}
{} with 'if'
Attachment #788956 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 21•11 years ago
|
||
(In reply to Brian R. Bondy [:bbondy] from comment #19)
> I still have that problem with it jumping up even with the new patch.
What device do you experience this on?
Flags: needinfo?(netzen)
Comment 22•11 years ago
|
||
Sony vaio - normal dpi, although it's windows 8.1 so that could be a factor as well.
Flags: needinfo?(netzen)
Assignee | ||
Comment 23•11 years ago
|
||
Updated bug898580-dom.patch to address :smaug's comment. Carrying r+.
Attachment #788956 -
Attachment is obsolete: true
Attachment #790273 -
Flags: review+
Assignee | ||
Comment 24•11 years ago
|
||
Comment on attachment 790273 [details] [diff] [review]
Part 0 - Add nsIDOMWindowUtils.getViewId(element)
Part 0 - Add nsIDOMWindowUtils.getViewId(element)
Assignee | ||
Updated•11 years ago
|
Attachment #790273 -
Attachment description: bug898580-dom.patch → Part 1 - Add nsIDOMWindowUtils.getViewId(element)
Assignee | ||
Updated•11 years ago
|
Attachment #790273 -
Attachment description: Part 1 - Add nsIDOMWindowUtils.getViewId(element) → Part 0 - Add nsIDOMWindowUtils.getViewId(element)
Assignee | ||
Updated•11 years ago
|
Attachment #789145 -
Attachment description: bug898580.patch → Part 1 - Inform APZC about scroll events on Metro
Assignee | ||
Updated•11 years ago
|
Attachment #789739 -
Attachment description: bug898580-part2.patch → Part 2 - Remove obsoleted code in APZC
Comment 25•11 years ago
|
||
Is this work ready to land? It's holding up bug 901607.
Assignee | ||
Comment 26•11 years ago
|
||
(In reply to Jim Mathies [:jimm] from comment #25)
> Is this work ready to land? It's holding up bug 901607.
Brian, should we take additional steps to reproduce the issue described in comment 19 (for example, try to install windows 8.1 on a test device) before landing this, or can we land this now? The dependent bug has landed, so this is otherwise ready to land.
Flags: needinfo?(netzen)
Comment 27•11 years ago
|
||
As long as it applies cleanly still and passes tests, let's just land it and post issues for followup work. Thanks for checking though! :)
Flags: needinfo?(netzen)
Assignee | ||
Comment 28•11 years ago
|
||
Attachment #790273 -
Attachment is obsolete: true
Attachment #792839 -
Flags: review+
Assignee | ||
Comment 29•11 years ago
|
||
Attachment #789145 -
Attachment is obsolete: true
Attachment #792840 -
Flags: review+
Assignee | ||
Comment 30•11 years ago
|
||
Attachment #789739 -
Attachment is obsolete: true
Attachment #792841 -
Flags: review+
Assignee | ||
Comment 31•11 years ago
|
||
Rebased patches, carrying r+.
Comment 32•11 years ago
|
||
Botond, what are the side effects of this bug not being fixed? Is there be some sort of vidual side effect in current nightlies that would be addressed once these patches land?
Comment 33•11 years ago
|
||
(In reply to Jim Mathies [:jimm] from comment #32)
> Botond, what are the side effects of this bug not being fixed? Is there be
> some sort of vidual side effect in current nightlies that would be addressed
> once these patches land?
*Is there some sort of visual side effect..
Assignee | ||
Comment 34•11 years ago
|
||
(In reply to Jim Mathies [:jimm] from comment #32)
> Botond, what are the side effects of this bug not being fixed? Is there be
> some sort of vidual side effect in current nightlies that would be addressed
> once these patches land?
If content on the page causes a scrollTo(), without these patches the APZC does not get notified of the change in scroll offset. As a result, a subsequent pan will cause a scroll relative to the old scroll offset, causing the page to briefly jump back to the old scroll offset.
By the way, these patches should land later today. Just waiting for a final try server run.
Assignee | ||
Comment 35•11 years ago
|
||
Try server results: https://tbpl.mozilla.org/?tree=Try&rev=e2a52b21ec02
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 36•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/842ac636819c
https://hg.mozilla.org/integration/mozilla-inbound/rev/3078301c9b34
https://hg.mozilla.org/integration/mozilla-inbound/rev/1383705460ab
Keywords: checkin-needed
Comment 37•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/842ac636819c
https://hg.mozilla.org/mozilla-central/rev/3078301c9b34
https://hg.mozilla.org/mozilla-central/rev/1383705460ab
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Comment 38•11 years ago
|
||
I'm getting this error:
c:/t1/hg/comm-central/mozilla/dom/base/nsDOMWindowUtils.cpp(1698) : error C2039: 'GetViewId' : is not a member of 'nsDOMWindowUtils'
c:\t1\hg\comm-central\mozilla\dom\base\nsDOMWindowUtils.h(18) : see declaration of 'nsDOMWindowUtils'
make.py[4]: Leaving directory 'c:\t1\hg\objdir-sm\mozilla\dom\bindings'
Comment 39•11 years ago
|
||
Philip: does your repo include the change to nsIDOMWindowUtils.idl from revision 842ac636819c? (first patch on this bug). Do you get this error with a clobber build?
Updated•11 years ago
|
Flags: needinfo?(philip.chee)
Comment 40•11 years ago
|
||
> Philip: does your repo include the change to nsIDOMWindowUtils.idl from revision
> 842ac636819c? (first patch on this bug).
Yes.
> Do you get this error with a clobber build?
I'll try a CLOBBER. Will report back.
Flags: needinfo?(philip.chee)
Comment 41•11 years ago
|
||
CLOBBER fixed, Thanks.
Updated•10 years ago
|
OS: Windows 8 Metro → Windows 8.1
You need to log in
before you can comment on or make changes to this bug.
Description
•