author | Ting-Yu Lin <tlin@mozilla.com> |
Thu, 16 Feb 2017 10:51:48 +0800 | |
changeset 343239 | f45cac0c1b91cb5220b74b1dd5b708a4154c9d1f |
parent 343238 | 366e6522665c6dfff386d76798d1ffbf232cc0c8 |
child 343240 | 0058687f781389dad42c0e01f4117859e8496202 |
push id | 31372 |
push user | cbook@mozilla.com |
push date | Thu, 16 Feb 2017 12:16:10 +0000 |
treeherder | mozilla-central@2737f66ad6ac [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | dbaron |
bugs | 1326407 |
milestone | 54.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
layout/generic/nsFloatManager.cpp | file | annotate | diff | comparison | revisions | |
layout/generic/nsFloatManager.h | file | annotate | diff | comparison | revisions |
--- a/layout/generic/nsFloatManager.cpp +++ b/layout/generic/nsFloatManager.cpp @@ -849,18 +849,18 @@ nsFloatManager::ShapeInfo::CreateCircleO { // Use physical coordinates to compute the center of circle() or ellipse() // since the <position> keywords such as 'left', 'top', etc. are physical. // https://drafts.csswg.org/css-shapes-1/#funcdef-ellipse nsRect physicalShapeBoxRect = aShapeBoxRect.GetPhysicalRect(aWM, aContainerSize); nsPoint physicalCenter = ShapeUtils::ComputeCircleOrEllipseCenter(aBasicShape, physicalShapeBoxRect); - nsPoint center = - ConvertPhysicalToLogical(aWM, physicalCenter, aContainerSize); + nsPoint logicalCenter = + ConvertToFloatLogical(physicalCenter, aWM, aContainerSize); // Compute the circle or ellipse radii. nsSize radii; StyleBasicShapeType type = aBasicShape->GetShapeType(); if (type == StyleBasicShapeType::Circle) { nscoord radius = ShapeUtils::ComputeCircleRadius(aBasicShape, physicalCenter, physicalShapeBoxRect); radii = nsSize(radius, radius); @@ -868,17 +868,17 @@ nsFloatManager::ShapeInfo::CreateCircleO MOZ_ASSERT(type == StyleBasicShapeType::Ellipse); nsSize physicalRadii = ShapeUtils::ComputeEllipseRadii(aBasicShape, physicalCenter, physicalShapeBoxRect); LogicalSize logicalRadii(aWM, physicalRadii); radii = nsSize(logicalRadii.ISize(aWM), logicalRadii.BSize(aWM)); } - return MakeUnique<EllipseShapeInfo>(center, radii); + return MakeUnique<EllipseShapeInfo>(logicalCenter, radii); } /* static */ nscoord nsFloatManager::ShapeInfo::ComputeEllipseLineInterceptDiff( const nscoord aShapeBoxBStart, const nscoord aShapeBoxBEnd, const nscoord aBStartCornerRadiusL, const nscoord aBStartCornerRadiusB, const nscoord aBEndCornerRadiusL, const nscoord aBEndCornerRadiusB, @@ -953,19 +953,19 @@ nsFloatManager::ShapeInfo::XInterceptAtY const nscoord aRadiusY) { // Solve for x in the ellipse equation (x/radiusX)^2 + (y/radiusY)^2 = 1. MOZ_ASSERT(aRadiusY > 0); return aRadiusX * std::sqrt(1 - (aY * aY) / double(aRadiusY * aRadiusY)); } /* static */ nsPoint -nsFloatManager::ShapeInfo::ConvertPhysicalToLogical( +nsFloatManager::ShapeInfo::ConvertToFloatLogical( + const nsPoint& aPoint, WritingMode aWM, - const nsPoint& aPoint, const nsSize& aContainerSize) { LogicalPoint logicalPoint(aWM, aPoint, aContainerSize); return nsPoint(logicalPoint.LineRelative(aWM, aContainerSize), logicalPoint.B(aWM)); } //----------------------------------------------------------------------
--- a/layout/generic/nsFloatManager.h +++ b/layout/generic/nsFloatManager.h @@ -396,21 +396,21 @@ private: const nscoord aShapeBoxBStart, const nscoord aShapeBoxBEnd, const nscoord aBStartCornerRadiusL, const nscoord aBStartCornerRadiusB, const nscoord aBEndCornerRadiusL, const nscoord aBEndCornerRadiusB, const nscoord aBandBStart, const nscoord aBandBEnd); static nscoord XInterceptAtY(const nscoord aY, const nscoord aRadiusX, const nscoord aRadiusY); - // Convert the coordinate space from physical to the logical space used - // in nsFloatManager, which is the same as FloatInfo::mRect. - static nsPoint ConvertPhysicalToLogical(mozilla::WritingMode aWM, - const nsPoint& aPoint, - const nsSize& aContainerSize); + // Convert the physical point to the special logical coordinate space + // used in float manager. + static nsPoint ConvertToFloatLogical(const nsPoint& aPoint, + mozilla::WritingMode aWM, + const nsSize& aContainerSize); }; // Implements shape-outside: <shape-box>. class BoxShapeInfo final : public ShapeInfo { public: BoxShapeInfo(const nsRect& aShapeBoxRect, nsIFrame* const aFrame) : mShapeBoxRect(aShapeBoxRect)