WeasyPrint icon indicating copy to clipboard operation
WeasyPrint copied to clipboard

Improper border around page area box

Open zopyx opened this issue 6 years ago • 5 comments

Check attached sample (WeasyPrint 51)

The image in the head page area box should be surrounded by a green. Instead the box border is drawn through the image.

https://www.dropbox.com/s/xt6pc79kwqnx5ev/wp.zip?dl=0

zopyx avatar Feb 05 '20 18:02 zopyx

I’m not sure that the image should be surrounded by a green border. Browsers (even if they don’t support running) also draw the border through the image, because the span is inline.

But the missing left border is a problem for sure.

liZe avatar Feb 13 '20 22:02 liZe

The problem is caused by the space before the image. This leading space should be removed, but it’s not. The span is split into 2 lines, the first one with the space, the second one with the image.

liZe avatar Feb 14 '20 07:02 liZe

@zopyx Do you have a copy of the original sample? It’s been removed from Dropbox and I can’t remember how we can reproduce the bug.

liZe avatar Apr 25 '22 22:04 liZe

Sorry, too long ago :)

zopyx avatar Apr 25 '22 22:04 zopyx

I’ve found a way to reproduce, and it’s not fixed yet…

<style>
  @page {
    @top-center {
      content: element(heading);
    }
  }
  span {
    border: 5px solid pink;
    position: running(heading);
  }
  img {
    width: 1cm;
  }
</style>
abc
<span> <img src="image.jpg" /></span>

liZe avatar Apr 25 '22 22:04 liZe