summaryrefslogtreecommitdiffstats
path: root/layout/generic/nsImageFrame.h
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-08-31 05:54:39 +0000
committerMoonchild <moonchild@palemoon.org>2020-08-31 05:54:39 +0000
commita6f632714fcb1be3dd00b0fc76fbf6bfc693155b (patch)
treeb04c82f9af4a0d288a6d4350d774ad8fe6dac903 /layout/generic/nsImageFrame.h
parent2ed0607c747b21cadaf7401d4ba706097578e74d (diff)
parentb28effe2ea93e43e362f7ce263d23b55adcb6da7 (diff)
downloadUXP-a6f632714fcb1be3dd00b0fc76fbf6bfc693155b.tar
UXP-a6f632714fcb1be3dd00b0fc76fbf6bfc693155b.tar.gz
UXP-a6f632714fcb1be3dd00b0fc76fbf6bfc693155b.tar.lz
UXP-a6f632714fcb1be3dd00b0fc76fbf6bfc693155b.tar.xz
UXP-a6f632714fcb1be3dd00b0fc76fbf6bfc693155b.zip
Merge branch 'redwood' into releaseRELBASE_20200831
Diffstat (limited to 'layout/generic/nsImageFrame.h')
-rw-r--r--layout/generic/nsImageFrame.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/layout/generic/nsImageFrame.h b/layout/generic/nsImageFrame.h
index 59af1be32..5e9b67274 100644
--- a/layout/generic/nsImageFrame.h
+++ b/layout/generic/nsImageFrame.h
@@ -86,7 +86,7 @@ public:
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
virtual mozilla::IntrinsicSize GetIntrinsicSize() override;
- virtual nsSize GetIntrinsicRatio() override;
+ virtual mozilla::AspectRatio GetIntrinsicRatio() override;
virtual void Reflow(nsPresContext* aPresContext,
ReflowOutput& aDesiredSize,
const ReflowInput& aReflowInput,
@@ -273,21 +273,19 @@ private:
void GetDocumentCharacterSet(nsACString& aCharset) const;
bool ShouldDisplaySelection();
+ // Whether the image frame should use the mapped aspect ratio from width=""
+ // and height="".
+ bool ShouldUseMappedAspectRatio() const;
+
/**
* Recalculate mIntrinsicSize from the image.
- *
- * @return whether aImage's size did _not_
- * match our previous intrinsic size.
*/
- bool UpdateIntrinsicSize(imgIContainer* aImage);
+ bool UpdateIntrinsicSize();
/**
* Recalculate mIntrinsicRatio from the image.
- *
- * @return whether aImage's ratio did _not_
- * match our previous intrinsic ratio.
*/
- bool UpdateIntrinsicRatio(imgIContainer* aImage);
+ bool UpdateIntrinsicRatio();
/**
* This function calculates the transform for converting between
@@ -308,6 +306,12 @@ private:
bool IsPendingLoad(imgIRequest* aRequest) const;
/**
+ * Updates mImage based on the current image request (cannot be null), and the
+ * image passed in (can be null), and invalidate layout and paint as needed.
+ */
+ void UpdateImage(imgIRequest* aRequest, imgIContainer* aImage);
+
+ /**
* Function to convert a dirty rect in the source image to a dirty
* rect for the image frame.
*/
@@ -333,7 +337,7 @@ private:
nsCOMPtr<imgIContainer> mPrevImage;
nsSize mComputedSize;
mozilla::IntrinsicSize mIntrinsicSize;
- nsSize mIntrinsicRatio;
+ mozilla::AspectRatio mIntrinsicRatio;
bool mDisplayingIcon;
bool mFirstFrameComplete;