Closed Bug 298283 Opened 19 years ago Closed 19 years ago

implement the 'overflow' property (initial value 'hidden')

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bugzilla, Assigned: tor)

References

()

Details

Attachments

(4 files, 3 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050531 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050531 Firefox/1.0+

The test cases
http://www.w3.org/Graphics/SVG/Test/20030813/htmlframe/full-coords-viewattr-01-b.html
and
http://www.w3.org/Graphics/SVG/Test/20030813/htmlframe/full-coords-viewattr-02-b.html
both fail in the lower half, where preserveAspectRatio="slice" is being tested.

Reproducible: Always

Steps to Reproduce:
1. Visit either test url with Firefox Deer Park Alpha 1.1
2. Compare the test SVG image on the left with the reference PNG on the right.


Actual Results:  
The lower tests, with the "slice" value, do not match the reference.

Expected Results:  
The SVG image should match the reference.
Please file any other SVG bugs in Core:SVG instead of Firefox:General.
Assignee: nobody → general
Component: General → SVG
Product: Firefox → Core
QA Contact: general → ian
Version: unspecified → Trunk
this WORKSFORME, the svg fragments are positioned correctly, "meet" and "slice"
are implemented correctly, the images just dont get cliped.
Attached image testcase (obsolete) —
testcase , that shows meet and slice are rendered differently,
just click somewhere in the document to toggle between meet and slice.
i forgot to add, it works in
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050616
Firefox/1.0+
Maybe I'm missing something, but isn't clipping important to "slice" ? I see
that the alignment is correct, but the viewBox should be clipped to the
viewport, shouldn't it?

From http://www.w3.org/TR/2002/CR-SVG11-20020430/coords.html#ViewBoxAttribute :
" In this case, if the aspect ratio of the viewBox does not match the viewport,
some of the viewBox will extend beyond the bounds of the viewport (i.e., the
area into which the viewBox will draw is larger than the viewport)."

Or is there a more general bug somewhere about not clipping to the viewport? 
(In reply to comment #5)
> Maybe I'm missing something, but isn't clipping important to "slice" ? I see
> that the alignment is correct, but the viewBox should be clipped to the
> viewport, shouldn't it?

i dont know, but it would definitly speed up rendering in most cases, see
https://bugzilla.mozilla.org/show_bug.cgi?id=119217

> 
> Or is there a more general bug somewhere about not clipping to the viewport? 

maybe you can change the subject of this bug to somthing like "mozilla should
allways clip to the viewport". 
though maybe its the same as above mentioned bug.
Attached image new testcase (obsolete) —
Attachment #186917 - Attachment is obsolete: true
We don't seem to support the 'overflow' and 'clip' properties as specified here:

  http://www.w3.org/TR/SVG/masking.html#OverflowAndClipProperties

"The initial value for 'overflow' as defined in [CSS2-overflow] is 'visible';
however, SVG's user agent style sheet  overrides this initial value and set the
'overflow' property on elements that establish new viewports (e.g., 'svg'
elements), 'pattern' elements and 'marker' elements to the value 'hidden'."
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
Summary: preserveAspectRatio="slice" works the same as "meet" → implement the 'overflow' property (initial value 'hidden')
so probably Bug#298282
https://bugzilla.mozilla.org/show_bug.cgi?id=298282
is a dublicate of this bug.
So this is a matter of implementing overflow in general and then adding some
style to svg.css?
Blocks: 298282
We do implement overflow for inner svg, and indeed it still seems to work
for simple testcases.  Not sure why these particular examples are failing.
Attached image testcase
another tastcase, showing the real problem, overflow clips to the viewbox, but
should clip to the viewport.
Attachment #187053 - Attachment is obsolete: true
Not sure what that testcase was supposed to display, but this fixes the two w3c
testcases.
i hope this got fixed by your patch as well, maybe its another bug though.
Output with the patch is similar to your expected behavior.
nice ! thanks for the fix !
how about bug#298282
is that fixed as well ?
Comment on attachment 188045 [details] [diff] [review]
fix overflow for inner <svg> and <image>

(In reply to comment #17)
> Output with the patch is similar to your expected behavior.

Spot on I'd say. The patch looks good too. r=me

>+    nsCOMPtr<nsIDOMSVGMatrix> clipTransform;
>+    if (!mPropagateTransform) {
>+      NS_NewSVGMatrix(getter_AddRefs(clipTransform));
>+    } else {
>+      nsISVGContainerFrame *parent;
>+      CallQueryInterface(mParent, &parent);
>+      if (parent)

I'd quite like an assertion here.

>+        clipTransform = parent->GetCanvasTM();
>     }
>+
>+    if (clipTransform)
>+      canvas->SetClipRect(clipTransform, x, y, width, height);
Attachment #188045 - Flags: review+
Attachment #188045 - Flags: approval1.8b3?
Attachment #188045 - Flags: approval1.8b3? → approval1.8b3+
Assignee: general → tor
Attachment #188045 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #188054 - Flags: review?(jonathan.watt)
Attachment #188054 - Flags: review?(jonathan.watt)
Attachment #188054 - Flags: review+
Attachment #188054 - Flags: approval1.8b3?
Comment on attachment 188054 [details] [diff] [review]
also fix <marker>

Cancelling the approval1.8b3 request. Asa says to carry the previous one.
Attachment #188054 - Flags: approval1.8b3?
*** Bug 298282 has been marked as a duplicate of this bug. ***
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: