Closed
Bug 732016
Opened 13 years ago
Closed 13 years ago
Maple: scrollIntoView does not clamp to the page size
Categories
(Firefox for Android Graveyard :: General, defect, P1)
Tracking
(firefox14 fixed, blocking-fennec1.0 beta+)
VERIFIED
FIXED
Firefox 15
People
(Reporter: BenWa, Assigned: tnikkel)
References
Details
(Whiteboard: maple [layout])
Attachments
(3 files, 7 obsolete files)
1.87 KB,
patch
|
kats
:
review+
lsblakk
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
10.83 KB,
patch
|
Details | Diff | Splinter Review | |
951 bytes,
patch
|
roc
:
review+
lsblakk
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
When an element is scrolled into view the position isn't clamped to the page size.
STR:
1) Go to google.com.
2) Notice the input field auto selected.
3) Dismiss the onscreen keyboard.
4) The page position is now outside the edge of the page.
Reporter | ||
Comment 1•13 years ago
|
||
Similarly it is possible to use window.scrollTo(x, y); to scroll the page outside the visible region.
Updated•13 years ago
|
OS: Mac OS X → Android
Hardware: x86 → ARM
Whiteboard: maple
Reporter | ||
Updated•13 years ago
|
tracking-fennec: --- → ?
Updated•13 years ago
|
Summary: Maple: scrollIntoView does not clamp to the page size → Maple: scrollIntoView/scrollTo does not clamp to the page size
Comment 3•13 years ago
|
||
nom for triage team. should be fixed before the merge
tracking-fennec: ? → ---
blocking-fennec1.0: --- → ?
Updated•13 years ago
|
blocking-fennec1.0: ? → beta+
Updated•13 years ago
|
Priority: -- → P2
Updated•13 years ago
|
Whiteboard: maple → maple [gfx]
Updated•13 years ago
|
Comment 4•13 years ago
|
||
Note, scrollTo purposefully doesn't clamp so that we can scroll to the outer extremes of the page (our zoom isn't taking into account by the scroll containers, so zooming in makes some area of the page to the lower-right inaccessible). scrollIntoView not clamping is a bug though.
Comment 5•13 years ago
|
||
Kats, the blame for this shows the change comes merging maple to m-c
http://hg.mozilla.org/mozilla-central/rev/0742dd20781e
Assignee: nobody → blassey.bugs
Attachment #607061 -
Flags: review?(bugmail.mozilla)
Comment 6•13 years ago
|
||
Had a look at this... While I think a simple fix would be to change scrollToFocusedInput in browser.js to just bounds check scrollX/scrollY before setting them, it would really be much much nicer if the root scroll frame could be aware of the set resolution and modify things accordingly.
This would also fix problems with fixed position content becoming inaccessible when zooming in (possibly). The clampScrollPosition property could subsequently be removed.
Doing this properly would be a layout task. The quick fix ought to be simple, but I'd be entirely unsurprised to see this break again in either the same, or more subtle ways.
Changing the title of the bug as we explicitly set scrollTo *not* to clamp - that isn't a bug.
Assignee: blassey.bugs → chrislord.net
Status: NEW → ASSIGNED
Summary: Maple: scrollIntoView/scrollTo does not clamp to the page size → Maple: scrollIntoView does not clamp to the page size
Comment 7•13 years ago
|
||
Resetting bits that I must've accidentally changed... Not assigning to myself just yet :)
Assignee: chrislord.net → blassey.bugs
Status: ASSIGNED → NEW
Comment 8•13 years ago
|
||
I don't think it's sufficient to fix the scrollIntoView case; javascript on the page can also call scrollTo with negative numbers and Gecko will obligingly scroll into overscroll. This was a problem in bug 733580, which was duped to here. While I do like gecko allowing us to scroll into that extra zoom area without having to use viewportExcess crud, I think just disabling the clamping altogether is probably a bad idea. We really want gecko to have a better idea of what the zoom is and how much scrolling should be allowed.
Comment 9•13 years ago
|
||
in that case I'm not the best assignee. Jet, can you recommend someone?
Assignee: blassey.bugs → nobody
Whiteboard: maple [gfx] → maple [layout]
Comment 10•13 years ago
|
||
Comment on attachment 607061 [details] [diff] [review]
patch
Review of attachment 607061 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks, that explains why this is happening at least. However this fix just trades one regression for another, as it will prevent us from drawing and setting gecko's scroll position into the bottom-right corner when the zoom > 1.0. I'd like to fix this properly by making the scroll clamping aware of the zoom we're at somehow.
Attachment #607061 -
Flags: review?(bugmail.mozilla) → review-
Updated•13 years ago
|
Updated•13 years ago
|
Comment 11•13 years ago
|
||
Just to note, this bug will be trivial to fix when bug 732971 lands, but it cannot be fixed until then
Comment 12•13 years ago
|
||
I wouldn't say "trivial". To fix this properly, we need to do three things:
1) Allow setting a resolution on content-window presshells
2) Have gecko take the resolution into account when clamping scroll coordinates
3) Turn off the disableScrollClamping thing in browser.js
I think bug 732971 covers step 1, and step 3 is trivial. But step 2 may or may not be trivial.
Comment 13•13 years ago
|
||
When I looked at the code a couple weeks ago it looked like clamping did take resolution into account when set on the content presshell, so number 2 should be taken care of.
Comment 16•13 years ago
|
||
Who owns this?
Comment 17•13 years ago
|
||
Its dependent on bug 732971.
Comment 19•13 years ago
|
||
Note to self and QA, once this lands, we need to check all dependancies and duplicates.
Comment 20•13 years ago
|
||
(In reply to Kartikaya Gupta (:kats) from comment #12)
> I wouldn't say "trivial". To fix this properly, we need to do three things:
> 1) Allow setting a resolution on content-window presshells
> 2) Have gecko take the resolution into account when clamping scroll
> coordinates
> 3) Turn off the disableScrollClamping thing in browser.js
>
> I think bug 732971 covers step 1, and step 3 is trivial. But step 2 may or
> may not be trivial.
Note that currently when I set the resolution on the content-window presShell and disable scroll clamping, it lets me scroll into the bottom-right corner of the page as expected, but it doesn't paint anything in that area. the area of the page that gets painted is dependent on the zoom level, with more of it getting painted the more I zoom out.
Assignee | ||
Comment 21•13 years ago
|
||
(In reply to Kartikaya Gupta (:kats) from comment #20)
> Note that currently when I set the resolution on the content-window
> presShell and disable scroll clamping, it lets me scroll into the
> bottom-right corner of the page as expected, but it doesn't paint anything
> in that area. the area of the page that gets painted is dependent on the
> zoom level, with more of it getting painted the more I zoom out.
Setting resolution on a non-root document is effectively a no-op as far as I can tell.
Assignee | ||
Comment 22•13 years ago
|
||
Making setResolution work on the content document will not help fix this bug in any way.
Updated•13 years ago
|
Assignee: nobody → tnikkel
Updated•13 years ago
|
Priority: P2 → P1
Assignee | ||
Comment 25•13 years ago
|
||
This fixes the problem that I could see on duckduckgo (bug 741992).
Would be good to get some other testing done on it.
Comment 26•13 years ago
|
||
Testing as per #25 would be good.
Comment 27•13 years ago
|
||
Tested on Nightly/14.0a1 2012-04-16 using a Motorola Droid 2 ( Android 2.3) and HTC Desire (Android 2.2).
The original issue at google.com could not be reproduced. Also the issue could not be reproduced at duckduckgo.com(bug 741992). At maps.google.com (Bug 735652) there is a visible transition from the bottom to the top of the page.
The autocomplete suggestions are no longer detached (Bug 736008) but I am seeing a second tap in the same textfield having other targets (focusing other elements like links or buttons) at mail.yahoo.com (Bug 744769 or Bug 740005).
For more investigations on the clamping behavior please provide a link to a custom build described in https://bugzilla.mozilla.org/show_bug.cgi?id=741992#c11. Leaving the qawanted tag for further testing. Please remove if it is not needed anymore.
Adrian, thanks for testing. We would also want to test this with the patch from this bug, which has not landed yet.
Updated•13 years ago
|
Whiteboard: maple [layout] → maple [layout][has wip patch]
Assignee | ||
Comment 30•13 years ago
|
||
So current frontend code wants to always set the scroll top left to be (approximately) the top left of what it is showing on the screen.
Maybe we want to move to the way XUL fennec did it where it didn't do this, but where the scroll position followed what would be visible in the zoomed out view.
This patch allows the current way to work and turn on scroll clamping (because the complete lack of scroll clamping can cause problems).
Attachment #615553 -
Attachment is obsolete: true
Attachment #615860 -
Flags: review?(roc)
Assignee | ||
Comment 31•13 years ago
|
||
A version that compiles, oops.
Attachment #615860 -
Attachment is obsolete: true
Attachment #615872 -
Flags: review?(roc)
Attachment #615860 -
Flags: review?(roc)
Comment on attachment 615872 [details] [diff] [review]
patch
Review of attachment 615872 [details] [diff] [review]:
-----------------------------------------------------------------
::: layout/generic/nsGfxScrollFrame.cpp
@@ +1944,5 @@
> if (aShouldClamp) {
> +#ifdef MOZ_JAVA_COMPOSITOR
> + // If we are using the java compositor then we want to fake the scrollport
> + // size for the purpose of clamping the scroll position so the java
> + // compositor can scroll to what it is actually showing on screen.
This is really hacky :-(.
Do we need a new presshell API to set the scrollport? I think we probably do.
Assignee | ||
Comment 33•13 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #32)
> This is really hacky :-(.
Yeah, you're right.
> Do we need a new presshell API to set the scrollport? I think we probably do.
Ok.
Assignee | ||
Comment 34•13 years ago
|
||
Attachment #615872 -
Attachment is obsolete: true
Attachment #616063 -
Flags: review?(roc)
Attachment #616063 -
Flags: feedback?(bugmail.mozilla)
Attachment #615872 -
Flags: review?(roc)
Comment 35•13 years ago
|
||
Comment on attachment 616063 [details] [diff] [review]
Add a scroll port api and use it for clamping.
Review of attachment 616063 [details] [diff] [review]:
-----------------------------------------------------------------
Seems reasonable to me. I can put together a patch that makes the front-end call this.
Attachment #616063 -
Flags: feedback?(bugmail.mozilla) → feedback+
Updated•13 years ago
|
Status: NEW → ASSIGNED
Comment 36•13 years ago
|
||
I think this patch should allow testing of the scroll port API. I haven't tried it myself but it's pretty straightforward.
Assignee | ||
Comment 37•13 years ago
|
||
Comment on attachment 616133 [details] [diff] [review]
Patch to test scroll port API
This works well. Do you want to get review for this?
Attachment #616133 -
Flags: feedback+
Personally I think a new virtual method on all display items is cleaner than checking display item types.
I wonder though, would it make more sense to just walk the frame tree to find images instead of building display lists? Is there much win from culling images that are covered by other stuff? If not, we should probably just walk the frame tree.
Comment on attachment 616063 [details] [diff] [review]
Add a scroll port api and use it for clamping.
Review of attachment 616063 [details] [diff] [review]:
-----------------------------------------------------------------
::: layout/base/nsIPresShell.h
@@ +1268,5 @@
> + void SetScrollPort(nscoord aWidth, nscoord aHeight);
> + bool IsScrollPortSet() { return mScrollPortSet; }
> + nsSize GetScrollPort() {
> + NS_ASSERTION(mScrollPortSet, "asking for scroll port when its not set?");
> + return mScrollPortSize;
These should be renamed. We're not actually changing the scroll port size, just the size that's used when clamping the scroll position. How about SetScrollPositionClampingScrollPortSize?
Attachment #616063 -
Flags: review?(roc) → review+
Would be good to have a test here. I think a mochitest-chrome test wouldn't be too hard.
Comment 41•13 years ago
|
||
Assumes the patch in attachment 616063 [details] [diff] [review] has been applied.
Attachment #616133 -
Attachment is obsolete: true
Attachment #616439 -
Flags: review?(chrislord.net)
Assignee | ||
Updated•13 years ago
|
Attachment #607061 -
Attachment is obsolete: true
Assignee | ||
Comment 42•13 years ago
|
||
Comment 38 was intended for a different bug.
Comment 43•13 years ago
|
||
Comment on attachment 616439 [details] [diff] [review]
Use new scrollport API in fennec frontend
Review of attachment 616439 [details] [diff] [review]:
-----------------------------------------------------------------
One nit, looks fine.
::: mobile/android/chrome/content/browser.js
@@ +1721,5 @@
> // Transform coordinates based on zoom
> let x = aViewport.x / aViewport.zoom;
> let y = aViewport.y / aViewport.zoom;
>
> // Set scroll position
Alter this comment to something along the lines of "Set scroll-port and scroll position"?
Attachment #616439 -
Flags: review?(chrislord.net) → review+
Comment 44•13 years ago
|
||
Updated for review comments, carrying r+. :tn, feel free to land this when you land the other patch.
Attachment #616439 -
Attachment is obsolete: true
Attachment #616561 -
Flags: review+
Assignee | ||
Comment 45•13 years ago
|
||
Patch with the renamed API.
Attachment #616063 -
Attachment is obsolete: true
Assignee | ||
Comment 46•13 years ago
|
||
Assignee | ||
Comment 47•13 years ago
|
||
I forgot the test! Oops! I'll try to come up with one.
Comment 48•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/492d12fa8b65
https://hg.mozilla.org/mozilla-central/rev/83faa1da3db8
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 14
Comment 49•13 years ago
|
||
This caused a number of major regressions, see bug 747681 and bug 747680.
Let's back this out.
Comment 51•13 years ago
|
||
Backed out:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8238bffb52b4
https://hg.mozilla.org/integration/mozilla-inbound/rev/064655d7ea01
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 52•13 years ago
|
||
We only want to apply this special clamping on the root scroll frame even when the API is used, not every scroll frame in the document.
I'll merge this into the main patch when relanding.
Attachment #617660 -
Flags: review?(roc)
Assignee | ||
Updated•13 years ago
|
Whiteboard: maple [layout][has wip patch] → maple [layout]
Comment 53•13 years ago
|
||
Assignee | ||
Comment 54•13 years ago
|
||
Comment on attachment 617660 [details] [diff] [review]
do it only for the root scroll frame
This should fix all of the regressions that were posted in bugs caused by this.
Comment on attachment 617660 [details] [diff] [review]
do it only for the root scroll frame
Review of attachment 617660 [details] [diff] [review]:
-----------------------------------------------------------------
oops
Attachment #617660 -
Flags: review?(roc) → review+
Assignee | ||
Comment 56•13 years ago
|
||
Comment 57•13 years ago
|
||
Assignee | ||
Comment 58•13 years ago
|
||
To avoid confusion, bug 747681 turned out to be caused by something else.
Updated•13 years ago
|
Whiteboard: maple [layout] → maple [layout][re-landed on inbound]
Comment 59•13 years ago
|
||
Comment on attachment 616561 [details] [diff] [review]
Use new scrollport API in fennec frontend
Will need aurora for mobile
Attachment #616561 -
Flags: approval-mozilla-aurora?
Comment 60•13 years ago
|
||
Comment on attachment 617660 [details] [diff] [review]
do it only for the root scroll frame
Will need aurora for mobile
Attachment #617660 -
Flags: approval-mozilla-aurora?
Comment 61•13 years ago
|
||
1) Bug 747681 was Verified as Fixed on Nightly/15.0a1 2012-04-24 and the issue is also not reproducible on Inbound/14.0a1 2012-04-24.
2) Bug 747680 was Verified as Fixed on Nightly/15.0a1 2012-04-24 and the issue is also not reproducible on Inbound/14.0a1 2012-04-24.
3) Bug 747944 is not reproducible on Inbound/14.0a1 2012-04-24.
Tested on:
Galaxy Nexus (Android 4.0.2), HTC Desire (Android 2.2.2)
Comment 62•13 years ago
|
||
(In reply to adrian tamas from comment #61)
> 1) Bug 747681 was Verified as Fixed on Nightly/15.0a1 2012-04-24 and the
> issue is also not reproducible on Inbound/14.0a1 2012-04-24.
> 2) Bug 747680 was Verified as Fixed on Nightly/15.0a1 2012-04-24 and the
> issue is also not reproducible on Inbound/14.0a1 2012-04-24.
> 3) Bug 747944 is not reproducible on Inbound/14.0a1 2012-04-24.
This patch would not be in the current nightly since its not on central yet.
QA still waiting for it to be checked into Central.
Comment 65•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/4f2dd5f1c565
https://hg.mozilla.org/mozilla-central/rev/73d5ffc47885
Status: REOPENED → RESOLVED
Closed: 13 years ago → 13 years ago
Resolution: --- → FIXED
Whiteboard: maple [layout][re-landed on inbound] → maple [layout]
Updated•13 years ago
|
Attachment #616561 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•13 years ago
|
Attachment #617660 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 66•13 years ago
|
||
This is currently only in 15, thus the aurora flags.
Target Milestone: Firefox 14 → Firefox 15
Assignee | ||
Comment 67•13 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/a38075d6e6d0
https://hg.mozilla.org/releases/mozilla-aurora/rev/e08b460bcb60
Target Milestone: Firefox 15 → Firefox 14
Updated•13 years ago
|
status-firefox14:
--- → fixed
Target Milestone: Firefox 14 → Firefox 15
Comment 68•13 years ago
|
||
Initial behavior described in the bug and behaviors from the bugs duped after this one are no longer reproducible. Verifying the issue as fixed.
Verified on:
Aurora 14.0a2 2012-04-29
Nightly 15.0a1 2012-04-30
Device: HTC Desire
OS: Android 2.2
Status: RESOLVED → VERIFIED
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•