зеркало из https://github.com/mozilla/pjs.git
Bug 521759 - patterns incorrect with viewBox and percentage widths or heights. r=roc
This commit is contained in:
Родитель
21840cb3c4
Коммит
754e86dbcc
|
@ -128,4 +128,5 @@ random-if(MOZ_WIDGET_TOOLKIT=="gtk2") == text-font-weight-01.svg text-font-weigh
|
|||
== text-style-01d.svg text-style-01-ref.svg
|
||||
== text-style-01e.svg text-style-01-ref.svg
|
||||
== thin-stroke-01.svg pass.svg
|
||||
== userSpaceOnUse-and-pattern-01.svg userSpaceOnUse-and-pattern-01-ref.svg
|
||||
== viewport-percent-graphic-user-01.svg pass.svg
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/licenses/publicdomain/
|
||||
-->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
|
||||
|
||||
<title>Reference for elements referencing an userSpaceOnUse pattern</title>
|
||||
|
||||
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=521759 -->
|
||||
|
||||
<defs>
|
||||
<pattern id="test" patternUnits="userSpaceOnUse" width="100" height="100" viewBox="0 0 10 10">
|
||||
<rect x="0" y="0" width="10" height="10" fill="lime" />
|
||||
</pattern>
|
||||
</defs>
|
||||
<rect x="20" y="20" width="100" height="100" fill="url(#test)" />
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 603 B |
|
@ -0,0 +1,18 @@
|
|||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/licenses/publicdomain/
|
||||
-->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
|
||||
|
||||
<title>Testcase for elements referencing an userSpaceOnUse pattern</title>
|
||||
|
||||
<!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=521759 -->
|
||||
|
||||
<defs>
|
||||
<pattern id="test" patternUnits="userSpaceOnUse" width="20%" height="20%" viewBox="0 0 10 10">
|
||||
<rect x="0" y="0" width="10" height="10" fill="lime" />
|
||||
</pattern>
|
||||
</defs>
|
||||
<rect x="20" y="20" width="100" height="100" fill="red" />
|
||||
<rect x="20" y="20" width="100" height="100" fill="url(#test)" />
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 663 B |
|
@ -208,7 +208,7 @@ nsSVGPatternFrame::PaintPattern(gfxASurface** surface,
|
|||
|
||||
// Construct the CTM that we will provide to our children when we
|
||||
// render them into the tile.
|
||||
gfxMatrix ctm = ConstructCTM(callerBBox, callerCTM);
|
||||
gfxMatrix ctm = ConstructCTM(callerBBox, callerCTM, callerContent);
|
||||
if (ctm.IsSingular()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
@ -512,15 +512,10 @@ nsSVGPatternFrame::GetPatternRect(const gfxRect &aTargetBBox,
|
|||
return gfxRect(x, y, width, height);
|
||||
}
|
||||
|
||||
static float
|
||||
GetLengthValue(const nsSVGLength2 *aLength)
|
||||
{
|
||||
return aLength->GetAnimValue(static_cast<nsSVGSVGElement*>(nsnull));
|
||||
}
|
||||
|
||||
gfxMatrix
|
||||
nsSVGPatternFrame::ConstructCTM(const gfxRect &callerBBox,
|
||||
const gfxMatrix &callerCTM)
|
||||
const gfxMatrix &callerCTM,
|
||||
nsSVGElement *aTargetContent)
|
||||
{
|
||||
gfxMatrix tCTM;
|
||||
|
||||
|
@ -537,10 +532,11 @@ nsSVGPatternFrame::ConstructCTM(const gfxRect &callerBBox,
|
|||
const nsSVGViewBoxRect viewBox = GetViewBox().GetAnimValue();
|
||||
|
||||
if (viewBox.height > 0.0f && viewBox.width > 0.0f) {
|
||||
float viewportWidth = GetLengthValue(GetWidth());
|
||||
float viewportHeight = GetLengthValue(GetHeight());
|
||||
float refX = GetLengthValue(GetX());
|
||||
float refY = GetLengthValue(GetY());
|
||||
nsSVGSVGElement *ctx = aTargetContent->GetCtx();
|
||||
float viewportWidth = GetWidth()->GetAnimValue(ctx);
|
||||
float viewportHeight = GetHeight()->GetAnimValue(ctx);
|
||||
float refX = GetX()->GetAnimValue(ctx);
|
||||
float refY = GetY()->GetAnimValue(ctx);
|
||||
viewBoxTM = nsSVGUtils::GetViewBoxTransform(viewportWidth, viewportHeight,
|
||||
viewBox.x + refX, viewBox.y + refY,
|
||||
viewBox.width, viewBox.height,
|
||||
|
|
|
@ -136,7 +136,8 @@ protected:
|
|||
const gfxRect &callerBBox,
|
||||
const gfxMatrix &callerCTM);
|
||||
gfxMatrix ConstructCTM(const gfxRect &callerBBox,
|
||||
const gfxMatrix &callerCTM);
|
||||
const gfxMatrix &callerCTM,
|
||||
nsSVGElement *aTargetContent);
|
||||
nsresult GetTargetGeometry(gfxMatrix *aCTM,
|
||||
gfxRect *aBBox,
|
||||
nsSVGElement **aTargetContent,
|
||||
|
|
Загрузка…
Ссылка в новой задаче