Closed Bug 1393088 Opened 7 years ago Closed 7 years ago

Port bug 1390209 to C-C [Remove unused nsIDOMHTML*Element interfaces]

Categories

(Thunderbird :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 57.0

People

(Reporter: Paenglab, Assigned: jorgk-bmo)

Details

Attachments

(2 files, 2 obsolete files)

I get this error: z:/Mozilla/comm-central/mailnews/compose/src/nsMsgSend.cpp(30): fatal error C1083: Cannot open include file: 'nsIDOMHTMLBodyElement.h': No such file or directory Bug 1390209 removed this. backout of this bug makes TB buildable.
This compiles, but I'm not sure that it's right. Very few C++ examples of HTMLBodyElement in the tree. Sadly :bz is on holidays, I'll see how I get advice on this. Maybe Ehsan.
Assignee: nobody → jorgk
Status: NEW → ASSIGNED
Comment on attachment 8900359 [details] [diff] [review] 1393088-nsIDOMHTMLBodyElement.patch Review of attachment 8900359 [details] [diff] [review]: ----------------------------------------------------------------- ::: mailnews/compose/src/nsMsgSend.cpp @@ +1289,5 @@ > // Now, we know the types of objects this node can be, so we will do > // our query interface here and see what we come up with > + nsCOMPtr<Element> bodyElement = (do_QueryInterface(node)); > + RefPtr<mozilla::dom::HTMLBodyElement> body = > + static_cast<mozilla::dom::HTMLBodyElement*>(mozilla::dom::HTMLBodyElement::FromContentOrNull(bodyElement)); Why the cast? The RefPtr<mozilla::dom::HTMLImageElement> below doesn't have it.
Without the cast I get: 0:12.66 c:/mozilla-source/comm-central/mailnews/compose/src/nsMsgSend.cpp(1293): error C2440: 'initializing': cannot convert from 'nsGenericHTMLElement *' to 'RefPtr<mozilla::dom::HTMLBodyElement>' 0:12.66 c:/mozilla-source/comm-central/mailnews/compose/src/nsMsgSend.cpp(1293): note: No constructor could take the source type, or constructor overload resolution was ambiguous
I actually works, I sent and e-mail with background and it was downloaded and attached.
After advice from Olli Pettay (:smaug) on IRC I came up with this.
Attachment #8900359 - Attachment is obsolete: true
Comment on attachment 8900385 [details] [diff] [review] 1393088-nsIDOMHTMLBodyElement.patch (v2). >+ nsCOMPtr<nsINode> bodyNode = do_QueryInterface(node); I wouldn't call this bodyNode, since it may not point to a body element. Perhaps just n or some such temporary sounding variable name? > // Now, we know the types of objects this node can be, so we will do > // our query interface here and see what we come up with >- nsCOMPtr<nsIDOMHTMLBodyElement> body = (do_QueryInterface(domSaveArray[j].node)); >+ nsCOMPtr<nsINode> bodyNode = (do_QueryInterface(domSaveArray[j].node)); same here. (and I wonder why () around QI) > // Now, we know the types of objects this node can be, so we will do > // our query interface here and see what we come up with >- nsCOMPtr<nsIDOMHTMLBodyElement> body = (do_QueryInterface(domSaveArray[i].node)); >+ nsCOMPtr<nsINode> bodyNode = (do_QueryInterface(domSaveArray[i].node)); and here
Attachment #8900385 - Flags: review+
Thank you, Olli!
Attachment #8900385 - Attachment is obsolete: true
Attachment #8900402 - Flags: review+
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/1777ffb9363f Port bug 1390209 to mailnews: Remove use of nsIDOMHTMLBodyElement. r=smaug
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 57.0
Hmm, all red. And my local fails too.
Hmm, compiled locally without having pulled M-C. The interface I used should have been in place already but I can see there are some string type issues. Just comment out the four lines and don't send anything. I'll fix it (now in a Council meeting).
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/e7173819d591 Port bug 1390209 to mailnews, follow-up: Correct parameters of [Get|Set]Background(). rs=bustage-fix
The string bits in these patches are very very wrong. See upcoming comments in bug 1403516.
Like "might well be a security bug" wrong.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: