Bug 1861726 - Remove unused StyleImage::GetIntrinsicSize. r=boris

It doesn't account for various subtleties like aspect ratios etc, so
let's remove it.

Depends on D192131

Differential Revision: https://phabricator.services.mozilla.com/D192132
This commit is contained in:
Emilio Cobos Álvarez 2023-11-01 17:17:13 +00:00
Родитель e3d3714eba
Коммит 77a79110dc
3 изменённых файлов: 0 добавлений и 28 удалений

Просмотреть файл

@ -971,9 +971,6 @@ inline const StyleImage& StyleImage::FinalImage() const {
return sNone;
}
template <>
Maybe<CSSIntSize> StyleImage::GetIntrinsicSize() const;
template <>
inline bool StyleImage::IsImageRequestType() const {
const auto& finalImage = FinalImage();

Просмотреть файл

@ -1560,27 +1560,6 @@ ImageResolution StyleImage::GetResolution() const {
return resolution;
}
template <>
Maybe<CSSIntSize> StyleImage::GetIntrinsicSize() const {
imgRequestProxy* request = GetImageRequest();
if (!request) {
return Nothing();
}
RefPtr<imgIContainer> image;
request->GetImage(getter_AddRefs(image));
if (!image) {
return Nothing();
}
// FIXME(emilio): Seems like this should be smarter about unspecified width /
// height, aspect ratio, etc, but this preserves the current behavior of our
// only caller for now...
int32_t w = 0, h = 0;
image->GetWidth(&w);
image->GetHeight(&h);
GetResolution().ApplyTo(w, h);
return Some(CSSIntSize{w, h});
}
// --------------------
// nsStyleImageLayers
//

Просмотреть файл

@ -878,10 +878,6 @@ renaming_overrides_prefixing = true
// size of the image.
ImageResolution GetResolution() const;
// Returns the intrinsic size of the image, if there's one, accounting for
// resolution as needed.
Maybe<CSSIntSize> GetIntrinsicSize() const;
// If this is an image-set(), the final image we've selected, otherwise it
// returns *this.
const StyleGenericImage& FinalImage() const;