mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 503814. iframe contents shifted slightly due to rounding issue. r+sr=roc
This commit is contained in:
parent
21d72e721f
commit
5fff4ee2f4
@ -365,6 +365,11 @@ inline PRInt32 NSToIntRound(float aValue)
|
||||
return NS_lroundf(aValue);
|
||||
}
|
||||
|
||||
inline PRInt32 NSToIntRoundUp(float aValue)
|
||||
{
|
||||
return PRInt32(NS_floorf(aValue + 0.5f));
|
||||
}
|
||||
|
||||
/*
|
||||
* App Unit/Pixel conversions
|
||||
*/
|
||||
|
@ -324,12 +324,12 @@ inline nsIntRect
|
||||
nsRect::ToNearestPixels(nscoord aAppUnitsPerPixel) const
|
||||
{
|
||||
nsIntRect rect;
|
||||
rect.x = NSToIntRound(NSAppUnitsToFloatPixels(x, float(aAppUnitsPerPixel)));
|
||||
rect.y = NSToIntRound(NSAppUnitsToFloatPixels(y, float(aAppUnitsPerPixel)));
|
||||
rect.width = NSToIntRound(NSAppUnitsToFloatPixels(XMost(),
|
||||
float(aAppUnitsPerPixel))) - rect.x;
|
||||
rect.height = NSToIntRound(NSAppUnitsToFloatPixels(YMost(),
|
||||
float(aAppUnitsPerPixel))) - rect.y;
|
||||
rect.x = NSToIntRoundUp(NSAppUnitsToFloatPixels(x, float(aAppUnitsPerPixel)));
|
||||
rect.y = NSToIntRoundUp(NSAppUnitsToFloatPixels(y, float(aAppUnitsPerPixel)));
|
||||
rect.width = NSToIntRoundUp(NSAppUnitsToFloatPixels(XMost(),
|
||||
float(aAppUnitsPerPixel))) - rect.x;
|
||||
rect.height = NSToIntRoundUp(NSAppUnitsToFloatPixels(YMost(),
|
||||
float(aAppUnitsPerPixel))) - rect.y;
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
6
layout/reftests/pixel-rounding/iframe-1-ref.html
Normal file
6
layout/reftests/pixel-rounding/iframe-1-ref.html
Normal file
@ -0,0 +1,6 @@
|
||||
<html>
|
||||
<body style="background-color: rgb(255,0,0)">
|
||||
<iframe style="position: fixed; top: 11" src="data:text/html,<body style='background-color: rgba(0,0,255,0.5)'>">
|
||||
</iframe>
|
||||
</body>
|
||||
</html>
|
6
layout/reftests/pixel-rounding/iframe-1.html
Normal file
6
layout/reftests/pixel-rounding/iframe-1.html
Normal file
@ -0,0 +1,6 @@
|
||||
<html>
|
||||
<body style="background-color: rgb(255,0,0)">
|
||||
<iframe style="position: fixed; top: 10.5" src="data:text/html,<body style='background-color: rgba(0,0,255,0.5)'>">
|
||||
</iframe>
|
||||
</body>
|
||||
</html>
|
@ -175,3 +175,5 @@ fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") == background-image-tiling.html background
|
||||
!= border-image-width-0.html border-image-width-10.html
|
||||
== border-image-width-4.html border-image-width-0.html
|
||||
== border-image-width-9.html border-image-width-0.html
|
||||
|
||||
== iframe-1.html iframe-1-ref.html
|
||||
|
Loading…
Reference in New Issue
Block a user