зеркало из https://github.com/mozilla/pjs.git
Bug 503814. iframe contents shifted slightly due to rounding issue. r+sr=roc
This commit is contained in:
Родитель
8520ce4482
Коммит
d925bda685
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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>
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче