diff --git a/weasyprint/formatting_structure/boxes.py b/weasyprint/formatting_structure/boxes.py index 683b3ad5e..adab5772c 100644 --- a/weasyprint/formatting_structure/boxes.py +++ b/weasyprint/formatting_structure/boxes.py @@ -719,32 +719,3 @@ class InlineFlexBox(FlexContainerBox, InlineLevelBox): It behaves as inline on the outside and as a flex container on the inside. """ - - -class RunningPlaceholder(BlockBox): - """A box to anchor a running element within the document flow""" - def __init__(self, identifier, style): - self.position_x = 0 - self.position_y = 0 - self.width = 0 - self.height = 0 - self.padding_left = 0 - self.padding_right = 0 - self.padding_top = 0 - self.padding_bottom = 0 - self.margin_left = 0 - self.margin_right = 0 - self.margin_top = 0 - self.margin_bottom = 0 - self.border_left_width = 0 - self.border_right_width = 0 - self.border_top_width = 0 - self.border_bottom_width = 0 - self.identifier = identifier - super(RunningPlaceholder, self).__init__( - None, dict(style, display='block', content=[('running', None)]), - children=[], - ) - - def translate(self, dx=0, dy=0, ignore_floats=False): - pass diff --git a/weasyprint/layout/__init__.py b/weasyprint/layout/__init__.py index a72626f98..cf84290aa 100644 --- a/weasyprint/layout/__init__.py +++ b/weasyprint/layout/__init__.py @@ -196,6 +196,7 @@ def __init__(self, enable_hinting, style_for, get_image_from_uri, self._excluded_shapes_lists = [] self.excluded_shapes = None # Not initialized yet self.string_set = defaultdict(lambda: defaultdict(lambda: list())) + self.running_elements = {} self.current_page = None self.forced_break = False @@ -205,9 +206,6 @@ def __init__(self, enable_hinting, style_for, get_image_from_uri, self.tables = {} self.dictionaries = {} - # TODO: this is probably the wrong place to put this - self.running_elements = {} - def create_block_formatting_context(self): self.excluded_shapes = [] self._excluded_shapes_lists.append(self.excluded_shapes) diff --git a/weasyprint/layout/blocks.py b/weasyprint/layout/blocks.py index e26426f32..b6b350de0 100644 --- a/weasyprint/layout/blocks.py +++ b/weasyprint/layout/blocks.py @@ -353,14 +353,9 @@ def block_container_layout(context, box, max_position_y, skip_stack, resume_at = (index, None) break elif child.is_running(): - placeholder = boxes.RunningPlaceholder( - child.style['position'][1], child.style, - ) - placeholder.index = index - new_children.append(placeholder) context.running_elements.setdefault( child.style['position'][1], {} - )[placeholder] = child + )[context.current_page - 1] = child continue if isinstance(child, boxes.LineBox): diff --git a/weasyprint/layout/pages.py b/weasyprint/layout/pages.py index adf2b2ba4..515931b33 100644 --- a/weasyprint/layout/pages.py +++ b/weasyprint/layout/pages.py @@ -665,9 +665,6 @@ def make_page(context, root_box, page_type, resume_at, page_number, if call_parse_again: remake_state['content_changed'] = True counter_lookup.parse_again(page_counter_values) - if isinstance(child, boxes.RunningPlaceholder): - elements = context.running_elements[child.identifier] - elements[page.page_type.index] = elements[child] if page_type.blank: resume_at = previous_resume_at