Use the enclosing rect in SVGRootInlineBox::LayoutInlineBoxes

The LayoutRect(const FloatRect&) constructor will round (floor in
practice) the location/size independently. This can cause the resulting
to be smaller than the argument - when the values a small (< 1) this
effect is easily amplified. In cases like the one in this bug, where the
bounding box of <text> is used to determine bounds for a <clipPath>,
this can result in content being clipped when it shouldn't be.

Use EnclosingLayoutRect instead of the "straight" conversion, to make
sure the resulting bounds are not smaller than the original.

Since this changes the bounding box of text, tests that depend on that
directly or indirectly are affected. Mostly without noticeable visual
For svg/animations/animate-text-nested-transforms.html the location
of the click (that starts the test) is nudged a bit to avoid timing out.

Bug: 820955
Change-Id: I8811de81de0a5dc795218dcdf8a55a79b15e2863
Commit-Queue: Fredrik Söderquist <>
Reviewed-by: Stephen Chenney <>
Cr-Commit-Position: refs/heads/master@{#640717}
49 files changed