Bug 1523071 - Use Rust lengths for margin / padding / inset. r=jwatt

Also for the intersection observer root margin, since it was easier to fix it
up and clean it up than not doing it.

This is the first big step to get rid of nscoord. It duplicates a bit of logic
in nsLayoutUtils since for now max/min-width/height are still represented with
nsStyleCoord, but I think I prefer to land this incrementally.

I didn't add helpers for the physical accessors of the style rect sides that
nsStyleSides has (top/bottom/left/right) since I think we generally should
encourage the logical versions, but let me know if you want me to do that.

Differential Revision: https://phabricator.services.mozilla.com/D17739
This commit is contained in:
Emilio Cobos Álvarez
2019-01-26 11:00:44 +01:00
parent 1e1ca69054
commit ce3d5d43c1
29 changed files with 417 additions and 287 deletions

View File

@@ -285,9 +285,8 @@ void DOMIntersectionObserver::Update(Document* aDocument,
NS_FOR_CSS_SIDES(side) {
nscoord basis = side == eSideTop || side == eSideBottom ? rootRect.Height()
: rootRect.Width();
nsStyleCoord coord = mRootMargin.Get(side);
rootMargin.Side(side) =
nsLayoutUtils::ComputeCBDependentValue(basis, coord);
nsLayoutUtils::ComputeCBDependentValue(basis, mRootMargin.Get(side));
}
for (size_t i = 0; i < mObservationTargets.Length(); ++i) {