Bug 1507540 part 7. Use notxpcom more in dom/. r=mccr8

This commit is contained in:
Boris Zbarsky
2018-11-19 20:20:17 -05:00
parent 951cf5c0c5
commit e808e8154d
18 changed files with 65 additions and 164 deletions

View File

@@ -758,23 +758,10 @@ HTMLImageElement::Image(const GlobalObject& aGlobal,
return img.forget();
}
NS_IMETHODIMP
HTMLImageElement::GetNaturalHeight(uint32_t* aNaturalHeight)
{
*aNaturalHeight = NaturalHeight();
return NS_OK;
}
uint32_t
HTMLImageElement::NaturalHeight()
{
uint32_t height;
nsresult rv = nsImageLoadingContent::GetNaturalHeight(&height);
if (NS_FAILED(rv)) {
MOZ_ASSERT(false, "GetNaturalHeight should not fail");
return 0;
}
uint32_t height = nsImageLoadingContent::NaturalHeight();
if (mResponsiveSelector) {
double density = mResponsiveSelector->GetSelectedImageDensity();
@@ -785,23 +772,10 @@ HTMLImageElement::NaturalHeight()
return height;
}
NS_IMETHODIMP
HTMLImageElement::GetNaturalWidth(uint32_t* aNaturalWidth)
{
*aNaturalWidth = NaturalWidth();
return NS_OK;
}
uint32_t
HTMLImageElement::NaturalWidth()
{
uint32_t width;
nsresult rv = nsImageLoadingContent::GetNaturalWidth(&width);
if (NS_FAILED(rv)) {
MOZ_ASSERT(false, "GetNaturalWidth should not fail");
return 0;
}
uint32_t width = nsImageLoadingContent::NaturalWidth();
if (mResponsiveSelector) {
double density = mResponsiveSelector->GetSelectedImageDensity();