Merging places and mozilla-central.

This commit is contained in:
Shawn Wilsher 2009-07-30 08:41:55 -07:00
Родитель c2ac8daba2 4631579de7
Коммит 2cac3b64fa
323 изменённых файлов: 33423 добавлений и 4276 удалений

Просмотреть файл

@ -167,13 +167,11 @@
<menuitem id="context-back"
label="&backCmd.label;"
accesskey="&backCmd.accesskey;"
chromedir="&locale.dir;"
command="Browser:BackOrBackDuplicate"
onclick="checkForMiddleClick(this, event);"/>
<menuitem id="context-forward"
label="&forwardCmd.label;"
accesskey="&forwardCmd.accesskey;"
chromedir="&locale.dir;"
command="Browser:ForwardOrForwardDuplicate"
onclick="checkForMiddleClick(this, event);"/>
<menuitem id="context-reload"

Просмотреть файл

@ -3,8 +3,6 @@
%brandDTD;
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd" >
%browserDTD;
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
<!ENTITY % globalRegionDTD SYSTEM "chrome://global-region/locale/region.dtd">
%globalRegionDTD;
<!ENTITY % charsetDTD SYSTEM "chrome://global/locale/charsetOverlay.dtd" >

Просмотреть файл

@ -474,7 +474,6 @@
#else
key="goBackKb"
#endif
chromedir="&locale.dir;"
command="Browser:BackOrBackDuplicate"
onclick="checkForMiddleClick(this, event);"/>
<menuitem id="historyMenuForward"
@ -484,7 +483,6 @@
#else
key="goForwardKb"
#endif
chromedir="&locale.dir;"
command="Browser:ForwardOrForwardDuplicate"
onclick="checkForMiddleClick(this, event);"/>
<menuitem id="historyMenuHome"

Просмотреть файл

@ -432,9 +432,7 @@ var PlacesCommandHook = {
if (starIcon && isElementVisible(starIcon)) {
// Make sure the bookmark properties dialog hangs toward the middle of
// the location bar in RTL builds
var position = "after_end";
if (gURLBar.getAttribute("chromedir") == "rtl")
position = "after_start";
var position = (getComputedStyle(gNavToolbox, "").direction == "rtl") ? 'after_start' : 'after_end';
if (aShowEditUI)
StarUI.showEditBookmarkPopup(itemId, starIcon, position);
#ifdef ADVANCED_STARRING_UI

Просмотреть файл

@ -45,7 +45,7 @@ toolbarpaletteitem[place="palette"] > toolbaritem > hbox[type="places"] {
display: none;
}
#feed-menu[chromedir="rtl"] > menuitem {
#feed-menu:-moz-locale-dir(rtl) > menuitem {
direction: rtl;
}

Просмотреть файл

@ -6628,9 +6628,7 @@ var gIdentityHandler = {
// Make sure the identity popup hangs toward the middle of the location bar
// in RTL builds
var position = 'after_start';
if (gURLBar.getAttribute("chromedir") == "rtl")
position = 'after_end';
var position = (getComputedStyle(gNavToolbox, "").direction == "rtl") ? 'after_end' : 'after_start';
// Add the "open" attribute to the identity box for styling
this._identityBox.setAttribute("open", "true");

Просмотреть файл

@ -104,17 +104,16 @@
<popupset id="mainPopupSet">
<menupopup id="backForwardMenu"
chromedir="&locale.dir;"
onpopupshowing="return FillHistoryMenu(event.target);"
oncommand="gotoHistoryIndex(event);"
onclick="checkForMiddleClick(this, event);"/>
<tooltip id="aHTMLTooltip" onpopupshowing="return FillInHTMLTooltip(document.tooltipNode);"/>
<!-- for search and content formfill/pw manager -->
<panel type="autocomplete" chromedir="&locale.dir;" id="PopupAutoComplete" noautofocus="true" hidden="true"/>
<panel type="autocomplete" id="PopupAutoComplete" noautofocus="true" hidden="true"/>
<!-- for url bar autocomplete -->
<panel type="autocomplete-richlistbox" chromedir="&locale.dir;" id="PopupAutoCompleteRichResult" noautofocus="true" hidden="true"/>
<panel type="autocomplete-richlistbox" id="PopupAutoCompleteRichResult" noautofocus="true" hidden="true"/>
<panel id="editBookmarkPanel"
orient="vertical"
@ -205,8 +204,7 @@
<!-- Popup for site identity information -->
<panel id="identity-popup" position="after_start" hidden="true" noautofocus="true"
onpopupshown="document.getElementById('identity-popup-more-info-button').focus();"
level="top"
chromedir="&locale.dir;">
level="top">
<hbox id="identity-popup-container" align="top">
<image id="identity-popup-icon"/>
<vbox id="identity-popup-content-box">
@ -318,18 +316,16 @@
<toolbaritem id="unified-back-forward-button" class="chromeclass-toolbar-additional"
context="backForwardMenu">
<toolbarbutton id="back-button" class="toolbarbutton-1"
chromedir="&locale.dir;"
label="&backCmd.label;"
command="Browser:BackOrBackDuplicate"
onclick="checkForMiddleClick(this, event);"
tooltiptext="&backButton.tooltip;"/>
<toolbarbutton id="forward-button" class="toolbarbutton-1"
chromedir="&locale.dir;"
label="&forwardCmd.label;"
command="Browser:ForwardOrForwardDuplicate"
onclick="checkForMiddleClick(this, event);"
tooltiptext="&forwardButton.tooltip;"/>
<toolbarbutton id="back-forward-dropmarker" type="menu" chromedir="&locale.dir;"
<toolbarbutton id="back-forward-dropmarker" type="menu"
disabled="true" tooltiptext="&backForwardMenu.tooltip;"
onbroadcast="if (this.disabled) this.disabled =
document.getElementById('Browser:Back').hasAttribute('disabled') &amp;&amp;
@ -337,7 +333,6 @@
<!-- bug 415444: event.stopPropagation is here for the cloned version of
this menupopup -->
<menupopup context=""
chromedir="&locale.dir;"
position="after_start"
onpopupshowing="return FillHistoryMenu(event.target);"
oncommand="gotoHistoryIndex(event); event.stopPropagation();"
@ -374,7 +369,6 @@
bookmarkemptytext="&urlbar.bookmark.emptyText;"
historyemptytext="&urlbar.history.emptyText;"
noneemptytext="&urlbar.none.emptyText;"
chromedir="&locale.dir;"
type="autocomplete"
autocompletesearch="history"
autocompletepopup="PopupAutoCompleteRichResult"
@ -399,7 +393,6 @@
We only add the identity-box button to the tab order when the location bar
has focus, otherwise pressing F6 focuses it instead of the location bar -->
<box id="identity-box" role="button"
chromedir="&locale.dir;"
onclick="gIdentityHandler.handleIdentityButtonEvent(event);"
onkeypress="gIdentityHandler.handleIdentityButtonEvent(event);">
<hbox align="center">
@ -419,13 +412,11 @@
style="-moz-user-focus: none"
class="plain urlbar-icon"
id="feed-button"
chromedir="&locale.dir;"
collapsed="true"
tooltiptext="&feedButton.tooltip;"
onclick="return FeedHandler.onFeedButtonClick(event);">
<menupopup position="after_end"
id="feed-menu"
chromedir="&locale.dir;"
onpopupshowing="return FeedHandler.buildFeedList(this);"
oncommand="return FeedHandler.subscribeToFeed(null, event);"
onclick="checkForMiddleClick(this, event);"/>
@ -434,7 +425,6 @@
class="urlbar-icon"
onclick="PlacesStarButton.onClick(event);"/>
<image id="go-button"
chromedir="&locale.dir;"
class="urlbar-icon"
tooltiptext="&goEndCap.tooltip;"
onclick="gURLBar.handleCommand(event);"/>
@ -445,7 +435,7 @@
<toolbaritem id="search-container" title="&searchItem.title;"
align="center" class="chromeclass-toolbar-additional"
flex="100" persist="width">
<searchbar id="searchbar" flex="1" chromedir="&locale.dir;"/>
<searchbar id="searchbar" flex="1"/>
</toolbaritem>
<toolbarbutton id="print-button" class="toolbarbutton-1 chromeclass-toolbar-additional"

Просмотреть файл

@ -48,8 +48,6 @@
<!DOCTYPE window [
<!ENTITY % pageInfoDTD SYSTEM "chrome://browser/locale/pageInfo.dtd">
%pageInfoDTD;
<!ENTITY % global SYSTEM "chrome://global/locale/global.dtd">
%global;
]>
#ifdef XP_MACOSX
@ -117,8 +115,7 @@
</menupopup>
<windowdragbox id="topBar" class="viewGroupWrapper">
<radiogroup id="viewGroup" class="chromeclass-toolbar" orient="horizontal"
chromedir="&locale.dir;">
<radiogroup id="viewGroup" class="chromeclass-toolbar" orient="horizontal">
<radio id="generalTab" label="&generalTab;" accesskey="&generalTab.accesskey;"
oncommand="showTab('general');"/>
<radio id="mediaTab" label="&mediaTab;" accesskey="&mediaTab.accesskey;"

Просмотреть файл

@ -50,8 +50,6 @@
<!DOCTYPE bindings [
<!ENTITY % tabBrowserDTD SYSTEM "chrome://browser/locale/tabbrowser.dtd" >
%tabBrowserDTD;
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
]>
<bindings id="tabBrowserBindings"
@ -68,7 +66,7 @@
<xul:stringbundle anonid="tbstringbundle" src="chrome://browser/locale/tabbrowser.properties"/>
<xul:tabbox anonid="tabbox" flex="1" eventnode="document" xbl:inherits="handleCtrlPageUpDown"
onselect="if (!('updateCurrentBrowser' in this.parentNode) || event.target.localName != 'tabpanels') return; this.parentNode.updateCurrentBrowser();">
<xul:hbox class="tab-drop-indicator-bar" collapsed="true" chromedir="&locale.dir;"
<xul:hbox class="tab-drop-indicator-bar" collapsed="true"
ondragover="this.parentNode.parentNode._onDragOver(event);"
ondragleave="this.parentNode.parentNode._onDragLeave(event);"
ondrop="this.parentNode.parentNode._onDrop(event);">
@ -2812,8 +2810,7 @@
onmousedown="_startScroll(-1);"
onmouseover="_continueScroll(-1);"
onmouseup="_stopScroll();"
onmouseout="_pauseScroll();"
chromedir="&locale.dir;"/>
onmouseout="_pauseScroll();"/>
<xul:scrollbox xbl:inherits="orient,align,pack,dir" flex="1" anonid="scrollbox">
<children/>
</xul:scrollbox>
@ -2829,8 +2826,7 @@
onmousedown="_startScroll(1);"
onmouseover="_continueScroll(1);"
onmouseup="_stopScroll();"
onmouseout="_pauseScroll();"
chromedir="&locale.dir;"/>
onmouseout="_pauseScroll();"/>
</xul:stack>
</content>
#endif
@ -2851,7 +2847,7 @@
</xul:stack>
#endif
<xul:arrowscrollbox anonid="arrowscrollbox" orient="horizontal" flex="1"
style="min-width: 1px;" chromedir="&locale.dir;"
style="min-width: 1px;"
#ifndef XP_MACOSX
clicktoscroll="true"
#endif
@ -2863,13 +2859,13 @@
# button, necessary due to the previous hack.
<children/>
<xul:toolbarbutton class="tabs-newtab-button"
command="cmd_newNavigatorTab" chromedir="&locale.dir;"
command="cmd_newNavigatorTab"
tooltiptext="&newTabButton.tooltip;"/>
</xul:arrowscrollbox>
<xul:toolbarbutton class="tabs-newtab-button" anonid="newtab-button"
command="cmd_newNavigatorTab" chromedir="&locale.dir;"
command="cmd_newNavigatorTab"
tooltiptext="&newTabButton.tooltip;"/>
<xul:stack align="center" pack="end" chromedir="&locale.dir;">
<xul:stack align="center" pack="end">
<xul:hbox flex="1" class="tabs-alltabs-box-animate" anonid="alltabs-box-animate"/>
<xul:toolbarbutton class="tabs-alltabs-button" anonid="alltabs-button"
type="menu"
@ -2879,7 +2875,7 @@
</xul:toolbarbutton>
</xul:stack>
<xul:toolbarbutton anonid="tabs-closebutton"
class="close-button tabs-closebutton" chromedir="&locale.dir;"/>
class="close-button tabs-closebutton"/>
</xul:hbox>
</xul:stack>
</content>
@ -3235,8 +3231,7 @@
<binding id="tabbrowser-tab" display="xul:hbox"
extends="chrome://global/content/bindings/tabbox.xml#tab">
<content chromedir="&locale.dir;"
closetabtext="&closeTab.label;">
<content closetabtext="&closeTab.label;">
<xul:image xbl:inherits="validate,src=image" class="tab-icon-image"/>
<xul:label flex="1" xbl:inherits="value=label,crop,accesskey" class="tab-text"/>
<xul:toolbarbutton anonid="close-button" tabindex="-1" class="tab-close-button"/>

Просмотреть файл

@ -47,8 +47,6 @@
%browserDTD;
<!ENTITY % textcontextDTD SYSTEM "chrome://global/locale/textcontext.dtd">
%textcontextDTD;
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
]>
<page id="webpanels-window"

Просмотреть файл

@ -1,10 +1,5 @@
<?xml version="1.0"?>
<!DOCTYPE bindings [
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
]>
<bindings id="placesBindings"
xmlns="http://www.mozilla.org/xbl"
xmlns:xbl="http://www.mozilla.org/xbl"

Просмотреть файл

@ -62,8 +62,6 @@
%placesDTD;
<!ENTITY % editMenuOverlayDTD SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
%editMenuOverlayDTD;
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
%browserDTD;
]>
@ -187,24 +185,22 @@
</popupset>
<toolbox id="placesToolbox">
<toolbar class="chromeclass-toolbar" id="placesToolbar" align="center" chromedir="&locale.dir;">
<toolbar class="chromeclass-toolbar" id="placesToolbar" align="center">
<toolbarbutton id="back-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
command="OrganizerCommand:Back"
tooltiptext="&backButton.tooltip;"
chromedir="&locale.dir;"
disabled="true"/>
<toolbarbutton id="forward-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
command="OrganizerCommand:Forward"
tooltiptext="&forwardButton.tooltip;"
chromedir="&locale.dir;"
disabled="true"/>
#ifdef XP_MACOSX
<toolbarbutton type="menu" class="tabbable"
onpopupshowing="document.getElementById('placeContent').focus()"
#else
<menubar id="placesMenu" chromedir="&locale.dir;">
<menubar id="placesMenu">
<menu accesskey="&organize.accesskey;" class="menu-iconic"
#endif
id="organizeButton" label="&organize.label;">

Просмотреть файл

@ -41,8 +41,6 @@
<!DOCTYPE bindings [
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd" >
%globalDTD;
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd" >
%browserDTD;
]>
@ -80,7 +78,6 @@
mousethrough="never"
collapsed="true"
tooltiptext="&bookmarksToolbarChevron.tooltip;"
chromedir="&locale.dir;"
onpopupshowing="chevronPopupShowing(event);">
<xul:menupopup anonid="chevronPopup"
xbl:inherits="tooltip"

Просмотреть файл

@ -45,8 +45,6 @@
<!DOCTYPE bindings [
<!ENTITY % searchBarDTD SYSTEM "chrome://browser/locale/searchbar.dtd" >
%searchBarDTD;
<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
%browserDTD;
]>
@ -80,8 +78,7 @@
xbl:inherits="disabled,disableautocomplete,searchengine,src,newlines">
<xul:button class="searchbar-engine-button"
type="menu"
anonid="searchbar-engine-button"
chromedir="&locale.dir;">
anonid="searchbar-engine-button">
<xul:image class="searchbar-engine-image" xbl:inherits="src"/>
<xul:image class="searchbar-dropmarker-image"/>
<xul:menupopup class="searchbar-popup"
@ -93,10 +90,9 @@
oncommand="openManager(event);"/>
</xul:menupopup>
</xul:button>
<xul:hbox class="search-go-container" chromedir="&locale.dir;">
<xul:hbox class="search-go-container">
<xul:image class="search-go-button"
anonid="search-go-button"
chromedir="&locale.dir;"
onclick="handleSearchCommand(event);"
tooltiptext="&searchEndCap.label;" />
</xul:hbox>

Просмотреть файл

@ -38,51 +38,69 @@
function test() {
/** Test for Bug 490040 **/
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
let os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
let ss = Cc["@mozilla.org/browser/sessionstore;1"].
getService(Ci.nsISessionStore);
let os = Cc["@mozilla.org/observer-service;1"].
getService(Ci.nsIObserverService);
let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
getService(Ci.nsIWindowWatcher);
waitForExplicitFinish();
function testWithState(aState, aCallback) {
// ensure we can store the window if need be
function testWithState(aState) {
// Ensure we can store the window if needed.
let curClosedWindowCount = ss.getClosedWindowCount();
gPrefService.setIntPref("browser.sessionstore.max_windows_undo", curClosedWindowCount + 1);
gPrefService.setIntPref("browser.sessionstore.max_windows_undo",
curClosedWindowCount + 1);
let theWin = openDialog(location, "_blank", "chrome,all,dialog=no");
theWin.addEventListener("load", function(aEvent) {
theWin.removeEventListener("load", arguments.callee, true);
let windowObserver = {
observe: function(aSubject, aTopic, aData) {
let theWin = aSubject.QueryInterface(Ci.nsIDOMWindow);
ss.setWindowState(theWin, JSON.stringify(aState.windowState), true);
switch(aTopic) {
case "domwindowopened":
theWin.addEventListener("load", function () {
theWin.removeEventListener("load", arguments.callee, false);
executeSoon(function() {
// Close the window as soon as the first tab loads, or
// immediately if there are no tabs.
if (aState.windowState.windows[0].tabs[0].entries.length) {
theWin.gBrowser.addEventListener("load", function() {
theWin.gBrowser.removeEventListener("load",
arguments.callee, true);
theWin.close();
}, true);
} else {
executeSoon(function() {
theWin.close();
});
}
ss.setWindowState(theWin, JSON.stringify(aState.windowState),
true);
});
}, false);
break;
let observer = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference]),
observe: function(aSubject, aTopic, aData) {
let _this = this;
// use executeSoon to ensure this happens after SS observer
executeSoon(function() {
is(ss.getClosedWindowCount(), curClosedWindowCount + (aState.shouldBeAdded ? 1 : 0),
"That window should " + (aState.shouldBeAdded ? "" : "not ") + "be restorable");
os.removeObserver(_this, "domwindowclosed");
executeSoon(aCallback);
});
case "domwindowclosed":
ww.unregisterNotification(this);
// Use executeSoon to ensure this happens after SS observer.
executeSoon(function() {
is(ss.getClosedWindowCount(),
curClosedWindowCount + (aState.shouldBeAdded ? 1 : 0),
"That window should " + (aState.shouldBeAdded ? "" : "not ") +
"be restorable");
executeSoon(runNextTest);
});
break;
}
};
os.addObserver(observer, "domwindowclosed", true);
// Close the window as soon as the first tab loads, or immediately if
// there are no tabs.
if (aState.windowState.windows[0].tabs[0].entries.length) {
theWin.gBrowser.addEventListener("load", function() {
theWin.gBrowser.removeEventListener("load", arguments.callee, true);
theWin.close();
}, true);
} else {
executeSoon(function() {
theWin.close();
});
}
}, true);
}
ww.registerNotification(windowObserver);
ww.openWindow(null,
location,
"_blank",
"chrome,all,dialog=no",
null);
}
// Only windows with open tabs are restorable. Windows where a lone tab is
@ -128,15 +146,16 @@ function test() {
}
];
testWithState(states[0], function() {
testWithState(states[1], function() {
testWithState(states[2], function() {
testWithState(states[3], function() {
gPrefService.clearUserPref("browser.sessionstore.max_windows_undo");
finish();
});
});
});
});
function runNextTest() {
if (states.length) {
let state = states.shift();
testWithState(state);
}
else {
gPrefService.clearUserPref("browser.sessionstore.max_windows_undo");
finish();
}
}
runNextTest();
}

Просмотреть файл

@ -401,13 +401,13 @@ menuitem:not([type]) {
list-style-image: url("moz-icon://stock/gtk-go-back-ltr?size=menu&state=disabled");
}
#historyMenuBack[chromedir="rtl"],
#context-back[chromedir="rtl"] {
#historyMenuBack:-moz-locale-dir(rtl),
#context-back:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=menu");
}
#historyMenuBack[disabled][chromedir="rtl"],
#context-back[disabled][chromedir="rtl"] {
#historyMenuBack[disabled]:-moz-locale-dir(rtl),
#context-back[disabled]:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=menu&state=disabled");
}
@ -421,13 +421,13 @@ menuitem:not([type]) {
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=menu&state=disabled");
}
#historyMenuForward[chromedir="rtl"],
#context-forward[chromedir="rtl"] {
#historyMenuForward:-moz-locale-dir(rtl),
#context-forward:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu");
}
#historyMenuForward[disabled][chromedir="rtl"],
#context-forward[disabled][chromedir="rtl"] {
#historyMenuForward[disabled]:-moz-locale-dir(rtl),
#context-forward[disabled]:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu&state=disabled");
}
@ -522,10 +522,10 @@ toolbar[mode="full"] .toolbarbutton-menubutton-button {
list-style-image: url("moz-icon://stock/gtk-go-back-ltr?size=toolbar&state=disabled");
}
#back-button[chromedir="rtl"] {
#back-button:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=toolbar");
}
#back-button[disabled="true"][chromedir="rtl"] {
#back-button[disabled="true"]:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=toolbar&state=disabled");
}
@ -536,10 +536,10 @@ toolbar[mode="full"] .toolbarbutton-menubutton-button {
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=toolbar&state=disabled");
}
#forward-button[chromedir="rtl"] {
#forward-button:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=toolbar");
}
#forward-button[disabled="true"][chromedir="rtl"] {
#forward-button[disabled="true"]:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=toolbar&state=disabled");
}
@ -648,13 +648,13 @@ toolbar[iconsize="small"] #back-button[disabled="true"] {
list-style-image: url("moz-icon://stock/gtk-go-back-ltr?size=menu&state=disabled");
}
toolbar[iconsize="small"] #back-button[chromedir="rtl"] {
toolbar[iconsize="small"] #back-button:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=menu");
}
menupopup[chromedir="rtl"] > .unified-nav-back[_moz-menuactive] {
menupopup:-moz-locale-dir(rtl) > .unified-nav-back[_moz-menuactive] {
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=menu") !important;
}
toolbar[iconsize="small"] #back-button[disabled="true"][chromedir="rtl"] {
toolbar[iconsize="small"] #back-button[disabled="true"]:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=menu&state=disabled");
}
@ -668,13 +668,13 @@ toolbar[iconsize="small"] #forward-button[disabled="true"] {
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=menu&state=disabled");
}
toolbar[iconsize="small"] #forward-button[chromedir="rtl"] {
toolbar[iconsize="small"] #forward-button:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu");
}
menupopup[chromedir="rtl"] > .unified-nav-forward[_moz-menuactive] {
menupopup:-moz-locale-dir(rtl) > .unified-nav-forward[_moz-menuactive] {
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu") !important;
}
toolbar[iconsize="small"] #forward-button[disabled="true"][chromedir="rtl"] {
toolbar[iconsize="small"] #forward-button[disabled="true"]:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu&state=disabled");
}
@ -833,7 +833,7 @@ toolbar[iconsize="small"] #paste-button[disabled="true"] {
direction: ltr !important;
}
#PopupAutoComplete[chromedir="rtl"] > tree > treerows {
#PopupAutoComplete:-moz-locale-dir(rtl) > tree > treerows {
direction: rtl;
}
@ -875,7 +875,7 @@ toolbar[iconsize="small"] #paste-button[disabled="true"] {
-moz-border-end: 1px solid ThreeDShadow;
}
#identity-box[chromedir="rtl"] {
#identity-box:-moz-locale-dir(rtl) {
-moz-border-start: 1px solid ThreeDShadow;
}
@ -1338,7 +1338,7 @@ toolbarbutton.chevron {
list-style-image: url("chrome://global/skin/toolbar/chevron.gif") !important;
}
toolbarbutton.chevron[chromedir="rtl"] {
toolbarbutton.chevron:-moz-locale-dir(rtl) {
list-style-image: url("chrome://global/skin/toolbar/chevron-rtl.gif") !important;
}

Просмотреть файл

@ -13,10 +13,10 @@
list-style-image: url("moz-icon://stock/gtk-go-back-ltr?size=toolbar&state=disabled");
}
#back-button[chromedir="rtl"] {
#back-button:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=toolbar");
}
#back-button[disabled="true"][chromedir="rtl"] {
#back-button[disabled="true"]:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=toolbar&state=disabled");
}
@ -29,10 +29,10 @@
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=toolbar&state=disabled");
}
#forward-button[chromedir="rtl"] {
#forward-button:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=toolbar");
}
#forward-button[disabled="true"][chromedir="rtl"] {
#forward-button[disabled="true"]:-moz-locale-dir(rtl) {
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=toolbar&state=disabled");
}

Просмотреть файл

@ -73,7 +73,7 @@
cursor: pointer;
}
.search-go-button[chromedir="rtl"] {
.search-go-button:-moz-locale-dir(rtl) {
-moz-transform: scaleX(-1);
}

Просмотреть файл

@ -124,12 +124,12 @@ toolbarbutton.bookmark-item[type=menu] > .toolbarbutton-menu-dropmarker {
-moz-padding-end: 7px;
}
toolbarbutton.bookmark-item[type=menu][chromedir="rtl"] > .toolbarbutton-menu-dropmarker {
toolbarbutton.bookmark-item[type=menu]:-moz-locale-dir(rtl) > .toolbarbutton-menu-dropmarker {
-moz-padding-start: 4px;
-moz-padding-end: 2px;
}
toolbarbutton.bookmark-item[chromedir="rtl"] {
toolbarbutton.bookmark-item:-moz-locale-dir(rtl) {
-moz-padding-start: 0px;
-moz-padding-end: 7px;
}
@ -150,7 +150,7 @@ toolbarbutton.bookmark-item:not([container]) > .toolbarbutton-text {
-moz-padding-end: 7px;
}
toolbarbutton.bookmark-item[chromedir="rtl"] > .toolbarbutton-text {
toolbarbutton.bookmark-item:-moz-locale-dir(rtl) > .toolbarbutton-text {
-moz-padding-end: 0;
-moz-padding-start: 7px;
}
@ -170,14 +170,14 @@ toolbarbutton.bookmark-item[container]:not([open]):hover > .toolbarbutton-menu-d
}
toolbarbutton.bookmark-item[container]:hover > .toolbarbutton-text,
toolbarbutton.bookmark-item[container][chromedir="rtl"]:not([open]):hover > .toolbarbutton-menu-dropmarker,
toolbarbutton.bookmark-item[container]:-moz-locale-dir(rtl):not([open]):hover > .toolbarbutton-menu-dropmarker,
#home-button.bookmark-item:hover > .toolbarbutton-icon,
#home-button.bookmark-item[chromedir="rtl"]:hover > .toolbarbutton-text {
#home-button.bookmark-item:-moz-locale-dir(rtl):hover > .toolbarbutton-text {
background: url("chrome://global/skin/toolbar/toolbarbutton-customhover-mid.png") repeat-x;
}
#home-button.bookmark-item:hover[chromedir="rtl"] > .toolbarbutton-icon,
toolbarbutton.bookmark-item[chromedir="rtl"]:hover > .toolbarbutton-text {
#home-button.bookmark-item:hover:-moz-locale-dir(rtl) > .toolbarbutton-icon,
toolbarbutton.bookmark-item:-moz-locale-dir(rtl):hover > .toolbarbutton-text {
background: url("chrome://global/skin/toolbar/toolbarbutton-customhover-right.png") no-repeat right top;
}
@ -190,15 +190,15 @@ toolbarbutton.bookmark-item[container]:hover:active > .toolbarbutton-menu-dropma
toolbarbutton.bookmark-item[container]:hover:active > .toolbarbutton-text,
toolbarbutton.bookmark-item[container][open="true"] > .toolbarbutton-text,
#home-button.bookmark-item:hover:active > .toolbarbutton-icon,
toolbarbutton.bookmark-item[container][chromedir="rtl"]:hover:active > .toolbarbutton-menu-dropmarker,
toolbarbutton.bookmark-item[container][chromedir="rtl"][open="true"] > .toolbarbutton-menu-dropmarker,
#home-button.bookmark-item:hover:active[chromedir="rtl"] > .toolbarbutton-text {
toolbarbutton.bookmark-item[container]:-moz-locale-dir(rtl):hover:active > .toolbarbutton-menu-dropmarker,
toolbarbutton.bookmark-item[container]:-moz-locale-dir(rtl)[open="true"] > .toolbarbutton-menu-dropmarker,
#home-button.bookmark-item:hover:active:-moz-locale-dir(rtl) > .toolbarbutton-text {
background: url("chrome://browser/skin/bookmark-open-mid.png") repeat-x !important;
}
toolbarbutton.bookmark-item[chromedir="rtl"][container]:hover:active > .toolbarbutton-text,
toolbarbutton.bookmark-item[chromedir="rtl"][container][open] > .toolbarbutton-text,
#home-button.bookmark-item[chromedir="rtl"]:hover:active > .toolbarbutton-icon {
toolbarbutton.bookmark-item:-moz-locale-dir(rtl)[container]:hover:active > .toolbarbutton-text,
toolbarbutton.bookmark-item:-moz-locale-dir(rtl)[container][open] > .toolbarbutton-text,
#home-button.bookmark-item:-moz-locale-dir(rtl):hover:active > .toolbarbutton-icon {
background: url("chrome://browser/skin/bookmark-open-right.png") no-repeat right top !important;
}
@ -290,8 +290,8 @@ toolbarbutton.bookmark-item-microsummarized {
-moz-box-orient: vertical;
}
.toolbarbutton-1[chromedir="rtl"],
#back-forward-dropmarker[chromedir="rtl"] {
.toolbarbutton-1:-moz-locale-dir(rtl),
#back-forward-dropmarker:-moz-locale-dir(rtl) {
list-style-image: url("chrome://browser/skin/Toolbar-rtl.png");
}
@ -375,7 +375,7 @@ toolbar[mode="icons"] #unified-back-forward-button > #back-button {
border-right: none;
}
toolbar[mode="icons"] #unified-back-forward-button > #back-button[chromedir="rtl"] {
toolbar[mode="icons"] #unified-back-forward-button > #back-button:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px, 571px, 33px, 540px);
}
@ -383,7 +383,7 @@ toolbar[mode="icons"] #unified-back-forward-button > #back-button[disabled="true
-moz-image-region: rect(33px, 535px, 66px, 504px);
}
toolbar[mode="icons"] #unified-back-forward-button > #back-button[disabled="true"][chromedir="rtl"] {
toolbar[mode="icons"] #unified-back-forward-button > #back-button[disabled="true"]:-moz-locale-dir(rtl) {
-moz-image-region: rect(33px, 571px, 66px, 540px);
}
@ -392,8 +392,8 @@ toolbar[mode="icons"] #unified-back-forward-button > #back-button[open="true"] {
-moz-image-region: rect(66px, 535px, 99px, 504px);
}
toolbar[mode="icons"] #unified-back-forward-button > #back-button:hover:active[chromedir="rtl"]:not([disabled]),
toolbar[mode="icons"] #unified-back-forward-button > #back-button[open="true"][chromedir="rtl"] {
toolbar[mode="icons"] #unified-back-forward-button > #back-button:hover:active:-moz-locale-dir(rtl):not([disabled]),
toolbar[mode="icons"] #unified-back-forward-button > #back-button[open="true"]:-moz-locale-dir(rtl) {
-moz-image-region: rect(66px, 571px, 99px, 540px);
}
@ -407,7 +407,7 @@ toolbar[mode="icons"] #unified-back-forward-button > #forward-button {
border-right: none;
}
toolbar[mode="icons"] #unified-back-forward-button > #forward-button[chromedir="rtl"] {
toolbar[mode="icons"] #unified-back-forward-button > #forward-button:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px, 540px, 33px, 514px);
}
@ -415,7 +415,7 @@ toolbar[mode="icons"] #unified-back-forward-button > #forward-button[disabled="t
-moz-image-region: rect(33px, 560px, 66px, 535px);
}
toolbar[mode="icons"] #unified-back-forward-button > #forward-button[disabled="true"][chromedir="rtl"] {
toolbar[mode="icons"] #unified-back-forward-button > #forward-button[disabled="true"]:-moz-locale-dir(rtl) {
-moz-image-region: rect(33px, 540px, 66px, 514px);
}
@ -425,8 +425,8 @@ toolbar[mode="icons"] #unified-back-forward-button > #forward-button[open="true"
-moz-margin-start: -5px;
}
toolbar[mode="icons"] #unified-back-forward-button > #forward-button[chromedir="rtl"]:hover:active:not([disabled]),
toolbar[mode="icons"] #unified-back-forward-button > #forward-button[open="true"][chromedir="rtl"] {
toolbar[mode="icons"] #unified-back-forward-button > #forward-button:-moz-locale-dir(rtl):hover:active:not([disabled]),
toolbar[mode="icons"] #unified-back-forward-button > #forward-button[open="true"]:-moz-locale-dir(rtl) {
-moz-image-region: rect(99px, 545px, 132px, 514px);
}
@ -440,7 +440,7 @@ toolbar[mode="icons"] #unified-back-forward-button > #forward-button[open="true"
border-right: none;
}
#back-forward-dropmarker[chromedir="rtl"] {
#back-forward-dropmarker:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px, 514px, 33px, 504px);
}
@ -458,7 +458,7 @@ toolbar[mode="icons"] #back-forward-dropmarker > dropmarker {
-moz-image-region: rect(33px, 571px, 66px, 560px);
}
#back-forward-dropmarker[disabled="true"][chromedir="rtl"] {
#back-forward-dropmarker[disabled="true"]:-moz-locale-dir(rtl) {
-moz-image-region: rect(33px, 514px, 66px, 504px);
}
@ -467,18 +467,18 @@ toolbar[mode="icons"] #back-forward-dropmarker > dropmarker {
-moz-image-region: rect(66px, 571px, 99px, 560px);
}
#back-forward-dropmarker[chromedir="rtl"]:hover:active:not([disabled]),
#back-forward-dropmarker[open="true"][chromedir="rtl"] {
#back-forward-dropmarker:-moz-locale-dir(rtl):hover:active:not([disabled]),
#back-forward-dropmarker[open="true"]:-moz-locale-dir(rtl) {
-moz-image-region: rect(66px, 514px, 99px, 504px);
}
.unified-nav-back[_moz-menuactive],
menupopup[chromedir="rtl"] > .unified-nav-forward[_moz-menuactive] {
menupopup:-moz-locale-dir(rtl) > .unified-nav-forward[_moz-menuactive] {
list-style-image: url("chrome://browser/skin/menu-back.png") !important;
}
.unified-nav-forward[_moz-menuactive],
menupopup[chromedir="rtl"] > .unified-nav-back[_moz-menuactive] {
menupopup:-moz-locale-dir(rtl) > .unified-nav-back[_moz-menuactive] {
list-style-image: url("chrome://browser/skin/menu-forward.png") !important;
}
@ -493,7 +493,7 @@ toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-but
border-right: none;
}
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-button[chromedir="rtl"] {
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-button:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px, 648px, 23px, 614px);
}
@ -501,7 +501,7 @@ toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-but
-moz-image-region: rect(23px, 605px, 46px, 571px);
}
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-button[disabled="true"][chromedir="rtl"] {
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-button[disabled="true"]:-moz-locale-dir(rtl) {
-moz-image-region: rect(23px, 648px, 46px, 614px);
}
@ -510,8 +510,8 @@ toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-but
-moz-image-region: rect(46px, 605px, 69px, 571px);
}
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-button[chromedir="rtl"]:hover:active:not([disabled]),
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-button[open="true"][chromedir="rtl"] {
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-button:-moz-locale-dir(rtl):hover:active:not([disabled]),
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #back-button[open="true"]:-moz-locale-dir(rtl) {
-moz-image-region: rect(46px, 648px, 69px, 614px);
}
@ -525,7 +525,7 @@ toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-
border-right: none;
}
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-button[chromedir="rtl"] {
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-button:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px, 614px, 23px, 580px);
}
@ -533,7 +533,7 @@ toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-
-moz-image-region: rect(23px, 638px, 46px, 605px);
}
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-button[disabled="true"][chromedir="rtl"] {
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-button[disabled="true"]:-moz-locale-dir(rtl) {
-moz-image-region: rect(23px, 614px, 46px, 580px);
}
@ -543,8 +543,8 @@ toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-
-moz-margin-start: 0;
}
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-button[chromedir="rtl"]:hover:active:not([disabled]),
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-button[open="true"][chromedir="rtl"] {
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-button:-moz-locale-dir(rtl):hover:active:not([disabled]),
toolbar[mode="icons"][iconsize="small"] #unified-back-forward-button > #forward-button[open="true"]:-moz-locale-dir(rtl) {
-moz-image-region: rect(46px, 614px, 69px, 580px);
}
@ -554,7 +554,7 @@ toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarke
-moz-image-region: rect(0px, 648px, 23px, 638px);
}
toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarker[chromedir="rtl"] {
toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarker:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px, 580px, 23px, 571px);
}
@ -562,7 +562,7 @@ toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarke
-moz-image-region: rect(23px, 648px, 46px, 638px);
}
toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarker[disabled="true"][chromedir="rtl"] {
toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarker[disabled="true"]:-moz-locale-dir(rtl) {
-moz-image-region: rect(23px, 580px, 46px, 571px);
}
@ -571,8 +571,8 @@ toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarke
-moz-image-region: rect(46px, 648px, 69px, 638px);
}
toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarker[chromedir="rtl"]:hover:active:not([disabled]),
toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarker[open="true"][chromedir="rtl"] {
toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarker:-moz-locale-dir(rtl):hover:active:not([disabled]),
toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarker[open="true"]:-moz-locale-dir(rtl) {
-moz-image-region: rect(46px, 580px, 69px, 571px);
}
@ -1461,7 +1461,7 @@ toolbarbutton.chevron {
list-style-image: url("chrome://global/skin/icons/chevron.png") !important;
}
toolbarbutton.chevron[chromedir="rtl"] {
toolbarbutton.chevron:-moz-locale-dir(rtl) {
list-style-image: url("chrome://global/skin/icons/chevron-rtl.png") !important;
}
@ -1663,15 +1663,15 @@ tabbrowser > tabbox > tabpanels {
border: none;
}
.tabbrowser-arrowscrollbox > .scrollbutton-up[chromedir="ltr"],
.tabbrowser-arrowscrollbox > .scrollbutton-down-stack > .scrollbutton-down[chromedir="rtl"] {
.tabbrowser-arrowscrollbox > .scrollbutton-up:-moz-locale-dir(ltr),
.tabbrowser-arrowscrollbox > .scrollbutton-down-stack > .scrollbutton-down:-moz-locale-dir(rtl) {
border-right: 2px solid;
-moz-border-right-colors: rgba(0,0,0,0.25) rgba(255,255,255,0.15);
list-style-image: url("chrome://browser/skin/tabbrowser/tab-arrow-left.png");
}
.tabbrowser-arrowscrollbox > .scrollbutton-down-stack > .scrollbutton-down[chromedir="ltr"],
.tabbrowser-arrowscrollbox > .scrollbutton-up[chromedir="rtl"] {
.tabbrowser-arrowscrollbox > .scrollbutton-down-stack > .scrollbutton-down:-moz-locale-dir(ltr),
.tabbrowser-arrowscrollbox > .scrollbutton-up:-moz-locale-dir(rtl) {
border-left: 2px solid;
-moz-border-left-colors: rgba(0,0,0,0.25) rgba(255,255,255,0.15);
list-style-image: url("chrome://browser/skin/tabbrowser/tab-arrow-right.png");

Просмотреть файл

@ -96,7 +96,7 @@
border-right: none;
}
#back-button[chromedir="rtl"] {
#back-button:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px, 67px, 23px, 34px);
}
@ -104,7 +104,7 @@
-moz-image-region: rect(23px, 34px, 46px, 0px) !important;
}
#back-button[disabled="true"][chromedir="rtl"] {
#back-button[disabled="true"]:-moz-locale-dir(rtl) {
-moz-image-region: rect(23px, 67px, 46px, 34px) !important;
}
@ -114,9 +114,9 @@
-moz-image-region: rect(46px, 34px, 69px, 0px);
}
#back-button:hover:active[chromedir="rtl"],
#back-button[buttondown="true"][chromedir="rtl"],
#back-button[open="true"][chromedir="rtl"] {
#back-button:hover:active:-moz-locale-dir(rtl),
#back-button[buttondown="true"]:-moz-locale-dir(rtl),
#back-button[open="true"]:-moz-locale-dir(rtl) {
-moz-image-region: rect(46px, 67px, 69px, 34px);
}
@ -136,7 +136,7 @@
border-right: none;
}
#forward-button[chromedir="rtl"] {
#forward-button:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px, 34px, 23px, 0px);
}
@ -144,7 +144,7 @@
-moz-image-region: rect(23px, 67px, 46px, 34px) !important;
}
#forward-button[disabled="true"][chromedir="rtl"] {
#forward-button[disabled="true"]:-moz-locale-dir(rtl) {
-moz-image-region: rect(23px, 34px, 46px, 0px) !important;
}
@ -154,9 +154,9 @@
-moz-image-region: rect(46px, 67px, 69px, 34px);
}
#forward-button:hover:active[chromedir="rtl"],
#forward-button[buttondown="true"][chromedir="rtl"],
#forward-button[open="true"][chromedir="rtl"] {
#forward-button:hover:active:-moz-locale-dir(rtl),
#forward-button[buttondown="true"]:-moz-locale-dir(rtl),
#forward-button[open="true"]:-moz-locale-dir(rtl) {
-moz-image-region: rect(46px, 34px, 69px, 0px);
}
@ -169,10 +169,10 @@
background: url("chrome://browser/skin/places/menubutton-end-pressed.png") right center no-repeat;
}
#placesToolbar[chromedir="rtl"] > toolbarbutton[type="menu"] {
#placesToolbar:-moz-locale-dir(rtl) > toolbarbutton[type="menu"] {
background: url("chrome://browser/skin/places/menubutton-end-rtl.png") left center no-repeat;
}
#placesToolbar[chromedir="rtl"] > toolbarbutton[type="menu"][open="true"] {
#placesToolbar:-moz-locale-dir(rtl) > toolbarbutton[type="menu"][open="true"] {
background: url("chrome://browser/skin/places/menubutton-end-pressed-rtl.png") left center no-repeat;
}
@ -192,10 +192,10 @@
background: url("chrome://browser/skin/places/menubutton-start-pressed.png") left center no-repeat;
}
#placesToolbar[chromedir="rtl"] > toolbarbutton[type="menu"] > .toolbarbutton-icon {
#placesToolbar:-moz-locale-dir(rtl) > toolbarbutton[type="menu"] > .toolbarbutton-icon {
background: url("chrome://browser/skin/places/menubutton-start-rtl.png") right center no-repeat;
}
#placesToolbar[chromedir="rtl"] > toolbarbutton[type="menu"][open="true"] > .toolbarbutton-icon {
#placesToolbar:-moz-locale-dir(rtl) > toolbarbutton[type="menu"][open="true"] > .toolbarbutton-icon {
background: url("chrome://browser/skin/places/menubutton-start-pressed-rtl.png") right center no-repeat;
}

Просмотреть файл

@ -45,7 +45,7 @@
padding: 0;
}
.searchbar-engine-button[chromedir="rtl"] {
.searchbar-engine-button:-moz-locale-dir(rtl) {
background-image: url("chrome://browser/skin/urlbar/startcap-rtl.png");
}
@ -53,7 +53,7 @@
background-image: url("chrome://browser/skin/urlbar/startcap-focused.png");
}
.searchbar-textbox[focused="true"] > .searchbar-engine-button[chromedir="rtl"] {
.searchbar-textbox[focused="true"] > .searchbar-engine-button:-moz-locale-dir(rtl) {
background-image: url("chrome://browser/skin/urlbar/startcap-focused-rtl.png");
}
@ -61,7 +61,7 @@
background-image: url("chrome://browser/skin/urlbar/startcap-focused-graphite.png");
}
.searchbar-textbox[focused="true"] > .searchbar-engine-button[chromedir="rtl"]:-moz-system-metric(mac-graphite-theme) {
.searchbar-textbox[focused="true"] > .searchbar-engine-button:-moz-locale-dir(rtl):-moz-system-metric(mac-graphite-theme) {
background-image: url("chrome://browser/skin/urlbar/startcap-focused-graphite-rtl.png");
}
@ -70,8 +70,8 @@
background-image: url("chrome://browser/skin/urlbar/startcap-active.png") !important;
}
.searchbar-engine-button:hover:active[chromedir="rtl"],
.searchbar-engine-button[open="true"][chromedir="rtl"] {
.searchbar-engine-button:hover:active:-moz-locale-dir(rtl),
.searchbar-engine-button[open="true"]:-moz-locale-dir(rtl) {
background-image: url("chrome://browser/skin/urlbar/startcap-active-rtl.png") !important;
}
@ -80,8 +80,8 @@
background-image: url("chrome://browser/skin/urlbar/startcap-active-focused.png") !important;
}
.searchbar-textbox[focused="true"] > .searchbar-engine-button[chromedir="rtl"]:active,
.searchbar-textbox[focused="true"] > .searchbar-engine-button[open="true"][chromedir="rtl"] {
.searchbar-textbox[focused="true"] > .searchbar-engine-button:-moz-locale-dir(rtl):active,
.searchbar-textbox[focused="true"] > .searchbar-engine-button[open="true"]:-moz-locale-dir(rtl) {
background-image: url("chrome://browser/skin/urlbar/startcap-active-focused-rtl.png") !important;
}
@ -90,8 +90,8 @@
background-image: url("chrome://browser/skin/urlbar/startcap-active-focused-graphite.png") !important;
}
.searchbar-textbox[focused="true"] > .searchbar-engine-button[chromedir="rtl"]:active:-moz-system-metric(mac-graphite-theme),
.searchbar-textbox[focused="true"] > .searchbar-engine-button[open="true"][chromedir="rtl"]:-moz-system-metric(mac-graphite-theme) {
.searchbar-textbox[focused="true"] > .searchbar-engine-button:-moz-locale-dir(rtl):active:-moz-system-metric(mac-graphite-theme),
.searchbar-textbox[focused="true"] > .searchbar-engine-button[open="true"]:-moz-locale-dir(rtl):-moz-system-metric(mac-graphite-theme) {
background-image: url("chrome://browser/skin/urlbar/startcap-active-focused-graphite-rtl.png") !important;
}
@ -118,7 +118,7 @@
-moz-padding-end: 5px;
}
.search-go-container[chromedir="rtl"] {
.search-go-container:-moz-locale-dir(rtl) {
background-image: url("chrome://browser/skin/urlbar/endcap-rtl.png");
}
@ -126,7 +126,7 @@
background-image: url("chrome://browser/skin/urlbar/endcap-focused.png");
}
.searchbar-textbox[focused="true"] > .search-go-container[chromedir="rtl"] {
.searchbar-textbox[focused="true"] > .search-go-container:-moz-locale-dir(rtl) {
background: url("chrome://browser/skin/urlbar/endcap-focused-rtl.png") no-repeat left top;
}
@ -134,7 +134,7 @@
background-image: url("chrome://browser/skin/urlbar/endcap-focused-graphite.png");
}
.searchbar-textbox[focused="true"] > .search-go-container[chromedir="rtl"]:-moz-system-metric(mac-graphite-theme) {
.searchbar-textbox[focused="true"] > .search-go-container:-moz-locale-dir(rtl):-moz-system-metric(mac-graphite-theme) {
background-image: url("chrome://browser/skin/urlbar/endcap-focused-graphite-rtl.png");
}

Просмотреть файл

@ -18,20 +18,20 @@
/* ::::: Identity Indicator Styling ::::: */
#urlbar[chromedir="ltr"]:-moz-system-metric(windows-default-theme) {
#urlbar:-moz-locale-dir(ltr):-moz-system-metric(windows-default-theme) {
-moz-margin-start: 9px;
}
#identity-box[chromedir="ltr"]:-moz-system-metric(windows-default-theme) {
#identity-box:-moz-locale-dir(ltr):-moz-system-metric(windows-default-theme) {
-moz-margin-start: -7px;
}
#identity-box[chromedir="ltr"]:-moz-system-metric(windows-default-theme) {
#identity-box:-moz-locale-dir(ltr):-moz-system-metric(windows-default-theme) {
-moz-border-radius: 11px 0 2px 11px / 15px 0 2px 15px;
}
/* Match #identity-box[chromedir="ltr"]'s -moz-margin-start */
#identity-popup[chromedir="ltr"]:-moz-system-metric(windows-default-theme) {
/* Match #identity-box:-moz-locale-dir(ltr)'s -moz-margin-start */
#identity-popup:-moz-locale-dir(ltr):-moz-system-metric(windows-default-theme) {
-moz-margin-start: 7px;
}

Просмотреть файл

@ -248,16 +248,16 @@ toolbar[iconsize="large"][mode="icons"] #back-button:not([disabled="true"]):hove
/* unified back button with keyhole icons, RTL version */
toolbar[iconsize="large"][mode="icons"] #back-button[chromedir="rtl"] {
toolbar[iconsize="large"][mode="icons"] #back-button:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px 516px 34px 480px);
}
toolbar[iconsize="large"][mode="icons"] #back-button[chromedir="rtl"]:not([disabled="true"]):hover {
toolbar[iconsize="large"][mode="icons"] #back-button:-moz-locale-dir(rtl):not([disabled="true"]):hover {
-moz-image-region: rect(34px 516px 68px 480px);
}
toolbar[iconsize="large"][mode="icons"] #back-button[chromedir="rtl"][disabled="true"] {
toolbar[iconsize="large"][mode="icons"] #back-button:-moz-locale-dir(rtl)[disabled="true"] {
-moz-image-region: rect(68px 516px 102px 480px);
}
toolbar[iconsize="large"][mode="icons"] #back-button[chromedir="rtl"]:not([disabled="true"]):hover:active {
toolbar[iconsize="large"][mode="icons"] #back-button:-moz-locale-dir(rtl):not([disabled="true"]):hover:active {
-moz-image-region: rect(102px 516px 136px 480px);
}
@ -284,16 +284,16 @@ toolbar[iconsize="large"][mode="icons"] #forward-button:not([disabled="true"]):h
/* unified forward button with keyhole icons, RTL version */
toolbar[iconsize="large"][mode="icons"] #forward-button[chromedir="rtl"] {
toolbar[iconsize="large"][mode="icons"] #forward-button:-moz-locale-dir(rtl) {
-moz-image-region: rect(3px 480px 31px 454px);
}
toolbar[iconsize="large"][mode="icons"] #forward-button[chromedir="rtl"]:not([disabled="true"]):hover {
toolbar[iconsize="large"][mode="icons"] #forward-button:-moz-locale-dir(rtl):not([disabled="true"]):hover {
-moz-image-region: rect(37px 480px 65px 454px);
}
toolbar[iconsize="large"][mode="icons"] #forward-button[chromedir="rtl"][disabled="true"] {
toolbar[iconsize="large"][mode="icons"] #forward-button:-moz-locale-dir(rtl)[disabled="true"] {
-moz-image-region: rect(71px 480px 99px 454px);
}
toolbar[iconsize="large"][mode="icons"] #forward-button[chromedir="rtl"]:not([disabled="true"]):hover:active {
toolbar[iconsize="large"][mode="icons"] #forward-button:-moz-locale-dir(rtl):not([disabled="true"]):hover:active {
-moz-image-region: rect(105px 480px 133px 454px);
}
@ -331,16 +331,16 @@ toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker:not([disabled="
/* unified dropmarker with keyhole icons, RTL version */
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"] {
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker:-moz-locale-dir(rtl) {
-moz-image-region: rect(3px 454px 31px 438px);
}
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"]:not([disabled="true"]):hover {
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker:-moz-locale-dir(rtl):not([disabled="true"]):hover {
-moz-image-region: rect(37px 454px 65px 438px);
}
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"][disabled="true"] {
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker:-moz-locale-dir(rtl)[disabled="true"] {
-moz-image-region: rect(71px 454px 99px 438px);
}
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"]:not([disabled="true"]):hover:active {
toolbar[iconsize="large"][mode="icons"] #back-forward-dropmarker:-moz-locale-dir(rtl):not([disabled="true"]):hover:active {
-moz-image-region: rect(105px 454px 133px 438px);
}
@ -368,16 +368,16 @@ toolbar[iconsize="small"][mode="icons"] #back-button:not([disabled="true"]):hove
/* unified back button with keyhole icons, small icons mode, RTL version */
toolbar[iconsize="small"][mode="icons"] #back-button[chromedir="rtl"] {
toolbar[iconsize="small"][mode="icons"] #back-button:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px 362px 24px 338px);
}
toolbar[iconsize="small"][mode="icons"] #back-button[chromedir="rtl"]:not([disabled="true"]):hover {
toolbar[iconsize="small"][mode="icons"] #back-button:-moz-locale-dir(rtl):not([disabled="true"]):hover {
-moz-image-region: rect(24px 362px 48px 338px);
}
toolbar[iconsize="small"][mode="icons"] #back-button[chromedir="rtl"][disabled="true"] {
toolbar[iconsize="small"][mode="icons"] #back-button:-moz-locale-dir(rtl)[disabled="true"] {
-moz-image-region: rect(48px 362px 72px 338px);
}
toolbar[iconsize="small"][mode="icons"] #back-button[chromedir="rtl"]:not([disabled="true"]):hover:active {
toolbar[iconsize="small"][mode="icons"] #back-button:-moz-locale-dir(rtl):not([disabled="true"]):hover:active {
-moz-image-region: rect(72px 362px 96px 338px);
}
@ -398,16 +398,16 @@ toolbar[iconsize="small"][mode="icons"] #forward-button:not([disabled="true"]):h
/* unified forward button with keyhole icons, small icons mode, RTL version */
toolbar[iconsize="small"][mode="icons"] #forward-button[chromedir="rtl"] {
toolbar[iconsize="small"][mode="icons"] #forward-button:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px 338px 24px 314px);
}
toolbar[iconsize="small"][mode="icons"] #forward-button[chromedir="rtl"]:not([disabled="true"]):hover {
toolbar[iconsize="small"][mode="icons"] #forward-button:-moz-locale-dir(rtl):not([disabled="true"]):hover {
-moz-image-region: rect(24px 338px 48px 314px);
}
toolbar[iconsize="small"][mode="icons"] #forward-button[chromedir="rtl"][disabled="true"] {
toolbar[iconsize="small"][mode="icons"] #forward-button:-moz-locale-dir(rtl)[disabled="true"] {
-moz-image-region: rect(48px 338px 72px 314px);
}
toolbar[iconsize="small"][mode="icons"] #forward-button[chromedir="rtl"]:not([disabled="true"]):hover:active {
toolbar[iconsize="small"][mode="icons"] #forward-button:-moz-locale-dir(rtl):not([disabled="true"]):hover:active {
-moz-image-region: rect(72px 338px 96px 314px);
}
@ -429,16 +429,16 @@ toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker:not([disabled="
/* unified dropmarker with keyhole icons, small icons mode, RTL version */
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"] {
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px 314px 24px 301px);
}
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"]:not([disabled="true"]):hover {
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker:-moz-locale-dir(rtl):not([disabled="true"]):hover {
-moz-image-region: rect(24px 314px 48px 301px);
}
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"][disabled="true"] {
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker:-moz-locale-dir(rtl)[disabled="true"] {
-moz-image-region: rect(48px 314px 72px 301px);
}
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"]:not([disabled="true"]):hover:active {
toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker:-moz-locale-dir(rtl):not([disabled="true"]):hover:active {
-moz-image-region: rect(72px 314px 96px 301px);
}
@ -460,17 +460,17 @@ toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"
-moz-image-region: rect(96px 24px 120px 0px);
}
#back-button[chromedir="rtl"] {
#back-button:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px 48px 24px 24px);
}
#back-button[chromedir="rtl"]:not([disabled="true"]):hover,
#back-button[chromedir="rtl"][buttonover="true"] {
#back-button:-moz-locale-dir(rtl):not([disabled="true"]):hover,
#back-button:-moz-locale-dir(rtl)[buttonover="true"] {
-moz-image-region: rect(24px 48px 48px 24px);
}
#back-button[chromedir="rtl"][disabled="true"] {
#back-button:-moz-locale-dir(rtl)[disabled="true"] {
-moz-image-region: rect(48px 48px 72px 24px);
}
#back-button[chromedir="rtl"]:not([disabled="true"]):hover:active {
#back-button:-moz-locale-dir(rtl):not([disabled="true"]):hover:active {
-moz-image-region: rect(96px 48px 120px 24px);
}
@ -490,17 +490,17 @@ toolbar[iconsize="small"][mode="icons"] #back-forward-dropmarker[chromedir="rtl"
-moz-image-region: rect(96px 48px 120px 24px);
}
#forward-button[chromedir="rtl"] {
#forward-button:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px 24px 24px 0px);
}
#forward-button[chromedir="rtl"]:not([disabled="true"]):hover,
#forward-button[chromedir="rtl"][buttonover="true"] {
#forward-button:-moz-locale-dir(rtl):not([disabled="true"]):hover,
#forward-button:-moz-locale-dir(rtl)[buttonover="true"] {
-moz-image-region: rect(24px 24px 48px 0px);
}
#forward-button[chromedir="rtl"][disabled="true"] {
#forward-button:-moz-locale-dir(rtl)[disabled="true"] {
-moz-image-region: rect(48px 24px 72px 0px);
}
#forward-button[chromedir="rtl"]:not([disabled="true"]):hover:active {
#forward-button:-moz-locale-dir(rtl):not([disabled="true"]):hover:active {
-moz-image-region: rect(96px 24px 120px 0px);
}
@ -727,21 +727,21 @@ toolbar[iconsize="small"] #back-button:not([disabled="true"]):hover:active {
-moz-image-region: rect(64px 16px 80px 0px);
}
toolbar[iconsize="small"] #back-button[chromedir="rtl"] {
toolbar[iconsize="small"] #back-button:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px 32px 16px 16px);
}
toolbar[iconsize="small"] #back-button[chromedir="rtl"]:not([disabled="true"]):hover,
toolbar[iconsize="small"] #back-button[chromedir="rtl"][buttonover="true"] {
toolbar[iconsize="small"] #back-button:-moz-locale-dir(rtl):not([disabled="true"]):hover,
toolbar[iconsize="small"] #back-button:-moz-locale-dir(rtl)[buttonover="true"] {
-moz-image-region: rect(16px 32px 32px 16px);
}
toolbar[iconsize="small"] #back-button[chromedir="rtl"][disabled="true"] {
toolbar[iconsize="small"] #back-button:-moz-locale-dir(rtl)[disabled="true"] {
-moz-image-region: rect(32px 32px 48px 16px);
}
toolbar[iconsize="small"] #back-button[chromedir="rtl"]:not([disabled="true"]):hover:active {
toolbar[iconsize="small"] #back-button:-moz-locale-dir(rtl):not([disabled="true"]):hover:active {
-moz-image-region: rect(64px 32px 80px 16px);
}
.unified-nav-back[_moz-menuactive],
menupopup[chromedir="rtl"] > .unified-nav-forward[_moz-menuactive] {
menupopup:-moz-locale-dir(rtl) > .unified-nav-forward[_moz-menuactive] {
list-style-image: url("chrome://browser/skin/menu-back.png") !important;
}
@ -764,21 +764,21 @@ toolbar[iconsize="small"] #forward-button:not([disabled="true"]):hover:active {
-moz-image-region: rect(64px 32px 80px 16px);
}
toolbar[iconsize="small"] #forward-button[chromedir="rtl"] {
toolbar[iconsize="small"] #forward-button:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px 16px 16px 0px);
}
toolbar[iconsize="small"] #forward-button[chromedir="rtl"]:not([disabled="true"]):hover,
toolbar[iconsize="small"] #forward-button[chromedir="rtl"][buttonover="true"] {
toolbar[iconsize="small"] #forward-button:-moz-locale-dir(rtl):not([disabled="true"]):hover,
toolbar[iconsize="small"] #forward-button:-moz-locale-dir(rtl)[buttonover="true"] {
-moz-image-region: rect(16px 16px 32px 0px);
}
toolbar[iconsize="small"] #forward-button[chromedir="rtl"][disabled="true"] {
toolbar[iconsize="small"] #forward-button:-moz-locale-dir(rtl)[disabled="true"] {
-moz-image-region: rect(32px 16px 48px 0px);
}
toolbar[iconsize="small"] #forward-button[chromedir="rtl"]:not([disabled="true"]):hover:active {
toolbar[iconsize="small"] #forward-button:-moz-locale-dir(rtl):not([disabled="true"]):hover:active {
-moz-image-region: rect(64px 16px 80px 0px);
}
.unified-nav-forward[_moz-menuactive],
menupopup[chromedir="rtl"] > .unified-nav-back[_moz-menuactive] {
menupopup:-moz-locale-dir(rtl) > .unified-nav-back[_moz-menuactive] {
list-style-image: url("chrome://browser/skin/menu-forward.png") !important;
}
@ -1101,7 +1101,7 @@ toolbar[iconsize="small"] #paste-button:not([disabled="true"]):hover:active {
direction: ltr !important;
}
#PopupAutoComplete[chromedir="rtl"] > tree > treerows {
#PopupAutoComplete:-moz-locale-dir(rtl) > tree > treerows {
direction: rtl;
}
@ -1508,7 +1508,7 @@ tabpanels {
-moz-border-radius-topright: 2px;
}
.tabbrowser-arrowscrollbox > .scrollbutton-up[chromedir="rtl"] {
.tabbrowser-arrowscrollbox > .scrollbutton-up:-moz-locale-dir(rtl) {
border-left-style: solid;
border-right-style: none;
-moz-border-radius-topleft: 2px;
@ -1527,16 +1527,16 @@ tabpanels {
list-style-image: url("chrome://browser/skin/tabbrowser/tab-arrow-right.png");
}
.tabbrowser-arrowscrollbox > .scrollbutton-down[chromedir="rtl"],
.tabs-container > .tabs-newtab-button[chromedir="rtl"],
.tabs-container > stack[chromedir="rtl"] > .tabs-alltabs-button {
.tabbrowser-arrowscrollbox > .scrollbutton-down:-moz-locale-dir(rtl),
.tabs-container > .tabs-newtab-button:-moz-locale-dir(rtl),
.tabs-container > stack:-moz-locale-dir(rtl) > .tabs-alltabs-button {
border-left-style: none;
border-right-style: solid;
-moz-border-radius-topleft: 0px;
-moz-border-radius-topright: 2px;
}
.tabbrowser-arrowscrollbox > .scrollbutton-down[chromedir="rtl"] {
.tabbrowser-arrowscrollbox > .scrollbutton-down:-moz-locale-dir(rtl) {
list-style-image: url("chrome://browser/skin/tabbrowser/tab-arrow-left.png");
}
@ -1592,7 +1592,7 @@ tabpanels {
opacity: 0.0;
}
stack[chromedir="rtl"] > hbox > .tabs-alltabs-box-animate {
stack:-moz-locale-dir(rtl) > hbox > .tabs-alltabs-box-animate {
background-image: url("chrome://browser/skin/tabbrowser/alltabs-box-overflow-start-bkgnd-animate.png");
}
@ -1643,7 +1643,7 @@ stack[chromedir="rtl"] > hbox > .tabs-alltabs-box-animate {
-moz-border-radius-topleft: 2px;
}
.tabs-container > .tabs-closebutton[chromedir="rtl"] {
.tabs-container > .tabs-closebutton:-moz-locale-dir(rtl) {
border-left: none;
border-right: 1px solid threedshadow;
-moz-border-radius-topleft: 0px;
@ -1660,7 +1660,7 @@ toolbarbutton.chevron {
list-style-image: url("chrome://global/skin/toolbar/chevron.gif") !important;
}
toolbarbutton.chevron[chromedir="rtl"] {
toolbarbutton.chevron:-moz-locale-dir(rtl) {
list-style-image: url("chrome://global/skin/toolbar/chevron-rtl.gif") !important;
}
@ -1712,13 +1712,13 @@ toolbar[mode="text"] > #window-controls > toolbarbutton > .toolbarbutton-text {
-moz-image-region: rect(0, 26px, 11px, 13px);
}
#urlbar[chromedir="ltr"] > .autocomplete-history-dropmarker {
#urlbar:-moz-locale-dir(ltr) > .autocomplete-history-dropmarker {
border-left: 1px solid;
-moz-border-left-colors: transparent;
}
#urlbar[chromedir="ltr"] > .autocomplete-history-dropmarker:hover ,
#urlbar[chromedir="ltr"] > .autocomplete-history-dropmarker[open="true"] {
#urlbar:-moz-locale-dir(ltr) > .autocomplete-history-dropmarker:hover ,
#urlbar:-moz-locale-dir(ltr) > .autocomplete-history-dropmarker[open="true"] {
-moz-border-left-colors: ButtonShadow;
}
@ -1802,7 +1802,7 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
/* ::::: Identity Indicator Styling ::::: */
/* Location bar visuals*/
#urlbar[chromedir="ltr"]:-moz-system-metric(windows-default-theme) {
#urlbar:-moz-locale-dir(ltr):-moz-system-metric(windows-default-theme) {
-moz-margin-start: 6px;
}
@ -1818,10 +1818,10 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
-moz-box-shadow: 1px 1px 0 rgba(255,255,255,.3) inset,
0 -1px 0 rgba(255,255,255,.2) inset;
}
#identity-box[chromedir="rtl"] {
#identity-box:-moz-locale-dir(ltr) {
-moz-border-start-style: solid;
}
#identity-box[chromedir="ltr"]:-moz-system-metric(windows-default-theme) {
#identity-box:-moz-locale-dir(ltr):-moz-system-metric(windows-default-theme) {
-moz-border-radius: 6px 0 2px 6px / 15px 0 2px 15px;
margin: -1px 0;
-moz-margin-start: -4px;
@ -1980,7 +1980,7 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
}
/* Bug 413060, comment 14: Match #identity-box's -moz-margin-start, less 1px */
#identity-popup[chromedir="ltr"]:-moz-system-metric(windows-default-theme) {
#identity-popup:-moz-locale-dir(ltr):-moz-system-metric(windows-default-theme) {
-moz-margin-start: 3px;
}

Просмотреть файл

@ -20,36 +20,36 @@
}
#back-button,
#forward-button[chromedir="rtl"] {
#forward-button:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px, 24px, 24px, 0px);
}
#back-button:not([disabled="true"]):hover,
#forward-button:not([disabled="true"]):hover[chromedir="rtl"] {
#forward-button:not([disabled="true"]):hover:-moz-locale-dir(rtl) {
-moz-image-region: rect(24px, 24px, 48px, 0px);
}
#back-button[disabled="true"],
#forward-button[chromedir="rtl"][disabled="true"] {
#forward-button:-moz-locale-dir(rtl)[disabled="true"] {
-moz-image-region: rect(48px, 24px, 72px, 0px) !important;
}
#back-button:not([disabled="true"]):hover:active,
#forward-button:not([disabled="true"]):hover:active[chromedir="rtl"] {
#forward-button:not([disabled="true"]):hover:active:-moz-locale-dir(rtl) {
-moz-image-region: rect(72px, 24px, 96px, 0px);
}
#forward-button,
#back-button[chromedir="rtl"] {
#back-button:-moz-locale-dir(rtl) {
-moz-image-region: rect(0px, 48px, 24px, 24px);
}
#forward-button:not([disabled="true"]):hover,
#back-button:not([disabled="true"]):hover[chromedir="rtl"] {
#back-button:not([disabled="true"]):hover:-moz-locale-dir(rtl) {
-moz-image-region: rect(24px, 48px, 48px, 24px);
}
#forward-button[disabled="true"],
#back-button[chromedir="rtl"][disabled="true"] {
#back-button:-moz-locale-dir(rtl)[disabled="true"] {
-moz-image-region: rect(48px, 48px, 72px, 24px) !important;
}
#forward-button:not([disabled="true"]):hover:active,
#back-button:not([disabled="true"]):hover:active[chromedir="rtl"] {
#back-button:not([disabled="true"]):hover:active:-moz-locale-dir(rtl) {
-moz-image-region: rect(72px, 48px, 96px, 24px);
}
@ -94,7 +94,7 @@
background: url(chrome://global/skin/arrow/arrow-dn.gif) right center no-repeat;
}
#placesMenu[chromedir="rtl"] > menu > label {
#placesMenu:-moz-locale-dir(rtl) > menu > label {
background-position: left center;
}

Просмотреть файл

@ -45,7 +45,7 @@
0 -1px 0 rgba(255,255,255,.4) inset;
}
.searchbar-engine-button:-moz-system-metric(windows-default-theme)[chromedir="ltr"] {
.searchbar-engine-button:-moz-system-metric(windows-default-theme):-moz-locale-dir(ltr) {
-moz-border-right-colors: rgba(0,0,0,.05);
}
@ -68,7 +68,7 @@
background: transparent url(chrome://browser/skin/Search-addengines.png) no-repeat right center;
}
.searchbar-engine-button[addengines="true"][chromedir="rtl"] > .button-box {
.searchbar-engine-button[addengines="true"]:-moz-locale-dir(rtl) > .button-box {
background-position: left center;
}
@ -94,7 +94,7 @@
-moz-image-region: rect(0px 16px 16px 0px);
}
.search-go-button[chromedir="rtl"] {
.search-go-button:-moz-locale-dir(rtl) {
-moz-transform: scaleX(-1);
}

Просмотреть файл

@ -0,0 +1,14 @@
-----BEGIN CERTIFICATE-----
MIICKDCCAZGgAwIBAgIFAIyjFPowDQYJKoZIhvcNAQEFBQAwKDEXMBUGA1UEAwwO
KgB3d3cubXlDQS5vcmcxDTALBgNVBAMTBG15Q0EwHhcNMDkwMzE0MTg0NzU2WhcN
MTkwMzE0MTg0NzU2WjBhMRMwEQYDVQQKEwpCYWRndXkgSW5jMRcwFQYDVQQDEw53
d3cuYmFkZ3V5LmNvbTEZMBcGA1UECxMQSGFja2luZyBEaXZpc2lvbjEWMBQGBFUE
gAMTDHd3dy5iYW5rLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2YvL
GgmF0OTLBKz0nYTvR+DlnZai7b2MqAIM9IUEpMfqzJPNYCsXziYXgHtr/do9ppJP
BhDjeyIGEOSpgBqdkWItxlLopUHnf8VKwnDPPj4KkNyXuTLm60X/ph+/zrjTw+kU
m+/kVYstgGMuTIoTuu7loxCqqeVlAgc5lzTpUhkCAwEAAaMlMCMwDAYDVR0TAQH/
BAIwADATBgNVHSUEDDAKBggrBgEFBQcDATANBgkqhkiG9w0BAQUFAAOBgQAKHl1G
vaXftj5QPK3eIT6Q3fWuGKR39grlg5GL/WocPanYycOlm9zvT1Hx95cY6msIXSKp
xycndJ02ODX35DDgolV6VHUsM9yoagk+eqs5kCqW2qiv3moIshL0yWVhuCobMA+E
D3wHFCPqVU+igRdCrEQDxZHoFOR4J/DKHfGANg==
-----END CERTIFICATE-----

Просмотреть файл

@ -0,0 +1,16 @@
-----BEGIN CERTIFICATE-----
MIICljCCAf+gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBkDERMA8GBPMlBAMTB2F0
dGFjazcxEDAOBgOABAMTB2F0dGFjazYxEzARBgZVBP///38TB2F0dGFjazUxEjAQ
BgVVBAOBgRMHYXR0YWNrNDEUMBIGB1UEgICAgIATB2F0dGFjazMxFDASBgdVBJCA
gIABEwdhdHRhY2syMRQwEgYHVQSIgICAARMHYXR0YWNrMTAeFw0wOTA0MTMxNDAw
MzdaFw0yOTA0MTMxNDAwMzdaMIGQMREwDwYE8yUEAxMHYXR0YWNrNzEQMA4GA4AE
AxMHYXR0YWNrNjETMBEGBlUE////fxMHYXR0YWNrNTESMBAGBVUEA4GBEwdhdHRh
Y2s0MRQwEgYHVQSAgICAgBMHYXR0YWNrMzEUMBIGB1UEkICAgAETB2F0dGFjazIx
FDASBgdVBIiAgIABEwdhdHRhY2sxMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB
gQC77fQ1wrywBnVmr8XO0/78/qFOz+sjnMlpBvLx5UImittgMNSgEqNulRDbO0qG
K4tlFF2sNsS7aOun6Cq7yl2+a8mIljmjzs+iwCLOEAkQTOM4RsdCosJVy/fjwmH1
xI0uXt5cPkA0FM7B/IZSzWSC+2gY1+u1AhRJ35bXDhu92wIDAQABMA0GCSqGSIb3
DQEBBQUAA4GBAFZitQjsQJ1+XsxKchBefilaHsi4oncc05P29IXcRbHI8wK2vNk8
kkG2c6M4a4Rx1R4C3n99NwXH4vyNUbA9FuMSAdjaS3TW3zm8lKNCuIWGuI2Vvefy
+wNcCfb8B4AuP8pZOqqKsspgiBAE1EPPErnb7nMVLCnf+ts9ARXLBZTi
-----END CERTIFICATE-----

Просмотреть файл

@ -0,0 +1,14 @@
-----BEGIN CERTIFICATE-----
MIICMTCCAZqgAwIBAgIFAIyjFTAwDQYJKoZIhvcNAQEFBQAwKDEXMBUGA1UEAwwO
KgB3d3cubXlDQS5vcmcxDTALBgNVBAMTBG15Q0EwHhcNMDkwMzE0MTg0ODI0WhcN
MTkwMzE0MTg0ODI0WjBqMRMwEQYDVQQKEwpCYWRndXkgSW5jMRcwFQYDVQQDEw53
d3cuYmFkZ3V5LmNvbTEZMBcGA1UECxMQSGFja2luZyBEaXZpc2lvbjEfMB0GDVUE
goCAgICAgICAgAMTDHd3dy5iYW5rLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
gYkCgYEA2YvLGgmF0OTLBKz0nYTvR+DlnZai7b2MqAIM9IUEpMfqzJPNYCsXziYX
gHtr/do9ppJPBhDjeyIGEOSpgBqdkWItxlLopUHnf8VKwnDPPj4KkNyXuTLm60X/
ph+/zrjTw+kUm+/kVYstgGMuTIoTuu7loxCqqeVlAgc5lzTpUhkCAwEAAaMlMCMw
DAYDVR0TAQH/BAIwADATBgNVHSUEDDAKBggrBgEFBQcDATANBgkqhkiG9w0BAQUF
AAOBgQBr+ekYoADBm6kbHBR1oc/6O9ZciRsTbxIAl3xjA3kNEeiUXXSoe+1dlt3Z
7D6EaQztqR8usCW728J3vi8p/XxociK3r4aq0Sxu29gp21N1V/Um8y3ssI+Yt9Im
oHlo5ikUXra5PtGAwi4FymrU5dWlHxYk1PlNP5nsvxdElPZnZA==
-----END CERTIFICATE-----

Двоичные данные
build/pgo/certs/cert8.db

Двоичный файл не отображается.

Двоичные данные
build/pgo/certs/key3.db

Двоичный файл не отображается.

Просмотреть файл

@ -156,3 +156,7 @@ https://sub.sectest1.example.org:443
# Used while testing the url-classifier
#
http://malware.example.com:80
# Bug 483437, 484111
https://www.bank1.com:443 privileged,cert=escapeattack1
https://www.bank2.com:443 privileged,cert=escapeattack2

Просмотреть файл

@ -139,8 +139,7 @@ PRUint32 nsAutoInPrincipalDomainOriginSetter::sInPrincipalDomainOrigin;
static
nsresult
GetPrincipalDomainOrigin(nsIPrincipal* aPrincipal,
nsACString& aOrigin)
GetOriginFromURI(nsIURI* aURI, nsACString& aOrigin)
{
if (nsAutoInPrincipalDomainOriginSetter::sInPrincipalDomainOrigin > 1) {
// Allow a single recursive call to GetPrincipalDomainOrigin, since that
@ -151,16 +150,8 @@ GetPrincipalDomainOrigin(nsIPrincipal* aPrincipal,
}
nsAutoInPrincipalDomainOriginSetter autoSetter;
aOrigin.Truncate();
nsCOMPtr<nsIURI> uri;
aPrincipal->GetDomain(getter_AddRefs(uri));
if (!uri) {
aPrincipal->GetURI(getter_AddRefs(uri));
}
NS_ENSURE_TRUE(uri, NS_ERROR_UNEXPECTED);
uri = NS_GetInnermostURI(uri);
nsCOMPtr<nsIURI> uri = NS_GetInnermostURI(aURI);
NS_ENSURE_TRUE(uri, NS_ERROR_UNEXPECTED);
nsCAutoString hostPort;
@ -182,6 +173,22 @@ GetPrincipalDomainOrigin(nsIPrincipal* aPrincipal,
return NS_OK;
}
static
nsresult
GetPrincipalDomainOrigin(nsIPrincipal* aPrincipal,
nsACString& aOrigin)
{
nsCOMPtr<nsIURI> uri;
aPrincipal->GetDomain(getter_AddRefs(uri));
if (!uri) {
aPrincipal->GetURI(getter_AddRefs(uri));
}
NS_ENSURE_TRUE(uri, NS_ERROR_UNEXPECTED);
return GetOriginFromURI(uri, aOrigin);
}
// Inline copy of JS_GetPrivate() for better inlining and optimization
// possibilities. Also doesn't take a cx argument as it's not
// needed. We access the private data only on objects whose private
@ -831,35 +838,81 @@ nsScriptSecurityManager::CheckPropertyAccessImpl(PRUint32 aAction,
NS_ConvertUTF8toUTF16 className(classInfoData.GetName());
nsCAutoString subjectOrigin;
nsCAutoString subjectDomain;
if (!nsAutoInPrincipalDomainOriginSetter::sInPrincipalDomainOrigin) {
GetPrincipalDomainOrigin(subjectPrincipal, subjectOrigin);
nsCOMPtr<nsIURI> uri, domain;
subjectPrincipal->GetURI(getter_AddRefs(uri));
// Subject can't be system if we failed the security
// check, so |uri| is non-null.
NS_ASSERTION(uri, "How did that happen?");
GetOriginFromURI(uri, subjectOrigin);
subjectPrincipal->GetDomain(getter_AddRefs(domain));
if (domain) {
GetOriginFromURI(domain, subjectDomain);
}
} else {
subjectOrigin.AssignLiteral("the security manager");
}
NS_ConvertUTF8toUTF16 subjectOriginUnicode(subjectOrigin);
NS_ConvertUTF8toUTF16 subjectDomainUnicode(subjectDomain);
nsCAutoString objectOrigin;
nsCAutoString objectDomain;
if (!nsAutoInPrincipalDomainOriginSetter::sInPrincipalDomainOrigin &&
objectPrincipal) {
GetPrincipalDomainOrigin(objectPrincipal, objectOrigin);
nsCOMPtr<nsIURI> uri, domain;
objectPrincipal->GetURI(getter_AddRefs(uri));
if (uri) { // Object principal might be system
GetOriginFromURI(uri, objectOrigin);
}
objectPrincipal->GetDomain(getter_AddRefs(domain));
if (domain) {
GetOriginFromURI(domain, objectDomain);
}
}
NS_ConvertUTF8toUTF16 objectOriginUnicode(objectOrigin);
NS_ConvertUTF8toUTF16 objectDomainUnicode(objectDomain);
nsXPIDLString errorMsg;
const PRUnichar *formatStrings[] =
{
subjectOriginUnicode.get(),
className.get(),
JSValIDToString(cx, aProperty),
objectOriginUnicode.get()
objectOriginUnicode.get(),
subjectDomainUnicode.get(),
objectDomainUnicode.get()
};
PRUint32 length = NS_ARRAY_LENGTH(formatStrings);
// XXXbz Our localization system is stupid and can't handle not showing
// some strings that get passed in. Which means that we have to get
// our length precisely right: it has to be exactly the number of
// strings our format string wants. This means we'll have to move
// strings in the array as needed, sadly...
if (nsAutoInPrincipalDomainOriginSetter::sInPrincipalDomainOrigin ||
!objectPrincipal) {
stringName.AppendLiteral("OnlySubject");
--length;
length -= 3;
} else {
// default to a length that doesn't include the domains, then
// increase it as needed.
length -= 2;
if (!subjectDomainUnicode.IsEmpty()) {
stringName.AppendLiteral("SubjectDomain");
length += 1;
}
if (!objectDomainUnicode.IsEmpty()) {
stringName.AppendLiteral("ObjectDomain");
length += 1;
if (length != NS_ARRAY_LENGTH(formatStrings)) {
// We have an object domain but not a subject domain.
// Scoot our string over one slot. See the XXX comment
// above for why we need to do this.
formatStrings[length-1] = formatStrings[length];
}
}
}
// We need to keep our existing failure rv and not override it

Просмотреть файл

@ -297,6 +297,7 @@ MOZ_OPTIMIZE_LDFLAGS = @MOZ_OPTIMIZE_LDFLAGS@
MOZ_OPTIMIZE_SIZE_TWEAK = @MOZ_OPTIMIZE_SIZE_TWEAK@
MOZ_RTTI_FLAGS_ON = @_MOZ_RTTI_FLAGS_ON@
MOZ_EXCEPTIONS_FLAGS_ON = @_MOZ_EXCEPTIONS_FLAGS_ON@
MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE = @MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE@
PROFILE_GEN_CFLAGS = @PROFILE_GEN_CFLAGS@

Просмотреть файл

@ -7330,6 +7330,8 @@ else
_MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_OFF
fi
AC_SUBST(_MOZ_EXCEPTIONS_FLAGS_ON)
# Irix & OSF native compilers do not like exception declarations
# when exceptions are disabled
if test -n "$MIPSPRO_CXX" -o -n "$COMPAQ_CXX" -o -n "$VACPP"; then

Просмотреть файл

@ -105,8 +105,8 @@ class nsIBoxObject;
// IID for the nsIDocument interface
#define NS_IDOCUMENT_IID \
{ 0x46003091, 0x7f99, 0x420f, \
{ 0x95, 0xbc, 0x28, 0xd7, 0xd5, 0x01, 0x5a, 0x41 } }
{ 0xe0ca6723, 0x1efa, 0x4819, \
{ 0x84, 0xbb, 0xfa, 0x48, 0x39, 0xe8, 0xef, 0x19 } }
// Flag for AddStyleSheet().
#define NS_STYLESHEET_FROM_CATALOG (1 << 0)
@ -1156,6 +1156,15 @@ public:
*/
virtual void MaybePreLoadImage(nsIURI* uri) = 0;
/**
* Returns true if the locale used for the document specifies a direction of
* right to left. For chrome documents, this comes from the chrome registry.
* This is used to determine the current state for the :-moz-locale-dir pseudoclass
* so once can know whether a document is expected to be rendered left-to-right
* or right-to-left.
*/
virtual PRBool IsDocumentRightToLeft() { return PR_FALSE; }
protected:
~nsIDocument()
{

Просмотреть файл

@ -3209,15 +3209,10 @@ nsGenericElement::doInsertChildAt(nsIContent* aKid, PRUint32 aIndex,
return rv;
}
// The kid may have removed its parent from the document, so recheck that
// that's still in the document before proceeding. Also, the kid may have
// just removed itself, in which case we don't really want to fire
// ContentAppended or a mutation event.
// XXXbz What if the kid just moved us in the document? Scripts suck. We
// really need to stop running them while we're in the middle of modifying
// the DOM....
NS_ASSERTION(aKid->GetNodeParent() == container,
"Did we run script inappropriately?");
if (aNotify && aKid->GetNodeParent() == container) {
if (aNotify) {
// Note that we always want to call ContentInserted when things are added
// as kids to documents
if (aParent && isAppend) {
@ -3730,7 +3725,7 @@ nsGenericElement::doReplaceOrInsertBefore(PRBool aReplace,
// We want an update batch when we expect several mutations to be performed,
// which is when we're replacing a node, or when we're inserting a fragment.
mozAutoDocConditionalContentUpdateBatch(aDocument,
mozAutoDocConditionalContentUpdateBatch batch(aDocument,
aReplace || nodeType == nsIDOMNode::DOCUMENT_FRAGMENT_NODE);
// If we're replacing
@ -3768,6 +3763,12 @@ nsGenericElement::doReplaceOrInsertBefore(PRBool aReplace,
if (nodeType == nsIDOMNode::DOCUMENT_FRAGMENT_NODE) {
PRUint32 count = newContent->GetChildCount();
if (!count) {
returnVal.swap(*aReturn);
return NS_OK;
}
// Copy the children into a separate array to avoid having to deal with
// mutations to the fragment while we're inserting.
nsCOMArray<nsIContent> fragChildren;
@ -3793,25 +3794,12 @@ nsGenericElement::doReplaceOrInsertBefore(PRBool aReplace,
mutated = mutated || guard.Mutated(1);
}
// Iterate through the fragment's children, and insert them in the new
// parent
for (i = 0; i < count; ++i) {
// Get the n:th child from the array.
nsIContent* childContent = fragChildren[i];
// If we've had any unexpeted mutations so far we need to recheck that
// the child can still be inserted.
if (mutated) {
// We really only need to update insPos if we *just* got an unexpected
// mutation as opposed to 3 insertions ago. But this is an edgecase so
// no need to over optimize.
insPos = refContent ? container->IndexOf(refContent) :
container->GetChildCount();
if (insPos < 0) {
// Someone seriously messed up the childlist. We have no idea
// where to insert the remaining children, so just bail.
return NS_ERROR_DOM_NOT_FOUND_ERR;
}
// If we've had any unexpeted mutations so far we need to recheck that
// the child can still be inserted.
if (mutated) {
for (i = 0; i < count; ++i) {
// Get the n:th child from the array.
nsIContent* childContent = fragChildren[i];
nsCOMPtr<nsIDOMNode> tmpNode = do_QueryInterface(childContent);
PRUint16 tmpType = 0;
@ -3824,18 +3812,64 @@ nsGenericElement::doReplaceOrInsertBefore(PRBool aReplace,
}
}
nsMutationGuard guard;
insPos = refContent ? container->IndexOf(refContent) :
container->GetChildCount();
if (insPos < 0) {
// Someone seriously messed up the childlist. We have no idea
// where to insert the remaining children, so just bail.
return NS_ERROR_DOM_NOT_FOUND_ERR;
}
}
PRBool appending = aParent && (insPos == container->GetChildCount());
PRBool firstInsPos = insPos;
// Iterate through the fragment's children, and insert them in the new
// parent
for (i = 0; i < count; ++i, ++insPos) {
nsIContent* childContent = fragChildren[i];
// XXXbz how come no reparenting here? That seems odd...
// Insert the child.
res = container->InsertChildAt(childContent, insPos, PR_TRUE);
NS_ENSURE_SUCCESS(res, res);
res = container->InsertChildAt(childContent, insPos, PR_FALSE);
if (NS_FAILED(res)) {
// Make sure to notify on any children that we did succeed to insert
if (appending && i != 0) {
nsNodeUtils::ContentAppended(aParent, firstInsPos);
}
return res;
}
// Check to see if any evil mutation events mucked around with the
// child list.
mutated = mutated || guard.Mutated(1);
++insPos;
if (!appending) {
nsNodeUtils::ContentInserted(container, childContent, insPos);
}
}
// Notify
if (appending) {
nsNodeUtils::ContentAppended(aParent, firstInsPos);
}
// Fire mutation events. Optimize for the case when there are no listeners
nsIDocument* doc = container->GetOwnerDoc();
nsPIDOMWindow* window = nsnull;
if (doc && (window = doc->GetInnerWindow()) &&
window->HasMutationListeners(NS_EVENT_BITS_MUTATION_NODEINSERTED)) {
for (i = 0; i < count; ++i, ++insPos) {
nsIContent* childContent = fragChildren[i];
if (nsContentUtils::HasMutationListeners(childContent,
NS_EVENT_BITS_MUTATION_NODEINSERTED, container)) {
mozAutoRemovableBlockerRemover blockerRemover;
nsMutationEvent mutation(PR_TRUE, NS_MUTATION_NODEINSERTED);
mutation.mRelatedNode = do_QueryInterface(container);
mozAutoSubtreeModified subtree(container->GetOwnerDoc(), container);
nsEventDispatcher::Dispatch(childContent, nsnull, &mutation);
}
}
}
}
else {

Просмотреть файл

@ -503,6 +503,7 @@ GK_ATOM(listing, "listing")
GK_ATOM(listitem, "listitem")
GK_ATOM(listrows, "listrows")
GK_ATOM(load, "load")
GK_ATOM(localedir, "localedir")
GK_ATOM(localName, "local-name")
GK_ATOM(longdesc, "longdesc")
#ifdef MOZ_MEDIA

Просмотреть файл

@ -45,656 +45,7 @@ relativesrcdir = content/canvas/test
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
_TEST_FILES_0 = \
test_fallback.basic.html \
test_fallback.multiple.html \
test_fallback.nested.html \
test_type.name.html \
test_type.exists.html \
test_type.delete.html \
test_type.prototype.html \
test_type.replace.html \
test_type.extend.html \
test_size.attributes.html \
test_size.attributes.type.get.html \
test_size.attributes.type.set.html \
test_size.attributes.default.html \
test_size.attributes.reflect.1.html \
test_size.attributes.reflect.2.html \
test_size.attributes.removed.html \
test_size.attributes.parse.whitespace.html \
test_size.attributes.parse.nonnumber.html \
test_size.attributes.parse.zero.html \
test_size.attributes.parse.negative.html \
test_size.attributes.parse.zerosuffix.html \
test_size.attributes.parse.floatsuffix.html \
test_size.attributes.parse.badsuffix.html \
test_size.attributes.parse.percentsuffix.html \
test_size.attributes.setAttribute.whitespace.html \
test_size.attributes.setAttribute.nonnumber.html \
test_size.attributes.setAttribute.zero.html \
test_size.attributes.setAttribute.negative.html \
test_size.attributes.setAttribute.zerosuffix.html \
test_size.attributes.setAttribute.floatsuffix.html \
test_size.attributes.setAttribute.badsuffix.html \
test_size.attributes.setAttribute.percentsuffix.html \
test_size.attributes.style.html \
test_initial.colour.html \
test_initial.reset.different.html \
test_initial.reset.same.html \
test_initial.reset.path.html \
test_initial.reset.clip.html \
test_initial.reset.transform.html \
test_initial.reset.gradient.html \
test_initial.reset.pattern.html \
test_context.emptystring.html \
test_context.unrecognised.badname.html \
test_context.unrecognised.badsuffix.html \
test_context.unrecognised.nullsuffix.html \
test_context.unrecognised.unicode.html \
test_context.casesensitive.html \
test_context.arguments.missing.html \
test_context.arguments.extra.html \
test_toDataURL.default.html \
test_toDataURL.png.html \
test_toDataURL.unrecognised.html \
test_toDataURL.lowercase.html \
test_toDataURL.arguments.1.html \
test_toDataURL.arguments.2.html \
test_toDataURL.arguments.3.html \
test_toDataURL.nocontext.html \
test_toDataURL.zerosize.html \
test_toDataURL.primarycolours.html \
test_toDataURL.complexcolours.html \
test_2d.getcontext.exists.html \
test_2d.type.exists.html \
test_2d.type.delete.html \
test_2d.type.prototype.html \
test_2d.type.replace.html \
test_2d.type.extend.html \
test_2d.getcontext.unique.html \
test_2d.getcontext.shared.html \
test_2d.voidreturn.html \
test_2d.missingargs.html \
test_2d.scaled.html \
test_2d.canvas.reference.html \
test_2d.canvas.readonly.html \
test_2d.state.saverestore.strokeStyle.html \
test_2d.state.saverestore.fillStyle.html \
test_2d.state.saverestore.globalAlpha.html \
test_2d.state.saverestore.lineWidth.html \
test_2d.state.saverestore.lineCap.html \
test_2d.state.saverestore.lineJoin.html \
test_2d.state.saverestore.miterLimit.html \
test_2d.state.saverestore.shadowOffsetX.html \
test_2d.state.saverestore.shadowOffsetY.html \
test_2d.state.saverestore.shadowBlur.html \
test_2d.state.saverestore.shadowColor.html \
test_2d.state.saverestore.globalCompositeOperation.html \
test_initial.reset.2dstate.html \
test_2d.state.saverestore.transformation.html \
test_2d.state.saverestore.clip.html \
test_2d.state.saverestore.path.html \
test_2d.state.saverestore.bitmap.html \
test_2d.state.saverestore.stack.html \
test_2d.state.saverestore.stackdepth.html \
test_2d.state.saverestore.underflow.html \
test_2d.transformation.order.html \
test_2d.transformation.scale.basic.html \
test_2d.transformation.scale.zero.html \
test_2d.transformation.scale.negative.html \
test_2d.transformation.scale.large.html \
test_2d.transformation.scale.nonfinite.html \
test_2d.transformation.scale.multiple.html \
$(NULL)
_TEST_FILES_1 = \
test_2d.transformation.rotate.zero.html \
test_2d.transformation.rotate.radians.html \
test_2d.transformation.rotate.direction.html \
test_2d.transformation.rotate.wrap.html \
test_2d.transformation.rotate.wrapnegative.html \
test_2d.transformation.rotate.nonfinite.html \
test_2d.transformation.translate.basic.html \
test_2d.transformation.translate.nonfinite.html \
test_2d.transformation.transform.identity.html \
test_2d.transformation.transform.skewed.html \
test_2d.transformation.transform.multiply.html \
test_2d.transformation.transform.nonfinite.html \
test_2d.transformation.setTransform.skewed.html \
test_2d.transformation.setTransform.multiple.html \
test_2d.transformation.setTransform.nonfinite.html \
test_2d.composite.globalAlpha.range.html \
test_2d.composite.globalAlpha.invalid.html \
test_2d.composite.globalAlpha.default.html \
test_2d.composite.globalAlpha.fill.html \
test_2d.composite.globalAlpha.image.html \
test_2d.composite.globalAlpha.canvas.html \
test_2d.composite.globalAlpha.imagepattern.html \
test_2d.composite.globalAlpha.canvaspattern.html \
test_2d.composite.solid.source-over.html \
test_2d.composite.solid.destination-over.html \
test_2d.composite.solid.source-in.html \
test_2d.composite.solid.destination-in.html \
test_2d.composite.solid.source-out.html \
test_2d.composite.solid.destination-out.html \
test_2d.composite.solid.source-atop.html \
test_2d.composite.solid.destination-atop.html \
test_2d.composite.solid.copy.html \
test_2d.composite.transparent.source-over.html \
test_2d.composite.transparent.destination-over.html \
test_2d.composite.transparent.source-in.html \
test_2d.composite.transparent.destination-in.html \
test_2d.composite.transparent.source-out.html \
test_2d.composite.transparent.destination-out.html \
test_2d.composite.transparent.source-atop.html \
test_2d.composite.transparent.destination-atop.html \
test_2d.composite.transparent.copy.html \
test_2d.composite.image.source-over.html \
test_2d.composite.image.destination-over.html \
test_2d.composite.image.destination-out.html \
test_2d.composite.image.source-atop.html \
test_2d.composite.image.copy.html \
test_2d.composite.canvas.source-over.html \
test_2d.composite.canvas.destination-over.html \
test_2d.composite.canvas.destination-out.html \
test_2d.composite.canvas.source-atop.html \
test_2d.composite.canvas.copy.html \
test_2d.composite.uncovered.fill.copy.html \
test_2d.composite.uncovered.image.copy.html \
test_2d.composite.uncovered.pattern.copy.html \
test_2d.composite.clip.source-over.html \
test_2d.composite.clip.destination-over.html \
test_2d.composite.clip.source-in.html \
test_2d.composite.clip.destination-in.html \
test_2d.composite.clip.source-out.html \
test_2d.composite.clip.destination-out.html \
test_2d.composite.clip.source-atop.html \
test_2d.composite.clip.destination-atop.html \
test_2d.composite.clip.copy.html \
test_2d.composite.operation.get.html \
test_2d.composite.operation.unrecognised.html \
test_2d.composite.operation.darker.html \
test_2d.composite.operation.over.html \
test_2d.composite.operation.clear.html \
test_2d.composite.operation.highlight.html \
test_2d.composite.operation.nullsuffix.html \
$(NULL)
_TEST_FILES_2 = \
test_2d.composite.operation.casesensitive.html \
test_2d.composite.operation.default.html \
test_2d.fillStyle.parse.html4.html \
test_2d.fillStyle.parse.hex3.html \
test_2d.fillStyle.parse.hex6.html \
test_2d.fillStyle.parse.rgb-num.html \
test_2d.fillStyle.parse.rgb-clamp-1.html \
test_2d.fillStyle.parse.rgb-clamp-2.html \
test_2d.fillStyle.parse.rgb-clamp-3.html \
test_2d.fillStyle.parse.rgb-clamp-4.html \
test_2d.fillStyle.parse.rgb-clamp-5.html \
test_2d.fillStyle.parse.rgb-percent.html \
test_2d.fillStyle.parse.rgba-solid-1.html \
test_2d.fillStyle.parse.rgba-solid-2.html \
test_2d.fillStyle.parse.rgba-num-1.html \
test_2d.fillStyle.parse.rgba-num-2.html \
test_2d.fillStyle.parse.rgba-percent.html \
test_2d.fillStyle.parse.rgba-clamp-1.html \
test_2d.fillStyle.parse.rgba-clamp-2.html \
test_2d.fillStyle.parse.transparent-1.html \
test_2d.fillStyle.parse.transparent-2.html \
test_2d.fillStyle.parse.hsl-1.html \
test_2d.fillStyle.parse.hsl-2.html \
test_2d.fillStyle.parse.hsl-3.html \
test_2d.fillStyle.parse.hsl-4.html \
test_2d.fillStyle.parse.hsl-5.html \
test_2d.fillStyle.parse.hsl-clamp-1.html \
test_2d.fillStyle.parse.hsl-clamp-2.html \
test_2d.fillStyle.parse.hsl-clamp-3.html \
test_2d.fillStyle.parse.hsl-clamp-4.html \
test_2d.fillStyle.parse.hsla-1.html \
test_2d.fillStyle.parse.hsla-2.html \
test_2d.fillStyle.parse.hsla-clamp-1.html \
test_2d.fillStyle.parse.hsla-clamp-2.html \
test_2d.fillStyle.parse.hsla-clamp-3.html \
test_2d.fillStyle.parse.hsla-clamp-4.html \
test_2d.fillStyle.parse.hsla-clamp-5.html \
test_2d.fillStyle.parse.hsla-clamp-6.html \
test_2d.fillStyle.parse.svg-1.html \
test_2d.fillStyle.parse.svg-2.html \
test_2d.fillStyle.parse.invalid.hex3.html \
test_2d.fillStyle.parse.invalid.hex6.html \
test_2d.fillStyle.parse.invalid.rgb-1.html \
test_2d.fillStyle.parse.invalid.rgb-2.html \
test_2d.fillStyle.parse.invalid.rgb-3.html \
test_2d.fillStyle.parse.invalid.rgb-4.html \
test_2d.fillStyle.parse.invalid.rgb-5.html \
test_2d.fillStyle.parse.invalid.rgb-6.html \
test_2d.fillStyle.parse.invalid.rgb-7.html \
test_2d.fillStyle.parse.invalid.rgba-1.html \
test_2d.fillStyle.parse.invalid.rgba-2.html \
test_2d.fillStyle.parse.invalid.rgba-3.html \
test_2d.fillStyle.parse.invalid.rgba-4.html \
test_2d.fillStyle.parse.invalid.rgba-5.html \
test_2d.fillStyle.parse.invalid.hsl-1.html \
test_2d.fillStyle.parse.invalid.hsl-2.html \
test_2d.fillStyle.parse.invalid.hsl-3.html \
test_2d.fillStyle.parse.invalid.hsl-4.html \
test_2d.fillStyle.parse.invalid.hsl-5.html \
test_2d.fillStyle.parse.invalid.hsla-1.html \
test_2d.fillStyle.parse.invalid.hsla-2.html \
test_2d.fillStyle.parse.system.html \
test_2d.fillStyle.parse.current.basic.html \
test_2d.fillStyle.parse.current.changed.html \
test_2d.fillStyle.parse.current.removed.html \
test_2d.fillStyle.invalidstring.html \
test_2d.fillStyle.invalidtype.html \
test_2d.fillStyle.get.solid.html \
test_2d.fillStyle.get.semitransparent.html \
test_2d.fillStyle.get.transparent.html \
test_2d.fillStyle.default.html \
test_2d.strokeStyle.default.html \
test_2d.gradient.object.type.html \
test_2d.gradient.object.return.html \
test_2d.gradient.interpolate.solid.html \
test_2d.gradient.interpolate.colour.html \
test_2d.gradient.interpolate.alpha.html \
test_2d.gradient.interpolate.colouralpha.html \
test_2d.gradient.interpolate.outside.html \
test_2d.gradient.interpolate.zerosize.html \
test_2d.gradient.interpolate.vertical.html \
test_2d.gradient.interpolate.multiple.html \
test_2d.gradient.interpolate.overlap.html \
test_2d.gradient.interpolate.overlap2.html \
test_2d.gradient.empty.html \
test_2d.gradient.object.update.html \
test_2d.gradient.object.compare.html \
test_2d.gradient.object.crosscanvas.html \
test_2d.gradient.object.invalidoffset.html \
test_2d.gradient.object.invalidcolour.html \
test_2d.gradient.linear.nonfinite.html \
test_2d.gradient.linear.transform.1.html \
test_2d.gradient.linear.transform.2.html \
test_2d.gradient.linear.transform.3.html \
test_2d.gradient.radial.negative.html \
test_2d.gradient.radial.nonfinite.html \
test_2d.gradient.radial.inside1.html \
$(NULL)
_TEST_FILES_3 = \
test_2d.gradient.radial.cone.bottom.html \
test_2d.gradient.radial.cone.cylinder.html \
test_2d.gradient.radial.cone.shape1.html \
test_2d.gradient.radial.transform.1.html \
test_2d.gradient.radial.transform.2.html \
test_2d.gradient.radial.transform.3.html \
test_2d.pattern.basic.type.html \
test_2d.pattern.basic.image.html \
test_2d.pattern.basic.canvas.html \
test_2d.pattern.basic.zerocanvas.html \
test_2d.pattern.basic.nocontext.html \
test_2d.pattern.image.undefined.html \
test_2d.pattern.image.null.html \
test_2d.pattern.image.string.html \
test_2d.pattern.image.incomplete.html \
test_2d.pattern.image.broken.html \
test_2d.pattern.repeat.empty.html \
test_2d.pattern.repeat.null.html \
test_2d.pattern.repeat.undefined.html \
test_2d.pattern.repeat.unrecognised.html \
test_2d.pattern.repeat.case.html \
test_2d.pattern.repeat.nullsuffix.html \
test_2d.pattern.modify.image1.html \
test_2d.pattern.modify.image2.html \
test_2d.pattern.modify.canvas1.html \
test_2d.pattern.modify.canvas2.html \
test_2d.pattern.crosscanvas.html \
test_2d.pattern.paint.norepeat.basic.html \
test_2d.pattern.paint.norepeat.outside.html \
test_2d.pattern.paint.norepeat.coord1.html \
test_2d.pattern.paint.norepeat.coord2.html \
test_2d.pattern.paint.norepeat.coord3.html \
test_2d.pattern.paint.repeat.basic.html \
test_2d.pattern.paint.repeat.outside.html \
test_2d.pattern.paint.repeat.coord1.html \
test_2d.pattern.paint.repeat.coord2.html \
test_2d.pattern.paint.repeat.coord3.html \
test_2d.pattern.paint.repeatx.basic.html \
test_2d.pattern.paint.repeatx.outside.html \
test_2d.pattern.paint.repeatx.coord1.html \
test_2d.pattern.paint.repeaty.basic.html \
test_2d.pattern.paint.repeaty.outside.html \
test_2d.pattern.paint.repeaty.coord1.html \
test_2d.pattern.paint.orientation.image.html \
test_2d.pattern.paint.orientation.canvas.html \
test_2d.pattern.animated.gif.html \
test_2d.line.defaults.html \
test_2d.line.width.basic.html \
test_2d.line.width.transformed.html \
test_2d.line.width.invalid.html \
test_2d.line.cap.butt.html \
test_2d.line.cap.round.html \
test_2d.line.cap.square.html \
test_2d.line.cap.open.html \
test_2d.line.cap.invalid.html \
test_2d.line.join.bevel.html \
test_2d.line.join.round.html \
test_2d.line.join.miter.html \
test_2d.line.join.open.html \
test_2d.line.join.closed.html \
test_2d.line.join.invalid.html \
test_2d.line.miter.exceeded.html \
test_2d.line.miter.acute.html \
test_2d.line.miter.obtuse.html \
test_2d.line.miter.rightangle.html \
test_2d.line.miter.lineedge.html \
test_2d.line.miter.within.html \
test_2d.line.miter.invalid.html \
test_2d.line.cross.html \
test_2d.line.union.html \
test_2d.clearRect.basic.html \
test_2d.clearRect.path.html \
test_2d.clearRect.zero.html \
test_2d.clearRect.negative.html \
test_2d.clearRect.transform.html \
test_2d.clearRect.globalalpha.html \
test_2d.clearRect.globalcomposite.html \
test_2d.clearRect.clip.html \
test_2d.clearRect.shadow.html \
test_2d.clearRect.nonfinite.html \
test_2d.fillRect.basic.html \
test_2d.fillRect.path.html \
test_2d.fillRect.zero.html \
test_2d.fillRect.negative.html \
test_2d.fillRect.transform.html \
test_2d.fillRect.clip.html \
test_2d.fillRect.shadow.html \
$(NULL)
_TEST_FILES_4 = \
test_2d.fillRect.nonfinite.html \
test_2d.strokeRect.basic.html \
test_2d.strokeRect.path.html \
test_2d.strokeRect.zero.1.html \
test_2d.strokeRect.zero.2.html \
test_2d.strokeRect.zero.3.html \
test_2d.strokeRect.zero.4.html \
test_2d.strokeRect.negative.html \
test_2d.strokeRect.transform.html \
test_2d.strokeRect.globalalpha.html \
test_2d.strokeRect.globalcomposite.html \
test_2d.strokeRect.clip.html \
test_2d.strokeRect.shadow.html \
test_2d.strokeRect.nonfinite.html \
test_2d.path.initial.html \
test_2d.path.beginPath.html \
test_2d.path.moveTo.basic.html \
test_2d.path.moveTo.newsubpath.html \
test_2d.path.moveTo.multiple.html \
test_2d.path.moveTo.nonfinite.html \
test_2d.path.closePath.empty.html \
test_2d.path.closePath.newline.html \
test_2d.path.closePath.nextpoint.html \
test_2d.path.lineTo.emptysubpath.html \
test_2d.path.lineTo.basic.html \
test_2d.path.lineTo.nextpoint.html \
test_2d.path.lineTo.nonfinite.html \
test_2d.path.quadraticCurveTo.emptysubpath.html \
test_2d.path.quadraticCurveTo.basic.html \
test_2d.path.quadraticCurveTo.shape.html \
test_2d.path.quadraticCurveTo.scaled.html \
test_2d.path.quadraticCurveTo.nonfinite.html \
test_2d.path.bezierCurveTo.emptysubpath.html \
test_2d.path.bezierCurveTo.basic.html \
test_2d.path.bezierCurveTo.shape.html \
test_2d.path.bezierCurveTo.scaled.html \
test_2d.path.bezierCurveTo.nonfinite.html \
test_2d.path.arcTo.emptysubpath.html \
test_2d.path.arcTo.coincide.1.html \
test_2d.path.arcTo.coincide.2.html \
test_2d.path.arcTo.collinear.1.html \
test_2d.path.arcTo.collinear.2.html \
test_2d.path.arcTo.collinear.3.html \
test_2d.path.arcTo.shape.curve1.html \
test_2d.path.arcTo.shape.curve2.html \
test_2d.path.arcTo.shape.start.html \
test_2d.path.arcTo.shape.end.html \
test_2d.path.arcTo.negative.html \
test_2d.path.arcTo.zero.1.html \
test_2d.path.arcTo.zero.2.html \
test_2d.path.arcTo.transformation.html \
test_2d.path.arcTo.scale.html \
test_2d.path.arcTo.nonfinite.html \
test_2d.path.arc.empty.html \
test_2d.path.arc.nonempty.html \
test_2d.path.arc.end.html \
test_2d.path.arc.angle.1.html \
test_2d.path.arc.angle.2.html \
test_2d.path.arc.angle.3.html \
test_2d.path.arc.angle.4.html \
test_2d.path.arc.angle.5.html \
test_2d.path.arc.angle.6.html \
test_2d.path.arc.zero.1.html \
test_2d.path.arc.zero.2.html \
test_2d.path.arc.twopie.1.html \
test_2d.path.arc.twopie.2.html \
test_2d.path.arc.twopie.3.html \
test_2d.path.arc.twopie.4.html \
test_2d.path.arc.shape.1.html \
test_2d.path.arc.shape.2.html \
test_2d.path.arc.shape.4.html \
test_2d.path.arc.shape.5.html \
test_2d.path.arc.selfintersect.1.html \
test_2d.path.arc.selfintersect.2.html \
test_2d.path.arc.negative.html \
test_2d.path.arc.zeroradius.html \
test_2d.path.arc.scale.1.html \
test_2d.path.arc.scale.2.html \
test_2d.path.arc.nonfinite.html \
test_2d.path.rect.basic.html \
test_2d.path.rect.newsubpath.html \
test_2d.path.rect.closed.html \
test_2d.path.rect.end.1.html \
test_2d.path.rect.end.2.html \
test_2d.path.rect.zero.1.html \
test_2d.path.rect.zero.2.html \
test_2d.path.rect.zero.3.html \
test_2d.path.rect.zero.4.html \
test_2d.path.rect.zero.5.html \
test_2d.path.rect.negative.html \
test_2d.path.rect.winding.html \
test_2d.path.rect.nonfinite.html \
test_2d.path.fill.overlap.html \
test_2d.path.fill.winding.add.html \
test_2d.path.fill.winding.subtract.1.html \
test_2d.path.fill.winding.subtract.2.html \
$(NULL)
_TEST_FILES_5 = \
test_2d.path.fill.winding.subtract.3.html \
test_2d.path.fill.closed.basic.html \
test_2d.path.fill.closed.unaffected.html \
test_2d.path.stroke.overlap.html \
test_2d.path.stroke.union.html \
test_2d.path.stroke.unaffected.html \
test_2d.path.stroke.scale1.html \
test_2d.path.stroke.scale2.html \
test_2d.path.stroke.skew.html \
test_2d.path.stroke.empty.html \
test_2d.path.stroke.prune.line.html \
test_2d.path.stroke.prune.closed.html \
test_2d.path.stroke.prune.curve.html \
test_2d.path.stroke.prune.arc.html \
test_2d.path.stroke.prune.rect.html \
test_2d.path.stroke.prune.corner.html \
test_2d.path.transformation.basic.html \
test_2d.path.transformation.multiple.html \
test_2d.path.transformation.changing.html \
test_2d.path.clip.empty.html \
test_2d.path.clip.basic.1.html \
test_2d.path.clip.basic.2.html \
test_2d.path.clip.intersect.html \
test_2d.path.clip.winding.1.html \
test_2d.path.clip.winding.2.html \
test_2d.path.clip.unaffected.html \
test_2d.path.isPointInPath.basic.1.html \
test_2d.path.isPointInPath.basic.2.html \
test_2d.path.isPointInPath.edge.html \
test_2d.path.isPointInPath.empty.html \
test_2d.path.isPointInPath.subpath.html \
test_2d.path.isPointInPath.outside.html \
test_2d.path.isPointInPath.unclosed.html \
test_2d.path.isPointInPath.arc.html \
test_2d.path.isPointInPath.bigarc.html \
test_2d.path.isPointInPath.bezier.html \
test_2d.path.isPointInPath.winding.html \
test_2d.path.isPointInPath.transform.1.html \
test_2d.path.isPointInPath.transform.2.html \
test_2d.path.isPointInPath.transform.3.html \
test_2d.path.isPointInPath.nonfinite.html \
test_2d.drawImage.3arg.html \
test_2d.drawImage.5arg.html \
test_2d.drawImage.9arg.basic.html \
test_2d.drawImage.9arg.sourcepos.html \
test_2d.drawImage.9arg.sourcesize.html \
test_2d.drawImage.9arg.destpos.html \
test_2d.drawImage.9arg.destsize.html \
test_2d.drawImage.canvas.html \
test_2d.drawImage.self.1.html \
test_2d.drawImage.self.2.html \
test_2d.drawImage.null.html \
test_2d.drawImage.wrongtype.html \
test_2d.drawImage.floatsource.html \
test_2d.drawImage.zerosource.html \
test_2d.drawImage.negativesource.html \
test_2d.drawImage.negativedest.html \
test_2d.drawImage.outsidesource.html \
test_2d.drawImage.incomplete.html \
test_2d.drawImage.broken.html \
test_2d.drawImage.animated.gif.html \
test_2d.drawImage.animated.apng.html \
test_2d.drawImage.animated.poster.html \
test_2d.drawImage.path.html \
test_2d.drawImage.transform.html \
test_2d.drawImage.alpha.html \
test_2d.drawImage.clip.html \
test_2d.drawImage.composite.html \
test_2d.drawImage.nowrap.html \
test_2d.drawImage.nonfinite.html \
test_2d.imageData.create.basic.html \
test_2d.imageData.create.type.html \
test_2d.imageData.create.initial.html \
test_2d.imageData.create.large.html \
test_2d.imageData.create.tiny.html \
test_2d.imageData.create.negative.html \
test_2d.imageData.create.zero.html \
test_2d.imageData.create.nonfinite.html \
test_2d.imageData.create.round.html \
test_2d.imageData.get.basic.html \
test_2d.imageData.get.type.html \
test_2d.imageData.get.zero.html \
test_2d.imageData.get.nonfinite.html \
test_2d.imageData.get.source.outside.html \
test_2d.imageData.get.source.negative.html \
test_2d.imageData.get.source.size.html \
test_2d.imageData.get.tiny.html \
test_2d.imageData.get.nonpremul.html \
test_2d.imageData.get.range.html \
test_2d.imageData.get.clamp.html \
test_2d.imageData.get.order.cols.html \
test_2d.imageData.get.order.rows.html \
test_2d.imageData.get.order.rgb.html \
test_2d.imageData.get.order.alpha.html \
test_2d.imageData.get.unaffected.html \
test_2d.imageData.object.properties.html \
test_2d.imageData.object.readonly.html \
test_2d.imageData.object.ctor.html \
test_2d.imageData.object.set.html \
test_2d.imageData.object.undefined.html \
$(NULL)
_TEST_FILES_6 = \
test_2d.imageData.object.nan.html \
test_2d.imageData.object.string.html \
test_2d.imageData.object.clamp.html \
test_2d.imageData.object.round.html \
test_2d.imageData.put.null.html \
test_2d.imageData.put.nonfinite.html \
test_2d.imageData.put.basic.html \
test_2d.imageData.put.created.html \
test_2d.imageData.put.wrongtype.html \
test_2d.imageData.put.cross.html \
test_2d.imageData.put.alpha.html \
test_2d.imageData.put.modified.html \
test_2d.imageData.put.dirty.zero.html \
test_2d.imageData.put.dirty.rect1.html \
test_2d.imageData.put.dirty.rect2.html \
test_2d.imageData.put.dirty.negative.html \
test_2d.imageData.put.dirty.outside.html \
test_2d.imageData.put.unchanged.html \
test_2d.imageData.put.unaffected.html \
test_2d.imageData.put.clip.html \
test_2d.imageData.put.path.html \
test_2d.shadow.attributes.shadowBlur.1.html \
test_2d.shadow.attributes.shadowBlur.2.html \
test_2d.shadow.attributes.shadowOffset.1.html \
test_2d.shadow.attributes.shadowOffset.2.html \
test_2d.shadow.attributes.shadowColor.1.html \
test_2d.shadow.attributes.shadowColor.2.html \
test_2d.shadow.basic.1.html \
test_2d.shadow.basic.2.html \
test_2d.shadow.offset.positiveX.html \
test_2d.shadow.offset.negativeX.html \
test_2d.shadow.offset.positiveY.html \
test_2d.shadow.offset.negativeY.html \
test_2d.shadow.outside.html \
test_2d.shadow.clip.1.html \
test_2d.shadow.clip.2.html \
test_2d.shadow.clip.3.html \
test_2d.shadow.stroke.basic.html \
test_2d.shadow.stroke.cap.1.html \
test_2d.shadow.stroke.cap.2.html \
test_2d.shadow.stroke.join.1.html \
test_2d.shadow.stroke.join.2.html \
test_2d.shadow.stroke.join.3.html \
test_2d.shadow.image.basic.html \
test_2d.shadow.image.transparent.1.html \
test_2d.shadow.image.transparent.2.html \
test_2d.shadow.image.alpha.html \
test_2d.shadow.image.section.html \
test_2d.shadow.image.scale.html \
test_2d.shadow.canvas.basic.html \
test_2d.shadow.canvas.transparent.1.html \
test_2d.shadow.canvas.transparent.2.html \
test_2d.shadow.canvas.alpha.html \
test_2d.shadow.pattern.basic.html \
test_2d.shadow.pattern.transparent.1.html \
test_2d.shadow.pattern.transparent.2.html \
test_2d.shadow.pattern.alpha.html \
test_2d.shadow.gradient.basic.html \
test_2d.shadow.gradient.transparent.1.html \
test_2d.shadow.gradient.transparent.2.html \
test_2d.shadow.gradient.alpha.html \
test_2d.shadow.transform.1.html \
test_2d.shadow.transform.2.html \
test_2d.shadow.blur.low.html \
test_2d.shadow.blur.high.html \
test_2d.shadow.alpha.1.html \
test_2d.shadow.alpha.2.html \
test_2d.shadow.alpha.3.html \
test_2d.shadow.alpha.4.html \
test_2d.shadow.alpha.5.html \
test_2d.shadow.composite.1.html \
test_2d.shadow.composite.2.html \
test_2d.shadow.composite.3.html \
test_2d.shadow.composite.4.html \
test_2d.imageSmoothing.html \
test_bug397524.html \
test_bug405982.html \
test_text.font.html \
test_text.textAlign.html \
test_text.textBaseline.html \
test_text.measure.html \
test_text.space.replace.html \
test_canvas.html \
image_transparent50.png \
image_redtransparent.png \
image_yellow.png \
@ -714,7 +65,6 @@ _TEST_FILES_6 = \
image_green.png \
image_green-redirect \
image_green-redirect^headers^ \
test_2d.imagedata_coercion.html \
$(NULL)
# xor and lighter aren't well handled by cairo; they mostly work, but we don't want
@ -746,14 +96,14 @@ _TEST_FILES_6 = \
# Tests that fail on Mac (possibly because spec is underdefined?). Bug 407105
ifneq ($(MOZ_WIDGET_TOOLKIT),cocoa)
# XXX vlad don't test these anywhere, cairo behaviour changed
_TEST_FILES_3 += \
_TEST_FILES_0 += \
test_2d.line.join.parallel.html \
test_2d.strokeRect.zero.5.html \
$(NULL)
# This is an issue with Quartz's handling of radial gradients and some numeric
# imprecision that results in errors here.
_TEST_FILES_2 += \
_TEST_FILES_0 += \
test_2d.gradient.radial.inside2.html \
test_2d.gradient.radial.inside3.html \
test_2d.gradient.radial.outside1.html \
@ -761,7 +111,7 @@ _TEST_FILES_2 += \
test_2d.gradient.radial.cone.top.html \
$(NULL)
_TEST_FILES_3 += \
_TEST_FILES_0 += \
test_2d.composite.uncovered.image.source-in.html \
test_2d.composite.uncovered.image.destination-in.html \
test_2d.composite.uncovered.image.source-out.html \
@ -772,7 +122,7 @@ _TEST_FILES_3 += \
# destination bounds seem to have problems with the BEVEL/SQUARE join/cap combo.
# The joins are rendered as if with MITER; the correct behaviour is also seen
# if BUTT is used instead of SQUARE.
_TEST_FILES_4 += test_2d.line.cap.closed.html
_TEST_FILES_0 += test_2d.line.cap.closed.html
endif
@ -780,7 +130,7 @@ endif
ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
# still need bug numbers
_TEST_FILES_1 += \
_TEST_FILES_0 += \
test_2d.composite.uncovered.fill.source-in.html \
test_2d.composite.uncovered.fill.destination-in.html \
test_2d.composite.uncovered.fill.source-out.html \
@ -792,7 +142,7 @@ _TEST_FILES_1 += \
$(NULL)
# still need bug numbers
_TEST_FILES_3 += \
_TEST_FILES_0 += \
test_2d.gradient.radial.outside2.html \
test_2d.gradient.radial.outside3.html \
test_2d.gradient.radial.cone.shape2.html \
@ -801,9 +151,9 @@ _TEST_FILES_3 += \
$(NULL)
# still need bug numbers
_TEST_FILES_4 += test_2d.path.arc.shape.3.html
_TEST_FILES_0 += test_2d.path.arc.shape.3.html
_TEST_FILES_5 += test_2d.path.rect.selfintersect.html
_TEST_FILES_0 += test_2d.path.rect.selfintersect.html
endif
# These tests only pass on Mac OS X >= 10.5; see bug 450114
@ -818,22 +168,3 @@ endif
# split up into groups to work around command-line length limits
libs:: $(_TEST_FILES_0)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
libs:: $(_TEST_FILES_1)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
libs:: $(_TEST_FILES_2)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
libs:: $(_TEST_FILES_3)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
libs:: $(_TEST_FILES_4)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
libs:: $(_TEST_FILES_5)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
libs:: $(_TEST_FILES_6)
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1119,6 +1119,15 @@ nsXULElement::AfterSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
SetTitlebarColor(color, aName == nsGkAtoms::activetitlebarcolor);
}
// if the localedir changed on the root element, reset the document direction
if (aName == nsGkAtoms::localedir &&
document && document->GetRootContent() == this) {
nsCOMPtr<nsIXULDocument> xuldoc = do_QueryInterface(document);
if (xuldoc) {
xuldoc->ResetDocumentDirection();
}
}
if (aName == nsGkAtoms::src && document) {
LoadSrc();
}
@ -1365,6 +1374,15 @@ nsXULElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aName, PRBool aNotify)
SetTitlebarColor(NS_RGBA(0, 0, 0, 0), aName == nsGkAtoms::activetitlebarcolor);
}
// if the localedir changed on the root element, reset the document direction
if (aName == nsGkAtoms::localedir &&
doc && doc->GetRootContent() == this) {
nsCOMPtr<nsIXULDocument> xuldoc = do_QueryInterface(doc);
if (xuldoc) {
xuldoc->ResetDocumentDirection();
}
}
// If the accesskey attribute is removed, unregister it here
// Also see nsXULLabelFrame, nsBoxFrame and nsTextBoxFrame's AttributeChanged
if (aName == nsGkAtoms::accesskey || aName == nsGkAtoms::control) {
@ -1793,8 +1811,7 @@ nsXULElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
retval = NS_STYLE_HINT_FRAMECHANGE;
} else {
// if left or top changes we reflow. This will happen in xul
// containers that manage positioned children such as a
// bulletinboard.
// containers that manage positioned children such as a stack.
if (nsGkAtoms::left == aAttribute || nsGkAtoms::top == aAttribute)
retval = NS_STYLE_HINT_REFLOW;
}

Просмотреть файл

@ -122,6 +122,11 @@ public:
* Callback notifying when a document could not be parsed properly.
*/
virtual PRBool OnDocumentParserError() = 0;
/**
* Reset the document direction so that it is recomputed.
*/
virtual void ResetDocumentDirection() = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIXULDocument, NS_IXULDOCUMENT_IID)

Просмотреть файл

@ -95,7 +95,10 @@ include $(topsrcdir)/config/rules.mk
LOCAL_INCLUDES = -I$(srcdir)/../../../base/src \
-I$(srcdir)/../../content/src \
-I$(srcdir)/../../templates/src \
-I$(srcdir)/../../../../layout/base \
-I$(srcdir)/../../../../layout/generic \
-I$(srcdir)/../../../../layout/style \
-I$(srcdir)/../../../../layout/xul/base/src \
-I$(srcdir)/../../../xml/document/src \
-I$(srcdir)/../../../events/src \
$(NULL)

Просмотреть файл

@ -126,6 +126,7 @@
#include "nsXULPopupManager.h"
#include "nsCCUncollectableMarker.h"
#include "nsURILoader.h"
#include "nsCSSFrameConstructor.h"
//----------------------------------------------------------------------
//
@ -222,6 +223,7 @@ nsRefMapEntry::RemoveContent(nsIContent* aContent)
nsXULDocument::nsXULDocument(void)
: nsXMLDocument("application/vnd.mozilla.xul+xml"),
mDocDirection(Direction_Uninitialized),
mState(eState_Master),
mResolutionPhase(nsForwardReference::eStart)
{
@ -260,6 +262,10 @@ nsXULDocument::~nsXULDocument()
delete mTemplateBuilderTable;
nsContentUtils::UnregisterPrefCallback("intl.uidirection.",
nsXULDocument::DirectionChanged,
this);
if (--gRefCnt == 0) {
NS_IF_RELEASE(gRDFService);
@ -1989,6 +1995,10 @@ nsXULDocument::Init()
}
}
nsContentUtils::RegisterPrefCallback("intl.uidirection.",
nsXULDocument::DirectionChanged,
this);
#ifdef PR_LOGGING
if (! gXULLog)
gXULLog = PR_NewLogModule("nsXULDocument");
@ -4627,6 +4637,100 @@ nsXULDocument::GetFocusController(nsIFocusController** aFocusController)
*aFocusController = nsnull;
}
PRBool
nsXULDocument::IsDocumentRightToLeft()
{
if (mDocDirection == Direction_Uninitialized) {
mDocDirection = Direction_LeftToRight; // default to ltr on failure
// setting the localedir attribute on the root element forces a
// specific direction for the document.
nsIContent* content = GetRootContent();
if (content) {
static nsIContent::AttrValuesArray strings[] =
{&nsGkAtoms::ltr, &nsGkAtoms::rtl, nsnull};
switch (content->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::localedir,
strings, eCaseMatters)) {
case 0: mDocDirection = Direction_LeftToRight; return PR_FALSE;
case 1: mDocDirection = Direction_RightToLeft; return PR_TRUE;
default: break;// otherwise, not a valid value, so fall through
}
}
// otherwise, get the locale from the chrome registry and
// look up the intl.uidirection.<locale> preference
nsCOMPtr<nsIXULChromeRegistry> reg =
do_GetService(NS_CHROMEREGISTRY_CONTRACTID);
if (reg) {
nsCAutoString package;
PRBool isChrome;
if (NS_SUCCEEDED(mDocumentURI->SchemeIs("chrome", &isChrome)) &&
isChrome) {
mDocumentURI->GetHostPort(package);
}
else {
// use the 'global' package for about and resource uris.
// otherwise, just default to left-to-right.
PRBool isAbout, isResource;
if (NS_SUCCEEDED(mDocumentURI->SchemeIs("about", &isAbout)) &&
isAbout) {
package.AssignLiteral("global");
}
else if (NS_SUCCEEDED(mDocumentURI->SchemeIs("resource", &isResource)) &&
isResource) {
package.AssignLiteral("global");
}
else {
return PR_FALSE;
}
}
nsCAutoString locale;
reg->GetSelectedLocale(package, locale);
if (locale.Length() >= 2) {
// first check the intl.uidirection.<locale> preference,
// and if that is not set, check the same preference but
// with just the first two characters of the locale. If
// that isn't set, default to left-to-right.
nsCAutoString prefString =
NS_LITERAL_CSTRING("intl.uidirection.") + locale;
nsAdoptingCString dir = nsContentUtils::GetCharPref(prefString.get());
if (dir.IsEmpty()) {
PRInt32 hyphen = prefString.FindChar('-');
if (hyphen >= 1) {
nsCAutoString shortPref(Substring(prefString, 0, hyphen));
dir = nsContentUtils::GetCharPref(shortPref.get());
}
}
mDocDirection = dir.EqualsLiteral("rtl") ?
Direction_RightToLeft : Direction_LeftToRight;
}
}
}
return (mDocDirection == Direction_RightToLeft);
}
int
nsXULDocument::DirectionChanged(const char* aPrefName, void* aData)
{
// reset the direction and reflow the document. This will happen if
// the direction isn't actually being used, but that doesn't really
// matter too much
nsXULDocument* doc = (nsXULDocument *)aData;
if (doc)
doc->ResetDocumentDirection();
nsIPresShell *shell = doc->GetPrimaryShell();
if (shell) {
shell->FrameConstructor()->
PostRestyleEvent(doc->GetRootContent(), eReStyle_Self, NS_STYLE_HINT_NONE);
}
return 0;
}
NS_IMETHODIMP
nsXULDocument::GetBoxObjectFor(nsIDOMElement* aElement, nsIBoxObject** aResult)
{

Просмотреть файл

@ -182,6 +182,10 @@ public:
virtual void EndUpdate(nsUpdateType aUpdateType);
virtual PRBool IsDocumentRightToLeft();
virtual void ResetDocumentDirection() { mDocDirection = Direction_Uninitialized; }
static PRBool
MatchAttribute(nsIContent* aContent,
PRInt32 aNameSpaceID,
@ -244,7 +248,8 @@ protected:
return kNameSpaceID_XUL;
}
protected:
static NS_HIDDEN_(int) DirectionChanged(const char* aPrefName, void* aData);
// pseudo constants
static PRInt32 gRefCnt;
@ -326,6 +331,17 @@ protected:
nsCOMPtr<nsIDOMNode> mTooltipNode; // [OWNER] element triggering the tooltip
/**
* document direction for use with the -moz-locale-dir property
*/
enum DocumentDirection {
Direction_Uninitialized, // not determined yet
Direction_LeftToRight,
Direction_RightToLeft
};
DocumentDirection mDocDirection;
/**
* Context stack, which maintains the state of the Builder and allows
* it to be interrupted.

Просмотреть файл

@ -3347,6 +3347,72 @@ nsGlobalWindow::GetScreenX(PRInt32* aScreenX)
return NS_OK;
}
nsRect
nsGlobalWindow::GetInnerScreenRect()
{
if (!mDocShell)
return nsRect();
nsGlobalWindow* rootWindow =
static_cast<nsGlobalWindow*>(GetPrivateRoot());
if (rootWindow) {
rootWindow->FlushPendingNotifications(Flush_Layout);
}
nsCOMPtr<nsIPresShell> presShell;
mDocShell->GetPresShell(getter_AddRefs(presShell));
if (!presShell)
return nsRect();
nsIFrame* rootFrame = presShell->GetRootFrame();
if (!rootFrame)
return nsRect();
return rootFrame->GetScreenRectInAppUnits();
}
NS_IMETHODIMP
nsGlobalWindow::GetMozInnerScreenX(float* aScreenX)
{
FORWARD_TO_OUTER(GetMozInnerScreenX, (aScreenX), NS_ERROR_NOT_INITIALIZED);
nsRect r = GetInnerScreenRect();
*aScreenX = nsPresContext::AppUnitsToFloatCSSPixels(r.x);
return NS_OK;
}
NS_IMETHODIMP
nsGlobalWindow::GetMozInnerScreenY(float* aScreenY)
{
FORWARD_TO_OUTER(GetMozInnerScreenY, (aScreenY), NS_ERROR_NOT_INITIALIZED);
nsRect r = GetInnerScreenRect();
*aScreenY = nsPresContext::AppUnitsToFloatCSSPixels(r.y);
return NS_OK;
}
NS_IMETHODIMP
nsGlobalWindow::GetMozScreenPixelsPerCSSPixel(float* aScreenPixels)
{
FORWARD_TO_OUTER(GetMozScreenPixelsPerCSSPixel,
(aScreenPixels), NS_ERROR_NOT_INITIALIZED);
*aScreenPixels = 1;
if (!nsContentUtils::IsCallerTrustedForRead())
return NS_ERROR_DOM_SECURITY_ERR;
if (!mDocShell)
return NS_OK;
nsCOMPtr<nsPresContext> presContext;
mDocShell->GetPresContext(getter_AddRefs(presContext));
if (!presContext)
return NS_OK;
*aScreenPixels = float(nsPresContext::AppUnitsPerCSSPixel())/
presContext->AppUnitsPerDevPixel();
return NS_OK;
}
NS_IMETHODIMP
nsGlobalWindow::SetScreenX(PRInt32 aScreenX)
{

Просмотреть файл

@ -90,6 +90,7 @@
#include "nsIXPCScriptable.h"
#include "nsPoint.h"
#include "nsSize.h"
#include "nsRect.h"
#include "mozFlushType.h"
#include "prclist.h"
#include "nsIDOMStorageObsolete.h"
@ -594,6 +595,7 @@ protected:
nsresult GetOuterSize(nsIntSize* aSizeCSSPixels);
nsresult SetOuterSize(PRInt32 aLengthCSSPixels, PRBool aIsWidth);
nsRect GetInnerScreenRect();
PRBool IsFrame()
{

Просмотреть файл

@ -44,7 +44,7 @@ interface nsIControllers;
interface nsIDOMLocation;
interface nsIVariant;
[scriptable, uuid(3414EBC7-731F-4697-9F43-ACA6F5050875)]
[scriptable, uuid(62579239-b619-4bf2-8d39-0b73e8663a85)]
interface nsIDOMWindowInternal : nsIDOMWindow2
{
readonly attribute nsIDOMWindowInternal window;
@ -104,6 +104,9 @@ interface nsIDOMWindowInternal : nsIDOMWindow2
attribute long outerHeight;
attribute long screenX;
attribute long screenY;
readonly attribute float mozInnerScreenX;
readonly attribute float mozInnerScreenY;
readonly attribute float mozScreenPixelsPerCSSPixel;
/* The offset in pixels by which the window is scrolled */
readonly attribute long pageXOffset;

Просмотреть файл

@ -39,7 +39,7 @@
#include "nsIDOMCSS2Properties.idl"
[scriptable, uuid(e7245a21-3f46-4e67-82bf-a9b326fe74ee)]
[scriptable, uuid(643f64d3-6b95-4d9a-ac75-c01a6f4c88cb)]
interface nsIDOMNSCSS2Properties : nsIDOMCSS2Properties
{
/* Non-DOM 2 extensions */
@ -256,5 +256,8 @@ interface nsIDOMNSCSS2Properties : nsIDOMCSS2Properties
attribute DOMString MozWindowShadow;
// raises(DOMException) on setting
attribute DOMString MozBackgroundSize;
// raises(DOMException) on setting
};

Просмотреть файл

@ -43,9 +43,106 @@ EnableCapabilityQuery = A script from "%S" is requesting enhanced abilities that
EnableCapabilityDenied = A script from "%S" was denied %S privileges.
CheckLoadURIError = Security Error: Content at %S may not load or link to %S.
CheckSameOriginError = Security Error: Content at %S may not load data from %S.
GetPropertyDeniedOrigins = Permission denied for <%S> to get property %S.%S from <%S>.
SetPropertyDeniedOrigins = Permission denied for <%S> to set property %S.%S on <%S>.
CallMethodDeniedOrigins = Permission denied for <%S> to call method %S.%S on <%S>.
# LOCALIZATION NOTE (GetPropertyDeniedOrigins):
# %1$S is the origin of the script which was denied access.
# %2$S is the origin of the object access was denied to.
# %3$S is the type of object it was.
# %4$S is the property of that object that access was denied for.
GetPropertyDeniedOrigins = Permission denied for <%1$S> to get property %2$S.%3$S from <%4$S>.
# LOCALIZATION NOTE (GetPropertyDeniedOriginsSubjectDomain):
# %1$S is the origin of the script which was denied access.
# %2$S is the origin of the object access was denied to.
# %3$S is the type of object it was.
# %4$S is the property of that object that access was denied for.
# %5$S is the value of document.domain for the script which was denied access;
# don't translate "document.domain".
GetPropertyDeniedOriginsSubjectDomain = Permission denied for <%1$S> (document.domain=<%5$S>) to get property %2$S.%3$S from <%4$S> (document.domain has not been set).
# LOCALIZATION NOTE (GetPropertyDeniedOriginsObjectDomain):
# %1$S is the origin of the script which was denied access.
# %2$S is the origin of the object access was denied to.
# %3$S is the type of object it was.
# %4$S is the property of that object that access was denied for.
# %5$S is the value of document.domain for the object being accessed;
# don't translate "document.domain".
GetPropertyDeniedOriginsObjectDomain = Permission denied for <%1$S> (document.domain has not been set) to get property %2$S.%3$S from <%4$S> (document.domain=<%5$S>).
# LOCALIZATION NOTE (GetPropertyDeniedOriginsSubjectDomainObjectDomain):
# %1$S is the origin of the script which was denied access.
# %2$S is the origin of the object access was denied to.
# %3$S is the type of object it was.
# %4$S is the property of that object that access was denied for.
# %5$S is the value of document.domain for the script which was denied access;
# don't translate "document.domain"
# %6$S is the value of document.domain for the object being accessed;
# don't translate "document.domain".
GetPropertyDeniedOriginsSubjectDomainObjectDomain = Permission denied for <%1$S> (document.domain=<%5$S>) to get property %2$S.%3$S from <%4$S> (document.domain=<%6$S>).
# LOCALIZATION NOTE (SetPropertyDeniedOrigins):
# %1$S is the origin of the script which was denied access.
# %2$S is the origin of the object access was denied to.
# %3$S is the type of object it was.
# %4$S is the property of that object that access was denied for.
SetPropertyDeniedOrigins = Permission denied for <%1$S> to set property %2$S.%3$S on <%4$S>.
# LOCALIZATION NOTE (SetPropertyDeniedOriginsSubjectDomain):
# %1$S is the origin of the script which was denied access.
# %2$S is the origin of the object access was denied to.
# %3$S is the type of object it was.
# %4$S is the property of that object that access was denied for.
# %5$S is the value of document.domain for the script which was denied access;
# don't translate "document.domain".
SetPropertyDeniedOriginsSubjectDomain = Permission denied for <%1$S> (document.domain=<%5$S>) to set property %2$S.%3$S on <%4$S> (document.domain has not been set).
# LOCALIZATION NOTE (SetPropertyDeniedOriginsObjectDomain):
# %1$S is the origin of the script which was denied access.
# %2$S is the origin of the object access was denied to.
# %3$S is the type of object it was.
# %4$S is the property of that object that access was denied for.
# %5$S is the value of document.domain for the object being accessed;
# don't translate "document.domain".
SetPropertyDeniedOriginsObjectDomain = Permission denied for <%1$S> (document.domain has not been set) to set property %2$S.%3$S on <%4$S> (document.domain=<%5$S>).
# LOCALIZATION NOTE (SetPropertyDeniedOriginsSubjectDomainObjectDomain):
# %1$S is the origin of the script which was denied access.
# %2$S is the origin of the object access was denied to.
# %3$S is the type of object it was.
# %4$S is the property of that object that access was denied for.
# %5$S is the value of document.domain for the script which was denied access;
# don't translate "document.domain"
# %6$S is the value of document.domain for the object being accessed;
# don't translate "document.domain".
SetPropertyDeniedOriginsSubjectDomainObjectDomain = Permission denied for <%1$S> (document.domain=<%5$S>) to set property %2$S.%3$S on <%4$S> (document.domain=<%6$S>).
# LOCALIZATION NOTE (CallMethodDeniedOrigins):
# %1$S is the origin of the script which was denied access.
# %2$S is the origin of the object access was denied to.
# %3$S is the type of object it was.
# %4$S is the method of that object that access was denied for.
CallMethodDeniedOrigins = Permission denied for <%1$S> to call method %2$S.%3$S on <%4$S>.
# LOCALIZATION NOTE (CallMethodDeniedOriginsSubjectDomain):
# %1$S is the origin of the script which was denied access.
# %2$S is the origin of the object access was denied to.
# %3$S is the type of object it was.
# %4$S is the method of that object that access was denied for.
# %5$S is the value of document.domain for the script which was denied access;
# don't translate "document.domain".
CallMethodDeniedOriginsSubjectDomain = Permission denied for <%1$S> (document.domain=<%5$S>) to call method %2$S.%3$S on <%4$S> (document.domain has not been set).
# LOCALIZATION NOTE (CallMethodDeniedOriginsObjectDomain):
# %1$S is the origin of the script which was denied access.
# %2$S is the origin of the object access was denied to.
# %3$S is the type of object it was.
# %4$S is the method of that object that access was denied for.
# %5$S is the value of document.domain for the object being accessed;
# don't translate "document.domain".
CallMethodDeniedOriginsObjectDomain = Permission denied for <%1$S> (document.domain has not been set) to call method %2$S.%3$S on <%4$S> (document.domain=<%5$S>).
# LOCALIZATION NOTE (CallMethodDeniedOriginsSubjectDomainObjectDomain):
# %1$S is the origin of the script which was denied access.
# %2$S is the origin of the object access was denied to.
# %3$S is the type of object it was.
# %4$S is the method of that object that access was denied for.
# %5$S is the value of document.domain for the script which was denied access;
# don't translate "document.domain"
# %6$S is the value of document.domain for the object being accessed;
# don't translate "document.domain".
CallMethodDeniedOriginsSubjectDomainObjectDomain = Permission denied for <%1$S> (document.domain=<%5$S>) to call method %2$S.%3$S on <%4$S> (document.domain=<%6$S>).
GetPropertyDeniedOriginsOnlySubject = Permission denied for <%S> to get property %S.%S
SetPropertyDeniedOriginsOnlySubject = Permission denied for <%S> to set property %S.%S
CallMethodDeniedOriginsOnlySubject = Permission denied for <%S> to call method %S.%S

Просмотреть файл

@ -44,7 +44,9 @@ relativesrcdir = dom/tests/mochitest/general
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
_TEST_FILES = test_offsets.html \
_TEST_FILES = \
test_innerScreen.xul \
test_offsets.html \
test_offsets.xul \
test_offsets.js \
test_domWindowUtils.html \

Просмотреть файл

@ -0,0 +1,83 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
<!--
Tests for mozInnerScreenX/Y properties
-->
<window title="Test mozInnerScreenX/Y Properties"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="text/javascript" src="/MochiKit/packed.js"/>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"/>
<!-- test resuls are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml"
style="height: 400px; position:relative; overflow: auto;">
<iframe id="f"
style="position:absolute; left:100px;
top:200px; width:200px; height:200px; border:none;"></iframe>
</body>
<!-- test code goes here -->
<script type="application/javascript"><![CDATA[
function isRounded(a, b, msg) {
ok(Math.round(a) == Math.round(b),
msg + " (rounded), got " + a + ", expected " + b);
}
function doTests()
{
var readable = false;
try
{
mozScreenPixelsPerCSSPixel;
readable = true;
}
catch(ex) { }
ok(!readable, "window pixels per css pixel shouldn't be readable to content");
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var devPxPerCSSPx = window.mozScreenPixelsPerCSSPixel;
var windowBO = document.documentElement.boxObject;
// isRounded(window.mozInnerScreenX*devPxPerCSSPx, windowBO.screenX,
// "window screen X");
isRounded(window.mozInnerScreenY*devPxPerCSSPx, windowBO.screenY,
"window screen Y");
var f = document.getElementById("f");
var fBounds = f.getBoundingClientRect();
const CI = Components.interfaces;
var fshell = f.contentWindow.QueryInterface(CI.nsIInterfaceRequestor).getInterface(CI.nsIWebNavigation).QueryInterface(CI.nsIDocShell);
var fmudv = fshell.contentViewer.QueryInterface(CI.nsIMarkupDocumentViewer);
isRounded(f.contentWindow.mozInnerScreenX,
window.mozInnerScreenX + fBounds.left,
"frame screen X");
isRounded(f.contentWindow.mozInnerScreenY,
window.mozInnerScreenY + fBounds.top,
"frame screen Y");
fmudv.fullZoom *= 2;
is(f.contentWindow.mozScreenPixelsPerCSSPixel, 2*devPxPerCSSPx,
"frame screen pixels per CSS pixel");
isRounded(f.contentWindow.mozInnerScreenX*2,
window.mozInnerScreenX + fBounds.left,
"zoomed frame screen X");
isRounded(f.contentWindow.mozInnerScreenY*2,
window.mozInnerScreenY + fBounds.top,
"zoomed frame screen Y");
fmudv.fullZoom = 1.0;
SimpleTest.finish();
}
addLoadEvent(doTests);
SimpleTest.waitForExplicitFinish();
]]>
</script>
</window>

Просмотреть файл

@ -88,12 +88,29 @@ inline void VERIFY_COORD(nscoord aCoord) {
#endif
}
inline nscoord NSCoordMultiply(nscoord aCoord, float aVal) {
/**
* Returns aCoord * aVal, capping the product to nscoord_MAX.
*
* Note: If/when we start using floats for nscoords, this function won't be
* necessary. Normal float multiplication correctly handles overflowing
* multiplications, automatically saturating to infinity.
*/
inline nscoord NSCoordSaturatingMultiply(nscoord aCoord, float aVal) {
VERIFY_COORD(aCoord);
NS_ABORT_IF_FALSE(aVal >= 0.0f,
"negative scaling factors must be handled manually");
#ifdef NS_COORD_IS_FLOAT
return floorf(aCoord*aVal);
return floorf(aCoord * aVal);
#else
return (PRInt32)(aCoord*aVal);
// This one's only a warning because it's possible to trigger
NS_WARN_IF_FALSE(aCoord > 0
? floorf(aCoord * aVal) < nscoord_MAX
: ceilf(aCoord * aVal) > nscoord_MIN,
"nscoord multiplication capped");
if (aCoord > 0)
return PRInt32(PR_MIN(nscoord_MAX, aCoord * aVal));
return PRInt32(PR_MAX(nscoord_MIN, aCoord * aVal));
#endif
}
@ -365,6 +382,11 @@ inline PRInt32 NSToIntRound(float aValue)
return NS_lroundf(aValue);
}
inline PRInt32 NSToIntRoundUp(float aValue)
{
return PRInt32(NS_floorf(aValue + 0.5f));
}
/*
* App Unit/Pixel conversions
*/

Просмотреть файл

@ -324,12 +324,12 @@ inline nsIntRect
nsRect::ToNearestPixels(nscoord aAppUnitsPerPixel) const
{
nsIntRect rect;
rect.x = NSToIntRound(NSAppUnitsToFloatPixels(x, float(aAppUnitsPerPixel)));
rect.y = NSToIntRound(NSAppUnitsToFloatPixels(y, float(aAppUnitsPerPixel)));
rect.width = NSToIntRound(NSAppUnitsToFloatPixels(XMost(),
float(aAppUnitsPerPixel))) - rect.x;
rect.height = NSToIntRound(NSAppUnitsToFloatPixels(YMost(),
float(aAppUnitsPerPixel))) - rect.y;
rect.x = NSToIntRoundUp(NSAppUnitsToFloatPixels(x, float(aAppUnitsPerPixel)));
rect.y = NSToIntRoundUp(NSAppUnitsToFloatPixels(y, float(aAppUnitsPerPixel)));
rect.width = NSToIntRoundUp(NSAppUnitsToFloatPixels(XMost(),
float(aAppUnitsPerPixel))) - rect.x;
rect.height = NSToIntRoundUp(NSAppUnitsToFloatPixels(YMost(),
float(aAppUnitsPerPixel))) - rect.y;
return rect;
}

Просмотреть файл

@ -745,25 +745,16 @@ public:
* on the spacing provider.
*/
TEXT_ENABLE_SPACING = 0x0008,
/**
* When set, GetSpacing can return negative spacing.
*/
TEXT_ENABLE_NEGATIVE_SPACING = 0x0010,
/**
* When set, GetHyphenationBreaks may return true for some character
* positions, otherwise it will always return false for all characters.
*/
TEXT_ENABLE_HYPHEN_BREAKS = 0x0040,
TEXT_ENABLE_HYPHEN_BREAKS = 0x0010,
/**
* When set, the text has no characters above 255 and it is stored
* in the textrun in 8-bit format.
*/
TEXT_IS_8BIT = 0x0080,
/**
* When set, the text may have UTF16 surrogate pairs, otherwise it
* doesn't.
*/
TEXT_HAS_SURROGATES = 0x0100,
TEXT_IS_8BIT = 0x0020,
/**
* When set, the RunMetrics::mBoundingBox field will be initialized
* properly based on glyph extents, in particular, glyph extents that
@ -771,18 +762,18 @@ public:
* and advance width of the glyph). When not set, it may just be the
* standard font-box even if glyphs overflow.
*/
TEXT_NEED_BOUNDING_BOX = 0x0200,
TEXT_NEED_BOUNDING_BOX = 0x0040,
/**
* When set, optional ligatures are disabled. Ligatures that are
* required for legible text should still be enabled.
*/
TEXT_DISABLE_OPTIONAL_LIGATURES = 0x0400,
TEXT_DISABLE_OPTIONAL_LIGATURES = 0x0080,
/**
* When set, the textrun should favour speed of construction over
* quality. This may involve disabling ligatures and/or kerning or
* other effects.
*/
TEXT_OPTIMIZE_SPEED = 0x0800
TEXT_OPTIMIZE_SPEED = 0x0100
};
/**
@ -1196,7 +1187,6 @@ public:
FLAG_NOT_MISSING = 0x01,
FLAG_NOT_CLUSTER_START = 0x02,
FLAG_NOT_LIGATURE_GROUP_START = 0x04,
FLAG_LOW_SURROGATE = 0x08,
GLYPH_COUNT_MASK = 0x00FFFF00U,
GLYPH_COUNT_SHIFT = 8
@ -1222,9 +1212,6 @@ public:
PRUint32 GetSimpleGlyph() const { return mValue & GLYPH_MASK; }
PRBool IsMissing() const { return (mValue & (FLAG_NOT_MISSING|FLAG_IS_SIMPLE_GLYPH)) == 0; }
PRBool IsLowSurrogate() const {
return (mValue & (FLAG_LOW_SURROGATE|FLAG_IS_SIMPLE_GLYPH)) == FLAG_LOW_SURROGATE;
}
PRBool IsClusterStart() const {
return (mValue & FLAG_IS_SIMPLE_GLYPH) || !(mValue & FLAG_NOT_CLUSTER_START);
}
@ -1271,15 +1258,6 @@ public:
(aGlyphCount << GLYPH_COUNT_SHIFT);
return *this;
}
/**
* Low surrogates don't have any glyphs and are not the start of
* a cluster or ligature group.
*/
CompressedGlyph& SetLowSurrogate() {
mValue = (mValue & FLAG_CAN_BREAK_BEFORE) | FLAG_NOT_MISSING |
FLAG_LOW_SURROGATE;
return *this;
}
PRUint32 GetGlyphCount() const {
NS_ASSERTION(!IsSimpleGlyph(), "Expected non-simple-glyph");
return (mValue & GLYPH_COUNT_MASK) >> GLYPH_COUNT_SHIFT;
@ -1351,11 +1329,6 @@ public:
// API for setting up the textrun glyphs. Should only be called by
// things that construct textruns.
/**
* Record every character that is the second half of a surrogate pair.
* This should be called after creating a Unicode textrun.
*/
void RecordSurrogates(const PRUnichar *aString);
/**
* We've found a run of text that should use a particular font. Call this
* only during initialization when font substitution has been computed.

Просмотреть файл

@ -52,8 +52,7 @@ public:
* Get a textrun for the given text, using a global cache. The textrun
* must be released via ReleaseTextRun, not deleted.
* Do not set any state in the textrun (e.g. actual or potential linebreaks).
* Flags IS_8BIT, IS_ASCII and HAS_SURROGATES are automatically set
* appropriately.
* Flags IS_8BIT and IS_ASCII are automatically set appropriately.
* Flag IS_PERSISTENT must NOT be set unless aText is guaranteed to live
* forever.
* The string can contain any characters, invalid ones will be stripped

Просмотреть файл

@ -70,10 +70,10 @@ public:
* Create a textrun using cached words.
* Invalid characters (see gfxFontGroup::IsInvalidChar) will be automatically
* treated as invisible missing.
* @param aFlags the flags TEXT_IS_ASCII and TEXT_HAS_SURROGATES must be set
* by the caller, if applicable; TEXT_IN_CACHE is added if we
* have a reference to the textrun in the cache and RemoveTextRun must
* be called when the textrun dies.
* @param aFlags the flag TEXT_IS_ASCII must be set by the caller,
* if applicable; TEXT_IN_CACHE is added if we have a reference to
* the textrun in the cache and RemoveTextRun must be called when the
* textrun dies.
*/
static gfxTextRun *MakeTextRun(const PRUnichar *aText, PRUint32 aLength,
gfxFontGroup *aFontGroup,
@ -83,10 +83,10 @@ public:
* Create a textrun using cached words.
* Invalid characters (see gfxFontGroup::IsInvalidChar) will be automatically
* treated as invisible missing.
* @param aFlags the flags TEXT_IS_ASCII and TEXT_HAS_SURROGATES must be set
* by the caller, if applicable; TEXT_IN_CACHE is added if we
* have a reference to the textrun in the cache and RemoveTextRun must
* be called when the textrun dies.
* @param aFlags the flag TEXT_IS_ASCII must be set by the caller,
* if applicable; TEXT_IN_CACHE is added if we have a reference to
* the textrun in the cache and RemoveTextRun must be called when the
* textrun dies.
*/
static gfxTextRun *MakeTextRun(const PRUint8 *aText, PRUint32 aLength,
gfxFontGroup *aFontGroup,

Просмотреть файл

@ -714,7 +714,6 @@ gfxAtsuiFontGroup::MakeTextRun(const PRUnichar *aString, PRUint32 aLength,
if (!textRun)
return nsnull;
textRun->RecordSurrogates(aString);
gfxPlatformMac::SetupClusterBoundaries(textRun, aString);
PRUint32 maxLen;

Просмотреть файл

@ -721,7 +721,6 @@ gfxCoreTextFontGroup::MakeTextRun(const PRUnichar *aString, PRUint32 aLength,
if (!textRun)
return nsnull;
textRun->RecordSurrogates(aString);
gfxPlatformMac::SetupClusterBoundaries(textRun, aString);
nsAutoString utf16;

Просмотреть файл

@ -289,8 +289,6 @@ gfxTextRun *gfxFT2FontGroup::MakeTextRun(const PRUnichar* aString, PRUint32 aLen
if (!textRun)
return nsnull;
textRun->RecordSurrogates(aString);
mString.Assign(nsDependentSubstring(aString, aString + aLength));
InitTextRun(textRun);

Просмотреть файл

@ -2377,30 +2377,6 @@ gfxTextRun::SetMissingGlyph(PRUint32 aIndex, PRUint32 aChar)
mCharacterGlyphs[aIndex].SetMissing(1);
}
void
gfxTextRun::RecordSurrogates(const PRUnichar *aString)
{
// !! FIXME !!
//
// This is called from the platform font implementations when making text runs, but currently it
// doesn't do anything because callers do not (consistently, or ever?) set the TEXT_HAS_SURROGATES flag.
// However, I have not seen anything that relies on the surrogate flag on glyphs, so perhaps we can
// simply eliminate this and remove that flag from gfxTextRunFactory?
if (!(mFlags & gfxTextRunFactory::TEXT_HAS_SURROGATES))
return;
// Remember which characters are low surrogates (the second half of
// a surrogate pair).
PRUint32 i;
gfxTextRun::CompressedGlyph g;
for (i = 0; i < mCharacterCount; ++i) {
if (NS_IS_LOW_SURROGATE(aString[i])) {
SetGlyphs(i, g.SetLowSurrogate(), nsnull);
}
}
}
static void
ClearCharacters(gfxTextRun::CompressedGlyph *aGlyphs, PRUint32 aLength)
{

Просмотреть файл

@ -548,8 +548,6 @@ gfxTextRun *gfxOS2FontGroup::MakeTextRun(const PRUnichar* aString, PRUint32 aLen
mEnableKerning = !(aFlags & gfxTextRunFactory::TEXT_OPTIMIZE_SPEED);
textRun->RecordSurrogates(aString);
nsCAutoString utf8;
PRInt32 headerLen = AppendDirectionalIndicatorUTF8(textRun->IsRightToLeft(), utf8);
AppendUTF16toUTF8(Substring(aString, aString + aLength), utf8);

Просмотреть файл

@ -2860,8 +2860,6 @@ gfxPangoFontGroup::MakeTextRun(const PRUnichar *aString, PRUint32 aLength,
if (!run)
return nsnull;
run->RecordSurrogates(aString);
nsCAutoString utf8;
PRInt32 headerLen = AppendDirectionalIndicatorUTF8(run->IsRightToLeft(), utf8);
AppendUTF16toUTF8(Substring(aString, aString + aLength), utf8);

Просмотреть файл

@ -93,8 +93,8 @@ public:
* Create a textrun using cached words.
* Invalid characters (see gfxFontGroup::IsInvalidChar) will be automatically
* treated as invisible missing.
* @param aFlags the flags TEXT_IS_ASCII and TEXT_HAS_SURROGATES must be set
* by the caller, if applicable
* @param aFlags the flag TEXT_IS_ASCII must be set by the caller,
* if applicable
* @param aIsInCache if true is returned, then RemoveTextRun must be called
* before the textrun changes or dies.
*/

Просмотреть файл

@ -1477,8 +1477,6 @@ gfxWindowsFontGroup::MakeTextRun(const PRUnichar *aString, PRUint32 aLength,
return nsnull;
NS_ASSERTION(aParams->mContext, "MakeTextRun called without a gfxContext");
textRun->RecordSurrogates(aString);
#ifdef FORCE_UNISCRIBE
const PRBool isComplex = PR_TRUE;
#else

Просмотреть файл

@ -304,7 +304,6 @@ RunTest (TestEntry *test, gfxContext *ctx) {
length = strlen(test->string);
textRun = gfxTextRunWordCache::MakeTextRun(reinterpret_cast<PRUint8*>(test->string), length, fontGroup, &params, flags);
} else {
flags |= gfxTextRunFactory::TEXT_HAS_SURROGATES; // just in case
NS_ConvertUTF8toUTF16 str(nsDependentCString(test->string));
length = str.Length();
textRun = gfxTextRunWordCache::MakeTextRun(str.get(), length, fontGroup, &params, flags);

Просмотреть файл

@ -119,7 +119,6 @@ RunTest (TestEntry *test, gfxContext *ctx) {
length = strlen(test->mString);
textRun = fontGroup->MakeTextRun(reinterpret_cast<const PRUint8*>(test->mString), length, &params, flags);
} else {
flags |= gfxTextRunFactory::TEXT_HAS_SURROGATES; // just in case
NS_ConvertUTF8toUTF16 str(nsDependentCString(test->mString));
length = str.Length();
textRun = fontGroup->MakeTextRun(str.get(), length, &params, flags);

Просмотреть файл

@ -144,6 +144,7 @@ CPPSRCS = \
jsscope.cpp \
jsscript.cpp \
jsstr.cpp \
jstask.cpp \
jsutil.cpp \
jsxdrapi.cpp \
jsxml.cpp \
@ -200,6 +201,7 @@ INSTALLED_HEADERS = \
jsscript.h \
jsstaticcheck.h \
jsstr.h \
jstask.h \
jstracer.h \
jstypes.h \
jsutil.h \
@ -343,7 +345,7 @@ endif
DIST_GARBAGE = config.cache config.log config.status \
config/myrules.mk config/myconfig.mk \
unallmakefiles js-config js-config.h mozilla-config.h
unallmakefiles js-config js-config.h js-confdefs.h
distclean::
cat unallmakefiles | $(XARGS) rm -f

Просмотреть файл

@ -162,6 +162,7 @@ MOZ_OPTIMIZE_LDFLAGS = @MOZ_OPTIMIZE_LDFLAGS@
MOZ_OPTIMIZE_SIZE_TWEAK = @MOZ_OPTIMIZE_SIZE_TWEAK@
MOZ_RTTI_FLAGS_ON = @_MOZ_RTTI_FLAGS_ON@
MOZ_EXCEPTIONS_FLAGS_ON = @_MOZ_EXCEPTIONS_FLAGS_ON@
MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE = @MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE@
PROFILE_GEN_CFLAGS = @PROFILE_GEN_CFLAGS@

Просмотреть файл

@ -1251,7 +1251,7 @@ if test "$GNU_CC"; then
fi
_DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
_DEFINES_CFLAGS='-include $(DEPTH)/js-confdefs.h -DMOZILLA_CLIENT'
_USE_CPP_INCLUDE_FLAG=1
elif test "$SOLARIS_SUNPRO_CC"; then
MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
@ -1270,7 +1270,7 @@ elif test "$SOLARIS_SUNPRO_CC"; then
else
DSO_PIC_CFLAGS='-KPIC'
fi
_DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
_DEFINES_CFLAGS='$(ACDEFINES) -D_JS_CONFDEFS_H_ -DMOZILLA_CLIENT'
else
MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
@ -1283,7 +1283,7 @@ else
DSO_CFLAGS=''
DSO_PIC_CFLAGS='-KPIC'
_DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
_DEFINES_CFLAGS='$(ACDEFINES) -D_JS_CONFDEFS_H_ -DMOZILLA_CLIENT'
fi
if test "$GNU_CXX"; then
@ -1303,7 +1303,7 @@ if test "$GNU_CXX"; then
esac
fi
_DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
_DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/js-confdefs.h'
_USE_CPP_INCLUDE_FLAG=1
AC_CACHE_CHECK(whether the compiler supports -Wno-invalid-offsetof,
@ -1342,7 +1342,7 @@ if test "$GNU_CXX"; then
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-variadic-macros"
fi
else
_DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
_DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_JS_CONFDEFS_H_ $(ACDEFINES)'
fi
dnl gcc can come with its own linker so it is better to use the pass-thru calls
@ -2129,8 +2129,8 @@ case "$target" in
USE_PTHREADS=1
_PEDANTIC=
LIBS="$LIBS -lsocket -lstdc++"
_DEFINES_CFLAGS='-Wp,-include -Wp,$(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT -D_POSIX_C_SOURCE=199506'
_DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -Wp,-include -Wp,$(DEPTH)/mozilla-config.h -D_POSIX_C_SOURCE=199506'
_DEFINES_CFLAGS='-Wp,-include -Wp,$(DEPTH)/js-confdefs.h -DMOZILLA_CLIENT -D_POSIX_C_SOURCE=199506'
_DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -Wp,-include -Wp,$(DEPTH)/js-confdefs.h -D_POSIX_C_SOURCE=199506'
if test "$with_x" != "yes"
then
_PLATFORM_DEFAULT_TOOLKIT="photon"
@ -4742,6 +4742,8 @@ else
_MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_OFF
fi
AC_SUBST(_MOZ_EXCEPTIONS_FLAGS_ON)
# Irix & OSF native compilers do not like exception declarations
# when exceptions are disabled
if test -n "$MIPSPRO_CXX" -o -n "$COMPAQ_CXX" -o -n "$VACPP"; then
@ -4798,8 +4800,8 @@ if test "$_cpp_md_flag"; then
else
COMPILER_DEPEND=
_USE_CPP_INCLUDE_FLAG=
_DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
_DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
_DEFINES_CFLAGS='$(ACDEFINES) -D_JS_CONFDEFS_H_ -DMOZILLA_CLIENT'
_DEFINES_CXXFLAGS='$(ACDEFINES) -D_JS_CONFDEFS_H_ -DMOZILLA_CLIENT'
fi
fi # MOZ_AUTO_DEPS
MDDEPDIR='.deps'
@ -5178,7 +5180,7 @@ dnl ========================================================
# Save the defines header file before autoconf removes it.
# (Do not add AC_DEFINE calls after this line.)
_CONFIG_TMP=confdefs-tmp.h
_CONFIG_DEFS_H=mozilla-config.h
_CONFIG_DEFS_H=js-confdefs.h
cat > $_CONFIG_TMP <<\EOF
/* List of defines generated by configure. Included with preprocessor flag,
@ -5186,8 +5188,8 @@ dnl ========================================================
* Do not edit.
*/
#ifndef _MOZILLA_CONFIG_H_
#define _MOZILLA_CONFIG_H_
#ifndef _JS_CONFDEFS_H_
#define _JS_CONFDEFS_H_
EOF
_EGREP_PATTERN='^#define ('
@ -5202,11 +5204,11 @@ _EGREP_PATTERN="${_EGREP_PATTERN}dummy_never_defined)"
cat >> $_CONFIG_TMP <<\EOF
#endif /* _MOZILLA_CONFIG_H_ */
#endif /* _JS_CONFDEFS_H_ */
EOF
# Only write mozilla-config.h when something changes (or it doesn't exist)
# Only write js-confdefs.h when something changes (or it doesn't exist)
if cmp -s $_CONFIG_TMP $_CONFIG_DEFS_H; then
rm $_CONFIG_TMP
else

Просмотреть файл

@ -79,6 +79,7 @@
#include "jsscope.h"
#include "jsscript.h"
#include "jsstr.h"
#include "jstask.h"
#include "jstracer.h"
#include "jsdbgapi.h"
#include "prmjtime.h"
@ -448,7 +449,7 @@ JS_AddArgumentFormatter(JSContext *cx, const char *format,
goto out;
mpp = &map->next;
}
map = (JSArgumentFormatMap *) JS_malloc(cx, sizeof *map);
map = (JSArgumentFormatMap *) cx->malloc(sizeof *map);
if (!map)
return JS_FALSE;
map->format = format;
@ -471,7 +472,7 @@ JS_RemoveArgumentFormatter(JSContext *cx, const char *format)
while ((map = *mpp) != NULL) {
if (map->length == length && !strcmp(map->format, format)) {
*mpp = map->next;
JS_free(cx, map);
cx->free(map);
return;
}
mpp = &map->next;
@ -773,7 +774,7 @@ JS_NewRuntime(uint32 maxbytes)
}
#endif /* DEBUG */
rt = (JSRuntime *) malloc(sizeof(JSRuntime));
rt = (JSRuntime *) js_malloc(sizeof(JSRuntime));
if (!rt)
return NULL;
@ -817,6 +818,9 @@ JS_NewRuntime(uint32 maxbytes)
rt->debuggerLock = JS_NEW_LOCK();
if (!rt->debuggerLock)
goto bad;
rt->deallocatorThread = new JSBackgroundThread();
if (!rt->deallocatorThread || !rt->deallocatorThread->init())
goto bad;
#endif
if (!js_InitPropertyTree(rt))
goto bad;
@ -886,9 +890,13 @@ JS_DestroyRuntime(JSRuntime *rt)
JS_DESTROY_CONDVAR(rt->titleSharingDone);
if (rt->debuggerLock)
JS_DESTROY_LOCK(rt->debuggerLock);
if (rt->deallocatorThread) {
rt->deallocatorThread->cancel();
delete rt->deallocatorThread;
}
#endif
js_FinishPropertyTree(rt);
free(rt);
js_free(rt);
}
JS_PUBLIC_API(void)
@ -1328,7 +1336,7 @@ JS_InitStandardClasses(JSContext *cx, JSObject *obj)
/* Define a top-level property 'undefined' with the undefined value. */
atom = cx->runtime->atomState.typeAtoms[JSTYPE_VOID];
if (!OBJ_DEFINE_PROPERTY(cx, obj, ATOM_TO_JSID(atom), JSVAL_VOID,
JS_PropertyStub, JS_PropertyStub, JSPROP_PERMANENT,
JS_PropertyStub, JS_PropertyStub, JSPROP_PERMANENT,
NULL)) {
return JS_FALSE;
}
@ -1535,7 +1543,7 @@ JS_ResolveStandardClass(JSContext *cx, JSObject *obj, jsval id,
if (idstr == ATOM_TO_STRING(atom)) {
*resolved = JS_TRUE;
return OBJ_DEFINE_PROPERTY(cx, obj, ATOM_TO_JSID(atom), JSVAL_VOID,
JS_PropertyStub, JS_PropertyStub,
JS_PropertyStub, JS_PropertyStub,
JSPROP_PERMANENT, NULL);
}
@ -1630,7 +1638,7 @@ JS_EnumerateStandardClasses(JSContext *cx, JSObject *obj)
atom = rt->atomState.typeAtoms[JSTYPE_VOID];
if (!AlreadyHasOwnProperty(cx, obj, atom) &&
!OBJ_DEFINE_PROPERTY(cx, obj, ATOM_TO_JSID(atom), JSVAL_VOID,
JS_PropertyStub, JS_PropertyStub, JSPROP_PERMANENT,
JS_PropertyStub, JS_PropertyStub, JSPROP_PERMANENT,
NULL)) {
return JS_FALSE;
}
@ -1653,7 +1661,7 @@ NewIdArray(JSContext *cx, jsint length)
JSIdArray *ida;
ida = (JSIdArray *)
JS_malloc(cx, offsetof(JSIdArray, vector) + length * sizeof(jsval));
cx->malloc(offsetof(JSIdArray, vector) + length * sizeof(jsval));
if (ida)
ida->length = length;
return ida;
@ -1831,41 +1839,19 @@ JS_ComputeThis(JSContext *cx, jsval *vp)
JS_PUBLIC_API(void *)
JS_malloc(JSContext *cx, size_t nbytes)
{
void *p;
JS_ASSERT(nbytes != 0);
if (nbytes == 0)
nbytes = 1;
p = malloc(nbytes);
if (!p) {
JS_ReportOutOfMemory(cx);
return NULL;
}
cx->updateMallocCounter(nbytes);
return p;
return cx->malloc(nbytes);
}
JS_PUBLIC_API(void *)
JS_realloc(JSContext *cx, void *p, size_t nbytes)
{
void *orig = p;
p = realloc(p, nbytes);
if (!p) {
JS_ReportOutOfMemory(cx);
return NULL;
}
if (!orig)
cx->updateMallocCounter(nbytes);
return p;
return cx->realloc(p, nbytes);
}
JS_PUBLIC_API(void)
JS_free(JSContext *cx, void *p)
{
if (p)
free(p);
return cx->free(p);
}
JS_PUBLIC_API(char *)
@ -1875,7 +1861,7 @@ JS_strdup(JSContext *cx, const char *s)
void *p;
n = strlen(s) + 1;
p = JS_malloc(cx, n);
p = cx->malloc(n);
if (!p)
return NULL;
return (char *)memcpy(p, s, n);
@ -2260,7 +2246,7 @@ DumpNotify(JSTracer *trc, void *thing, uint32 kind)
edgeNameSize = strlen(edgeName) + 1;
node = (JSHeapDumpNode *)
JS_malloc(cx, offsetof(JSHeapDumpNode, edgeName) + edgeNameSize);
cx->malloc(offsetof(JSHeapDumpNode, edgeName) + edgeNameSize);
if (!node) {
dtrc->ok = JS_FALSE;
return;
@ -2412,7 +2398,7 @@ JS_DumpHeap(JSContext *cx, FILE *fp, void* startThing, uint32 startKind,
for (;;) {
next = node->next;
parent = node->parent;
JS_free(cx, node);
cx->free(node);
node = next;
if (node)
break;
@ -2679,7 +2665,7 @@ JS_SetScriptStackQuota(JSContext *cx, size_t quota)
JS_PUBLIC_API(void)
JS_DestroyIdArray(JSContext *cx, JSIdArray *ida)
{
JS_free(cx, ida);
cx->free(ida);
}
JS_PUBLIC_API(JSBool)
@ -3001,7 +2987,7 @@ DefinePropertyById(JSContext *cx, JSObject *obj, jsid id, jsval value,
attrs, flags, tinyid, NULL);
}
return OBJ_DEFINE_PROPERTY(cx, obj, id, value, getter, setter, attrs,
NULL);
NULL);
}
static JSBool
@ -3720,7 +3706,7 @@ JS_HasUCProperty(JSContext *cx, JSObject *obj,
JSProperty *prop;
CHECK_REQUEST(cx);
ok = LookupUCProperty(cx, obj, name, namelen,
ok = LookupUCProperty(cx, obj, name, namelen,
JSRESOLVE_QUALIFIED | JSRESOLVE_DETECTING,
&obj2, &prop);
if (ok) {
@ -4072,13 +4058,13 @@ prop_iter_trace(JSTracer *trc, JSObject *obj)
/* Native case: just mark the next property to visit. */
sprop = (JSScopeProperty *) JSVAL_TO_PRIVATE(v);
if (sprop)
TRACE_SCOPE_PROPERTY(trc, sprop);
sprop->trace(trc);
} else {
/* Non-native case: mark each id in the JSIdArray private. */
ida = (JSIdArray *) JSVAL_TO_PRIVATE(v);
for (i = 0, n = ida->length; i < n; i++) {
id = ida->vector[i];
TRACE_ID(trc, id);
js_TraceId(trc, id);
}
}
}
@ -4644,7 +4630,7 @@ JS_CompileScript(JSContext *cx, JSObject *obj,
if (!chars)
return NULL;
script = JS_CompileUCScript(cx, obj, chars, length, filename, lineno);
JS_free(cx, chars);
cx->free(chars);
return script;
}
@ -4663,7 +4649,7 @@ JS_CompileScriptForPrincipals(JSContext *cx, JSObject *obj,
return NULL;
script = JS_CompileUCScriptForPrincipals(cx, obj, principals,
chars, length, filename, lineno);
JS_free(cx, chars);
cx->free(chars);
return script;
}
@ -4748,7 +4734,7 @@ JS_BufferIsCompilableUnit(JSContext *cx, JSObject *obj,
JS_SetErrorReporter(cx, older);
}
}
JS_free(cx, chars);
cx->free(chars);
JS_RestoreExceptionState(cx, exnState);
return result;
}
@ -4857,7 +4843,7 @@ JS_CompileFunction(JSContext *cx, JSObject *obj, const char *name,
return NULL;
fun = JS_CompileUCFunction(cx, obj, name, nargs, argnames, chars, length,
filename, lineno);
JS_free(cx, chars);
cx->free(chars);
return fun;
}
@ -4878,7 +4864,7 @@ JS_CompileFunctionForPrincipals(JSContext *cx, JSObject *obj,
fun = JS_CompileUCFunctionForPrincipals(cx, obj, principals, name,
nargs, argnames, chars, length,
filename, lineno);
JS_free(cx, chars);
cx->free(chars);
return fun;
}
@ -5088,7 +5074,7 @@ JS_EvaluateScript(JSContext *cx, JSObject *obj,
if (!chars)
return JS_FALSE;
ok = JS_EvaluateUCScript(cx, obj, chars, length, filename, lineno, rval);
JS_free(cx, chars);
cx->free(chars);
return ok;
}
@ -5110,7 +5096,7 @@ JS_EvaluateScriptForPrincipals(JSContext *cx, JSObject *obj,
return JS_FALSE;
ok = JS_EvaluateUCScriptForPrincipals(cx, obj, principals, chars, length,
filename, lineno, rval);
JS_free(cx, chars);
cx->free(chars);
return ok;
}
@ -5197,7 +5183,7 @@ JS_SetOperationCallback(JSContext *cx, JSOperationCallback callback)
{
#ifdef JS_THREADSAFE
JS_ASSERT(CURRENT_THREAD_IS_ME(cx->thread));
#endif
#endif
JSOperationCallback old = cx->operationCallback;
cx->operationCallback = callback;
return old;
@ -5319,13 +5305,13 @@ JS_NewString(JSContext *cx, char *bytes, size_t nbytes)
/* Free chars (but not bytes, which caller frees on error) if we fail. */
str = js_NewString(cx, chars, length);
if (!str) {
JS_free(cx, chars);
cx->free(chars);
return NULL;
}
/* Hand off bytes to the deflated string cache, if possible. */
if (!js_SetStringBytes(cx, str, bytes, nbytes))
JS_free(cx, bytes);
cx->free(bytes);
return str;
}
@ -5341,7 +5327,7 @@ JS_NewStringCopyN(JSContext *cx, const char *s, size_t n)
return NULL;
str = js_NewString(cx, js, n);
if (!str)
JS_free(cx, js);
cx->free(js);
return str;
}
@ -5361,7 +5347,7 @@ JS_NewStringCopyZ(JSContext *cx, const char *s)
return NULL;
str = js_NewString(cx, js, n);
if (!str)
JS_free(cx, js);
cx->free(js);
return str;
}
@ -5449,7 +5435,7 @@ JS_GetStringChars(JSString *str)
if (str->isDependent()) {
n = str->dependentLength();
size = (n + 1) * sizeof(jschar);
s = (jschar *) malloc(size);
s = (jschar *) js_malloc(size);
if (s) {
memcpy(s, str->dependentChars(), n * sizeof *s);
s[n] = 0;
@ -5727,7 +5713,7 @@ JS_NewRegExpObject(JSContext *cx, char *bytes, size_t length, uintN flags)
if (!chars)
return NULL;
obj = js_NewRegExpObject(cx, NULL, chars, length, flags);
JS_free(cx, chars);
cx->free(chars);
return obj;
}
@ -5857,7 +5843,7 @@ JS_SaveExceptionState(JSContext *cx)
JSExceptionState *state;
CHECK_REQUEST(cx);
state = (JSExceptionState *) JS_malloc(cx, sizeof(JSExceptionState));
state = (JSExceptionState *) cx->malloc(sizeof(JSExceptionState));
if (state) {
state->throwing = JS_GetPendingException(cx, &state->exception);
if (state->throwing && JSVAL_IS_GCTHING(state->exception))
@ -5886,7 +5872,7 @@ JS_DropExceptionState(JSContext *cx, JSExceptionState *state)
if (state) {
if (state->throwing && JSVAL_IS_GCTHING(state->exception))
JS_RemoveRoot(cx, &state->exception);
JS_free(cx, state);
cx->free(state);
}
}

Просмотреть файл

@ -54,35 +54,122 @@ JS_BEGIN_EXTERN_C
/*
* Type tags stored in the low bits of a jsval.
*/
#define JSVAL_OBJECT 0x0 /* untagged reference to object */
#define JSVAL_INT 0x1 /* tagged 31-bit integer value */
#define JSVAL_DOUBLE 0x2 /* tagged reference to double */
#define JSVAL_STRING 0x4 /* tagged reference to string */
#define JSVAL_BOOLEAN 0x6 /* tagged boolean value */
typedef enum jsvaltag {
JSVAL_OBJECT = 0x0, /* untagged reference to object */
JSVAL_INT = 0x1, /* tagged 31-bit integer value */
JSVAL_DOUBLE = 0x2, /* tagged reference to double */
JSVAL_STRING = 0x4, /* tagged reference to string */
JSVAL_BOOLEAN = 0x6 /* tagged boolean value */
} jsvaltag;
#define JSVAL_OBJECT ((jsvaltag)0x0)
#define JSVAL_INT ((jsvaltag)0x1)
#define JSVAL_DOUBLE ((jsvaltag)0x2)
#define JSVAL_STRING ((jsvaltag)0x4)
#define JSVAL_BOOLEAN ((jsvaltag)0x6)
/* Type tag bitfield length and derived macros. */
#define JSVAL_TAGBITS 3
#define JSVAL_TAGMASK JS_BITMASK(JSVAL_TAGBITS)
#define JSVAL_TAG(v) ((v) & JSVAL_TAGMASK)
#define JSVAL_SETTAG(v,t) ((v) | (t))
#define JSVAL_CLRTAG(v) ((v) & ~(jsval)JSVAL_TAGMASK)
#define JSVAL_ALIGN JS_BIT(JSVAL_TAGBITS)
/* Not a function, because we have static asserts that use it */
#define JSVAL_TAG(v) ((jsvaltag)((v) & JSVAL_TAGMASK))
/* Not a function, because we have static asserts that use it */
#define JSVAL_SETTAG(v, t) ((v) | (t))
static JS_ALWAYS_INLINE jsval
JSVAL_CLRTAG(jsval v)
{
return v & ~(jsval)JSVAL_TAGMASK;
}
/*
* Well-known JS values. The extern'd variables are initialized when the
* first JSContext is created by JS_NewContext (see below).
*/
#define JSVAL_NULL ((jsval) 0)
#define JSVAL_ZERO INT_TO_JSVAL(0)
#define JSVAL_ONE INT_TO_JSVAL(1)
#define JSVAL_FALSE PSEUDO_BOOLEAN_TO_JSVAL(JS_FALSE)
#define JSVAL_TRUE PSEUDO_BOOLEAN_TO_JSVAL(JS_TRUE)
#define JSVAL_VOID PSEUDO_BOOLEAN_TO_JSVAL(2)
/*
* A pseudo-boolean is a 29-bit (for 32-bit jsval) or 61-bit (for 64-bit jsval)
* value other than 0 or 1 encoded as a jsval whose tag is JSVAL_BOOLEAN.
*
* JSVAL_VOID happens to be defined as a jsval encoding a pseudo-boolean, but
* embedders MUST NOT rely on this. All other possible pseudo-boolean values
* are implementation-reserved and MUST NOT be constructed by any embedding of
* SpiderMonkey.
*/
#define JSVAL_TO_PSEUDO_BOOLEAN(v) ((JSBool) ((v) >> JSVAL_TAGBITS))
#define PSEUDO_BOOLEAN_TO_JSVAL(b) \
JSVAL_SETTAG((jsval) (b) << JSVAL_TAGBITS, JSVAL_BOOLEAN)
/* Predicates for type testing. */
#define JSVAL_IS_OBJECT(v) (JSVAL_TAG(v) == JSVAL_OBJECT)
#define JSVAL_IS_NUMBER(v) (JSVAL_IS_INT(v) || JSVAL_IS_DOUBLE(v))
#define JSVAL_IS_INT(v) ((v) & JSVAL_INT)
#define JSVAL_IS_DOUBLE(v) (JSVAL_TAG(v) == JSVAL_DOUBLE)
#define JSVAL_IS_STRING(v) (JSVAL_TAG(v) == JSVAL_STRING)
#define JSVAL_IS_BOOLEAN(v) (((v) & ~((jsval)1 << JSVAL_TAGBITS)) == \
JSVAL_BOOLEAN)
#define JSVAL_IS_NULL(v) ((v) == JSVAL_NULL)
#define JSVAL_IS_VOID(v) ((v) == JSVAL_VOID)
#define JSVAL_IS_PRIMITIVE(v) (!JSVAL_IS_OBJECT(v) || JSVAL_IS_NULL(v))
static JS_ALWAYS_INLINE JSBool
JSVAL_IS_OBJECT(jsval v)
{
return JSVAL_TAG(v) == JSVAL_OBJECT;
}
static JS_ALWAYS_INLINE JSBool
JSVAL_IS_INT(jsval v)
{
return v & JSVAL_INT;
}
static JS_ALWAYS_INLINE JSBool
JSVAL_IS_DOUBLE(jsval v)
{
return JSVAL_TAG(v) == JSVAL_DOUBLE;
}
static JS_ALWAYS_INLINE JSBool
JSVAL_IS_NUMBER(jsval v)
{
return JSVAL_IS_INT(v) || JSVAL_IS_DOUBLE(v);
}
static JS_ALWAYS_INLINE JSBool
JSVAL_IS_STRING(jsval v)
{
return JSVAL_TAG(v) == JSVAL_STRING;
}
static JS_ALWAYS_INLINE JSBool
JSVAL_IS_BOOLEAN(jsval v)
{
return (v & ~((jsval)1 << JSVAL_TAGBITS)) == JSVAL_BOOLEAN;
}
static JS_ALWAYS_INLINE JSBool
JSVAL_IS_NULL(jsval v)
{
return v == JSVAL_NULL;
}
static JS_ALWAYS_INLINE JSBool
JSVAL_IS_VOID(jsval v)
{
return v == JSVAL_VOID;
}
static JS_ALWAYS_INLINE JSBool
JSVAL_IS_PRIMITIVE(jsval v)
{
return !JSVAL_IS_OBJECT(v) || JSVAL_IS_NULL(v);
}
/* Objects, strings, and doubles are GC'ed. */
#define JSVAL_IS_GCTHING(v) (!((v) & JSVAL_INT) && \
JSVAL_TAG(v) != JSVAL_BOOLEAN)
static JS_ALWAYS_INLINE JSBool
JSVAL_IS_GCTHING(jsval v)
{
return !(v & JSVAL_INT) && JSVAL_TAG(v) != JSVAL_BOOLEAN;
}
static JS_ALWAYS_INLINE void *
JSVAL_TO_GCTHING(jsval v)
@ -145,36 +232,18 @@ STRING_TO_JSVAL(JSString *str)
#define JSVAL_INT_POW2(n) ((jsval)1 << (n))
#define JSVAL_INT_MIN (-JSVAL_INT_POW2(30))
#define JSVAL_INT_MAX (JSVAL_INT_POW2(30) - 1)
/* Not a function, because we have static asserts that use it */
#define INT_FITS_IN_JSVAL(i) ((jsuint)(i) - (jsuint)JSVAL_INT_MIN <= \
(jsuint)(JSVAL_INT_MAX - JSVAL_INT_MIN))
/* Not a function, because we have static asserts that use it */
/* FIXME: Bug 506721, since that means we can't assert JSVAL_IS_INT(v) */
#define JSVAL_TO_INT(v) ((jsint)(v) >> 1)
/* Not a function, because we have static asserts that use it */
/* FIXME: Bug 506721, since that means we can't assert INT_FITS_IN_JSVAL(i) */
#define INT_TO_JSVAL(i) (((jsval)(i) << 1) | JSVAL_INT)
/*
* A pseudo-boolean is a 29-bit (for 32-bit jsval) or 61-bit (for 64-bit jsval)
* value other than 0 or 1 encoded as a jsval whose tag is JSVAL_BOOLEAN.
*
* JSVAL_VOID happens to be defined as a jsval encoding a pseudo-boolean, but
* embedders MUST NOT rely on this. All other possible pseudo-boolean values
* are implementation-reserved and MUST NOT be constructed by any embedding of
* SpiderMonkey.
*/
#define JSVAL_TO_PSEUDO_BOOLEAN(v) ((JSBool) ((v) >> JSVAL_TAGBITS))
#define PSEUDO_BOOLEAN_TO_JSVAL(b) \
JSVAL_SETTAG((jsval) (b) << JSVAL_TAGBITS, JSVAL_BOOLEAN)
/*
* Well-known JS values. The extern'd variables are initialized when the
* first JSContext is created by JS_NewContext (see below).
*/
#define JSVAL_NULL ((jsval) 0)
#define JSVAL_ZERO INT_TO_JSVAL(0)
#define JSVAL_ONE INT_TO_JSVAL(1)
#define JSVAL_FALSE PSEUDO_BOOLEAN_TO_JSVAL(JS_FALSE)
#define JSVAL_TRUE PSEUDO_BOOLEAN_TO_JSVAL(JS_TRUE)
#define JSVAL_VOID PSEUDO_BOOLEAN_TO_JSVAL(2)
/* Convert between boolean and jsval, asserting that inputs are valid. */
static JS_ALWAYS_INLINE JSBool
JSVAL_TO_BOOLEAN(jsval v)
@ -2229,14 +2298,14 @@ JS_CallFunctionValue(JSContext *cx, JSObject *obj, jsval fval, uintN argc,
* These functions allow setting an operation callback that will be called
* from the thread the context is associated with some time after any thread
* triggered the callback using JS_TriggerOperationCallback(cx).
*
*
* In a threadsafe build the engine internally triggers operation callbacks
* under certain circumstances (i.e. GC and title transfer) to force the
* context to yield its current request, which the engine always
* context to yield its current request, which the engine always
* automatically does immediately prior to calling the callback function.
* The embedding should thus not rely on callbacks being triggered through
* the external API only.
*
*
* Important note: Additional callbacks can occur inside the callback handler
* if it re-enters the JS engine. The embedding must ensure that the callback
* is disconnected before attempting such re-entry.

Просмотреть файл

@ -160,12 +160,12 @@ JS_ArenaAllocate(JSArenaPool *pool, size_t nb)
if (pool->quotap) {
if (gross > *pool->quotap)
return NULL;
b = (JSArena *) malloc(gross);
b = (JSArena *) js_malloc(gross);
if (!b)
return NULL;
*pool->quotap -= gross;
} else {
b = (JSArena *) malloc(gross);
b = (JSArena *) js_malloc(gross);
if (!b)
return NULL;
}
@ -227,12 +227,12 @@ JS_ArenaRealloc(JSArenaPool *pool, void *p, size_t size, size_t incr)
growth = gross - (a->limit - (jsuword) a);
if (growth > *pool->quotap)
return NULL;
a = (JSArena *) realloc(a, gross);
a = (JSArena *) js_realloc(a, gross);
if (!a)
return NULL;
*pool->quotap -= growth;
} else {
a = (JSArena *) realloc(a, gross);
a = (JSArena *) js_realloc(a, gross);
if (!a)
return NULL;
}
@ -315,7 +315,7 @@ FreeArenaList(JSArenaPool *pool, JSArena *head)
*pool->quotap += a->limit - (jsuword) a;
JS_CLEAR_ARENA(a);
JS_COUNT_ARENA(pool,--);
free(a);
js_free(a);
} while ((a = *ap) != NULL);
pool->current = head;
@ -354,7 +354,7 @@ JS_FinishArenaPool(JSArenaPool *pool)
JSArenaStats *stats, **statsp;
if (pool->stats.name) {
free(pool->stats.name);
js_free(pool->stats.name);
pool->stats.name = NULL;
}
for (statsp = &arena_stats_list; (stats = *statsp) != 0;

Просмотреть файл

@ -314,7 +314,7 @@ ResizeSlots(JSContext *cx, JSObject *obj, uint32 oldsize, uint32 size)
if (size == 0) {
if (obj->dslots) {
JS_free(cx, obj->dslots - 1);
cx->free(obj->dslots - 1);
obj->dslots = NULL;
}
return JS_TRUE;
@ -330,7 +330,7 @@ ResizeSlots(JSContext *cx, JSObject *obj, uint32 oldsize, uint32 size)
}
slots = obj->dslots ? obj->dslots - 1 : NULL;
newslots = (jsval *) JS_realloc(cx, slots, (size + 1) * sizeof(jsval));
newslots = (jsval *) cx->realloc(slots, (size + 1) * sizeof(jsval));
if (!newslots)
return JS_FALSE;
@ -1099,7 +1099,7 @@ array_enumerate(JSContext *cx, JSObject *obj, JSIterateOp enum_op,
if (obj->dslots[i] == JSVAL_HOLE) {
if (!ii) {
ii = (JSIndexIterState *)
JS_malloc(cx, offsetof(JSIndexIterState, holes) +
cx->malloc(offsetof(JSIndexIterState, holes) +
JS_BITMAP_SIZE(capacity));
if (!ii)
return JS_FALSE;
@ -1116,7 +1116,7 @@ array_enumerate(JSContext *cx, JSObject *obj, JSIterateOp enum_op,
break;
}
ii = (JSIndexIterState *)
JS_malloc(cx, offsetof(JSIndexIterState, holes));
cx->malloc(offsetof(JSIndexIterState, holes));
if (!ii)
return JS_FALSE;
ii->hasHoles = JS_FALSE;
@ -1157,7 +1157,7 @@ array_enumerate(JSContext *cx, JSObject *obj, JSIterateOp enum_op,
if (JSVAL_TAG(*statep) != JSVAL_BOOLEAN) {
JS_ASSERT((*statep & INDEX_ITER_TAG) == INDEX_ITER_TAG);
ii = (JSIndexIterState *) (*statep & ~INDEX_ITER_TAG);
JS_free(cx, ii);
cx->free(ii);
}
*statep = JSVAL_NULL;
break;
@ -1188,7 +1188,7 @@ static void
array_finalize(JSContext *cx, JSObject *obj)
{
if (obj->dslots)
JS_free(cx, obj->dslots - 1);
cx->free(obj->dslots - 1);
obj->dslots = NULL;
}
@ -1336,7 +1336,7 @@ BufferToString(JSContext *cx, JSTempVector<jschar> &buf, jsval *rval)
jschar *chars = buf.extractRawBuffer();
JSString *str = js_NewString(cx, chars, length);
if (!str) {
JS_free(cx, chars);
cx->free(chars);
return JS_FALSE;
}
*rval = STRING_TO_JSVAL(str);
@ -1368,7 +1368,7 @@ array_toSource(JSContext *cx, uintN argc, jsval *vp)
JSBool ok = JS_TRUE;
/*
* This object will take responsibility for the jschar buffer until the
* This object will take responsibility for the jschar buffer until the
* buffer is transferred to the returned JSString.
*/
JSTempVector<jschar> buf(cx);
@ -1392,7 +1392,7 @@ array_toSource(JSContext *cx, uintN argc, jsval *vp)
if (!(ok = buf.pushBack(arr, arr + 3)))
goto done;
if (sharpchars)
JS_free(cx, sharpchars);
cx->free(sharpchars);
goto make_string;
}
#endif
@ -1520,7 +1520,7 @@ array_toString_sub(JSContext *cx, JSObject *obj, JSBool locale,
}
/*
* This object will take responsibility for the jschar buffer until the
* This object will take responsibility for the jschar buffer until the
* buffer is transferred to the returned JSString.
*/
JSTempVector<jschar> buf(cx);
@ -2151,7 +2151,7 @@ array_sort(JSContext *cx, uintN argc, jsval *vp)
return JS_FALSE;
}
#endif
vec = (jsval *) JS_malloc(cx, 2 * (size_t) len * sizeof(jsval));
vec = (jsval *) cx->malloc(2 * (size_t) len * sizeof(jsval));
if (!vec)
return JS_FALSE;
@ -2280,8 +2280,8 @@ array_sort(JSContext *cx, uintN argc, jsval *vp)
} while (i != 0);
JS_ASSERT(tvr.u.array == vec);
vec = (jsval *) JS_realloc(cx, vec,
4 * (size_t) newlen * sizeof(jsval));
vec = (jsval *) cx->realloc(vec,
4 * (size_t) newlen * sizeof(jsval));
if (!vec) {
vec = tvr.u.array;
ok = JS_FALSE;
@ -2342,7 +2342,7 @@ array_sort(JSContext *cx, uintN argc, jsval *vp)
out:
JS_POP_TEMP_ROOT(cx, &tvr);
JS_free(cx, vec);
cx->free(vec);
if (!ok)
return JS_FALSE;
@ -3507,7 +3507,7 @@ js_ArrayInfo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
if (JSVAL_IS_PRIMITIVE(argv[i]) ||
!OBJ_IS_ARRAY(cx, (array = JSVAL_TO_OBJECT(argv[i])))) {
fprintf(stderr, "%s: not array\n", bytes);
JS_free(cx, bytes);
cx->free(bytes);
continue;
}
fprintf(stderr, "%s: %s (len %lu", bytes,
@ -3519,7 +3519,7 @@ js_ArrayInfo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
js_DenseArrayCapacity(array));
}
fputs(")\n", stderr);
JS_free(cx, bytes);
cx->free(bytes);
}
return JS_TRUE;
}

Просмотреть файл

@ -207,6 +207,10 @@ JSBool
js_GetDenseArrayElementValue(JSContext *cx, JSObject *obj, JSProperty *prop,
jsval *vp);
/* Array constructor native. Exposed only so the JIT can know its address. */
JSBool
js_Array(JSContext* cx, JSObject* obj, uintN argc, jsval* argv, jsval* rval);
JS_END_EXTERN_C
#endif /* jsarray_h___ */

Просмотреть файл

@ -783,7 +783,7 @@ js_Atomize(JSContext *cx, const char *bytes, size_t length, uintN flags)
str.initFlat(chars, inflatedLength);
atom = js_AtomizeString(cx, &str, ATOM_TMPSTR | flags);
if (chars != inflated && str.flatChars())
JS_free(cx, chars);
cx->free(chars);
return atom;
}

Просмотреть файл

@ -129,7 +129,7 @@ js_BoxInt32(JSContext* cx, int32 i)
if (!js_NewDoubleInRootedValue(cx, d, &v))
return JSVAL_ERROR_COOKIE;
return v;
}
}
JS_DEFINE_CALLINFO_2(extern, JSVAL, js_BoxInt32, CONTEXT, INT32, 1, 1)
jsdouble FASTCALL
@ -242,8 +242,6 @@ JSBool FASTCALL
js_AddProperty(JSContext* cx, JSObject* obj, JSScopeProperty* sprop)
{
JS_ASSERT(OBJ_IS_NATIVE(obj));
JS_ASSERT(SPROP_HAS_STUB_SETTER(sprop));
JS_LOCK_OBJ(cx, obj);
JSScope* scope = OBJ_SCOPE(obj);

Просмотреть файл

@ -86,7 +86,7 @@ struct JSTraceableNative {
const nanojit::CallInfo *builtin;
const char *prefix;
const char *argtypes;
uintN flags; /* JSTNErrType | JSTN_UNBOX_AFTER | JSTN_MORE |
uintN flags; /* JSTNErrType | JSTN_UNBOX_AFTER | JSTN_MORE |
JSTN_CONSTRUCTOR */
};
@ -117,7 +117,7 @@ struct JSTraceableNative {
#endif
/*
* Supported types for builtin functions.
* Supported types for builtin functions.
*
* Types with -- for the two string fields are not permitted as argument types
* in JS_DEFINE_TRCINFO.
@ -165,7 +165,7 @@ struct JSTraceableNative {
* trace. If an exception is pending, it is thrown; otherwise, we assume the
* builtin had no side effects and retry the current bytecode in the
* interpreter.
*
*
* So a builtin must not return a value indicating failure after causing side
* effects (such as reporting an error), without setting an exception pending.
* The operation would be retried, despite the first attempt's observable
@ -187,6 +187,7 @@ struct JSTraceableNative {
#define _JS_CTYPE_JSVAL _JS_JSVAL_CTYPE( _JS_PTR, "","v", INFALLIBLE)
#define _JS_CTYPE_JSVAL_RETRY _JS_JSVAL_CTYPE( _JS_PTR, --, --, FAIL_COOKIE)
#define _JS_CTYPE_JSVAL_FAIL _JS_JSVAL_CTYPE( _JS_PTR, --, --, FAIL_STATUS)
#define _JS_CTYPE_JSID _JS_CTYPE(jsid, _JS_PTR, --, --, INFALLIBLE)
#define _JS_CTYPE_BOOL _JS_CTYPE(JSBool, _JS_I32, "","i", INFALLIBLE)
#define _JS_CTYPE_BOOL_RETRY _JS_CTYPE(JSBool, _JS_I32, --, --, FAIL_VOID)
#define _JS_CTYPE_BOOL_FAIL _JS_CTYPE(JSBool, _JS_I32, --, --, FAIL_STATUS)
@ -414,6 +415,9 @@ js_BooleanOrUndefinedToNumber(JSContext* cx, int32 unboxed);
extern JS_FRIEND_API(void)
js_SetTraceableNativeFailed(JSContext *cx);
extern jsdouble FASTCALL
js_dmod(jsdouble a, jsdouble b);
#else
#define JS_DEFINE_CALLINFO_1(linkage, rt, op, at0, cse, fold)
@ -444,6 +448,10 @@ JS_DECLARE_CALLINFO(js_ArrayCompPush)
JS_DECLARE_CALLINFO(js_AllocFlatClosure)
JS_DECLARE_CALLINFO(js_PutArguments)
/* Defined in jsfun.cpp. */
JS_DECLARE_CALLINFO(js_SetCallVar)
JS_DECLARE_CALLINFO(js_SetCallArg)
/* Defined in jsnum.cpp. */
JS_DECLARE_CALLINFO(js_NumberToString)

Просмотреть файл

@ -142,7 +142,7 @@ static JSThread *
NewThread(jsword id)
{
JS_ASSERT(js_CurrentThreadId() == id);
JSThread *thread = (JSThread *) calloc(1, sizeof(JSThread));
JSThread *thread = (JSThread *) js_calloc(sizeof(JSThread));
if (!thread)
return NULL;
JS_INIT_CLIST(&thread->contextList);
@ -158,7 +158,7 @@ DestroyThread(JSThread *thread)
JS_ASSERT(JS_CLIST_IS_EMPTY(&thread->contextList));
JS_ASSERT(!thread->titleToShare);
FinishThreadData(&thread->data);
free(thread);
js_free(thread);
}
JSBool
@ -370,7 +370,7 @@ js_NewContext(JSRuntime *rt, size_t stackChunkSize)
* runtime list. After that it can be accessed from another thread via
* js_ContextIterator.
*/
cx = (JSContext *) calloc(1, sizeof *cx);
cx = (JSContext *) js_calloc(sizeof *cx);
if (!cx)
return NULL;
@ -743,14 +743,14 @@ FreeContext(JSContext *cx)
JS_FinishArenaPool(&cx->tempPool);
if (cx->lastMessage)
free(cx->lastMessage);
js_free(cx->lastMessage);
/* Remove any argument formatters. */
map = cx->argumentFormatMap;
while (map) {
JSArgumentFormatMap *temp = map;
map = map->next;
JS_free(cx, temp);
cx->free(temp);
}
/* Destroy the busy array table. */
@ -769,13 +769,13 @@ FreeContext(JSContext *cx)
if (lrs) {
while ((lrc = lrs->topChunk) != &lrs->firstChunk) {
lrs->topChunk = lrc->down;
JS_free(cx, lrc);
cx->free(lrc);
}
JS_free(cx, lrs);
cx->free(lrs);
}
/* Finally, free cx itself. */
free(cx);
js_free(cx);
}
JSBool
@ -819,7 +819,7 @@ js_NextActiveContext(JSRuntime *rt, JSContext *cx)
return cx;
#else
return js_ContextIterator(rt, JS_FALSE, &iter);
#endif
#endif
}
#ifdef JS_THREADSAFE
@ -1013,7 +1013,7 @@ js_EnterLocalRootScope(JSContext *cx)
lrs = cx->localRootStack;
if (!lrs) {
lrs = (JSLocalRootStack *) JS_malloc(cx, sizeof *lrs);
lrs = (JSLocalRootStack *) cx->malloc(sizeof *lrs);
if (!lrs)
return JS_FALSE;
lrs->scopeMark = JSLRS_NULL_MARK;
@ -1056,7 +1056,7 @@ js_LeaveLocalRootScopeWithResult(JSContext *cx, jsval rval)
lrc = lrs->topChunk;
JS_ASSERT(lrc != &lrs->firstChunk);
lrs->topChunk = lrc->down;
JS_free(cx, lrc);
cx->free(lrc);
--n;
}
@ -1096,10 +1096,10 @@ js_LeaveLocalRootScopeWithResult(JSContext *cx, jsval rval)
*/
if (mark == 0) {
cx->localRootStack = NULL;
JS_free(cx, lrs);
cx->free(lrs);
} else if (m == 0) {
lrs->topChunk = lrc->down;
JS_free(cx, lrc);
cx->free(lrc);
}
}
@ -1158,7 +1158,7 @@ js_ForgetLocalRoot(JSContext *cx, jsval v)
JS_ASSERT(n != 0);
JS_ASSERT(lrc != &lrs->firstChunk);
lrs->topChunk = lrc->down;
JS_free(cx, lrc);
cx->free(lrc);
}
}
@ -1187,7 +1187,7 @@ js_PushLocalRoot(JSContext *cx, JSLocalRootStack *lrs, jsval v)
* After lrs->firstChunk, trying to index at a power-of-two chunk
* boundary: need a new chunk.
*/
lrc = (JSLocalRootChunk *) JS_malloc(cx, sizeof *lrc);
lrc = (JSLocalRootChunk *) cx->malloc(sizeof *lrc);
if (!lrc)
return -1;
lrc->down = lrs->topChunk;
@ -1380,8 +1380,8 @@ js_ReportErrorVA(JSContext *cx, uintN flags, const char *format, va_list ap)
}
ReportError(cx, message, &report);
free(message);
JS_free(cx, ucmessage);
js_free(message);
cx->free(ucmessage);
return warning;
}
@ -1432,7 +1432,7 @@ js_ExpandErrorArguments(JSContext *cx, JSErrorCallback callback,
* pointers later.
*/
reportp->messageArgs = (const jschar **)
JS_malloc(cx, sizeof(jschar *) * (argCount + 1));
cx->malloc(sizeof(jschar *) * (argCount + 1));
if (!reportp->messageArgs)
return JS_FALSE;
reportp->messageArgs[argCount] = NULL;
@ -1476,9 +1476,9 @@ js_ExpandErrorArguments(JSContext *cx, JSErrorCallback callback,
* is used once and only once in the expansion !!!
*/
reportp->ucmessage = out = (jschar *)
JS_malloc(cx, (expandedLength + 1) * sizeof(jschar));
cx->malloc((expandedLength + 1) * sizeof(jschar));
if (!out) {
JS_free (cx, buffer);
cx->free(buffer);
goto error;
}
while (*fmt) {
@ -1498,7 +1498,7 @@ js_ExpandErrorArguments(JSContext *cx, JSErrorCallback callback,
}
JS_ASSERT(expandedArgs == argCount);
*out = 0;
JS_free (cx, buffer);
cx->free(buffer);
*messagep =
js_DeflateString(cx, reportp->ucmessage,
(size_t)(out - reportp->ucmessage));
@ -1527,7 +1527,7 @@ js_ExpandErrorArguments(JSContext *cx, JSErrorCallback callback,
const char *defaultErrorMessage
= "No error message available for error number %d";
size_t nbytes = strlen(defaultErrorMessage) + 16;
*messagep = (char *)JS_malloc(cx, nbytes);
*messagep = (char *)cx->malloc(nbytes);
if (!*messagep)
goto error;
JS_snprintf(*messagep, nbytes, defaultErrorMessage, errorNumber);
@ -1540,17 +1540,17 @@ error:
if (charArgs) {
i = 0;
while (reportp->messageArgs[i])
JS_free(cx, (void *)reportp->messageArgs[i++]);
cx->free((void *)reportp->messageArgs[i++]);
}
JS_free(cx, (void *)reportp->messageArgs);
cx->free((void *)reportp->messageArgs);
reportp->messageArgs = NULL;
}
if (reportp->ucmessage) {
JS_free(cx, (void *)reportp->ucmessage);
cx->free((void *)reportp->ucmessage);
reportp->ucmessage = NULL;
}
if (*messagep) {
JS_free(cx, (void *)*messagep);
cx->free((void *)*messagep);
*messagep = NULL;
}
return JS_FALSE;
@ -1581,7 +1581,7 @@ js_ReportErrorNumberVA(JSContext *cx, uintN flags, JSErrorCallback callback,
ReportError(cx, message, &report);
if (message)
JS_free(cx, message);
cx->free(message);
if (report.messageArgs) {
/*
* js_ExpandErrorArguments owns its messageArgs only if it had to
@ -1590,12 +1590,12 @@ js_ReportErrorNumberVA(JSContext *cx, uintN flags, JSErrorCallback callback,
if (charArgs) {
int i = 0;
while (report.messageArgs[i])
JS_free(cx, (void *)report.messageArgs[i++]);
cx->free((void *)report.messageArgs[i++]);
}
JS_free(cx, (void *)report.messageArgs);
cx->free((void *)report.messageArgs);
}
if (report.ucmessage)
JS_free(cx, (void *)report.ucmessage);
cx->free((void *)report.ucmessage);
return warning;
}
@ -1609,7 +1609,7 @@ js_ReportErrorAgain(JSContext *cx, const char *message, JSErrorReport *reportp)
return;
if (cx->lastMessage)
free(cx->lastMessage);
js_free(cx->lastMessage);
cx->lastMessage = JS_strdup(cx, message);
if (!cx->lastMessage)
return;
@ -1667,7 +1667,7 @@ js_ReportIsNullOrUndefined(JSContext *cx, intN spindex, jsval v,
js_null_str, NULL);
}
JS_free(cx, bytes);
cx->free(bytes);
return ok;
}
@ -1690,7 +1690,7 @@ js_ReportMissingArg(JSContext *cx, jsval *vp, uintN arg)
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
JSMSG_MISSING_FUN_ARG, argbuf,
bytes ? bytes : "");
JS_free(cx, bytes);
cx->free(bytes);
}
JSBool
@ -1709,7 +1709,7 @@ js_ReportValueErrorFlags(JSContext *cx, uintN flags, const uintN errorNumber,
ok = JS_ReportErrorFlagsAndNumber(cx, flags, js_GetErrorMessage,
NULL, errorNumber, bytes, arg1, arg2);
JS_free(cx, bytes);
cx->free(bytes);
return ok;
}
@ -1738,10 +1738,10 @@ JSBool
js_InvokeOperationCallback(JSContext *cx)
{
JS_ASSERT(cx->operationCallbackFlag);
/*
* Reset the callback flag first, then yield. If another thread is racing
* us here we will accumulate another callback request which will be
* us here we will accumulate another callback request which will be
* serviced at the next opportunity.
*/
cx->operationCallbackFlag = 0;
@ -1755,7 +1755,7 @@ js_InvokeOperationCallback(JSContext *cx)
*/
if (cx->runtime->gcIsNeeded)
js_GC(cx, GC_NORMAL);
#ifdef JS_THREADSAFE
#ifdef JS_THREADSAFE
else
JS_YieldRequest(cx);
#endif

Просмотреть файл

@ -57,6 +57,7 @@
#include "jsregexp.h"
#include "jsutil.h"
#include "jsarray.h"
#include "jstask.h"
JS_BEGIN_EXTERN_C
@ -255,6 +256,13 @@ struct JSThreadData {
* locks on each JS_malloc.
*/
size_t gcMallocBytes;
#ifdef JS_THREADSAFE
/*
* Deallocator task for this thread.
*/
JSFreePointerListTask *deallocatorTask;
#endif
};
#ifdef JS_THREADSAFE
@ -391,7 +399,18 @@ struct JSRuntime {
JSPackedBool gcPoke;
JSPackedBool gcRunning;
JSPackedBool gcRegenShapes;
uint8 gcPadding;
/*
* During gc, if rt->gcRegenShapes &&
* (scope->flags & JSScope::SHAPE_REGEN) == rt->gcRegenShapesScopeFlag,
* then the scope's shape has already been regenerated during this GC.
* To avoid having to sweep JSScopes, the bit's meaning toggles with each
* shape-regenerating GC.
*
* FIXME Once scopes are GC'd (bug 505004), this will be obsolete.
*/
uint8 gcRegenShapesScopeFlag;
#ifdef JS_GC_ZEAL
jsrefcount gcZeal;
#endif
@ -688,6 +707,26 @@ struct JSRuntime {
void setGCTriggerFactor(uint32 factor);
void setGCLastBytes(size_t lastBytes);
inline void* malloc(size_t bytes) {
return ::js_malloc(bytes);
}
inline void* calloc(size_t bytes) {
return ::js_calloc(bytes);
}
inline void* realloc(void* p, size_t bytes) {
return ::js_realloc(p, bytes);
}
inline void free(void* p) {
::js_free(p);
}
#ifdef JS_THREADSAFE
JSBackgroundThread *deallocatorThread;
#endif
};
/* Common macros to access thread-local caches in JSThread or JSRuntime. */
@ -1039,16 +1078,86 @@ struct JSContext {
jsval *nativeVp;
#endif
#ifdef JS_THREADSAFE
inline void createDeallocatorTask() {
JSThreadData* tls = JS_THREAD_DATA(this);
JS_ASSERT(!tls->deallocatorTask);
if (runtime->deallocatorThread && !runtime->deallocatorThread->busy())
tls->deallocatorTask = new JSFreePointerListTask();
}
inline void submitDeallocatorTask() {
JSThreadData* tls = JS_THREAD_DATA(this);
if (tls->deallocatorTask) {
runtime->deallocatorThread->schedule(tls->deallocatorTask);
tls->deallocatorTask = NULL;
}
}
#endif
/* Call this after succesful malloc of memory for GC-related things. */
inline void
updateMallocCounter(size_t nbytes)
{
inline void updateMallocCounter(size_t nbytes) {
size_t *pbytes, bytes;
pbytes = &JS_THREAD_DATA(this)->gcMallocBytes;
bytes = *pbytes;
*pbytes = (size_t(-1) - bytes <= nbytes) ? size_t(-1) : bytes + nbytes;
}
inline void* malloc(size_t bytes) {
JS_ASSERT(bytes != 0);
void *p = runtime->malloc(bytes);
if (!p) {
JS_ReportOutOfMemory(this);
return NULL;
}
updateMallocCounter(bytes);
return p;
}
inline void* calloc(size_t bytes) {
JS_ASSERT(bytes != 0);
void *p = runtime->calloc(bytes);
if (!p) {
JS_ReportOutOfMemory(this);
return NULL;
}
updateMallocCounter(bytes);
return p;
}
inline void* realloc(void* p, size_t bytes) {
void *orig = p;
p = runtime->realloc(p, bytes);
if (!p) {
JS_ReportOutOfMemory(this);
return NULL;
}
if (!orig)
updateMallocCounter(bytes);
return p;
}
#ifdef JS_THREADSAFE
inline void free(void* p) {
if (!p)
return;
if (thread) {
JSFreePointerListTask* task = JS_THREAD_DATA(this)->deallocatorTask;
if (task) {
task->add(p);
return;
}
}
runtime->free(p);
}
#else
inline void free(void* p) {
if (!p)
return;
runtime->free(p);
}
#endif
};
#ifdef JS_THREADSAFE

Просмотреть файл

@ -1961,7 +1961,7 @@ date_toSource(JSContext *cx, uintN argc, jsval *vp)
str = JS_NewString(cx, bytes, strlen(bytes));
if (!str) {
free(bytes);
js_free(bytes);
return JS_FALSE;
}
*vp = STRING_TO_JSVAL(str);

Просмотреть файл

@ -124,6 +124,10 @@ typedef uint32 JSIntervalTime;
extern JS_FRIEND_API(JSIntervalTime)
js_IntervalNow();
/* Date constructor native. Exposed only so the JIT can know its address. */
JSBool
js_Date(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval);
JS_END_EXTERN_C
#endif /* jsdate_h___ */

Просмотреть файл

@ -123,7 +123,7 @@ js_UntrapScriptCode(JSContext *cx, JSScript *script)
continue;
nbytes += (sn - notes + 1) * sizeof *sn;
code = (jsbytecode *) JS_malloc(cx, nbytes);
code = (jsbytecode *) cx->malloc(nbytes);
if (!code)
break;
memcpy(code, script->code, nbytes);
@ -155,12 +155,12 @@ JS_SetTrap(JSContext *cx, JSScript *script, jsbytecode *pc,
} else {
sample = rt->debuggerMutations;
DBG_UNLOCK(rt);
trap = (JSTrap *) JS_malloc(cx, sizeof *trap);
trap = (JSTrap *) cx->malloc(sizeof *trap);
if (!trap)
return JS_FALSE;
trap->closure = NULL;
if(!js_AddRoot(cx, &trap->closure, "trap->closure")) {
JS_free(cx, trap);
cx->free(trap);
return JS_FALSE;
}
DBG_LOCK(rt);
@ -184,7 +184,7 @@ JS_SetTrap(JSContext *cx, JSScript *script, jsbytecode *pc,
DBG_UNLOCK(rt);
if (junk) {
js_RemoveRoot(rt, &junk->closure);
JS_free(cx, junk);
cx->free(junk);
}
return JS_TRUE;
}
@ -213,7 +213,7 @@ DestroyTrapAndUnlock(JSContext *cx, JSTrap *trap)
DBG_UNLOCK(cx->runtime);
js_RemoveRoot(cx->runtime, &trap->closure);
JS_free(cx, trap);
cx->free(trap);
}
JS_PUBLIC_API(void)
@ -413,7 +413,7 @@ DropWatchPointAndUnlock(JSContext *cx, JSWatchPoint *wp, uintN flag)
}
}
JS_free(cx, wp);
cx->free(wp);
return ok;
}
@ -434,7 +434,7 @@ js_TraceWatchPoints(JSTracer *trc, JSObject *obj)
&wp->links != &rt->watchPointList;
wp = (JSWatchPoint *)wp->links.next) {
if (wp->object == obj) {
TRACE_SCOPE_PROPERTY(trc, wp->sprop);
wp->sprop->trace(trc);
if ((wp->sprop->attrs & JSPROP_SETTER) && wp->setter) {
JS_CALL_OBJECT_TRACER(trc, js_CastAsObject(wp->setter),
"wp->setter");
@ -619,7 +619,7 @@ js_watch_set(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
if (nslots <= JS_ARRAY_LENGTH(smallv)) {
argv = smallv;
} else {
argv = (jsval *) JS_malloc(cx, nslots * sizeof(jsval));
argv = (jsval *) cx->malloc(nslots * sizeof(jsval));
if (!argv) {
DBG_LOCK(rt);
DropWatchPointAndUnlock(cx, wp, JSWP_HELD);
@ -651,7 +651,7 @@ js_watch_set(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
JSFUN_HEAVYWEIGHT_TEST(fun->flags) &&
!js_GetCallObject(cx, &frame)) {
if (argv != smallv)
JS_free(cx, argv);
cx->free(argv);
DBG_LOCK(rt);
DropWatchPointAndUnlock(cx, wp, JSWP_HELD);
return JS_FALSE;
@ -679,7 +679,7 @@ js_watch_set(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
cx->fp = frame.down;
if (argv != smallv)
JS_free(cx, argv);
cx->free(argv);
}
}
DBG_LOCK(rt);
@ -825,7 +825,7 @@ JS_SetWatchPoint(JSContext *cx, JSObject *obj, jsval idval,
goto out;
}
wp = (JSWatchPoint *) JS_malloc(cx, sizeof *wp);
wp = (JSWatchPoint *) cx->malloc(sizeof *wp);
if (!wp) {
ok = JS_FALSE;
goto out;
@ -1343,7 +1343,7 @@ JS_EvaluateInStackFrame(JSContext *cx, JSStackFrame *fp,
length = (uintN) len;
ok = JS_EvaluateUCInStackFrame(cx, fp, chars, length, filename, lineno,
rval);
JS_free(cx, chars);
cx->free(chars);
return ok;
}
@ -1469,7 +1469,7 @@ JS_GetPropertyDescArray(JSContext *cx, JSObject *obj, JSPropertyDescArray *pda)
}
n = scope->entryCount;
pd = (JSPropertyDesc *) JS_malloc(cx, (size_t)n * sizeof(JSPropertyDesc));
pd = (JSPropertyDesc *) cx->malloc((size_t)n * sizeof(JSPropertyDesc));
if (!pd)
return JS_FALSE;
i = 0;
@ -1511,7 +1511,7 @@ JS_PutPropertyDescArray(JSContext *cx, JSPropertyDescArray *pda)
if (pd[i].flags & JSPD_ALIAS)
js_RemoveRoot(cx->runtime, &pd[i].alias);
}
JS_free(cx, pd);
cx->free(pd);
}
/************************************************************************/
@ -1884,7 +1884,7 @@ js_DumpCallgrind(JSContext *cx, JSObject *obj,
cstr = js_DeflateString(cx, str->chars(), str->length());
if (cstr) {
CALLGRIND_DUMP_STATS_AT(cstr);
JS_free(cx, cstr);
cx->free(cstr);
return JS_TRUE;
}
}
@ -1962,7 +1962,7 @@ js_StartVtune(JSContext *cx, JSObject *obj,
status = VTStartSampling(&params);
if (params.tb5Filename != default_filename)
JS_free(cx, params.tb5Filename);
cx->free(params.tb5Filename);
if (status != 0) {
if (status == VTAPI_MULTIPLE_RUNS)

Просмотреть файл

@ -111,13 +111,13 @@
JS_PUBLIC_API(void *)
JS_DHashAllocTable(JSDHashTable *table, uint32 nbytes)
{
return malloc(nbytes);
return js_malloc(nbytes);
}
JS_PUBLIC_API(void)
JS_DHashFreeTable(JSDHashTable *table, void *ptr)
{
free(ptr);
js_free(ptr);
}
JS_PUBLIC_API(JSDHashNumber)
@ -180,7 +180,7 @@ JS_DHashFreeStringKey(JSDHashTable *table, JSDHashEntryHdr *entry)
{
const JSDHashEntryStub *stub = (const JSDHashEntryStub *)entry;
free((void *) stub->key);
js_free((void *) stub->key);
memset(entry, 0, table->entrySize);
}
@ -212,11 +212,11 @@ JS_NewDHashTable(const JSDHashTableOps *ops, void *data, uint32 entrySize,
{
JSDHashTable *table;
table = (JSDHashTable *) malloc(sizeof *table);
table = (JSDHashTable *) js_malloc(sizeof *table);
if (!table)
return NULL;
if (!JS_DHashTableInit(table, ops, data, entrySize, capacity)) {
free(table);
js_free(table);
return NULL;
}
return table;
@ -226,7 +226,7 @@ JS_PUBLIC_API(void)
JS_DHashTableDestroy(JSDHashTable *table)
{
JS_DHashTableFinish(table);
free(table);
js_free(table);
}
JS_PUBLIC_API(JSBool)

Просмотреть файл

@ -368,7 +368,7 @@ JS_dtobasestr(int base, double dinput)
JS_ASSERT(base >= 2 && base <= 36);
dval(d) = dinput;
buffer = (char*) malloc(DTOBASESTR_BUFFER_SIZE);
buffer = (char*) js_malloc(DTOBASESTR_BUFFER_SIZE);
if (buffer) {
p = buffer;
if (dval(d) < 0.0
@ -412,7 +412,7 @@ JS_dtobasestr(int base, double dinput)
nomem1:
Bfree(b);
UNLOCK_DTOA();
free(buffer);
js_free(buffer);
return NULL;
}
do {
@ -449,7 +449,7 @@ JS_dtobasestr(int base, double dinput)
Bfree(mlo);
Bfree(mhi);
UNLOCK_DTOA();
free(buffer);
js_free(buffer);
return NULL;
}
JS_ASSERT(e < 0);

Просмотреть файл

@ -112,10 +112,10 @@ JSCodeGenerator::~JSCodeGenerator()
/* NB: non-null only after OOM. */
if (spanDeps)
JS_free(compiler->context, spanDeps);
compiler->context->free(spanDeps);
if (upvarMap.vector)
JS_free(compiler->context, upvarMap.vector);
compiler->context->free(upvarMap.vector);
}
static ptrdiff_t
@ -549,7 +549,7 @@ AddSpanDep(JSContext *cx, JSCodeGenerator *cg, jsbytecode *pc, jsbytecode *pc2,
if ((index & (index - 1)) == 0 &&
(!(sdbase = cg->spanDeps) || index >= SPANDEPS_MIN)) {
size = sdbase ? SPANDEPS_SIZE(index) : SPANDEPS_SIZE_MIN / 2;
sdbase = (JSSpanDep *) JS_realloc(cx, sdbase, size + size);
sdbase = (JSSpanDep *) cx->realloc(sdbase, size + size);
if (!sdbase)
return JS_FALSE;
cg->spanDeps = sdbase;
@ -1165,7 +1165,7 @@ OptimizeSpanDeps(JSContext *cx, JSCodeGenerator *cg)
* can span top-level statements, because JS lacks goto.
*/
size = SPANDEPS_SIZE(JS_BIT(JS_CeilingLog2(cg->numSpanDeps)));
JS_free(cx, cg->spanDeps);
cx->free(cg->spanDeps);
cg->spanDeps = NULL;
FreeJumpTargets(cg, cg->jumpTargets);
cg->jumpTargets = NULL;
@ -1899,7 +1899,7 @@ MakeUpvarForEval(JSParseNode *pn, JSCodeGenerator *cg)
JS_ASSERT(ALE_INDEX(ale) <= length);
if (ALE_INDEX(ale) == length) {
length = 2 * JS_MAX(2, length);
vector = (uint32 *) JS_realloc(cx, vector, length * sizeof *vector);
vector = (uint32 *) cx->realloc(vector, length * sizeof *vector);
if (!vector)
return false;
cg->upvarMap.vector = vector;
@ -2197,7 +2197,7 @@ BindNameToSlot(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn)
if (!vector) {
uint32 length = cg->lexdeps.count;
vector = (uint32 *) calloc(length, sizeof *vector);
vector = (uint32 *) js_calloc(length * sizeof *vector);
if (!vector) {
JS_ReportOutOfMemory(cx);
return JS_FALSE;
@ -3144,9 +3144,8 @@ EmitSwitch(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn,
/* Just grab 8K for the worst-case bitmap. */
intmap_bitlen = JS_BIT(16);
intmap = (jsbitmap *)
JS_malloc(cx,
(JS_BIT(16) >> JS_BITS_PER_WORD_LOG2)
* sizeof(jsbitmap));
cx->malloc((JS_BIT(16) >> JS_BITS_PER_WORD_LOG2)
* sizeof(jsbitmap));
if (!intmap) {
JS_ReportOutOfMemory(cx);
return JS_FALSE;
@ -3163,7 +3162,7 @@ EmitSwitch(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn,
release:
if (intmap && intmap != intmap_space)
JS_free(cx, intmap);
cx->free(intmap);
if (!ok)
return JS_FALSE;
@ -3307,7 +3306,7 @@ EmitSwitch(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn,
*/
if (tableLength != 0) {
tableSize = (size_t)tableLength * sizeof *table;
table = (JSParseNode **) JS_malloc(cx, tableSize);
table = (JSParseNode **) cx->malloc(tableSize);
if (!table)
return JS_FALSE;
memset(table, 0, tableSize);
@ -3475,7 +3474,7 @@ EmitSwitch(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn,
out:
if (table)
JS_free(cx, table);
cx->free(table);
if (ok) {
ok = js_PopStatementCG(cx, cg);

Просмотреть файл

@ -164,7 +164,7 @@ CopyErrorReport(JSContext *cx, JSErrorReport *report)
*/
mallocSize = sizeof(JSErrorReport) + argsArraySize + argsCopySize +
ucmessageSize + uclinebufSize + linebufSize + filenameSize;
cursor = (uint8 *)JS_malloc(cx, mallocSize);
cursor = (uint8 *)cx->malloc(mallocSize);
if (!cursor)
return NULL;
@ -301,7 +301,7 @@ InitExnPrivate(JSContext *cx, JSObject *exnObject, JSString *message,
js_ReportAllocationOverflow(cx);
return JS_FALSE;
}
priv = (JSExnPrivate *)JS_malloc(cx, size);
priv = (JSExnPrivate *)cx->malloc(size);
if (!priv)
return JS_FALSE;
@ -417,8 +417,8 @@ exn_finalize(JSContext *cx, JSObject *obj)
priv = GetExnPrivate(cx, obj);
if (priv) {
if (priv->errorReport)
JS_free(cx, priv->errorReport);
JS_free(cx, priv);
cx->free(priv->errorReport);
cx->free(priv);
}
}
@ -586,7 +586,7 @@ StackTraceToString(JSContext *cx, JSExnPrivate *priv)
if (stackmax >= STACK_LENGTH_LIMIT) \
goto done; \
stackmax = stackmax ? 2 * stackmax : 64; \
ptr_ = JS_realloc(cx, stackbuf, (stackmax+1) * sizeof(jschar)); \
ptr_ = cx->realloc(stackbuf, (stackmax+1) * sizeof(jschar)); \
if (!ptr_) \
goto bad; \
stackbuf = (jschar *) ptr_; \
@ -608,7 +608,7 @@ StackTraceToString(JSContext *cx, JSExnPrivate *priv)
goto done; \
} \
stackmax = JS_BIT(JS_CeilingLog2(stacklen + length_)); \
ptr_ = JS_realloc(cx, stackbuf, (stackmax+1) * sizeof(jschar)); \
ptr_ = cx->realloc(stackbuf, (stackmax+1) * sizeof(jschar)); \
if (!ptr_) \
goto bad; \
stackbuf = (jschar *) ptr_; \
@ -659,7 +659,7 @@ StackTraceToString(JSContext *cx, JSExnPrivate *priv)
* don't use JS_realloc here; simply let the oversized allocation
* be owned by the string in that rare case.
*/
void *shrunk = JS_realloc(cx, stackbuf, (stacklen+1) * sizeof(jschar));
void *shrunk = cx->realloc(stackbuf, (stacklen+1) * sizeof(jschar));
if (shrunk)
stackbuf = (jschar *) shrunk;
}
@ -671,7 +671,7 @@ StackTraceToString(JSContext *cx, JSExnPrivate *priv)
bad:
if (stackbuf)
JS_free(cx, stackbuf);
cx->free(stackbuf);
return NULL;
}
@ -800,7 +800,7 @@ exn_toString(JSContext *cx, uintN argc, jsval *vp)
name_length = name->length();
message_length = message->length();
length = (name_length ? name_length + 2 : 0) + message_length;
cp = chars = (jschar *) JS_malloc(cx, (length + 1) * sizeof(jschar));
cp = chars = (jschar *) cx->malloc((length + 1) * sizeof(jschar));
if (!chars)
return JS_FALSE;
@ -815,7 +815,7 @@ exn_toString(JSContext *cx, uintN argc, jsval *vp)
result = js_NewString(cx, chars, length);
if (!result) {
JS_free(cx, chars);
cx->free(chars);
return JS_FALSE;
}
} else {
@ -915,7 +915,7 @@ exn_toSource(JSContext *cx, uintN argc, jsval *vp)
}
}
cp = chars = (jschar *) JS_malloc(cx, (length + 1) * sizeof(jschar));
cp = chars = (jschar *) cx->malloc((length + 1) * sizeof(jschar));
if (!chars) {
ok = JS_FALSE;
goto out;
@ -955,7 +955,7 @@ exn_toSource(JSContext *cx, uintN argc, jsval *vp)
result = js_NewString(cx, chars, length);
if (!result) {
JS_free(cx, chars);
cx->free(chars);
ok = JS_FALSE;
goto out;
}

Просмотреть файл

@ -296,7 +296,7 @@ static char*
js_combinePath(JSContext *cx, const char *base, const char *name)
{
int len = strlen(base);
char* result = JS_malloc(cx, len + strlen(name) + 2);
char* result = cx->malloc(len + strlen(name) + 2);
if (!result)
return NULL;
@ -335,7 +335,7 @@ js_fileBaseName(JSContext *cx, const char *pathname)
}
/* Allocate and copy. */
result = JS_malloc(cx, aux - index + 1);
result = cx->malloc(aux - index + 1);
if (!result)
return NULL;
strncpy(result, pathname + index + 1, aux - index);
@ -366,7 +366,7 @@ js_fileDirectoryName(JSContext *cx, const char *pathname)
if (cp < pathname && end != pathname) {
/* There were just /s, return the root. */
result = JS_malloc(cx, 1 + 1); /* The separator + trailing NUL. */
result = cx->malloc(1 + 1); /* The separator + trailing NUL. */
result[0] = FILESEPARATOR;
result[1] = '\0';
return result;
@ -388,7 +388,7 @@ js_fileDirectoryName(JSContext *cx, const char *pathname)
}
pathsize = end - pathname + 1;
result = JS_malloc(cx, pathsize + 1);
result = cx->malloc(pathsize + 1);
if (!result)
return NULL;
@ -401,7 +401,7 @@ js_fileDirectoryName(JSContext *cx, const char *pathname)
/* Return everything up to and including the seperator. */
pathsize = cp - pathname + 1;
result = JS_malloc(cx, pathsize + 1);
result = cx->malloc(pathsize + 1);
if (!result)
return NULL;
@ -462,7 +462,7 @@ js_canonicalPath(JSContext *cx, char *oldpath)
while (j >= 0 && path[j] == ' ')
j--;
tmp = JS_malloc(cx, j-i+2);
tmp = cx->malloc(j-i+2);
if (!tmp)
return NULL;
@ -478,7 +478,7 @@ js_canonicalPath(JSContext *cx, char *oldpath)
/* file:// support. */
if (!strncmp(path, URL_PREFIX, strlen(URL_PREFIX))) {
tmp = js_canonicalPath(cx, path + strlen(URL_PREFIX));
JS_free(cx, path);
cx->free(path);
return tmp;
}
@ -486,7 +486,7 @@ js_canonicalPath(JSContext *cx, char *oldpath)
tmp = js_absolutePath(cx, path);
if (!tmp)
return NULL;
JS_free(cx, path);
cx->free(path);
path = tmp;
}
@ -505,7 +505,7 @@ js_canonicalPath(JSContext *cx, char *oldpath)
back--;
} else {
tmp = result;
result = JS_malloc(cx, strlen(base) + 1 + strlen(tmp) + 1);
result = cx->malloc(strlen(base) + 1 + strlen(tmp) + 1);
if (!result)
goto out;
@ -516,18 +516,18 @@ js_canonicalPath(JSContext *cx, char *oldpath)
result[c + 1] = '\0';
strcat(result, tmp);
}
JS_free(cx, tmp);
cx->free(tmp);
}
}
JS_free(cx, current);
JS_free(cx, base);
cx->free(current);
cx->free(base);
current = dir;
base = js_fileBaseName(cx, current);
dir = js_fileDirectoryName(cx, current);
}
tmp = result;
result = JS_malloc(cx, strlen(dir)+1+strlen(tmp)+1);
result = cx->malloc(strlen(dir) + 1 + strlen(tmp) + 1);
if (!result)
goto out;
@ -543,13 +543,13 @@ js_canonicalPath(JSContext *cx, char *oldpath)
out:
if (tmp)
JS_free(cx, tmp);
cx->free(tmp);
if (dir)
JS_free(cx, dir);
cx->free(dir);
if (base)
JS_free(cx, base);
cx->free(base);
if (current)
JS_free(cx, current);
cx->free(current);
return result;
}
@ -753,7 +753,7 @@ js_FileHasOption(JSContext *cx, const char *oldoptions, const char *name)
break;
current = comma + 1;
}
JS_free(cx, options);
cx->free(options);
return found;
}
@ -838,20 +838,20 @@ js_FileRead(JSContext *cx, JSFile *file, jschar *buf, int32 len, int32 mode)
switch (mode) {
case ASCII:
aux = (unsigned char*)JS_malloc(cx, len);
aux = (unsigned char*)cx->malloc(len);
if (!aux)
return 0;
count = js_BufferedRead(file, aux, len);
if (count == -1) {
JS_free(cx, aux);
cx->free(aux);
return 0;
}
for (i = 0; i < len; i++)
buf[i] = (jschar)aux[i];
JS_free(cx, aux);
cx->free(aux);
break;
case UTF8:
@ -977,7 +977,7 @@ js_FileWrite(JSContext *cx, JSFile *file, jschar *buf, int32 len, int32 mode)
switch (mode) {
case ASCII:
aux = (unsigned char*)JS_malloc(cx, len);
aux = (unsigned char*)cx->malloc(len);
if (!aux)
return 0;
@ -989,21 +989,21 @@ js_FileWrite(JSContext *cx, JSFile *file, jschar *buf, int32 len, int32 mode)
: fwrite(aux, 1, len, file->nativehandle);
if (count==-1) {
JS_free(cx, aux);
cx->free(aux);
return 0;
}
JS_free(cx, aux);
cx->free(aux);
break;
case UTF8:
utfbuf = (unsigned char*)JS_malloc(cx, len*3);
utfbuf = (unsigned char*)cx->malloc(len*3);
if (!utfbuf) return 0;
i = 0;
for (count = 0;count<len;count++) {
j = one_ucs2_to_utf8_char(utfbuf+i, utfbuf+len*3, buf[count]);
if (j==-1) {
JS_free(cx, utfbuf);
cx->free(utfbuf);
return 0;
}
i+=j;
@ -1013,10 +1013,10 @@ js_FileWrite(JSContext *cx, JSFile *file, jschar *buf, int32 len, int32 mode)
: fwrite(utfbuf, 1, i, file->nativehandle);
if (j<i) {
JS_free(cx, utfbuf);
cx->free(utfbuf);
return 0;
}
JS_free(cx, utfbuf);
cx->free(utfbuf);
break;
case UCS2:
@ -1179,13 +1179,13 @@ js_parent(JSContext *cx, JSFile *file, jsval *resultp)
} else {
JSObject *obj = js_NewFileObject(cx, str);
if (!obj) {
JS_free(cx, str);
cx->free(str);
return JS_FALSE;
}
*resultp = OBJECT_TO_JSVAL(obj);
}
JS_free(cx, str);
cx->free(str);
return JS_TRUE;
}
@ -1206,7 +1206,7 @@ js_name(JSContext *cx, JSFile *file, jsval *vp)
str = JS_NewString(cx, name, strlen(name));
if (!str) {
JS_free(cx, name);
cx->free(name);
return JS_FALSE;
}
@ -1353,7 +1353,7 @@ file_open(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
pipemode[i++] = '\0';
file->nativehandle = POPEN(&file->path[1], pipemode);
} else if(file->path[len-1] == PIPE_SYMBOL) {
char *command = JS_malloc(cx, len);
char *command = cx->malloc(len);
strncpy(command, file->path, len-1);
command[len-1] = '\0';
@ -1364,7 +1364,7 @@ file_open(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
#endif
pipemode[i++] = '\0';
file->nativehandle = POPEN(command, pipemode);
JS_free(cx, command);
cx->free(command);
}
/* set the flags */
file->isNative = JS_TRUE;
@ -1377,7 +1377,7 @@ file_open(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
}
js_ResetBuffers(file);
JS_free(cx, mode);
cx->free(mode);
mode = NULL;
/* Set the open flag and return result */
@ -1396,7 +1396,7 @@ good:
out:
if(mode)
JS_free(cx, mode);
cx->free(mode);
return JS_FALSE;
}
@ -1511,13 +1511,13 @@ file_copyTo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
goto out;
}
buffer = JS_malloc(cx, size);
buffer = cx->malloc(size);
count = INT_TO_JSVAL(PR_Read(file->handle, buffer, size));
/* reading panic */
if (count!=size) {
JS_free(cx, buffer);
cx->free(buffer);
JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL,
JSFILEMSG_COPY_READ_ERROR, file->path);
goto out;
@ -1527,13 +1527,13 @@ file_copyTo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
/* writing panic */
if (count!=size) {
JS_free(cx, buffer);
cx->free(buffer);
JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL,
JSFILEMSG_COPY_WRITE_ERROR, file->path);
goto out;
}
JS_free(cx, buffer);
cx->free(buffer);
if(!fileInitiallyOpen){
if(!file_close(cx, obj, 0, NULL, rval)) goto out;
@ -1577,7 +1577,7 @@ file_renameTo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
if (PR_Rename(file->path, dest)==PR_SUCCESS){
/* copy the new filename */
JS_free(cx, file->path);
cx->free(file->path);
file->path = dest;
*rval = JSVAL_TRUE;
return JS_TRUE;
@ -1729,17 +1729,17 @@ file_read(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
/* want = (want>262144)?262144:want; * arbitrary size limitation */
buf = JS_malloc(cx, want*sizeof buf[0]);
buf = cx->malloc(want*sizeof buf[0]);
if (!buf) goto out;
count = js_FileRead(cx, file, buf, want, file->type);
if (count>0) {
str = JS_NewUCStringCopyN(cx, buf, count);
*rval = STRING_TO_JSVAL(str);
JS_free(cx, buf);
cx->free(buf);
return JS_TRUE;
} else {
JS_free(cx, buf);
cx->free(buf);
goto out;
}
out:
@ -1760,7 +1760,7 @@ file_readln(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
SECURITY_CHECK(cx, NULL, "readln", file);
JSFILE_CHECK_READ;
buf = JS_malloc(cx, MAX_LINE_LENGTH * sizeof data);
buf = cx->malloc(MAX_LINE_LENGTH * sizeof data);
if (!buf)
return JS_FALSE;
@ -1792,8 +1792,7 @@ file_readln(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
default:
if (--room < 0) {
tmp = JS_realloc(cx, buf,
(offset + MAX_LINE_LENGTH) * sizeof data);
tmp = cx->realloc(buf, (offset + MAX_LINE_LENGTH) * sizeof data);
if (!tmp)
goto out;
@ -1814,7 +1813,7 @@ eof:
done:
buf[offset] = 0;
tmp = JS_realloc(cx, buf, (offset + 1) * sizeof data);
tmp = cx->realloc(buf, (offset + 1) * sizeof data);
if (!tmp)
goto out;
@ -1827,7 +1826,7 @@ done:
out:
if (buf)
JS_free(cx, buf);
cx->free(buf);
return JS_FALSE;
}
@ -1980,7 +1979,7 @@ file_list(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
filePath = js_combinePath(cx, file->path, (char*)entry->name);
eachFile = js_NewFileObject(cx, filePath);
JS_free(cx, filePath);
cx->free(filePath);
if (!eachFile){
JS_ReportWarning(cx, "File %s cannot be retrieved", filePath);
continue;
@ -2017,7 +2016,7 @@ file_mkdir(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
char *dir = js_fileDirectoryName(cx, file->path);
JSObject *dirObj = js_NewFileObject(cx, dir);
JS_free(cx, dir);
cx->free(dir);
/* call file_mkdir with the right set of parameters if needed */
if (file_mkdir(cx, dirObj, argc, argv, rval))
@ -2031,12 +2030,12 @@ file_mkdir(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
fullName = js_combinePath(cx, file->path, dirName);
if (PR_MkDir(fullName, 0755)==PR_SUCCESS){
*rval = JSVAL_TRUE;
JS_free(cx, fullName);
cx->free(fullName);
return JS_TRUE;
}else{
JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL,
JSFILEMSG_OP_FAILED, "mkdir", fullName);
JS_free(cx, fullName);
cx->free(fullName);
goto out;
}
}
@ -2077,7 +2076,7 @@ file_toURL(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
return JS_FALSE;
str = js_NewString(cx, urlChars, len);
if (!str) {
JS_free(cx, urlChars);
cx->free(urlChars);
return JS_FALSE;
}
*rval = STRING_TO_JSVAL(str);
@ -2104,9 +2103,9 @@ file_finalize(JSContext *cx, JSObject *obj)
}
if (file->path)
JS_free(cx, file->path);
cx->free(file->path);
JS_free(cx, file);
cx->free(file);
}
}
@ -2118,7 +2117,7 @@ file_init(JSContext *cx, JSObject *obj, char *bytes)
{
JSFile *file;
file = JS_malloc(cx, sizeof *file);
file = cx->malloc(sizeof *file);
if (!file)
return NULL;
memset(file, 0 , sizeof *file);
@ -2130,7 +2129,7 @@ file_init(JSContext *cx, JSObject *obj, char *bytes)
if (!JS_SetPrivate(cx, obj, file)) {
JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL,
JSFILEMSG_CANNOT_SET_PRIVATE_FILE, file->path);
JS_free(cx, file);
cx->free(file);
return NULL;
}
@ -2176,7 +2175,7 @@ js_NewFileObjectFromFILE(JSContext *cx, FILE *nativehandle, char *filename,
/* free result of RESOLVE_PATH from file_init. */
JS_ASSERT(file->path != NULL);
JS_free(cx, file->path);
cx->free(file->path);
file->path = strdup(filename);
file->isOpen = open;
@ -2399,7 +2398,7 @@ file_getProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
case FILE_MODE:
SECURITY_CHECK(cx, NULL, "mode", file);
JSFILE_CHECK_OPEN("mode");
bytes = JS_malloc(cx, MODE_SIZE);
bytes = cx->malloc(MODE_SIZE);
bytes[0] = '\0';
flag = JS_FALSE;
@ -2439,7 +2438,7 @@ file_getProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
flag = JS_TRUE;
}
*vp = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, bytes));
JS_free(cx, bytes);
cx->free(bytes);
break;
case FILE_CREATED:
SECURITY_CHECK(cx, NULL, "creationTime", file);
@ -2575,7 +2574,7 @@ file_getProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
bytes = js_combinePath(cx, file->path, prop_name);
*vp = OBJECT_TO_JSVAL(js_NewFileObject(cx, bytes));
PR_CloseDir(dir);
JS_free(cx, bytes);
cx->free(bytes);
return !JSVAL_IS_NULL(*vp);
}
}
@ -2717,10 +2716,10 @@ js_InitFileClass(JSContext *cx, JSObject* obj)
/* Define CURRENTDIR property. We are doing this to get a
slash at the end of the current dir */
afile = js_NewFileObject(cx, CURRENT_DIR);
currentdir = JS_malloc(cx, MAX_PATH_LENGTH);
currentdir = getcwd(currentdir, MAX_PATH_LENGTH);
currentdir = cx->malloc(MAX_PATH_LENGTH);
currentdir = getcwd(currentdir, MAX_PATH_LENGTH);
afile = js_NewFileObject(cx, currentdir);
JS_free(cx, currentdir);
cx->free(currentdir);
vp = OBJECT_TO_JSVAL(afile);
JS_DefinePropertyWithTinyId(cx, ctor, CURRENTDIR_PROPERTY, 0, vp,
JS_PropertyStub, file_currentDirSetter,

Просмотреть файл

@ -136,7 +136,7 @@ MarkArgDeleted(JSContext *cx, JSStackFrame *fp, uintN slot)
bitmap = (jsbitmap *) &bmapint;
} else {
nbytes = JS_HOWMANY(nbits, JS_BITS_PER_WORD) * sizeof(jsbitmap);
bitmap = (jsbitmap *) JS_malloc(cx, nbytes);
bitmap = (jsbitmap *) cx->malloc(nbytes);
if (!bitmap)
return JS_FALSE;
memset(bitmap, 0, nbytes);
@ -311,7 +311,7 @@ js_PutArgsObject(JSContext *cx, JSStackFrame *fp)
if (!JSVAL_IS_VOID(bmapval)) {
JS_SetReservedSlot(cx, argsobj, 0, JSVAL_VOID);
if (fp->argc > JSVAL_INT_BITS)
JS_free(cx, JSVAL_TO_PRIVATE(bmapval));
cx->free(JSVAL_TO_PRIVATE(bmapval));
}
/*
@ -1133,7 +1133,7 @@ js_GetCallArg(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
return CallPropertyOp(cx, obj, id, vp, JSCPK_ARG, JS_FALSE);
}
static JSBool
JSBool
SetCallArg(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
{
return CallPropertyOp(cx, obj, id, vp, JSCPK_ARG, JS_TRUE);
@ -1154,12 +1154,27 @@ js_GetCallVarChecked(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
return CheckForEscapingClosure(cx, obj, vp);
}
static JSBool
JSBool
SetCallVar(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
{
return CallPropertyOp(cx, obj, id, vp, JSCPK_VAR, JS_TRUE);
}
JSBool JS_FASTCALL
js_SetCallArg(JSContext *cx, JSObject *obj, jsid id, jsval v)
{
return CallPropertyOp(cx, obj, id, &v, JSCPK_ARG, JS_TRUE);
}
JSBool JS_FASTCALL
js_SetCallVar(JSContext *cx, JSObject *obj, jsid id, jsval v)
{
return CallPropertyOp(cx, obj, id, &v, JSCPK_VAR, JS_TRUE);
}
JS_DEFINE_CALLINFO_4(extern, BOOL, js_SetCallArg, CONTEXT, OBJECT, JSID, JSVAL, 0, 0)
JS_DEFINE_CALLINFO_4(extern, BOOL, js_SetCallVar, CONTEXT, OBJECT, JSID, JSVAL, 0, 0)
static JSBool
call_resolve(JSContext *cx, JSObject *obj, jsval idval, uintN flags,
JSObject **objp)
@ -2743,10 +2758,10 @@ FreeLocalNameHash(JSContext *cx, JSLocalNameMap *map)
for (dup = map->lastdup; dup; dup = next) {
next = dup->link;
JS_free(cx, dup);
cx->free(dup);
}
JS_DHashTableFinish(&map->names);
JS_free(cx, map);
cx->free(map);
}
static JSBool
@ -2774,7 +2789,7 @@ HashLocalName(JSContext *cx, JSLocalNameMap *map, JSAtom *name,
if (entry->name) {
JS_ASSERT(entry->name == name);
JS_ASSERT(entry->localKind == JSLOCAL_ARG);
dup = (JSNameIndexPair *) JS_malloc(cx, sizeof *dup);
dup = (JSNameIndexPair *) cx->malloc(sizeof *dup);
if (!dup)
return JS_FALSE;
dup->name = entry->name;
@ -2820,7 +2835,7 @@ js_AddLocal(JSContext *cx, JSFunction *fun, JSAtom *atom, JSLocalKind kind)
if (n > 1) {
array = fun->u.i.names.array;
} else {
array = (jsuword *) JS_malloc(cx, MAX_ARRAY_LOCALS * sizeof *array);
array = (jsuword *) cx->malloc(MAX_ARRAY_LOCALS * sizeof *array);
if (!array)
return JS_FALSE;
array[0] = fun->u.i.names.taggedAtom;
@ -2845,7 +2860,7 @@ js_AddLocal(JSContext *cx, JSFunction *fun, JSAtom *atom, JSLocalKind kind)
}
} else if (n == MAX_ARRAY_LOCALS) {
array = fun->u.i.names.array;
map = (JSLocalNameMap *) JS_malloc(cx, sizeof *map);
map = (JSLocalNameMap *) cx->malloc(sizeof *map);
if (!map)
return JS_FALSE;
if (!JS_DHashTableInit(&map->names, JS_DHashGetStubOps(),
@ -2853,7 +2868,7 @@ js_AddLocal(JSContext *cx, JSFunction *fun, JSAtom *atom, JSLocalKind kind)
JS_DHASH_DEFAULT_CAPACITY(MAX_ARRAY_LOCALS
* 2))) {
JS_ReportOutOfMemory(cx);
JS_free(cx, map);
cx->free(map);
return JS_FALSE;
}
@ -2886,7 +2901,7 @@ js_AddLocal(JSContext *cx, JSFunction *fun, JSAtom *atom, JSLocalKind kind)
* to replace fun->u.i.names with the built map.
*/
fun->u.i.names.map = map;
JS_free(cx, array);
cx->free(array);
} else {
if (*indexp == JS_BITMASK(16)) {
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
@ -3108,7 +3123,7 @@ DestroyLocalNames(JSContext *cx, JSFunction *fun)
if (n <= 1)
return;
if (n <= MAX_ARRAY_LOCALS)
JS_free(cx, fun->u.i.names.array);
cx->free(fun->u.i.names.array);
else
FreeLocalNameHash(cx, fun->u.i.names.map);
}
@ -3124,8 +3139,8 @@ js_FreezeLocalNames(JSContext *cx, JSFunction *fun)
n = fun->nargs + fun->u.i.nvars + fun->u.i.nupvars;
if (2 <= n && n < MAX_ARRAY_LOCALS) {
/* Shrink over-allocated array ignoring realloc failures. */
array = (jsuword *) JS_realloc(cx, fun->u.i.names.array,
n * sizeof *array);
array = (jsuword *) cx->realloc(fun->u.i.names.array,
n * sizeof *array);
if (array)
fun->u.i.names.array = array;
}

Просмотреть файл

@ -280,7 +280,25 @@ extern JSBool
js_GetCallArg(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
extern JSBool
js_GetCallVar(JSContext *cx, JSObject *obj, jsval id, jsval *vp);
js_GetCallVar(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
extern JSBool
SetCallArg(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
extern JSBool
SetCallVar(JSContext *cx, JSObject *obj, jsid id, jsval *vp);
/*
* js_SetCallArg and js_SetCallVar are extern fastcall copies of the setter
* functions. These versions are required in order to set call vars from traces.
* The normal versions must not be fastcall because they are stored in the
* property ops map.
*/
extern JSBool JS_FASTCALL
js_SetCallArg(JSContext *cx, JSObject *obj, jsid id, jsval v);
extern JSBool JS_FASTCALL
js_SetCallVar(JSContext *cx, JSObject *obj, jsid id, jsval v);
/*
* Slower version of js_GetCallVar used when call_resolve detects an attempt to

Просмотреть файл

@ -76,6 +76,7 @@
#include "jsscript.h"
#include "jsstaticcheck.h"
#include "jsstr.h"
#include "jstask.h"
#include "jstracer.h"
#if JS_HAS_XML_SUPPORT
@ -722,7 +723,7 @@ FreePtrTable(JSPtrTable *table, const JSPtrTableInfo *info)
{
if (table->array) {
JS_ASSERT(table->count > 0);
free(table->array);
js_free(table->array);
table->array = NULL;
table->count = 0;
}
@ -756,8 +757,8 @@ AddToPtrTable(JSContext *cx, JSPtrTable *table, const JSPtrTableInfo *info,
if (capacity > (size_t)-1 / sizeof table->array[0])
goto bad;
}
array = (void **) realloc(table->array,
capacity * sizeof table->array[0]);
array = (void **) js_realloc(table->array,
capacity * sizeof table->array[0]);
if (!array)
goto bad;
#ifdef DEBUG
@ -796,11 +797,11 @@ ShrinkPtrTable(JSPtrTable *table, const JSPtrTableInfo *info,
array = table->array;
JS_ASSERT(array);
if (capacity == 0) {
free(array);
js_free(array);
table->array = NULL;
return;
}
array = (void **) realloc(array, capacity * sizeof array[0]);
array = (void **) js_realloc(array, capacity * sizeof array[0]);
if (array)
table->array = array;
}
@ -881,7 +882,7 @@ NewGCChunk(void)
*
* bytes to ensure that we always have room to store the gap.
*/
p = malloc((js_gcArenasPerChunk + 1) << GC_ARENA_SHIFT);
p = js_malloc((js_gcArenasPerChunk + 1) << GC_ARENA_SHIFT);
if (!p)
return 0;
@ -913,11 +914,11 @@ DestroyGCChunk(jsuword chunk)
#endif
#if HAS_POSIX_MEMALIGN
free((void *) chunk);
js_free((void *) chunk);
#else
/* See comments in NewGCChunk. */
JS_ASSERT(*GetMallocedChunkGapPtr(chunk) < GC_ARENA_SIZE);
free((void *) (chunk - *GetMallocedChunkGapPtr(chunk)));
js_free((void *) (chunk - *GetMallocedChunkGapPtr(chunk)));
#endif
}
@ -3042,7 +3043,7 @@ js_TraceContext(JSTracer *trc, JSContext *acx)
tvr->u.trace(trc, tvr);
break;
case JSTVU_SPROP:
TRACE_SCOPE_PROPERTY(trc, tvr->u.sprop);
tvr->u.sprop->trace(trc);
break;
case JSTVU_WEAK_ROOTS:
TraceWeakRoots(trc, tvr->u.weakRoots);
@ -3270,7 +3271,10 @@ js_FinalizeStringRT(JSRuntime *rt, JSString *str, intN type, JSContext *cx)
JS_ASSERT(type < 0);
rt->unitStrings[*chars] = NULL;
} else if (type < 0) {
free(chars);
if (cx)
cx->free(chars);
else
rt->free(chars);
} else {
JS_ASSERT((uintN) type < JS_ARRAY_LENGTH(str_finalizers));
finalizer = str_finalizers[type];
@ -3519,6 +3523,7 @@ js_GC(JSContext *cx, JSGCInvocationKind gckind)
*/
if (rt->shapeGen & SHAPE_OVERFLOW_BIT) {
rt->gcRegenShapes = true;
rt->gcRegenShapesScopeFlag ^= JSScope::SHAPE_REGEN;
rt->shapeGen = 0;
rt->protoHazardShape = 0;
}
@ -3555,6 +3560,10 @@ js_GC(JSContext *cx, JSGCInvocationKind gckind)
rt->gcMarkingTracer = NULL;
#ifdef JS_THREADSAFE
cx->createDeallocatorTask();
#endif
/*
* Sweep phase.
*
@ -3733,6 +3742,10 @@ js_GC(JSContext *cx, JSGCInvocationKind gckind)
*/
DestroyGCArenas(rt, emptyArenas);
#ifdef JS_THREADSAFE
cx->submitDeallocatorTask();
#endif
if (rt->gcCallback)
(void) rt->gcCallback(cx, JSGC_FINALIZE_END);
#ifdef DEBUG_srcnotesize

Просмотреть файл

@ -47,6 +47,7 @@
#include "jsdhash.h"
#include "jsbit.h"
#include "jsutil.h"
#include "jstask.h"
JS_BEGIN_EXTERN_C
@ -341,6 +342,28 @@ js_AddAsGCBytes(JSContext *cx, size_t sz);
extern void
js_RemoveAsGCBytes(JSRuntime* rt, size_t sz);
#ifdef JS_THREADSAFE
class JSFreePointerListTask : public JSBackgroundTask {
void *head;
public:
JSFreePointerListTask() : head(NULL) {}
void add(void* ptr) {
*(void**)ptr = head;
head = ptr;
}
void run() {
void *ptr = head;
while (ptr) {
void *next = *(void **)ptr;
js_free(ptr);
ptr = next;
}
}
};
#endif
/*
* Free the chars held by str when it is finalized by the GC. When type is
* less then zero, it denotes an internal string. Otherwise it denotes the

Просмотреть файл

@ -73,7 +73,7 @@ DefaultAllocTable(void *pool, size_t size)
static void
DefaultFreeTable(void *pool, void *item, size_t size)
{
free(item);
js_free(item);
}
static JSHashEntry *
@ -86,7 +86,7 @@ static void
DefaultFreeEntry(void *pool, JSHashEntry *he, uintN flag)
{
if (flag == HT_FREE_ENTRY)
free(he);
js_free(he);
}
static JSHashAllocOps defaultHashAllocOps = {

Просмотреть файл

@ -1534,7 +1534,7 @@ js_Execute(JSContext *cx, JSObject *chain, JSScript *script,
js_LeaveTrace(cx);
#ifdef JS_TRACER
/*
/*
* The JIT requires that the scope chain here is equal to its global
* object. Disable the JIT for this call if this condition is not true.
*/
@ -2095,7 +2095,7 @@ js_GetUpvar(JSContext *cx, uintN level, uintN cookie)
} else if (slot == CALLEE_UPVAR_SLOT) {
vp = &fp->argv[-2];
slot = 0;
} else {
} else {
slot -= fp->fun->nargs;
JS_ASSERT(slot < fp->script->nslots);
vp = fp->slots;
@ -2132,7 +2132,7 @@ js_TraceOpcode(JSContext *cx)
fp->script, cx->tracePrevPc);
/*
* If there aren't that many elements on the stack, then
* If there aren't that many elements on the stack, then
* we have probably entered a new frame, and printing output
* would just be misleading.
*/
@ -2145,7 +2145,7 @@ js_TraceOpcode(JSContext *cx)
fprintf(tracefp, "%s %s",
(n == -ndefs) ? " output:" : ",",
bytes);
JS_free(cx, bytes);
cx->free(bytes);
}
}
fprintf(tracefp, " @ %u\n", (uintN) (regs->sp - StackBase(fp)));
@ -2177,7 +2177,7 @@ js_TraceOpcode(JSContext *cx)
fprintf(tracefp, "%s %s",
(n == -nuses) ? " inputs:" : ",",
bytes);
JS_free(cx, bytes);
cx->free(bytes);
}
}
fprintf(tracefp, " @ %u\n", (uintN) (regs->sp - StackBase(fp)));
@ -2264,7 +2264,7 @@ js_DumpOpMeters()
# define SIGNIFICANT(count,total) (200. * (count) >= (total))
graph = (Edge *) calloc(nedges, sizeof graph[0]);
graph = (Edge *) js_calloc(nedges * sizeof graph[0]);
for (i = nedges = 0; i < JSOP_LIMIT; i++) {
from = js_CodeName[i];
for (j = 0; j < JSOP_LIMIT; j++) {
@ -2293,7 +2293,7 @@ js_DumpOpMeters()
graph[i].from, graph[i].to,
(unsigned long)graph[i].count, style);
}
free(graph);
js_free(graph);
fputs("}\n", fp);
fclose(fp);
@ -2717,7 +2717,7 @@ js_Interpret(JSContext *cx)
* 'op=x; DO_OP()' to let another opcode's implementation finish
* their work, and many opcodes share entry points with a run of
* consecutive BEGIN_CASEs.
*
*
* Take care to trace OP only when it is the opcode fetched from
* the instruction stream, so the trace matches what one would
* expect from looking at the code. (We do omit POPs after SETs;
@ -4802,7 +4802,6 @@ js_Interpret(JSContext *cx)
}
JS_UNLOCK_SCOPE(cx, scope);
PCMETER(cache->setpcmisses++);
atom = NULL;
}
}

Просмотреть файл

@ -90,7 +90,7 @@ struct JSStackFrame {
* variables on the stack initially, note when they are closed
* over, and copy those that are out to the heap when we leave
* their dynamic scope.
*
*
* The bytecode compiler produces a tree of block objects
* accompanying each JSScript representing those lexical blocks in
* the script that have let-bound variables associated with them.
@ -102,7 +102,7 @@ struct JSStackFrame {
* When we are in the static scope of such a block, blockChain
* points to its compiler-allocated block object; otherwise, it is
* NULL.
*
*
* scopeChain is the current scope chain, including 'call' and
* 'block' objects for those function calls and lexical blocks
* whose static scope we are currently executing in, and 'with'
@ -158,7 +158,7 @@ static JS_INLINE uintN
GlobalVarCount(JSStackFrame *fp)
{
uintN n;
JS_ASSERT(!fp->fun);
n = fp->script->nfixed;
if (fp->script->regexpsOffset != 0)
@ -243,6 +243,10 @@ struct JSPropCacheEntry {
jsuword kshape; /* key shape if pc, else obj for atom */
jsuword vcap; /* value capability, see above */
jsuword vword; /* value word, see PCVAL_* below */
bool adding() const {
return PCVCAP_TAG(vcap) == 0 && kshape != PCVCAP_SHAPE(vcap);
}
};
/*

Просмотреть файл

@ -43,7 +43,7 @@
* Types:
* JSInt<N>, JSUint<N> (for <N> = 8, 16, 32, and 64)
* JSIntPtr, JSUIntPtr
*
*
* JSInt<N> and JSUint<N> are signed and unsigned types known to be
* <N> bits long. Note that neither JSInt8 nor JSUInt8 is necessarily
* equivalent to a plain "char".

Просмотреть файл

@ -649,7 +649,7 @@ generator_finalize(JSContext *cx, JSObject *obj)
*/
JS_ASSERT(gen->state == JSGEN_NEWBORN || gen->state == JSGEN_CLOSED ||
gen->state == JSGEN_OPEN);
JS_free(cx, gen);
cx->free(gen);
}
}
@ -716,7 +716,7 @@ js_NewGenerator(JSContext *cx, JSStackFrame *fp)
/* Allocate obj's private data struct. */
gen = (JSGenerator *)
JS_malloc(cx, sizeof(JSGenerator) + (nslots - 1) * sizeof(jsval));
cx->malloc(sizeof(JSGenerator) + (nslots - 1) * sizeof(jsval));
if (!gen)
goto bad;
@ -783,7 +783,7 @@ js_NewGenerator(JSContext *cx, JSStackFrame *fp)
gen->state = JSGEN_NEWBORN;
if (!JS_SetPrivate(cx, obj, gen)) {
JS_free(cx, gen);
cx->free(gen);
goto bad;
}
return obj;

Просмотреть файл

@ -909,7 +909,7 @@ DestroyFatlock(JSFatLock *fl)
{
PR_DestroyLock(fl->slock);
PR_DestroyCondVar(fl->svar);
free(fl);
js_free(fl);
}
static JSFatLock *
@ -1003,7 +1003,7 @@ js_SetupLocks(int listc, int globc)
global_locks_log2 = JS_CeilingLog2(globc);
global_locks_mask = JS_BITMASK(global_locks_log2);
global_lock_count = JS_BIT(global_locks_log2);
global_locks = (PRLock **) malloc(global_lock_count * sizeof(PRLock*));
global_locks = (PRLock **) js_malloc(global_lock_count * sizeof(PRLock*));
if (!global_locks)
return JS_FALSE;
for (i = 0; i < global_lock_count; i++) {
@ -1014,7 +1014,7 @@ js_SetupLocks(int listc, int globc)
return JS_FALSE;
}
}
fl_list_table = (JSFatLockTable *) malloc(i * sizeof(JSFatLockTable));
fl_list_table = (JSFatLockTable *) js_malloc(i * sizeof(JSFatLockTable));
if (!fl_list_table) {
js_CleanupLocks();
return JS_FALSE;
@ -1036,7 +1036,7 @@ js_CleanupLocks()
if (global_locks) {
for (i = 0; i < global_lock_count; i++)
PR_DestroyLock(global_locks[i]);
free(global_locks);
js_free(global_locks);
global_locks = NULL;
global_lock_count = 1;
global_locks_log2 = 0;
@ -1049,7 +1049,7 @@ js_CleanupLocks()
DeleteListOfFatlocks(fl_list_table[i].taken);
fl_list_table[i].taken = NULL;
}
free(fl_list_table);
js_free(fl_list_table);
fl_list_table = NULL;
fl_list_table_len = 0;
}

Просмотреть файл

@ -231,7 +231,7 @@ static inline jsdouble JS_FASTCALL
math_ceil_kernel(jsdouble x)
{
#ifdef __APPLE__
if (x < 0 && x > -1.0)
if (x < 0 && x > -1.0)
return js_copysign(0, -1);
#endif
return ceil(x);

Просмотреть файл

@ -384,7 +384,7 @@ num_toString(JSContext *cx, uintN argc, jsval *vp)
return JS_FALSE;
}
str = JS_NewStringCopyZ(cx, dStr);
free(dStr);
js_free(dStr);
}
if (!str)
return JS_FALSE;
@ -460,7 +460,7 @@ num_toLocaleString(JSContext *cx, uintN argc, jsval *vp)
}
tmpGroup--;
buf = (char *)JS_malloc(cx, size + 1);
buf = (char *)cx->malloc(size + 1);
if (!buf)
return JS_FALSE;
@ -492,7 +492,7 @@ num_toLocaleString(JSContext *cx, uintN argc, jsval *vp)
str = JS_NewString(cx, buf, size);
if (!str) {
JS_free(cx, buf);
cx->free(buf);
return JS_FALSE;
}
@ -739,9 +739,9 @@ js_FinishRuntimeNumberState(JSContext *cx)
rt->jsNegativeInfinity = NULL;
rt->jsPositiveInfinity = NULL;
JS_free(cx, (void *)rt->thousandsSeparator);
JS_free(cx, (void *)rt->decimalSeparator);
JS_free(cx, (void *)rt->numGrouping);
cx->free((void *)rt->thousandsSeparator);
cx->free((void *)rt->decimalSeparator);
cx->free((void *)rt->numGrouping);
rt->thousandsSeparator = rt->decimalSeparator = rt->numGrouping = NULL;
}
@ -852,7 +852,7 @@ NumberToStringWithBase(JSContext *cx, jsdouble d, jsint base)
return NULL;
s = JS_NewStringCopyZ(cx, numStr);
if (!(numStr >= buf && numStr < buf + sizeof buf))
free(numStr);
js_free(numStr);
return s;
}
@ -1251,7 +1251,7 @@ js_strtod(JSContext *cx, const jschar *s, const jschar *send,
/* Use cbuf to avoid malloc */
if (length >= sizeof cbuf) {
cstr = (char *) JS_malloc(cx, length + 1);
cstr = (char *) cx->malloc(length + 1);
if (!cstr)
return JS_FALSE;
} else {
@ -1292,7 +1292,7 @@ js_strtod(JSContext *cx, const jschar *s, const jschar *send,
i = estr - cstr;
if (cstr != cbuf)
JS_free(cx, cstr);
cx->free(cstr);
*ep = i ? s1 + i : s;
*dp = d;
return JS_TRUE;
@ -1405,7 +1405,7 @@ js_strtointeger(JSContext *cx, const jschar *s, const jschar *send,
*/
size_t i;
size_t length = s1 - start;
char *cstr = (char *) JS_malloc(cx, length + 1);
char *cstr = (char *) cx->malloc(length + 1);
char *estr;
int err=0;
@ -1418,12 +1418,12 @@ js_strtointeger(JSContext *cx, const jschar *s, const jschar *send,
value = JS_strtod(cstr, &estr, &err);
if (err == JS_DTOA_ENOMEM) {
JS_ReportOutOfMemory(cx);
JS_free(cx, cstr);
cx->free(cstr);
return JS_FALSE;
}
if (err == JS_DTOA_ERANGE && value == HUGE_VAL)
value = *cx->runtime->jsPositiveInfinity;
JS_free(cx, cstr);
cx->free(cstr);
} else if ((base & (base - 1)) == 0) {
/*
* The number may also be inaccurate for power-of-two bases. This

Просмотреть файл

@ -560,7 +560,7 @@ out:
ida = JS_Enumerate(cx, obj);
if (!ida) {
if (*sp) {
JS_free(cx, *sp);
cx->free(*sp);
*sp = NULL;
}
goto bad;
@ -704,7 +704,7 @@ obj_toSource(JSContext *cx, uintN argc, jsval *vp)
if (!chars) {
/* If outermost, allocate 4 + 1 for "({})" and the terminator. */
chars = (jschar *) malloc(((outermost ? 4 : 2) + 1) * sizeof(jschar));
chars = (jschar *) js_malloc(((outermost ? 4 : 2) + 1) * sizeof(jschar));
nchars = 0;
if (!chars)
goto error;
@ -715,9 +715,9 @@ obj_toSource(JSContext *cx, uintN argc, jsval *vp)
MAKE_SHARP(he);
nchars = js_strlen(chars);
chars = (jschar *)
realloc((ochars = chars), (nchars + 2 + 1) * sizeof(jschar));
js_realloc((ochars = chars), (nchars + 2 + 1) * sizeof(jschar));
if (!chars) {
free(ochars);
js_free(ochars);
goto error;
}
if (outermost) {
@ -958,11 +958,11 @@ obj_toSource(JSContext *cx, uintN argc, jsval *vp)
/* Allocate 1 + 1 at end for closing brace and terminating 0. */
chars = (jschar *)
realloc((ochars = chars), curlen * sizeof(jschar));
js_realloc((ochars = chars), curlen * sizeof(jschar));
if (!chars) {
/* Save code space on error: let JS_free ignore null vsharp. */
JS_free(cx, vsharp);
free(ochars);
cx->free(vsharp);
js_free(ochars);
goto error;
}
@ -1005,7 +1005,7 @@ obj_toSource(JSContext *cx, uintN argc, jsval *vp)
nchars += vlength;
if (vsharp)
JS_free(cx, vsharp);
cx->free(vsharp);
}
}
@ -1019,7 +1019,7 @@ obj_toSource(JSContext *cx, uintN argc, jsval *vp)
if (!ok) {
if (chars)
free(chars);
js_free(chars);
goto out;
}
@ -1031,7 +1031,7 @@ obj_toSource(JSContext *cx, uintN argc, jsval *vp)
make_string:
str = js_NewString(cx, chars, nchars);
if (!str) {
free(chars);
js_free(chars);
ok = JS_FALSE;
goto out;
}
@ -1042,8 +1042,8 @@ obj_toSource(JSContext *cx, uintN argc, jsval *vp)
return ok;
overflow:
JS_free(cx, vsharp);
free(chars);
cx->free(vsharp);
js_free(chars);
chars = NULL;
goto error;
}
@ -1064,7 +1064,7 @@ obj_toString(JSContext *cx, uintN argc, jsval *vp)
obj = js_GetWrappedObject(cx, obj);
clazz = OBJ_GET_CLASS(cx, obj)->name;
nchars = 9 + strlen(clazz); /* 9 for "[object ]" */
chars = (jschar *) JS_malloc(cx, (nchars + 1) * sizeof(jschar));
chars = (jschar *) cx->malloc((nchars + 1) * sizeof(jschar));
if (!chars)
return JS_FALSE;
@ -1079,7 +1079,7 @@ obj_toString(JSContext *cx, uintN argc, jsval *vp)
str = js_NewString(cx, chars, nchars);
if (!str) {
JS_free(cx, chars);
cx->free(chars);
return JS_FALSE;
}
*vp = STRING_TO_JSVAL(str);
@ -2986,7 +2986,7 @@ AllocSlots(JSContext *cx, JSObject *obj, size_t nslots)
JS_ASSERT(nslots > JS_INITIAL_NSLOTS);
jsval* slots;
slots = (jsval*) JS_malloc(cx, SLOTS_TO_DYNAMIC_WORDS(nslots) * sizeof(jsval));
slots = (jsval*) cx->malloc(SLOTS_TO_DYNAMIC_WORDS(nslots) * sizeof(jsval));
if (!slots)
return true;
@ -3044,7 +3044,7 @@ js_GrowSlots(JSContext *cx, JSObject *obj, size_t nslots)
size_t oslots = size_t(slots[-1]);
slots = (jsval*) JS_realloc(cx, slots - 1, nwords * sizeof(jsval));
slots = (jsval*) cx->realloc(slots - 1, nwords * sizeof(jsval));
*slots++ = nslots;
obj->dslots = slots;
@ -3069,11 +3069,11 @@ js_ShrinkSlots(JSContext *cx, JSObject *obj, size_t nslots)
JS_ASSERT(nslots <= size_t(slots[-1]));
if (nslots <= JS_INITIAL_NSLOTS) {
JS_free(cx, slots - 1);
cx->free(slots - 1);
obj->dslots = NULL;
} else {
size_t nwords = SLOTS_TO_DYNAMIC_WORDS(nslots);
slots = (jsval*) JS_realloc(cx, slots - 1, nwords * sizeof(jsval));
slots = (jsval*) cx->realloc(slots - 1, nwords * sizeof(jsval));
*slots++ = nslots;
obj->dslots = slots;
}
@ -4965,7 +4965,7 @@ js_Enumerate(JSContext *cx, JSObject *obj, JSIterateOp enum_op,
}
allocated = NativeEnumeratorSize(length);
ne = (JSNativeEnumerator *) JS_malloc(cx, allocated);
ne = (JSNativeEnumerator *) cx->malloc(allocated);
if (!ne) {
JS_UNLOCK_SCOPE(cx, scope);
return JS_FALSE;
@ -4997,7 +4997,7 @@ js_Enumerate(JSContext *cx, JSObject *obj, JSIterateOp enum_op,
JS_LOCK_GC(cx->runtime);
if (!js_AddAsGCBytes(cx, allocated)) {
/* js_AddAsGCBytes releases the GC lock on failures. */
JS_free(cx, ne);
cx->free(ne);
return JS_FALSE;
}
ne->next = cx->runtime->nativeEnumerators;
@ -5085,12 +5085,12 @@ js_TraceNativeEnumerators(JSTracer *trc)
cursor = ne->ids;
end = cursor + ne->length;
do {
TRACE_ID(trc, *cursor);
js_TraceId(trc, *cursor);
} while (++cursor != end);
} else if (doGC) {
js_RemoveAsGCBytes(rt, NativeEnumeratorSize(ne->length));
*nep = ne->next;
JS_free(trc->context, ne);
trc->context->free(ne);
continue;
}
nep = &ne->next;
@ -5748,7 +5748,6 @@ js_TraceObject(JSTracer *trc, JSObject *obj)
{
JSContext *cx;
JSScope *scope;
JSScopeProperty *sprop;
JSClass *clasp;
size_t nslots, i;
jsval v;
@ -5772,32 +5771,7 @@ js_TraceObject(JSTracer *trc, JSObject *obj)
MeterEntryCount(scope->entryCount);
#endif
sprop = scope->lastProp;
if (sprop) {
JS_ASSERT(scope->has(sprop));
/* Regenerate property cache shape ids if GC'ing. */
if (IS_GC_MARKING_TRACER(trc) && cx->runtime->gcRegenShapes) {
if (!(sprop->flags & SPROP_FLAG_SHAPE_REGEN)) {
sprop->shape = js_RegenerateShapeForGC(cx);
sprop->flags |= SPROP_FLAG_SHAPE_REGEN;
}
uint32 shape = sprop->shape;
if (scope->hasOwnShape()) {
shape = js_RegenerateShapeForGC(cx);
JS_ASSERT(shape != sprop->shape);
}
scope->shape = shape;
}
/* Trace scope's property tree ancestor line. */
do {
if (scope->hadMiddleDelete() && !scope->has(sprop))
continue;
TRACE_SCOPE_PROPERTY(trc, sprop);
} while ((sprop = sprop->parent) != NULL);
}
scope->trace(trc);
if (!JS_CLIST_IS_EMPTY(&cx->runtime->watchPointList))
js_TraceWatchPoints(trc, obj);

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше