Closed Bug 610567 Opened 14 years ago Closed 14 years ago

moz-box-shadow adds undesired margins to right and bottom sides of element

Categories

(Core :: Layout: Block and Inline, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 446693

People

(Reporter: dan, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-us) AppleWebKit/533.18.1 (KHTML, like Gecko) Version/5.0.2 Safari/533.18.5
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10

I have a 1000 pixel wide DIV with margin-left and margin-right set to AUTO so that it is centered. I've applied a shadow using -moz-box-shadow: rgba(0, 51, 102, 0.5) 0px 15px 30px;

Safari and Chrome behave as I expect (using their specific -webkit-box-shadow tag) and there is NO horizontal scrollbar in the browser until the viewport becomes exactly 999 pixels or less wide.

Firefox shows a horizontal scrollbar much sooner... for the shadow... BUT it still aligns the left margin of the DIV to the left side of the viewport once the viewport reaches 1000 pixels wide. However, I'm still able to scroll ~20 or 30 pixels to the right of the DIV.

It's very annoying and inconsistent - why shouldn't the *left* side of the DIV's shadow be visible as well?

Reproducible: Always

Steps to Reproduce:
1. Go to http://www.automediagroup.net/new_info_mac/moz_shadow_fail.html
2. Set viewport to ~1000 pixels wide.
3. Observe irritating behavior.
Actual Results:  
Exactly what I described.

Expected Results:  
Fit the 1000 pixel DIV perfectly inside the 1000 pixel viewport.
Summary: moz-box-shadow adds undesired margins to right and left sides of element → moz-box-shadow adds undesired margins to right and bottom sides of element
> why shouldn't the *left* side of the DIV's shadow be visible

Overflow to the left of the viewport generally can't be scrolled to.

With a trunk build, I see pretty much identical behavior on that testcase in Chrome and Firefox, for what it's worth: both show a scrollbar as soon as the window is less than 1015 pixels wide.
I definitely don't see that in Chrome. Here is a screenshot of what I see in Chrome:

http://twitpic.com/357jui

It also looks the same in Safari.

This is what I see in Firefox, however:

http://twitpic.com/357k9k
Starting in Firefox 4.0 beta 7, shadows should no longer cause scrollbars.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → DUPLICATE
Yes, with a Firefox trunk build I see exactly what you see with Chrome.  Note that I see that at all widths above 1015 px; below that both Chrome and Safari have a horizontal scrollbar.

I definitely don't see the large scrollable space you see (though I do see it on 3.6).

Chances are, bug 446693 fixed this.
Oh, ok thank you I was confused about what you were saying but I understand now.
You need to log in before you can comment on or make changes to this bug.