Closed
Bug 112988
Opened 24 years ago
Closed 24 years ago
Add support for subpieces of an image to the XUL image frame
Categories
(Core Graveyard :: Skinability, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla0.9.7
People
(Reporter: hyatt, Assigned: hyatt)
References
Details
Attachments
(2 files)
33.10 KB,
patch
|
bugs
:
review+
hewitt
:
superreview+
|
Details | Diff | Splinter Review |
2.95 KB,
application/vnd.mozilla.xul+xml
|
Details |
The idea behidn this bug is to be able to extract a piece of an image from a
larger image and use it when painting.
Something like
foo.gif#0,0,16,16
where the numbers to the right are top,left,width,height of the subimage to extract.
Assignee | ||
Updated•24 years ago
|
Assignee | ||
Updated•24 years ago
|
Target Milestone: mozilla0.9.7 → mozilla0.9.8
Assignee | ||
Comment 1•24 years ago
|
||
Patch to implement support.
Assignee | ||
Comment 2•24 years ago
|
||
Testcase.
Assignee | ||
Comment 3•24 years ago
|
||
This patch does the following:
(1) Adds support for a new property, -moz-image-region, that is a rect. Its
syntax is identical to the CSS 'clip' property. This rect, if specified, is
used by XUL image frames to carve out a piece of a larger image and only paint
that piece as part of the image frame.
(2) Cleans up and removes #ifdefs from the XUL image frame.
(3) Fixes a perf problem related to allocating many needless URIs whenever the
style context for a XUL image frame changed.
(4) Patches a bug in the rendering context's DrawImage routine. It was adding
in the src rect's x/y offsets to the destination point, which is not what
DrawScaledImage does with its dest rect's x/y. Fixing this inconsistency
involved tweaking the HTML image frame a little bit.
Assignee | ||
Updated•24 years ago
|
Target Milestone: mozilla0.9.8 → mozilla0.9.7
Assignee | ||
Comment 4•24 years ago
|
||
Note that this fix to the DrawImage routine has fixed some printing issues
when images are split across pages. The incorrect offsetting was messing up
images in that case.
For an example of how this bug has fixed that problem, see the 1.x megabyte
images in this directory:
http://rsd.gsfc.nasa.gov/goesg/earth/Weather/GOES-8/jpg/vis/4km/
Although there are numerous painting issues that still plague this case when
printing, and I suspect they are related to the dirty rect intersection
optimization in HTMLImageFrame, this patch clearly makes things a bit better.
Comment 5•24 years ago
|
||
shouldn't the default dimensions of the image region (when 'auto' is used?) be
the width and height of the image, rather than 0?
Assignee | ||
Comment 6•24 years ago
|
||
Probably, but I'd have to add an extra member variable to the style struct like
clip does for auto, and I don't want to bloat the style struct just for purity's
sake. :)
Basically I'd have to have an mImageRegionFlags member variable like mClipFlags
does for clip that stored the fact that the rect was auto. I found it easier to
just use (0,0,0,0) as the auto values and make the code use the full rect when
it got a 0,0,0,0 subrect.
Comment 7•24 years ago
|
||
Comment on attachment 60101 [details] [diff] [review]
Patch that enables -moz-image-region support in CSS.
ok.
r=ben@netscape.com
Attachment #60101 -
Flags: review+
Comment 8•24 years ago
|
||
Comment on attachment 60101 [details] [diff] [review]
Patch that enables -moz-image-region support in CSS.
sr=hewitt
Attachment #60101 -
Flags: superreview+
Assignee | ||
Comment 9•24 years ago
|
||
Fixed. I moved image-region into the list struct so that it would inherit.
Other than that, the patch stayed the same.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
This patch didn't update the nsStyleList copy constructor, and thus caused bug
220717.
Updated•17 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•