TitleImplement margin auto
Authorcampaul
CreatedThu, 29 May 2025 19:39:00 +0000
State open

Fix for #67

This still needs more tests and documentation before it's ready to go but I wanted to post the PR to start getting feedback as early as possible. This is a big change so I expect it will end up needing many revisions.

Overview

Some changes that were made as prerequisites:

The main logic is as follows:

This works because getAvailableWidth is always called before any of boxOffsetX, boxRestWidth or boxDiffWidth. This means calcFinalWidth is guaranteed to have already run.

Screenshots

The margin auto test passing Screenshot 2025-05-29 at 2 22 59 PM

The dillo website correctly centered now Screenshot 2025-05-29 at 2 23 33 PM

rodarima on Mon, 02 Jun 2025 21:32:28 +0000

Thanks a lot for the effort! I will check the implementation when I have a moment, what you describe sounds reasonable.

So far I see that with fca573fa0b3c2654f2ca178aa6556394f52be2a8 the page https://dillo-browser.github.io/25-years/index.html extends the width ignoring the max-width constraint. Can we add another test case so we prevent future regressions?