Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New page-margin boxes layout algorithm #58

Closed
SimonSapin opened this issue Mar 21, 2013 · 4 comments
Closed

New page-margin boxes layout algorithm #58

SimonSapin opened this issue Mar 21, 2013 · 4 comments
Labels
bug Existing features not working as expected good first issue Issues that can be quite easily solved by Python developers with a good CSS background
Milestone

Comments

@SimonSapin
Copy link
Member

Catch up with spec changes: http://dev.w3.org/csswg/css3-page/#margin-dimension

@liZe liZe added the good first issue Issues that can be quite easily solved by Python developers with a good CSS background label Mar 23, 2018
@galbwe
Copy link

galbwe commented Jul 14, 2019

@liZe Hi, I'd like to get started contributing to this project. I'm still familiarizing myself with the codebase, and am not 100% certain about which part of the code to modify to address this issue. I think I need to edit the compute_variable_dimension function in layout/pages.py, based on a search for the w3 url. Is this on the right track? Thanks.

@liZe
Copy link
Member

liZe commented Jul 14, 2019

Hi, I'd like to get started contributing to this project.

Thank you! Don't hesitate to ask if you have any questions, I'll do my best to help you.

I think I need to edit the compute_variable_dimension function in layout/pages.py, based on a search for the w3 url. Is this on the right track?

Yes, it is.

In 2012, when @SimonSapin implemented the page-margins layout, the specification was this one:
https://www.w3.org/TR/2006/WD-css3-page-20061010/#margin-dimension

The algorithm was really hard to implement and didn't give good results. Simon decided to implement something else, and he proposed a replacement of the specification, based on what he implemented in WeasyPrint:
https://github.com/SimonSapin/css/blob/8c17fbe/margin-boxes-variable-dimension

This proposition was accepted, probably with some changes (I don't remember, maybe Simon does). So the first step is to find what's different between the current specification and the current implementation in compute_variable_dimension, and then fix these differences.

You can spend some time reading Chapter 5.3 of the specification. It's totally normal to find it over-complicated at first 😄, but it gets easier with time. The algorithm is close to the current code, so it can be helpful to have both side by side to understand how it works.

I'll be happy to help, so feel free to ask anything.

@galbwe
Copy link

galbwe commented Jul 14, 2019

@liZe Thank you for the context, and for the speedy reply! I'll start working through the specs and reach out if I have any questions.

@liZe
Copy link
Member

liZe commented May 29, 2023

Closed by #1890.

@liZe liZe closed this as completed May 29, 2023
@liZe liZe added this to the 60.0 milestone May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing features not working as expected good first issue Issues that can be quite easily solved by Python developers with a good CSS background
Projects
None yet
Development

No branches or pull requests

3 participants