Backed out changeset 7876583b2407 (bug 1577236) for causing failures in calc-rounding-001.html CLOSED TREE

This commit is contained in:
Mihai Alexandru Michis 2019-09-11 18:48:22 +03:00
Родитель a2446c4186
Коммит 95b09298a4
3 изменённых файлов: 13 добавлений и 8 удалений

Просмотреть файл

@ -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;