Merge last green changeset from mozilla-inbound to mozilla-central

This commit is contained in:
Marco Bonardo 2011-10-04 11:02:20 +02:00
commit 9a6d70c1b6
14 changed files with 179 additions and 208 deletions

View File

@ -128,6 +128,10 @@ CSRCS = \
DEFINES += -DANGLE_USE_NSPR -DANGLE_BUILD
#these defines are from ANGLE's build_angle.gyp
DEFINES += -DANGLE_DISABLE_TRACE
DEFINES += -DANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL0
EXTRA_DSO_LDOPTS = $(MOZALLOC_LIB)
ifdef MOZ_ANGLE

View File

@ -131,6 +131,10 @@ CSRCS = \
DEFINES += -DANGLE_BUILD -DNOMINMAX -DLIBEGL_EXPORTS -D_CRT_SECURE_NO_DEPRECATE
#these defines are from ANGLE's build_angle.gyp
DEFINES += -DANGLE_DISABLE_TRACE
DEFINES += -DANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL0
ifndef MOZ_DEBUG
DEFINES += -D_SECURE_SCL=0
endif

View File

@ -131,6 +131,10 @@ CSRCS = \
DEFINES += -DANGLE_BUILD -DNOMINMAX -DLIBGLESV2_EXPORTS -D_CRT_SECURE_NO_DEPRECATE
#these defines are from ANGLE's build_angle.gyp
DEFINES += -DANGLE_DISABLE_TRACE
DEFINES += -DANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL0
ifndef MOZ_DEBUG
DEFINES += -D_SECURE_SCL=0
endif

View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<script>
function boom()
{
document.getElementById("s").appendChild(document.createElement("div"));
var marq = document.getElementById("f").contentDocument.documentElement;
marq.behavior = "alternate";
}
</script>
</head>
<body onload="boom();"><span id="s"></span><iframe src="data:text/xml,%3Cmarquee%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%3EX%3C%2Fmarquee%3E" id="f"></iframe></body>
</html>

View File

@ -321,6 +321,7 @@ load 579655.html
load 580494-1.html
load 580834-1.xhtml
load 595039-1.html
load 597924-1.html
load 606432-1.html
load 609821-1.xhtml
load 615146-1.html

View File

@ -1529,13 +1529,12 @@ WrapPreserve3DListInternal(nsIFrame* aFrame, nsDisplayListBuilder *aBuilder, nsD
nsDisplayList temp;
while (nsDisplayItem *item = aList->RemoveBottom()) {
nsIFrame *childFrame = item->GetUnderlyingFrame();
NS_ASSERTION(childFrame, "All display items to be wrapped must have a frame!");
// We accumulate sequential items that aren't transforms into the 'temp' list
// and then flush this list into newList by wrapping the whole lot with a single
// nsDisplayTransform.
if (childFrame->GetParent()->Preserves3DChildren()) {
if (childFrame && childFrame->GetParent()->Preserves3DChildren()) {
switch (item->GetType()) {
case nsDisplayItem::TYPE_TRANSFORM: {
if (!temp.IsEmpty()) {
@ -1645,7 +1644,7 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
}
// Mark the display list items for absolutely positioned children
MarkAbsoluteFramesForDisplayList(aBuilder, aDirtyRect);
MarkAbsoluteFramesForDisplayList(aBuilder, dirtyRect);
nsDisplayListCollection set;
nsresult rv;

View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<div>test</div>
<style>
body {
width: 100px; height: 300px;
position: absolute;
-moz-transform: scale(0.5);
}
div { position: absolute; }
</style>

View File

@ -1655,6 +1655,7 @@ HTTP(..) == 654057-1.html 654057-1-ref.html
fails-if(layersGPUAccelerated&&cocoaWidget) == 654950-1.html 654950-1-ref.html # Quartz alpha blending doesn't match GL alpha blending
== 652775-1.html 652775-1-ref.html
== 655549-1.html 655549-1-ref.html
!= 656875.html about:blank
== 658952.html 658952-ref.html
== 664127-1.xul 664127-1-ref.xul
== 660682-1.html 660682-1-ref.html

View File

@ -127,7 +127,9 @@
<script type="application/javascript;version=1.8"><![CDATA[
let Ci = Components.interfaces, Cc = Components.classes, Cu = Components.utils;
let gChromeWin = null;
Cu.import("resource://gre/modules/AddonManager.jsm");
Cu.import("resource://gre/modules/NetUtil.jsm");
function openLink(aElement) {
try {
@ -177,23 +179,21 @@
uninitAddons();
}
function _readFile(aFile) {
try {
let stream = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(Ci.nsIFileInputStream);
stream.init(aFile, 0x01, 0, 0);
let cvstream = Cc["@mozilla.org/intl/converter-input-stream;1"].createInstance(Ci.nsIConverterInputStream);
function _readFile(aFile, aCallback) {
let channel = NetUtil.newChannel(aFile);
channel.contentType = "application/json";
NetUtil.asyncFetch(channel, function(aStream, aResult) {
if (!Components.isSuccessCode(aResult)) {
Cu.reportError("AboutHome: Could not read from " + aFile.leafName);
aCallback(null);
return;
}
let fileSize = stream.available();
cvstream.init(stream, "UTF-8", fileSize, Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
let data = {};
cvstream.readString(fileSize, data);
let content = data.value;
cvstream.close();
return content.replace(/\r\n?/g, "\n");
}
catch (ex) { Cu.reportError(ex); }
let content = NetUtil.readInputStreamToString(aStream, aStream.available()) || "";
aStream.close();
return null;
aCallback(content.replace(/\r\n?/g, "\n"));
});
}
function openTabs(aURLs) {
@ -218,75 +218,77 @@
return;
}
let data = JSON.parse(_readFile(session));
if (!data || data.windows.length == 0) {
noRecentTabs();
return;
}
let chromeWin = getChromeWin();
let allPageURLs = [];
let list = document.getElementById("recentTabs");
let tabs = data.windows[0].tabs;
for (let i=0; i<tabs.length; i++) {
let tabData = tabs[i];
let tabEntry = tabData.entries[tabData.index - 1];
let url = tabEntry.url;
if (url.indexOf("about:") == 0)
continue;
let title = tabEntry.title;
if (!title)
continue;
let uri = chromeWin.Util.makeURI(url);
let favicon = chromeWin.gFaviconService.getFaviconImageForPage(uri).spec;
let outer = document.createElement("a");
outer.setAttribute("role", "button");
outer.setAttribute("href", url);
allPageURLs.push(url);
let img = document.createElement("img");
img.className = "favicon";
img.setAttribute("src", favicon);
outer.appendChild(img);
let inner = document.createElement("div");
inner.className = "inner";
let titlePart = document.createElement("div");
titlePart.textContent = title;
titlePart.className = "title";
inner.appendChild(titlePart);
outer.appendChild(inner);
list.appendChild(outer);
}
if (allPageURLs.length > 0) {
let loading = document.getElementById("loadingTabs");
loading.parentNode.removeChild(loading);
if (allPageURLs.length > 1) {
let outer = document.createElement("div");
outer.className = "openall";
outer.textContent = document.getElementById("text-openalltabs").textContent;
_readFile(session, function(aContent) {
let data = JSON.parse(aContent);
if (!data || data.windows.length == 0) {
noRecentTabs();
return;
}
let chromeWin = getChromeWin();
let allPageURLs = [];
let list = document.getElementById("recentTabs");
let tabs = data.windows[0].tabs;
for (let i=0; i<tabs.length; i++) {
let tabData = tabs[i];
let tabEntry = tabData.entries[tabData.index - 1];
let url = tabEntry.url;
if (url.indexOf("about:") == 0)
continue;
let title = tabEntry.title;
if (!title)
continue;
let uri = chromeWin.Util.makeURI(url);
let favicon = chromeWin.gFaviconService.getFaviconImageForPage(uri).spec;
let outer = document.createElement("a");
outer.setAttribute("role", "button");
outer.addEventListener("click", function() {
openTabs(allPageURLs);
}, false);
outer.setAttribute("href", url);
allPageURLs.push(url);
let img = document.createElement("img");
img.className = "favicon";
img.setAttribute("src", favicon);
outer.appendChild(img);
let inner = document.createElement("div");
inner.className = "inner";
let titlePart = document.createElement("div");
titlePart.textContent = title;
titlePart.className = "title";
inner.appendChild(titlePart);
outer.appendChild(inner);
list.appendChild(outer);
}
} else {
noRecentTabs();
}
if (allPageURLs.length > 0) {
let loading = document.getElementById("loadingTabs");
loading.parentNode.removeChild(loading);
if (allPageURLs.length > 1) {
let outer = document.createElement("div");
outer.className = "openall";
outer.textContent = document.getElementById("text-openalltabs").textContent;
outer.setAttribute("role", "button");
outer.addEventListener("click", function() {
openTabs(allPageURLs);
}, false);
list.appendChild(outer);
}
} else {
noRecentTabs();
}
});
}
function openRemoteTabs() {
@ -315,26 +317,6 @@
return file;
},
_readFile: function(aFile) {
try {
let stream = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(Ci.nsIFileInputStream);
stream.init(aFile, 0x01, 0, 0);
let cvstream = Cc["@mozilla.org/intl/converter-input-stream;1"].createInstance(Ci.nsIConverterInputStream);
let fileSize = stream.available();
cvstream.init(stream, "UTF-8", fileSize, Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
let data = {};
cvstream.readString(fileSize, data);
let content = data.value;
cvstream.close();
return content.replace(/\r\n?/g, "\n");
}
catch (ex) {
Cu.reportError(ex);
}
return null;
},
_loadAddons: function(aAddons, aAddonCount, aTotalResults) {
let list = document.getElementById("newAddons");
let loading = document.getElementById("loadingAddons");
@ -384,23 +366,29 @@
},
loadFromCacheOrScheduleUpdate: function(aDelay) {
let self = this;
let file = this._getFile();
if (file.exists()) {
let json = JSON.parse(this._readFile(file));
// Ignore addons already installed
let self = this;
let addonsCache = json.addons;
AddonManager.getAllAddons(function(aAddons) {
let addons = addonsCache.filter(function(addon) {
for (let i =0; i < aAddons.length; i++)
if (addon.id == aAddons[i].id)
return false;
return true;
_readFile(file, function(aContent) {
let json = JSON.parse(aContent);
if (!json || json.addons.length == 0) {
self._loadAddons([], 0, 0);
return;
}
// Ignore addons already installed
let addonsCache = json.addons;
AddonManager.getAllAddons(function(aAddons) {
let addons = addonsCache.filter(function(addon) {
for (let i =0; i < aAddons.length; i++)
if (addon.id == aAddons[i].id)
return false;
return true;
});
self._loadAddons(addons, addons.length, json.totalResults);
});
self._loadAddons(addons, addons.length, json.totalResults);
});
} else {
setTimeout(function() {

View File

@ -104,10 +104,6 @@ interface mozIStorageConnection : nsISupports {
* @note Due to a bug in SQLite, if you use the shared cache (openDatabase),
* you end up with the same privileges as the first connection opened
* regardless of what is specified in aReadOnly.
* @note The following pragmas are copied over to the new connection:
* cache_size (only if smaller than SQLITE_DEFAULT_CACHE_SIZE),
* foreign_keys, journal_size_limit, synchronous, temp_store,
* wal_autocheckpoint.
*
* @throws NS_ERROR_UNEXPECTED
* If this connection is a memory database.

View File

@ -882,40 +882,6 @@ Connection::Clone(bool aReadOnly,
nsresult rv = clone->initialize(mDatabaseFile);
NS_ENSURE_SUCCESS(rv, rv);
// Copy over pragmas from the original connection.
static const char * pragmas[] = {
"cache_size",
"foreign_keys",
"journal_size_limit",
"synchronous",
"temp_store",
"wal_autocheckpoint"
};
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(pragmas); ++i) {
nsCAutoString pragmaQuery("PRAGMA ");
pragmaQuery.Append(pragmas[i]);
nsCOMPtr<mozIStorageStatement> stmt;
rv = CreateStatement(pragmaQuery, getter_AddRefs(stmt));
MOZ_ASSERT(NS_SUCCEEDED(rv));
bool hasResult = PR_FALSE;
if (stmt && NS_SUCCEEDED(stmt->ExecuteStep(&hasResult)) && hasResult) {
PRInt32 value = stmt->AsInt32(0);
// To preserve memory, override the cloned connection's cache_size value
// only if it's smaller than the default.
if (::strcmp(pragmas[i], "cache_size") == 0) {
(void)clone->CreateStatement(pragmaQuery, getter_AddRefs(stmt));
if (stmt && NS_SUCCEEDED(stmt->ExecuteStep(&hasResult)) && hasResult &&
value >= stmt->AsInt32(0)) {
continue;
}
}
pragmaQuery.AppendLiteral(" = ");
pragmaQuery.AppendInt(value);
rv = clone->ExecuteSimpleSQL(pragmaQuery);
MOZ_ASSERT(NS_SUCCEEDED(rv));
}
}
// Copy any functions that have been added to this connection.
(void)mFunctions.EnumerateRead(copyFunctionEnumerator, clone);

View File

@ -482,47 +482,6 @@ function test_clone_copies_overridden_functions()
run_next_test();
}
function test_clone_copies_pragmas()
{
const PRAGMAS = [
{ name: "cache_size", value: 500, copied: true },
{ name: "foreign_keys", value: 1, copied: true },
{ name: "journal_size_limit", value: 524288, copied: true },
{ name: "synchronous", value: 2, copied: true },
{ name: "temp_store", value: 2, copied: true },
{ name: "wal_autocheckpoint", value: 16, copied: true },
{ name: "ignore_check_constraints", value: 1, copied: false },
];
let db1 = getService().openUnsharedDatabase(getTestDB());
// Sanity check initial values are different from enforced ones.
PRAGMAS.forEach(function (pragma) {
let stmt = db1.createStatement("PRAGMA " + pragma.name);
do_check_true(stmt.executeStep());
do_check_neq(pragma.value, stmt.getInt32(0));
stmt.finalize();
});
// Execute pragmas.
PRAGMAS.forEach(function (pragma) {
db1.executeSimpleSQL("PRAGMA " + pragma.name + " = " + pragma.value);
});
let db2 = db1.clone(true);
do_check_true(db2.connectionReady);
// Check cloned connection inherited pragma values.
PRAGMAS.forEach(function (pragma) {
let stmt = db1.createStatement("PRAGMA " + pragma.name);
do_check_true(stmt.executeStep());
let validate = pragma.copied ? do_check_eq : do_check_neq;
validate(pragma.value, stmt.getInt32(0));
stmt.finalize();
});
run_next_test();
}
function test_getInterface()
{
let db = getOpenedDatabase();

View File

@ -338,6 +338,15 @@ static WindowsDllInterceptor sUser32Intercept;
// the size of the default window border Windows paints.
static const PRInt32 kGlassMarginAdjustment = 2;
// We should never really try to accelerate windows bigger than this. In some
// cases this might lead to no D3D9 acceleration where we could have had it
// but D3D9 does not reliably report when it supports bigger windows. 8192
// is as safe as we can get, we know at least D3D10 hardware always supports
// this, other hardware we expect to report correctly in D3D9.
#define MAX_ACCELERATED_DIMENSION 8192
/**************************************************************
**************************************************************
**
@ -3230,6 +3239,9 @@ nsWindow::GetLayerManager(PLayersChild* aShadowManager,
}
#endif
RECT windowRect;
::GetClientRect(mWnd, &windowRect);
if (!mLayerManager ||
(!sAllowD3D9 && aPersistence == LAYER_MANAGER_PERSISTENT &&
mLayerManager->GetBackendType() ==
@ -3243,7 +3255,9 @@ nsWindow::GetLayerManager(PLayersChild* aShadowManager,
* transparent windows so don't even try. I'm also not sure if we even
* want to support this case. See bug #593471 */
if (eTransparencyTransparent == mTransparencyMode ||
prefs.mDisableAcceleration)
prefs.mDisableAcceleration ||
windowRect.right - windowRect.left > MAX_ACCELERATED_DIMENSION ||
windowRect.bottom - windowRect.top > MAX_ACCELERATED_DIMENSION)
mUseAcceleratedRendering = false;
else if (prefs.mAccelerateByDefault)
mUseAcceleratedRendering = true;

View File

@ -339,15 +339,6 @@ bool nsWindow::OnPaint(HDC aDC, PRUint32 aNestingLevel)
}
#endif
nsRefPtr<gfxWindowsSurface> targetSurfaceWin;
if (!targetSurface &&
IsRenderMode(gfxWindowsPlatform::RENDER_GDI))
{
PRUint32 flags = (mTransparencyMode == eTransparencyOpaque) ? 0 :
gfxWindowsSurface::FLAG_IS_TRANSPARENT;
targetSurfaceWin = new gfxWindowsSurface(hDC, flags);
targetSurface = targetSurfaceWin;
}
#ifdef CAIRO_HAS_D2D_SURFACE
if (!targetSurface &&
IsRenderMode(gfxWindowsPlatform::RENDER_DIRECT2D))
@ -361,9 +352,25 @@ bool nsWindow::OnPaint(HDC aDC, PRUint32 aNestingLevel)
#endif
mD2DWindowSurface = new gfxD2DSurface(mWnd, content);
}
targetSurface = mD2DWindowSurface;
if (!mD2DWindowSurface->CairoStatus()) {
targetSurface = mD2DWindowSurface;
} else {
mD2DWindowSurface = nsnull;
}
}
#endif
nsRefPtr<gfxWindowsSurface> targetSurfaceWin;
if (!targetSurface &&
(IsRenderMode(gfxWindowsPlatform::RENDER_GDI) ||
IsRenderMode(gfxWindowsPlatform::RENDER_DIRECT2D)))
{
PRUint32 flags = (mTransparencyMode == eTransparencyOpaque) ? 0 :
gfxWindowsSurface::FLAG_IS_TRANSPARENT;
targetSurfaceWin = new gfxWindowsSurface(hDC, flags);
targetSurface = targetSurfaceWin;
}
nsRefPtr<gfxImageSurface> targetSurfaceImage;
if (!targetSurface &&
(IsRenderMode(gfxWindowsPlatform::RENDER_IMAGE_STRETCH32) ||