Last Comment Bug 776591 - unitless length quirk is supported in top/left/right but not bottom
: unitless length quirk is supported in top/left/right but not bottom
Status: RESOLVED FIXED
: regression
Product: Core
Classification: Components
Component: CSS Parsing and Computation (show other bugs)
: Trunk
: All All
: P3 normal (vote)
: mozilla17
Assigned To: David Baron :dbaron: ⌚️UTC-10
:
: Jet Villegas (:jet)
Mentors:
Depends on:
Blocks: 774122
  Show dependency treegraph
 
Reported: 2012-07-23 10:30 PDT by Chris Lord [:cwiiis]
Modified: 2014-01-10 10:42 PST (History)
8 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
+
verified


Attachments
Accept unitless lengths in quirks mode for bottom, just as for left/top/right. () (1.92 KB, patch)
2012-07-23 11:36 PDT, David Baron :dbaron: ⌚️UTC-10
bzbarsky: review+
Details | Diff | Splinter Review
Screen Shot (396.81 KB, image/jpeg)
2012-11-12 02:57 PST, Mihai Morar, (:MihaiMorar)
no flags Details

Description Chris Lord [:cwiiis] 2012-07-23 10:30:27 PDT
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.
Comment 1 Chris Lord [:cwiiis] 2012-07-23 10:33:07 PDT
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.
Comment 2 Matt Brubeck (:mbrubeck) 2012-07-23 10:36:31 PDT
Regression from bug 774122.
Comment 3 Matt Brubeck (:mbrubeck) 2012-07-23 10:38:12 PDT
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
Comment 4 Boris Zbarsky [:bz] (still a bit busy) 2012-07-23 11:06:38 PDT
Possibly.  Are there web pages that depend on that behavior?
Comment 5 David Baron :dbaron: ⌚️UTC-10 2012-07-23 11:36:06 PDT
Created attachment 644999 [details] [diff] [review]
Accept unitless lengths in quirks mode for bottom, just as for left/top/right.  ()
Comment 6 Matt Brubeck (:mbrubeck) 2012-07-23 11:43:52 PDT
(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 7 Boris Zbarsky [:bz] (still a bit busy) 2012-07-23 12:07:03 PDT
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
Comment 8 Matt Brubeck (:mbrubeck) 2012-07-25 10:19:31 PDT
I reported this issue in the bug tracker for the Quirks Mode spec:
https://www.w3.org/Bugs/Public/show_bug.cgi?id=18404
Comment 9 Matt Brubeck (:mbrubeck) 2012-07-25 14:48:09 PDT
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?
Comment 10 David Baron :dbaron: ⌚️UTC-10 2012-08-20 19:28:16 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/d656e6d3d996
Comment 11 Ed Morley [:emorley] 2012-08-21 06:28:28 PDT
https://hg.mozilla.org/mozilla-central/rev/d656e6d3d996
Comment 12 Mihai Morar, (:MihaiMorar) 2012-11-12 02:57:18 PST
Created attachment 680571 [details]
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.
Comment 13 Manuela Muntean [Away] 2012-11-19 06:07:34 PST
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.
Comment 14 Boris Zbarsky [:bz] (still a bit busy) 2012-11-19 06:13:18 PST
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.
Comment 15 Manuela Muntean [Away] 2012-11-21 05:29:36 PST
(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?
Comment 16 Chris Lord [:cwiiis] 2012-11-21 06:07:33 PST
(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'.
Comment 17 Manuela Muntean [Away] 2012-11-21 06:18:29 PST
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
Comment 18 Tracy Walker [:tracy] 2014-01-10 10:42:03 PST
mass remove verifyme requests greater than 4 months old

Note You need to log in before you can comment on or make changes to this bug.