Closed Bug 1381011 Opened 4 years ago Closed 4 years ago

Port bug 1380413 to mailnews [Remove some unused nsIDOMHTMLImageElement bits]

Categories

(Thunderbird :: General, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 56.0

People

(Reporter: jorgk-bmo, Assigned: jorgk-bmo)

References

Details

Attachments

(1 file, 1 obsolete file)

1:13.92 c:/mozilla-source/comm-central/mailnews/compose/src/nsMsgCompose.cpp(275): error C2039: 'GetSrc': is not a member of 'nsIDOMHTMLImageElement'
Depends on: 1380413
Can Thunderbird include mozilla/dom/HTMLImageElement.h and use it here?
I'm onto it:
  nsCOMPtr<Element> imageElement = do_QueryInterface(object);
  RefPtr<mozilla::dom::HTMLImageElement> image = mozilla::dom::HTMLImageElement::FromContent(imageElement);
  if (image)
  {
    image->GetSrc(objURL);
  }
Sadly, we're fighting three bustages concurrently, this one and bug 1381006 and bug 1380906.
>  RefPtr<mozilla::dom::HTMLImageElement> image = mozilla::dom::HTMLImageElement::FromContent(imageElement);

You want FromContentOrNull, if "object" can actually not be an element.

Or you could return false up front if !imageElement, of course, then use FromContent.
Attached patch 1381011-HTMLImageElement.patch (obsolete) — Splinter Review
Boris, can you please look this over. I can compile with this patch.
Flags: needinfo?(bzbarsky)
1.  See comment 3.  That applies in a few places.
2.  In ResetUrisForEmbed you want IgnoredErrorResult if you really plan to ignore it.
Flags: needinfo?(bzbarsky)
Re. 2: OK, how would I not ignore it, can you give me two lines of code, please.
That depends on what you want to happen when the attribute set fails, no?

The current code ignores such failures, of course, so continuing to do so is not unreasonable.
Some tweaks to address issues, white-space and variable names.
Attachment #8886616 - Attachment is obsolete: true
https://hg.mozilla.org/comm-central/rev/130d043e685055c682059c92dc582acb2a65afd2
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 56.0
Summary: Port bug 1380413 to mailnews → Port bug 1380413 to mailnews [Remove some unused nsIDOMHTMLImageElement bits]
You need to log in before you can comment on or make changes to this bug.