зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 7876583b2407 (bug 1577236) for causing failures in calc-rounding-001.html CLOSED TREE
This commit is contained in:
Родитель
a2446c4186
Коммит
95b09298a4
|
@ -2261,8 +2261,8 @@ static void ConstrainToCoordValues(float& aStart, float& aSize) {
|
|||
// can't return a value greater than nscoord_MAX. If aSize is greater than
|
||||
// nscoord_MAX then we reduce it to nscoord_MAX while keeping the rect
|
||||
// centered:
|
||||
if (aSize > float(nscoord_MAX)) {
|
||||
float excess = aSize - float(nscoord_MAX);
|
||||
if (aSize > nscoord_MAX) {
|
||||
float excess = aSize - nscoord_MAX;
|
||||
excess /= 2;
|
||||
aStart += excess;
|
||||
aSize = (float)nscoord_MAX;
|
||||
|
|
|
@ -2092,9 +2092,9 @@ void FrameLayerBuilder::Init(nsDisplayListBuilder* aBuilder,
|
|||
}
|
||||
|
||||
void FrameLayerBuilder::FlashPaint(gfxContext* aContext) {
|
||||
float r = float(rand()) / float(RAND_MAX);
|
||||
float g = float(rand()) / float(RAND_MAX);
|
||||
float b = float(rand()) / float(RAND_MAX);
|
||||
float r = float(rand()) / RAND_MAX;
|
||||
float g = float(rand()) / RAND_MAX;
|
||||
float b = float(rand()) / RAND_MAX;
|
||||
aContext->SetColor(Color(r, g, b, 0.4f));
|
||||
aContext->Paint();
|
||||
}
|
||||
|
|
|
@ -447,7 +447,13 @@ nscoord StyleCSSPixelLength::ToAppUnits() const {
|
|||
return 0;
|
||||
}
|
||||
float length = _0 * float(mozilla::AppUnitsPerCSSPixel());
|
||||
return NSToCoordRoundWithClamp(length);
|
||||
if (length >= nscoord_MAX) {
|
||||
return nscoord_MAX;
|
||||
}
|
||||
if (length <= nscoord_MIN) {
|
||||
return nscoord_MIN;
|
||||
}
|
||||
return NSToIntRound(length);
|
||||
}
|
||||
|
||||
constexpr LengthPercentage LengthPercentage::Zero() {
|
||||
|
@ -694,8 +700,7 @@ constexpr const auto kPaintOrderShift = StylePAINT_ORDER_SHIFT;
|
|||
constexpr const auto kPaintOrderMask = StylePAINT_ORDER_MASK;
|
||||
|
||||
template <>
|
||||
inline nsRect StyleGenericClipRect<LengthOrAuto>::ToLayoutRect(
|
||||
nscoord aAutoSize) const {
|
||||
inline nsRect StyleGenericClipRect<LengthOrAuto>::ToLayoutRect(nscoord aAutoSize) const {
|
||||
nscoord x = left.IsLength() ? left.ToLength() : 0;
|
||||
nscoord y = top.IsLength() ? top.ToLength() : 0;
|
||||
nscoord width = right.IsLength() ? right.ToLength() - x : aAutoSize;
|
||||
|
|
Загрузка…
Ссылка в новой задаче