Closed Bug 475678 Opened 13 years ago Closed 13 years ago

content absolutely positioned at the bottom of the page shouldn't require scrolling

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set
normal

Tracking

(fennec1.0b2+)

VERIFIED FIXED
Tracking Status
fennec 1.0b2+ ---

People

(Reporter: Dolske, Assigned: mfinkle)

References

Details

Attachments

(2 files)

Attached file Testcase
I found this with http://isthetreegreen.com, attached as a testcase... The top of the page is just a couple of short lines of text, and then I glue a separate line of footer text to the bottom-right corner with:

#footer {
    position: absolute;
    bottom: 2px;
    right: 2px;
}

With Fennec A2, I have to scroll down about a page to see this footer. Same result with "position: fixed".

Stuart suggested this could be a side-effect of sizing the browser to 1024x800 for layout, and that using a size with the same aspect-ratio as the screen might fix it. [screen is 800x480, so 1024x614].
Duplicate of this bug: 483718
Assignee: nobody → pavlov
tracking-fennec: --- → 1.0b2+
Attached patch patchSplinter Review
This patch dynamically adjusts the height based on the width of the window. I tested isthetreegreen.com and about:config. Both work fine with the note that we make room for the urlbar, so you need to pan it out of the way to see the "full" page. For example, at isthetreegreen.com, you need to pan the URLBar out of the way to see the footer.

I also tweaked the name of a method (Browser.getTabFromContent -> Browser.getTabFromChrome) because the former was easily confused with the actual web content.
Assignee: pavlov → mark.finkle
Attachment #381380 - Flags: review?(pavlov)
(In reply to comment #2)

> This patch dynamically adjusts the height based on the width of the window. I
> tested isthetreegreen.com

Note that I've been using a CSS hack on the site to make it look right; you should be able to save the file locally and remove the .footerFennecN800Hack stuff to make sure.
Attachment #381380 - Flags: review+
Comment on attachment 381380 [details] [diff] [review]
patch

Code note: why not use the form

for (let b in browsers) {
  b.style.height = scaledH + "px";
}

It's shorter and clearer.  You could also use this in getTabFromChrome().

The actual algorithm for this looks fine for me.  I approve of the method name change.
(In reply to comment #4)
> (From update of attachment 381380 [details] [diff] [review])
> Code note: why not use the form
> 
> for (let b in browsers) {
>   b.style.height = scaledH + "px";
> }
> 
> It's shorter and clearer.  You could also use this in getTabFromChrome().

for..in is really only to be used with Objects, not Arrays. The loop will iterate over all user-defined properties in addition to the Array elements. There was talk about making for..in do the right thing for Arrays, but I don't know if it's happened.

See note here:
https://developer.mozilla.org/En/Core_JavaScript_1.5_Reference/Statements/For...in#Description
Ah, that makes sense... thanks for the JS lesson!
Attachment #381380 - Flags: review?(pavlov) → review+
http://hg.mozilla.org/mobile-browser/rev/db5372dca854
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Duplicate of this bug: 500732
this appears fixed with the maemo nightly from 20090819
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.