Closed Bug 137382 Opened 22 years ago Closed 21 years ago

Redundant check for SVG namespace

Categories

(Core :: SVG, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: hwaara, Assigned: hwaara)

References

Details

Attachments

(1 file, 2 obsolete files)

There are two checks for the correct namespace in ConstructSVGFrame(), one can
be removed.
Attached patch Patch (obsolete) — Splinter Review
bbaetz, can you r=?
Actually, since the only caller to ConstructSVGFrame has the namespace check as
well as a requirement, we can skip the other one in ConstructSVGFrame() too.

See
http://lxr.mozilla.org/seamonkey/source/layout/html/style/src/nsCSSFrameConstructor.cpp#7302
Attached patch Patch v2 (obsolete) — Splinter Review
Removes two redundant namespace checks.
Attachment #79148 - Attachment is obsolete: true
Since this is a general (and trivial) CSSFrameConstructor patch, CC dbaron for r=.

BTW, I don't think sr= is required, since SVG is NPOB.
You should get SVG module owner review.  Note that this re-enables
nsSVGAtoms::nameSpaceDeprecatedID.
Yes, I figured it was a bug that we didn't allow that namespace.
r=afri. 
Can you remove the test for the deprecated namespace as well please? We should 
only allow the official namespace.
At some stage we should go through the source with a fine comb and get rid of 
all references to nsSVGAtoms::nameSpaceDeprecatedID.
Attached patch Patch v3Splinter Review
Changes:

* Eliminate deprecated namespace.
* Fix some minor typos in nsIFrameManager.h
* Remove redundant namespace checks when constructing a SVG frame.

Afri, could you re-r= this?
Attachment #79176 - Attachment is obsolete: true
Looks good.
r=afri
IMO, ConstructSVGFrame should at least have an assertion, since that code may be
restructured at some point in the near future.
Assert for what?
Oh, for being in the proper namespace?  I'll include that in the patch and then
checkin.
->moi
Assignee: alex.fritze → hwaara
Checked in on the trunk today.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
This patch introduces bogus assertions for xbl-wrapped svg elements - e.g. try 
http://www.croczilla.com/svg/xbl-shapes.xml.

The NS_ASSERTION in ConstructSVGFrame uses nsIContent::GetNameSpaceID(), which 
is incorrect for xbl-wrapped content. The namespace needs to be resolved using 
ResolveTag(). Also aNameSpaceID is already passed in as a parameter to 
ConstructSVGFrame(), so there is no need to actually re-resolve it.

Here's what the assertion should look like:

Index: nsCSSFrameConstructor.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp,v
retrieving revision 1.745
diff -u -r1.745 nsCSSFrameConstructor.cpp
--- nsCSSFrameConstructor.cpp	26 May 2002 17:07:07 -0000	1.745
+++ nsCSSFrameConstructor.cpp	14 Jun 2002 14:13:06 -0000
@@ -6986,8 +6988,7 @@
                                           nsIStyleContext*         
aStyleContext,
                                           nsFrameItems&            aFrameItems)
 {
-  NS_ASSERTION(NS_SUCCEEDED(aContent->GetNameSpaceID(aNameSpaceID)) && 
-            (aNameSpaceID == nsSVGAtoms::nameSpaceID), "SVG frame constructed 
in wrong namespace");
+  NS_ASSERTION(aNameSpaceID == nsSVGAtoms::nameSpaceID, "SVG frame constructed 
in wrong namespace");
 
   nsresult  rv = NS_OK;
   PRBool isAbsolutelyPositioned = PR_FALSE;


Status: RESOLVED → REOPENED
Resolution: FIXED → ---
r=hwaara; go ahead and check-in the change.
Depends on: svgbranch
Checked in as part of bug 182533.
Status: REOPENED → RESOLVED
Closed: 22 years ago21 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: