Closed
Bug 608653
Opened 14 years ago
Closed 14 years ago
SVG patterns with unspecified width/height attributes should not paint
Categories
(Core :: SVG, defect)
Core
SVG
Tracking
()
RESOLVED
FIXED
mozilla2.0b8
People
(Reporter: heycam, Assigned: longsonr)
Details
Attachments
(2 files, 3 obsolete files)
242 bytes,
image/svg+xml
|
Details | |
5.86 KB,
patch
|
Details | Diff | Splinter Review |
If the width="" or height="" attributes on a <pattern> element are omitted, then the <pattern> should not be painted. It's not clear whether this test should paint black (because of paint fallback, as Opera does) or green (as IE does). I think it should be green, but I'll raise an issue for it. Either way, it's clear it shouldn't be red.
Reporter | ||
Comment 1•14 years ago
|
||
Assignee | ||
Comment 2•14 years ago
|
||
nsSVGPatternFrame will need fixing. We'll need to take care as it should work even without width and height as attributes if you animate them into existence but that's bug 544809 too.
Component: Style System (CSS) → SVG
QA Contact: style-system → general
Assignee | ||
Comment 3•14 years ago
|
||
Actually we have the lacuna values for width/height wrong. According to the spec width/height default to 0 which is an error so we shouldn't display anything. This patch makes us display black which is wrong, but at least it's not red any more :-) Fallback colours should be restricted to URI invalid and when the geometry of the applicable element has no width or no height, such as the case of a horizontal or vertical line. The first case is easy, the second is harder as we don't distinguish between different types of pattern failures, we just return a pattern or null. Can you raise a follow up for this please?
Attachment #487532 -
Flags: feedback?(cam)
Assignee | ||
Updated•14 years ago
|
Attachment #487532 -
Flags: review?(roc)
Attachment #487532 -
Flags: approval2.0?
Reporter | ||
Comment 4•14 years ago
|
||
(In reply to comment #3) > According to the spec width/height default to 0 which is an error so we > shouldn't display anything. This patch makes us display black which is wrong, > but at least it's not red any more :-) Is the black coming from the fact that it is trying to fall back, but there is nothing to fall back to? > Fallback colours should be restricted to URI invalid and when the geometry of > the applicable element has no width or no height, such as the case of a > horizontal or vertical line. I am not convinced about using the fallback paint if the referenced pattern has width/height 0. I don't think the spec is clear about that. But I think the test you have (with the black rect behind the patterned rect) is fine. > The first case is easy, the second is harder as we don't distinguish between > different types of pattern failures, we just return a pattern or null. Can you > raise a follow up for this please? I'll raise an issue with the WG and raise a bug depending on the outcome of that.
Attachment #487532 -
Flags: review?(roc)
Attachment #487532 -
Flags: review+
Attachment #487532 -
Flags: approval2.0?
Attachment #487532 -
Flags: approval2.0+
Assignee | ||
Comment 5•14 years ago
|
||
(In reply to comment #4) > > Is the black coming from the fact that it is trying to fall back, but there is > nothing to fall back to? We have a default fallback colour of black if a fallback colour is not specified. I think that may have been right in according to SVG 1.1 release 1 and may be wrong according to SVG 1.1 release 2 where it may be that it should not draw although that's likely to be tricky to implement. > > I am not convinced about using the fallback paint if the referenced pattern has > width/height 0. I don't think the spec is clear about that. But I think the > test you have (with the black rect behind the patterned rect) is fine. FWIW, I'm pretty convinced that you shouldn't use the fallback paint even though we do with or without this patch.
Assignee | ||
Comment 6•14 years ago
|
||
Assignee: nobody → longsonr
Attachment #487532 -
Attachment is obsolete: true
Attachment #487532 -
Flags: feedback?(cam)
Assignee | ||
Updated•14 years ago
|
Keywords: checkin-needed
Whiteboard: [c-n: after 2.0b7 freeze]
Comment 7•14 years ago
|
||
This bug's patch currently breaks four reftests: reftests/svg/smil/transform/translate-pattern-1.svg reftests/svg/objectBoundingBox-and-pattern-01a.svg reftests/svg/objectBoundingBox-and-pattern-01b.svg reftests/svg/objectBoundingBox-and-pattern-01c.svg Reftest log coming up in a second...
Status: NEW → ASSIGNED
Keywords: checkin-needed
Whiteboard: [c-n: after 2.0b7 freeze]
Version: unspecified → Trunk
Comment 8•14 years ago
|
||
Here's the reftest failure log, suitable for passing to http://hg.mozilla.org/mozilla-central/raw-file/tip/layout/tools/reftest/reftest-analyzer.xhtml With this bug's patch, these tests fail on all platforms, both opt & debug builds. (based on a tryserver run earlier today)
Assignee | ||
Comment 9•14 years ago
|
||
All the reftests are broken. Updated patch coming up.
Assignee | ||
Comment 10•14 years ago
|
||
Sorry about that. It's very good of you to land everything.
Attachment #487700 -
Attachment is obsolete: true
Attachment #488018 -
Attachment is obsolete: true
Comment 11•14 years ago
|
||
No problem -- thanks for the quick fix!
Comment 12•14 years ago
|
||
Landed: http://hg.mozilla.org/mozilla-central/rev/0181db574a21
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b8
Updated•14 years ago
|
Attachment #488018 -
Attachment mime type: text/x-log → text/plain
You need to log in
before you can comment on or make changes to this bug.
Description
•