This has multiple benefits:
- It makes DLBI detection of background-position changes work for buttons.
- It makes background-attachment: fixed work for button backgrounds.
- It allows the willPaintBorder optimization to be used for button background
drawing, which reduces the background clip to not overlap with opaque borders.
The willPaintBorder optimization requires a change to the reftest 611574-2.html.
This reftest compares backgrounds to inset box shadows. Box shadows those don't
have a willPaintBorder optimization, so we'd get different results due to the
borders - inset box shadows will bleed through the rounded corner anti-aliasing
of the border, backgrounds won't any more. So we just turn off button borders
and cover the outer edges of the borders with an outline in that reftest.
MozReview-Commit-ID: Lvx2p5szjw7
***
Cover the antialiasing in 611574-2.html with a black outline.
MozReview-Commit-ID: IHC3B7Eq72j
--HG--
extra : rebase_source : 71ae376f482d14e55820879f28b37056e1b857bf
This has multiple benefits:
- It makes DLBI detection of background-position changes work for buttons.
- It makes background-attachment: fixed work for button backgrounds.
- It allows the willPaintBorder optimization to be used for button background
drawing, which reduces the background clip to not overlap with opaque borders.
The willPaintBorder optimization requires a change to the reftest 611574-2.html.
This reftest compares backgrounds to inset box shadows. Box shadows those don't
have a willPaintBorder optimization, so we'd get different results due to the
borders - inset box shadows will bleed through the rounded corner anti-aliasing
of the border, backgrounds won't any more. So we just turn off button borders
and cover the outer edges of the borders with an outline in that reftest.
MozReview-Commit-ID: Lvx2p5szjw7
***
Cover the antialiasing in 611574-2.html with a black outline.
MozReview-Commit-ID: IHC3B7Eq72j
--HG--
extra : rebase_source : fbd7d3152b819232adfc97dd9df1481a582925c5
This has multiple benefits:
- It makes DLBI detection of background-position changes work for buttons.
- It makes background-attachment: fixed work for button backgrounds.
- It allows the willPaintBorder optimization to be used for button background
drawing, which reduces the background clip to not overlap with opaque borders.
The willPaintBorder optimization requires a change to the reftest 611574-2.html.
This reftest compares backgrounds to inset box shadows. Box shadows those don't
have a willPaintBorder optimization, so we'd get different results due to the
borders - inset box shadows will bleed through the rounded corner anti-aliasing
of the border, backgrounds won't any more. So we just turn off button borders
and cover the outer edges of the borders with an outline in that reftest.
MozReview-Commit-ID: Lvx2p5szjw7
***
Cover the antialiasing in 611574-2.html with a black outline.
MozReview-Commit-ID: IHC3B7Eq72j
--HG--
extra : rebase_source : e2c625e25ebce052948dc39de6f9af91d4987315
Except for the changes in:
layout/generic/nsIFrame.h (part)
layout/style/nsComputedDOMStyle.h (all)
layout/style/nsRuleNode.cpp (part)
layout/style/nsStyleContext.cpp (part)
layout/style/nsStyleContext.h (part)
(see patch 3b in the bug), this patch was written with the sed script:
s/\<GetStyle\(Font\|Color\|List\|Text\|Visibility\|Quotes\|UserInterface\|TableBorder\|SVG\|Background\|Position\|TextReset\|Display\|Content\|UIReset\|Table\|Margin\|Padding\|Border\|Outline\|XUL\|SVGReset\|Column\)\>/Style\1/g
Previously we snapped the results of nsDisplayItem::GetBounds and
nsDisplayItem::GetOpaqueRegion internally. By tracking which display items were
inside transforms, we disabled snapping quite conservatively whenever an ancestor
had a transform, which is undesirable.
With this patch, we don't snap inside GetBounds or GetOpaqueRegion, but just return
a boolean flag indicating whether the item will draw with snapping or not. This flag
is conservative so that "true" means we will snap (if the graphics context has a transform
that allows snapping), but "false" means we might or might not snap (so it's always safe
to return false).
FrameLayerBuilder takes over responsibility for snapping item bounds. When it converts
display item bounds to layer pixel coordinates, it checks the snap flag returned from
the display item and checks whether the transform when we draw into the layer will be
a known scale (the ContainerParameters scale factors) plus integer translation. If both
are true, we snap the item bounds when converting to layer pixel coordinates. With
this approach, we can snap item bounds even when the items have ancestors with active
transforms.