Closed Bug 776591 Opened 12 years ago Closed 12 years ago

unitless length quirk is supported in top/left/right but not bottom

Categories

(Core :: CSS Parsing and Computation, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla17
Tracking Status
firefox17 + verified

People

(Reporter: cwiiis, Assigned: dbaron)

References

Details

(Keywords: regression)

Attachments

(2 files)

It seems that the 'bottom' property for position: fixed elements has broken at some point - it's treated as if the property isn't there. Inspecting a page shows the property missing on affected elements.

Test-case here: http://chrislord.net/files/mozilla/fixed.html

This is a regression.
mbrubeck rightly points out on IRC that my test page lacks units for bottom, which is why the declarations are getting dropped. However, this same CSS worked a few revs ago and continues to work in Chrome, so something has changed here. mbrubeck also points out that the declarations for top/left/right also continue to work, so this is confusing at best.
Regression from bug 774122.
CSS Quirks Mode should probably be updated to support the unitless length quirk for "bottom" if it is supported by "top"/"left"/"right":
http://dvcs.w3.org/hg/quirks-mode/raw-file/tip/Overview.html#support-unitless-lengths
Summary: bottom positioning of position: fixed is handled incorrectly → unitless length quirk is supported in top/left/right but not bottom
Possibly.  Are there web pages that depend on that behavior?
Component: Layout → Style System (CSS)
(In reply to Boris Zbarsky (:bz) from comment #4)
> Possibly.  Are there web pages that depend on that behavior?

Oh, how I miss Google Code Search.  Using regular Google search it's hard to find actual live stylesheets, but here are some code snippets that depend on unitless bottom.  Not sure if they are still used on any live sites, but they do show that authors are likely to write (or copy) code that depends on the old behavior.

I can find tons of these examples, and I'm pretty sure with the right tools I could find plenty of live examples too, especially since all of this code still works in current versions of Firefox and other browsers:

http://forum.ucoz.com/forum/8-15269-1
http://pastebin.com/EWeghcvQ
http://www.indexhibit.org/forum/thread/6495/
http://www.blogskins.com/download.php?sid=360062&format=xanga

And here's one live page that runs into a parse error in Nightly because of this bug:

http://www.geocities.ws/buttemont/
Comment on attachment 644999 [details] [diff] [review]
Accept unitless lengths in quirks mode for bottom, just as for left/top/right.  ()

Matt, thanks.  That's certainly good enough for me.  ;)

r=em
Attachment #644999 - Flags: review?(bzbarsky) → review+
I reported this issue in the bug tracker for the Quirks Mode spec:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=18404
Assignee: nobody → dbaron
In https://www.w3.org/Bugs/Public/show_bug.cgi?id=18404 Simon Pieters points to more data about how common unitless values are for various properties, and asks whether we think any other properties should be added.  Any opinions?
https://hg.mozilla.org/mozilla-central/rev/d656e6d3d996
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
Keywords: verifyme
Attached image Screen Shot
I've tested this on 17.0b5 and on Nightly 19.0a1 (2012-11-11) on Windows 7 x64 and Ubuntu x32 and the issue appears as it did on nightly 17.0a1 (2012-08-20). I can see that pressing multiple times on Reflow botton, text appears from bottom left corner, under the blue object and it continues out of the bottom right page range, dilating the page and moving the objects from right top and bottom too out of page range. 
Please see attached screen shot.
I was able to reproduce this issue on the Nightly from 21st of July, when the problem wasn't fixed, User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Firefox/17.0, Build ID: 20120721030555.

The issue is still reproducible on Firefox 17 Release Candidate, where it should be fixed, User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Firefox/17.0, Build ID: 20121116115405.

The issue is the one presented in comment 12, and as seen in the attached screenshot, which is a faulty behaviour. (on Chrome the testcase works as expected, with the yellow bottom rectangle in a fix position after pressing several times the "Reflow" button)

After taking all this into consideration, I will reopen the bug.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 12 has nothing to do with this bug, as far as I can tell.  In particular, the observed behavior that comment describes is correct given the testcase.

Not only that, but the linked-to testcase has been modified so that it no longer shows the original bug that was reported here.  So if you're trying to verify the fix, you will need to use a different testcase that actually shows the original bug.
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
(In reply to Boris Zbarsky (:bz) from comment #14)
> Comment 12 has nothing to do with this bug, as far as I can tell.  In
> particular, the observed behavior that comment describes is correct given
> the testcase.
> 
> Not only that, but the linked-to testcase has been modified so that it no
> longer shows the original bug that was reported here.  So if you're trying
> to verify the fix, you will need to use a different testcase that actually
> shows the original bug.

Boris, I tried reproducing this issue on builds without the fix to see what I need to verify. The bottom property works fine for me on the builds with the bug and without the fix when I have elements that contain:
{
position:fixed;
bottom:30px;
...
}

Are there any other details I should add to reproduce this bug?
(In reply to Manuela Muntean from comment #15)
> (In reply to Boris Zbarsky (:bz) from comment #14)
> > Comment 12 has nothing to do with this bug, as far as I can tell.  In
> > particular, the observed behavior that comment describes is correct given
> > the testcase.
> > 
> > Not only that, but the linked-to testcase has been modified so that it no
> > longer shows the original bug that was reported here.  So if you're trying
> > to verify the fix, you will need to use a different testcase that actually
> > shows the original bug.
> 
> Boris, I tried reproducing this issue on builds without the fix to see what
> I need to verify. The bottom property works fine for me on the builds with
> the bug and without the fix when I have elements that contain:
> {
> position:fixed;
> bottom:30px;
> ...
> }
> 
> Are there any other details I should add to reproduce this bug?

To test this bug, you need to remove the 'px' from the bottom property. That's what this bug is about. When this bug manifests, specifying bottom:30; will have no effect, when this is fixed, it'll act the same as if you specified '30px'.
Taking into consideration the suggestion Chris gave in comment 16, this issue is fixed.
Tested on Firefox 17 Release Candidate, build 2.

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0
Build ID: 20121119183901
mass remove verifyme requests greater than 4 months old
Keywords: verifyme
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: