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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user