Merge backout of bug 595337 and bug 556487.

This commit is contained in:
Benjamin Smedberg 2010-09-14 14:51:04 -07:00
commit 79b91c860d
18 changed files with 95 additions and 40 deletions

View File

@ -83,5 +83,5 @@ function test() {
let button = document.getElementById("tabview-button");
ok(button, "Tab View button exists");
EventUtils.synthesizeMouse(button, 1, 1, {});
button.doCommand();
}

View File

@ -11,13 +11,7 @@ function test() {
ctx.tab1 = gBrowser.addTab(testPath + "bug592641_img.jpg");
ctx.tab1Browser = gBrowser.getBrowserForTab(ctx.tab1);
ctx.tab1Browser.addEventListener("load",
// onload is fired in OnStopDecode, so let's
// use executeSoon() to make sure that any
// other OnStopDecode event handlers get the
// chance to fire first.
function() {executeSoon(load1Done);},
true);
ctx.tab1Browser.addEventListener("load", load1Soon, true);
}
function checkTitle(title) {
@ -27,9 +21,14 @@ function checkTitle(title) {
"Title should be correct on load #" + ctx.loadsDone);
}
function load1Soon() {
ctx.tab1Browser.removeEventListener("load", load1Soon, true);
// onload is fired in OnStopDecode, so let's use executeSoon() to make sure
// that any other OnStopDecode event handlers get the chance to fire first.
executeSoon(load1Done);
}
function load1Done() {
// Check the title
var title = ctx.tab1Browser.contentWindow.document.title;
checkTitle(title);
@ -38,19 +37,17 @@ function load1Done() {
// the cached case.
ctx.tab2 = gBrowser.addTab(testPath + "bug592641_img.jpg");
ctx.tab2Browser = gBrowser.getBrowserForTab(ctx.tab2);
ctx.tab2Browser.addEventListener("load",
// onload is fired in OnStopDecode, so let's
// use executeSoon() to make sure that any
// other OnStopDecode event handlers get the
// chance to fire first.
function() {executeSoon(load2Done);},
true);
ctx.tab2Browser.addEventListener("load", load2Soon, true);
}
function load2Soon() {
ctx.tab2Browser.removeEventListener("load", load2Soon, true);
// onload is fired in OnStopDecode, so let's use executeSoon() to make sure
// that any other OnStopDecode event handlers get the chance to fire first.
executeSoon(load2Done);
}
function load2Done() {
// Check the title
var title = ctx.tab2Browser.contentWindow.document.title;
checkTitle(title);

View File

@ -78,7 +78,6 @@ EXPORTS = \
nsPIWindowRoot.h \
nsFocusManager.h \
nsWrapperCache.h \
nsContentPermissionHelper.h \
$(NULL)
CPPSRCS = \
@ -102,8 +101,16 @@ CPPSRCS = \
nsScriptNameSpaceManager.cpp \
nsDOMScriptObjectFactory.cpp \
nsQueryContentEventResult.cpp \
$(NULL)
ifdef MOZ_IPC
EXPORTS += \
nsContentPermissionHelper.h \
$(NULL)
CPPSRCS += \
nsContentPermissionHelper.cpp \
$(NULL)
endif
include $(topsrcdir)/dom/dom-config.mk

View File

@ -43,8 +43,6 @@
#include "mozilla/unused.h"
#ifdef MOZ_IPC
using mozilla::unused; // <snicker>
nsContentPermissionRequestProxy::nsContentPermissionRequestProxy()
@ -164,4 +162,3 @@ ContentPermissionRequestParent::Recvprompt()
} // namespace dom
} // namespace mozilla
#endif

View File

@ -0,0 +1 @@
<iframe src="data:text/html,%3Cdiv%20style%3D%22background%3A%20-moz-element(%23e)%22%3Ez"></iframe>

View File

@ -333,4 +333,5 @@ load 586806-1.html
load 586806-2.html
load 586806-3.html
load 586973-1.html
load 590404.html
load 591141.html

View File

@ -775,6 +775,12 @@ nsImageFrame::GetPrefWidth(nsIRenderingContext *aRenderingContext)
mIntrinsicSize.width.GetCoordValue() : 0;
}
/* virtual */ nsIFrame::IntrinsicSize
nsImageFrame::GetIntrinsicSize()
{
return mIntrinsicSize;
}
/* virtual */ nsSize
nsImageFrame::GetIntrinsicRatio()
{

View File

@ -109,6 +109,7 @@ public:
const nsDisplayListSet& aLists);
virtual nscoord GetMinWidth(nsIRenderingContext *aRenderingContext);
virtual nscoord GetPrefWidth(nsIRenderingContext *aRenderingContext);
virtual IntrinsicSize GetIntrinsicSize();
virtual nsSize GetIntrinsicRatio();
NS_IMETHOD Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,

View File

@ -707,6 +707,7 @@ IsPercentageAware(const nsIFrame* aFrame)
if ((
#ifdef MOZ_SVG
fType == nsGkAtoms::svgOuterSVGFrame ||
fType == nsGkAtoms::imageFrame ||
#endif
fType == nsGkAtoms::subDocumentFrame) &&
const_cast<nsIFrame*>(aFrame)->GetIntrinsicSize().width.GetUnit() ==

View File

@ -0,0 +1,7 @@
<html>
<body>
<div style="width: 200px; height: 200px; border: 2px dashed green">
<img src="squaredCircle-viewBox-noSize.svg">
</div>
</body>
</html>

View File

@ -0,0 +1,18 @@
<!-- This test makes sure that we resize SVG content correctly after the
container width is dynamically modified. -->
<html class="reftest-wait">
<head>
<script>
function go() {
document.getElementById("wrapper").style.width = "200px";
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="go()">
<div id="wrapper"
style="width: 100px; height: 200px; border: 2px dashed green">
<img src="squaredCircle-viewBox-noSize.svg">
</div>
</body>
</html>

View File

@ -28,7 +28,9 @@ include zoom/reftest.list
== img-simple-6.html lime100x100-ref.html
== img-simple-7.html lime100x100-ref.html
# More complex <img> tests
== img-content-outside-viewBox-1.html img-content-outside-viewBox-1-ref.html
== img-dyn-1.html img-dyn-1-ref.html
# XXXdholbert Some of the tests below fail on Windows 7 right now. Marking them
# random-on-windows right now while I investigate.

View File

@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<rect x="2" y="2" height="96" width="96"
stroke-width="4" stroke="black" fill="yellow"/>
<circle cx="50" cy="50" r="46" style="fill: blue"/>
</svg>

After

Width:  |  Height:  |  Size: 223 B

View File

@ -392,6 +392,9 @@ GetEffectPropertyForURI(nsIURI *aURI, nsIFrame *aFrame,
const FramePropertyDescriptor *aProperty,
nsSVGRenderingObserver * (* aCreate)(nsIURI *, nsIFrame *, PRBool))
{
if (!aURI)
return nsnull;
FrameProperties props = aFrame->Properties();
nsSVGEffects::URIObserverHashtable *hashtable =
static_cast<nsSVGEffects::URIObserverHashtable*>(props.Get(aProperty));

View File

@ -152,8 +152,7 @@ NS_IMETHODIMP nsZipDataStream::OnStopRequest(nsIRequest *aRequest,
inline nsresult nsZipDataStream::CompleteEntry()
{
nsresult rv = mStream->Flush();
NS_ENSURE_SUCCESS(rv, rv);
nsresult rv;
nsCOMPtr<nsISeekableStream> seekable = do_QueryInterface(mStream, &rv);
NS_ENSURE_SUCCESS(rv, rv);
PRInt64 pos;
@ -161,17 +160,7 @@ inline nsresult nsZipDataStream::CompleteEntry()
NS_ENSURE_SUCCESS(rv, rv);
mHeader->mCSize = pos - mHeader->mOffset - mHeader->GetFileHeaderLength();
// Go back and rewrite the file header
rv = seekable->Seek(nsISeekableStream::NS_SEEK_SET, mHeader->mOffset);
NS_ENSURE_SUCCESS(rv, rv);
rv = mHeader->WriteFileHeader(mStream);
NS_ENSURE_SUCCESS(rv, rv);
rv = mStream->Flush();
NS_ENSURE_SUCCESS(rv, rv);
rv = seekable->Seek(nsISeekableStream::NS_SEEK_SET, pos);
NS_ENSURE_SUCCESS(rv, rv);
mHeader->mWriteOnClose = PR_TRUE;
return NS_OK;
}

View File

@ -78,6 +78,7 @@ public:
mDisk(0),
mIAttr(0),
mInited(PR_FALSE),
mWriteOnClose(PR_FALSE),
mExtraField(NULL),
mLocalExtraField(NULL)
{
@ -105,6 +106,7 @@ public:
PRUint16 mDisk;
PRUint16 mIAttr;
PRPackedBool mInited;
PRPackedBool mWriteOnClose;
nsCString mName;
nsCString mComment;
nsAutoArrayPtr<PRUint8> mExtraField;

View File

@ -301,7 +301,7 @@ NS_IMETHODIMP nsZipWriter::Open(nsIFile *aFile, PRInt32 aIoFlags)
return rv;
}
rv = NS_NewBufferedOutputStream(getter_AddRefs(mStream), stream, 0x800);
rv = NS_NewBufferedOutputStream(getter_AddRefs(mStream), stream, 3 * 1024 * 1024);
if (NS_FAILED(rv)) {
stream->Close();
mHeaders.Clear();
@ -711,6 +711,24 @@ NS_IMETHODIMP nsZipWriter::Close()
Cleanup();
return rv;
}
// Go back and rewrite the file headers
for (PRInt32 i = 0; i < mHeaders.Count(); i++) {
nsZipHeader *header = mHeaders[i];
if (!header->mWriteOnClose)
continue;
rv = seekable->Seek(nsISeekableStream::NS_SEEK_SET, header->mOffset);
if (NS_FAILED(rv)) {
Cleanup();
return rv;
}
rv = header->WriteFileHeader(mStream);
if (NS_FAILED(rv)) {
Cleanup();
return rv;
}
}
}
nsresult rv = mStream->Close();

View File

@ -49,10 +49,10 @@ XPIDLSRCS = nsIUpdateTimerManager.idl
EXTRA_PP_COMPONENTS = nsUpdateTimerManager.js nsUpdateTimerManager.manifest
ifdef MOZ_UPDATER
DIRS = ../readstrings
ifneq ($(OS_TARGET),Android)
DIRS = ../readstrings \
updater \
$(NULL)
DIRS += updater
endif
XPIDLSRCS += nsIUpdateService.idl