зеркало из https://github.com/mozilla/gecko-dev.git
Back out fe2be5137635:0dc2e0f4fbcc (bug 917595) for reftest failures
This commit is contained in:
Родитель
9d27abea6f
Коммит
8de499b562
|
@ -1,18 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="reftest-wait">
|
|
||||||
<style>
|
|
||||||
iframe {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border: 0px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script>
|
|
||||||
document.addEventListener('MozReftestInvalidate',
|
|
||||||
() => document.documentElement.removeAttribute('class'),
|
|
||||||
false);
|
|
||||||
</script>
|
|
||||||
<body>
|
|
||||||
<iframe src="bug917595-unrotated.jpg" scrolling="no" marginwidth="0" marginheight="0"></iframe>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Двоичные данные
content/html/document/reftests/bug917595-exif-rotated.jpg
Двоичные данные
content/html/document/reftests/bug917595-exif-rotated.jpg
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 89 KiB |
|
@ -1,18 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html class="reftest-wait">
|
|
||||||
<style>
|
|
||||||
iframe {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border: 0px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script>
|
|
||||||
document.addEventListener('MozReftestInvalidate',
|
|
||||||
() => document.documentElement.removeAttribute('class'),
|
|
||||||
false);
|
|
||||||
</script>
|
|
||||||
<body>
|
|
||||||
<iframe src="bug917595-exif-rotated.jpg" scrolling="no" marginwidth="0" marginheight="0"></iframe>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Двоичные данные
content/html/document/reftests/bug917595-pixel-rotated.jpg
Двоичные данные
content/html/document/reftests/bug917595-pixel-rotated.jpg
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 89 KiB |
Двоичные данные
content/html/document/reftests/bug917595-unrotated.jpg
Двоичные данные
content/html/document/reftests/bug917595-unrotated.jpg
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 89 KiB |
|
@ -3,9 +3,3 @@
|
||||||
|
|
||||||
== bug448564-4a.html bug448564-4b.html
|
== bug448564-4a.html bug448564-4b.html
|
||||||
== bug502168-1_malformed.html bug502168-1_well-formed.html
|
== bug502168-1_malformed.html bug502168-1_well-formed.html
|
||||||
|
|
||||||
# Test that image documents taken into account CSS properties like
|
|
||||||
# image-orientation when determining the size of the image.
|
|
||||||
# (Fuzzy necessary due to pixel-wise comparison of different JPEGs.)
|
|
||||||
== bug917595-iframe-1.html bug917595-1-ref.html
|
|
||||||
fuzzy(1,57) == bug917595-exif-rotated.jpg bug917595-pixel-rotated.jpg
|
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
#include "nsIDOMKeyEvent.h"
|
#include "nsIDOMKeyEvent.h"
|
||||||
#include "nsIDOMMouseEvent.h"
|
#include "nsIDOMMouseEvent.h"
|
||||||
#include "nsIDOMEventListener.h"
|
#include "nsIDOMEventListener.h"
|
||||||
#include "nsIFrame.h"
|
|
||||||
#include "nsGkAtoms.h"
|
#include "nsGkAtoms.h"
|
||||||
#include "imgIRequest.h"
|
#include "imgIRequest.h"
|
||||||
#include "imgILoader.h"
|
#include "imgILoader.h"
|
||||||
|
@ -210,7 +209,6 @@ ImageDocument::Destroy()
|
||||||
if (mImageContent) {
|
if (mImageContent) {
|
||||||
// Remove our event listener from the image content.
|
// Remove our event listener from the image content.
|
||||||
nsCOMPtr<EventTarget> target = do_QueryInterface(mImageContent);
|
nsCOMPtr<EventTarget> target = do_QueryInterface(mImageContent);
|
||||||
target->RemoveEventListener(NS_LITERAL_STRING("load"), this, false);
|
|
||||||
target->RemoveEventListener(NS_LITERAL_STRING("click"), this, false);
|
target->RemoveEventListener(NS_LITERAL_STRING("click"), this, false);
|
||||||
|
|
||||||
// Break reference cycle with mImageContent, if we have one
|
// Break reference cycle with mImageContent, if we have one
|
||||||
|
@ -255,7 +253,6 @@ ImageDocument::SetScriptGlobalObject(nsIScriptGlobalObject* aScriptGlobalObject)
|
||||||
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to create synthetic document");
|
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to create synthetic document");
|
||||||
|
|
||||||
target = do_QueryInterface(mImageContent);
|
target = do_QueryInterface(mImageContent);
|
||||||
target->AddEventListener(NS_LITERAL_STRING("load"), this, false);
|
|
||||||
target->AddEventListener(NS_LITERAL_STRING("click"), this, false);
|
target->AddEventListener(NS_LITERAL_STRING("click"), this, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -512,11 +509,8 @@ ImageDocument::SetModeClass(eModeClasses mode)
|
||||||
nsresult
|
nsresult
|
||||||
ImageDocument::OnStartContainer(imgIRequest* aRequest, imgIContainer* aImage)
|
ImageDocument::OnStartContainer(imgIRequest* aRequest, imgIContainer* aImage)
|
||||||
{
|
{
|
||||||
// Styles have not yet been applied, so we don't know the final size. For now,
|
|
||||||
// default to the image's intrinsic size.
|
|
||||||
aImage->GetWidth(&mImageWidth);
|
aImage->GetWidth(&mImageWidth);
|
||||||
aImage->GetHeight(&mImageHeight);
|
aImage->GetHeight(&mImageHeight);
|
||||||
|
|
||||||
nsCOMPtr<nsIRunnable> runnable =
|
nsCOMPtr<nsIRunnable> runnable =
|
||||||
NS_NewRunnableMethod(this, &ImageDocument::DefaultCheckOverflowing);
|
NS_NewRunnableMethod(this, &ImageDocument::DefaultCheckOverflowing);
|
||||||
nsContentUtils::AddScriptRunner(runnable);
|
nsContentUtils::AddScriptRunner(runnable);
|
||||||
|
@ -579,44 +573,11 @@ ImageDocument::HandleEvent(nsIDOMEvent* aEvent)
|
||||||
else if (mImageIsOverflowing) {
|
else if (mImageIsOverflowing) {
|
||||||
ShrinkToFit();
|
ShrinkToFit();
|
||||||
}
|
}
|
||||||
} else if (eventType.EqualsLiteral("load")) {
|
|
||||||
UpdateSizeFromLayout();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
ImageDocument::UpdateSizeFromLayout()
|
|
||||||
{
|
|
||||||
// Pull an updated size from the content frame to account for any size
|
|
||||||
// change due to CSS properties like |image-orientation|.
|
|
||||||
Element* contentElement = mImageContent->AsElement();
|
|
||||||
if (!contentElement) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsIFrame* contentFrame = contentElement->GetPrimaryFrame(Flush_Frames);
|
|
||||||
if (!contentFrame) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsIntSize oldSize(mImageWidth, mImageHeight);
|
|
||||||
IntrinsicSize newSize = contentFrame->GetIntrinsicSize();
|
|
||||||
|
|
||||||
if (newSize.width.GetUnit() == eStyleUnit_Coord) {
|
|
||||||
mImageWidth = nsPresContext::AppUnitsToFloatCSSPixels(newSize.width.GetCoordValue());
|
|
||||||
}
|
|
||||||
if (newSize.height.GetUnit() == eStyleUnit_Coord) {
|
|
||||||
mImageHeight = nsPresContext::AppUnitsToFloatCSSPixels(newSize.height.GetCoordValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ensure that our information about overflow is up-to-date if needed.
|
|
||||||
if (mImageWidth != oldSize.width || mImageHeight != oldSize.height) {
|
|
||||||
CheckOverflowing(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
ImageDocument::CreateSyntheticDocument()
|
ImageDocument::CreateSyntheticDocument()
|
||||||
{
|
{
|
||||||
|
|
|
@ -94,8 +94,6 @@ protected:
|
||||||
void ResetZoomLevel();
|
void ResetZoomLevel();
|
||||||
float GetZoomLevel();
|
float GetZoomLevel();
|
||||||
|
|
||||||
void UpdateSizeFromLayout();
|
|
||||||
|
|
||||||
enum eModeClasses {
|
enum eModeClasses {
|
||||||
eNone,
|
eNone,
|
||||||
eShrinkToFit,
|
eShrinkToFit,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче