Closed Bug 264987 Opened 20 years ago Closed 20 years ago

code level bug : missing do_QueryInterface() ?

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bernard.alleysson, Assigned: bernard.alleysson)

References

()

Details

Attachments

(1 file)

assigning according to cvsblame (patch bug 255337)

Found by code inspection. It seems that do_GetInterface() was lost. Here is the
patch:

Index: html/style/src/nsCSSRendering.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/html/style/src/nsCSSRendering.cpp,v
retrieving revision 3.252
diff -u -8 -p -r3.252 nsCSSRendering.cpp
--- html/style/src/nsCSSRendering.cpp	11 Oct 2004 16:29:42 -0000	3.252
+++ html/style/src/nsCSSRendering.cpp	18 Oct 2004 23:52:36 -0000
@@ -2636,17 +2636,17 @@ FindElementBackground(nsPresContext* aPr
   if (!parentFrame)
     return PR_TRUE; // no parent to look at
 
   if (content->Tag() != nsHTMLAtoms::body)
     return PR_TRUE; // not frame for <BODY> element
 
   // We should only look at the <html> background if we're in an HTML document
   nsIDocument* document = content->GetOwnerDoc();
-  nsCOMPtr<nsIDOMHTMLDocument> htmlDoc(document);
+  nsCOMPtr<nsIDOMHTMLDocument> htmlDoc = do_QueryInterface(document);
   if (!htmlDoc)
     return PR_TRUE;
 
   if (document->IsCaseSensitive()) // XHTML, not HTML
     return PR_TRUE;
   
   const nsStyleBackground* htmlBG = parentFrame->GetStyleBackground();
   return !htmlBG->IsTransparent();
oops, please replace do_GetInterface() by do_QueryInterface
Summary: code level bug : missing do_GetInterface() ? → code level bug : missing do_QueryInterface() ?
Attached patch Bernard's patchSplinter Review
In general, it's easier to work with patches when they're attached to bugs...
;)
Comment on attachment 162529 [details] [diff] [review]
Bernard's patch

r+sr=bzbarsky.	I do rather wonder how this compiled...
Attachment #162529 - Flags: superreview+
Attachment #162529 - Flags: review+
To patch author.  ;)
Assignee: bzbarsky → balleysson
Checked in on the trunk.  Thanks for catching this, Bernard!
Status: NEW → RESOLVED
Closed: 20 years ago
OS: Windows Server 2003 → All
Hardware: PC → All
Resolution: --- → FIXED
(In reply to comment #3)
> I do rather wonder how this compiled...

due to bug 253941
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: