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

list-style-position outside appearance #2393

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions weasyprint/formatting_structure/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,18 @@ def marker_to_box(element, state, parent_style, style_for, get_image_from_uri,
translate_y = properties.ZERO_PIXELS
marker_box.style['transform'] = (
('translate', (translate_x, translate_y)),)

# now consider parent padding
padding_x = None
if parent_style['direction'] == 'ltr' and 'padding_left' in parent_style and \
parent_style['padding_left'].value != 0:
padding_x = properties.Dimension(-parent_style['padding_left'].value, parent_style['padding_left'].unit)
elif parent_style['direction'] != 'ltr' and 'padding_right' in parent_style and \
parent_style['padding_right'].value != 0:
padding_x = parent_style['padding_right']
if padding_x is not None:
marker_box.style['transform'] = marker_box.style['transform'] + (
('translate', (padding_x, translate_y)),)
else:
marker_box = boxes.InlineBox.anonymous_from(box, children)
yield marker_box
Expand Down