fix warnings from jst's nsGenericElement checkin

VERIFIED FIXED in Future

Status

()

P3
normal
VERIFIED FIXED
18 years ago
11 years ago

People

(Reporter: dbaron, Assigned: bryner)

Tracking

({dom1})

Trunk
Future
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

I'm working on a patch to fix the warnings from jst's checkin making content
objects inherit from nsGenericElement, using |using|.  It seems to work
for me (RedHat gcc-2.96-70), and I'm using the
HAVE_CPP_AMBIGUITY_RESOLVING_USING macro set by autoconf and also set for
Mac.  I'm not sure whether the autoconf test is exactly what we want, though.
(It's not used anywhere else.)

Anyway, I'll attach a patch that shows the general approach.  I've fixed
many of the warnings that can be fixed by changing nsGenericElement
or nsGenericHTMLElement, but some can be fixed only on the different
content objects.  I've only done nsHTMLAnchorElement as a sample.

Any thoughts on whether this is a good idea?  It would sure be nice not to
have to look at these warnings...
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla0.8
Keywords: dom1
Component: DOM Level 1 → DOM HTML

Comment 2

18 years ago
QA contact Update
QA Contact: janc → desale

Comment 3

18 years ago
Will this fix these warnings? --

Warning : 'nsGenericElement::GetAttribute(const nsAString &, nsAString &)' hides 
inherited virtual function 'nsIContent::GetAttribute(int, nsIAtom *, nsAString &
)const '
nsGenericElement.h line 361   };

Warning : 'nsGenericElement::SetAttribute(const nsAString &, const nsAString &)' 
hides inherited virtual function 'nsIContent::SetAttribute(nsINodeInfo *, const 
nsAString &, int)'
nsGenericElement.h line 361   };
Yes, it should.

I think jst said he has a different fix for this, and he's not sure which to use.
(I think his fix is renaming one of the two |SetAttribute|/|GetAttribute| pairs
of methods, but I'm not sure.)
Reality check.  Moving out to 0.9.1.
Target Milestone: mozilla0.9 → mozilla0.9.1

Comment 6

18 years ago
Updating QA contact to Shivakiran Tummala.
QA Contact: desale → stummala
(Assignee)

Comment 8

18 years ago
Ok, this patch fixes the method hiding warnings by changing Attribute to Attr in
nsIContent method names.

Comment 9

18 years ago
r=jag
Bryner, you're my hero for fixing all these warnings I introduced way back when,
sr=jst for the changes, all I found when reviewing was a few indendtation nits:

- nsDOMAttributeMap.cpp:

@@ -291,7 +291,7 @@
     nsresult attrResult;
     nsAutoString value;
 
-    attrResult = mContent->GetAttribute(nameSpaceID, nameAtom,
+    attrResult = mContent->GetAttr(nameSpaceID, nameAtom,
                                         *getter_AddRefs(prefix), value);

nsGenericHTMLElement.cpp:

@@ -1583,7 +1583,7 @@
 
   // We still rely on the old way of setting the attribute.
 
-  return NS_STATIC_CAST(nsIContent *, this)->SetAttribute(nsid, atom, aValue,
+  return NS_STATIC_CAST(nsIContent *, this)->SetAttr(nsid, atom, aValue,
                                                           aNotify);
 
- nsXULContentBuilder.cpp:

 else {
-                aRealElement->UnsetAttribute(attribNameSpaceID,
+                aRealElement->UnsetAttr(attribNameSpaceID,
                                              attribName,
                                              PR_TRUE);
             }
@@ -1398,7 +1398,7 @@

- nsXULTemplateBuilder.cpp:

-        rv = aRuleElement->GetAttributeNameAt(i, attrNameSpaceID,
+        rv = aRuleElement->GetAttrNameAt(i, attrNameSpaceID,
                                               *getter_AddRefs(attr),
                                               *getter_AddRefs(prefix));
         if (NS_FAILED(rv)) return rv;
@@ -2152,7 +2152,7 @@

and also around line 2310:

-            element->GetAttributeNameAt(i, nameSpaceID, *getter_AddRefs(attr),
+            element->GetAttrNameAt(i, nameSpaceID, *getter_AddRefs(attr),
                                         *getter_AddRefs(prefix));
(Assignee)

Comment 11

18 years ago
I'll take this since I have the patch.
Assignee: dbaron → bryner
assignee_accessible: 1 → 0
Status: ASSIGNED → NEW
CC list accessible: false
qacontact_accessible: 1 → 0
Not accessible to reporter
(Assignee)

Comment 12

18 years ago
Checked in.
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
assignee_accessible: 0 → 1
CC list accessible: true
qacontact_accessible: 0 → 1
Accessible to reporter
Fixing database corruption caused by bug 95743.  Pay no attention to the man
behind the curtain.

Comment 14

18 years ago
This is strictly a development issue, warning messages in the code are used for
debugging and does not have any greater impact. Marking verified as per
developer comments above. 
Status: RESOLVED → VERIFIED

Updated

11 years ago
Component: DOM: HTML → DOM: Core & HTML
QA Contact: stummala → general
You need to log in before you can comment on or make changes to this bug.