зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1320036 - Part 1. Correct objectBoundingBox region of a filter applied to an outer SVG element. r=jwatt
MozReview-Commit-ID: 8frACVe2gFE --HG-- extra : rebase_source : f796c7ae084cc2af0960a0702167fe8211aa083a extra : source : 43b17a8af53a4684abb4379a3fba95c9d424c77f
This commit is contained in:
Родитель
7decdeb7c8
Коммит
8f0a57337e
|
@ -182,7 +182,9 @@ nsFilterInstance::nsFilterInstance(nsIFrame *aTargetFrame,
|
||||||
mTargetBBox = *aOverrideBBox;
|
mTargetBBox = *aOverrideBBox;
|
||||||
} else {
|
} else {
|
||||||
MOZ_ASSERT(mTargetFrame, "Need to supply a frame when there's no aOverrideBBox");
|
MOZ_ASSERT(mTargetFrame, "Need to supply a frame when there's no aOverrideBBox");
|
||||||
mTargetBBox = nsSVGUtils::GetBBox(mTargetFrame);
|
mTargetBBox = nsSVGUtils::GetBBox(mTargetFrame,
|
||||||
|
nsSVGUtils::eUseFrameBoundsForOuterSVG |
|
||||||
|
nsSVGUtils::eBBoxIncludeFillGeometry);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compute user space to filter space transforms.
|
// Compute user space to filter space transforms.
|
||||||
|
|
|
@ -192,8 +192,8 @@ nsSVGIntegrationUtils::GetSVGCoordContextForNonSVGFrame(nsIFrame* aNonSVGFrame)
|
||||||
gfxRect
|
gfxRect
|
||||||
nsSVGIntegrationUtils::GetSVGBBoxForNonSVGFrame(nsIFrame* aNonSVGFrame)
|
nsSVGIntegrationUtils::GetSVGBBoxForNonSVGFrame(nsIFrame* aNonSVGFrame)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(!aNonSVGFrame->IsFrameOfType(nsIFrame::eSVG),
|
NS_ASSERTION(!(aNonSVGFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT),
|
||||||
"SVG frames should not get here");
|
"Frames with SVG layout should not get here");
|
||||||
nsIFrame* firstFrame =
|
nsIFrame* firstFrame =
|
||||||
nsLayoutUtils::FirstContinuationOrIBSplitSibling(aNonSVGFrame);
|
nsLayoutUtils::FirstContinuationOrIBSplitSibling(aNonSVGFrame);
|
||||||
// 'r' is in "user space":
|
// 'r' is in "user space":
|
||||||
|
|
|
@ -1097,7 +1097,10 @@ nsSVGUtils::GetBBox(nsIFrame *aFrame, uint32_t aFlags)
|
||||||
}
|
}
|
||||||
gfxRect bbox;
|
gfxRect bbox;
|
||||||
nsISVGChildFrame *svg = do_QueryFrame(aFrame);
|
nsISVGChildFrame *svg = do_QueryFrame(aFrame);
|
||||||
if (svg || aFrame->IsSVGText()) {
|
const bool hasSVGLayout = aFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT;
|
||||||
|
if (hasSVGLayout || aFrame->IsSVGText() ||
|
||||||
|
// if we evaluate the following, |svg| can only be an outer-<svg> or null
|
||||||
|
(svg && !(aFlags & eUseFrameBoundsForOuterSVG))) {
|
||||||
// It is possible to apply a gradient, pattern, clipping path, mask or
|
// It is possible to apply a gradient, pattern, clipping path, mask or
|
||||||
// filter to text. When one of these facilities is applied to text
|
// filter to text. When one of these facilities is applied to text
|
||||||
// the bounding box is the entire text element in all
|
// the bounding box is the entire text element in all
|
||||||
|
|
|
@ -403,7 +403,11 @@ public:
|
||||||
eBBoxIncludeStroke = 1 << 2,
|
eBBoxIncludeStroke = 1 << 2,
|
||||||
eBBoxIncludeStrokeGeometry = 1 << 3,
|
eBBoxIncludeStrokeGeometry = 1 << 3,
|
||||||
eBBoxIncludeMarkers = 1 << 4,
|
eBBoxIncludeMarkers = 1 << 4,
|
||||||
eBBoxIncludeClipped = 1 << 5
|
eBBoxIncludeClipped = 1 << 5,
|
||||||
|
// Normally a getBBox call on outer-<svg> should only return the
|
||||||
|
// bounds of the elements children. This flag will cause the
|
||||||
|
// element's bounds to be returned instead.
|
||||||
|
eUseFrameBoundsForOuterSVG = 1 << 6
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* Get the SVG bbox (the SVG spec's simplified idea of bounds) of aFrame in
|
* Get the SVG bbox (the SVG spec's simplified idea of bounds) of aFrame in
|
||||||
|
|
Загрузка…
Ссылка в новой задаче