This commit is contained in:
Robert Sayre 2009-03-02 01:33:33 -05:00
commit 63eb5825cc
52 changed files with 796 additions and 351 deletions

View File

@ -771,7 +771,7 @@ pref("browser.ssl_override_behavior", 2);
// 0 - do not show domain
// 1 - show effectiveTLD + 1 (e.g. mozilla.org)
// 2 - show full domain (e.g. bugzilla.mozilla.org)
pref("browser.identity.ssl_domain_display", 0);
pref("browser.identity.ssl_domain_display", 1);
// True if the user should be prompted when a web application supports
// offline apps.
@ -783,6 +783,9 @@ pref("browser.zoom.full", true);
// Whether or not to save and restore zoom levels on a per-site basis.
pref("browser.zoom.siteSpecific", true);
// Whether or not to update background tabs to the current zoom level.
pref("browser.zoom.updateBackgroundTabs", true);
// replace newlines with spaces when pasting into <input type="text"> fields
pref("editor.singleLine.pasteNewlines", 2);

View File

@ -86,6 +86,9 @@ var FullZoom = {
// browser.zoom.siteSpecific preference cache
_siteSpecificPref: undefined,
// browser.zoom.updateBackgroundTabs preference cache
updateBackgroundTabs: undefined,
// whether we are in private browsing mode
_inPrivateBrowsing: false,
@ -131,18 +134,20 @@ var FullZoom = {
getService(Ci.nsIPrivateBrowsingService).
privateBrowsingEnabled;
// Listen for changes to the browser.zoom.siteSpecific preference so we can
// enable/disable per-site saving and restoring of zoom levels accordingly.
this._siteSpecificPref =
this._prefBranch.getBoolPref("browser.zoom.siteSpecific");
this._prefBranch.addObserver("browser.zoom.siteSpecific", this, true);
this.updateBackgroundTabs =
this._prefBranch.getBoolPref("browser.zoom.updateBackgroundTabs");
// Listen for changes to the browser.zoom branch so we can enable/disable
// updating background tabs and per-site saving and restoring of zoom levels.
this._prefBranch.addObserver("browser.zoom.", this, true);
},
destroy: function FullZoom_destroy() {
let os = Cc["@mozilla.org/observer-service;1"].
getService(Ci.nsIObserverService);
os.removeObserver(this, "private-browsing");
this._prefBranch.removeObserver("browser.zoom.siteSpecific", this);
this._prefBranch.removeObserver("browser.zoom.", this);
this._cps.removeObserver(this.name, this);
window.removeEventListener("DOMMouseScroll", this, false);
delete this._cps;
@ -210,6 +215,10 @@ var FullZoom = {
this._siteSpecificPref =
this._prefBranch.getBoolPref("browser.zoom.siteSpecific");
break;
case "browser.zoom.updateBackgroundTabs":
this.updateBackgroundTabs =
this._prefBranch.getBoolPref("browser.zoom.updateBackgroundTabs");
break;
}
break;
case "private-browsing":

View File

@ -4161,6 +4161,7 @@ var XULBrowserWindow = {
// simulate all change notifications after switching tabs
onUpdateCurrentBrowser: function (aStateFlags, aStatus, aMessage, aTotalProgress) {
if (FullZoom.updateBackgroundTabs)
FullZoom.onLocationChange(gBrowser.currentURI);
var nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
var loadingDone = aStateFlags & nsIWebProgressListener.STATE_STOP;

View File

@ -118,6 +118,7 @@
anonid="undoCloseTabMenuItem"/>
<xul:menuseparator/>
<xul:menuitem id="context_closeTab" label="&closeTab.label;" accesskey="&closeTab.accesskey;"
tbattr="tabbrowser-multiple"
oncommand="var tabbrowser = this.parentNode.parentNode.parentNode.parentNode;
tabbrowser.removeTab(tabbrowser.mContextTab);"/>
</xul:menupopup>
@ -1015,7 +1016,10 @@
if (event.button != 1 || event.target.localName != 'tab')
return;
if (this.mTabs.length > 1 ||
!this.mPrefs.getBoolPref("browser.tabs.closeWindowWithLastTab"))
this.removeTab(event.target);
event.stopPropagation();
]]>
</body>

View File

@ -82,7 +82,10 @@ var gPermissionManager = {
cycleHeader: function(column) {},
getRowProperties: function(row,prop){},
getColumnProperties: function(column,prop){},
getCellProperties: function(row,column,prop){}
getCellProperties: function(row,column,prop){
if (column.element.getAttribute("id") == "siteCol")
prop.AppendElement(this._ltrAtom);
}
},
_getCapabilityString: function (aCapability)
@ -214,6 +217,10 @@ var gPermissionManager = {
this._loadPermissions();
urlField.focus();
this._ltrAtom = Components.classes["@mozilla.org/atom-service;1"]
.getService(Components.interfaces.nsIAtomService)
.getAtom("ltr");
},
uninit: function ()

View File

@ -268,6 +268,14 @@ PrivateBrowsingService.prototype = {
getService(Ci.nsIHttpAuthManager);
authMgr.clearAll();
// Prevent any SSL sockets from remaining open (bug 463256)
let ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
if (!ios.offline) {
ios.offline = true;
ios.offline = false;
}
if (!this._inPrivateBrowsing) {
// Clear the error console
let consoleService = Cc["@mozilla.org/consoleservice;1"].

View File

@ -54,6 +54,9 @@ _BROWSER_TEST_FILES = \
browser_privatebrowsing_transition.js \
browser_privatebrowsing_import.js \
browser_privatebrowsing_crh.js \
browser_privatebrowsing_windowtitle.js \
browser_privatebrowsing_windowtitle_page.html \
browser_privatebrowsing_sslsite_transition.js \
$(NULL)
libs:: $(_BROWSER_TEST_FILES)

View File

@ -0,0 +1,83 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Private Browsing Tests.
*
* The Initial Developer of the Original Code is
* Ehsan Akhgari.
* Portions created by the Initial Developer are Copyright (C) 2009
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Ehsan Akhgari <ehsan.akhgari@gmail.com> (Original Author)
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// This test makes sure that SSL sites load correctly after leaving the
// Private Browsing mode (bug 463256).
function test() {
// initialization
let pb = Cc["@mozilla.org/privatebrowsing;1"].
getService(Ci.nsIPrivateBrowsingService);
const kTestURL = "https://example.com/";
// load an SSL site in the first tab and wait for it to finish loading
let tab = gBrowser.tabContainer.childNodes[0];
let browser = gBrowser.getBrowserForTab(tab);
browser.addEventListener("load", function() {
browser.removeEventListener("load", arguments.callee, true);
// enter the private browsing mode, and wait for the about:pb page to load
pb.privateBrowsingEnabled = true;
tab = gBrowser.tabContainer.childNodes[0];
browser = gBrowser.getBrowserForTab(tab);
browser.addEventListener("load", function() {
browser.removeEventListener("load", arguments.callee, true);
is(browser.contentWindow.location, "about:privatebrowsing",
"about:privatebrowsing should be loaded at this stage");
// leave the private browsing mode, and wait for the SSL page to load again
pb.privateBrowsingEnabled = false;
tab = gBrowser.tabContainer.childNodes[0];
browser = gBrowser.getBrowserForTab(tab);
// Note: if the page fails to load, the test will time out
browser.addEventListener("load", function() {
browser.removeEventListener("load", arguments.callee, true);
is(browser.contentWindow.location, kTestURL,
"The original SSL page should be loaded at this stage");
browser.contentWindow.location = "about:blank";
finish();
}, true);
}, true);
}, true);
browser.contentWindow.location = kTestURL;
waitForExplicitFinish();
}

View File

@ -0,0 +1,140 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Private Browsing Tests.
*
* The Initial Developer of the Original Code is
* Ehsan Akhgari.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Ehsan Akhgari <ehsan.akhgari@gmail.com> (Original Author)
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// This test makes sure that the window title changes correctly while switching
// from and to private browsing mode.
function test() {
// initialization
let prefBranch = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch);
prefBranch.setBoolPref("browser.privatebrowsing.keep_current_session", true);
let pb = Cc["@mozilla.org/privatebrowsing;1"].
getService(Ci.nsIPrivateBrowsingService);
const testPageURL = "http://localhost:8888/browser/" +
"browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle_page.html";
waitForExplicitFinish();
// initialization of expected titles
let test_title = "Test title";
let app_name = document.documentElement.getAttribute("title");
const isOSX = ("nsILocalFileMac" in Ci);
var page_with_title;
var page_without_title;
var pb_page_with_title;
var pb_page_without_title;
var about_pb_title;
if (isOSX) {
page_with_title = test_title;
page_without_title = app_name;
pb_page_with_title = test_title + " - (Private Browsing)";
pb_page_without_title = app_name + " - (Private Browsing)";
about_pb_title = pb_page_without_title;
}
else {
page_with_title = test_title + " - " + app_name;
page_without_title = app_name;
pb_page_with_title = test_title + " - " + app_name + " (Private Browsing)";
pb_page_without_title = app_name + " (Private Browsing)";
about_pb_title = "Private Browsing - " + app_name + " (Private Browsing)";
}
// check the window title for a page without a title
let blankTab = gBrowser.addTab();
gBrowser.selectedTab = blankTab;
is(document.title, page_without_title, "The window title for a page without a title matches " +
"(outside private browsing mode)");
gBrowser.removeTab(blankTab);
let pageTab = gBrowser.addTab();
gBrowser.selectedTab = pageTab;
let pageBrowser = gBrowser.getBrowserForTab(pageTab);
pageBrowser.addEventListener("load", function () {
pageBrowser.removeEventListener("load", arguments.callee, true);
// check the window title for a page with a title
is(document.title, page_with_title, "The window title for a page with a title matches " +
"(outside private browsing mode)");
gBrowser.removeTab(pageTab);
// enter the private browsing mode
pb.privateBrowsingEnabled = true;
// check the window title for a page without a title
blankTab = gBrowser.addTab();
gBrowser.selectedTab = blankTab;
is(document.title, pb_page_without_title, "The window title for a page without a title matches " +
"(inside private browsing mode)");
gBrowser.removeTab(blankTab);
pageTab = gBrowser.addTab();
gBrowser.selectedTab = pageTab;
pageBrowser = gBrowser.getBrowserForTab(pageTab);
pageBrowser.addEventListener("load", function () {
pageBrowser.removeEventListener("load", arguments.callee, true);
// check the window title for a page with a title
is(document.title, pb_page_with_title, "The window title for a page with a title matches " +
"(inside private browsing mode)");
gBrowser.removeTab(pageTab);
let aboutPBTab = gBrowser.addTab();
gBrowser.selectedTab = aboutPBTab;
let aboutPBBrowser = gBrowser.getBrowserForTab(aboutPBTab);
aboutPBBrowser.addEventListener("load", function() {
aboutPBBrowser.removeEventListener("load", arguments.callee, true);
// check the window title for about:privatebrowsing
is(document.title, about_pb_title, "The window title for about:privatebrowsing matches " +
"(inside private browsing mode)");
gBrowser.removeTab(aboutPBTab);
// cleanup
pb.privateBrowsingEnabled = false;
prefBranch.clearUserPref("browser.privatebrowsing.keep_current_session");
finish();
}, true);
aboutPBBrowser.contentWindow.location = "about:privatebrowsing";
}, true);
pageBrowser.contentWindow.location = testPageURL;
}, true);
pageBrowser.contentWindow.location = testPageURL;
}

View File

@ -0,0 +1,9 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>Test title</title>
</head>
<body>
Test page for the window title test
</body>
</html>

View File

@ -81,13 +81,11 @@
<xul:button class="searchbar-engine-button"
type="menu"
anonid="searchbar-engine-button"
popup="_child"
chromedir="&locale.dir;">
<xul:image class="searchbar-engine-image" xbl:inherits="src"/>
<xul:image class="searchbar-dropmarker-image"/>
<xul:menupopup class="searchbar-popup"
anonid="searchbar-popup"
position="after_start">
anonid="searchbar-popup">
<xul:menuseparator/>
<xul:menuitem class="open-engine-manager"
anonid="open-engine-manager"

View File

@ -1619,20 +1619,21 @@ SessionStoreService.prototype = {
if (aOverwriteTabs) {
this.restoreWindowFeatures(aWindow, winData);
delete this._windows[aWindow.__SSi].extData;
}
if (winData.cookies) {
this.restoreCookies(winData.cookies);
}
if (winData.extData) {
if (aOverwriteTabs || !this._windows[aWindow.__SSi].extData) {
if (!this._windows[aWindow.__SSi].extData) {
this._windows[aWindow.__SSi].extData = {};
}
for (var key in winData.extData) {
this._windows[aWindow.__SSi].extData[key] = winData.extData[key];
}
}
if (winData._closedTabs && (root._firstTabs || aOverwriteTabs)) {
this._windows[aWindow.__SSi]._closedTabs = winData._closedTabs;
if (aOverwriteTabs || root._firstTabs) {
this._windows[aWindow.__SSi]._closedTabs = winData._closedTabs || [];
}
this.restoreHistoryPrecursor(aWindow, tabs, winData.tabs,

View File

@ -74,6 +74,7 @@ _BROWSER_TEST_FILES = \
browser_466937_sample.html \
browser_476161.js \
browser_476161_sample.html \
browser_477657.js \
$(NULL)
libs:: $(_BROWSER_TEST_FILES)

View File

@ -0,0 +1,96 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is sessionstore test code.
*
* The Initial Developer of the Original Code is
* Simon Bünzli <zeniko@gmail.com>.
* Portions created by the Initial Developer are Copyright (C) 2009
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
function test() {
/** Test for Bug 477657 **/
// test setup
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
waitForExplicitFinish();
let newWin = openDialog(location, "_blank", "chrome,all,dialog=no");
newWin.addEventListener("load", function(aEvent) {
let newState = { windows: [{
tabs: [{ entries: [] }],
_closedTabs: [{
state: { entries: [{ url: "about:" }]},
title: "About:"
}],
sizemode: "maximized"
}] };
let uniqueKey = "bug 477657";
let uniqueValue = "unik" + Date.now();
ss.setWindowValue(newWin, uniqueKey, uniqueValue);
is(ss.getWindowValue(newWin, uniqueKey), uniqueValue,
"window value was set before the window was overwritten");
ss.setWindowState(newWin, JSON.stringify(newState), true);
executeSoon(function() {
is(ss.getWindowValue(newWin, uniqueKey), "",
"window value was implicitly cleared");
is(newWin.windowState, newWin.STATE_MAXIMIZED,
"the window was maximized");
is(JSON.parse(ss.getClosedTabData(newWin)).length, 1,
"the closed tab was added before the window was overwritten");
delete newState.windows[0]._closedTabs;
delete newState.windows[0].sizemode;
ss.setWindowState(newWin, JSON.stringify(newState), true);
executeSoon(function() {
is(JSON.parse(ss.getClosedTabData(newWin)).length, 0,
"closed tabs were implicitly cleared");
is(newWin.windowState, newWin.STATE_MAXIMIZED,
"the window remains maximized");
newState.windows[0].sizemode = "normal";
ss.setWindowState(newWin, JSON.stringify(newState), true);
executeSoon(function() {
isnot(newWin.windowState, newWin.STATE_MAXIMIZED,
"the window was explicitly unmaximized");
// clean up
newWin.close();
finish();
});
});
});
}, false);
}

View File

@ -7,7 +7,7 @@
<!ENTITY prefWin.styleMac2 "width: 47em; min-height: 40em;">
<!ENTITY prefWin.styleGNOME2 "width: 42em; min-height: 39.5em;">
<!ENTITY paneMain.title "Main">
<!ENTITY paneMain.title "General">
<!ENTITY paneTabs.title "Tabs">
<!ENTITY paneContent.title "Content">
<!ENTITY paneApplications.title "Applications">

View File

@ -860,6 +860,10 @@ ifeq (,$(filter WINCE WINNT OS2,$(OS_ARCH)))
RUN_TEST_PROGRAM = $(DIST)/bin/run-mozilla.sh
endif
ifeq ($(OS_ARCH),OS2)
RUN_TEST_PROGRAM = $(topsrcdir)/testing/xpcshell/test_os2.cmd "$(DIST)"
endif
#
# Java macros
#

View File

@ -156,8 +156,12 @@ FWDSLASH_TOPSRCDIR := $(topsrcdir)
ifeq ($(HOST_OS_ARCH),WINNT)
NATIVE_TOPSRCDIR := $(subst /,\\,$(WIN_TOP_SRC))
else
ifeq ($(HOST_OS_ARCH),os2-emx)
NATIVE_TOPSRCDIR := $(subst /,\\,$(topsrcdir))
else
NATIVE_TOPSRCDIR := $(topsrcdir)
endif
endif
endif # CYGWIN_WRAPPER
testxpcsrcdir = $(topsrcdir)/testing/xpcshell

View File

@ -666,18 +666,18 @@ CMozillaBrowser *CPromptService::GetOwningBrowser(nsIDOMWindow *parent)
if (parent == nsnull)
{
// return the first element from the list if there is one
if (CMozillaBrowser::sBrowserList.Count() > 0)
if (CMozillaBrowser::sBrowserList.Length() > 0)
{
return (CMozillaBrowser *) CMozillaBrowser::sBrowserList[0];
return CMozillaBrowser::sBrowserList[0];
}
return NULL;
}
// Search for the browser with a content window matching the one provided
PRInt32 i;
for (i = 0; i < CMozillaBrowser::sBrowserList.Count(); i++)
PRUint32 i;
for (i = 0; i < CMozillaBrowser::sBrowserList.Length(); i++)
{
CMozillaBrowser *p = (CMozillaBrowser *) CMozillaBrowser::sBrowserList[i];
CMozillaBrowser *p = CMozillaBrowser::sBrowserList[i];
if (p->mWebBrowser)
{
nsCOMPtr<nsIDOMWindow> domWindow;

View File

@ -860,6 +860,10 @@ ifeq (,$(filter WINCE WINNT OS2,$(OS_ARCH)))
RUN_TEST_PROGRAM = $(DIST)/bin/run-mozilla.sh
endif
ifeq ($(OS_ARCH),OS2)
RUN_TEST_PROGRAM = $(topsrcdir)/testing/xpcshell/test_os2.cmd "$(DIST)"
endif
#
# Java macros
#

View File

@ -156,8 +156,12 @@ FWDSLASH_TOPSRCDIR := $(topsrcdir)
ifeq ($(HOST_OS_ARCH),WINNT)
NATIVE_TOPSRCDIR := $(subst /,\\,$(WIN_TOP_SRC))
else
ifeq ($(HOST_OS_ARCH),os2-emx)
NATIVE_TOPSRCDIR := $(subst /,\\,$(topsrcdir))
else
NATIVE_TOPSRCDIR := $(topsrcdir)
endif
endif
endif # CYGWIN_WRAPPER
testxpcsrcdir = $(topsrcdir)/testing/xpcshell

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html class="reftest-print">
<body>
<div style="display: table-row">
<span style="display: block; page-break-before: always"></span>
</div>
<div style="display: table-row-group">
<span style="display: block; page-break-before: always"></span>
</div>
<div style="display: table">
<span style="display: block; page-break-before: always"></span>
</div>
</body>
</html>

View File

@ -194,4 +194,5 @@ load 468546-1.xhtml
load 468645-1.xhtml
load 468645-2.xhtml
load 468645-3.xhtml
load 479114-1.html
load 477333-1.xhtml

View File

@ -2165,8 +2165,10 @@ nsCSSFrameConstructor::CreateGeneratedContentFrame(nsFrameConstructorState& aSta
// NS_FRAME_GENERATED_CONTENT.
aState.mAdditionalStateBits |= NS_FRAME_GENERATED_CONTENT;
// XXXbz should we actually allow page-break frames here?
ConstructFrameInternal(aState, container, aParentFrame,
elemName, kNameSpaceID_None, pseudoStyleContext, aFrameItems, PR_TRUE);
elemName, kNameSpaceID_None, pseudoStyleContext,
aFrameItems, PR_FALSE, PR_FALSE);
aState.mAdditionalStateBits = savedStateBits;
}
@ -2186,22 +2188,8 @@ TextIsOnlyWhitespace(nsIContent* aContent)
// aIncludeSpecial applies to captions, col groups, cols and cells.
// These do not generate pseudo frame wrappers for foreign children.
static PRBool
IsTableRelated(PRUint8 aDisplay)
{
return
aDisplay == NS_STYLE_DISPLAY_TABLE ||
aDisplay == NS_STYLE_DISPLAY_INLINE_TABLE ||
aDisplay == NS_STYLE_DISPLAY_TABLE_HEADER_GROUP ||
aDisplay == NS_STYLE_DISPLAY_TABLE_ROW_GROUP ||
aDisplay == NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP ||
aDisplay == NS_STYLE_DISPLAY_TABLE_ROW ||
aDisplay == NS_STYLE_DISPLAY_TABLE_CAPTION ||
aDisplay == NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP ||
aDisplay == NS_STYLE_DISPLAY_TABLE_COLUMN ||
aDisplay == NS_STYLE_DISPLAY_TABLE_CELL;
}
// In fact, colgroups never have any children that are not cols and
// cols never have any children at all.
static PRBool
IsTableRelated(nsIAtom* aParentType,
@ -2990,7 +2978,7 @@ nsCSSFrameConstructor::GetPseudoCellFrame(PRInt32 aNameSpaceID,
}
nsresult
nsCSSFrameConstructor::GetParentFrame(PRInt32 aNameSpaceID,
nsCSSFrameConstructor::CreateRequiredPseudoFrames(PRInt32 aNameSpaceID,
nsIFrame& aParentFrameIn,
nsIAtom* aChildFrameType,
nsFrameConstructorState& aState,
@ -3008,15 +2996,7 @@ nsCSSFrameConstructor::GetParentFrame(PRInt32 aNameSpaceID,
nsFrameState savedStateBits = aState.mAdditionalStateBits;
aState.mAdditionalStateBits &= ~NS_FRAME_GENERATED_CONTENT;
if (nsGkAtoms::tableOuterFrame == aChildFrameType) { // table child
if (IsTableRelated(parentFrameType, PR_TRUE) &&
(nsGkAtoms::tableCaptionFrame != parentFrameType) ) { // need pseudo cell parent
rv = GetPseudoCellFrame(aNameSpaceID, aState, aParentFrameIn);
if (NS_FAILED(rv)) return rv;
pseudoParentFrame = pseudoFrames.mCellInner.mFrame;
}
}
else if (nsGkAtoms::tableCaptionFrame == aChildFrameType) { // caption child
if (nsGkAtoms::tableCaptionFrame == aChildFrameType) { // caption child
if (nsGkAtoms::tableOuterFrame != parentFrameType) { // need pseudo table parent
rv = GetPseudoTableFrame(aNameSpaceID, aState, aParentFrameIn);
if (NS_FAILED(rv)) return rv;
@ -3060,16 +3040,11 @@ nsCSSFrameConstructor::GetParentFrame(PRInt32 aNameSpaceID,
pseudoParentFrame = pseudoFrames.mRow.mFrame;
}
}
else if (nsGkAtoms::tableFrame == aChildFrameType) { // invalid
NS_ASSERTION(PR_FALSE, "GetParentFrame called on nsGkAtoms::tableFrame child");
}
else { // foreign frame
if (IsTableRelated(parentFrameType, PR_FALSE)) { // need pseudo cell parent
rv = GetPseudoCellFrame(aNameSpaceID, aState, aParentFrameIn);
if (NS_FAILED(rv)) return rv;
pseudoParentFrame = pseudoFrames.mCellInner.mFrame;
}
#ifdef DEBUG
else {
NS_ERROR("Unexpected frame type in CreateRequiredPseudoFrames");
}
#endif
if (pseudoParentFrame) {
aParentFrame = pseudoParentFrame;
@ -3139,6 +3114,15 @@ nsCSSFrameConstructor::AdjustParentFrame(nsFrameConstructorState& aState,
// needs to become the float containing block.
aState.PushFloatContainingBlock(aParentFrame, aSaveState);
aCreatedPseudo = PR_TRUE;
// Now it might be that we had existing pseudo-frames and in particular an
// existing pseudo-cell (so that the pseudo cell we just got is not the
// lowest pseudo-frame). If that's the case, we need to process everythign
// below that cell, so that our later siblings don't see those
// pseudo-frames.
if (aState.mPseudoFrames.mTableOuter.mFrame) {
ProcessPseudoFrames(aState, nsGkAtoms::tableOuterFrame);
}
}
return NS_OK;
}
@ -3194,30 +3178,13 @@ nsCSSFrameConstructor::ConstructTableFrame(nsFrameConstructorState& aState,
#endif
aNewOuterFrame = NS_NewTableOuterFrame(mPresShell, outerStyleContext);
nsIFrame* parentFrame = aContentParent;
nsFrameItems* frameItems = &aChildItems;
// We may need to push a float containing block
nsFrameConstructorSaveState floatSaveState;
if (!aIsPseudo) {
// this frame may have a pseudo parent
PRBool hasPseudoParent = PR_FALSE;
GetParentFrame(aNameSpaceID,*parentFrame, nsGkAtoms::tableOuterFrame,
aState, parentFrame, hasPseudoParent);
if (!hasPseudoParent && !aState.mPseudoFrames.IsEmpty()) {
ProcessPseudoFrames(aState, aChildItems);
}
if (hasPseudoParent) {
aState.PushFloatContainingBlock(parentFrame, floatSaveState);
frameItems = &aState.mPseudoFrames.mCellInner.mChildList;
if (aState.mPseudoFrames.mTableOuter.mFrame) {
ProcessPseudoFrames(aState, nsGkAtoms::tableOuterFrame);
}
}
}
NS_ASSERTION(!IsTableRelated(aContentParent->GetType(), PR_TRUE) ||
aContentParent->GetType() == nsGkAtoms::tableCaptionFrame,
"Unexpected parent frame for table");
nsIFrame* geometricParent = aState.GetGeometricParent
(outerStyleContext->GetStyleDisplay(),
parentFrame);
aContentParent);
// Init the table outer frame and see if we need to create a view, e.g.
// the frame is absolutely positioned
@ -3239,8 +3206,8 @@ nsCSSFrameConstructor::ConstructTableFrame(nsFrameConstructorState& aState,
// Put the newly created frames into the right child list
aNewOuterFrame->SetInitialChildList(nsnull, aNewInnerFrame);
rv = aState.AddChild(aNewOuterFrame, *frameItems, aContent,
aStyleContext, parentFrame);
rv = aState.AddChild(aNewOuterFrame, aChildItems, aContent,
aStyleContext, aContentParent);
if (NS_FAILED(rv)) {
return rv;
}
@ -3289,7 +3256,7 @@ nsCSSFrameConstructor::ConstructTableCaptionFrame(nsFrameConstructorState& aStat
nsIFrame* parentFrame = aParentFrameIn;
*aHasPseudoParent = PR_FALSE;
// this frame may have a pseudo parent
GetParentFrame(aNameSpaceID, *aParentFrameIn,
CreateRequiredPseudoFrames(aNameSpaceID, *aParentFrameIn,
nsGkAtoms::tableCaptionFrame, aState, parentFrame,
*aHasPseudoParent);
if (!*aHasPseudoParent && !aState.mPseudoFrames.IsEmpty()) {
@ -3333,9 +3300,9 @@ nsCSSFrameConstructor::ConstructTableRowGroupFrame(nsFrameConstructorState& aSta
*aHasPseudoParent = PR_FALSE;
if (!aIsPseudo) {
// this frame may have a pseudo parent
GetParentFrame(aNameSpaceID, *aParentFrameIn,
nsGkAtoms::tableRowGroupFrame, aState, parentFrame,
*aHasPseudoParent);
CreateRequiredPseudoFrames(aNameSpaceID, *aParentFrameIn,
nsGkAtoms::tableRowGroupFrame, aState,
parentFrame, *aHasPseudoParent);
if (!*aHasPseudoParent && !aState.mPseudoFrames.IsEmpty()) {
ProcessPseudoFrames(aState, aChildItems);
}
@ -3403,9 +3370,9 @@ nsCSSFrameConstructor::ConstructTableColGroupFrame(nsFrameConstructorState& aSta
*aHasPseudoParent = PR_FALSE;
if (!aIsPseudo) {
// this frame may have a pseudo parent
GetParentFrame(aNameSpaceID, *aParentFrameIn,
nsGkAtoms::tableColGroupFrame, aState, parentFrame,
*aHasPseudoParent);
CreateRequiredPseudoFrames(aNameSpaceID, *aParentFrameIn,
nsGkAtoms::tableColGroupFrame, aState,
parentFrame, *aHasPseudoParent);
if (!*aHasPseudoParent && !aState.mPseudoFrames.IsEmpty()) {
ProcessPseudoFrames(aState, aChildItems);
}
@ -3452,7 +3419,7 @@ nsCSSFrameConstructor::ConstructTableRowFrame(nsFrameConstructorState& aState,
*aHasPseudoParent = PR_FALSE;
if (!aIsPseudo) {
// this frame may have a pseudo parent
GetParentFrame(aNameSpaceID, *aParentFrameIn,
CreateRequiredPseudoFrames(aNameSpaceID, *aParentFrameIn,
nsGkAtoms::tableRowFrame, aState, parentFrame,
*aHasPseudoParent);
if (!*aHasPseudoParent && !aState.mPseudoFrames.IsEmpty()) {
@ -3507,7 +3474,7 @@ nsCSSFrameConstructor::ConstructTableColFrame(nsFrameConstructorState& aState,
*aHasPseudoParent = PR_FALSE;
if (!aIsPseudo) {
// this frame may have a pseudo parent
GetParentFrame(aNameSpaceID, *aParentFrameIn,
CreateRequiredPseudoFrames(aNameSpaceID, *aParentFrameIn,
nsGkAtoms::tableColFrame, aState, parentFrame,
*aHasPseudoParent);
if (!*aHasPseudoParent && !aState.mPseudoFrames.IsEmpty()) {
@ -3568,7 +3535,7 @@ nsCSSFrameConstructor::ConstructTableCellFrame(nsFrameConstructorState& aState,
if (!aIsPseudo) {
// this frame may have a pseudo parent
// use nsGkAtoms::tableCellFrame which will match if it is really nsGkAtoms::bcTableCellFrame
GetParentFrame(aNameSpaceID, *aParentFrameIn,
CreateRequiredPseudoFrames(aNameSpaceID, *aParentFrameIn,
nsGkAtoms::tableCellFrame, aState, parentFrame,
*aHasPseudoParent);
if (!*aHasPseudoParent && !aState.mPseudoFrames.IsEmpty()) {
@ -4471,8 +4438,7 @@ nsCSSFrameConstructor::ConstructButtonFrame(nsFrameConstructorState& aState,
// if there are any anonymous children create frames for them. Note that
// we're doing this using a different parent frame from the one we pass to
// ProcessChildren!
CreateAnonymousFrames(aTag, aState, aContent, buttonFrame,
anonymousChildItems);
CreateAnonymousFrames(aState, aContent, buttonFrame, anonymousChildItems);
if (anonymousChildItems.childList) {
// the anonymous content is already parented to the area frame
aState.mFrameManager->AppendFrames(blockFrame, nsnull,
@ -4581,8 +4547,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsFrameConstructorState& aState,
// element (the scrollbars).
nsFrameItems childItems;
CreateAnonymousFrames(nsGkAtoms::combobox, aState, aContent,
comboboxFrame, childItems);
CreateAnonymousFrames(aState, aContent, comboboxFrame, childItems);
comboboxFrame->SetInitialChildList(nsnull, childItems.childList);
@ -5320,40 +5285,6 @@ nsCSSFrameConstructor::ConstructFrameFromData(const FrameConstructionData* aData
return NS_OK;
}
nsresult
nsCSSFrameConstructor::CreateAnonymousFrames(nsIAtom* aTag,
nsFrameConstructorState& aState,
nsIContent* aParent,
nsIFrame* aNewFrame,
nsFrameItems& aChildItems,
PRBool aIsRoot)
{
// See if we might have anonymous content
// by looking at the tag rather than doing a QueryInterface on
// the frame. Only these tags' frames can have anonymous content
// through nsIAnonymousContentCreator. We do this check for
// performance reasons. If we did a QueryInterface on every tag it
// would be inefficient.
// XXXbz what about just having a virtual method to check this instead?
if (!aIsRoot &&
aTag != nsGkAtoms::input &&
aTag != nsGkAtoms::textarea &&
aTag != nsGkAtoms::combobox &&
aTag != nsGkAtoms::isindex &&
aTag != nsGkAtoms::scrollbar
#ifdef MOZ_SVG
&& aTag != nsGkAtoms::use
#endif
#ifdef MOZ_MEDIA
&& aTag != nsGkAtoms::video
&& aTag != nsGkAtoms::audio
#endif
)
return NS_OK;
return CreateAnonymousFrames(aState, aParent, aNewFrame, aChildItems);
}
// after the node has been constructed and initialized create any
// anonymous content a node needs.
nsresult
@ -5876,13 +5807,10 @@ nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay* aDisplay,
return &sInlineData;
}
NS_ASSERTION(IsTableRelated(aDisplay->mDisplay), "Unexpected display type");
if (NS_STYLE_DISPLAY_TABLE == aDisplay->mDisplay ||
NS_STYLE_DISPLAY_INLINE_TABLE == aDisplay->mDisplay) {
static const FrameConstructionData sTableData =
FULL_CTOR_FCDATA(FCDATA_IS_TABLE_PART,
&nsCSSFrameConstructor::ConstructTable);
FULL_CTOR_FCDATA(0, &nsCSSFrameConstructor::ConstructTable);
return &sTableData;
}
@ -6489,15 +6417,13 @@ nsCSSFrameConstructor::PageBreakBefore(nsFrameConstructorState& aState,
nsIContent* aContent,
nsIFrame* aParentFrame,
nsStyleContext* aStyleContext,
const FrameConstructionData* aFCData,
nsFrameItems& aFrameItems)
{
const nsStyleDisplay* display = aStyleContext->GetStyleDisplay();
if (NS_STYLE_DISPLAY_NONE != display->mDisplay &&
NS_STYLE_POSITION_FIXED != display->mPosition &&
NS_STYLE_POSITION_ABSOLUTE != display->mPosition &&
(NS_STYLE_DISPLAY_TABLE == display->mDisplay ||
!IsTableRelated(display->mDisplay))) {
if (!aStyleContext->GetStyleDisplay()->IsAbsolutelyPositioned() &&
!(aFCData->mBits & FCDATA_IS_TABLE_PART)) {
if (display->mBreakBefore) {
ConstructPageBreakFrame(aState, aContent, aParentFrame, aStyleContext,
aFrameItems);
@ -6559,39 +6485,23 @@ nsCSSFrameConstructor::ConstructFrame(nsFrameConstructorState& aState,
nsRefPtr<nsStyleContext> styleContext;
styleContext = ResolveStyleContext(aParentFrame, aContent);
PRBool pageBreakAfter = PR_FALSE;
if (aState.mPresContext->IsPaginated()) {
// Construct a page break frame for page-break-before, and remember if
// we need one for page-break-after.
pageBreakAfter = PageBreakBefore(aState, aContent, aParentFrame,
styleContext, aFrameItems);
}
// construct the frame
rv = ConstructFrameInternal(aState, aContent, aParentFrame,
return ConstructFrameInternal(aState, aContent, aParentFrame,
aContent->Tag(), aContent->GetNameSpaceID(),
styleContext, aFrameItems, PR_FALSE);
if (NS_SUCCEEDED(rv) && pageBreakAfter) {
// Construct the page break after
ConstructPageBreakFrame(aState, aContent, aParentFrame, styleContext,
aFrameItems);
}
return rv;
styleContext, aFrameItems, PR_TRUE, PR_TRUE);
}
nsresult
nsCSSFrameConstructor::ConstructFrameInternal( nsFrameConstructorState& aState,
nsCSSFrameConstructor::ConstructFrameInternal(nsFrameConstructorState& aState,
nsIContent* aContent,
nsIFrame* aParentFrame,
nsIAtom* aTag,
PRInt32 aNameSpaceID,
nsStyleContext* aStyleContext,
nsFrameItems& aFrameItems,
PRBool aXBLBaseTag)
PRBool aAllowXBLBase,
PRBool aAllowPageBreaks)
{
// The following code allows the user to specify the base tag
// of an element using XBL. XUL and HTML objects (like boxes, menus, etc.)
@ -6599,23 +6509,20 @@ nsCSSFrameConstructor::ConstructFrameInternal( nsFrameConstructorState& aState,
const nsStyleDisplay* display = aStyleContext->GetStyleDisplay();
nsRefPtr<nsStyleContext> styleContext(aStyleContext);
nsAutoEnqueueBinding binding(mDocument);
if (!aXBLBaseTag)
if (aAllowXBLBase && display->mBinding)
{
// Ensure that our XBL bindings are installed.
if (display->mBinding) {
// Get the XBL loader.
nsresult rv;
// Load the bindings.
PRBool resolveStyle;
nsIXBLService * xblService = GetXBLService();
if (!xblService)
return NS_ERROR_FAILURE;
rv = xblService->LoadBindings(aContent, display->mBinding->mURI,
PRBool resolveStyle;
nsresult rv = xblService->LoadBindings(aContent, display->mBinding->mURI,
display->mBinding->mOriginPrincipal,
PR_FALSE, getter_AddRefs(binding.mBinding),
PR_FALSE,
getter_AddRefs(binding.mBinding),
&resolveStyle);
if (NS_FAILED(rv))
return NS_OK;
@ -6623,25 +6530,10 @@ nsCSSFrameConstructor::ConstructFrameInternal( nsFrameConstructorState& aState,
if (resolveStyle) {
styleContext = ResolveStyleContext(aParentFrame, aContent);
display = styleContext->GetStyleDisplay();
aStyleContext = styleContext;
}
PRInt32 nameSpaceID;
nsCOMPtr<nsIAtom> baseTag =
mDocument->BindingManager()->ResolveTag(aContent, &nameSpaceID);
if (baseTag != aTag || aNameSpaceID != nameSpaceID) {
// Construct the frame using the XBL base tag.
rv = ConstructFrameInternal(aState,
aContent,
aParentFrame,
baseTag,
nameSpaceID,
styleContext,
aFrameItems,
PR_TRUE);
return rv;
}
}
aTag = mDocument->BindingManager()->ResolveTag(aContent, &aNameSpaceID);
}
// Pre-check for display "none" - if we find that, don't create
@ -6693,7 +6585,7 @@ nsCSSFrameConstructor::ConstructFrameInternal( nsFrameConstructorState& aState,
// Now check for XUL display types
if (!data) {
data = FindXULDisplayData(display, aContent, aStyleContext);
data = FindXULDisplayData(display, aContent, styleContext);
}
// And general display types
@ -6706,6 +6598,14 @@ nsCSSFrameConstructor::ConstructFrameInternal( nsFrameConstructorState& aState,
if (data->mBits & FCDATA_SUPPRESS_FRAME) {
return NS_OK;
}
#ifdef MOZ_XUL
if ((data->mBits & FCDATA_IS_POPUP) &&
aParentFrame->GetType() != nsGkAtoms::menuFrame &&
!aState.mPopupItems.containingBlock) {
return NS_OK;
}
#endif /* MOZ_XUL */
}
nsIFrame* adjParentFrame = aParentFrame;
@ -6741,17 +6641,25 @@ nsCSSFrameConstructor::ConstructFrameInternal( nsFrameConstructorState& aState,
styleContext->GetStyleBackground();
}
#ifdef MOZ_XUL
if ((data->mBits & FCDATA_IS_POPUP) &&
adjParentFrame->GetType() != nsGkAtoms::menuFrame &&
!aState.mPopupItems.containingBlock) {
return NS_OK;
}
#endif /* MOZ_XUL */
// Construct a page break frame for page-break-before, if needed, and
// remember whether we need one for page-break-after.
PRBool pageBreakAfter =
aAllowPageBreaks &&
aState.mPresContext->IsPaginated() &&
PageBreakBefore(aState, aContent, adjParentFrame, styleContext, data,
*frameItems);
return ConstructFrameFromData(data, aState, aContent, adjParentFrame, aTag,
rv = ConstructFrameFromData(data, aState, aContent, adjParentFrame, aTag,
aNameSpaceID, styleContext, *frameItems,
pseudoParent);
if (NS_SUCCEEDED(rv) && pageBreakAfter) {
// Construct the page break after
ConstructPageBreakFrame(aState, aContent, adjParentFrame, styleContext,
*frameItems);
}
return rv;
}
@ -10352,8 +10260,7 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState,
// Create any anonymous frames the initial containing block frame requires.
// This must happen before the rest of ProcessChildren to ensure that
// popups are never constructed before the popupset.
CreateAnonymousFrames(nsnull, aState, aContent, aFrame, aFrameItems,
PR_TRUE);
CreateAnonymousFrames(aState, aContent, aFrame, aFrameItems);
}
nsresult rv = NS_OK;
@ -10392,8 +10299,7 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState,
}
if (aFrame != mRootElementFrame) {
CreateAnonymousFrames(aContent->Tag(), aState, aContent, aFrame,
aFrameItems);
CreateAnonymousFrames(aState, aContent, aFrame, aFrameItems);
}
// process the current pseudo frame state
@ -11414,10 +11320,9 @@ nsCSSFrameConstructor::CreateListBoxContent(nsPresContext* aPresContext,
BeginUpdate();
rv = ConstructFrameInternal(state, aChild,
aParentFrame, aChild->Tag(),
aChild->GetNameSpaceID(),
styleContext, frameItems, PR_FALSE);
rv = ConstructFrameInternal(state, aChild, aParentFrame, aChild->Tag(),
aChild->GetNameSpaceID(), styleContext,
frameItems, PR_TRUE, PR_FALSE);
if (!state.mPseudoFrames.IsEmpty()) {
ProcessPseudoFrames(state, frameItems);
}
@ -11584,8 +11489,7 @@ nsCSSFrameConstructor::ConstructInline(nsFrameConstructorState& aState,
childItems, &kidsAllInline);
if (kidsAllInline) {
// Set the inline frame's initial child list
CreateAnonymousFrames(aContent->Tag(), aState, aContent, newFrame,
childItems);
CreateAnonymousFrames(aState, aContent, newFrame, childItems);
newFrame->SetInitialChildList(nsnull, childItems.childList);
if (NS_SUCCEEDED(rv)) {

View File

@ -539,7 +539,7 @@ private:
nsFrameConstructorState& aState,
nsIFrame& aParentFrameIn);
nsresult GetParentFrame(PRInt32 aNameSpaceID,
nsresult CreateRequiredPseudoFrames(PRInt32 aNameSpaceID,
nsIFrame& aParentFrameIn,
nsIAtom* aChildFrameType,
nsFrameConstructorState& aState,
@ -826,6 +826,7 @@ private:
nsIContent* aContent,
nsIFrame* aParentFrame,
nsStyleContext* aStyleContext,
const FrameConstructionData* aFCData,
nsFrameItems& aFrameItems);
// Function to find FrameConstructionData for aContent. Will return
@ -871,21 +872,15 @@ private:
nsFrameItems& aFrameItems,
PRBool aHasPseudoParent);
nsresult ConstructFrameInternal( nsFrameConstructorState& aState,
nsresult ConstructFrameInternal(nsFrameConstructorState& aState,
nsIContent* aContent,
nsIFrame* aParentFrame,
nsIAtom* aTag,
PRInt32 aNameSpaceID,
nsStyleContext* aStyleContext,
nsFrameItems& aFrameItems,
PRBool aXBLBaseTag);
nsresult CreateAnonymousFrames(nsIAtom* aTag,
nsFrameConstructorState& aState,
nsIContent* aParent,
nsIFrame* aNewFrame,
nsFrameItems& aChildItems,
PRBool aIsRoot = PR_FALSE);
PRBool aAllowXBLBase,
PRBool aAllowPageBreaks);
nsresult CreateAnonymousFrames(nsFrameConstructorState& aState,
nsIContent* aParent,

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<body>
<table cellpadding="0" cellspacing="0">
<tr>
<td>Long long cell</td>
<td>cell</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0">
<tr>
<td>cell</td>
<td>cell</td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<body>
<div style="display: table-row">
<div style="display: table-row">
<div style="display: table-cell">Long long cell</div>
<div style="display: table-cell">cell</div>
</div>
<span style="display: table"></span>
<div style="display: table-row">
<div style="display: table-cell">cell</div>
<div style="display: table-cell">cell</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<body>
<div style="display: table-row">
<div style="display: table-row">
<div style="display: table-cell">Long long cell</div>
<div style="display: table-cell">cell</div>
</div>
<span style="display: block"></span>
<div style="display: table-row">
<div style="display: table-cell">cell</div>
<div style="display: table-cell">cell</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<body>
<table cellpadding="0" cellspacing="0">
<tr>
<td>First Column</td>
<td>Second Column</td>
</tr>
<tr>
<td>First Column</td>
<td>Second Column</td>
</tr>
</table>
</body>
</html>

View File

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<body>
<div style="display:table">
<div style="display: table-row">
<div style="display: table-cell">
First Column
</div>
<div style="display: table-cell">
Second Column
</div>
</div>
<div style="display: table-row">
<div style="display: table-cell">
First Column
</div>
<div style="display: -moz-popup; display: popup"></div>
<div style="display: table-cell">
Second Column
</div>
</div>
</div>
</body>
</html>

View File

@ -1092,3 +1092,6 @@ fails == 461512-1.html 461512-1-ref.html # Bug 461512
== 478811-2.html 478811-2-ref.html
== 478811-3.html 478811-3-ref.html
== 478811-4.html 478811-4-ref.html
== 478956-1a.html 478956-1-ref.html
== 478956-1b.html 478956-1-ref.html
== 480017-1.html 480017-1-ref.html

View File

@ -2186,7 +2186,7 @@ version 1.2.30beta03 [July 6, 2008]
version 1.2.30beta04 [July 10, 2008]
Merged more cosmetic whitespace changes from libpng-1.4.0beta19.
version 1.0.38rc01, 1.2.30rc01 [December 18, 2008]
version 1.0.38rc01, 1.2.30rc01 [July 18, 2008]
No changes.
version 1.0.38rc02, 1.2.30rc02 [July 21, 2008]
@ -2309,6 +2309,25 @@ version 1.0.42rc01, 1.2.34rc01 [December 11, 2008]
version 1.0.42, 1.2.34 [December 18, 2008]
No changes.
version 1.2.35beta01 [February 4, 2009]
Zero out some arrays of pointers after png_malloc(). (Tavis Ormandy)
version 1.2.35beta02 [Feburary 4, 2009]
Zero out more arrays of pointers after png_malloc().
version 1.2.35beta03 [February 5, 2009]
Use png_memset() instead of a loop to intialize pointers. We realize
this will not work on platforms where the NULL pointer is not all zeroes.
version 1.2.35rc01 [February 11, 2009]
No changes.
version 1.2.35rc02 [February 12, 2009]
Fix typo in new png_memset call in pngset.c (png_color should be png_charp)
version 1.0.43 and 1.2.35 [February 14, 2009]
No changes.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement

View File

@ -8,7 +8,7 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
If you modify libpng you may insert additional notices immediately following
this sentence.
libpng versions 1.2.6, August 15, 2004, through 1.2.34, December 18, 2008, are
libpng versions 1.2.6, August 15, 2004, through 1.2.35, February 14, 2009, are
Copyright (c) 2004, 2006-2008 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors
@ -106,4 +106,4 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
December 18, 2008
February 14, 2009

View File

@ -1,6 +1,8 @@
Changes made to pristine png source by mozilla.org developers.
2009/02/19 -- Synced with libpng-1.2.35 (bug #478901).
2008/08/21 -- Synced with libpng-1.2.31 (bug #418900).
2008/03/29 -- Initialize prev_row for each APNG frame, only when

View File

@ -1,4 +1,4 @@
README for libpng version 1.2.34 - December 18, 2008 (shared library 12.0)
README for libpng version 1.2.35 - February 14, 2009 (shared library 12.0)
See the note about version numbers near the top of png.h
See INSTALL for instructions on how to install libpng.
@ -194,11 +194,11 @@ Files in this distribution:
descrip.mms => VMS makefile for MMS or MMK
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.elf => Linux/ELF makefile symbol versioning,
gcc, creates libpng12.so.0.1.2.34)
gcc, creates libpng12.so.0.1.2.35)
makefile.linux => Linux/ELF makefile
(gcc, creates libpng12.so.0.1.2.34)
(gcc, creates libpng12.so.0.1.2.35)
makefile.gcmmx => Linux/ELF makefile
(gcc, creates libpng12.so.0.1.2.34,
(gcc, creates libpng12.so.0.1.2.35,
uses assembler code tuned for Intel MMX platform)
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with
@ -220,12 +220,12 @@ Files in this distribution:
makefile.openbsd => OpenBSD makefile
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
makefile.sggcc => Silicon Graphics
(gcc, creates libpng12.so.0.1.2.34)
(gcc, creates libpng12.so.0.1.2.35)
makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile
(gcc, creates libpng12.so.0.1.2.34)
(gcc, creates libpng12.so.0.1.2.35)
makefile.so9 => Solaris 9 makefile
(gcc, creates libpng12.so.0.1.2.34)
(gcc, creates libpng12.so.0.1.2.35)
makefile.32sunu => Sun Ultra 32-bit makefile
makefile.64sunu => Sun Ultra 64-bit makefile
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc

View File

@ -1,15 +1,15 @@
libpng.txt - A description on how to use and modify libpng
libpng version 1.2.34 - December 18, 2008
libpng version 1.2.35 - February 14, 2009
Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net>
Copyright (c) 1998-2008 Glenn Randers-Pehrson
Copyright (c) 1998-2009 Glenn Randers-Pehrson
For conditions of distribution and use, see copyright
notice in png.h.
Based on:
libpng versions 0.97, January 1998, through 1.2.34 - December 18, 2008
libpng versions 0.97, January 1998, through 1.2.35 - February 14, 2009
Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2008 Glenn Randers-Pehrson
@ -471,6 +471,8 @@ row_pointers prior to calling png_read_png() with
"Image is too wide to process in memory");
row_pointers = png_malloc(png_ptr,
height*png_sizeof(png_bytep));
for (int i=0; i<height, i++)
row_pointers[i]=NULL; /* security precaution */
for (int i=0; i<height, i++)
row_pointers[i]=png_malloc(png_ptr,
width*pixel_size);
@ -2851,13 +2853,13 @@ application:
IX. Y2K Compliance in libpng
August 21, 2008
February 14, 2009
Since the PNG Development group is an ad-hoc body, we can't make
an official declaration.
This is your unofficial assurance that libpng from version 0.71 and
upward through 1.2.31 are Y2K compliant. It is my belief that earlier
upward through 1.2.35 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant.
Libpng only has three year fields. One is a 2-byte unsigned integer that

View File

@ -13,7 +13,7 @@
#include "png.h"
/* Generate a compiler error if there is an old png.h in the search path. */
typedef version_1_2_34 Your_png_h_is_not_version_1_2_34;
typedef version_1_2_35 Your_png_h_is_not_version_1_2_35;
/* Version information for C files. This had better match the version
* string defined in png.h. */
@ -697,7 +697,7 @@ png_charp PNGAPI
png_get_copyright(png_structp png_ptr)
{
png_ptr = png_ptr; /* silence compiler warning about unused png_ptr */
return ((png_charp) "\n libpng version 1.2.34 - December 18, 2008\n\
return ((png_charp) "\n libpng version 1.2.35 - February 14, 2009\n\
Copyright (c) 1998-2008 Glenn Randers-Pehrson\n\
Copyright (c) 1996-1997 Andreas Dilger\n\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n");

View File

@ -1,14 +1,14 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.2.34 - December 18, 2008
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
* libpng version 1.2.35 - February 14, 2009
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.2.34 - December 18, 2008: Glenn
* libpng versions 0.97, January 1998, through 1.2.35 - February 14, 2009: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
@ -217,6 +217,11 @@
* 1.2.34rc01 13 10234 12.so.0.34[.0]
* 1.0.42 10 10042 10.so.0.42[.0]
* 1.2.34 13 10234 12.so.0.34[.0]
* 1.2.35beta01-03 13 10235 12.so.0.35[.0]
* 1.0.43rc01-02 10 10043 10.so.0.43[.0]
* 1.2.35rc01-02 13 10235 12.so.0.35[.0]
* 1.0.43 10 10043 10.so.0.43[.0]
* 1.2.35 13 10235 12.so.0.35[.0]
*
* Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be
@ -246,7 +251,7 @@
* If you modify libpng you may insert additional notices immediately following
* this sentence.
*
* libpng versions 1.2.6, August 15, 2004, through 1.2.34, December 18, 2008, are
* libpng versions 1.2.6, August 15, 2004, through 1.2.35, February 14, 2009, are
* Copyright (c) 2004, 2006-2008 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.2.5
* with the following individual added to the list of Contributing Authors:
@ -358,13 +363,13 @@
* Y2K compliance in libpng:
* =========================
*
* December 18, 2008
* February 14, 2009
*
* Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration.
*
* This is your unofficial assurance that libpng from version 0.71 and
* upward through 1.2.34 are Y2K compliant. It is my belief that earlier
* upward through 1.2.35 are Y2K compliant. It is my belief that earlier
* versions were also Y2K compliant.
*
* Libpng only has three year fields. One is a 2-byte unsigned integer
@ -420,9 +425,9 @@
*/
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.2.34"
#define PNG_LIBPNG_VER_STRING "1.2.35"
#define PNG_HEADER_VERSION_STRING \
" libpng version 1.2.34 - December 18, 2008\n"
" libpng version 1.2.35 - February 14, 2009\n"
#define PNG_LIBPNG_VER_SONUM 0
#define PNG_LIBPNG_VER_DLLNUM 13
@ -430,7 +435,7 @@
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 2
#define PNG_LIBPNG_VER_RELEASE 34
#define PNG_LIBPNG_VER_RELEASE 35
/* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero: */
@ -458,7 +463,7 @@
* Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only
* version 1.0.0 was mis-numbered 100 instead of 10000). From
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */
#define PNG_LIBPNG_VER 10234 /* 1.2.34 */
#define PNG_LIBPNG_VER 10235 /* 1.2.35 */
#ifndef PNG_VERSION_INFO_ONLY
/* include the compression library's header */
@ -1534,7 +1539,7 @@ struct png_struct_def
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
typedef png_structp version_1_2_34;
typedef png_structp version_1_2_35;
typedef png_struct FAR * FAR * png_structpp;

View File

@ -1,9 +1,9 @@
/* pngconf.h - machine configurable file for libpng
*
* libpng version 1.2.34 - December 18, 2008
* libpng version 1.2.35 - February 14, 2009
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*/
@ -235,6 +235,8 @@
# include <windows.h>
/* Console I/O functions are not supported on WindowsCE */
# define PNG_NO_CONSOLE_IO
/* abort() may not be supported on some/all Windows CE platforms */
# define PNG_ABORT() exit(-1)
# ifdef PNG_DEBUG
# undef PNG_DEBUG
# endif

View File

@ -1044,7 +1044,7 @@ png_get_mmx_rowbytes_threshold (png_structp png_ptr)
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
/* these functions were added to libpng 1.2.6 */
/* These functions were added to libpng 1.2.6 */
png_uint_32 PNGAPI
png_get_user_width_max (png_structp png_ptr)
{

View File

@ -1,9 +1,9 @@
/* pngread.c - read a PNG file
*
* Last changed in libpng 1.2.30 [August 13, 2008]
* Last changed in libpng 1.2.35 [February 14, 2009]
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@ -1577,12 +1577,12 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
#ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_ROWS;
#endif
png_memset(info_ptr->row_pointers, 0, info_ptr->height
* png_sizeof(png_bytep));
for (row = 0; row < (int)info_ptr->height; row++)
{
info_ptr->row_pointers[row] = (png_bytep)png_malloc(png_ptr,
png_get_rowbytes(png_ptr, info_ptr));
}
}
png_read_image(png_ptr, info_ptr->row_pointers);
info_ptr->valid |= PNG_INFO_IDAT;

View File

@ -1,9 +1,9 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
* Last changed in libpng 1.2.30 [August 13, 2008]
* Last changed in libpng 1.2.35 [February 14, 2009]
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@ -309,9 +309,7 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
hash = (png_dsortpp)png_malloc(png_ptr, (png_uint_32)(769 *
png_sizeof(png_dsortp)));
for (i = 0; i < 769; i++)
hash[i] = NULL;
/* png_memset(hash, 0, 769 * png_sizeof(png_dsortp)); */
png_memset(hash, 0, 769 * png_sizeof(png_dsortp));
num_new_palette = num_palette;
@ -4133,6 +4131,8 @@ png_build_gamma_table(png_structp png_ptr)
double fin, fout;
png_uint_32 last, max;
png_memset(png_ptr->gamma_16_table, 0, num * png_sizeof(png_uint_16p));
for (i = 0; i < num; i++)
{
png_ptr->gamma_16_table[i] = (png_uint_16p)png_malloc(png_ptr,
@ -4188,6 +4188,8 @@ png_build_gamma_table(png_structp png_ptr)
png_ptr->gamma_16_to_1 = (png_uint_16pp)png_malloc(png_ptr,
(png_uint_32)(num * png_sizeof(png_uint_16p )));
png_memset(png_ptr->gamma_16_to_1, 0, num * png_sizeof(png_uint_16p));
for (i = 0; i < num; i++)
{
png_ptr->gamma_16_to_1[i] = (png_uint_16p)png_malloc(png_ptr,
@ -4211,6 +4213,9 @@ png_build_gamma_table(png_structp png_ptr)
png_ptr->gamma_16_from_1 = (png_uint_16pp)png_malloc(png_ptr,
(png_uint_32)(num * png_sizeof(png_uint_16p)));
png_memset(png_ptr->gamma_16_from_1, 0,
num * png_sizeof(png_uint_16p));
for (i = 0; i < num; i++)
{
png_ptr->gamma_16_from_1[i] = (png_uint_16p)png_malloc(png_ptr,

View File

@ -1123,6 +1123,7 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_debug(1, "in png_handle_sPLT");
if (!(png_ptr->mode & PNG_HAVE_IHDR))
png_error(png_ptr, "Missing IHDR before sPLT");
else if (png_ptr->mode & PNG_HAVE_IDAT)
@ -1909,6 +1910,7 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_debug(1, "in png_handle_tEXt");
if (!(png_ptr->mode & PNG_HAVE_IHDR))
png_error(png_ptr, "Missing IHDR before tEXt");
@ -1925,6 +1927,7 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
#endif
png_free(png_ptr, png_ptr->chunkdata);
png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
if (png_ptr->chunkdata == NULL)
{
@ -1942,6 +1945,7 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
}
key = png_ptr->chunkdata;
key[slength] = 0x00;
for (text = key; *text; text++)
@ -1991,6 +1995,8 @@ png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_size_t slength, prefix_len, data_len;
png_debug(1, "in png_handle_zTXt");
if (!(png_ptr->mode & PNG_HAVE_IHDR))
png_error(png_ptr, "Missing IHDR before zTXt");
@ -2095,6 +2101,7 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_debug(1, "in png_handle_iTXt");
if (!(png_ptr->mode & PNG_HAVE_IHDR))
png_error(png_ptr, "Missing IHDR before iTXt");
@ -2383,6 +2390,7 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_debug(1, "in png_handle_unknown");
if (png_ptr->mode & PNG_HAVE_IDAT)
{
#ifdef PNG_USE_LOCAL_ARRAYS
@ -3371,9 +3379,9 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
png_debug1(3, "width = %lu,", png_ptr->width);
png_debug1(3, "height = %lu,", png_ptr->height);
png_debug1(3, "iwidth = %lu,", png_ptr->iwidth);
png_debug1(3, "num_rows = %lu", png_ptr->num_rows);
png_debug1(3, "num_rows = %lu,", png_ptr->num_rows);
png_debug1(3, "rowbytes = %lu,", png_ptr->rowbytes);
png_debug1(3, "irowbytes = %lu,", png_ptr->irowbytes);
png_debug1(3, "irowbytes = %lu", png_ptr->irowbytes);
png_ptr->flags |= PNG_FLAG_ROW_INIT;
}

View File

@ -1,9 +1,9 @@
/* pngset.c - storage of image information into info struct
*
* Last changed in libpng 1.2.34 [December 18, 2008]
* Last changed in libpng 1.2.35 [February 14, 2009]
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@ -61,7 +61,8 @@ png_set_cHRM(png_structp png_ptr, png_infop info_ptr,
#endif
info_ptr->valid |= PNG_INFO_cHRM;
}
#endif
#endif /* PNG_FLOATING_POINT_SUPPORTED */
#ifdef PNG_FIXED_POINT_SUPPORTED
void PNGAPI
png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr,
@ -387,7 +388,11 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
return;
}
info_ptr->pcal_params[nparams] = NULL;
#ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_PCAL;
#endif
png_memset(info_ptr->pcal_params, 0, (nparams + 1) * png_sizeof(png_charp));
for (i = 0; i < nparams; i++)
{
@ -404,9 +409,6 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
}
info_ptr->valid |= PNG_INFO_pCAL;
#ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_PCAL;
#endif
}
#endif
@ -640,7 +642,7 @@ png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr,
}
#endif /* cHRM */
}
#endif
#endif /* sRGB */
#if defined(PNG_iCCP_SUPPORTED)
@ -964,6 +966,7 @@ png_set_sPLT(png_structp png_ptr,
png_memcpy(np, info_ptr->splt_palettes,
info_ptr->splt_palettes_num * png_sizeof(png_sPLT_t));
png_free(png_ptr, info_ptr->splt_palettes);
info_ptr->splt_palettes=NULL;

View File

@ -1,9 +1,9 @@
/* pngwio.c - functions for data output
*
* Last changed in libpng 1.2.30 [August 13, 2008]
* Last changed in libpng 1.2.35 [February 14, 2009]
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@ -137,7 +137,7 @@ png_default_flush(png_structp png_ptr)
if (png_ptr == NULL) return;
#if !defined(_WIN32_WCE)
io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr));
if (io_ptr != NULL)
if (io_ptr != NULL && fileno(io_ptr) != -1)
fflush(io_ptr);
#endif
}

View File

@ -1,7 +1,7 @@
/* pngwrite.c - general routines to write a PNG file
*
* Last changed in libpng 1.2.31 [August 19, 2008]
* Last changed in libpng 1.2.34 [December 18, 2008]
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

View File

@ -90,11 +90,15 @@ public:
nsIZipReaderCache *jarCache)
: mJarCache(jarCache)
, mJarFile(jarFile)
, mFullJarURI(fullJarURI)
, mJarEntry(jarEntry)
, mContentLength(-1)
{
NS_ASSERTION(mJarFile, "no jar file");
if (fullJarURI) {
nsresult rv = fullJarURI->GetAsciiSpec(mJarDirSpec);
NS_ASSERTION(NS_SUCCEEDED(rv), "this shouldn't fail");
}
}
virtual ~nsJARInputThunk()
@ -120,7 +124,7 @@ private:
nsCOMPtr<nsIZipReaderCache> mJarCache;
nsCOMPtr<nsIZipReader> mJarReader;
nsCOMPtr<nsIFile> mJarFile;
nsCOMPtr<nsIURI> mFullJarURI;
nsCString mJarDirSpec;
nsCOMPtr<nsIInputStream> mJarStream;
nsCString mJarEntry;
PRInt32 mContentLength;
@ -150,11 +154,9 @@ nsJARInputThunk::EnsureJarStream()
// A directory stream also needs the Spec of the FullJarURI
// because is included in the stream data itself.
nsCAutoString jarDirSpec;
rv = mFullJarURI->GetAsciiSpec(jarDirSpec);
if (NS_FAILED(rv)) return rv;
NS_ENSURE_STATE(!mJarDirSpec.IsEmpty());
rv = mJarReader->GetInputStreamWithSpec(jarDirSpec,
rv = mJarReader->GetInputStreamWithSpec(mJarDirSpec,
mJarEntry.get(),
getter_AddRefs(mJarStream));
}

View File

@ -76,7 +76,7 @@
#include "NSReg.h"
#include "VerReg.h"
#if defined(XP_MAC) || defined(XP_MACOSX)
#if defined(XP_MACOSX)
#include <Folders.h>
#endif
@ -158,7 +158,7 @@ static REGERR vr_GetUninstallItemPath(char *regPackageName, char *regbuf, uint32
static REGERR vr_convertPackageName(char *regPackageName, char *convertedPackageName, uint32 convertedDataLength);
static REGERR vr_unmanglePackageName(char *mangledPackageName, char *regPackageName, uint32 regPackageLength);
#if defined(XP_MAC) || defined(XP_MACOSX)
#if defined(XP_MACOSX)
static void vr_MacAliasFromPath(const char * fileName, void ** alias, int32 * length);
static char * vr_PathFromMacAlias(const void * alias, uint32 aliasLength);
#endif
@ -289,14 +289,7 @@ done:
#if defined(XP_WIN) || defined(XP_OS2)
#define VR_FILE_SEP '\\'
#endif
#if defined(XP_MAC) || defined(XP_MACOSX)
#define VR_FILE_SEP ':'
#endif
#ifdef XP_BEOS
#define VR_FILE_SEP '/'
#endif
#ifdef XP_UNIX
#elif defined(XP_UNIX) || defined(XP_BEOS)
#define VR_FILE_SEP '/'
#endif
@ -452,7 +445,7 @@ static REGERR vr_GetPathname(HREG reg, RKEY key, char *entry, char *buf, uint32
info.size = sizeof(REGINFO);
#if !defined(XP_MAC) && !defined(XP_MACOSX)
#if !defined(XP_MACOSX)
err = NR_RegGetEntry( reg, key, entry, (void*)buf, &sizebuf );
return err;
#else
@ -686,10 +679,6 @@ static REGERR vr_FindKey(char *component_path, HREG *hreg, RKEY *key)
* ---------------------------------------------------------------------
*/
#ifdef XP_MAC
#pragma export on
#endif
#ifndef STANDALONE_REGISTRY
VR_INTERFACE(REGERR) VR_PackRegistry(void *userData, nr_RegPackCallbackFunc fn)
{
@ -1159,10 +1148,6 @@ VR_INTERFACE(REGERR) VR_GetRefCount(char *component_path, int *result)
} /* GetRefCount */
#ifdef XP_MAC
#pragma export reset
#endif
static REGERR vr_GetUninstallItemPath(char *regPackageName, char *regbuf, uint32 regbuflen)
{
XP_Bool bSharedUninstall = FALSE;
@ -1339,10 +1324,6 @@ static REGERR vr_unmanglePackageName(char *mangledPackageName, char *regPackageN
return REGERR_OK;
}
#ifdef XP_MAC
#pragma export on
#endif
VR_INTERFACE(REGERR) VR_UninstallCreateNode(char *regPackageName, char *userPackageName)
{
REGERR err;
@ -1853,8 +1834,4 @@ VR_INTERFACE(REGERR) VR_EnumUninstall(REGENUM *state, char* userPackageName,
} /* EnumUninstall */
#ifdef XP_MAC
#pragma export reset
#endif
/* EOF: VerReg.c */

View File

@ -264,7 +264,7 @@ mozStorageConnection::Close()
int srv = sqlite3_close(mDBConn);
if (srv != SQLITE_OK)
NS_WARNING("sqlite3_close failed. There are probably outstanding statements that are listed above!");
NS_ERROR("sqlite3_close failed. There are probably outstanding statements that are listed above!");
mDBConn = NULL;
return ConvertResultCode(srv);

View File

@ -0,0 +1,24 @@
/* Invoke unit tests on OS/2 */
PARSE ARG dist prog parm
dist=forwardtoback(dist);
'set BEGINLIBPATH='dist'\bin;%BEGINLIBPATH%'
'set LIBPATHSTRICT=T'
if substr(FILESPEC("name",prog),1,5) \= 'test_'
then
do
prog=forwardtoback(prog)
prog parm
exit
end
else
bash prog parm
exit
forwardtoback: procedure
arg pathname
parse var pathname pathname'/'rest
do while (rest <> "")
pathname = pathname'\'rest
parse var pathname pathname'/'rest
end
return pathname

View File

@ -93,7 +93,10 @@ var signonsTreeView = {
cycleHeader : function(column) {},
getRowProperties : function(row,prop) {},
getColumnProperties : function(column,prop) {},
getCellProperties : function(row,column,prop) {}
getCellProperties : function(row,column,prop) {
if (column.element.getAttribute("id") == "siteCol")
prop.AppendElement(kLTRAtom);
}
};

View File

@ -59,6 +59,8 @@ var rejectsTree;
var showingPasswords = false;
var kLTRAtom;
function Startup() {
// xpconnect to password manager interfaces
passwordmanager = Components.classes["@mozilla.org/login-manager;1"]
@ -73,6 +75,10 @@ function Startup() {
signonsTree = document.getElementById("signonsTree");
rejectsTree = document.getElementById("rejectsTree");
kLTRAtom = Components.classes["@mozilla.org/atom-service;1"]
.getService(Components.interfaces.nsIAtomService)
.getAtom("ltr");
}
function Shutdown() {

View File

@ -64,7 +64,10 @@ var rejectsTreeView = {
cycleHeader : function(column) {},
getRowProperties : function(row,prop){},
getColumnProperties : function(column,prop){},
getCellProperties : function(row,column,prop){}
getCellProperties : function(row,column,prop){
if (column.element.getAttribute("id") == "rejectCol")
prop.AppendElement(kLTRAtom);
}
};
function Reject(number, host) {