Closed Bug 1212823 Opened 9 years ago Closed 9 years ago

Input's box-shadow has wrong width and height

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox44 --- affected
firefox45 --- fixed

People

(Reporter: arni2033, Assigned: mattwoodrow)

References

()

Details

(Whiteboard: [gfx-noted])

Attachments

(3 files)

STR:   (Win7_64, Nightly 44, 32bit, ID 20151007030205, new profile)
1. Open the following "data:" url or click URL in the form above
>   data:text/html,<input style="width:300px; box-shadow: 200px 0px 2px 2px red;">

Result:       Input's box-shadow is noticeable narrower than input itself.
Expectations: Input's box-shadow should have the same width as input, just like in GoogleChrome browser

This is very obvious issue, so marking this as [dupeme]
Worksforme on Mac, so presumably a Windows graphics issue....

Do you see the problem on Firefox release?  Earlier nightlies?
Component: CSS Parsing and Computation → Graphics
Flags: needinfo?(arni2033)
Pretty good question actually.
It was regressed between 2012-12-11 and 2012-12-12. Pushlog:
>   http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=4dfe323a663d&tochange=634180132e68
I think it's bug 820131 but can't say for sure
Flags: needinfo?(arni2033)
That seems pretty plausible...  Matt, can you take a look?
Blocks: 820131
Flags: needinfo?(matt.woodrow)
Whiteboard: [dupeme] → [dupeme] [gfx-noted]
Assignee: nobody → matt.woodrow
Flags: needinfo?(matt.woodrow)
Whiteboard: [dupeme] [gfx-noted] → [gfx-noted]
Reftest would be nice, but not sure how to get the same rendering.

This bug doesn't exhibit on mac because the dirty rect is only taken into account when we need a temporary surface for drawing (very common for GDI, but rare for Quartz).
Attachment #8686335 - Flags: review?(roc)
Comment on attachment 8686335 [details] [diff] [review]
Adjust for box-shadow offset so that the dirty rect and frame rect are in the same coordinate space

Review of attachment 8686335 [details] [diff] [review]:
-----------------------------------------------------------------

::: layout/base/nsCSSRendering.cpp
@@ +1382,5 @@
>        shadowContext->SetMatrix(
>          shadowContext->CurrentMatrix().Translate(devPixelOffset));
>  
> +	  nsRect nativeRect = aDirtyRect;
> +	  nativeRect.MoveBy(-nsPoint(shadowItem->mXOffset, shadowItem->mYOffset));

fix indent
Attachment #8686335 - Flags: review?(roc) → review+
BTW can't you write a reftest just by using zero blur-radius?
Flags: needinfo?(matt.woodrow)
Attached patch ReftestSplinter Review
The size of the red div depends on the size the native theme drawing picks for the input element, so I've made this windows only.
Flags: needinfo?(matt.woodrow)
Attachment #8686389 - Flags: review?(roc)
https://hg.mozilla.org/mozilla-central/rev/7d5a2743cc47
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Has STR: --- → yes
I've managed to reproduce this bug on Nightly 44.0a1 (2015-10-08) (Build ID: 20151008030232) on Linux, 64 Bit.

This Bug is now verified as fixed on Latest Firefox Nightly 50.0a1 (2016-06-29)

Build ID: 20160629030209
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0
OS: Ubuntu 14.04 ; inux 3.19.0-61-generic
QA Whiteboard: [bugday-20160629]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: