Bug 975741 patch 2: Remove checks of nsStyleDisplay::mChildPerspective.GetCoordValue() > 0 because it's now always greater than 0. r=mattwoodrow
authorL. David Baron <dbaron@dbaron.org>
Wed, 26 Feb 2014 13:36:35 -0800
changeset 171069 e8eaec0c9198a09371a8c2b37d0af5a04984cc2a
parent 171068 b7030189c2ca5697c8fba43220511ddc39fcce98
child 171070 cfaa46b8361246d7defd3f8b5d4dc482f844aeb2
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersmattwoodrow
bugs975741
milestone30.0a1
Bug 975741 patch 2: Remove checks of nsStyleDisplay::mChildPerspective.GetCoordValue() > 0 because it's now always greater than 0. r=mattwoodrow Now that the first patch in this bug changed things so that 'none' is reliably stored as eStyleUnit_None (rather than being stored as a 0 length when it comes from the initial value), we know mChildPerspective is always > 0 when it is eStyleUnit_Coord, and there's no point making the additional check.
layout/generic/nsFrame.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -1053,26 +1053,24 @@ nsIFrame::HasPerspective() const
   if (!IsTransformed()) {
     return false;
   }
   nsStyleContext* parentStyleContext = StyleContext()->GetParent();
   if (!parentStyleContext) {
     return false;
   }
   const nsStyleDisplay* parentDisp = parentStyleContext->StyleDisplay();
-  return parentDisp->mChildPerspective.GetUnit() == eStyleUnit_Coord &&
-         parentDisp->mChildPerspective.GetCoordValue() > 0.0;
+  return parentDisp->mChildPerspective.GetUnit() == eStyleUnit_Coord;
 }
 
 bool
 nsIFrame::ChildrenHavePerspective() const
 {
   const nsStyleDisplay *disp = StyleDisplay();
-  return disp->mChildPerspective.GetUnit() == eStyleUnit_Coord &&
-         disp->mChildPerspective.GetCoordValue() > 0.0;
+  return disp->mChildPerspective.GetUnit() == eStyleUnit_Coord;
 }
 
 nsRect
 nsIFrame::GetContentRectRelativeToSelf() const
 {
   nsMargin bp(GetUsedBorderAndPadding());
   ApplySkipSides(bp);
   nsRect r(0, 0, mRect.width, mRect.height);