Allow line breaks before/after atomic inline elements

… in preferred minumum width calculation.

Revert test workarounds made in the previous commit.
Fix painting of inset/outset borders.
Fix margin collapsing with tables.

The position of page breaks between table rows did not consider margin
collapsing.
Fix trailing whitespaces in preferred widths
Fix a test relying on a bug of libxml2