Closed Bug 338596 Opened 18 years ago Closed 18 years ago

SVG objectBoundingBox value seems ignored in patternUnits (Minefield as of May 19 '06)

Categories

(Core :: SVG, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: wisniewskit, Assigned: longsonr)

References

Details

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060519 Minefield/3.0a1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060519 Minefield/3.0a1

When creating an SVG pattern, objectBoundingBox units do not seem to apply to the patternUnits property, only patternContentUnits. It is my understanding that the coordinates of the pattern's document fragment should be changed such that (0,0) in the minimum x,y pair of the bounding box around the element referencing the pattern (http://www.w3.org/TR/1999/WD-SVG-19991203/pservers.html#PatternUnitsAttribute - link is a little outdated, but spells things out a little better than the SVG 1.1 documentation about this property+value)

Reproducible: Always

Steps to Reproduce:
1. View SVG document given in "additional details" in Minefield.
2.
3.

Actual Results:  
Red rect in test case under "additional details" seems to tile from top/left corner of viewport.

Expected Results:  
Red rect ought to tile from top/left corner of black-outlined region, occupying the top quarter of outlined region.

<?xml version="1.0" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
	<defs>
		<pattern id="test" patternUnits="objectBoundingBox" patternContentUnits="objectBoundingBox">
			<rect x="0" y="0" width="0.5" height="0.5" fill="red" />
		</pattern>
	</defs>

	<rect x="20" y="20" width="200" height="200" fill="url(#test)" stroke="black" />
</svg>
Component: General → SVG
Product: Firefox → Core
Version: unspecified → Trunk
FWIW with this patch example now displays the same in Adobe SVG viewer
Assignee: nobody → longsonr
Status: UNCONFIRMED → ASSIGNED
Attachment #223034 - Flags: review?(tor)
Attachment #223034 - Flags: review?(tor) → review+
Attachment #223034 - Flags: superreview?(roc)
QA Contact: general → ian
Attachment #223034 - Flags: superreview?(roc) → superreview+
Checked in.

Checking in nsSVGPatternFrame.cpp;
/cvsroot/mozilla/layout/svg/base/src/nsSVGPatternFrame.cpp,v  <--  nsSVGPatternFrame.cpp
new revision: 1.25; previous revision: 1.24
done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Depends on: 377263
Attached image reporters testcase
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: