Bug 1631541 - Remove unused ImageDocument webidl bits. r=smaug

The rest are used only for testing, but I'll figure what to do with
those in some other bug.

Differential Revision: https://phabricator.services.mozilla.com/D71626
This commit is contained in:
Emilio Cobos Álvarez 2020-04-20 20:23:52 +00:00
Родитель df2e891775
Коммит 66c26340c4
5 изменённых файлов: 0 добавлений и 62 удалений

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

@ -287,17 +287,6 @@ void ImageDocument::OnPageShow(bool aPersisted,
MediaDocument::OnPageShow(aPersisted, aDispatchStartTarget, aOnlySystemGroup);
}
already_AddRefed<imgIRequest> ImageDocument::GetImageRequest(ErrorResult& aRv) {
nsCOMPtr<nsIImageLoadingContent> imageLoader =
do_QueryInterface(mImageContent);
nsCOMPtr<imgIRequest> imageRequest;
if (imageLoader) {
aRv = imageLoader->GetRequest(nsIImageLoadingContent::CURRENT_REQUEST,
getter_AddRefs(imageRequest));
}
return imageRequest.forget();
}
void ImageDocument::ShrinkToFit() {
if (!mImageContent) {
return;
@ -411,18 +400,6 @@ void ImageDocument::RestoreImage() {
UpdateTitleAndCharset();
}
void ImageDocument::ToggleImageSize() {
mShouldResize = true;
if (mImageIsResized) {
mShouldResize = false;
ResetZoomLevel();
RestoreImage();
} else if (ImageIsOverflowing()) {
ResetZoomLevel();
ShrinkToFit();
}
}
void ImageDocument::NotifyPossibleTitleChange(bool aBoundTitleElement) {
if (!mHasCustomTitle && !mTitleUpdateInProgress) {
mHasCustomTitle = true;

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

@ -60,13 +60,11 @@ class ImageDocument final : public MediaDocument,
return mImageIsOverflowingHorizontally || mImageIsOverflowingVertically;
}
bool ImageIsResized() const { return mImageIsResized; }
already_AddRefed<imgIRequest> GetImageRequest(ErrorResult& aRv);
// ShrinkToFit is called from xpidl methods and we don't have a good
// way to mark those MOZ_CAN_RUN_SCRIPT yet.
MOZ_CAN_RUN_SCRIPT_BOUNDARY void ShrinkToFit();
void RestoreImage();
void RestoreImageTo(int32_t aX, int32_t aY) { ScrollImageTo(aX, aY, true); }
void ToggleImageSize();
virtual void NotifyPossibleTitleChange(bool aBoundTitleElement) override;

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

@ -1,23 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<script>
function boom()
{
var frame = document.getElementById("f");
var frameDoc = frame.contentDocument;
document.body.removeChild(frame);
try { frameDoc.shrinkToFit(); }catch(e){}
try { frameDoc.restoreImageTo(1,1); }catch(e){}
try { frameDoc.restoreImage(); }catch(e){}
try { frameDoc.toggleImageSize(); }catch(e){}
}
</script>
</head>
<body onload="boom();">
<iframe id="f" src="data:image/gif;base64,R0lGODlhAQABAID/AP///wAAACwAAAAAAQABAAACAkQBADs="></iframe>
</body>
</html>

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

@ -33,7 +33,6 @@ load 580507-1.xhtml
load 590387.html
load 596785-1.html
load 596785-2.html
load 601422.html
load 602117.html
load 604807.html
load 605264.html

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

@ -4,8 +4,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/.
*/
interface imgIRequest;
[ChromeOnly, OverrideBuiltins,
Exposed=Window]
interface ImageDocument : HTMLDocument {
@ -15,10 +13,6 @@ interface ImageDocument : HTMLDocument {
/* Whether the image has been resized to fit visible area. */
readonly attribute boolean imageIsResized;
/* The image request being displayed in the content area */
[Throws]
readonly attribute imgIRequest? imageRequest;
/* Resize the image to fit visible area. */
void shrinkToFit();
@ -29,11 +23,4 @@ interface ImageDocument : HTMLDocument {
* The coordinate system is that of the shrunken image.
*/
void restoreImageTo(long x, long y);
/* A helper method for switching between states.
* The switching logic is as follows. If the image has been resized
* restore image original size, otherwise if the image is overflowing
* current visible area resize the image to fit the area.
*/
void toggleImageSize();
};