зеркало из https://github.com/mozilla/pjs.git
Merge mozilla-central to tracemonkey.
This commit is contained in:
Коммит
e3469c7595
|
@ -68,7 +68,9 @@ ifdef MOZ_MEMORY
|
|||
tier_base_dirs += memory/jemalloc
|
||||
endif
|
||||
|
||||
ifdef COMPILE_ENVIRONMENT
|
||||
include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk
|
||||
endif
|
||||
|
||||
TIERS += testharness
|
||||
|
||||
|
|
|
@ -181,16 +181,14 @@ var StarUI = {
|
|||
rows.insertBefore(header, rows.firstChild);
|
||||
header.hidden = false;
|
||||
|
||||
var bundle = this._element("bundle_browser");
|
||||
|
||||
// Set panel title:
|
||||
// if we are batching, i.e. the bookmark has been added now,
|
||||
// then show Page Bookmarked, else if the bookmark did already exist,
|
||||
// we are about editing it, then use Edit This Bookmark.
|
||||
this._element("editBookmarkPanelTitle").value =
|
||||
this._batching ?
|
||||
bundle.getString("editBookmarkPanel.pageBookmarkedTitle") :
|
||||
bundle.getString("editBookmarkPanel.editBookmarkTitle");
|
||||
gNavigatorBundle.getString("editBookmarkPanel.pageBookmarkedTitle") :
|
||||
gNavigatorBundle.getString("editBookmarkPanel.editBookmarkTitle");
|
||||
|
||||
// No description; show the Done, Cancel;
|
||||
// hide the Edit, Undo buttons
|
||||
|
@ -207,7 +205,7 @@ var StarUI = {
|
|||
// The label of the remove button differs if the URI is bookmarked
|
||||
// multiple times.
|
||||
var bookmarks = PlacesUtils.getBookmarksForURI(gBrowser.currentURI);
|
||||
var forms = bundle.getString("editBookmark.removeBookmarks.label");
|
||||
var forms = gNavigatorBundle.getString("editBookmark.removeBookmarks.label");
|
||||
var label = PluralForm.get(bookmarks.length, forms).replace("#1", bookmarks.length);
|
||||
this._element("editBookmarkPanelRemoveButton").label = label;
|
||||
|
||||
|
@ -249,18 +247,17 @@ var StarUI = {
|
|||
function PCH_showPageBookmarkedNotification(aItemId, aAnchorElement, aPosition) {
|
||||
this._blockCommands(); // un-done in the popuphiding handler
|
||||
|
||||
var bundle = this._element("bundle_browser");
|
||||
var brandBundle = this._element("bundle_brand");
|
||||
var brandShortName = brandBundle.getString("brandShortName");
|
||||
|
||||
// "Page Bookmarked" title
|
||||
this._element("editBookmarkPanelTitle").value =
|
||||
bundle.getString("editBookmarkPanel.pageBookmarkedTitle");
|
||||
gNavigatorBundle.getString("editBookmarkPanel.pageBookmarkedTitle");
|
||||
|
||||
// description
|
||||
this._element("editBookmarkPanelDescription").textContent =
|
||||
bundle.getFormattedString("editBookmarkPanel.pageBookmarkedDescription",
|
||||
[brandShortName]);
|
||||
gNavigatorBundle.getFormattedString("editBookmarkPanel.pageBookmarkedDescription",
|
||||
[brandShortName]);
|
||||
|
||||
// show the "Edit.." button and the Remove Bookmark button, hide the
|
||||
// undo-remove-bookmark button.
|
||||
|
@ -310,12 +307,11 @@ var StarUI = {
|
|||
if (this._batching) {
|
||||
PlacesUIUtils.ptm.endBatch();
|
||||
PlacesUIUtils.ptm.beginBatch(); // allow undo from within the notification
|
||||
var bundle = this._element("bundle_browser");
|
||||
|
||||
// "Bookmark Removed" title (the description field is already empty in
|
||||
// this mode)
|
||||
this._element("editBookmarkPanelTitle").value =
|
||||
bundle.getString("editBookmarkPanel.bookmarkedRemovedTitle");
|
||||
gNavigatorBundle.getString("editBookmarkPanel.bookmarkedRemovedTitle");
|
||||
|
||||
// hide the edit panel
|
||||
this.quitEditMode();
|
||||
|
@ -1148,17 +1144,16 @@ var PlacesStarButton = {
|
|||
if (!starIcon)
|
||||
return;
|
||||
|
||||
var browserBundle = document.getElementById("bundle_browser");
|
||||
var uri = getBrowser().currentURI;
|
||||
this._starred = uri && (PlacesUtils.getMostRecentBookmarkForURI(uri) != -1 ||
|
||||
PlacesUtils.getMostRecentFolderForFeedURI(uri) != -1);
|
||||
if (this._starred) {
|
||||
starIcon.setAttribute("starred", "true");
|
||||
starIcon.setAttribute("tooltiptext", browserBundle.getString("starButtonOn.tooltip"));
|
||||
starIcon.setAttribute("tooltiptext", gNavigatorBundle.getString("starButtonOn.tooltip"));
|
||||
}
|
||||
else {
|
||||
starIcon.removeAttribute("starred");
|
||||
starIcon.setAttribute("tooltiptext", browserBundle.getString("starButtonOff.tooltip"));
|
||||
starIcon.setAttribute("tooltiptext", gNavigatorBundle.getString("starButtonOff.tooltip"));
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@
|
|||
<command id="Tools:Downloads" oncommand="BrowserDownloadsUI();"/>
|
||||
<command id="Tools:Addons" oncommand="BrowserOpenAddonsMgr();"/>
|
||||
<command id="Tools:Sanitize"
|
||||
oncommand="Cc[GLUE_CID].getService(Ci.nsIBrowserGlue).sanitize(window || null);"/>
|
||||
oncommand="Cc['@mozilla.org/browser/browserglue;1'].getService(Ci.nsIBrowserGlue).sanitize(window || null);"/>
|
||||
<command id="Tools:PrivateBrowsing" oncommand="gPrivateBrowsingUI.toggleMode();"/>
|
||||
<command id="History:UndoCloseTab" oncommand="undoCloseTab();"/>
|
||||
<command id="History:UndoCloseWindow" oncommand="undoCloseWindow();"/>
|
||||
|
|
|
@ -65,12 +65,7 @@ let Ci = Components.interfaces;
|
|||
let Cu = Components.utils;
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
const nsIWebNavigation = Components.interfaces.nsIWebNavigation;
|
||||
|
||||
const MAX_HISTORY_MENU_ITEMS = 15;
|
||||
|
||||
// We use this once, for Clear Private Data
|
||||
const GLUE_CID = "@mozilla.org/browser/browserglue;1";
|
||||
const nsIWebNavigation = Ci.nsIWebNavigation;
|
||||
|
||||
var gCharsetMenu = null;
|
||||
var gLastBrowserCharset = null;
|
||||
|
@ -198,14 +193,12 @@ function UpdateBackForwardCommands(aWebNavigation) {
|
|||
* Click-and-Hold implementation for the Back and Forward buttons
|
||||
* XXXmano: should this live in toolbarbutton.xml?
|
||||
*/
|
||||
function ClickAndHoldMouseDownCallback(aButton)
|
||||
{
|
||||
function ClickAndHoldMouseDownCallback(aButton) {
|
||||
aButton.open = true;
|
||||
gClickAndHoldTimer = null;
|
||||
}
|
||||
|
||||
function ClickAndHoldMouseDown(aEvent)
|
||||
{
|
||||
function ClickAndHoldMouseDown(aEvent) {
|
||||
/**
|
||||
* 1. Only left click starts the click and hold timer.
|
||||
* 2. Exclude the dropmarker area. This is done by excluding
|
||||
|
@ -223,49 +216,35 @@ function ClickAndHoldMouseDown(aEvent)
|
|||
setTimeout(ClickAndHoldMouseDownCallback, 500, aEvent.currentTarget);
|
||||
}
|
||||
|
||||
function MayStopClickAndHoldTimer(aEvent)
|
||||
{
|
||||
function MayStopClickAndHoldTimer(aEvent) {
|
||||
// Note passing null here is a no-op
|
||||
clearTimeout(gClickAndHoldTimer);
|
||||
}
|
||||
|
||||
function ClickAndHoldStopEvent(aEvent)
|
||||
{
|
||||
function ClickAndHoldStopEvent(aEvent) {
|
||||
if (aEvent.originalTarget.localName != "menuitem" &&
|
||||
aEvent.currentTarget.open)
|
||||
aEvent.stopPropagation();
|
||||
}
|
||||
|
||||
function SetClickAndHoldHandlers()
|
||||
{
|
||||
function _addClickAndHoldListenersOnElement(aElm)
|
||||
{
|
||||
aElm.addEventListener("mousedown",
|
||||
ClickAndHoldMouseDown,
|
||||
false);
|
||||
aElm.addEventListener("mouseup",
|
||||
MayStopClickAndHoldTimer,
|
||||
false);
|
||||
aElm.addEventListener("mouseout",
|
||||
MayStopClickAndHoldTimer,
|
||||
false);
|
||||
|
||||
function SetClickAndHoldHandlers() {
|
||||
function _addClickAndHoldListenersOnElement(aElm) {
|
||||
aElm.addEventListener("mousedown", ClickAndHoldMouseDown, false);
|
||||
aElm.addEventListener("mouseup", MayStopClickAndHoldTimer, false);
|
||||
aElm.addEventListener("mouseout", MayStopClickAndHoldTimer, false);
|
||||
|
||||
// don't propagate onclick and oncommand events after
|
||||
// click-and-hold opened the drop-down menu
|
||||
aElm.addEventListener("command",
|
||||
ClickAndHoldStopEvent,
|
||||
true);
|
||||
aElm.addEventListener("click",
|
||||
ClickAndHoldStopEvent,
|
||||
true);
|
||||
aElm.addEventListener("command", ClickAndHoldStopEvent, true);
|
||||
aElm.addEventListener("click", ClickAndHoldStopEvent, true);
|
||||
}
|
||||
|
||||
// Bug 414797: Clone the dropmarker's menu into both the back and
|
||||
// the forward buttons.
|
||||
var unifiedButton = document.getElementById("unified-back-forward-button");
|
||||
if (unifiedButton && !unifiedButton._clickHandlersAttached) {
|
||||
if (unifiedButton && !unifiedButton._clickHandlersAttached) {
|
||||
var popup = document.getElementById("back-forward-dropmarker")
|
||||
.firstChild.cloneNode(true);
|
||||
.firstChild.cloneNode(true);
|
||||
var backButton = document.getElementById("back-button");
|
||||
backButton.setAttribute("type", "menu-button");
|
||||
backButton.appendChild(popup);
|
||||
|
@ -359,22 +338,21 @@ const gPopupBlockerObserver = {
|
|||
// it.
|
||||
if (!gBrowser.pageReport.reported) {
|
||||
if (gPrefService.getBoolPref("privacy.popups.showBrowserMessage")) {
|
||||
var bundle_browser = document.getElementById("bundle_browser");
|
||||
var brandBundle = document.getElementById("bundle_brand");
|
||||
var brandShortName = brandBundle.getString("brandShortName");
|
||||
var message;
|
||||
var popupCount = gBrowser.pageReport.length;
|
||||
#ifdef XP_WIN
|
||||
var popupButtonText = bundle_browser.getString("popupWarningButton");
|
||||
var popupButtonAccesskey = bundle_browser.getString("popupWarningButton.accesskey");
|
||||
var popupButtonText = gNavigatorBundle.getString("popupWarningButton");
|
||||
var popupButtonAccesskey = gNavigatorBundle.getString("popupWarningButton.accesskey");
|
||||
#else
|
||||
var popupButtonText = bundle_browser.getString("popupWarningButtonUnix");
|
||||
var popupButtonAccesskey = bundle_browser.getString("popupWarningButtonUnix.accesskey");
|
||||
var popupButtonText = gNavigatorBundle.getString("popupWarningButtonUnix");
|
||||
var popupButtonAccesskey = gNavigatorBundle.getString("popupWarningButtonUnix.accesskey");
|
||||
#endif
|
||||
if (popupCount > 1)
|
||||
message = bundle_browser.getFormattedString("popupWarningMultiple", [brandShortName, popupCount]);
|
||||
message = gNavigatorBundle.getFormattedString("popupWarningMultiple", [brandShortName, popupCount]);
|
||||
else
|
||||
message = bundle_browser.getFormattedString("popupWarning", [brandShortName]);
|
||||
message = gNavigatorBundle.getFormattedString("popupWarning", [brandShortName]);
|
||||
|
||||
var notificationBox = gBrowser.getNotificationBox();
|
||||
var notification = notificationBox.getNotificationWithValue("popup-blocked");
|
||||
|
@ -416,7 +394,6 @@ const gPopupBlockerObserver = {
|
|||
|
||||
fillPopupList: function (aEvent)
|
||||
{
|
||||
var bundle_browser = document.getElementById("bundle_browser");
|
||||
// XXXben - rather than using |currentURI| here, which breaks down on multi-framed sites
|
||||
// we should really walk the pageReport and create a list of "allow for <host>"
|
||||
// menuitems for the common subset of hosts present in the report, this will
|
||||
|
@ -431,18 +408,17 @@ const gPopupBlockerObserver = {
|
|||
try {
|
||||
blockedPopupAllowSite.removeAttribute("hidden");
|
||||
|
||||
var pm = Components.classes["@mozilla.org/permissionmanager;1"]
|
||||
.getService(this._kIPM);
|
||||
var pm = Cc["@mozilla.org/permissionmanager;1"].getService(this._kIPM);
|
||||
if (pm.testPermission(uri, "popup") == this._kIPM.ALLOW_ACTION) {
|
||||
// Offer an item to block popups for this site, if a whitelist entry exists
|
||||
// already for it.
|
||||
var blockString = bundle_browser.getFormattedString("popupBlock", [uri.host]);
|
||||
let blockString = gNavigatorBundle.getFormattedString("popupBlock", [uri.host]);
|
||||
blockedPopupAllowSite.setAttribute("label", blockString);
|
||||
blockedPopupAllowSite.setAttribute("block", "true");
|
||||
}
|
||||
else {
|
||||
// Offer an item to allow popups for this site
|
||||
var allowString = bundle_browser.getFormattedString("popupAllow", [uri.host]);
|
||||
let allowString = gNavigatorBundle.getFormattedString("popupAllow", [uri.host]);
|
||||
blockedPopupAllowSite.setAttribute("label", allowString);
|
||||
blockedPopupAllowSite.removeAttribute("block");
|
||||
}
|
||||
|
@ -484,8 +460,8 @@ const gPopupBlockerObserver = {
|
|||
foundUsablePopupURI = true;
|
||||
|
||||
var menuitem = document.createElement("menuitem");
|
||||
var label = bundle_browser.getFormattedString("popupShowPopupPrefix",
|
||||
[popupURIspec]);
|
||||
var label = gNavigatorBundle.getFormattedString("popupShowPopupPrefix",
|
||||
[popupURIspec]);
|
||||
menuitem.setAttribute("label", label);
|
||||
menuitem.setAttribute("popupWindowURI", popupURIspec);
|
||||
menuitem.setAttribute("popupWindowFeatures", pageReport[i].popupWindowFeatures);
|
||||
|
@ -510,9 +486,9 @@ const gPopupBlockerObserver = {
|
|||
var showMessage = gPrefService.getBoolPref("privacy.popups.showBrowserMessage");
|
||||
blockedPopupDontShowMessage.setAttribute("checked", !showMessage);
|
||||
if (aEvent.target.localName == "popup")
|
||||
blockedPopupDontShowMessage.setAttribute("label", bundle_browser.getString("popupWarningDontShowFromMessage"));
|
||||
blockedPopupDontShowMessage.setAttribute("label", gNavigatorBundle.getString("popupWarningDontShowFromMessage"));
|
||||
else
|
||||
blockedPopupDontShowMessage.setAttribute("label", bundle_browser.getString("popupWarningDontShowFromStatusbar"));
|
||||
blockedPopupDontShowMessage.setAttribute("label", gNavigatorBundle.getString("popupWarningDontShowFromStatusbar"));
|
||||
},
|
||||
|
||||
showBlockedPopup: function (aEvent)
|
||||
|
@ -612,7 +588,6 @@ const gXPInstallObserver = {
|
|||
observe: function (aSubject, aTopic, aData)
|
||||
{
|
||||
var brandBundle = document.getElementById("bundle_brand");
|
||||
var browserBundle = document.getElementById("bundle_browser");
|
||||
switch (aTopic) {
|
||||
case "xpinstall-install-blocked":
|
||||
var installInfo = aSubject.QueryInterface(Components.interfaces.nsIXPIInstallInfo);
|
||||
|
@ -628,16 +603,16 @@ const gXPInstallObserver = {
|
|||
if (!gPrefService.getBoolPref("xpinstall.enabled")) {
|
||||
notificationName = "xpinstall-disabled"
|
||||
if (gPrefService.prefIsLocked("xpinstall.enabled")) {
|
||||
messageString = browserBundle.getString("xpinstallDisabledMessageLocked");
|
||||
messageString = gNavigatorBundle.getString("xpinstallDisabledMessageLocked");
|
||||
buttons = [];
|
||||
}
|
||||
else {
|
||||
messageString = browserBundle.getFormattedString("xpinstallDisabledMessage",
|
||||
[brandShortName, host]);
|
||||
messageString = gNavigatorBundle.getFormattedString("xpinstallDisabledMessage",
|
||||
[brandShortName, host]);
|
||||
|
||||
buttons = [{
|
||||
label: browserBundle.getString("xpinstallDisabledButton"),
|
||||
accessKey: browserBundle.getString("xpinstallDisabledButton.accesskey"),
|
||||
label: gNavigatorBundle.getString("xpinstallDisabledButton"),
|
||||
accessKey: gNavigatorBundle.getString("xpinstallDisabledButton.accesskey"),
|
||||
popup: null,
|
||||
callback: function editPrefs() {
|
||||
gPrefService.setBoolPref("xpinstall.enabled", true);
|
||||
|
@ -648,12 +623,12 @@ const gXPInstallObserver = {
|
|||
}
|
||||
else {
|
||||
notificationName = "xpinstall"
|
||||
messageString = browserBundle.getFormattedString("xpinstallPromptWarning",
|
||||
[brandShortName, host]);
|
||||
messageString = gNavigatorBundle.getFormattedString("xpinstallPromptWarning",
|
||||
[brandShortName, host]);
|
||||
|
||||
buttons = [{
|
||||
label: browserBundle.getString("xpinstallPromptAllowButton"),
|
||||
accessKey: browserBundle.getString("xpinstallPromptAllowButton.accesskey"),
|
||||
label: gNavigatorBundle.getString("xpinstallPromptAllowButton"),
|
||||
accessKey: gNavigatorBundle.getString("xpinstallPromptAllowButton.accesskey"),
|
||||
popup: null,
|
||||
callback: function() {
|
||||
var mgr = Components.classes["@mozilla.org/xpinstall/install-manager;1"]
|
||||
|
@ -3169,24 +3144,22 @@ function FillHistoryMenu(aParent) {
|
|||
|
||||
var webNav = getWebNavigation();
|
||||
var sessionHistory = webNav.sessionHistory;
|
||||
var bundle_browser = document.getElementById("bundle_browser");
|
||||
|
||||
var count = sessionHistory.count;
|
||||
var index = sessionHistory.index;
|
||||
var end;
|
||||
|
||||
if (count <= 1) // don't display the popup for a single item
|
||||
return false;
|
||||
|
||||
const MAX_HISTORY_MENU_ITEMS = 15;
|
||||
var index = sessionHistory.index;
|
||||
var half_length = Math.floor(MAX_HISTORY_MENU_ITEMS / 2);
|
||||
var start = Math.max(index - half_length, 0);
|
||||
end = Math.min(start == 0 ? MAX_HISTORY_MENU_ITEMS : index + half_length + 1, count);
|
||||
var end = Math.min(start == 0 ? MAX_HISTORY_MENU_ITEMS : index + half_length + 1, count);
|
||||
if (end == count)
|
||||
start = Math.max(count - MAX_HISTORY_MENU_ITEMS, 0);
|
||||
|
||||
var tooltipBack = bundle_browser.getString("tabHistory.goBack");
|
||||
var tooltipCurrent = bundle_browser.getString("tabHistory.current");
|
||||
var tooltipForward = bundle_browser.getString("tabHistory.goForward");
|
||||
var tooltipBack = gNavigatorBundle.getString("tabHistory.goBack");
|
||||
var tooltipCurrent = gNavigatorBundle.getString("tabHistory.current");
|
||||
var tooltipForward = gNavigatorBundle.getString("tabHistory.goForward");
|
||||
|
||||
for (var j = end - 1; j >= start; j--) {
|
||||
let item = document.createElement("menuitem");
|
||||
|
@ -4423,8 +4396,9 @@ nsBrowserAccess.prototype =
|
|||
if (!window.document.documentElement.getAttribute("chromehidden"))
|
||||
win = window;
|
||||
else {
|
||||
var browserGlue = Cc[GLUE_CID].getService(Ci.nsIBrowserGlue);
|
||||
win = browserGlue.getMostRecentBrowserWindow();
|
||||
win = Cc["@mozilla.org/browser/browserglue;1"]
|
||||
.getService(Ci.nsIBrowserGlue)
|
||||
.getMostRecentBrowserWindow();
|
||||
needToFocusWin = true;
|
||||
}
|
||||
|
||||
|
@ -5474,19 +5448,17 @@ var OfflineApps = {
|
|||
var notificationBox = gBrowser.getNotificationBox(aBrowser);
|
||||
var notification = notificationBox.getNotificationWithValue("offline-app-usage");
|
||||
if (!notification) {
|
||||
var bundle_browser = document.getElementById("bundle_browser");
|
||||
|
||||
var buttons = [{
|
||||
label: bundle_browser.getString("offlineApps.manageUsage"),
|
||||
accessKey: bundle_browser.getString("offlineApps.manageUsageAccessKey"),
|
||||
label: gNavigatorBundle.getString("offlineApps.manageUsage"),
|
||||
accessKey: gNavigatorBundle.getString("offlineApps.manageUsageAccessKey"),
|
||||
callback: OfflineApps.manage
|
||||
}];
|
||||
|
||||
var warnQuota = gPrefService.getIntPref("offline-apps.quota.warn");
|
||||
const priority = notificationBox.PRIORITY_WARNING_MEDIUM;
|
||||
var message = bundle_browser.getFormattedString("offlineApps.usage",
|
||||
[ aURI.host,
|
||||
warnQuota / 1024 ]);
|
||||
var message = gNavigatorBundle.getFormattedString("offlineApps.usage",
|
||||
[ aURI.host,
|
||||
warnQuota / 1024 ]);
|
||||
|
||||
notificationBox.appendNotification(message, "offline-app-usage",
|
||||
"chrome://browser/skin/Info.png",
|
||||
|
@ -5580,33 +5552,31 @@ var OfflineApps = {
|
|||
if (notification) {
|
||||
notification.documents.push(aContentWindow.document);
|
||||
} else {
|
||||
var bundle_browser = document.getElementById("bundle_browser");
|
||||
|
||||
var buttons = [{
|
||||
label: bundle_browser.getString("offlineApps.allow"),
|
||||
accessKey: bundle_browser.getString("offlineApps.allowAccessKey"),
|
||||
label: gNavigatorBundle.getString("offlineApps.allow"),
|
||||
accessKey: gNavigatorBundle.getString("offlineApps.allowAccessKey"),
|
||||
callback: function() {
|
||||
for (var i = 0; i < notification.documents.length; i++) {
|
||||
OfflineApps.allowSite(notification.documents[i]);
|
||||
}
|
||||
}
|
||||
},{
|
||||
label: bundle_browser.getString("offlineApps.never"),
|
||||
accessKey: bundle_browser.getString("offlineApps.neverAccessKey"),
|
||||
label: gNavigatorBundle.getString("offlineApps.never"),
|
||||
accessKey: gNavigatorBundle.getString("offlineApps.neverAccessKey"),
|
||||
callback: function() {
|
||||
for (var i = 0; i < notification.documents.length; i++) {
|
||||
OfflineApps.disallowSite(notification.documents[i]);
|
||||
}
|
||||
}
|
||||
},{
|
||||
label: bundle_browser.getString("offlineApps.notNow"),
|
||||
accessKey: bundle_browser.getString("offlineApps.notNowAccessKey"),
|
||||
label: gNavigatorBundle.getString("offlineApps.notNow"),
|
||||
accessKey: gNavigatorBundle.getString("offlineApps.notNowAccessKey"),
|
||||
callback: function() { /* noop */ }
|
||||
}];
|
||||
|
||||
const priority = notificationBox.PRIORITY_INFO_LOW;
|
||||
var message = bundle_browser.getFormattedString("offlineApps.available",
|
||||
[ host ]);
|
||||
var message = gNavigatorBundle.getFormattedString("offlineApps.available",
|
||||
[ host ]);
|
||||
notification =
|
||||
notificationBox.appendNotification(message, notificationID,
|
||||
"chrome://browser/skin/Info.png",
|
||||
|
@ -6340,21 +6310,17 @@ var gIdentityHandler = {
|
|||
_lastLocation : null,
|
||||
|
||||
// smart getters
|
||||
get _stringBundle () {
|
||||
delete this._stringBundle;
|
||||
return this._stringBundle = document.getElementById("bundle_browser");
|
||||
},
|
||||
get _staticStrings () {
|
||||
delete this._staticStrings;
|
||||
this._staticStrings = {};
|
||||
this._staticStrings[this.IDENTITY_MODE_DOMAIN_VERIFIED] = {
|
||||
encryption_label: this._stringBundle.getString("identity.encrypted")
|
||||
encryption_label: gNavigatorBundle.getString("identity.encrypted")
|
||||
};
|
||||
this._staticStrings[this.IDENTITY_MODE_IDENTIFIED] = {
|
||||
encryption_label: this._stringBundle.getString("identity.encrypted")
|
||||
encryption_label: gNavigatorBundle.getString("identity.encrypted")
|
||||
};
|
||||
this._staticStrings[this.IDENTITY_MODE_UNKNOWN] = {
|
||||
encryption_label: this._stringBundle.getString("identity.unencrypted")
|
||||
encryption_label: gNavigatorBundle.getString("identity.unencrypted")
|
||||
};
|
||||
return this._staticStrings;
|
||||
},
|
||||
|
@ -6400,6 +6366,11 @@ var gIdentityHandler = {
|
|||
delete this._identityIconLabel;
|
||||
return this._identityIconLabel = document.getElementById("identity-icon-label");
|
||||
},
|
||||
get _overrideService () {
|
||||
delete this._overrideService;
|
||||
return this._overrideService = Cc["@mozilla.org/security/certoverride;1"]
|
||||
.getService(Ci.nsICertOverrideService);
|
||||
},
|
||||
|
||||
/**
|
||||
* Rebuild cache of the elements that may or may not exist depending
|
||||
|
@ -6545,15 +6516,10 @@ var gIdentityHandler = {
|
|||
if (lookupHost.indexOf(':') < 0)
|
||||
lookupHost += ":443";
|
||||
|
||||
// Cache the override service the first time we need to check it
|
||||
if (!this._overrideService)
|
||||
this._overrideService = Components.classes["@mozilla.org/security/certoverride;1"]
|
||||
.getService(Components.interfaces.nsICertOverrideService);
|
||||
|
||||
// Verifier is either the CA Org, for a normal cert, or a special string
|
||||
// for certs that are trusted because of a security exception.
|
||||
var tooltip = this._stringBundle.getFormattedString("identity.identified.verifier",
|
||||
[iData.caOrg]);
|
||||
var tooltip = gNavigatorBundle.getFormattedString("identity.identified.verifier",
|
||||
[iData.caOrg]);
|
||||
|
||||
// Check whether this site is a security exception. XPConnect does the right
|
||||
// thing here in terms of converting _lastLocation.port from string to int, but
|
||||
|
@ -6562,21 +6528,21 @@ var gIdentityHandler = {
|
|||
if (this._overrideService.hasMatchingOverride(this._lastLocation.hostname,
|
||||
(this._lastLocation.port || 443),
|
||||
iData.cert, {}, {}))
|
||||
tooltip = this._stringBundle.getString("identity.identified.verified_by_you");
|
||||
tooltip = gNavigatorBundle.getString("identity.identified.verified_by_you");
|
||||
}
|
||||
else if (newMode == this.IDENTITY_MODE_IDENTIFIED) {
|
||||
// If it's identified, then we can populate the dialog with credentials
|
||||
iData = this.getIdentityData();
|
||||
tooltip = this._stringBundle.getFormattedString("identity.identified.verifier",
|
||||
[iData.caOrg]);
|
||||
tooltip = gNavigatorBundle.getFormattedString("identity.identified.verifier",
|
||||
[iData.caOrg]);
|
||||
if (iData.country)
|
||||
icon_label = this._stringBundle.getFormattedString("identity.identified.title_with_country",
|
||||
[iData.subjectOrg, iData.country]);
|
||||
icon_label = gNavigatorBundle.getFormattedString("identity.identified.title_with_country",
|
||||
[iData.subjectOrg, iData.country]);
|
||||
else
|
||||
icon_label = iData.subjectOrg;
|
||||
}
|
||||
else {
|
||||
tooltip = this._stringBundle.getString("identity.unknown.tooltip");
|
||||
tooltip = gNavigatorBundle.getString("identity.unknown.tooltip");
|
||||
icon_label = "";
|
||||
}
|
||||
|
||||
|
@ -6607,7 +6573,7 @@ var gIdentityHandler = {
|
|||
if (newMode == this.IDENTITY_MODE_DOMAIN_VERIFIED) {
|
||||
var iData = this.getIdentityData();
|
||||
var host = this.getEffectiveHost();
|
||||
var owner = this._stringBundle.getString("identity.ownerUnknown2");
|
||||
var owner = gNavigatorBundle.getString("identity.ownerUnknown2");
|
||||
verifier = this._identityBox.tooltipText;
|
||||
supplemental = "";
|
||||
}
|
||||
|
@ -6622,8 +6588,8 @@ var gIdentityHandler = {
|
|||
if (iData.city)
|
||||
supplemental += iData.city + "\n";
|
||||
if (iData.state && iData.country)
|
||||
supplemental += this._stringBundle.getFormattedString("identity.identified.state_and_country",
|
||||
[iData.state, iData.country]);
|
||||
supplemental += gNavigatorBundle.getFormattedString("identity.identified.state_and_country",
|
||||
[iData.state, iData.country]);
|
||||
else if (iData.state) // State only
|
||||
supplemental += iData.state;
|
||||
else if (iData.country) // Country only
|
||||
|
@ -6715,10 +6681,8 @@ let DownloadMonitorPanel = {
|
|||
this._panel = document.getElementById("download-monitor");
|
||||
|
||||
// Cache the status strings
|
||||
let (bundle = document.getElementById("bundle_browser")) {
|
||||
this._activeStr = bundle.getString("activeDownloads");
|
||||
this._pausedStr = bundle.getString("pausedDownloads");
|
||||
}
|
||||
this._activeStr = gNavigatorBundle.getString("activeDownloads");
|
||||
this._pausedStr = gNavigatorBundle.getString("pausedDownloads");
|
||||
|
||||
gDownloadMgr.addListener(this);
|
||||
this._listening = true;
|
||||
|
|
|
@ -1037,8 +1037,7 @@ nsContextMenu.prototype = {
|
|||
|
||||
var brandBundle = document.getElementById("bundle_brand");
|
||||
var app = brandBundle.getString("brandShortName");
|
||||
var bundle_browser = document.getElementById("bundle_browser");
|
||||
var message = bundle_browser.getFormattedString(aBlock ?
|
||||
var message = gNavigatorBundle.getFormattedString(aBlock ?
|
||||
"imageBlockedWarning" : "imageAllowedWarning", [app, uri.host]);
|
||||
|
||||
var notificationBox = this.browser.getNotificationBox();
|
||||
|
@ -1049,8 +1048,8 @@ nsContextMenu.prototype = {
|
|||
else {
|
||||
var self = this;
|
||||
var buttons = [{
|
||||
label: bundle_browser.getString("undo"),
|
||||
accessKey: bundle_browser.getString("undo.accessKey"),
|
||||
label: gNavigatorBundle.getString("undo"),
|
||||
accessKey: gNavigatorBundle.getString("undo.accessKey"),
|
||||
callback: function() { self.toggleImageBlocking(!aBlock); }
|
||||
}];
|
||||
const priority = notificationBox.PRIORITY_WARNING_MEDIUM;
|
||||
|
|
|
@ -81,6 +81,7 @@
|
|||
</commandset>
|
||||
|
||||
<popupset id="mainPopupSet">
|
||||
<tooltip id="aHTMLTooltip" onpopupshowing="return FillInHTMLTooltip(document.tooltipNode);"/>
|
||||
<popup id="contentAreaContextMenu"
|
||||
onpopupshowing="if (event.target != this)
|
||||
return true;
|
||||
|
@ -94,6 +95,6 @@
|
|||
|
||||
<commandset id="editMenuCommands"/>
|
||||
<browser id="web-panels-browser" persist="cachedurl" type="content" flex="1"
|
||||
context="contentAreaContextMenu"
|
||||
context="contentAreaContextMenu" tooltip="aHTMLTooltip"
|
||||
onclick="return window.parent.contentAreaClick(event, true);"/>
|
||||
</page>
|
||||
|
|
|
@ -272,6 +272,7 @@ MOZ_INSURE_EXCLUDE_DIRS = @MOZ_INSURE_EXCLUDE_DIRS@
|
|||
MOZ_NATIVE_NSPR = @MOZ_NATIVE_NSPR@
|
||||
MOZ_NATIVE_NSS = @MOZ_NATIVE_NSS@
|
||||
|
||||
COMPILE_ENVIRONMENT = @COMPILE_ENVIRONMENT@
|
||||
CROSS_COMPILE = @CROSS_COMPILE@
|
||||
|
||||
WCHAR_CFLAGS = @WCHAR_CFLAGS@
|
||||
|
|
|
@ -203,6 +203,7 @@ MOZ_ARG_ENABLE_BOOL(compile-environment,
|
|||
Disable compiler/library checks.],
|
||||
COMPILE_ENVIRONMENT=1,
|
||||
COMPILE_ENVIRONMENT= )
|
||||
AC_SUBST(COMPILE_ENVIRONMENT)
|
||||
|
||||
MOZ_ARG_WITH_STRING(l10n-base,
|
||||
[ --with-l10n-base=DIR path to l10n repositories],
|
||||
|
|
|
@ -2694,11 +2694,9 @@ nsGenericHTMLFormElement::FocusState()
|
|||
// If the window is not active, do not allow the focus to bring the
|
||||
// window to the front. We update the focus controller, but do
|
||||
// nothing else.
|
||||
nsCOMPtr<nsIDocShellTreeItem> dsti = do_GetInterface(doc->GetWindow());
|
||||
if (dsti) {
|
||||
nsCOMPtr<nsIDocShellTreeItem> root;
|
||||
dsti->GetRootTreeItem(getter_AddRefs(root));
|
||||
nsCOMPtr<nsIDOMWindow> rootWindow = do_GetInterface(root);
|
||||
nsPIDOMWindow* win = doc->GetWindow();
|
||||
if (win) {
|
||||
nsCOMPtr<nsIDOMWindow> rootWindow = do_QueryInterface(win->GetPrivateRoot());
|
||||
|
||||
nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
|
||||
if (fm && rootWindow) {
|
||||
|
|
|
@ -95,12 +95,19 @@ _TEST_FILES = \
|
|||
test_playback.html \
|
||||
test_playback_errors.html \
|
||||
test_readyState.html \
|
||||
test_seek.html \
|
||||
test_seek2.html \
|
||||
test_volume.html \
|
||||
use_large_cache.js \
|
||||
$(NULL)
|
||||
|
||||
ifneq ($(OS_ARCH),WINNT)
|
||||
# These tests are disabled on windows until we
|
||||
# figure out the random failures. See bug 475369.
|
||||
_TEST_FILES += \
|
||||
test_seek.html \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
# Ogg sample files
|
||||
_TEST_FILES += \
|
||||
320x240.ogv \
|
||||
|
|
|
@ -55,6 +55,7 @@ _TEST_FILES = \
|
|||
test_getSubStringLength.xhtml \
|
||||
getSubStringLength-helper.svg \
|
||||
test_pathSeg.xhtml \
|
||||
test_pointer-events.xhtml \
|
||||
test_scientific.html \
|
||||
scientific-helper.svg \
|
||||
test_switch.xhtml \
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=500174
|
||||
-->
|
||||
<head>
|
||||
<title>Test Pointer Events</title>
|
||||
<script type="text/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=500174">Mozilla Bug 500174</a>
|
||||
<p id="display"></p>
|
||||
<div id="content">
|
||||
|
||||
<div width="100%" height="1" id="div">
|
||||
</div>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" id="svg">
|
||||
<rect id="bad" width="100%" height="100%" fill="green"/>
|
||||
<circle id="good" cx="50%" cy="50%" r="1" stroke-width="1000" fill="black" pointer-events="all"/>
|
||||
</svg>
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
<![CDATA[
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
function run()
|
||||
{
|
||||
var svgDoc = document.getElementById('svg');
|
||||
var bad = document.getElementById('bad');
|
||||
var good = document.getElementById('good');
|
||||
var elementFromPoint = document.elementFromPoint(50, 50);
|
||||
is(elementFromPoint, good, 'pointer-events="all"');
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
window.addEventListener("load", run, false);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -464,8 +464,7 @@ interface nsIDocShell : nsISupports
|
|||
|
||||
/**
|
||||
* Find out whether the docshell is currently in the middle of a page
|
||||
* transition (after the onunload event has fired, but before the new
|
||||
* document has been set up)
|
||||
* transition. This is set just before the pagehide/unload events fire.
|
||||
*/
|
||||
readonly attribute boolean isInUnload;
|
||||
|
||||
|
|
|
@ -10,23 +10,26 @@ const enteredText2="\u03BE\u03B5\u03C3\u03BA\u03B5\u03C0\u03AC\u03B6\u03C9\u0020
|
|||
var testPage;
|
||||
|
||||
function test() {
|
||||
testPage = Application.activeWindow.open(url("chrome://mochikit/content/browser/docshell/test/browser/test-form_sjis.html"));
|
||||
testPage = Application.activeWindow.open(url("about:blank"));
|
||||
testPage.events.addListener("load", afterOpen);
|
||||
testPage.load(url("chrome://mochikit/content/browser/docshell/test/browser/test-form_sjis.html"));
|
||||
testPage.focus();
|
||||
|
||||
waitForExplicitFinish();
|
||||
setTimeout(afterOpen, 1000);
|
||||
}
|
||||
|
||||
function afterOpen() {
|
||||
testPage.events.removeListener("load", afterOpen);
|
||||
testPage.events.addListener("load", afterChangeCharset);
|
||||
testPage.document.getElementById("testtextarea").value=enteredText1;
|
||||
testPage.document.getElementById("testinput").value=enteredText2;
|
||||
|
||||
/* Force the page encoding to Shift_JIS */
|
||||
SetForcedCharset("Shift_JIS");
|
||||
setTimeout(afterChangeCharset, 3000);
|
||||
}
|
||||
|
||||
function afterChangeCharset() {
|
||||
testPage.events.removeListener("load", afterChangeCharset);
|
||||
is(testPage.document.getElementById("testpar").innerHTML, rightText,
|
||||
"encoding successfully changed");
|
||||
is(testPage.document.getElementById("testtextarea").value, enteredText1,
|
||||
|
|
|
@ -25,15 +25,17 @@ function testContent(text) {
|
|||
}
|
||||
|
||||
function afterOpen() {
|
||||
testPage.events.removeListener("load", afterOpen);
|
||||
testPage.events.addListener("load", afterChangeCharset);
|
||||
/* Test that the content on load is the expected wrong decoding */
|
||||
testContent(wrongText);
|
||||
|
||||
/* Force the page encoding to Shift_JIS */
|
||||
SetForcedCharset("Shift_JIS");
|
||||
setTimeout(afterChangeCharset, 3000);
|
||||
}
|
||||
|
||||
function afterChangeCharset() {
|
||||
testPage.events.removeListener("load", afterChangeCharset);
|
||||
/* test that the content is decoded correctly */
|
||||
testContent(rightText);
|
||||
testPage.close();
|
||||
|
@ -42,9 +44,10 @@ function afterChangeCharset() {
|
|||
|
||||
function test() {
|
||||
var activeWin = Application.activeWindow;
|
||||
testPage = activeWin.open(url("chrome://mochikit/content/browser/docshell/test/browser/test-form_sjis.html"));
|
||||
testPage = activeWin.open(url("about:blank"));
|
||||
testPage.events.addListener("load", afterOpen);
|
||||
testPage.load(url("chrome://mochikit/content/browser/docshell/test/browser/test-form_sjis.html"));
|
||||
testPage.focus();
|
||||
|
||||
waitForExplicitFinish();
|
||||
setTimeout(afterOpen, 1000);
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
document.getElementById("cmd_find").doCommand();
|
||||
ok(!gFindBar.hidden, "failed to open findbar");
|
||||
enterStringIntoFindField("A generic page");
|
||||
ok(TestWindow.getWindow().getSelection().toString().toLowerCase() ==
|
||||
is(TestWindow.getWindow().getSelection().toString().toLowerCase(),
|
||||
"a generic page",
|
||||
"find failed on second page loaded");
|
||||
|
||||
|
@ -101,7 +101,7 @@
|
|||
document.getElementById("cmd_find").doCommand();
|
||||
ok(!gFindBar.hidden, "failed to open findbar");
|
||||
enterStringIntoFindField("find this");
|
||||
ok(TestWindow.getWindow().getSelection().toString().toLowerCase() ==
|
||||
is(TestWindow.getWindow().getSelection().toString().toLowerCase(),
|
||||
"find this",
|
||||
"find failed on page loaded from bfcache");
|
||||
|
||||
|
|
|
@ -975,10 +975,16 @@ nsFocusManager::SetFocusInner(nsIContent* aNewContent, PRInt32 aFlags,
|
|||
return;
|
||||
|
||||
// don't allow focus to be placed in docshells or descendants of docshells
|
||||
// that are being destroyed
|
||||
// that are being destroyed. Also, ensure that the page hasn't been
|
||||
// unloaded. The prevents content from being refocused during an unload event.
|
||||
nsCOMPtr<nsIDocShell> newDocShell = newWindow->GetDocShell();
|
||||
nsCOMPtr<nsIDocShell> docShell = newDocShell;
|
||||
while (docShell) {
|
||||
PRBool inUnload;
|
||||
docShell->GetIsInUnload(&inUnload);
|
||||
if (inUnload)
|
||||
return;
|
||||
|
||||
PRBool beingDestroyed;
|
||||
docShell->IsBeingDestroyed(&beingDestroyed);
|
||||
if (beingDestroyed)
|
||||
|
@ -1630,9 +1636,37 @@ nsFocusManager::RaiseWindow(nsPIDOMWindow* aWindow)
|
|||
{
|
||||
// don't raise windows that are already raised or are in the process of
|
||||
// being lowered
|
||||
if (aWindow == mActiveWindow || aWindow == mWindowBeingLowered)
|
||||
if (!aWindow || aWindow == mActiveWindow || aWindow == mWindowBeingLowered)
|
||||
return;
|
||||
|
||||
#ifdef XP_WIN
|
||||
// Windows would rather we focus the child widget, otherwise, the toplevel
|
||||
// widget will always end up being focused. Fortunately, focusing the child
|
||||
// widget will also have the effect of raising the window this widget is in.
|
||||
// But on other platforms, we can just focus the toplevel widget to raise
|
||||
// the window.
|
||||
nsCOMPtr<nsPIDOMWindow> childWindow;
|
||||
GetFocusedDescendant(aWindow, PR_TRUE, getter_AddRefs(childWindow));
|
||||
if (!childWindow)
|
||||
childWindow = aWindow;
|
||||
|
||||
nsCOMPtr<nsIDocShell> docShell = aWindow->GetDocShell();
|
||||
if (!docShell)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
docShell->GetPresShell(getter_AddRefs(presShell));
|
||||
if (!presShell)
|
||||
return;
|
||||
|
||||
nsIViewManager* vm = presShell->GetViewManager();
|
||||
if (vm) {
|
||||
nsCOMPtr<nsIWidget> widget;
|
||||
vm->GetWidget(getter_AddRefs(widget));
|
||||
if (widget)
|
||||
widget->SetFocus(PR_TRUE);
|
||||
}
|
||||
#else
|
||||
nsCOMPtr<nsIWebNavigation> webnav = do_GetInterface(aWindow);
|
||||
nsCOMPtr<nsIBaseWindow> treeOwnerAsWin = do_QueryInterface(webnav);
|
||||
if (treeOwnerAsWin) {
|
||||
|
@ -1641,6 +1675,7 @@ nsFocusManager::RaiseWindow(nsPIDOMWindow* aWindow)
|
|||
if (widget)
|
||||
widget->SetFocus(PR_TRUE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -242,12 +242,9 @@ nsSelectMoveScrollCommand::DoSelectCommand(const char *aCommandName, nsIDOMWindo
|
|||
selCont->GetCaretEnabled(&caretOn);
|
||||
|
||||
// We allow the caret to be moved with arrow keys on any window for which
|
||||
// the caret is enabled. In particular, this includes caret-browsing mode,
|
||||
// but we refer to this mode again in the test condition for readability.
|
||||
if (caretOn) {
|
||||
// XXXndeakin P3 perhaps this should be cached
|
||||
if (nsContentUtils::GetBoolPref("accessibility.browsewithcaret"))
|
||||
return DoCommandBrowseWithCaretOn(aCommandName, aWindow, selCont);
|
||||
// the caret is enabled. In particular, this includes caret-browsing mode.
|
||||
if (caretOn || nsContentUtils::GetBoolPref("accessibility.browsewithcaret")) {
|
||||
return DoCommandBrowseWithCaretOn(aCommandName, aWindow, selCont);
|
||||
}
|
||||
|
||||
return DoCommandBrowseWithCaretOff(aCommandName, selCont);
|
||||
|
|
|
@ -379,6 +379,15 @@ function startTest()
|
|||
is(t19.selectionEnd, 5, "input focused from tab key selectionEnd");
|
||||
t19.setSelectionRange(0, 0);
|
||||
|
||||
gLastFocusMethod = 0;
|
||||
var selectFired = false;
|
||||
function selectListener() { selectFired = true; }
|
||||
t19.addEventListener("select", selectListener, false);
|
||||
expectFocusShift(function() t19.select(),
|
||||
null, "t" + 19, true, "input.select()");
|
||||
t19.removeEventListener("select", selectListener, false);
|
||||
ok(selectFired, "select event fires for input");
|
||||
|
||||
// mouse clicking
|
||||
gLastFocusMethod = fm.FLAG_BYMOUSE;
|
||||
for (idx = kTabbableSteps; idx >= 1; idx--) {
|
||||
|
|
|
@ -641,16 +641,16 @@ PRBool IsBidiControl(PRUint32 aChar)
|
|||
return (eBidiCat_CC == GetBidiCat(aChar) || ((aChar)&0xfffffe)==LRM_CHAR);
|
||||
}
|
||||
|
||||
PRBool HasRTLChars(nsAString& aString)
|
||||
PRBool HasRTLChars(const nsAString& aString)
|
||||
{
|
||||
// This is used to determine whether to enable bidi if a string has
|
||||
// right-to-left characters. To simplify things, anything that could be a
|
||||
// surrogate or RTL presentation form is covered just by testing >= 0xD800).
|
||||
// It's fine to enable bidi in rare cases where it actually isn't needed.
|
||||
PRInt32 length = aString.Length();
|
||||
for (PRInt32 i = 0; i < length; i++) {
|
||||
if ((UCS2_CHAR_IS_BIDI(aString.CharAt(i)) ) ||
|
||||
((NS_IS_HIGH_SURROGATE(aString.CharAt(i))) &&
|
||||
(++i < length) &&
|
||||
(NS_IS_LOW_SURROGATE(aString.CharAt(i))) &&
|
||||
(UTF32_CHAR_IS_BIDI(SURROGATE_TO_UCS4(aString.CharAt(i-1),
|
||||
aString.CharAt(i)))))) {
|
||||
PRUnichar ch = aString.CharAt(i);
|
||||
if (ch >= 0xD800 || IS_IN_BMP_RTL_BLOCK(ch)) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -214,7 +214,7 @@ typedef enum nsCharType nsCharType;
|
|||
* Give an nsString.
|
||||
* @return PR_TRUE if the string contains right-to-left characters
|
||||
*/
|
||||
PRBool HasRTLChars(nsAString& aString);
|
||||
PRBool HasRTLChars(const nsAString& aString);
|
||||
|
||||
// --------------------------------------------------
|
||||
// IBMBIDI
|
||||
|
|
|
@ -350,6 +350,14 @@ check::
|
|||
$(srcdir)/trace-test.js
|
||||
endif
|
||||
|
||||
DIST_GARBAGE = config.cache config.log config.status \
|
||||
config/myrules.mk config/myconfig.mk \
|
||||
unallmakefiles js-config js-config.h mozilla-config.h
|
||||
|
||||
distclean::
|
||||
cat unallmakefiles | $(XARGS) rm -f
|
||||
rm -f $(DIST_GARBAGE)
|
||||
|
||||
# our build system doesn't handle subdir srcs very gracefully today
|
||||
export::
|
||||
mkdir -p nanojit
|
||||
|
|
|
@ -2585,7 +2585,7 @@ JS_SetGCParameter(JSRuntime *rt, JSGCParamKey key, uint32 value)
|
|||
default:
|
||||
JS_ASSERT(key == JSGC_TRIGGER_FACTOR);
|
||||
JS_ASSERT(value >= 100);
|
||||
rt->SetGCTriggerFactor(value);
|
||||
rt->gcTriggerFactor = value;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -369,16 +369,15 @@ struct JSRuntime {
|
|||
JSDHashTable gcRootsHash;
|
||||
JSDHashTable *gcLocksHash;
|
||||
jsrefcount gcKeepAtoms;
|
||||
size_t gcBytes;
|
||||
size_t gcLastBytes;
|
||||
size_t gcMaxBytes;
|
||||
size_t gcMaxMallocBytes;
|
||||
uint32 gcBytes;
|
||||
uint32 gcLastBytes;
|
||||
uint32 gcMaxBytes;
|
||||
uint32 gcMaxMallocBytes;
|
||||
uint32 gcEmptyArenaPoolLifespan;
|
||||
uint32 gcLevel;
|
||||
uint32 gcNumber;
|
||||
JSTracer *gcMarkingTracer;
|
||||
uint32 gcTriggerFactor;
|
||||
size_t gcTriggerBytes;
|
||||
volatile JSBool gcIsNeeded;
|
||||
|
||||
/*
|
||||
|
@ -683,9 +682,6 @@ struct JSRuntime {
|
|||
JSFunctionMeter functionMeter;
|
||||
char lastScriptFilename[1024];
|
||||
#endif
|
||||
|
||||
void SetGCTriggerFactor(uint32 factor);
|
||||
void SetGCLastBytes(size_t lastBytes);
|
||||
};
|
||||
|
||||
/* Common macros to access thread-local caches in JSThread or JSRuntime. */
|
||||
|
|
|
@ -82,6 +82,10 @@
|
|||
#include "jsxml.h"
|
||||
#endif
|
||||
|
||||
#ifdef INCLUDE_MOZILLA_DTRACE
|
||||
#include "jsdtracef.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Check if posix_memalign is available.
|
||||
*/
|
||||
|
@ -1304,13 +1308,13 @@ js_InitGC(JSRuntime *rt, uint32 maxbytes)
|
|||
* By default the trigger factor gets maximum possible value. This
|
||||
* means that GC will not be triggered by growth of GC memory (gcBytes).
|
||||
*/
|
||||
rt->SetGCTriggerFactor((uint32) -1);
|
||||
rt->gcTriggerFactor = (uint32) -1;
|
||||
|
||||
/*
|
||||
* The assigned value prevents GC from running when GC memory is too low
|
||||
* (during JS engine start).
|
||||
*/
|
||||
rt->SetGCLastBytes(8192);
|
||||
rt->gcLastBytes = 8192;
|
||||
|
||||
METER(memset(&rt->gcStats, 0, sizeof rt->gcStats));
|
||||
return JS_TRUE;
|
||||
|
@ -1796,22 +1800,6 @@ EnsureLocalFreeList(JSContext *cx)
|
|||
|
||||
#endif
|
||||
|
||||
void
|
||||
JSRuntime::SetGCTriggerFactor(uint32 factor)
|
||||
{
|
||||
JS_ASSERT(factor >= 100);
|
||||
|
||||
gcTriggerFactor = factor;
|
||||
SetGCLastBytes(gcLastBytes);
|
||||
}
|
||||
|
||||
void
|
||||
JSRuntime::SetGCLastBytes(size_t lastBytes)
|
||||
{
|
||||
gcLastBytes = lastBytes;
|
||||
gcTriggerBytes = lastBytes * gcTriggerFactor / 100;
|
||||
}
|
||||
|
||||
static JS_INLINE bool
|
||||
IsGCThresholdReached(JSRuntime *rt)
|
||||
{
|
||||
|
@ -1826,7 +1814,7 @@ IsGCThresholdReached(JSRuntime *rt)
|
|||
* the gcBytes value is close to zero at the JS engine start.
|
||||
*/
|
||||
return rt->gcMallocBytes >= rt->gcMaxMallocBytes ||
|
||||
rt->gcBytes >= rt->gcTriggerBytes;
|
||||
rt->gcBytes / rt->gcTriggerFactor >= rt->gcLastBytes / 100;
|
||||
}
|
||||
|
||||
void *
|
||||
|
@ -3858,7 +3846,7 @@ out:
|
|||
goto restart;
|
||||
}
|
||||
|
||||
rt->SetGCLastBytes(rt->gcBytes);
|
||||
rt->gcLastBytes = rt->gcBytes;
|
||||
done_running:
|
||||
rt->gcLevel = 0;
|
||||
rt->gcRunning = JS_FALSE;
|
||||
|
|
|
@ -2674,7 +2674,8 @@ js_XDRBlockObject(JSXDRState *xdr, JSObject **objp)
|
|||
if (xdr->mode == JSXDR_DECODE) {
|
||||
if (!js_DefineNativeProperty(cx, obj, ATOM_TO_JSID(atom),
|
||||
JSVAL_VOID, NULL, NULL,
|
||||
JSPROP_ENUMERATE | JSPROP_PERMANENT,
|
||||
JSPROP_ENUMERATE | JSPROP_PERMANENT |
|
||||
JSPROP_SHARED,
|
||||
SPROP_HAS_SHORTID, shortid, NULL)) {
|
||||
ok = JS_FALSE;
|
||||
break;
|
||||
|
|
|
@ -643,9 +643,9 @@ assemble(istream &in,
|
|||
map<string,LIns*> labels;
|
||||
map<string,pair<LOpcode,size_t> > op_map;
|
||||
|
||||
#define OPDEF(op, number, args, repkind, isStmt) \
|
||||
#define OPDEF(op, number, args, repkind) \
|
||||
op_map[#op] = make_pair(LIR_##op, args);
|
||||
#define OPDEF64(op, number, args, repkind, isStmt) \
|
||||
#define OPDEF64(op, number, args, repkind) \
|
||||
op_map[#op] = make_pair(LIR_##op, args);
|
||||
#include "nanojit/LIRopcode.tbl"
|
||||
#undef OPDEF
|
||||
|
|
|
@ -85,10 +85,10 @@ namespace nanojit
|
|||
|
||||
/* Opcodes must be strictly increasing without holes. */
|
||||
uint32_t count = 0;
|
||||
#define OPDEF(op, number, operands, repkind, isStmt) \
|
||||
#define OPDEF(op, number, operands, repkind) \
|
||||
NanoAssertMsg(LIR_##op == count++, "misnumbered opcode");
|
||||
#define OPDEF64(op, number, operands, repkind, isStmt) \
|
||||
OPDEF(op, number, operands, repkind, isStmt)
|
||||
#define OPDEF64(op, number, operands, repkind) \
|
||||
OPDEF(op, number, operands, repkind)
|
||||
#include "LIRopcode.tbl"
|
||||
#undef OPDEF
|
||||
#undef OPDEF64
|
||||
|
|
|
@ -52,9 +52,9 @@ namespace nanojit
|
|||
#ifdef FEATURE_NANOJIT
|
||||
|
||||
const uint8_t operandCount[] = {
|
||||
#define OPDEF(op, number, operands, repkind, isStmt) \
|
||||
#define OPDEF(op, number, operands, repkind) \
|
||||
operands,
|
||||
#define OPDEF64(op, number, operands, repkind, isStmt) \
|
||||
#define OPDEF64(op, number, operands, repkind) \
|
||||
operands,
|
||||
#include "LIRopcode.tbl"
|
||||
#undef OPDEF
|
||||
|
@ -62,47 +62,35 @@ namespace nanojit
|
|||
0
|
||||
};
|
||||
|
||||
const uint8_t repKind[] = {
|
||||
#define OPDEF(op, number, operands, repkind, isStmt) \
|
||||
LRK_##repkind,
|
||||
#define OPDEF64(op, number, operands, repkind, isStmt) \
|
||||
const uint8_t repKinds[] = {
|
||||
#define OPDEF(op, number, operands, repkind) \
|
||||
LRK_##repkind,
|
||||
#define OPDEF64(op, number, operands, repkind) \
|
||||
OPDEF(op, number, operands, repkind)
|
||||
#include "LIRopcode.tbl"
|
||||
#undef OPDEF
|
||||
#undef OPDEF64
|
||||
0
|
||||
};
|
||||
|
||||
const uint8_t insSize[] = {
|
||||
#define OPDEF(op, number, operands, repkind, isStmt) \
|
||||
sizeof(LIns##repkind),
|
||||
#define OPDEF64(op, number, operands, repkind, isStmt) \
|
||||
sizeof(LIns##repkind),
|
||||
const uint8_t insSizes[] = {
|
||||
#define OPDEF(op, number, operands, repkind) \
|
||||
sizeof(LIns##repkind),
|
||||
#define OPDEF64(op, number, operands, repkind) \
|
||||
OPDEF(op, number, operands, repkind)
|
||||
#include "LIRopcode.tbl"
|
||||
#undef OPDEF
|
||||
#undef OPDEF64
|
||||
0
|
||||
};
|
||||
|
||||
// This isn't called 'isStmt' because there's a function of that name.
|
||||
const uint8_t isStmtArray[] = {
|
||||
#define OPDEF(op, number, operands, repkind, isStmt) \
|
||||
isStmt,
|
||||
#define OPDEF64(op, number, operands, repkind, isStmt) \
|
||||
isStmt,
|
||||
#include "LIRopcode.tbl"
|
||||
#undef OPDEF
|
||||
#undef OPDEF64
|
||||
0
|
||||
};
|
||||
0
|
||||
};
|
||||
|
||||
// LIR verbose specific
|
||||
#ifdef NJ_VERBOSE
|
||||
|
||||
const char* lirNames[] = {
|
||||
#define OPDEF(op, number, operands, repkind, isStmt) \
|
||||
#define OPDEF(op, number, operands, repkind) \
|
||||
#op,
|
||||
#define OPDEF64(op, number, operands, repkind, isStmt) \
|
||||
#define OPDEF64(op, number, operands, repkind) \
|
||||
#op,
|
||||
#include "LIRopcode.tbl"
|
||||
#undef OPDEF
|
||||
|
@ -388,7 +376,7 @@ namespace nanojit
|
|||
switch (iop)
|
||||
{
|
||||
default:
|
||||
i -= insSize[((LInsp)i)->opcode()];
|
||||
i -= insSizes[((LInsp)i)->opcode()];
|
||||
break;
|
||||
|
||||
#if defined NANOJIT_64BIT
|
||||
|
@ -439,53 +427,53 @@ namespace nanojit
|
|||
}
|
||||
|
||||
bool LIns::isLInsOp0() const {
|
||||
NanoAssert(LRK_None != repKind[opcode()]);
|
||||
return LRK_Op0 == repKind[opcode()];
|
||||
NanoAssert(LRK_None != repKinds[opcode()]);
|
||||
return LRK_Op0 == repKinds[opcode()];
|
||||
}
|
||||
|
||||
bool LIns::isLInsOp1() const {
|
||||
NanoAssert(LRK_None != repKind[opcode()]);
|
||||
return LRK_Op1 == repKind[opcode()];
|
||||
NanoAssert(LRK_None != repKinds[opcode()]);
|
||||
return LRK_Op1 == repKinds[opcode()];
|
||||
}
|
||||
|
||||
bool LIns::isLInsOp2() const {
|
||||
NanoAssert(LRK_None != repKind[opcode()]);
|
||||
return LRK_Op2 == repKind[opcode()];
|
||||
NanoAssert(LRK_None != repKinds[opcode()]);
|
||||
return LRK_Op2 == repKinds[opcode()];
|
||||
}
|
||||
|
||||
bool LIns::isLInsLd() const {
|
||||
NanoAssert(LRK_None != repKind[opcode()]);
|
||||
return LRK_Ld == repKind[opcode()];
|
||||
NanoAssert(LRK_None != repKinds[opcode()]);
|
||||
return LRK_Ld == repKinds[opcode()];
|
||||
}
|
||||
|
||||
bool LIns::isLInsSti() const {
|
||||
NanoAssert(LRK_None != repKind[opcode()]);
|
||||
return LRK_Sti == repKind[opcode()];
|
||||
NanoAssert(LRK_None != repKinds[opcode()]);
|
||||
return LRK_Sti == repKinds[opcode()];
|
||||
}
|
||||
|
||||
bool LIns::isLInsSk() const {
|
||||
NanoAssert(LRK_None != repKind[opcode()]);
|
||||
return LRK_Sk == repKind[opcode()];
|
||||
NanoAssert(LRK_None != repKinds[opcode()]);
|
||||
return LRK_Sk == repKinds[opcode()];
|
||||
}
|
||||
|
||||
bool LIns::isLInsC() const {
|
||||
NanoAssert(LRK_None != repKind[opcode()]);
|
||||
return LRK_C == repKind[opcode()];
|
||||
NanoAssert(LRK_None != repKinds[opcode()]);
|
||||
return LRK_C == repKinds[opcode()];
|
||||
}
|
||||
|
||||
bool LIns::isLInsP() const {
|
||||
NanoAssert(LRK_None != repKind[opcode()]);
|
||||
return LRK_P == repKind[opcode()];
|
||||
NanoAssert(LRK_None != repKinds[opcode()]);
|
||||
return LRK_P == repKinds[opcode()];
|
||||
}
|
||||
|
||||
bool LIns::isLInsI() const {
|
||||
NanoAssert(LRK_None != repKind[opcode()]);
|
||||
return LRK_I == repKind[opcode()];
|
||||
NanoAssert(LRK_None != repKinds[opcode()]);
|
||||
return LRK_I == repKinds[opcode()];
|
||||
}
|
||||
|
||||
bool LIns::isLInsI64() const {
|
||||
NanoAssert(LRK_None != repKind[opcode()]);
|
||||
return LRK_I64 == repKind[opcode()];
|
||||
NanoAssert(LRK_None != repKinds[opcode()]);
|
||||
return LRK_I64 == repKinds[opcode()];
|
||||
}
|
||||
|
||||
bool LIns::isCmp() const {
|
||||
|
@ -532,11 +520,6 @@ namespace nanojit
|
|||
return nanojit::isCseOpcode(opcode()) || (isCall() && callInfo()->_cse);
|
||||
}
|
||||
|
||||
bool LIns::isStmt()
|
||||
{
|
||||
return 1 == isStmtArray[opcode()];
|
||||
}
|
||||
|
||||
void LIns::setTarget(LInsp label)
|
||||
{
|
||||
NanoAssert(label && label->isop(LIR_label));
|
||||
|
|
|
@ -59,9 +59,9 @@ namespace nanojit
|
|||
// flags; upper bits reserved
|
||||
LIR64 = 0x40, // result is double or quad
|
||||
|
||||
#define OPDEF(op, number, args, repkind, isStmt) \
|
||||
#define OPDEF(op, number, args, repkind) \
|
||||
LIR_##op = (number),
|
||||
#define OPDEF64(op, number, args, repkind, isStmt) \
|
||||
#define OPDEF64(op, number, args, repkind) \
|
||||
LIR_##op = ((number) | LIR64),
|
||||
#include "LIRopcode.tbl"
|
||||
LIR_sentinel
|
||||
|
@ -680,7 +680,20 @@ namespace nanojit
|
|||
bool isBranch() const {
|
||||
return isop(LIR_jt) || isop(LIR_jf) || isop(LIR_j);
|
||||
}
|
||||
bool isStmt();
|
||||
|
||||
// Return true if removal of 'ins' from a LIR fragment could
|
||||
// possibly change the behaviour of that fragment, even if any
|
||||
// value computed by 'ins' is not used later in the fragment.
|
||||
// In other words, can 'ins' possible alter control flow or memory?
|
||||
// Note, this assumes that loads will never fault and hence cannot
|
||||
// affect the control flow.
|
||||
bool isStmt() {
|
||||
return isGuard() || isBranch() ||
|
||||
(isCall() && !isCse()) ||
|
||||
isStore() ||
|
||||
isop(LIR_loop) || isop(LIR_label) || isop(LIR_live) ||
|
||||
isRet();
|
||||
}
|
||||
|
||||
void setTarget(LIns* t);
|
||||
LIns* getTarget();
|
||||
|
|
|
@ -39,8 +39,8 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
* Definitions of LIR opcodes. If you need to allocate an opcode, claim one
|
||||
* starting with "__".
|
||||
* Definitions of LIR opcodes. If you need to allocate an opcode, look
|
||||
* for a name of the form unused* and claim it.
|
||||
*
|
||||
* Includers must define OPDEF and OPDEF64 macros of the following forms:
|
||||
*
|
||||
|
@ -60,12 +60,6 @@
|
|||
* that it needs changing if the opcode becomes used.
|
||||
* repkind Indicates how the instruction is represented in memory; XYZ
|
||||
* corresponds to LInsXYZ and LRK_XYZ.
|
||||
* isStmt If 1, the removal of the instruction from a LIR fragment could
|
||||
* change the behaviour of that fragment, even if any value
|
||||
* computed by the instruction is not used later in the fragment.
|
||||
* In other words, can the instruction possibly alter control
|
||||
* flow or memory? Note, we assume that loads will never fault
|
||||
* and hence cannot affect the control flow.
|
||||
*
|
||||
* This file is best viewed with 128 columns:
|
||||
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678
|
||||
|
@ -74,36 +68,36 @@
|
|||
/* op val name operands */
|
||||
|
||||
/* special operations (must be 0..N) */
|
||||
OPDEF(start, 0, 0, Op0, 0) // start of a fragment
|
||||
OPDEF(__1, 1,-1, None, 0)
|
||||
OPDEF(skip, 2, 1, Sk, 0) // holds blobs ("payloads") of data; also links pages
|
||||
OPDEF(__3, 3,-1, None, 0)
|
||||
OPDEF(__4, 4,-1, None, 0)
|
||||
OPDEF(__5, 5,-1, None, 0)
|
||||
OPDEF(__6, 6,-1, None, 0)
|
||||
OPDEF(start, 0, 0, Op0) // start of a fragment
|
||||
OPDEF(unused1, 1,-1, None)
|
||||
OPDEF(skip, 2, 1, Sk) // holds blobs ("payloads") of data; also links pages
|
||||
OPDEF(unused3, 3,-1, None)
|
||||
OPDEF(unused4, 4,-1, None)
|
||||
OPDEF(unused5, 5,-1, None)
|
||||
OPDEF(unused6, 6,-1, None)
|
||||
|
||||
/* non-pure operations */
|
||||
OPDEF(addp, 7, 2, Op2, 0) // integer addition for temporary pointer calculations
|
||||
OPDEF(param, 8, 0, P, 0) // load a parameter
|
||||
OPDEF(__9, 9,-1, None, 0)
|
||||
OPDEF(ld, 10, 2, Ld, 0) // 32-bit load
|
||||
OPDEF(alloc, 11, 0, I, 0) // alloca some stack space
|
||||
OPDEF(sti, 12, 2, Sti, 1) // 32-bit store
|
||||
OPDEF(ret, 13, 1, Op1, 1) // return a word-sized value
|
||||
OPDEF(live, 14, 1, Op1, 1) // extend live range of reference
|
||||
OPDEF(__15, 15, 0, C, 0)
|
||||
OPDEF(call, 16, 0, C, 1) // subroutine call returning a 32-bit value
|
||||
OPDEF(addp, 7, 2, Op2) // integer addition for temporary pointer calculations
|
||||
OPDEF(param, 8, 0, P) // load a parameter
|
||||
OPDEF(unused9, 9,-1, None)
|
||||
OPDEF(ld, 10, 1, Ld) // 32-bit load
|
||||
OPDEF(alloc, 11, 0, I) // alloca some stack space
|
||||
OPDEF(sti, 12, 2, Sti) // 32-bit store
|
||||
OPDEF(ret, 13, 1, Op1) // return a word-sized value
|
||||
OPDEF(live, 14, 1, Op1) // extend live range of reference
|
||||
OPDEF(unused15, 15, 0, C)
|
||||
OPDEF(call, 16, 0, C) // subroutine call returning a 32-bit value
|
||||
|
||||
/* guards */
|
||||
OPDEF(loop, 17, 0, Op2, 1) // loop fragment
|
||||
OPDEF(x, 18, 0, Op2, 1) // exit always
|
||||
OPDEF(loop, 17, 0, Op2) // loop fragment
|
||||
OPDEF(x, 18, 0, Op2) // exit always
|
||||
|
||||
/* branches */
|
||||
OPDEF(j, 19, 0, Op2, 1) // jump always
|
||||
OPDEF(jt, 20, 1, Op2, 1) // jump if true
|
||||
OPDEF(jf, 21, 1, Op2, 1) // jump if false
|
||||
OPDEF(label, 22, 0, Op0, 1) // a jump target (no machine code is emitted for this)
|
||||
OPDEF(ji, 23,-1, None, 0) // indirect jump (currently not implemented)
|
||||
OPDEF(j, 19, 0, Op2) // jump always
|
||||
OPDEF(jt, 20, 1, Op2) // jump if true
|
||||
OPDEF(jf, 21, 1, Op2) // jump if false
|
||||
OPDEF(label, 22, 0, Op0) // a jump target (no machine code is emitted for this)
|
||||
OPDEF(ji, 23,-1, None) // indirect jump (currently not implemented)
|
||||
|
||||
/* operators */
|
||||
|
||||
|
@ -112,12 +106,12 @@ OPDEF(ji, 23,-1, None, 0) // indirect jump (currently not implemented)
|
|||
* common-subexpression-elimination detection code.
|
||||
*/
|
||||
|
||||
OPDEF(int, 24, 0, I, 0) // constant 32-bit integer
|
||||
OPDEF(cmov, 25, 2, Op2, 0) // conditional move (op1=cond, op2=LIR_2(iftrue,iffalse))
|
||||
OPDEF(int, 24, 0, I) // constant 32-bit integer
|
||||
OPDEF(cmov, 25, 2, Op2) // conditional move (op1=cond, op2=LIR_2(iftrue,iffalse))
|
||||
#if defined(NANOJIT_64BIT)
|
||||
OPDEF(callh, 26,-1, None, 0) // unused on 64-bit machines
|
||||
OPDEF(callh, 26,-1, None) // unused on 64-bit machines
|
||||
#else
|
||||
OPDEF(callh, 26, 1, Op1, 0) // get the high 32 bits of a call returning a 64-bit value
|
||||
OPDEF(callh, 26, 1, Op1) // get the high 32 bits of a call returning a 64-bit value
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -129,44 +123,44 @@ OPDEF(callh, 26, 1, Op1, 0) // get the high 32 bits of a call returning a 64
|
|||
* with 3. NB: These opcodes must remain continuous so that comparison-opcode
|
||||
* detection works correctly.
|
||||
*/
|
||||
OPDEF(feq, 27, 2, Op2, 0) // floating-point equality
|
||||
OPDEF(flt, 28, 2, Op2, 0) // floating-point less-than
|
||||
OPDEF(fgt, 29, 2, Op2, 0) // floating-point greater-than
|
||||
OPDEF(fle, 30, 2, Op2, 0) // floating-point less-than-or-equal
|
||||
OPDEF(fge, 31, 2, Op2, 0) // floating-point greater-than-or-equal
|
||||
OPDEF(feq, 27, 2, Op2) // floating-point equality
|
||||
OPDEF(flt, 28, 2, Op2) // floating-point less-than
|
||||
OPDEF(fgt, 29, 2, Op2) // floating-point greater-than
|
||||
OPDEF(fle, 30, 2, Op2) // floating-point less-than-or-equal
|
||||
OPDEF(fge, 31, 2, Op2) // floating-point greater-than-or-equal
|
||||
|
||||
OPDEF(ldcb, 32, 2, Ld, 0) // non-volatile 8-bit load
|
||||
OPDEF(ldcs, 33, 2, Ld, 0) // non-volatile 16-bit load
|
||||
OPDEF(ldc, 34, 2, Ld, 0) // non-volatile 32-bit load
|
||||
OPDEF(ldcb, 32, 1, Ld) // non-volatile 8-bit load
|
||||
OPDEF(ldcs, 33, 1, Ld) // non-volatile 16-bit load
|
||||
OPDEF(ldc, 34, 1, Ld) // non-volatile 32-bit load
|
||||
|
||||
OPDEF(neg, 35, 1, Op1, 0) // integer negation
|
||||
OPDEF(add, 36, 2, Op2, 0) // integer addition
|
||||
OPDEF(sub, 37, 2, Op2, 0) // integer subtraction
|
||||
OPDEF(mul, 38, 2, Op2, 0) // integer multiplication
|
||||
OPDEF(div, 39, 2, Op2, 0) // integer division
|
||||
OPDEF(mod, 40, 1, Op1, 0) // hack: get the modulus from a LIR_div result, for x86 only
|
||||
OPDEF(neg, 35, 1, Op1) // integer negation
|
||||
OPDEF(add, 36, 2, Op2) // integer addition
|
||||
OPDEF(sub, 37, 2, Op2) // integer subtraction
|
||||
OPDEF(mul, 38, 2, Op2) // integer multiplication
|
||||
OPDEF(div, 39, 2, Op2) // integer division
|
||||
OPDEF(mod, 40, 1, Op1) // hack: get the modulus from a LIR_div result, for x86 only
|
||||
|
||||
OPDEF(and, 41, 2, Op2, 0) // 32-bit bitwise AND
|
||||
OPDEF(or, 42, 2, Op2, 0) // 32-bit bitwise OR
|
||||
OPDEF(xor, 43, 2, Op2, 0) // 32-bit bitwise XOR
|
||||
OPDEF(not, 44, 1, Op1, 0) // 32-bit bitwise NOT
|
||||
OPDEF(lsh, 45, 2, Op2, 0) // 32-bit left shift
|
||||
OPDEF(rsh, 46, 2, Op2, 0) // 32-bit right shift with sign-extend (>>)
|
||||
OPDEF(ush, 47, 2, Op2, 0) // 32-bit unsigned right shift (>>>)
|
||||
OPDEF(and, 41, 2, Op2) // 32-bit bitwise AND
|
||||
OPDEF(or, 42, 2, Op2) // 32-bit bitwise OR
|
||||
OPDEF(xor, 43, 2, Op2) // 32-bit bitwise XOR
|
||||
OPDEF(not, 44, 1, Op1) // 32-bit bitwise NOT
|
||||
OPDEF(lsh, 45, 2, Op2) // 32-bit left shift
|
||||
OPDEF(rsh, 46, 2, Op2) // 32-bit right shift with sign-extend (>>)
|
||||
OPDEF(ush, 47, 2, Op2) // 32-bit unsigned right shift (>>>)
|
||||
|
||||
// conditional guards, op^1 to complement. Only things that are
|
||||
// isCond() can be passed to these.
|
||||
OPDEF(xt, 48, 1, Op2, 1) // exit if true (0x30 0011 0000)
|
||||
OPDEF(xf, 49, 1, Op2, 1) // exit if false (0x31 0011 0001)
|
||||
OPDEF(xt, 48, 1, Op2) // exit if true (0x30 0011 0000)
|
||||
OPDEF(xf, 49, 1, Op2) // exit if false (0x31 0011 0001)
|
||||
|
||||
OPDEF(qlo, 50, 1, Op1, 0) // get the low 32 bits of a 64-bit value
|
||||
OPDEF(qhi, 51, 1, Op1, 0) // get the high 32 bits of a 64-bit value
|
||||
OPDEF(qlo, 50, 1, Op1) // get the low 32 bits of a 64-bit value
|
||||
OPDEF(qhi, 51, 1, Op1) // get the high 32 bits of a 64-bit value
|
||||
|
||||
OPDEF(__52, 52,-1, None, 0)
|
||||
OPDEF(unused52, 52,-1, None)
|
||||
|
||||
OPDEF(ov, 53, 1, Op1, 0) // test for overflow; value must have just been computed
|
||||
OPDEF(ov, 53, 1, Op1) // test for overflow; value must have just been computed
|
||||
|
||||
OPDEF(__53, 54,-1, None, 0)
|
||||
OPDEF(unused53, 54,-1, None)
|
||||
|
||||
// Integer (all sizes) relational operators. (op ^ 1) is the op which flips the
|
||||
// left and right sides of the comparison, so (lt ^ 1) == gt, or the operator
|
||||
|
@ -175,96 +169,96 @@ OPDEF(__53, 54,-1, None, 0)
|
|||
// with 3. 'u' prefix indicates the unsigned integer variant.
|
||||
// NB: These opcodes must remain continuous so that comparison-opcode detection
|
||||
// works correctly.
|
||||
OPDEF(eq, 55, 2, Op2, 0) // integer equality
|
||||
OPDEF(lt, 56, 2, Op2, 0) // signed integer less-than (0x38 0011 1000)
|
||||
OPDEF(gt, 57, 2, Op2, 0) // signed integer greater-than (0x39 0011 1001)
|
||||
OPDEF(le, 58, 2, Op2, 0) // signed integer less-than-or-equal (0x3A 0011 1010)
|
||||
OPDEF(ge, 59, 2, Op2, 0) // signed integer greater-than-or-equal (0x3B 0011 1011)
|
||||
OPDEF(ult, 60, 2, Op2, 0) // unsigned integer less-than (0x3C 0011 1100)
|
||||
OPDEF(ugt, 61, 2, Op2, 0) // unsigned integer greater-than (0x3D 0011 1101)
|
||||
OPDEF(ule, 62, 2, Op2, 0) // unsigned integer less-than-or-equal (0x3E 0011 1110)
|
||||
OPDEF(uge, 63, 2, Op2, 0) // unsigned integer greater-than-or-equal (0x3F 0011 1111)
|
||||
OPDEF(eq, 55, 2, Op2) // integer equality
|
||||
OPDEF(lt, 56, 2, Op2) // signed integer less-than (0x38 0011 1000)
|
||||
OPDEF(gt, 57, 2, Op2) // signed integer greater-than (0x39 0011 1001)
|
||||
OPDEF(le, 58, 2, Op2) // signed integer less-than-or-equal (0x3A 0011 1010)
|
||||
OPDEF(ge, 59, 2, Op2) // signed integer greater-than-or-equal (0x3B 0011 1011)
|
||||
OPDEF(ult, 60, 2, Op2) // unsigned integer less-than (0x3C 0011 1100)
|
||||
OPDEF(ugt, 61, 2, Op2) // unsigned integer greater-than (0x3D 0011 1101)
|
||||
OPDEF(ule, 62, 2, Op2) // unsigned integer less-than-or-equal (0x3E 0011 1110)
|
||||
OPDEF(uge, 63, 2, Op2) // unsigned integer greater-than-or-equal (0x3F 0011 1111)
|
||||
|
||||
OPDEF64(2, 0, 2, Op2, 0) // wraps a pair of refs, for LIR_cmov or LIR_qcmov
|
||||
OPDEF64(file, 1, 2, Op1, 0) // source filename for debug symbols
|
||||
OPDEF64(line, 2, 2, Op1, 0) // source line number for debug symbols
|
||||
OPDEF64(xbarrier,3, 1, Op2, 1) // memory barrier; doesn't exit, but flushes all values to the stack
|
||||
OPDEF64(xtbl, 4, 1, Op2, 1) // exit via indirect jump
|
||||
OPDEF64(2, 0, 2, Op2) // wraps a pair of refs, for LIR_cmov or LIR_qcmov
|
||||
OPDEF64(file, 1, 2, Op1) // source filename for debug symbols
|
||||
OPDEF64(line, 2, 2, Op1) // source line number for debug symbols
|
||||
OPDEF64(xbarrier, 3, 1, Op2) // memory barrier; doesn't exit, but flushes all values to the stack
|
||||
OPDEF64(xtbl, 4, 1, Op2) // exit via indirect jump
|
||||
|
||||
OPDEF64(__5b, 5,-1, None, 0)
|
||||
OPDEF64(__6b, 6,-1, None, 0)
|
||||
OPDEF64(__7b, 7,-1, None, 0)
|
||||
OPDEF64(__8b, 8,-1, None, 0)
|
||||
OPDEF64(__9b, 9,-1, None, 0)
|
||||
OPDEF64(unused5_64, 5,-1, None)
|
||||
OPDEF64(unused6_64, 6,-1, None)
|
||||
OPDEF64(unused7_64, 7,-1, None)
|
||||
OPDEF64(unused8_64, 8,-1, None)
|
||||
OPDEF64(unused9_64, 9,-1, None)
|
||||
|
||||
OPDEF64(ldq, LIR_ld, 2, Ld, 0) // 64-bit (quad) load
|
||||
OPDEF64(ldq, LIR_ld, 1, Ld) // 64-bit (quad) load
|
||||
|
||||
OPDEF64(__11b, 11,-1, None, 0)
|
||||
OPDEF64(unused11_64, 11,-1, None)
|
||||
|
||||
OPDEF64(stqi, LIR_sti, 2, Sti, 1) // 64-bit (quad) store
|
||||
OPDEF64(fret, LIR_ret, 1, Op1, 1)
|
||||
OPDEF64(stqi, LIR_sti, 2, Sti) // 64-bit (quad) store
|
||||
OPDEF64(fret, LIR_ret, 1, Op1)
|
||||
|
||||
OPDEF64(__14b, 14,-1, None, 0)
|
||||
OPDEF64(__15b, 15,-1, None, 0)
|
||||
OPDEF64(unused14_64, 14,-1, None)
|
||||
OPDEF64(unused15_64, 15,-1, None)
|
||||
|
||||
OPDEF64(fcall, LIR_call, 0, C, 1) // subroutine call returning 64-bit (quad) value
|
||||
OPDEF64(fcall, LIR_call, 0, C) // subroutine call returning 64-bit (quad) value
|
||||
|
||||
OPDEF64(__17b, 17,-1, None, 0)
|
||||
OPDEF64(__18b, 18,-1, None, 0)
|
||||
OPDEF64(__19b, 19,-1, None, 0)
|
||||
OPDEF64(__20b, 20,-1, None, 0)
|
||||
OPDEF64(__21b, 21,-1, None, 0)
|
||||
OPDEF64(__22b, 22,-1, None, 0)
|
||||
OPDEF64(__23b, 23,-1, None, 0)
|
||||
OPDEF64(unused17_64, 17,-1, None)
|
||||
OPDEF64(unused18_64, 18,-1, None)
|
||||
OPDEF64(unused19_64, 19,-1, None)
|
||||
OPDEF64(unused20_64, 20,-1, None)
|
||||
OPDEF64(unused21_64, 21,-1, None)
|
||||
OPDEF64(unused22_64, 22,-1, None)
|
||||
OPDEF64(unused23_64, 23,-1, None)
|
||||
|
||||
// We strip off the 64 bit flag and compare that the opcode is between LIR_int
|
||||
// and LIR_uge to decide whether we can CSE the opcode. All opcodes below
|
||||
// this marker are subject to CSE.
|
||||
|
||||
OPDEF64(quad, LIR_int, 0, I64, 0) // 64-bit (quad) constant value
|
||||
OPDEF64(qcmov, LIR_cmov, 2, Op2, 0) // 64-bit conditional move
|
||||
OPDEF64(quad, LIR_int, 0, I64) // 64-bit (quad) constant value
|
||||
OPDEF64(qcmov, LIR_cmov, 2, Op2) // 64-bit conditional move
|
||||
|
||||
OPDEF64(__26b, 26,-1, None, 0)
|
||||
OPDEF64(__27b, 27,-1, None, 0)
|
||||
OPDEF64(__28b, 28,-1, None, 0)
|
||||
OPDEF64(__29b, 29,-1, None, 0)
|
||||
OPDEF64(__30b, 30,-1, None, 0)
|
||||
OPDEF64(__31b, 31,-1, None, 0)
|
||||
OPDEF64(__32b, 32,-1, None, 0)
|
||||
OPDEF64(__33b, 33,-1, None, 0)
|
||||
OPDEF64(unused26_64, 26,-1, None)
|
||||
OPDEF64(unused27_64, 27,-1, None)
|
||||
OPDEF64(unused28_64, 28,-1, None)
|
||||
OPDEF64(unused29_64, 29,-1, None)
|
||||
OPDEF64(unused30_64, 30,-1, None)
|
||||
OPDEF64(unused31_64, 31,-1, None)
|
||||
OPDEF64(unused32_64, 32,-1, None)
|
||||
OPDEF64(unused33_64, 33,-1, None)
|
||||
|
||||
OPDEF64(ldqc, LIR_ldc, 2, Ld, 0) // non-volatile 64-bit load
|
||||
OPDEF64(ldqc, LIR_ldc, 1, Ld) // non-volatile 64-bit load
|
||||
|
||||
OPDEF64(fneg, LIR_neg, 1, Op1, 0) // floating-point negation
|
||||
OPDEF64(fadd, LIR_add, 2, Op2, 0) // floating-point addition
|
||||
OPDEF64(fsub, LIR_sub, 2, Op2, 0) // floating-point subtraction
|
||||
OPDEF64(fmul, LIR_mul, 2, Op2, 0) // floating-point multiplication
|
||||
OPDEF64(fdiv, LIR_div, 2, Op2, 0) // floating-point division
|
||||
OPDEF64(fmod, LIR_mod, 2, Op2, 0) // floating-point modulus(?)
|
||||
OPDEF64(fneg, LIR_neg, 1, Op1) // floating-point negation
|
||||
OPDEF64(fadd, LIR_add, 2, Op2) // floating-point addition
|
||||
OPDEF64(fsub, LIR_sub, 2, Op2) // floating-point subtraction
|
||||
OPDEF64(fmul, LIR_mul, 2, Op2) // floating-point multiplication
|
||||
OPDEF64(fdiv, LIR_div, 2, Op2) // floating-point division
|
||||
OPDEF64(fmod, LIR_mod, 2, Op2) // floating-point modulus(?)
|
||||
|
||||
OPDEF64(qiand, 41, 2, Op2, 0) // 64-bit bitwise AND
|
||||
OPDEF64(qiadd, 42, 2, Op2, 0) // 64-bit bitwise ADD
|
||||
OPDEF64(qior, 43, 2, Op2, 0) // 64-bit bitwise OR
|
||||
OPDEF64(qiand, 41, 2, Op2) // 64-bit bitwise AND
|
||||
OPDEF64(qiadd, 42, 2, Op2) // 64-bit bitwise ADD
|
||||
OPDEF64(qior, 43, 2, Op2) // 64-bit bitwise OR
|
||||
|
||||
OPDEF64(qilsh, 44, 2, Op2, 0) // 64-bit left shift
|
||||
OPDEF64(qjoin, 45, 2, Op2, 0) // join two 32-bit values (1st arg is low bits, 2nd is high)
|
||||
OPDEF64(qilsh, 44, 2, Op2) // 64-bit left shift
|
||||
OPDEF64(qjoin, 45, 2, Op2) // join two 32-bit values (1st arg is low bits, 2nd is high)
|
||||
|
||||
OPDEF64(i2f, 46, 1, Op1, 0) // convert a signed 32-bit integer to a float
|
||||
OPDEF64(u2f, 47, 1, Op1, 0) // convert an unsigned 32-bit integer to a float
|
||||
OPDEF64(i2f, 46, 1, Op1) // convert a signed 32-bit integer to a float
|
||||
OPDEF64(u2f, 47, 1, Op1) // convert an unsigned 32-bit integer to a float
|
||||
|
||||
OPDEF64(__48b, 48,-1, None, 0)
|
||||
OPDEF64(__49b, 49,-1, None, 0)
|
||||
OPDEF64(__50b, 50,-1, None, 0)
|
||||
OPDEF64(__51b, 51,-1, None, 0)
|
||||
OPDEF64(__52b, 52,-1, None, 0)
|
||||
OPDEF64(__53b, 53,-1, None, 0)
|
||||
OPDEF64(__54b, 54,-1, None, 0)
|
||||
OPDEF64(__55b, 55,-1, None, 0)
|
||||
OPDEF64(__56b, 56,-1, None, 0)
|
||||
OPDEF64(__57b, 57,-1, None, 0)
|
||||
OPDEF64(__58b, 58,-1, None, 0)
|
||||
OPDEF64(__59b, 59,-1, None, 0)
|
||||
OPDEF64(__60b, 60,-1, None, 0)
|
||||
OPDEF64(__61b, 61,-1, None, 0)
|
||||
OPDEF64(__62b, 62,-1, None, 0)
|
||||
OPDEF64(__63b, 63,-1, None, 0)
|
||||
OPDEF64(unused48_64, 48,-1, None)
|
||||
OPDEF64(unused49_64, 49,-1, None)
|
||||
OPDEF64(unused50_64, 50,-1, None)
|
||||
OPDEF64(unused51_64, 51,-1, None)
|
||||
OPDEF64(unused52_64, 52,-1, None)
|
||||
OPDEF64(unused53_64, 53,-1, None)
|
||||
OPDEF64(unused54_64, 54,-1, None)
|
||||
OPDEF64(unused55_64, 55,-1, None)
|
||||
OPDEF64(unused56_64, 56,-1, None)
|
||||
OPDEF64(unused57_64, 57,-1, None)
|
||||
OPDEF64(unused58_64, 58,-1, None)
|
||||
OPDEF64(unused59_64, 59,-1, None)
|
||||
OPDEF64(unused60_64, 60,-1, None)
|
||||
OPDEF64(unused61_64, 61,-1, None)
|
||||
OPDEF64(unused62_64, 62,-1, None)
|
||||
OPDEF64(unused63_64, 63,-1, None)
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
<html><head><title>Firefox 3.5 crash</title>
|
||||
|
||||
<script language=JavaScript>
|
||||
|
||||
function escapeData(data){
|
||||
var escData='';
|
||||
for(var i=0;i<data.length;i++) {
|
||||
var c=data.charAt(i);
|
||||
if( c==' ') c = escape(c);
|
||||
escData+=c;
|
||||
}
|
||||
return escData;
|
||||
}
|
||||
|
||||
var a = ["a", "a ", "a", "a "]
|
||||
|
||||
var html = "";
|
||||
for (i=0;i<a.length;i++){
|
||||
html += escapeData("a")+escapeData(a[i])
|
||||
}
|
||||
</script>
|
||||
</body></html>
|
||||
|
|
@ -18,3 +18,4 @@ load 468552-1.html
|
|||
load 471366-1.html
|
||||
load 475185-1.html
|
||||
load 475291-1.html
|
||||
load 503286-1.html
|
||||
|
|
|
@ -212,6 +212,7 @@ dom_quickstubs.cpp: $(srcdir)/dom_quickstubs.qsconf \
|
|||
$(topsrcdir)/xpcom/idl-parser/xpidl.py \
|
||||
$(DEPTH)/js/src/mozilla-config.h
|
||||
$(PYTHON) $(topsrcdir)/config/pythonpath.py \
|
||||
-I$(topsrcdir)/other-licenses/ply \
|
||||
-I$(topsrcdir)/xpcom/idl-parser \
|
||||
$(srcdir)/qsgen.py \
|
||||
--idlpath=$(DEPTH)/dist/idl \
|
||||
|
|
|
@ -973,104 +973,65 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
NS_MergeReflowStatusInto(&state.mReflowStatus, ocStatus);
|
||||
|
||||
// If the block is complete, put continued floats in the closest ancestor
|
||||
// block that uses the same float manager and leave the block complete; this
|
||||
// allows subsequent lines on the page to be impacted by floats. If the
|
||||
// block is incomplete or there is no ancestor using the same float manager,
|
||||
// put continued floats at the beginning of the first overflow line.
|
||||
// If the block is complete put continued floats at the beginning
|
||||
// of the first overflow line.
|
||||
if (state.mOverflowPlaceholders.NotEmpty()) {
|
||||
NS_ASSERTION(aReflowState.availableHeight != NS_UNCONSTRAINEDSIZE,
|
||||
"Somehow we failed to fit all content, even though we have unlimited space!");
|
||||
if (NS_FRAME_IS_FULLY_COMPLETE(state.mReflowStatus)) {
|
||||
// find the nearest block ancestor that uses the same float manager
|
||||
for (const nsHTMLReflowState* ancestorRS = aReflowState.parentReflowState;
|
||||
ancestorRS;
|
||||
ancestorRS = ancestorRS->parentReflowState) {
|
||||
nsIFrame* ancestor = ancestorRS->frame;
|
||||
if (nsLayoutUtils::GetAsBlock(ancestor) &&
|
||||
aReflowState.mFloatManager == ancestorRS->mFloatManager) {
|
||||
// Put the continued floats in ancestor since it uses the same float manager
|
||||
nsFrameList* ancestorPlace =
|
||||
((nsBlockFrame*)ancestor)->GetOverflowPlaceholders();
|
||||
// The ancestor should have this list, since it's being reflowed. But maybe
|
||||
// it isn't because of reflow roots or something.
|
||||
if (ancestorPlace) {
|
||||
for (nsIFrame* f = state.mOverflowPlaceholders.FirstChild();
|
||||
f; f = f->GetNextSibling()) {
|
||||
NS_ASSERTION(IsContinuationPlaceholder(f),
|
||||
"Overflow placeholders must be continuation placeholders");
|
||||
ReparentFrame(f, this, ancestorRS->frame);
|
||||
nsIFrame* oof = nsPlaceholderFrame::GetRealFrameForPlaceholder(f);
|
||||
mFloats.RemoveFrame(oof);
|
||||
ReparentFrame(oof, this, ancestorRS->frame);
|
||||
// Clear the next-sibling in case the frame wasn't in mFloats
|
||||
oof->SetNextSibling(nsnull);
|
||||
// Do not put the float into any child frame list, because
|
||||
// placeholders in the overflow-placeholder block-state list
|
||||
// don't keep their out of flows in a child frame list.
|
||||
}
|
||||
ancestorPlace->AppendFrames(nsnull, state.mOverflowPlaceholders.FirstChild());
|
||||
state.mOverflowPlaceholders.SetFrames(nsnull);
|
||||
break;
|
||||
}
|
||||
state.mOverflowPlaceholders.SortByContentOrder();
|
||||
PRInt32 numOverflowPlace = state.mOverflowPlaceholders.GetLength();
|
||||
nsLineBox* newLine =
|
||||
state.NewLineBox(state.mOverflowPlaceholders.FirstChild(),
|
||||
numOverflowPlace, PR_FALSE);
|
||||
if (newLine) {
|
||||
nsLineList* overflowLines = GetOverflowLines();
|
||||
if (overflowLines) {
|
||||
// Need to put the overflow placeholders' floats into our
|
||||
// overflow-out-of-flows list, since the overflow placeholders are
|
||||
// going onto our overflow line list. Put them last, because that's
|
||||
// where the placeholders are going.
|
||||
nsFrameList floats;
|
||||
nsIFrame* lastFloat = nsnull;
|
||||
for (nsIFrame* f = state.mOverflowPlaceholders.FirstChild();
|
||||
f; f = f->GetNextSibling()) {
|
||||
NS_ASSERTION(IsContinuationPlaceholder(f),
|
||||
"Overflow placeholders must be continuation placeholders");
|
||||
nsIFrame* oof = nsPlaceholderFrame::GetRealFrameForPlaceholder(f);
|
||||
// oof is not currently in any child list
|
||||
floats.InsertFrames(nsnull, lastFloat, oof);
|
||||
lastFloat = oof;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!state.mOverflowPlaceholders.IsEmpty()) {
|
||||
state.mOverflowPlaceholders.SortByContentOrder();
|
||||
PRInt32 numOverflowPlace = state.mOverflowPlaceholders.GetLength();
|
||||
nsLineBox* newLine =
|
||||
state.NewLineBox(state.mOverflowPlaceholders.FirstChild(),
|
||||
numOverflowPlace, PR_FALSE);
|
||||
if (newLine) {
|
||||
nsLineList* overflowLines = GetOverflowLines();
|
||||
if (overflowLines) {
|
||||
// Need to put the overflow placeholders' floats into our
|
||||
// overflow-out-of-flows list, since the overflow placeholders are
|
||||
// going onto our overflow line list. Put them last, because that's
|
||||
// where the placeholders are going.
|
||||
nsFrameList floats;
|
||||
nsIFrame* lastFloat = nsnull;
|
||||
for (nsIFrame* f = state.mOverflowPlaceholders.FirstChild();
|
||||
f; f = f->GetNextSibling()) {
|
||||
NS_ASSERTION(IsContinuationPlaceholder(f),
|
||||
"Overflow placeholders must be continuation placeholders");
|
||||
nsIFrame* oof = nsPlaceholderFrame::GetRealFrameForPlaceholder(f);
|
||||
// oof is not currently in any child list
|
||||
floats.InsertFrames(nsnull, lastFloat, oof);
|
||||
lastFloat = oof;
|
||||
}
|
||||
|
||||
// Put the new placeholders *last* in the overflow lines
|
||||
// because they might have previnflows in the overflow lines.
|
||||
nsIFrame* lastChild = overflowLines->back()->LastChild();
|
||||
lastChild->SetNextSibling(state.mOverflowPlaceholders.FirstChild());
|
||||
// Create a new line as the last line and put the
|
||||
// placeholders there
|
||||
overflowLines->push_back(newLine);
|
||||
// Put the new placeholders *last* in the overflow lines
|
||||
// because they might have previnflows in the overflow lines.
|
||||
nsIFrame* lastChild = overflowLines->back()->LastChild();
|
||||
lastChild->SetNextSibling(state.mOverflowPlaceholders.FirstChild());
|
||||
// Create a new line as the last line and put the
|
||||
// placeholders there
|
||||
overflowLines->push_back(newLine);
|
||||
|
||||
nsAutoOOFFrameList oofs(this);
|
||||
oofs.mList.AppendFrames(nsnull, floats.FirstChild());
|
||||
}
|
||||
else {
|
||||
mLines.push_back(newLine);
|
||||
nsLineList::iterator nextToLastLine = ----end_lines();
|
||||
PushLines(state, nextToLastLine);
|
||||
}
|
||||
state.mOverflowPlaceholders.SetFrames(nsnull);
|
||||
nsAutoOOFFrameList oofs(this);
|
||||
oofs.mList.AppendFrames(nsnull, floats.FirstChild());
|
||||
}
|
||||
state.mReflowStatus |= NS_FRAME_REFLOW_NEXTINFLOW;
|
||||
NS_FRAME_SET_INCOMPLETE(state.mReflowStatus);
|
||||
else {
|
||||
mLines.push_back(newLine);
|
||||
nsLineList::iterator nextToLastLine = ----end_lines();
|
||||
PushLines(state, nextToLastLine);
|
||||
}
|
||||
state.mOverflowPlaceholders.SetFrames(nsnull);
|
||||
}
|
||||
state.mReflowStatus |= NS_FRAME_REFLOW_NEXTINFLOW;
|
||||
if (NS_FRAME_IS_COMPLETE(state.mReflowStatus))
|
||||
NS_FRAME_SET_OVERFLOW_INCOMPLETE(state.mReflowStatus);
|
||||
}
|
||||
|
||||
if (NS_FRAME_IS_NOT_COMPLETE(state.mReflowStatus)) {
|
||||
if (!NS_FRAME_IS_FULLY_COMPLETE(state.mReflowStatus)) {
|
||||
if (GetOverflowLines()) {
|
||||
state.mReflowStatus |= NS_FRAME_REFLOW_NEXTINFLOW;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_kipp
|
||||
ListTag(stdout); printf(": block is not complete\n");
|
||||
ListTag(stdout); printf(": block is not fully complete\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1590,7 +1551,8 @@ nsBlockFrame::PrepareResizeReflow(nsBlockReflowState& aState)
|
|||
// way we are here.
|
||||
if (line->IsBlock() ||
|
||||
line->HasFloats() ||
|
||||
(line != mLines.back() && !line->HasBreakAfter()) ||
|
||||
((line != mLines.back() || GetNextInFlow()) // not the last line
|
||||
&& !line->HasBreakAfter()) ||
|
||||
line->ResizeReflowOptimizationDisabled() ||
|
||||
line->IsImpactedByFloat() ||
|
||||
(line->mBounds.XMost() > newAvailWidth)) {
|
||||
|
@ -3311,7 +3273,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
|
|||
}
|
||||
else {
|
||||
// None of the block fits. Determine the correct reflow status.
|
||||
if (aLine == mLines.front()) {
|
||||
if (aLine == mLines.front() && !GetPrevInFlow()) {
|
||||
// If it's our very first line then we need to be pushed to
|
||||
// our parents next-in-flow. Therefore, return break-before
|
||||
// status for our reflow status.
|
||||
|
@ -4542,11 +4504,6 @@ nsBlockFrame::DrainOverflowLines(nsBlockReflowState& aState)
|
|||
// most one frame for a given piece of content is in our normal
|
||||
// child list, by pushing all but the first placeholder to our
|
||||
// overflow placeholders list.
|
||||
//
|
||||
// One problem we have to deal with is that some of these
|
||||
// continuation placeholders may have been donated to us by a
|
||||
// descendant block that was complete. We need to push them down to
|
||||
// a lower block if possible.
|
||||
//
|
||||
// We keep the lists ordered so that prev in flows come before their
|
||||
// next in flows. We do not worry about properly ordering the
|
||||
|
@ -4590,9 +4547,9 @@ nsBlockFrame::DrainOverflowLines(nsBlockReflowState& aState)
|
|||
NS_ASSERTION(IsContinuationPlaceholder(f),
|
||||
"Line frames should all be continuation placeholders");
|
||||
next = f->GetNextSibling();
|
||||
f->SetNextSibling(nsnull);
|
||||
nsIFrame* fpif = f->GetPrevInFlow();
|
||||
nsIFrame* oof = f->GetOutOfFlowFrame();
|
||||
|
||||
// Take this out of mFloats for now. We may put it back later in
|
||||
// this function
|
||||
#ifdef DEBUG
|
||||
|
@ -4611,53 +4568,12 @@ nsBlockFrame::DrainOverflowLines(nsBlockReflowState& aState)
|
|||
// mOverflowPlaceholders do not keep their floats in any child list
|
||||
lastOP = f;
|
||||
} else {
|
||||
if (fpif->GetParent() == prevBlock) {
|
||||
keepPlaceholders.InsertFrame(nsnull, lastKP, f);
|
||||
keepOutOfFlows.InsertFrame(nsnull, lastKOOF, oof);
|
||||
lastKP = f;
|
||||
lastKOOF = oof;
|
||||
} else {
|
||||
// Ok, now we're in the tough situation where some child
|
||||
// of prevBlock was complete and pushed its overflow
|
||||
// placeholders up to prevBlock's overflow. We might be
|
||||
// able to find a more appropriate parent for f somewhere
|
||||
// down in our descendants.
|
||||
NS_ASSERTION(nsLayoutUtils::IsProperAncestorFrame(prevBlock, fpif),
|
||||
"bad prev-in-flow ancestor chain");
|
||||
// Find the first ancestor of f's prev-in-flow that has a next in flow
|
||||
// that can contain the float.
|
||||
// That next in flow should become f's parent.
|
||||
nsIFrame* fpAncestor;
|
||||
for (fpAncestor = fpif->GetParent();
|
||||
!fpAncestor->GetNextInFlow() || !fpAncestor->IsFloatContainingBlock();
|
||||
fpAncestor = fpAncestor->GetParent())
|
||||
;
|
||||
if (fpAncestor == prevBlock) {
|
||||
// We're still the best parent.
|
||||
keepPlaceholders.InsertFrame(nsnull, lastKP, f);
|
||||
keepOutOfFlows.InsertFrame(nsnull, lastKOOF, oof);
|
||||
lastKP = f;
|
||||
lastKOOF = oof;
|
||||
} else {
|
||||
// Just put it at the front of
|
||||
// fpAncestor->GetNextInFlow()'s lines.
|
||||
nsLineBox* newLine = aState.NewLineBox(f, 1, PR_FALSE);
|
||||
if (newLine) {
|
||||
nsBlockFrame* target =
|
||||
static_cast<nsBlockFrame*>(fpAncestor->GetNextInFlow());
|
||||
if (!target->mLines.empty()) {
|
||||
f->SetNextSibling(target->mLines.front()->mFirstChild);
|
||||
} else {
|
||||
f->SetNextSibling(nsnull);
|
||||
}
|
||||
target->mLines.push_front(newLine);
|
||||
ReparentFrame(f, this, target);
|
||||
|
||||
target->mFloats.InsertFrame(nsnull, nsnull, oof);
|
||||
ReparentFrame(oof, this, target);
|
||||
}
|
||||
}
|
||||
}
|
||||
NS_ASSERTION(fpif->GetParent() == prevBlock,
|
||||
"Block has placeholders that don't belong to it.");
|
||||
keepPlaceholders.InsertFrame(nsnull, lastKP, f);
|
||||
keepOutOfFlows.InsertFrame(nsnull, lastKOOF, oof);
|
||||
lastKP = f;
|
||||
lastKOOF = oof;
|
||||
}
|
||||
}
|
||||
aState.FreeLineBox(line);
|
||||
|
@ -5917,10 +5833,6 @@ nsBlockFrame::ReflowFloat(nsBlockReflowState& aState,
|
|||
(NS_UNCONSTRAINEDSIZE == availSpace.height))
|
||||
aReflowStatus = NS_FRAME_COMPLETE;
|
||||
|
||||
//XXXfr Floats can't be overflow incomplete yet
|
||||
if (NS_FRAME_OVERFLOW_IS_INCOMPLETE(aReflowStatus))
|
||||
NS_FRAME_SET_INCOMPLETE(aReflowStatus);
|
||||
|
||||
if (NS_FRAME_IS_COMPLETE(aReflowStatus)) {
|
||||
// Float is now complete, so delete the placeholder's next in
|
||||
// flows, if any; their floats (which are this float's continuations)
|
||||
|
|
|
@ -944,6 +944,11 @@ nsImageFrame::DisplayAltText(nsPresContext* aPresContext,
|
|||
const PRUnichar* str = aAltText.get();
|
||||
PRInt32 strLen = aAltText.Length();
|
||||
nscoord y = aRect.y;
|
||||
|
||||
if (!aPresContext->BidiEnabled() && HasRTLChars(aAltText)) {
|
||||
aPresContext->SetBidiEnabled();
|
||||
}
|
||||
|
||||
// Always show the first line, even if we have to clip it below
|
||||
PRBool firstLine = PR_TRUE;
|
||||
while ((strLen > 0) && (firstLine || (y + maxDescent) < aRect.YMost())) {
|
||||
|
|
|
@ -1851,7 +1851,7 @@ static const char*
|
|||
GetMIMEType(nsIPluginInstance *aPluginInstance)
|
||||
{
|
||||
if (aPluginInstance) {
|
||||
char* mime = nsnull;
|
||||
const char* mime = nsnull;
|
||||
if (NS_SUCCEEDED(aPluginInstance->GetMIMEType(&mime)) && mime)
|
||||
return mime;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Welcome to Flickr!</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<ul>
|
||||
<li><span><a href="/photos/foo/" title="مسجد قبة الصخرة by Yaqut"><img src="/foo.jpg" width="75" height="75" alt="مسجد قبة الصخرة by Yaqut"></a></span><div>From <a href="/photos/yaqut/" title="Yaqut">Yaqut</a></div></li>
|
||||
<li><span><a href="/photos/bar/" title="מערכת שליחת ההודעות באתר אורנג עובדת בפיירפוקס - מזל טוב!"><img src="/bar.jpg" width="75" height="75" alt="מערכת שליחת ההודעות באתר אורנג עובדת בפיירפוקס - מזל טוב! by MosheOofnik"></a></span><div>From <a href="/photos/mosheoofnik/" title="MosheOofnik">Moshe Oofnik</a></div></li>
|
||||
<li><span><a href="/photos/baz/" title="Fruit Basket by Elmo"><img src="/baz.jpg" width="75" height="75" alt="Fruit Basket by Elmo"></a></span><div>From <a href="/photos/elmo/" title="Elmo">Elmo</a></div></li>
|
||||
</ul>‏
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Welcome to Flickr!</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<ul>
|
||||
<li><span><a href="/photos/foo/" title="مسجد قبة الصخرة by Yaqut"><img src="/foo.jpg" width="75" height="75" alt="مسجد قبة الصخرة by Yaqut"></a></span><div>From <a href="/photos/yaqut/" title="Yaqut">Yaqut</a></div></li>
|
||||
<li><span><a href="/photos/bar/" title="מערכת שליחת ההודעות באתר אורנג עובדת בפיירפוקס - מזל טוב!"><img src="/bar.jpg" width="75" height="75" alt="מערכת שליחת ההודעות באתר אורנג עובדת בפיירפוקס - מזל טוב! by MosheOofnik"></a></span><div>From <a href="/photos/mosheoofnik/" title="MosheOofnik">Moshe Oofnik</a></div></li>
|
||||
<li><span><a href="/photos/baz/" title="Fruit Basket by Elmo"><img src="/baz.jpg" width="75" height="75" alt="Fruit Basket by Elmo"></a></span><div>From <a href="/photos/elmo/" title="Elmo">Elmo</a></div></li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -41,3 +41,4 @@ random-if(MOZ_WIDGET_TOOLKIT=="gtk2") == 386339.html 386339-ref.html
|
|||
== 489887-1.html 489887-1-ref.html
|
||||
== 492231-1.html 492231-1-ref.html
|
||||
== 496006-1.html 496006-1-ref.html
|
||||
== 503269-1.html 503269-1-ref.html
|
||||
|
|
Двоичный файл не отображается.
Двоичный файл не отображается.
|
@ -233,17 +233,22 @@ nsSVGGeometryFrame::SetupCairoFill(gfxContext *aContext)
|
|||
}
|
||||
|
||||
PRBool
|
||||
nsSVGGeometryFrame::HasStroke(gfxContext *aContext)
|
||||
{
|
||||
return GetStyleSVG()->mStroke.mType != eStyleSVGPaintType_None &&
|
||||
GetStrokeWidth() > 0;
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGGeometryFrame::SetupCairoStrokeGeometry(gfxContext *aContext)
|
||||
{
|
||||
const nsStyleSVG* style = GetStyleSVG();
|
||||
if (style->mStroke.mType == eStyleSVGPaintType_None)
|
||||
return PR_FALSE;
|
||||
|
||||
float width = GetStrokeWidth();
|
||||
if (width <= 0)
|
||||
return PR_FALSE;
|
||||
return;
|
||||
aContext->SetLineWidth(width);
|
||||
|
||||
const nsStyleSVG* style = GetStyleSVG();
|
||||
|
||||
switch (style->mStrokeLinecap) {
|
||||
case NS_STYLE_STROKE_LINECAP_BUTT:
|
||||
aContext->SetLineCap(gfxContext::LINE_CAP_BUTT);
|
||||
|
@ -269,15 +274,12 @@ nsSVGGeometryFrame::SetupCairoStrokeGeometry(gfxContext *aContext)
|
|||
aContext->SetLineJoin(gfxContext::LINE_JOIN_BEVEL);
|
||||
break;
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
PRBool
|
||||
void
|
||||
nsSVGGeometryFrame::SetupCairoStrokeHitGeometry(gfxContext *aContext)
|
||||
{
|
||||
if (!SetupCairoStrokeGeometry(aContext))
|
||||
return PR_FALSE;
|
||||
SetupCairoStrokeGeometry(aContext);
|
||||
|
||||
gfxFloat *dashArray;
|
||||
PRUint32 count;
|
||||
|
@ -286,14 +288,15 @@ nsSVGGeometryFrame::SetupCairoStrokeHitGeometry(gfxContext *aContext)
|
|||
aContext->SetDash(dashArray, count, GetStrokeDashoffset());
|
||||
delete [] dashArray;
|
||||
}
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsSVGGeometryFrame::SetupCairoStroke(gfxContext *aContext)
|
||||
{
|
||||
if (!SetupCairoStrokeHitGeometry(aContext))
|
||||
if (!HasStroke(aContext)) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
SetupCairoStrokeHitGeometry(aContext);
|
||||
|
||||
const nsStyleSVG* style = GetStyleSVG();
|
||||
float opacity = MaybeOptimizeOpacity(style->mStrokeOpacity);
|
||||
|
|
|
@ -80,15 +80,17 @@ public:
|
|||
*/
|
||||
PRBool SetupCairoFill(gfxContext *aContext);
|
||||
/*
|
||||
* Set up a cairo context for measuring a stroked path
|
||||
* @return PR_FALSE if there is no stroke
|
||||
*/
|
||||
PRBool SetupCairoStrokeGeometry(gfxContext *aContext);
|
||||
PRBool HasStroke(gfxContext *aContext);
|
||||
/*
|
||||
* Set up a cairo context for measuring a stroked path
|
||||
*/
|
||||
void SetupCairoStrokeGeometry(gfxContext *aContext);
|
||||
/*
|
||||
* Set up a cairo context for hit testing a stroked path
|
||||
* @return PR_FALSE if there is no stroke
|
||||
*/
|
||||
PRBool SetupCairoStrokeHitGeometry(gfxContext *aContext);
|
||||
void SetupCairoStrokeHitGeometry(gfxContext *aContext);
|
||||
/*
|
||||
* Set up a cairo context for stroking a path
|
||||
* @return PR_FALSE to skip rendering
|
||||
|
|
|
@ -462,9 +462,10 @@ nsSVGGlyphFrame::UpdateCoveredRegion()
|
|||
nsRefPtr<gfxContext> tmpCtx = MakeTmpCtx();
|
||||
tmpCtx->Multiply(matrix);
|
||||
|
||||
PRBool hasStroke = SetupCairoStrokeGeometry(tmpCtx);
|
||||
|
||||
if (!hasStroke && GetStyleSVG()->mFill.mType == eStyleSVGPaintType_None) {
|
||||
PRBool hasStroke = HasStroke(tmpCtx);
|
||||
if (hasStroke) {
|
||||
SetupCairoStrokeGeometry(tmpCtx);
|
||||
} else if (GetStyleSVG()->mFill.mType == eStyleSVGPaintType_None) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -182,8 +182,8 @@ nsSVGPathGeometryFrame::GetFrameForPoint(const nsPoint &aPoint)
|
|||
|
||||
if (mask & HITTEST_MASK_FILL)
|
||||
isHit = context.PointInFill(userSpacePoint);
|
||||
if (!isHit && (mask & HITTEST_MASK_STROKE) &&
|
||||
SetupCairoStrokeHitGeometry(&context)) {
|
||||
if (!isHit && (mask & HITTEST_MASK_STROKE)) {
|
||||
SetupCairoStrokeHitGeometry(&context);
|
||||
isHit = context.PointInStroke(userSpacePoint);
|
||||
}
|
||||
|
||||
|
@ -267,7 +267,8 @@ nsSVGPathGeometryFrame::UpdateCoveredRegion()
|
|||
// # If the stroke is very thin, cairo won't paint any stroke, and so the
|
||||
// stroke bounds that it will return will be empty.
|
||||
|
||||
if (SetupCairoStrokeGeometry(&context)) {
|
||||
if (HasStroke(&context)) {
|
||||
SetupCairoStrokeGeometry(&context);
|
||||
extent = nsSVGUtils::PathExtentsToMaxStrokeExtents(extent, this);
|
||||
} else if (GetStyleSVG()->mFill.mType == eStyleSVGPaintType_None) {
|
||||
extent = gfxRect(0, 0, 0, 0);
|
||||
|
|
|
@ -670,7 +670,7 @@ void nsTableFrame::RemoveCol(nsTableColGroupFrame* aColGroupFrame,
|
|||
if (aRemoveFromCellMap) {
|
||||
nsTableCellMap* cellMap = GetCellMap();
|
||||
if (cellMap) {
|
||||
CreateAnonymousColFrames(1, eColAnonymousCell, PR_TRUE);
|
||||
AppendAnonymousColFrames(1);
|
||||
}
|
||||
}
|
||||
// for now, just bail and recalc all of the collapsing borders
|
||||
|
@ -711,13 +711,9 @@ nsTableFrame::CreateAnonymousColGroupFrame(nsTableColGroupType aColGroupType)
|
|||
}
|
||||
|
||||
void
|
||||
nsTableFrame::CreateAnonymousColFrames(PRInt32 aNumColsToAdd,
|
||||
nsTableColType aColType,
|
||||
PRBool aDoAppend,
|
||||
nsIFrame* aPrevColIn)
|
||||
nsTableFrame::AppendAnonymousColFrames(PRInt32 aNumColsToAdd)
|
||||
{
|
||||
NS_PRECONDITION(aColType != eColAnonymousCol, "Shouldn't happen");
|
||||
|
||||
nsTableColFrame* prevCol = nsnull;
|
||||
// get the last col group frame
|
||||
nsTableColGroupFrame* colGroupFrame = nsnull;
|
||||
nsIFrame* childFrame = mColGroups.FirstChild();
|
||||
|
@ -728,37 +724,27 @@ nsTableFrame::CreateAnonymousColFrames(PRInt32 aNumColsToAdd,
|
|||
childFrame = childFrame->GetNextSibling();
|
||||
}
|
||||
|
||||
nsTableColGroupType lastColGroupType = eColGroupContent;
|
||||
nsTableColGroupType newColGroupType = eColGroupContent;
|
||||
if (colGroupFrame) {
|
||||
lastColGroupType = colGroupFrame->GetColType();
|
||||
}
|
||||
if (eColAnonymousCell == aColType) {
|
||||
if (eColGroupAnonymousCell != lastColGroupType) {
|
||||
newColGroupType = eColGroupAnonymousCell;
|
||||
}
|
||||
if (colGroupFrame &&
|
||||
(colGroupFrame->GetColType() == eColGroupAnonymousCell)) {
|
||||
prevCol =
|
||||
static_cast<nsTableColFrame*> (colGroupFrame->GetChildList().LastChild());
|
||||
}
|
||||
else {
|
||||
NS_ASSERTION(PR_FALSE, "CreateAnonymousColFrames called incorrectly");
|
||||
return;
|
||||
}
|
||||
|
||||
if (eColGroupContent != newColGroupType) {
|
||||
PRInt32 colIndex = (colGroupFrame) ? colGroupFrame->GetStartColumnIndex() + colGroupFrame->GetColCount()
|
||||
: 0;
|
||||
colGroupFrame = CreateAnonymousColGroupFrame(newColGroupType);
|
||||
PRInt32 colIndex = (colGroupFrame) ?
|
||||
colGroupFrame->GetStartColumnIndex() +
|
||||
colGroupFrame->GetColCount() : 0;
|
||||
colGroupFrame = CreateAnonymousColGroupFrame(eColGroupAnonymousCell);
|
||||
if (!colGroupFrame) {
|
||||
return;
|
||||
}
|
||||
mColGroups.AppendFrame(this, colGroupFrame); // add the new frame to the child list
|
||||
// add the new frame to the child list
|
||||
mColGroups.AppendFrame(this, colGroupFrame);
|
||||
colGroupFrame->SetStartColumnIndex(colIndex);
|
||||
}
|
||||
|
||||
nsIFrame* prevCol = (aDoAppend) ? colGroupFrame->GetChildList().LastChild() : aPrevColIn;
|
||||
|
||||
nsIFrame* firstNewFrame;
|
||||
CreateAnonymousColFrames(colGroupFrame, aNumColsToAdd, aColType,
|
||||
CreateAnonymousColFrames(colGroupFrame, aNumColsToAdd, eColAnonymousCell,
|
||||
PR_TRUE, prevCol, &firstNewFrame);
|
||||
|
||||
}
|
||||
|
||||
// XXX this needs to be moved to nsCSSFrameConstructor
|
||||
|
@ -850,7 +836,7 @@ nsTableFrame::MatchCellMapToColCache(nsTableCellMap* aCellMap)
|
|||
PRInt32 numColsToAdd = numColsInMap - numColsInCache;
|
||||
if (numColsToAdd > 0) {
|
||||
// this sets the child list, updates the col cache and cell map
|
||||
CreateAnonymousColFrames(numColsToAdd, eColAnonymousCell, PR_TRUE);
|
||||
AppendAnonymousColFrames(numColsToAdd);
|
||||
}
|
||||
if (numColsToAdd < 0) {
|
||||
PRInt32 numColsNotRemoved = DestroyAnonymousColFrames(-numColsToAdd);
|
||||
|
@ -2489,8 +2475,7 @@ nsTableFrame::RemoveFrame(nsIAtom* aListName,
|
|||
PRInt32 numAnonymousColsToAdd = GetColCount() - mColFrames.Length();
|
||||
if (numAnonymousColsToAdd > 0) {
|
||||
// this sets the child list, updates the col cache and cell map
|
||||
CreateAnonymousColFrames(numAnonymousColsToAdd,
|
||||
eColAnonymousCell, PR_TRUE);
|
||||
AppendAnonymousColFrames(numAnonymousColsToAdd);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
|
@ -456,10 +456,7 @@ public:
|
|||
|
||||
PRInt32 DestroyAnonymousColFrames(PRInt32 aNumFrames);
|
||||
|
||||
void CreateAnonymousColFrames(PRInt32 aNumColsToAdd,
|
||||
nsTableColType aColType,
|
||||
PRBool aDoAppend,
|
||||
nsIFrame* aPrevCol = nsnull);
|
||||
void AppendAnonymousColFrames(PRInt32 aNumColsToAdd);
|
||||
|
||||
void CreateAnonymousColFrames(nsTableColGroupFrame* aColGroupFrame,
|
||||
PRInt32 aNumColsToAdd,
|
||||
|
|
|
@ -471,21 +471,6 @@ nsTableOuterFrame::GetMargin(nsPresContext* aPresContext,
|
|||
aMargin = childRS.mComputedMargin;
|
||||
}
|
||||
|
||||
static
|
||||
nscoord CalcAutoMargin(nscoord aAutoMargin,
|
||||
nscoord aOppositeMargin,
|
||||
nscoord aContainBlockSize,
|
||||
nscoord aFrameSize)
|
||||
{
|
||||
nscoord margin;
|
||||
if (NS_AUTOMARGIN == aOppositeMargin)
|
||||
margin = (aContainBlockSize - aFrameSize) / 2;
|
||||
else {
|
||||
margin = aContainBlockSize - aFrameSize - aOppositeMargin;
|
||||
}
|
||||
return PR_MAX(0, margin);
|
||||
}
|
||||
|
||||
static nsSize
|
||||
GetContainingBlockSize(const nsHTMLReflowState& aOuterRS)
|
||||
{
|
||||
|
|
|
@ -1351,18 +1351,8 @@ nsTreeBodyFrame::CheckTextForBidi(nsAutoString& aText)
|
|||
// We could check to see whether the prescontext already has bidi enabled,
|
||||
// but usually it won't, so it's probably faster to avoid the call to
|
||||
// GetPresContext() when it's not needed.
|
||||
const PRUnichar* text = aText.get();
|
||||
PRUint32 length = aText.Length();
|
||||
PRUint32 i;
|
||||
for (i = 0; i < length; ++i) {
|
||||
PRUnichar ch = text[i];
|
||||
// To simplify things, anything that could be a surrogate or RTL
|
||||
// presentation form is covered just by testing >= 0xD800). It's fine to
|
||||
// enable bidi in rare cases where it actually isn't needed.
|
||||
if (ch >= 0xD800 || IS_IN_BMP_RTL_BLOCK(ch)) {
|
||||
PresContext()->SetBidiEnabled();
|
||||
break;
|
||||
}
|
||||
if (HasRTLChars(aText)) {
|
||||
PresContext()->SetBidiEnabled();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ interface nsIPluginInstance : nsISupports
|
|||
* @param aMIMEType - resulting MIME type
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
readonly attribute string MIMEType;
|
||||
void getMIMEType([const, shared] out string aValue);
|
||||
|
||||
/**
|
||||
* Get the JavaScript context to this plugin instance.
|
||||
|
|
|
@ -334,7 +334,7 @@ nsNPAPIPlugin::nsNPAPIPlugin(NPPluginFuncs* callbacks, PRLibrary* aLibrary,
|
|||
fLibrary = aLibrary;
|
||||
}
|
||||
|
||||
nsNPAPIPlugin::~nsNPAPIPlugin(void)
|
||||
nsNPAPIPlugin::~nsNPAPIPlugin()
|
||||
{
|
||||
// reset the callbacks list
|
||||
memset((void*) &fCallbacks, 0, sizeof(fCallbacks));
|
||||
|
@ -2476,6 +2476,9 @@ _getauthenticationinfo(NPP instance, const char *protocol, const char *host,
|
|||
return NPERR_NO_ERROR;
|
||||
}
|
||||
|
||||
// We need extern "C" here because it has a function pointer as an argument.
|
||||
// See Bug 501889.
|
||||
PR_BEGIN_EXTERN_C
|
||||
uint32_t NP_CALLBACK
|
||||
_scheduletimer(NPP instance, uint32_t interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID))
|
||||
{
|
||||
|
@ -2485,6 +2488,7 @@ _scheduletimer(NPP instance, uint32_t interval, NPBool repeat, void (*timerFunc)
|
|||
|
||||
return inst->ScheduleTimer(interval, repeat, timerFunc);
|
||||
}
|
||||
PR_END_EXTERN_C
|
||||
|
||||
void NP_CALLBACK
|
||||
_unscheduletimer(NPP instance, uint32_t timerID)
|
||||
|
|
|
@ -76,7 +76,7 @@ class nsNPAPIPlugin : public nsIPlugin
|
|||
public:
|
||||
nsNPAPIPlugin(NPPluginFuncs* callbacks, PRLibrary* aLibrary,
|
||||
NP_PLUGINSHUTDOWN aShutdown);
|
||||
virtual ~nsNPAPIPlugin(void);
|
||||
virtual ~nsNPAPIPlugin();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIPLUGIN
|
||||
|
@ -104,7 +104,7 @@ protected:
|
|||
|
||||
NP_PLUGINSHUTDOWN fShutdownEntry;
|
||||
|
||||
// The browser-side callbacks that a 4.x-style plugin calls.
|
||||
// Browser-side callbacks that the plugin calls.
|
||||
static NPNetscapeFuncs CALLBACKS;
|
||||
};
|
||||
|
||||
|
|
|
@ -270,7 +270,7 @@ nsresult nsNPAPIPluginStreamListener::CleanUpStream(NPReason reason)
|
|||
|
||||
if (mStreamStarted && callbacks->destroystream) {
|
||||
PRLibrary* lib = nsnull;
|
||||
lib = mInst->fLibrary;
|
||||
lib = mInst->mLibrary;
|
||||
NPError error;
|
||||
NS_TRY_SAFE_CALL_RETURN(error, (*callbacks->destroystream)(npp, &mNPStream, reason), lib, mInst);
|
||||
|
||||
|
@ -312,7 +312,7 @@ void nsNPAPIPluginStreamListener::CallURLNotify(NPReason reason)
|
|||
NPP npp;
|
||||
mInst->GetNPP(&npp);
|
||||
|
||||
NS_TRY_SAFE_CALL_VOID((*callbacks->urlnotify)(npp, mNotifyURL, reason, mNotifyData), mInst->fLibrary, mInst);
|
||||
NS_TRY_SAFE_CALL_VOID((*callbacks->urlnotify)(npp, mNotifyURL, reason, mNotifyData), mInst->mLibrary, mInst);
|
||||
|
||||
NPP_PLUGIN_LOG(PLUGIN_LOG_NORMAL,
|
||||
("NPP URLNotify called: this=%p, npp=%p, notify=%p, reason=%d, url=%s\n",
|
||||
|
@ -358,7 +358,7 @@ nsNPAPIPluginStreamListener::OnStartBinding(nsIPluginStreamInfo* pluginInfo)
|
|||
|
||||
mStreamInfo = pluginInfo;
|
||||
|
||||
NS_TRY_SAFE_CALL_RETURN(error, (*callbacks->newstream)(npp, (char*)contentType, &mNPStream, seekable, &streamType), mInst->fLibrary, mInst);
|
||||
NS_TRY_SAFE_CALL_RETURN(error, (*callbacks->newstream)(npp, (char*)contentType, &mNPStream, seekable, &streamType), mInst->mLibrary, mInst);
|
||||
|
||||
NPP_PLUGIN_LOG(PLUGIN_LOG_NORMAL,
|
||||
("NPP NewStream called: this=%p, npp=%p, mime=%s, seek=%d, type=%d, return=%d, url=%s\n",
|
||||
|
@ -597,7 +597,7 @@ nsNPAPIPluginStreamListener::OnDataAvailable(nsIPluginStreamInfo* pluginInfo,
|
|||
while (mStreamBufferByteCount > 0) {
|
||||
PRInt32 numtowrite;
|
||||
if (callbacks->writeready) {
|
||||
NS_TRY_SAFE_CALL_RETURN(numtowrite, (*callbacks->writeready)(npp, &mNPStream), mInst->fLibrary, mInst);
|
||||
NS_TRY_SAFE_CALL_RETURN(numtowrite, (*callbacks->writeready)(npp, &mNPStream), mInst->mLibrary, mInst);
|
||||
NPP_PLUGIN_LOG(PLUGIN_LOG_NOISY,
|
||||
("NPP WriteReady called: this=%p, npp=%p, "
|
||||
"return(towrite)=%d, url=%s\n",
|
||||
|
@ -644,7 +644,7 @@ nsNPAPIPluginStreamListener::OnDataAvailable(nsIPluginStreamInfo* pluginInfo,
|
|||
}
|
||||
|
||||
PRInt32 writeCount = 0; // bytes consumed by plugin instance
|
||||
NS_TRY_SAFE_CALL_RETURN(writeCount, (*callbacks->write)(npp, &mNPStream, streamPosition, numtowrite, ptrStreamBuffer), mInst->fLibrary, mInst);
|
||||
NS_TRY_SAFE_CALL_RETURN(writeCount, (*callbacks->write)(npp, &mNPStream, streamPosition, numtowrite, ptrStreamBuffer), mInst->mLibrary, mInst);
|
||||
|
||||
NPP_PLUGIN_LOG(PLUGIN_LOG_NOISY,
|
||||
("NPP Write called: this=%p, npp=%p, pos=%d, len=%d, "
|
||||
|
@ -749,7 +749,7 @@ nsNPAPIPluginStreamListener::OnFileAvailable(nsIPluginStreamInfo* pluginInfo,
|
|||
mInst->GetNPP(&npp);
|
||||
|
||||
PRLibrary* lib = nsnull;
|
||||
lib = mInst->fLibrary;
|
||||
lib = mInst->mLibrary;
|
||||
|
||||
NS_TRY_SAFE_CALL_VOID((*callbacks->asfile)(npp, &mNPStream, fileName), lib, mInst);
|
||||
|
||||
|
@ -869,7 +869,7 @@ NS_IMPL_ISUPPORTS1(nsNPAPIPluginInstance, nsIPluginInstance)
|
|||
|
||||
nsNPAPIPluginInstance::nsNPAPIPluginInstance(NPPluginFuncs* callbacks,
|
||||
PRLibrary* aLibrary)
|
||||
: fCallbacks(callbacks),
|
||||
: mCallbacks(callbacks),
|
||||
#ifdef XP_MACOSX
|
||||
#ifdef NP_NO_QUICKDRAW
|
||||
mDrawingModel(NPDrawingModelCoreGraphics),
|
||||
|
@ -881,19 +881,18 @@ nsNPAPIPluginInstance::nsNPAPIPluginInstance(NPPluginFuncs* callbacks,
|
|||
mTransparent(PR_FALSE),
|
||||
mStarted(PR_FALSE),
|
||||
mCached(PR_FALSE),
|
||||
mIsJavaPlugin(PR_FALSE),
|
||||
mWantsAllNetworkStreams(PR_FALSE),
|
||||
mInPluginInitCall(PR_FALSE),
|
||||
fLibrary(aLibrary),
|
||||
mLibrary(aLibrary),
|
||||
mStreams(nsnull),
|
||||
mMIMEType(nsnull)
|
||||
{
|
||||
NS_ASSERTION(fCallbacks != NULL, "null callbacks");
|
||||
NS_ASSERTION(mCallbacks != NULL, "null callbacks");
|
||||
|
||||
// Initialize the NPP structure.
|
||||
|
||||
fNPP.pdata = NULL;
|
||||
fNPP.ndata = this;
|
||||
mNPP.pdata = NULL;
|
||||
mNPP.ndata = this;
|
||||
|
||||
PLUGIN_LOG(PLUGIN_LOG_BASIC, ("nsNPAPIPluginInstance ctor: this=%p\n",this));
|
||||
}
|
||||
|
@ -982,9 +981,9 @@ NS_IMETHODIMP nsNPAPIPluginInstance::Stop(void)
|
|||
mStarted = PR_FALSE;
|
||||
ExitAsyncPluginThreadCallLock();
|
||||
|
||||
OnPluginDestroy(&fNPP);
|
||||
OnPluginDestroy(&mNPP);
|
||||
|
||||
if (fCallbacks->destroy == NULL) {
|
||||
if (mCallbacks->destroy == NULL) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -1005,12 +1004,12 @@ NS_IMETHODIMP nsNPAPIPluginInstance::Stop(void)
|
|||
listener->CleanUpStream(NPRES_USER_BREAK);
|
||||
}
|
||||
|
||||
NS_TRY_SAFE_CALL_RETURN(error, (*fCallbacks->destroy)(&fNPP, &sdata), fLibrary, this);
|
||||
NS_TRY_SAFE_CALL_RETURN(error, (*mCallbacks->destroy)(&mNPP, &sdata), mLibrary, this);
|
||||
|
||||
NPP_PLUGIN_LOG(PLUGIN_LOG_NORMAL,
|
||||
("NPP Destroy called: this=%p, npp=%p, return=%d\n", this, &fNPP, error));
|
||||
("NPP Destroy called: this=%p, npp=%p, return=%d\n", this, &mNPP, error));
|
||||
|
||||
nsJSNPRuntime::OnPluginDestroy(&fNPP);
|
||||
nsJSNPRuntime::OnPluginDestroy(&mNPP);
|
||||
|
||||
if (error != NPERR_NO_ERROR)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
@ -1117,13 +1116,13 @@ nsNPAPIPluginInstance::InitializePlugin()
|
|||
}
|
||||
}
|
||||
|
||||
NS_ENSURE_TRUE(fCallbacks->newp, NS_ERROR_FAILURE);
|
||||
NS_ENSURE_TRUE(mCallbacks->newp, NS_ERROR_FAILURE);
|
||||
|
||||
// XXX Note that the NPPluginType_* enums were crafted to be
|
||||
// backward compatible...
|
||||
|
||||
nsPluginMode mode;
|
||||
char* mimetype;
|
||||
const char* mimetype;
|
||||
NPError error;
|
||||
|
||||
GetMode(&mode);
|
||||
|
@ -1179,8 +1178,6 @@ nsNPAPIPluginInstance::InitializePlugin()
|
|||
}
|
||||
}
|
||||
|
||||
mIsJavaPlugin = nsPluginHost::IsJavaMIMEType(mimetype);
|
||||
|
||||
// Mark this instance as started before calling NPP_New because the plugin may
|
||||
// call other NPAPI functions, like NPN_GetURLNotify, that assume this is set
|
||||
// before returning. If the plugin returns failure, we'll clear it out below.
|
||||
|
@ -1189,13 +1186,13 @@ nsNPAPIPluginInstance::InitializePlugin()
|
|||
PRBool oldVal = mInPluginInitCall;
|
||||
mInPluginInitCall = PR_TRUE;
|
||||
|
||||
NS_TRY_SAFE_CALL_RETURN(error, (*fCallbacks->newp)((char*)mimetype, &fNPP, (PRUint16)mode, count, (char**)names, (char**)values, NULL), fLibrary,this);
|
||||
NS_TRY_SAFE_CALL_RETURN(error, (*mCallbacks->newp)((char*)mimetype, &mNPP, (PRUint16)mode, count, (char**)names, (char**)values, NULL), mLibrary,this);
|
||||
|
||||
mInPluginInitCall = oldVal;
|
||||
|
||||
NPP_PLUGIN_LOG(PLUGIN_LOG_NORMAL,
|
||||
("NPP New called: this=%p, npp=%p, mime=%s, mode=%d, argc=%d, return=%d\n",
|
||||
this, &fNPP, mimetype, mode, count, error));
|
||||
this, &mNPP, mimetype, mode, count, error));
|
||||
|
||||
if (error != NPERR_NO_ERROR) {
|
||||
mStarted = PR_FALSE;
|
||||
|
@ -1216,13 +1213,13 @@ NS_IMETHODIMP nsNPAPIPluginInstance::SetWindow(nsPluginWindow* window)
|
|||
#if defined (MOZ_WIDGET_GTK2)
|
||||
// bug 108347, flash plugin on linux doesn't like window->width <=
|
||||
// 0, but Java needs wants this call.
|
||||
if (!mIsJavaPlugin && window->type == nsPluginWindowType_Window &&
|
||||
if (!nsPluginHost::IsJavaMIMEType(mMIMEType) && window->type == nsPluginWindowType_Window &&
|
||||
(window->width <= 0 || window->height <= 0)) {
|
||||
return NS_OK;
|
||||
}
|
||||
#endif // MOZ_WIDGET
|
||||
|
||||
if (fCallbacks->setwindow) {
|
||||
if (mCallbacks->setwindow) {
|
||||
PluginDestructionGuard guard(this);
|
||||
|
||||
// XXX Turns out that NPPluginWindow and NPWindow are structurally
|
||||
|
@ -1233,7 +1230,7 @@ NS_IMETHODIMP nsNPAPIPluginInstance::SetWindow(nsPluginWindow* window)
|
|||
PRBool oldVal = mInPluginInitCall;
|
||||
mInPluginInitCall = PR_TRUE;
|
||||
|
||||
NS_TRY_SAFE_CALL_RETURN(error, (*fCallbacks->setwindow)(&fNPP, (NPWindow*)window), fLibrary, this);
|
||||
NS_TRY_SAFE_CALL_RETURN(error, (*mCallbacks->setwindow)(&mNPP, (NPWindow*)window), mLibrary, this);
|
||||
|
||||
mInPluginInitCall = oldVal;
|
||||
|
||||
|
@ -1307,9 +1304,9 @@ NS_IMETHODIMP nsNPAPIPluginInstance::Print(nsPluginPrint* platformPrint)
|
|||
// to be compatible with the older SDK versions and to match what
|
||||
// NPAPI and other browsers do, overwrite |window.type| field with one
|
||||
// more copy of |platformPrint|. See bug 113264
|
||||
if (fCallbacks) {
|
||||
PRUint16 sdkmajorversion = (fCallbacks->version & 0xff00)>>8;
|
||||
PRUint16 sdkminorversion = fCallbacks->version & 0x00ff;
|
||||
if (mCallbacks) {
|
||||
PRUint16 sdkmajorversion = (mCallbacks->version & 0xff00)>>8;
|
||||
PRUint16 sdkminorversion = mCallbacks->version & 0x00ff;
|
||||
if ((sdkmajorversion == 0) && (sdkminorversion < 11)) {
|
||||
// Let's copy platformPrint bytes over to where it was supposed to be
|
||||
// in older versions -- four bytes towards the beginning of the struct
|
||||
|
@ -1324,8 +1321,8 @@ NS_IMETHODIMP nsNPAPIPluginInstance::Print(nsPluginPrint* platformPrint)
|
|||
}
|
||||
}
|
||||
|
||||
if (fCallbacks->print)
|
||||
NS_TRY_SAFE_CALL_VOID((*fCallbacks->print)(&fNPP, thePrint), fLibrary, this);
|
||||
if (mCallbacks->print)
|
||||
NS_TRY_SAFE_CALL_VOID((*mCallbacks->print)(&mNPP, thePrint), mLibrary, this);
|
||||
|
||||
NPP_PLUGIN_LOG(PLUGIN_LOG_NORMAL,
|
||||
("NPP PrintProc called: this=%p, pDC=%p, [x=%d,y=%d,w=%d,h=%d], clip[t=%d,b=%d,l=%d,r=%d]\n",
|
||||
|
@ -1355,9 +1352,9 @@ NS_IMETHODIMP nsNPAPIPluginInstance::HandleEvent(nsPluginEvent* event, PRBool* h
|
|||
|
||||
PRInt16 result = 0;
|
||||
|
||||
if (fCallbacks->event) {
|
||||
if (mCallbacks->event) {
|
||||
#ifdef XP_MACOSX
|
||||
result = (*fCallbacks->event)(&fNPP, (void*)event->event);
|
||||
result = (*mCallbacks->event)(&mNPP, (void*)event->event);
|
||||
|
||||
#elif defined(XP_WIN) || defined(XP_OS2)
|
||||
NPEvent npEvent;
|
||||
|
@ -1365,15 +1362,15 @@ NS_IMETHODIMP nsNPAPIPluginInstance::HandleEvent(nsPluginEvent* event, PRBool* h
|
|||
npEvent.wParam = event->wParam;
|
||||
npEvent.lParam = event->lParam;
|
||||
|
||||
NS_TRY_SAFE_CALL_RETURN(result, (*fCallbacks->event)(&fNPP, (void*)&npEvent), fLibrary, this);
|
||||
NS_TRY_SAFE_CALL_RETURN(result, (*mCallbacks->event)(&mNPP, (void*)&npEvent), mLibrary, this);
|
||||
|
||||
#else // MOZ_X11 or other
|
||||
result = (*fCallbacks->event)(&fNPP, (void*)&event->event);
|
||||
result = (*mCallbacks->event)(&mNPP, (void*)&event->event);
|
||||
#endif
|
||||
|
||||
NPP_PLUGIN_LOG(PLUGIN_LOG_NOISY,
|
||||
("NPP HandleEvent called: this=%p, npp=%p, event=%d, return=%d\n",
|
||||
this, &fNPP, event->event, result));
|
||||
this, &mNPP, event->event, result));
|
||||
|
||||
*handled = result;
|
||||
}
|
||||
|
@ -1384,13 +1381,13 @@ NS_IMETHODIMP nsNPAPIPluginInstance::HandleEvent(nsPluginEvent* event, PRBool* h
|
|||
nsresult nsNPAPIPluginInstance::GetValueInternal(NPPVariable variable, void* value)
|
||||
{
|
||||
nsresult res = NS_OK;
|
||||
if (fCallbacks->getvalue && mStarted) {
|
||||
if (mCallbacks->getvalue && mStarted) {
|
||||
PluginDestructionGuard guard(this);
|
||||
|
||||
NS_TRY_SAFE_CALL_RETURN(res, (*fCallbacks->getvalue)(&fNPP, variable, value), fLibrary, this);
|
||||
NS_TRY_SAFE_CALL_RETURN(res, (*mCallbacks->getvalue)(&mNPP, variable, value), mLibrary, this);
|
||||
NPP_PLUGIN_LOG(PLUGIN_LOG_NORMAL,
|
||||
("NPP GetValue called: this=%p, npp=%p, var=%d, value=%d, return=%d\n",
|
||||
this, &fNPP, variable, value, res));
|
||||
this, &mNPP, variable, value, res));
|
||||
}
|
||||
|
||||
return res;
|
||||
|
@ -1433,7 +1430,7 @@ NS_IMETHODIMP nsNPAPIPluginInstance::GetValue(nsPluginInstanceVariable variable,
|
|||
nsresult nsNPAPIPluginInstance::GetNPP(NPP* aNPP)
|
||||
{
|
||||
if (aNPP)
|
||||
*aNPP = &fNPP;
|
||||
*aNPP = &mNPP;
|
||||
else
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
|
@ -1443,7 +1440,7 @@ nsresult nsNPAPIPluginInstance::GetNPP(NPP* aNPP)
|
|||
nsresult nsNPAPIPluginInstance::GetCallbacks(const NPPluginFuncs ** aCallbacks)
|
||||
{
|
||||
if (aCallbacks)
|
||||
*aCallbacks = fCallbacks;
|
||||
*aCallbacks = mCallbacks;
|
||||
else
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
|
@ -1488,7 +1485,7 @@ nsNPAPIPluginInstance::GetJSObject(JSContext *cx, JSObject** outObject)
|
|||
if (NS_FAILED(rv) || !npobj)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
*outObject = nsNPObjWrapper::GetNewOrUsed(&fNPP, cx, npobj);
|
||||
*outObject = nsNPObjWrapper::GetNewOrUsed(&mNPP, cx, npobj);
|
||||
|
||||
_releaseobject(npobj);
|
||||
|
||||
|
@ -1512,7 +1509,7 @@ nsNPAPIPluginInstance::DefineJavaProperties()
|
|||
}
|
||||
|
||||
// Get the NPObject wrapper for window.
|
||||
NPObject *window_obj = _getwindowobject(&fNPP);
|
||||
NPObject *window_obj = _getwindowobject(&mNPP);
|
||||
|
||||
if (!window_obj) {
|
||||
_releaseobject(plugin_obj);
|
||||
|
@ -1529,16 +1526,16 @@ nsNPAPIPluginInstance::DefineJavaProperties()
|
|||
|
||||
// Define the properties.
|
||||
|
||||
bool ok = _setproperty(&fNPP, window_obj, packages_id, &v);
|
||||
bool ok = _setproperty(&mNPP, window_obj, packages_id, &v);
|
||||
if (ok) {
|
||||
ok = _getproperty(&fNPP, plugin_obj, java_id, &v);
|
||||
ok = _getproperty(&mNPP, plugin_obj, java_id, &v);
|
||||
|
||||
if (ok && NPVARIANT_IS_OBJECT(v)) {
|
||||
// Set java_obj so that we properly release it at the end of
|
||||
// this function.
|
||||
java_obj = NPVARIANT_TO_OBJECT(v);
|
||||
|
||||
ok = _setproperty(&fNPP, window_obj, java_id, &v);
|
||||
ok = _setproperty(&mNPP, window_obj, java_id, &v);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1618,7 +1615,7 @@ NS_IMETHODIMP
|
|||
nsNPAPIPluginInstance::GetPluginAPIVersion(PRUint16* version)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(version);
|
||||
*version = fCallbacks->version;
|
||||
*version = mCallbacks->version;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1630,7 +1627,7 @@ nsNPAPIPluginInstance::PrivateModeStateChanged()
|
|||
|
||||
PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("nsNPAPIPluginInstance informing plugin of private mode state change this=%p\n",this));
|
||||
|
||||
if (fCallbacks->setvalue) {
|
||||
if (mCallbacks->setvalue) {
|
||||
PluginDestructionGuard guard(this);
|
||||
|
||||
nsCOMPtr<nsIPrivateBrowsingService> pbs = do_GetService(NS_PRIVATE_BROWSING_SERVICE_CONTRACTID);
|
||||
|
@ -1641,7 +1638,7 @@ nsNPAPIPluginInstance::PrivateModeStateChanged()
|
|||
return rv;
|
||||
|
||||
NPError error;
|
||||
NS_TRY_SAFE_CALL_RETURN(error, (*fCallbacks->setvalue)(&fNPP, NPNVprivateModeBool, &pme), fLibrary, this);
|
||||
NS_TRY_SAFE_CALL_RETURN(error, (*mCallbacks->setvalue)(&mNPP, NPNVprivateModeBool, &pme), mLibrary, this);
|
||||
return (error == NPERR_NO_ERROR) ? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
|
@ -1689,7 +1686,7 @@ nsNPAPIPluginInstance::ScheduleTimer(uint32_t interval, NPBool repeat, void (*ti
|
|||
{
|
||||
nsNPAPITimer *newTimer = new nsNPAPITimer();
|
||||
|
||||
newTimer->npp = &fNPP;
|
||||
newTimer->npp = &mNPP;
|
||||
|
||||
// generate ID that is unique to this instance
|
||||
uint32_t uniqueID = mTimers.Length();
|
||||
|
@ -1783,7 +1780,7 @@ nsNPAPIPluginInstance::ForceRedraw()
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNPAPIPluginInstance::GetMIMEType(char* *result)
|
||||
nsNPAPIPluginInstance::GetMIMEType(const char* *result)
|
||||
{
|
||||
if (!mMIMEType)
|
||||
*result = "";
|
||||
|
|
|
@ -136,11 +136,11 @@ protected:
|
|||
// A pointer to the plugin's callback functions. This information
|
||||
// is actually stored in the plugin class (<b>nsPluginClass</b>),
|
||||
// and is common for all plugins of the class.
|
||||
NPPluginFuncs* fCallbacks;
|
||||
NPPluginFuncs* mCallbacks;
|
||||
|
||||
// The structure used to communicate between the plugin instance and
|
||||
// the browser.
|
||||
NPP_t fNPP;
|
||||
NPP_t mNPP;
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
NPDrawingModel mDrawingModel;
|
||||
|
@ -148,17 +148,16 @@ protected:
|
|||
|
||||
// these are used to store the windowless properties
|
||||
// which the browser will later query
|
||||
PRPackedBool mWindowless;
|
||||
PRPackedBool mTransparent;
|
||||
PRPackedBool mStarted;
|
||||
PRPackedBool mCached;
|
||||
PRPackedBool mIsJavaPlugin;
|
||||
PRPackedBool mWantsAllNetworkStreams;
|
||||
PRPackedBool mWindowless;
|
||||
PRPackedBool mTransparent;
|
||||
PRPackedBool mStarted;
|
||||
PRPackedBool mCached;
|
||||
PRPackedBool mWantsAllNetworkStreams;
|
||||
|
||||
public:
|
||||
// True while creating the plugin, or calling NPP_SetWindow() on it.
|
||||
PRPackedBool mInPluginInitCall;
|
||||
PRLibrary* fLibrary;
|
||||
PRLibrary* mLibrary;
|
||||
nsInstanceStream *mStreams;
|
||||
|
||||
private:
|
||||
|
|
|
@ -531,7 +531,7 @@ nsPluginInstanceTag * nsPluginInstanceTagList::find(const char * mimetype)
|
|||
if (!p->mInstance)
|
||||
continue;
|
||||
|
||||
char* mt;
|
||||
const char* mt;
|
||||
nsresult rv = p->mInstance->GetMIMEType(&mt);
|
||||
if (NS_FAILED(rv))
|
||||
continue;
|
||||
|
|
|
@ -178,7 +178,7 @@ MRESULT EXPENTRY PluginWndProc(HWND hWnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
|||
nsCOMPtr<nsIPluginInstance> inst;
|
||||
win->GetPluginInstance(inst);
|
||||
if (inst) {
|
||||
char* mimetype = nsnull;
|
||||
const char* mimetype = nsnull;
|
||||
inst->GetMIMEType(&mimetype);
|
||||
if (mimetype) {
|
||||
if (!strcmp(mimetype, "application/x-shockwave-flash"))
|
||||
|
|
|
@ -225,7 +225,7 @@ static LRESULT CALLBACK PluginWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
|
|||
// Flash will need special treatment later
|
||||
if (win->mPluginType == nsPluginType_Unknown) {
|
||||
if (inst) {
|
||||
char* mimetype = nsnull;
|
||||
const char* mimetype = nsnull;
|
||||
inst->GetMIMEType(&mimetype);
|
||||
if (mimetype) {
|
||||
if (!strcmp(mimetype, "application/x-shockwave-flash"))
|
||||
|
|
|
@ -1015,8 +1015,13 @@ LoginManagerStorage_mozStorage.prototype = {
|
|||
|
||||
// Wrap in a transaction for better performance.
|
||||
this._dbConnection.beginTransaction();
|
||||
for each (let login in logins)
|
||||
this._addLogin(login, true);
|
||||
for each (let login in logins) {
|
||||
try {
|
||||
this._addLogin(login, true);
|
||||
} catch (e) {
|
||||
this.log("_importLegacySignons failed to add login: " + e);
|
||||
}
|
||||
}
|
||||
let disabledHosts = legacy.getAllDisabledHosts({});
|
||||
for each (let hostname in disabledHosts)
|
||||
this.setLoginSavingEnabled(hostname, false);
|
||||
|
@ -1562,8 +1567,8 @@ LoginManagerStorage_mozStorage.prototype = {
|
|||
}
|
||||
|
||||
// Finalize all statements to free memory, avoid errors later
|
||||
for (let i = 0; i < this._dbStmts.length; i++)
|
||||
this._dbStmts[i].finalize();
|
||||
for each (let stmt in this._dbStmts)
|
||||
stmt.finalize();
|
||||
this._dbStmts = [];
|
||||
|
||||
// Close the connection, ignore 'already closed' error
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
#2e
|
||||
.
|
||||
http://dummyhost.mozilla.org
|
||||
put_user_here
|
||||
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECEnlbhAkNBbBBBCexD5eaffSLGH/ORiFlQ4X
|
||||
*put_pw_here
|
||||
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECHmiTaseYjkkBBAA0ILJTFSa5CnlpD5PTEYR
|
||||
|
||||
.
|
||||
http://dummyhost2.mozilla.org
|
||||
put_user_here2
|
||||
*MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECEnlbhAkNBbBBBCexD5eaffSLGH/ORiFlQ4X
|
||||
*put_pw_here2
|
||||
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECHmiTaseYjkkBBAA0ILJTFSa5CnlpD5PTEYR
|
||||
---
|
||||
put_user_here3
|
||||
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECEnlbhAkNBbBBBCexD5eaffSLGH/ORiFlQ4X
|
||||
*put_pw_here3
|
||||
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECHmiTaseYjkkBBAA0ILJTFSa5CnlpD5PTEYR
|
||||
|
||||
put_user_here
|
||||
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECEnlbhAkNBbBBBCexD5eaffSLGH/ORiFlQ4X
|
||||
*put_pw_here4
|
||||
*MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECHmiTaseYjkkBBAA0ILJTFSa5CnlpD5PTEYR
|
||||
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECHmiTaseYjkkBBAA0ILJTFSa5CnlpD5PTEYR
|
||||
.
|
||||
http://dummyhost4.mozilla.org
|
||||
|
||||
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECEnlbhAkNBbBBBCexD5eaffSLGH/ORiFlQ4X
|
||||
*password
|
||||
MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECHmiTaseYjkkBBAA0ILJTFSa5CnlpD5PTEYR
|
||||
|
||||
.
|
|
@ -266,6 +266,34 @@ LoginTest.checkStorageData(storage, [], [testuser1]);
|
|||
LoginTest.deleteFile(OUTDIR, "signons-427033-1.sqlite");
|
||||
|
||||
|
||||
/*
|
||||
* ---------------------- Bug 500822 ----------------------
|
||||
* Importing passwords to mozstorage can fail when signons3.txt is corrupted.
|
||||
*/
|
||||
|
||||
|
||||
/* ========== 13 ========== */
|
||||
testnum++;
|
||||
|
||||
testdesc = "checking import of partially corrupted signons3.txt"
|
||||
|
||||
testuser1.init("http://dummyhost.mozilla.org", "", null,
|
||||
"dummydude", "itsasecret", "put_user_here", "put_pw_here");
|
||||
storage = LoginTest.initStorage(INDIR, "signons-500822-1.txt",
|
||||
OUTDIR, "signons-500822-1.sqlite");
|
||||
|
||||
// Using searchLogins to check that we have the correct first entry. Tests for
|
||||
// searchLogin are in test_storage_mozStorage_7.js. Other entries may be
|
||||
// corrupted, but we need to check for one valid login.
|
||||
let matchData = Cc["@mozilla.org/hash-property-bag;1"].createInstance(Ci.nsIWritablePropertyBag2);
|
||||
matchData.setPropertyAsAString("hostname", "http://dummyhost.mozilla.org");
|
||||
matchData.setPropertyAsAString("usernameField", "put_user_here");
|
||||
logins = storage.searchLogins({}, matchData);
|
||||
do_check_eq(1, logins.length, "should match 1 login");
|
||||
|
||||
LoginTest.deleteFile(OUTDIR, "signons-500822-1.sqlite");
|
||||
|
||||
|
||||
} catch (e) {
|
||||
throw "FAILED in test #" + testnum + " -- " + testdesc + ": " + e;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
function closeWindow(aClose, aPromptFunction)
|
||||
{
|
||||
# Closing the last window doesn't quit the application on OS X.
|
||||
#ifndef XP_MACOSX
|
||||
var windowCount = 0;
|
||||
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
||||
.getService(Components.interfaces.nsIWindowMediator);
|
||||
|
@ -11,8 +13,6 @@ function closeWindow(aClose, aPromptFunction)
|
|||
break;
|
||||
}
|
||||
|
||||
# Closing the last window doesn't quit the application on OS X.
|
||||
#ifndef XP_MACOSX
|
||||
// If we're down to the last window and someone tries to shut down, check to make sure we can!
|
||||
if (windowCount == 1 && !canQuitApplication())
|
||||
return false;
|
||||
|
|
|
@ -85,6 +85,7 @@ _TEST_FILES = findbar_window.xul \
|
|||
test_autocomplete4.xul \
|
||||
test_keys.xul \
|
||||
window_keys.xul \
|
||||
test_showcaret.xul \
|
||||
$(NULL)
|
||||
|
||||
# test_panel_focus.xul won't work if the Full Keyboard Access preference is set to
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
|
||||
|
||||
<window title="Show Caret Test"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/MochiKit/packed.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
|
||||
|
||||
<iframe id="f1" width="100" height="100" onload="frameLoaded()"
|
||||
src="data:text/html,%3Cbody%20style='height:%208000px'%3E%3Cp%3EHello%3C/p%3EGoodbye%3C/body%3E"/>
|
||||
<iframe id="f2" type="content" showcaret="true" width="100" height="100" onload="frameLoaded()"
|
||||
src="data:text/html,%3Cbody%20style='height:%208000px'%3E%3Cp%3EHello%3C/p%3EGoodbye%3C/body%3E"/>
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
|
||||
var framesLoaded = 0;
|
||||
function frameLoaded() { if (++framesLoaded == 2) runTest(); }
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
function runTest()
|
||||
{
|
||||
var sel1 = frames[0].getSelection();
|
||||
sel1.collapse(frames[0].document.body, 0);
|
||||
|
||||
var sel2 = frames[1].getSelection();
|
||||
sel2.collapse(frames[1].document.body, 0);
|
||||
|
||||
window.frames[0].focus();
|
||||
document.commandDispatcher.getControllerForCommand("cmd_scrollBottom").doCommand("cmd_scrollBottom");
|
||||
|
||||
ok(frames[0].scrollY > 0, "scrollY for non-showcaret");
|
||||
is(sel1.focusNode, frames[0].document.body, "focusNode for non-showcaret");
|
||||
is(sel1.focusOffset, 0, "focusOffset for non-showcaret");
|
||||
|
||||
window.frames[1].focus();
|
||||
document.commandDispatcher.getControllerForCommand("cmd_scrollBottom").doCommand("cmd_scrollBottom");
|
||||
|
||||
is(frames[1].scrollY, 0, "scrollY for showcaret");
|
||||
isnot(sel2.focusNode, frames[1].document.body, "focusNode for showcaret");
|
||||
ok(sel2.anchorOffset > 0, "focusOffset for showcaret");
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<p id="display">
|
||||
</p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
|
||||
</window>
|
|
@ -363,6 +363,8 @@
|
|||
}
|
||||
})]]></field>
|
||||
|
||||
<field name="_destroyed">false</field>
|
||||
|
||||
<constructor><![CDATA[
|
||||
// These elements are accessed frequently and are therefore cached
|
||||
this._findField = this.getElement("findbar-textbox");
|
||||
|
@ -403,28 +405,41 @@
|
|||
]]></constructor>
|
||||
|
||||
<destructor><![CDATA[
|
||||
// It is possible that the findbar may be destroyed before any
|
||||
// documents it is listening to (see nsIEditActionListener code below).
|
||||
// Thus, to avoid leaking, if we are listening to any editors, unhook
|
||||
// ourselves now, and remove our cached copies
|
||||
if (this._editors) {
|
||||
for (var x = this._editors.length - 1; x >= 0; --x)
|
||||
this._unhookListenersAtIndex(x);
|
||||
}
|
||||
|
||||
this.browser = null;
|
||||
|
||||
var prefsvc =
|
||||
Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch2);
|
||||
prefsvc.removeObserver("accessibility.typeaheadfind",
|
||||
this._observer);
|
||||
prefsvc.removeObserver("accessibility.typeaheadfind.linksonly",
|
||||
this._observer);
|
||||
prefsvc.removeObserver("accessibility.typeaheadfind.casesensitive",
|
||||
this._observer);
|
||||
this.destroy();
|
||||
]]></destructor>
|
||||
|
||||
<!-- This is necessary because the destructor isn't called when
|
||||
we are removed from a document that is not destroyed. This
|
||||
needs to be explicitly called in this case -->
|
||||
<method name="destroy">
|
||||
<body><![CDATA[
|
||||
if (this._destroyed)
|
||||
return;
|
||||
this._destroyed = true;
|
||||
|
||||
// It is possible that the findbar may be destroyed before any
|
||||
// documents it is listening to (see nsIEditActionListener code below).
|
||||
// Thus, to avoid leaking, if we are listening to any editors, unhook
|
||||
// ourselves now, and remove our cached copies
|
||||
if (this._editors) {
|
||||
for (var x = this._editors.length - 1; x >= 0; --x)
|
||||
this._unhookListenersAtIndex(x);
|
||||
}
|
||||
|
||||
this.browser = null;
|
||||
|
||||
var prefsvc =
|
||||
Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch2);
|
||||
prefsvc.removeObserver("accessibility.typeaheadfind",
|
||||
this._observer);
|
||||
prefsvc.removeObserver("accessibility.typeaheadfind.linksonly",
|
||||
this._observer);
|
||||
prefsvc.removeObserver("accessibility.typeaheadfind.casesensitive",
|
||||
this._observer);
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="_setFindCloseTimeout">
|
||||
<body><![CDATA[
|
||||
if (this._quickFindTimeout)
|
||||
|
|
|
@ -161,6 +161,7 @@ function test()
|
|||
return;
|
||||
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
win.focus();
|
||||
let doc = win.document;
|
||||
|
||||
let stmt = db.createStatement("SELECT COUNT(*) FROM moz_downloads");
|
||||
|
|
|
@ -227,6 +227,7 @@ function test()
|
|||
return;
|
||||
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
win.focus();
|
||||
|
||||
// Now we can run our tests
|
||||
for each (let t in testFuncs)
|
||||
|
|
|
@ -179,6 +179,7 @@ function test()
|
|||
return;
|
||||
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
win.focus();
|
||||
// Send the enter key to Download Manager to retry the download
|
||||
synthesizeKey("VK_ENTER", {}, win);
|
||||
os.removeObserver(testObs, DLMGR_UI_DONE);
|
||||
|
|
|
@ -122,6 +122,7 @@ function test()
|
|||
return;
|
||||
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
win.focus();
|
||||
let $ = function(aId) win.document.getElementById(aId);
|
||||
let downloadView = $("downloadView");
|
||||
|
||||
|
|
|
@ -118,6 +118,7 @@ function test()
|
|||
return;
|
||||
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
win.focus();
|
||||
let $ = function(aId) win.document.getElementById(aId);
|
||||
let downloadView = $("downloadView");
|
||||
let searchbox = $("searchbox");
|
||||
|
|
|
@ -108,6 +108,7 @@ function runTest()
|
|||
let testObs = {
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
win.focus();
|
||||
let doc = win.document;
|
||||
let searchbox = doc.getElementById("searchbox");
|
||||
let clearButton = doc.getElementById("clearListButton");
|
||||
|
|
|
@ -83,6 +83,7 @@ function test()
|
|||
return;
|
||||
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
win.focus();
|
||||
|
||||
// Put in a value to clear out
|
||||
let search = win.document.getElementById("searchbox");
|
||||
|
|
|
@ -117,6 +117,7 @@ function test()
|
|||
return;
|
||||
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
win.focus();
|
||||
let $ = function(aId) win.document.getElementById(aId);
|
||||
let downloadView = $("downloadView");
|
||||
|
||||
|
|
|
@ -117,6 +117,7 @@ function test()
|
|||
return;
|
||||
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
win.focus();
|
||||
let $ = function(aId) win.document.getElementById(aId);
|
||||
let downloadView = $("downloadView");
|
||||
let searchbox = $("searchbox");
|
||||
|
|
|
@ -131,6 +131,7 @@ function test()
|
|||
return;
|
||||
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
win.focus();
|
||||
let doc = win.document;
|
||||
|
||||
let richlistbox = doc.getElementById("downloadView");
|
||||
|
|
|
@ -107,6 +107,7 @@ function test()
|
|||
obs.removeObserver(testObs, DLMGR_UI_DONE);
|
||||
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
win.focus();
|
||||
let defaultTitle = win.document.documentElement.getAttribute("statictitle");
|
||||
is(win.document.title, defaultTitle,
|
||||
"The downloads window title is correct outside of the private browsing mode");
|
||||
|
|
|
@ -121,6 +121,7 @@ function test()
|
|||
return;
|
||||
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
win.focus();
|
||||
let doc = win.document;
|
||||
|
||||
// Note: This also tests the ordering of the display
|
||||
|
|
|
@ -125,6 +125,7 @@ function test()
|
|||
return;
|
||||
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
win.focus();
|
||||
let $ = function(aId) win.document.getElementById(aId);
|
||||
let downloadView = $("downloadView");
|
||||
let searchbox = $("searchbox");
|
||||
|
|
|
@ -108,6 +108,7 @@ function test()
|
|||
return;
|
||||
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
win.focus();
|
||||
|
||||
// Now we can run our tests
|
||||
for each (let t in testFuncs)
|
||||
|
|
|
@ -116,6 +116,7 @@ function test()
|
|||
return;
|
||||
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
win.focus();
|
||||
|
||||
var checkSelectAndRemove = function(alreadyFocused)
|
||||
{
|
||||
|
|
|
@ -173,6 +173,7 @@ function test()
|
|||
return;
|
||||
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
win.focus();
|
||||
let doc = win.document;
|
||||
dm.addListener(new bug413985obs(win));
|
||||
|
||||
|
|
|
@ -92,6 +92,7 @@ function test()
|
|||
return;
|
||||
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMWindow);
|
||||
win.focus();
|
||||
|
||||
// Note: This test will not be valid if the download list is built
|
||||
// synchronously in Startup in downloads.js
|
||||
|
|
|
@ -85,6 +85,7 @@ SimpleTest.waitForExplicitFinish();
|
|||
let windowObserver = {
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
|
||||
win.focus();
|
||||
|
||||
win.addEventListener("load", function onLoad(event) {
|
||||
win.removeEventListener("load", onLoad, false);
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
</hbox>
|
||||
|
||||
<vbox flex="1">
|
||||
<description id="item-action-text"/>
|
||||
<label id="item-action-text" for="items"/>
|
||||
<richlistbox id="items" flex="1"
|
||||
ondblclick="dialog.onDblClick();"
|
||||
onselect="dialog.updateOKButton();">
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
mozilla/tools/build
|
||||
===================
|
||||
|
||||
This directory is for tools that facilitate the building of
|
||||
the mozilla source code (the browser, the sdks, etc.).
|
||||
|
||||
|
||||
Table of Contents
|
||||
=================
|
||||
|
||||
* sync-all-configures
|
||||
Run from cron to generate configure on all desired branches.
|
||||
|
||||
* sync-configure
|
||||
Current script to generate configure from configure.in and check in.
|
||||
|
||||
* mozilla-src-tarball
|
||||
Used to create nightly tarball.
|
||||
|
||||
* gnome-tip-nightly
|
||||
A tcsh shell script to pull and build gnome packages from
|
||||
the gnome anonymous cvs server. This is useful for keeping
|
||||
the toolkits needed to build mozilla on unix up to date.
|
||||
Typical usage for mozilla prereq building:
|
||||
gnome-tip-nightly gtk+ /builds/gnome /usr/local --with-threads=posix
|
||||
gnome-tip-nightly glib /builds/gnome /usr/local --with-threads=posix
|
||||
|
||||
* check-modules.pl
|
||||
A perl script to check the modules file for duplicates and syntax errors.
|
||||
Usage: check-modules.pl CVSROOT/modules
|
||||
check-modules.pl -v CVSROOT/modules (verbose: Print the modules out)
|
|
@ -1,274 +0,0 @@
|
|||
#!/usr/bin/env perl
|
||||
|
||||
# ***** 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 this file as it was released upon February 25, 1999.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Netscape Communications Corporation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 1999
|
||||
# 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 *****
|
||||
|
||||
#
|
||||
# check-modules.pl - Check cvs modules file for duplicates and syntax errors.
|
||||
#
|
||||
# TODO:
|
||||
# - Parse output of 'cvs co -c' command in addition to the raw file.
|
||||
#
|
||||
# Send comments, improvements, bugs to Steve Lamm (slamm@netscape.com).
|
||||
|
||||
# $Id: check-modules.pl,v 1.4 2004/04/25 21:07:13 gerv%gerv.net Exp $
|
||||
|
||||
require 5.004;
|
||||
|
||||
use Getopt::Std;
|
||||
|
||||
sub usage
|
||||
{
|
||||
my ($progname) = $0 =~ /([^\/]+)$/;
|
||||
die "Usage: $progname [options] [<module_file>]
|
||||
Reads from stdin if no file is given.
|
||||
Options:
|
||||
-v Verbose. Print the modules and what they include.
|
||||
-h Print this usage message.
|
||||
";
|
||||
}
|
||||
|
||||
&usage if !getopts('hv');
|
||||
&usage if defined($opt_h);
|
||||
|
||||
######################################################################
|
||||
# begin main
|
||||
|
||||
|
||||
# The subroutine &parse_input creates the globals @module_names,
|
||||
# %module_tree, and %line_number (described below).
|
||||
&parse_input;
|
||||
|
||||
foreach $module (@module_names)
|
||||
{
|
||||
&check_module($module);
|
||||
}
|
||||
|
||||
# end main
|
||||
######################################################################
|
||||
# begin subroutines
|
||||
|
||||
sub parse_input
|
||||
{
|
||||
# Globals created:
|
||||
# @module_names - List of module names in the order they are seen.
|
||||
# %module_tree - Hash table of lists. Keys are module names.
|
||||
# Values are lists of module names and diretories.
|
||||
# %line_number - Hash indexed by module name and module item.
|
||||
# Values are line numbers.
|
||||
|
||||
@module_names = ();
|
||||
%module_tree = ();
|
||||
%line_number = ();
|
||||
|
||||
while (<>)
|
||||
{
|
||||
next if /^\#/ || /^\s*$/;
|
||||
|
||||
# Check for a module definition
|
||||
if (/^([_a-zA-Z0-9]+)\s+(?:-l\s+)?-a\s*(.*)$/)
|
||||
{
|
||||
my ($module_name) = $1;
|
||||
my (@sub_items) = ();
|
||||
my ($line) = $2;
|
||||
|
||||
push @module_names, $module_name;
|
||||
|
||||
# Read line continuations (i.e. lines with '\' on the end).
|
||||
while ($line =~ /\\$/)
|
||||
{
|
||||
chomp $line;
|
||||
$line =~ s/^\s*(.*?)\s*\\$/$1/;
|
||||
if (length($line) > 0)
|
||||
{
|
||||
my (@line_items) = split(/\s+/, $line);
|
||||
push @sub_items, @line_items;
|
||||
&save_line_numbers($module_name, $., @line_items);
|
||||
}
|
||||
$line = <>;
|
||||
}
|
||||
chomp $line;
|
||||
$line =~ s/^\s*(.*?)\s*$/$1/;
|
||||
my (@line_items) = split(/\s+/, $line);
|
||||
push @sub_items, @line_items;
|
||||
&save_line_numbers($module_name, $., @line_items);
|
||||
|
||||
$module_tree{$module_name} = \@sub_items;
|
||||
}
|
||||
else
|
||||
{
|
||||
die "Unexpected input: line $.: $_\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub check_module
|
||||
{
|
||||
my ($module) = $_[0];
|
||||
my ($sub_module, $sub_dir, $prev_module);
|
||||
|
||||
# Globals created:
|
||||
# %have_checked - List of modules already checked.
|
||||
# %full_list - All the directories for a module.
|
||||
# Indexed by module and sub directory.
|
||||
# Values are the module that added the directory.
|
||||
|
||||
return if defined($have_checked{$module});
|
||||
|
||||
$full_list{$module} = {};
|
||||
|
||||
foreach $sub_module ( &get_modules($module) )
|
||||
{
|
||||
&check_module($sub_module);
|
||||
|
||||
# Add the directories of the sub_module to this module
|
||||
while (($sub_dir, $prev_module) = each %{$full_list{$sub_module}})
|
||||
{
|
||||
$full_list{$module}{$sub_dir} = $prev_module;
|
||||
}
|
||||
}
|
||||
foreach $sub_dir ( &get_directories($module) )
|
||||
{
|
||||
if (defined($full_list{$module}{$sub_dir}))
|
||||
{
|
||||
my ($previous_module) = $full_list{$module}{$sub_dir};
|
||||
|
||||
&warn_multiple($sub_dir, $module, $previous_module);
|
||||
}
|
||||
else
|
||||
{
|
||||
$full_list{$module}{$sub_dir} = $module;
|
||||
|
||||
# Check if parent or child of directory was previously added
|
||||
#
|
||||
&check_inclusion($sub_dir, $module);
|
||||
}
|
||||
}
|
||||
if (defined($opt_v))
|
||||
{
|
||||
print "$module\n";
|
||||
while (($sub_dir, $prev_module) = each %{$full_list{$module}})
|
||||
{
|
||||
print " $sub_dir, $prev_module\n";
|
||||
}
|
||||
}
|
||||
$have_checked{$module} = 1;
|
||||
}
|
||||
|
||||
sub get_modules
|
||||
{
|
||||
my ($module) = $_[0];
|
||||
my (@output) = ();
|
||||
my ($sub_item);
|
||||
|
||||
foreach $sub_item ( @{ $module_tree{$module} } )
|
||||
{
|
||||
push @output, $sub_item if defined($module_tree{$sub_item});
|
||||
}
|
||||
return @output;
|
||||
}
|
||||
|
||||
sub get_directories
|
||||
{
|
||||
my ($module) = $_[0];
|
||||
my (@output) = ();
|
||||
my ($sub_item);
|
||||
|
||||
foreach $sub_item ( @{ $module_tree{$module} } )
|
||||
{
|
||||
push @output, $sub_item unless defined($module_tree{$sub_item});
|
||||
}
|
||||
return @output;
|
||||
}
|
||||
|
||||
sub save_line_numbers
|
||||
{
|
||||
my ($module, $line_num, @sub_items) = @_;
|
||||
my ($sub_item);
|
||||
|
||||
foreach $sub_item (@sub_items)
|
||||
{
|
||||
if (defined($line_number{$module}{$sub_item}))
|
||||
{
|
||||
$line_number{$module}{$sub_item} =
|
||||
"$line_number{$module}{$sub_item}, $line_num";
|
||||
}
|
||||
else
|
||||
{
|
||||
$line_number{$module}{$sub_item} = $line_num;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub warn_multiple
|
||||
{
|
||||
my ($sub_item, $module, $previous_module) = @_;
|
||||
my ($line_txt) = '';
|
||||
|
||||
my (@lines) = split(', ', $line_number{$module}{$sub_item});
|
||||
|
||||
push(@lines, split(', ', $line_number{$previous_module}{$sub_item}))
|
||||
unless $previous_module eq $module;
|
||||
|
||||
$line_txt = "lines ".join(', ', sort { $a <=> $b } @lines);
|
||||
|
||||
warn "Error: Multiple listing: $line_txt: $sub_item.\n";
|
||||
}
|
||||
|
||||
sub check_inclusion
|
||||
{
|
||||
my ($sub_dir, $module) = @_;
|
||||
my ($dir);
|
||||
|
||||
foreach $dir (keys %{$full_list{$module}})
|
||||
{
|
||||
next if $dir eq $sub_dir;
|
||||
if (length($dir) < length($sub_dir))
|
||||
{
|
||||
my ($temp) = $sub_dir;
|
||||
$sub_dir = $dir;
|
||||
$dir = $temp;
|
||||
}
|
||||
if ($dir =~ /^$sub_dir\//)
|
||||
{
|
||||
warn "Warning: $dir (line "
|
||||
.$line_number{$full_list{$module}{$dir}}{$dir}
|
||||
.") pulled by $sub_dir (line "
|
||||
.$line_number{$full_list{$module}{$sub_dir}}{$sub_dir}
|
||||
.")\n";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
#!/bin/tcsh -f
|
||||
# Original Author: Alec Flett <alecf@netscape.com>
|
||||
# Shameless Modifier: leaf nunes <leaf@mozilla.org>
|
||||
# Last checked in: $Date: 1999/02/09 08:09:58 $
|
||||
# Last checked in by: $Author: leaf%mozilla.org $
|
||||
|
||||
test $# -gt 2 || echo "Usage: $0 package builddir prefix [options]" && exit
|
||||
|
||||
set package=$1
|
||||
set builddir=$2
|
||||
set prefix=$3
|
||||
set options=$4
|
||||
|
||||
|
||||
# add any special bin directories for the build here
|
||||
set path = ( $path )
|
||||
|
||||
setenv LD_LIBRARY_PATH /lib:/usr/lib:/usr/local/lib:/usr/openwin/lib:/tools/contrib/lib
|
||||
|
||||
|
||||
cd $builddir
|
||||
|
||||
cvs -d :pserver:anonymous@anoncvs.gnome.org:/cvs/gnome checkout $package
|
||||
|
||||
|
||||
cd $package
|
||||
# find the version from the RPM spec file
|
||||
|
||||
set ver = `grep '%define.*\<ver\>' $package.spec | awk '{print $3}'`
|
||||
|
||||
# combine package and version to get the package-specific destination
|
||||
set packagever = $package-$ver
|
||||
set dest = $prefix/$packagever
|
||||
|
||||
|
||||
|
||||
# build
|
||||
echo installing in $dest
|
||||
rm config.cache
|
||||
rm config.status
|
||||
./autogen.sh $options --prefix=$dest # --with-threads=posix
|
||||
|
||||
# clean up last night's build
|
||||
find . -name '.deps' -exec rm -rf {} \; >& /dev/null
|
||||
find . -name '.libs' -exec rm -rf {} \; >& /dev/null
|
||||
gmake clean
|
||||
|
||||
# now build
|
||||
gmake
|
||||
gmake install
|
||||
|
||||
# remove the old installation of this version
|
||||
(find $dest -type l && find $dest -type f) | \
|
||||
sed s%$dest/%% | xargs -i% rm $prefix/%
|
||||
|
||||
# symlink in the new installation
|
||||
pushd `pwd`
|
||||
cd $prefix
|
||||
lndir -ignorelinks $packagever
|
||||
popd
|
||||
|
||||
|
||||
# maybe add some tests to see if the build was successful.
|
|
@ -1,90 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
DEBUG=0
|
||||
SSH=ssh
|
||||
SCP=scp
|
||||
BUILD=/builds/seamonkey
|
||||
CCACHE_DIR=/builds/.cltbldccache
|
||||
PACKAGE=/builds/seamonkey/package
|
||||
if [ ! -d $PACKAGE ] ; then
|
||||
mkdir -p $PACKAGE
|
||||
else
|
||||
rm -f $PACKAGE/mozilla-source*
|
||||
fi
|
||||
|
||||
PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/tools/ns/bin:/usr/local/gnome/bin
|
||||
|
||||
CVS_CO_OPTION=""
|
||||
MILESTONE_SUFFIX=""
|
||||
DELIVERYDIR="/home/ftp/pub/mozilla/nightly/`date +%Y-%m-%d-%H`-trunk"
|
||||
|
||||
while getopts r:m:d o; do
|
||||
case "$o" in
|
||||
r) tag="$OPTARG";;
|
||||
m) milestone="$OPTARG";;
|
||||
d) DEBUG=1;;
|
||||
[?]) print >&2 "Usage: $0 [-r tag] [-m milestone] [-d] ..."
|
||||
exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ $tag. != "." -a $milestone. != "." ] ; then
|
||||
CVS_CO_OPTION="-r $tag"
|
||||
DELIVERYDIR="/home/cltbld/mozilla${milestone}/src"
|
||||
MILESTONE_SUFFIX="-$milestone"
|
||||
else
|
||||
milestone=""
|
||||
fi
|
||||
|
||||
if [ $DEBUG -ne 0 ] ; then
|
||||
SSH="echo ssh"
|
||||
SCP="echo scp"
|
||||
fi
|
||||
|
||||
[ -f ${BUILD}/seamonkey-config ] && MOZCONFIG=${BUILD}/seamonkey-config
|
||||
CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
|
||||
export BUILD PACKAGE PATH DELIVERYDIR MOZCONFIG CVSROOT CCACHE_DIR
|
||||
|
||||
date
|
||||
[ ! -e $BUILD ] && mkdir -p $BUILD
|
||||
cd $BUILD
|
||||
rm -rf mozilla
|
||||
cvs -d${CVSROOT} co $CVS_CO_OPTION mozilla/client.mk
|
||||
cd mozilla; gmake -f client.mk checkout
|
||||
gmake -f client.mk checkout BUILD_MODULES=psm
|
||||
cvs up $CVS_CO_OPTION security/makefile.win
|
||||
cvs up $CVS_CO_OPTION -d other-licenses
|
||||
# Per Gervase Markham on 1/19, do not include other-licenses/branding/.
|
||||
rm -rf other-licenses/branding/
|
||||
cvs up $CVS_CO_OPTION -d calendar
|
||||
cd ..
|
||||
rm -f mozilla-source*
|
||||
tar -cf mozilla-source${MILESTONE_SUFFIX}.tar mozilla
|
||||
gzip -9 -c mozilla-source${MILESTONE_SUFFIX}.tar > mozilla-source${MILESTONE_SUFFIX}.tar.gz
|
||||
bzip2 mozilla-source${MILESTONE_SUFFIX}.tar
|
||||
mv mozilla-source${MILESTONE_SUFFIX}.tar* $PACKAGE/
|
||||
cd mozilla/
|
||||
### timebomb stuff. obsolete?
|
||||
# cd config/
|
||||
# perl5 set-timebomb.pl
|
||||
# cd ..
|
||||
gmake -f client.mk build
|
||||
cd dist/
|
||||
if [ -f bin/seamonkey-bin ] ; then
|
||||
cd $PACKAGE
|
||||
$SSH stage.mozilla.org mkdir -p ${DELIVERYDIR}
|
||||
$SCP mozilla-source${MILESTONE_SUFFIX}.tar* \
|
||||
stage.mozilla.org:${DELIVERYDIR}
|
||||
$SSH stage.mozilla.org chmod -R 775 \
|
||||
${DELIVERYDIR}
|
||||
|
||||
if [ $milestone. = . ] ; then
|
||||
$SSH stage.mozilla.org mkdir -p /home/ftp/pub/mozilla/nightly/latest-trunk
|
||||
$SCP mozilla-source${MILESTONE_SUFFIX}.tar* \
|
||||
stage.mozilla.org:/home/ftp/pub/mozilla/nightly/latest-trunk
|
||||
$SSH stage.mozilla.org chmod -R 775 \
|
||||
/home/ftp/pub/mozilla/nightly/latest-trunk
|
||||
fi
|
||||
fi
|
||||
date
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
for branch in HEAD MOZILLA_1_8_BRANCH MOZILLA_1_8_0_BRANCH; do
|
||||
$HOME/bin/sync-configure $branch
|
||||
done
|
|
@ -1,76 +0,0 @@
|
|||
#!/bin/sh -x
|
||||
|
||||
# 3/3/03 - Now Runs on bawb as cltbld
|
||||
# 5/1/03 - Now Runs on branch as cltbld
|
||||
# 2003/02/24 - Now runs on egg as cltbld
|
||||
# 2005/08/24 - Modified to take a branch argument (chase)
|
||||
# 2006-06-27 - Modified to use hostname -f (dbaron)
|
||||
|
||||
BRANCH="HEAD"
|
||||
if [ "x$1" != "x" ]; then
|
||||
BRANCH=$1
|
||||
fi
|
||||
|
||||
# Autoconf ***must*** be 2.13.
|
||||
AC="/usr/bin/autoconf-2.13"
|
||||
CVS="/usr/bin/cvs"
|
||||
CVSROOT='cltbld@cvs.mozilla.org:/cvsroot'
|
||||
CVS_RSH=ssh
|
||||
PATH="/usr/bin:/bin:/usr/local/bin:/usr/sbin:/usr/bsd:/sbin:/usr/bin:/bin:/usr/etc:/usr/ucb"
|
||||
TDIR="/tmp/c-s.$$"
|
||||
HOST=`/bin/hostname -f`
|
||||
|
||||
export CVSROOT CVS_RSH PATH
|
||||
|
||||
rm -rf ${TDIR}
|
||||
mkdir ${TDIR}
|
||||
cd ${TDIR}
|
||||
|
||||
use_tmpdir()
|
||||
{
|
||||
if [ "$BRANCH" = "HEAD" ]; then
|
||||
${CVS} -q checkout mozilla/configure.in mozilla/configure mozilla/build/autoconf mozilla/aclocal.m4
|
||||
else
|
||||
${CVS} -q checkout -r $BRANCH mozilla/configure.in mozilla/configure mozilla/build/autoconf mozilla/aclocal.m4
|
||||
fi
|
||||
|
||||
CO_STATUS=$?
|
||||
if [ $CO_STATUS != 0 ]
|
||||
then
|
||||
echo "ERROR cvs checkout exited with a non-zero exit code: $CO_STATUS"
|
||||
return $CO_STATUS
|
||||
fi
|
||||
|
||||
cd mozilla
|
||||
${AC} -l build/autoconf
|
||||
AC_STATUS=$?
|
||||
if [ $AC_STATUS != 0 ]
|
||||
then
|
||||
echo "ERROR autoconf exited with a non-zero exit code: $AC_STATUS"
|
||||
return $AC_STATUS
|
||||
fi
|
||||
|
||||
${CVS} diff configure >/dev/null 2>&1
|
||||
DIFF_STATUS=$?
|
||||
if [ $DIFF_STATUS == 1 ]
|
||||
then
|
||||
${CVS} commit -m"Automated update from host $HOST" configure
|
||||
CI_STATUS=$?
|
||||
if [ $CI_STATUS != 0 ]
|
||||
then
|
||||
echo "ERROR cvs commit exited with exit code: $CI_STATUS"
|
||||
return $CI_STATUS
|
||||
fi
|
||||
elif [ $DIFF_STATUS == 0 ]
|
||||
then
|
||||
return 0
|
||||
else
|
||||
echo "ERROR cvs diff exited with exit code: $DIFF_STATUS"
|
||||
return $DIFF_STATUS
|
||||
fi
|
||||
}
|
||||
|
||||
use_tmpdir
|
||||
result=$?
|
||||
rm -rf ${TDIR}
|
||||
exit $result
|
|
@ -810,12 +810,22 @@ void* nsChildView::GetNativeData(PRUint32 aDataType)
|
|||
if ([mView isKindOfClass:[ChildView class]])
|
||||
[(ChildView*)mView setIsPluginView:YES];
|
||||
|
||||
mPluginPort.cgPort.context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
|
||||
|
||||
NSWindow* window = [mView nativeWindow];
|
||||
if (window) {
|
||||
// [NSGraphicsContext currentContext] is supposed to "return the
|
||||
// current graphics context of the current thread." But sometimes
|
||||
// (when called while mView isn't focused for drawing) it returns a
|
||||
// graphics context for the wrong window. [window graphicsContext]
|
||||
// (which "provides the graphics context associated with the window
|
||||
// for the current thread") seems always to return the "right"
|
||||
// graphics context. See bug 500130.
|
||||
mPluginPort.cgPort.context = (CGContextRef)
|
||||
[[window graphicsContext] graphicsPort];
|
||||
WindowRef topLevelWindow = (WindowRef)[window windowRef];
|
||||
mPluginPort.cgPort.window = topLevelWindow;
|
||||
} else {
|
||||
mPluginPort.cgPort.context = nil;
|
||||
mPluginPort.cgPort.window = nil;
|
||||
}
|
||||
|
||||
retVal = (void*)&mPluginPort;
|
||||
|
|
|
@ -321,7 +321,7 @@ nsWindow::nsWindow() : nsBaseWidget()
|
|||
mDeferredPositioner = nsnull;
|
||||
mOldIMC = nsnull;
|
||||
mNativeDragTarget = nsnull;
|
||||
mIsDestroying = PR_FALSE;
|
||||
mInDtor = PR_FALSE;
|
||||
mIsVisible = PR_FALSE;
|
||||
mHas3DBorder = PR_FALSE;
|
||||
mIsInMouseCapture = PR_FALSE;
|
||||
|
@ -384,30 +384,14 @@ nsWindow::nsWindow() : nsBaseWidget()
|
|||
|
||||
nsWindow::~nsWindow()
|
||||
{
|
||||
mIsDestroying = PR_TRUE;
|
||||
if (sCurrentWindow == this) {
|
||||
sCurrentWindow = nsnull;
|
||||
}
|
||||
mInDtor = PR_TRUE;
|
||||
|
||||
MouseTrailer* mtrailer = nsToolkit::gMouseTrailer;
|
||||
if (mtrailer) {
|
||||
if (mtrailer->GetMouseTrailerWindow() == mWnd)
|
||||
mtrailer->DestroyTimer();
|
||||
|
||||
if (mtrailer->GetCaptureWindow() == mWnd)
|
||||
mtrailer->SetCaptureWindow(nsnull);
|
||||
}
|
||||
|
||||
// If the widget was released without calling Destroy() then the native
|
||||
// window still exists, and we need to destroy it
|
||||
if (NULL != mWnd) {
|
||||
// If the widget was released without calling Destroy() then the native window still
|
||||
// exists, and we need to destroy it. This will also result in a call to OnDestroy.
|
||||
//
|
||||
// XXX How could this happen???
|
||||
if (NULL != mWnd)
|
||||
Destroy();
|
||||
}
|
||||
|
||||
if (mCursor == -1) {
|
||||
// A successfull SetCursor call will destroy the custom cursor, if it's ours
|
||||
SetCursor(eCursor_standard);
|
||||
}
|
||||
|
||||
sInstanceCount--;
|
||||
|
||||
|
@ -477,76 +461,6 @@ NS_METHOD nsWindow::Create(nsNativeWidget aParent,
|
|||
aParent));
|
||||
}
|
||||
|
||||
// Close this nsWindow
|
||||
NS_METHOD nsWindow::Destroy()
|
||||
{
|
||||
// Switch to the "main gui thread" if necessary... This method must
|
||||
// be executed on the "gui thread"...
|
||||
nsToolkit* toolkit = (nsToolkit *)mToolkit;
|
||||
if (toolkit != nsnull && !toolkit->IsGuiThread()) {
|
||||
MethodInfo info(this, nsWindow::DESTROY);
|
||||
toolkit->CallMethod(&info);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// disconnect from the parent
|
||||
if (!mIsDestroying) {
|
||||
nsBaseWidget::Destroy();
|
||||
}
|
||||
|
||||
// just to be safe. If we're going away and for some reason we're still
|
||||
// the rollup widget, rollup and turn off capture.
|
||||
if ( this == sRollupWidget ) {
|
||||
if ( sRollupListener )
|
||||
sRollupListener->Rollup(nsnull, nsnull);
|
||||
CaptureRollupEvents(nsnull, PR_FALSE, PR_TRUE);
|
||||
}
|
||||
|
||||
EnableDragDrop(PR_FALSE);
|
||||
|
||||
// destroy the HWND
|
||||
if (mWnd) {
|
||||
// prevent the widget from causing additional events
|
||||
mEventCallback = nsnull;
|
||||
|
||||
// if IME is disabled, restore it.
|
||||
if (mOldIMC) {
|
||||
mOldIMC = ::ImmAssociateContext(mWnd, mOldIMC);
|
||||
NS_ASSERTION(!mOldIMC, "Another IMC was associated");
|
||||
}
|
||||
|
||||
HICON icon;
|
||||
icon = (HICON) ::SendMessageW(mWnd, WM_SETICON, (WPARAM)ICON_BIG, (LPARAM) 0);
|
||||
if (icon)
|
||||
::DestroyIcon(icon);
|
||||
|
||||
icon = (HICON) ::SendMessageW(mWnd, WM_SETICON, (WPARAM)ICON_SMALL, (LPARAM) 0);
|
||||
if (icon)
|
||||
::DestroyIcon(icon);
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
if (eTransparencyTransparent == mTransparencyMode)
|
||||
{
|
||||
SetupTranslucentWindowMemoryBitmap(eTransparencyOpaque);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
VERIFY(::DestroyWindow(mWnd));
|
||||
|
||||
mWnd = NULL;
|
||||
//our windows can be subclassed by
|
||||
//others and these nameless, faceless others
|
||||
//may not let us know about WM_DESTROY. so,
|
||||
//if OnDestroy() didn't get called, just call
|
||||
//it now. MMP
|
||||
if (PR_FALSE == mOnDestroyCalled)
|
||||
OnDestroy();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Allow Derived classes to modify the height that is passed
|
||||
// when the window is created or resized. Also add extra height
|
||||
// if needed (on Windows CE)
|
||||
|
@ -733,6 +647,45 @@ nsWindow::StandardWindowCreate(nsIWidget *aParent,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
// Close this nsWindow
|
||||
NS_METHOD nsWindow::Destroy()
|
||||
{
|
||||
// WM_DESTROY has already fired, we're done.
|
||||
if (nsnull == mWnd)
|
||||
return NS_OK;
|
||||
|
||||
// Switch to the "main gui thread" if necessary. Destroy() must be executed on the
|
||||
// "gui thread".
|
||||
nsToolkit* toolkit = (nsToolkit *)mToolkit;
|
||||
if (toolkit != nsnull && !toolkit->IsGuiThread()) {
|
||||
MethodInfo info(this, nsWindow::DESTROY);
|
||||
toolkit->CallMethod(&info);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// During the destruction of all of our children, make sure we don't get deleted.
|
||||
nsCOMPtr<nsIWidget> kungFuDeathGrip(this);
|
||||
|
||||
// The DestroyWindow function destroys the specified window. The function sends WM_DESTROY
|
||||
// and WM_NCDESTROY messages to the window to deactivate it and remove the keyboard focus
|
||||
// from it. The function also destroys the window's menu, flushes the thread message queue,
|
||||
// destroys timers, removes clipboard ownership, and breaks the clipboard viewer chain (if
|
||||
// the window is at the top of the viewer chain).
|
||||
//
|
||||
// If the specified window is a parent or owner window, DestroyWindow automatically destroys
|
||||
// the associated child or owned windows when it destroys the parent or owner window. The
|
||||
// function first destroys child or owned windows, and then it destroys the parent or owner
|
||||
// window.
|
||||
VERIFY(::DestroyWindow(mWnd));
|
||||
|
||||
// Our windows can be subclassed which may prevent us receiving WM_DESTROY. If OnDestroy()
|
||||
// didn't get called, call it now.
|
||||
if (PR_FALSE == mOnDestroyCalled)
|
||||
OnDestroy();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**************************************************************
|
||||
*
|
||||
* SECTION: Window class utilities
|
||||
|
@ -1038,7 +991,8 @@ NS_IMETHODIMP nsWindow::SetParent(nsIWidget *aNewParent)
|
|||
}
|
||||
|
||||
if (mWnd) {
|
||||
::SetParent(mWnd, nsnull);
|
||||
// If we have no parent, SetParent should return the desktop.
|
||||
VERIFY(::SetParent(mWnd, nsnull));
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -1061,7 +1015,7 @@ nsWindow* nsWindow::GetParentWindow(PRBool aIncludeOwner)
|
|||
// If this widget has already been destroyed, pretend we have no parent.
|
||||
// This corresponds to code in Destroy which removes the destroyed
|
||||
// widget from its parent's child list.
|
||||
if (mIsDestroying || mOnDestroyCalled)
|
||||
if (mInDtor || mOnDestroyCalled)
|
||||
return nsnull;
|
||||
|
||||
|
||||
|
@ -1084,7 +1038,7 @@ nsWindow* nsWindow::GetParentWindow(PRBool aIncludeOwner)
|
|||
if (widget) {
|
||||
// If the widget is in the process of being destroyed then
|
||||
// do NOT return it
|
||||
if (widget->mIsDestroying) {
|
||||
if (widget->mInDtor) {
|
||||
widget = nsnull;
|
||||
}
|
||||
}
|
||||
|
@ -3346,12 +3300,12 @@ PRBool nsWindow::DispatchMouseEvent(PRUint32 aEventType, WPARAM wParam,
|
|||
|
||||
if (rect.Contains(event.refPoint)) {
|
||||
if (sCurrentWindow == NULL || sCurrentWindow != this) {
|
||||
if ((nsnull != sCurrentWindow) && (!sCurrentWindow->mIsDestroying)) {
|
||||
if ((nsnull != sCurrentWindow) && (!sCurrentWindow->mInDtor)) {
|
||||
LPARAM pos = sCurrentWindow->lParamToClient(lParamToScreen(lParam));
|
||||
sCurrentWindow->DispatchMouseEvent(NS_MOUSE_EXIT, wParam, pos);
|
||||
}
|
||||
sCurrentWindow = this;
|
||||
if (!mIsDestroying) {
|
||||
if (!mInDtor) {
|
||||
LPARAM pos = sCurrentWindow->lParamToClient(lParamToScreen(lParam));
|
||||
sCurrentWindow->DispatchMouseEvent(NS_MOUSE_ENTER, wParam, pos);
|
||||
}
|
||||
|
@ -3561,7 +3515,7 @@ LRESULT CALLBACK nsWindow::WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
|
|||
// deleted during processing. yes, it's a double hack, since someWindow
|
||||
// is not really an interface.
|
||||
nsCOMPtr<nsISupports> kungFuDeathGrip;
|
||||
if (!someWindow->mIsDestroying) // not if we're in the destructor!
|
||||
if (!someWindow->mInDtor) // not if we're in the destructor!
|
||||
kungFuDeathGrip = do_QueryInterface((nsBaseWidget*)someWindow);
|
||||
|
||||
// Re-direct a tab change message destined for its parent window to the
|
||||
|
@ -5472,44 +5426,103 @@ nsWindow::SetupKeyModifiersSequence(nsTArray<KeyPair>* aArray, PRUint32 aModifie
|
|||
}
|
||||
}
|
||||
|
||||
// OnDestroy
|
||||
// WM_DESTROY event handler
|
||||
void nsWindow::OnDestroy()
|
||||
{
|
||||
mOnDestroyCalled = PR_TRUE;
|
||||
|
||||
// Make sure we don't get destroyed in the process of tearing down.
|
||||
nsCOMPtr<nsIWidget> kungFuDeathGrip(this);
|
||||
|
||||
// Dispatch the NS_DESTROY event. Must be called before mEventCallback is cleared.
|
||||
if (!mInDtor)
|
||||
DispatchStandardEvent(NS_DESTROY);
|
||||
|
||||
// Prevent the widget from sending additional events.
|
||||
mEventCallback = nsnull;
|
||||
|
||||
// Free our subclass and clear |this| stored in the window props. We will no longer
|
||||
// receive events from Windows after this point.
|
||||
SubclassWindow(FALSE);
|
||||
|
||||
// We have to destroy the native drag target before we null out our
|
||||
// window pointer
|
||||
// Once mEventCallback is cleared and the subclass is reset, sCurrentWindow can be
|
||||
// cleared. (It's used in tracking windows for mouse events.)
|
||||
if (sCurrentWindow == this)
|
||||
sCurrentWindow = nsnull;
|
||||
|
||||
// Disconnects us from our parent, will call our GetParent().
|
||||
nsBaseWidget::Destroy();
|
||||
|
||||
// Release references to children, device context, toolkit, and app shell.
|
||||
nsBaseWidget::OnDestroy();
|
||||
|
||||
// Clear our native parent handle.
|
||||
// XXX Windows will take care of this in the proper order, and SetParent(nsnull)'s
|
||||
// remove child on the parent already took place in nsBaseWidget's Destroy call above.
|
||||
//SetParent(nsnull);
|
||||
|
||||
// We have to destroy the native drag target before we null out our window pointer.
|
||||
EnableDragDrop(PR_FALSE);
|
||||
|
||||
mWnd = NULL;
|
||||
|
||||
// free GDI objects
|
||||
if (mBrush) {
|
||||
VERIFY(::DeleteObject(mBrush));
|
||||
mBrush = NULL;
|
||||
// If we're going away and for some reason we're still the rollup widget, rollup and
|
||||
// turn off capture.
|
||||
if ( this == sRollupWidget ) {
|
||||
if ( sRollupListener )
|
||||
sRollupListener->Rollup(nsnull, nsnull);
|
||||
CaptureRollupEvents(nsnull, PR_FALSE, PR_TRUE);
|
||||
}
|
||||
|
||||
// if we were in the middle of deferred window positioning then
|
||||
// free the memory for the multiple-window position structure
|
||||
// If IME is disabled, restore it.
|
||||
if (mOldIMC) {
|
||||
mOldIMC = ::ImmAssociateContext(mWnd, mOldIMC);
|
||||
NS_ASSERTION(!mOldIMC, "Another IMC was associated");
|
||||
}
|
||||
|
||||
// Turn off mouse trails if enabled.
|
||||
MouseTrailer* mtrailer = nsToolkit::gMouseTrailer;
|
||||
if (mtrailer) {
|
||||
if (mtrailer->GetMouseTrailerWindow() == mWnd)
|
||||
mtrailer->DestroyTimer();
|
||||
|
||||
if (mtrailer->GetCaptureWindow() == mWnd)
|
||||
mtrailer->SetCaptureWindow(nsnull);
|
||||
}
|
||||
|
||||
// If we were in the middle of deferred window positioning then free the memory for the
|
||||
// multiple-window position structure.
|
||||
if (mDeferredPositioner) {
|
||||
VERIFY(::EndDeferWindowPos(mDeferredPositioner));
|
||||
mDeferredPositioner = NULL;
|
||||
}
|
||||
|
||||
// release references to children, device context, toolkit, and app shell
|
||||
nsBaseWidget::OnDestroy();
|
||||
|
||||
// dispatch the event
|
||||
if (!mIsDestroying) {
|
||||
// dispatching of the event may cause the reference count to drop to 0
|
||||
// and result in this object being destroyed. To avoid that, add a reference
|
||||
// and then release it after dispatching the event
|
||||
AddRef();
|
||||
DispatchStandardEvent(NS_DESTROY);
|
||||
Release();
|
||||
// Free GDI window class objects
|
||||
if (mBrush) {
|
||||
VERIFY(::DeleteObject(mBrush));
|
||||
mBrush = NULL;
|
||||
}
|
||||
|
||||
// Free app icon resources.
|
||||
HICON icon;
|
||||
icon = (HICON) ::SendMessageW(mWnd, WM_SETICON, (WPARAM)ICON_BIG, (LPARAM) 0);
|
||||
if (icon)
|
||||
::DestroyIcon(icon);
|
||||
|
||||
icon = (HICON) ::SendMessageW(mWnd, WM_SETICON, (WPARAM)ICON_SMALL, (LPARAM) 0);
|
||||
if (icon)
|
||||
::DestroyIcon(icon);
|
||||
|
||||
// Destroy any custom cursor resources.
|
||||
if (mCursor == -1)
|
||||
SetCursor(eCursor_standard);
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
// Reset transparency
|
||||
if (eTransparencyTransparent == mTransparencyMode)
|
||||
SetupTranslucentWindowMemoryBitmap(eTransparencyOpaque);
|
||||
#endif
|
||||
|
||||
// Clear the main HWND.
|
||||
mWnd = NULL;
|
||||
}
|
||||
|
||||
// OnMove
|
||||
|
@ -5741,7 +5754,7 @@ already_AddRefed<nsIAccessible> nsWindow::GetRootAccessible()
|
|||
{
|
||||
nsWindow::sIsAccessibilityOn = TRUE;
|
||||
|
||||
if (mIsDestroying || mOnDestroyCalled || mWindowType == eWindowType_invisible) {
|
||||
if (mInDtor || mOnDestroyCalled || mWindowType == eWindowType_invisible) {
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
|
|
|
@ -417,7 +417,7 @@ protected:
|
|||
HBRUSH mBrush;
|
||||
PRPackedBool mIsTopWidgetWindow;
|
||||
PRPackedBool mHas3DBorder;
|
||||
PRPackedBool mIsDestroying;
|
||||
PRPackedBool mInDtor;
|
||||
PRPackedBool mIsVisible;
|
||||
PRPackedBool mIsInMouseCapture;
|
||||
PRPackedBool mInWheelProcessing;
|
||||
|
|
|
@ -41,9 +41,6 @@
|
|||
"""A parser for cross-platform IDL (XPIDL) files."""
|
||||
|
||||
import sys, os.path, re
|
||||
|
||||
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir,
|
||||
'other-licenses', 'ply'))
|
||||
from ply import lex, yacc
|
||||
|
||||
"""A type conforms to the following pattern:
|
||||
|
|
|
@ -65,11 +65,7 @@ interface nsILocalFile : nsIFile
|
|||
* initWith[Native]Path
|
||||
*
|
||||
* This function will initialize the nsILocalFile object. Any
|
||||
* internal state information will be reset.
|
||||
*
|
||||
* NOTE: This function has a known bug on the macintosh and
|
||||
* other OSes which do not represent file locations as paths.
|
||||
* If you do use this function, be very aware of this problem!
|
||||
* internal state information will be reset.
|
||||
*
|
||||
* @param filePath
|
||||
* A string which specifies a full file path to a
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <utime.h>
|
||||
|
||||
#define CHECK_mBaseURL() \
|
||||
#define CHECK_INIT() \
|
||||
PR_BEGIN_MACRO \
|
||||
if (!mBaseURL) \
|
||||
return NS_ERROR_NOT_INITIALIZED; \
|
||||
|
@ -356,8 +356,7 @@ NS_IMETHODIMP nsLocalFile::AppendNative(const nsACString& aNode)
|
|||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
// Check we are correctly initialized.
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
nsACString::const_iterator start, end;
|
||||
aNode.BeginReading(start);
|
||||
|
@ -387,7 +386,7 @@ NS_IMETHODIMP nsLocalFile::Normalize()
|
|||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
// CFURL doesn't doesn't seem to resolve paths containing relative
|
||||
// components, so we'll nick the stdlib code from nsLocalFileUnix
|
||||
|
@ -432,8 +431,7 @@ NS_IMETHODIMP nsLocalFile::Create(PRUint32 type, PRUint32 permissions)
|
|||
if (type != NORMAL_FILE_TYPE && type != DIRECTORY_TYPE)
|
||||
return NS_ERROR_FILE_UNKNOWN_TYPE;
|
||||
|
||||
// Check we are correctly initialized.
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
nsTArray<nsString> nonExtantNodes;
|
||||
CFURLRef pathURLRef = mBaseURL;
|
||||
|
@ -528,7 +526,7 @@ NS_IMETHODIMP nsLocalFile::GetNativeLeafName(nsACString& aNativeLeafName)
|
|||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
CFStringRef leafStrRef = ::CFURLCopyLastPathComponent(mBaseURL);
|
||||
|
@ -545,7 +543,7 @@ NS_IMETHODIMP nsLocalFile::SetNativeLeafName(const nsACString& aNativeLeafName)
|
|||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
CFURLRef parentURLRef = ::CFURLCreateCopyDeletingLastPathComponent(kCFAllocatorDefault, mBaseURL);
|
||||
|
@ -600,7 +598,7 @@ NS_IMETHODIMP nsLocalFile::MoveToNative(nsIFile *newParentDir, const nsACString&
|
|||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
StFollowLinksState followLinks(*this, PR_FALSE);
|
||||
|
||||
|
@ -686,7 +684,7 @@ NS_IMETHODIMP nsLocalFile::Remove(PRBool recursive)
|
|||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
// if we're a symlink, never remove target
|
||||
StFollowLinksState followLinks(*this, PR_FALSE);
|
||||
|
@ -737,7 +735,7 @@ NS_IMETHODIMP nsLocalFile::GetPermissions(PRUint32 *aPermissions)
|
|||
{
|
||||
NS_ENSURE_ARG_POINTER(aPermissions);
|
||||
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
struct STAT buf;
|
||||
nsresult rv = FillStatBufferInternal(&buf);
|
||||
|
@ -750,7 +748,7 @@ NS_IMETHODIMP nsLocalFile::GetPermissions(PRUint32 *aPermissions)
|
|||
|
||||
NS_IMETHODIMP nsLocalFile::SetPermissions(PRUint32 aPermissions)
|
||||
{
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
nsCAutoString path;
|
||||
nsresult rv = GetPathInternal(path);
|
||||
|
@ -866,7 +864,7 @@ NS_IMETHODIMP nsLocalFile::GetFileSize(PRInt64 *aFileSize)
|
|||
|
||||
NS_IMETHODIMP nsLocalFile::SetFileSize(PRInt64 aFileSize)
|
||||
{
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
nsCAutoString path;
|
||||
nsresult rv = GetPathInternal(path);
|
||||
|
@ -882,7 +880,7 @@ NS_IMETHODIMP nsLocalFile::SetFileSize(PRInt64 aFileSize)
|
|||
|
||||
NS_IMETHODIMP nsLocalFile::GetFileSizeOfLink(PRInt64 *aFileSizeOfLink)
|
||||
{
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
NS_ENSURE_ARG_POINTER(aFileSizeOfLink);
|
||||
|
||||
|
@ -902,7 +900,7 @@ NS_IMETHODIMP nsLocalFile::GetTarget(nsAString& aTarget)
|
|||
|
||||
NS_IMETHODIMP nsLocalFile::GetNativeTarget(nsACString& aNativeTarget)
|
||||
{
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
PRBool isSymLink = PR_FALSE;
|
||||
nsresult rv = IsSymlink(&isSymLink);
|
||||
|
@ -944,7 +942,7 @@ NS_IMETHODIMP nsLocalFile::GetNativePath(nsACString& aNativePath)
|
|||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
CFStringRef pathStrRef = ::CFURLCopyFileSystemPath(mBaseURL, kCFURLPOSIXPathStyle);
|
||||
|
@ -976,7 +974,7 @@ NS_IMETHODIMP nsLocalFile::IsWritable(PRBool *_retval)
|
|||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
*_retval = PR_FALSE;
|
||||
|
@ -993,7 +991,7 @@ NS_IMETHODIMP nsLocalFile::IsWritable(PRBool *_retval)
|
|||
|
||||
NS_IMETHODIMP nsLocalFile::IsReadable(PRBool *_retval)
|
||||
{
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
*_retval = PR_FALSE;
|
||||
|
@ -1010,8 +1008,7 @@ NS_IMETHODIMP nsLocalFile::IsExecutable(PRBool *_retval)
|
|||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
// Check we are correctly initialized.
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
*_retval = PR_FALSE;
|
||||
|
@ -1103,7 +1100,7 @@ NS_IMETHODIMP nsLocalFile::IsSymlink(PRBool *_retval)
|
|||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
NS_ENSURE_ARG(_retval);
|
||||
*_retval = PR_FALSE;
|
||||
|
@ -1163,8 +1160,7 @@ NS_IMETHODIMP nsLocalFile::Equals(nsIFile *inFile, PRBool *_retval)
|
|||
|
||||
NS_IMETHODIMP nsLocalFile::Contains(nsIFile *inFile, PRBool recur, PRBool *_retval)
|
||||
{
|
||||
// Check we are correctly initialized.
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
*_retval = PR_FALSE;
|
||||
|
@ -1196,8 +1192,7 @@ NS_IMETHODIMP nsLocalFile::GetParent(nsIFile * *aParent)
|
|||
NS_ENSURE_ARG_POINTER(aParent);
|
||||
*aParent = nsnull;
|
||||
|
||||
// Check we are correctly initialized.
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
// If it can be determined without error that a file does not
|
||||
// have a parent, return nsnull for the parent and NS_OK as the result.
|
||||
|
@ -1387,7 +1382,7 @@ NS_IMETHODIMP nsLocalFile::OpenANSIFileDesc(const char *mode, FILE **_retval)
|
|||
|
||||
NS_IMETHODIMP nsLocalFile::Load(PRLibrary **_retval)
|
||||
{
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
|
||||
|
@ -1638,7 +1633,7 @@ NS_IMETHODIMP nsLocalFile::GetCFURL(CFURLRef *_retval)
|
|||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
if (mFollowLinks) {
|
||||
nsCAutoString nativePath;
|
||||
|
@ -1678,7 +1673,7 @@ NS_IMETHODIMP nsLocalFile::GetFSSpec(FSSpec *_retval)
|
|||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
FSRef fsRef;
|
||||
nsresult rv = GetFSRefInternal(fsRef);
|
||||
|
@ -1720,7 +1715,7 @@ NS_IMETHODIMP nsLocalFile::GetFileType(OSType *aFileType)
|
|||
|
||||
NS_ENSURE_ARG_POINTER(aFileType);
|
||||
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
|
||||
|
@ -1742,7 +1737,7 @@ NS_IMETHODIMP nsLocalFile::SetFileType(OSType aFileType)
|
|||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
NSAutoreleasePool* ap = [[NSAutoreleasePool alloc] init];
|
||||
NSDictionary* dict = [NSDictionary dictionaryWithObject:[NSNumber numberWithUnsignedLong:aFileType] forKey:NSFileHFSTypeCode];
|
||||
|
@ -1759,7 +1754,7 @@ NS_IMETHODIMP nsLocalFile::GetFileCreator(OSType *aFileCreator)
|
|||
|
||||
NS_ENSURE_ARG_POINTER(aFileCreator);
|
||||
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
|
||||
|
@ -1781,7 +1776,7 @@ NS_IMETHODIMP nsLocalFile::SetFileCreator(OSType aFileCreator)
|
|||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
NSAutoreleasePool* ap = [[NSAutoreleasePool alloc] init];
|
||||
NSDictionary* dict = [NSDictionary dictionaryWithObject:[NSNumber numberWithUnsignedLong:aFileCreator] forKey:NSFileHFSCreatorCode];
|
||||
|
@ -1990,7 +1985,7 @@ nsresult nsLocalFile::GetFSRefInternal(FSRef& aFSRef)
|
|||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
return (::CFURLGetFSRef(mBaseURL, &aFSRef) ? NS_OK : NS_ERROR_FAILURE);
|
||||
|
||||
|
@ -2001,7 +1996,7 @@ nsresult nsLocalFile::GetPathInternal(nsACString& path)
|
|||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
CFURLRef urlRef;
|
||||
nsresult rv = GetCFURL(&urlRef);
|
||||
|
@ -2027,7 +2022,7 @@ nsresult nsLocalFile::CopyInternal(nsIFile* aParentDir,
|
|||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
StFollowLinksState srcFollowState(*this, followLinks);
|
||||
|
||||
|
@ -2085,7 +2080,7 @@ nsresult nsLocalFile::CopyInternal(nsIFile* aParentDir,
|
|||
|
||||
nsresult nsLocalFile::FillStatBufferInternal(struct STAT *statBuffer)
|
||||
{
|
||||
CHECK_mBaseURL();
|
||||
CHECK_INIT();
|
||||
|
||||
char path[PATH_MAX] = "";
|
||||
Boolean gotPath = ::CFURLGetFileSystemRepresentation(mBaseURL, true, (UInt8*)path, PATH_MAX);
|
||||
|
|
Загрузка…
Ссылка в новой задаче