Merge the trunk into HTML5 parsing repo

This commit is contained in:
Henri Sivonen 2009-03-26 14:10:18 +02:00
Родитель 6283a3c22e 40af1731e8
Коммит 27ccc45764
855 изменённых файлов: 22319 добавлений и 17641 удалений

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

@ -4,7 +4,7 @@
~$ ~$
\.pyc$ \.pyc$
(^|/)TAGS$ (^|/)TAGS$
\.DS_Store$ (^|/)\.DS_Store$
# User files that may appear at the root # User files that may appear at the root
^\.mozconfig$ ^\.mozconfig$

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

@ -70,6 +70,7 @@ build/wince/tools/Makefile
build/wince/shunt/Makefile build/wince/shunt/Makefile
build/wince/shunt/include/windows.h build/wince/shunt/include/windows.h
build/wince/shunt/include/ymath.h build/wince/shunt/include/ymath.h
build/wince/shunt/include/stdlib.h
build/wince/shunt/include/sys/Makefile build/wince/shunt/include/sys/Makefile
" "

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

@ -292,7 +292,7 @@
<image id="thepreviewimage"/> <image id="thepreviewimage"/>
</hbox> </hbox>
<hbox id="brokenimagecontainer" pack="center" collapsed="true"> <hbox id="brokenimagecontainer" pack="center" collapsed="true">
<image id="brokenimage" src="resource:///res/broken-image.gif"/> <image id="brokenimage" src="resource:///res/broken-image.png"/>
</hbox> </hbox>
</vbox> </vbox>
</vbox> </vbox>

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

@ -54,7 +54,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
dlgbuttons="accept,cancel" dlgbuttons="accept,cancel"
title="&sanitizeDialog2.title;" title="&sanitizeDialog2.title;"
style="width: &window.width;;" style="width: &dialog.width;;"
ondialogaccept="gSanitizePromptDialog.sanitize();"> ondialogaccept="gSanitizePromptDialog.sanitize();">
<prefpane id="SanitizeDialogPane" onpaneload="gSanitizePromptDialog.init();"> <prefpane id="SanitizeDialogPane" onpaneload="gSanitizePromptDialog.init();">
@ -78,7 +78,7 @@
} }
var bundleBrowser = document.getElementById("bundleBrowser"); var bundleBrowser = document.getElementById("bundleBrowser");
document.documentElement.getButton("accept").label = bundleBrowser.getString("sanitizeButton2"); document.documentElement.getButton("accept").label = bundleBrowser.getString("sanitizeButtonOK");
}, },
checkPrefs : function () checkPrefs : function ()
@ -199,36 +199,36 @@
<groupbox orient="vertical"> <groupbox orient="vertical">
<caption label="&historySection.label;"/> <caption label="&historySection.label;"/>
<hbox id="SanitizeDurationBox" align="center"> <hbox id="SanitizeDurationBox" align="center">
<label value="&clearDuration.label;" control="sanitizeDurationChoice" <label value="&clearTimeDuration.label;" control="sanitizeDurationChoice"
accesskey="&clearDuration.accesskey;" id="sanitizeDurationLabel"/> accesskey="&clearTimeDuration.accesskey;" id="sanitizeDurationLabel"/>
<menulist id="sanitizeDurationChoice" <menulist id="sanitizeDurationChoice"
preference="privacy.sanitize.timeSpan"> preference="privacy.sanitize.timeSpan">
<menupopup> <menupopup>
<menuitem label="&clearDuration.lastHour;" value="1"/> <menuitem label="&clearTimeDuration.lastHour;" value="1"/>
<menuitem label="&clearDuration.last2Hours;" value="2"/> <menuitem label="&clearTimeDuration.last2Hours;" value="2"/>
<menuitem label="&clearDuration.last4Hours;" value="3"/> <menuitem label="&clearTimeDuration.last4Hours;" value="3"/>
<menuitem label="&clearDuration.today;" value="4"/> <menuitem label="&clearTimeDuration.today;" value="4"/>
<menuseparator/> <menuseparator/>
<menuitem label="&clearDuration.everything;" value="0"/> <menuitem label="&clearTimeDuration.everything;" value="0"/>
</menupopup> </menupopup>
</menulist> </menulist>
<label value="&clearDuration.suffix;" flex="1"/> <label value="&clearTimeDuration.suffix;" flex="1"/>
</hbox> </hbox>
<hbox> <hbox>
<vbox style="width: &column.width;"> <vbox style="width: &column.width;">
<checkbox id="history-checkbox" <checkbox id="history-checkbox"
label="&itemVisitedPages.label;" label="&itemBrowsingHistory.label;"
accesskey="&itemVisitedPages.accesskey;" accesskey="&itemBrowsingHistory.accesskey;"
preference="privacy.cpd.history" preference="privacy.cpd.history"
oncommand="gSanitizePromptDialog.updateDownloadHistory();" oncommand="gSanitizePromptDialog.updateDownloadHistory();"
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/> onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
<checkbox id="downloads-checkbox" <checkbox id="downloads-checkbox"
label="&itemDownloadList.label;" label="&itemDownloadHistory.label;"
accesskey="&itemDownloadList.accesskey;" accesskey="&itemDownloadHistory.accesskey;"
preference="privacy.cpd.downloads" preference="privacy.cpd.downloads"
onsyncfrompreference="return gSanitizePromptDialog.onReadDownloads();"/> onsyncfrompreference="return gSanitizePromptDialog.onReadDownloads();"/>
<checkbox label="&itemFormSearchEntries.label;" <checkbox label="&itemFormSearchHistory.label;"
accesskey="&itemFormSearchEntries.accesskey;" accesskey="&itemFormSearchHistory.accesskey;"
preference="privacy.cpd.formdata" preference="privacy.cpd.formdata"
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/> onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
</vbox> </vbox>
@ -241,8 +241,8 @@
accesskey="&itemActiveLogins.accesskey;" accesskey="&itemActiveLogins.accesskey;"
preference="privacy.cpd.sessions" preference="privacy.cpd.sessions"
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/> onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
<checkbox label="&itemWebCache.label;" <checkbox label="&itemCache.label;"
accesskey="&itemWebCache.accesskey;" accesskey="&itemCache.accesskey;"
preference="privacy.cpd.cache" preference="privacy.cpd.cache"
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/> onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
</vbox> </vbox>
@ -255,8 +255,8 @@
accesskey="&itemPasswords.accesskey;" accesskey="&itemPasswords.accesskey;"
preference="privacy.cpd.passwords" preference="privacy.cpd.passwords"
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/> onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
<checkbox label="&itemSiteSettings.label;" <checkbox label="&itemSitePreferences.label;"
accesskey="&itemSiteSettings.accesskey;" accesskey="&itemSitePreferences.accesskey;"
preference="privacy.cpd.siteSettings" preference="privacy.cpd.siteSettings"
onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/> onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/>
</vbox> </vbox>

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

@ -68,9 +68,10 @@ _BROWSER_FILES = browser_sanitize-timespans.js \
browser_bug409481.js \ browser_bug409481.js \
browser_bug413915.js \ browser_bug413915.js \
browser_bug420160.js \ browser_bug420160.js \
browser_bug432599.js \
browser_bug427559.js \ browser_bug427559.js \
browser_bug432599.js \
browser_bug441778.js \ browser_bug441778.js \
browser_bug455852.js \
browser_discovery.js \ browser_discovery.js \
discovery.html \ discovery.html \
moz.png \ moz.png \

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

@ -0,0 +1,16 @@
function test() {
is(gBrowser.mTabs.length, 1, "one tab is open");
content.focus();
isnot(document.activeElement, gURLBar.inputField, "location bar is not focused");
var tab = gBrowser.selectedTab;
gPrefService.setBoolPref("browser.tabs.closeWindowWithLastTab", false);
EventUtils.synthesizeKey("w", { accelKey: true });
is(tab.parentNode, null, "ctrl+w removes the tab");
is(gBrowser.mTabs.length, 1, "a new tab has been opened");
is(document.activeElement, gURLBar.inputField, "location bar is focused for the new tab");
if (gPrefService.prefHasUserValue("browser.tabs.closeWindowWithLastTab"))
gPrefService.clearUserPref("browser.tabs.closeWindowWithLastTab");
}

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

@ -75,14 +75,8 @@ upload::
ifdef ENABLE_TESTS ifdef ENABLE_TESTS
# Implemented in testing/testsuite-targets.mk # Implemented in testing/testsuite-targets.mk
ifdef TEST_PATH
BROWSER_TEST_PATH = --test-path=$(TEST_PATH)
else
BROWSER_TEST_PATH =
endif
mochitest-browser-chrome: mochitest-browser-chrome:
$(RUN_MOCHITEST) --browser-chrome $(BROWSER_TEST_PATH) $(RUN_MOCHITEST) --browser-chrome
$(CHECK_TEST_ERROR) $(CHECK_TEST_ERROR)
mochitest:: mochitest-browser-chrome mochitest:: mochitest-browser-chrome

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

@ -973,26 +973,13 @@ PlacesController.prototype = {
} }
} }
else if (PlacesUtils.nodeIsDay(node)) { else if (PlacesUtils.nodeIsDay(node)) {
// this is the oldest date var query = node.getQueries({})[0];
// for the last node endDate is end of epoch var beginTime = query.beginTime;
var beginDate = 0; var endTime = query.endTime;
// this is the newest date NS_ASSERT(query && beginTime && endTime,
// day nodes have time property set to the last day in the interval "A valid date container query should exist!");
var endDate = node.time; // We want to exclude beginTime from the removal
bhist.removePagesByTimeframe(beginTime+1, endTime);
var nodeIdx = 0;
var cc = root.childCount;
// Find index of current day node
while (nodeIdx < cc && root.getChild(nodeIdx) != node)
++nodeIdx;
// We have an older day
if (nodeIdx+1 < cc)
beginDate = root.getChild(nodeIdx+1).time;
// we want to exclude beginDate from the removal
bhist.removePagesByTimeframe(beginDate+1, endDate);
} }
} }

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

@ -167,7 +167,7 @@ function check_no_bookmarks() {
root.containerOpen = false; root.containerOpen = false;
} }
let gTestDir = do_get_file("browser/components/places/tests/unit/"); let gTestDir = do_get_cwd();
const FILENAME_BOOKMARKS_HTML = "bookmarks.html"; const FILENAME_BOOKMARKS_HTML = "bookmarks.html";
let backup_date = new Date().toLocaleFormat("%Y-%m-%d"); let backup_date = new Date().toLocaleFormat("%Y-%m-%d");
const FILENAME_BOOKMARKS_JSON = "bookmarks-" + backup_date + ".json"; const FILENAME_BOOKMARKS_JSON = "bookmarks-" + backup_date + ".json";

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

@ -70,8 +70,8 @@ function run_test() {
setIntPref("browser.places.smartBookmarksVersion", -1); setIntPref("browser.places.smartBookmarksVersion", -1);
// file pointer to legacy bookmarks file // file pointer to legacy bookmarks file
//var bookmarksFileOld = do_get_file("browser/components/places/tests/unit/bookmarks.large.html"); //var bookmarksFileOld = do_get_file("bookmarks.large.html");
var bookmarksFileOld = do_get_file("browser/components/places/tests/unit/bookmarks.preplaces.html"); var bookmarksFileOld = do_get_file("bookmarks.preplaces.html");
// file pointer to a new places-exported json file // file pointer to a new places-exported json file
var jsonFile = dirSvc.get("ProfD", Ci.nsILocalFile); var jsonFile = dirSvc.get("ProfD", Ci.nsILocalFile);
jsonFile.append("bookmarks.exported.json"); jsonFile.append("bookmarks.exported.json");

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

@ -71,7 +71,7 @@ function run_test() {
ps.setIntPref("browser.places.smartBookmarksVersion", -1); ps.setIntPref("browser.places.smartBookmarksVersion", -1);
// import bookmarks from corrupt file // import bookmarks from corrupt file
var corruptBookmarksFile = do_get_file("browser/components/places/tests/unit/bookmarks.corrupt.html"); var corruptBookmarksFile = do_get_file("bookmarks.corrupt.html");
try { try {
ies.importHTMLFromFile(corruptBookmarksFile, true); ies.importHTMLFromFile(corruptBookmarksFile, true);
} catch(ex) { do_throw("couldn't import corrupt bookmarks file: " + ex); } } catch(ex) { do_throw("couldn't import corrupt bookmarks file: " + ex); }

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

@ -102,7 +102,7 @@ function run_test() {
setIntPref("browser.places.smartBookmarksVersion", -1); setIntPref("browser.places.smartBookmarksVersion", -1);
// file pointer to legacy bookmarks file // file pointer to legacy bookmarks file
var bookmarksFileOld = do_get_file("browser/components/places/tests/unit/bookmarks.preplaces.html"); var bookmarksFileOld = do_get_file("bookmarks.preplaces.html");
// file pointer to a new places-exported bookmarks file // file pointer to a new places-exported bookmarks file
var bookmarksFileNew = dirSvc.get("ProfD", Ci.nsILocalFile); var bookmarksFileNew = dirSvc.get("ProfD", Ci.nsILocalFile);
bookmarksFileNew.append("bookmarks.exported.html"); bookmarksFileNew.append("bookmarks.exported.html");

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

@ -52,7 +52,7 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
dlgbuttons="accept,cancel,help" dlgbuttons="accept,cancel,help"
ondialoghelp="openPrefsHelp()" ondialoghelp="openPrefsHelp()"
title="&sanitizePrefs.title;"> title="&sanitizePrefs2.title;">
<script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/> <script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
@ -76,14 +76,14 @@
<groupbox orient="horizontal"> <groupbox orient="horizontal">
<caption label="&historySection.label;"/> <caption label="&historySection.label;"/>
<vbox style="width: &column.width;"> <vbox style="width: &column.width;">
<checkbox label="&itemVisitedPages.label;" <checkbox label="&itemBrowsingHistory.label;"
accesskey="&itemVisitedPages.accesskey;" accesskey="&itemBrowsingHistory.accesskey;"
preference="privacy.item.history"/> preference="privacy.item.history"/>
<checkbox label="&itemDownloadList.label;" <checkbox label="&itemDownloadHistory.label;"
accesskey="&itemDownloadList.accesskey;" accesskey="&itemDownloadHistory.accesskey;"
preference="privacy.item.downloads"/> preference="privacy.item.downloads"/>
<checkbox label="&itemFormSearchEntries.label;" <checkbox label="&itemFormSearchHistory.label;"
accesskey="&itemFormSearchEntries.accesskey;" accesskey="&itemFormSearchHistory.accesskey;"
preference="privacy.item.formdata"/> preference="privacy.item.formdata"/>
</vbox> </vbox>
<vbox style="width: &column.width;"> <vbox style="width: &column.width;">
@ -93,8 +93,8 @@
<checkbox label="&itemActiveLogins.label;" <checkbox label="&itemActiveLogins.label;"
accesskey="&itemActiveLogins.accesskey;" accesskey="&itemActiveLogins.accesskey;"
preference="privacy.item.sessions"/> preference="privacy.item.sessions"/>
<checkbox label="&itemWebCache.label;" <checkbox label="&itemCache.label;"
accesskey="&itemWebCache.accesskey;" accesskey="&itemCache.accesskey;"
preference="privacy.item.cache"/> preference="privacy.item.cache"/>
</vbox> </vbox>
</groupbox> </groupbox>
@ -104,8 +104,8 @@
<checkbox label="&itemPasswords.label;" <checkbox label="&itemPasswords.label;"
accesskey="&itemPasswords.accesskey;" accesskey="&itemPasswords.accesskey;"
preference="privacy.item.passwords"/> preference="privacy.item.passwords"/>
<checkbox label="&itemSiteSettings.label;" <checkbox label="&itemSitePreferences.label;"
accesskey="&itemSiteSettings.accesskey;" accesskey="&itemSitePreferences.accesskey;"
preference="privacy.item.siteSettings"/> preference="privacy.item.siteSettings"/>
</vbox> </vbox>
<vbox style="width: &column.width;"> <vbox style="width: &column.width;">

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

@ -106,6 +106,14 @@
for (let i = 0; i < elements.length; ++ i) for (let i = 0; i < elements.length; ++ i)
elements[i].parentNode.removeChild(elements[i]); elements[i].parentNode.removeChild(elements[i]);
// Set up the help link
let moreInfoURL = Cc["@mozilla.org/toolkit/URLFormatterService;1"].
getService(Ci.nsIURLFormatter).
formatURLPref("app.support.baseURL");
let moreInfoLink = document.getElementById("moreInfoLink");
if (moreInfoLink)
moreInfoLink.setAttribute("href", moreInfoURL + "private-browsing");
// Focus the location bar // Focus the location bar
if (mainWindow.gURLBar) if (mainWindow.gURLBar)
mainWindow.focusElement(mainWindow.gURLBar); mainWindow.focusElement(mainWindow.gURLBar);
@ -153,6 +161,14 @@
<p id="footerText" class="showPrivate">&privatebrowsingpage.howToStop;</p> <p id="footerText" class="showPrivate">&privatebrowsingpage.howToStop;</p>
<p id="footerTextNormal" class="showNormal">&privatebrowsingpage.howToStart;</p> <p id="footerTextNormal" class="showNormal">&privatebrowsingpage.howToStart;</p>
</div> </div>
<!-- More Info -->
<div id="moreInfo" class="showPrivate">
<p id="moreInfoText">
&privatebrowsingpage.moreInfo;
<a id="moreInfoLink" target="_blank">&privatebrowsingpage.learnMore;</a>
</p>
</div>
</div> </div>
</div> </div>

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

@ -116,7 +116,7 @@ function do_test()
// the active downloads array. // the active downloads array.
// Copy the empty downloads database to our profile directory // Copy the empty downloads database to our profile directory
let downloads = do_get_file("toolkit/components/downloads/test/downloads.empty.sqlite"); let downloads = do_get_file("downloads.empty.sqlite");
downloads.copyTo(dirSvc.get("ProfD", Ci.nsIFile), "downloads.sqlite"); downloads.copyTo(dirSvc.get("ProfD", Ci.nsIFile), "downloads.sqlite");
// Open the database // Open the database

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

@ -39,6 +39,6 @@
function run_test() { function run_test() {
PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing;1"; PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing;1";
do_import_script("browser/components/privatebrowsing/test/unit/do_test_privatebrowsing_autostart.js"); load("do_test_privatebrowsing_autostart.js");
do_test(); do_test();
} }

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

@ -40,6 +40,6 @@
function run_test() { function run_test() {
PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing;1"; PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing;1";
do_import_script("browser/components/privatebrowsing/test/unit/do_test_privatebrowsing_exit.js"); load("do_test_privatebrowsing_exit.js");
do_test(); do_test();
} }

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

@ -39,6 +39,6 @@
function run_test() { function run_test() {
PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing-wrapper;1"; PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing-wrapper;1";
do_import_script("browser/components/privatebrowsing/test/unit/do_test_privatebrowsing_autostart.js"); load("do_test_privatebrowsing_autostart.js");
do_test(); do_test();
} }

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

@ -40,6 +40,6 @@
function run_test() { function run_test() {
PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing-wrapper;1"; PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing-wrapper;1";
do_import_script("browser/components/privatebrowsing/test/unit/do_test_privatebrowsing_exit.js"); load("do_test_privatebrowsing_exit.js");
do_test(); do_test();
} }

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

@ -44,6 +44,6 @@
function run_test() { function run_test() {
PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing-wrapper;1"; PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing-wrapper;1";
do_import_script("browser/components/privatebrowsing/test/unit/do_test_removeDataFromDomain.js"); load("do_test_removeDataFromDomain.js");
do_test(); do_test();
} }

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

@ -44,6 +44,6 @@
function run_test() { function run_test() {
PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing;1"; PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing;1";
do_import_script("browser/components/privatebrowsing/test/unit/do_test_removeDataFromDomain_activeDownloads.js"); load("do_test_removeDataFromDomain_activeDownloads.js");
do_test(); do_test();
} }

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

@ -44,6 +44,6 @@
function run_test() { function run_test() {
PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing;1"; PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing;1";
do_import_script("browser/components/privatebrowsing/test/unit/do_test_removeDataFromDomain.js"); load("do_test_removeDataFromDomain.js");
do_test(); do_test();
} }

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

@ -44,6 +44,6 @@
function run_test() { function run_test() {
PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing;1"; PRIVATEBROWSING_CONTRACT_ID = "@mozilla.org/privatebrowsing;1";
do_import_script("browser/components/privatebrowsing/test/unit/do_test_removeDataFromDomain_activeDownloads.js"); load("do_test_removeDataFromDomain_activeDownloads.js");
do_test(); do_test();
} }

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

@ -52,7 +52,7 @@
<title>&restorepage.tabtitle;</title> <title>&restorepage.tabtitle;</title>
<link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all"/> <link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all"/>
<link rel="stylesheet" href="chrome://browser/skin/aboutSessionRestore.css" type="text/css" media="all"/> <link rel="stylesheet" href="chrome://browser/skin/aboutSessionRestore.css" type="text/css" media="all"/>
<link rel="icon" type="image/png" href="chrome://global/skin/icons/question-16.png"/> <link rel="icon" type="image/png" href="chrome://global/skin/icons/warning-16.png"/>
<script type="application/javascript" src="chrome://browser/content/aboutSessionRestore.js"/> <script type="application/javascript" src="chrome://browser/content/aboutSessionRestore.js"/>
</head> </head>
@ -64,7 +64,7 @@
<!-- Error Title --> <!-- Error Title -->
<div id="errorTitle"> <div id="errorTitle">
<h1 id="errorTitleText">&restorepage.pagetitle;</h1> <h1 id="errorTitleText">&restorepage.errorTitle;</h1>
</div> </div>
<!-- LONG CONTENT (the section most likely to require scrolling) --> <!-- LONG CONTENT (the section most likely to require scrolling) -->
@ -72,20 +72,21 @@
<!-- Short Description --> <!-- Short Description -->
<div id="errorShortDesc"> <div id="errorShortDesc">
<p id="errorShortDescText">&restorepage.issueDesc;</p> <p id="errorShortDescText">&restorepage.problemDesc;</p>
</div> </div>
<!-- Long Description (Note: See netError.dtd for used XHTML tags) --> <!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
<div id="errorLongDesc"> <div id="errorLongDesc">
<p>&restorepage.remedies;</p> <p>&restorepage.tryThis;</p>
<ul> <ul>
<li>&restorepage.dueToChrome;</li> <li>&restorepage.restoreSome;</li>
<li>&restorepage.dueToContent;</li> <li>&restorepage.startNew;</li>
</ul> </ul>
</div> </div>
<!-- Short Description --> <!-- Short Description -->
<div id="errorTrailerDesc"> <div id="errorTrailerDesc">
<p>&nbsp;</p>
<tree xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" <tree xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="tabList" flex="1" seltype="single" hidecolumnpicker="true" id="tabList" flex="1" seltype="single" hidecolumnpicker="true"
onclick="onListClick(event);" onkeydown="onListKeyDown(event);" onclick="onListClick(event);" onkeydown="onListKeyDown(event);"
@ -106,11 +107,11 @@
<button id="errorCancel" label="&restorepage.cancelButton;" <button id="errorCancel" label="&restorepage.cancelButton;"
accesskey="&restorepage.cancel.access;" accesskey="&restorepage.cancel.access;"
oncommand="startNewSession();"/> oncommand="startNewSession();"/>
<button id="errorTryAgain" label="&restorepage.restoreButton;" <button id="errorTryAgain" label="&restorepage.tryagainButton;"
accesskey="&restorepage.restore.access;" accesskey="&restorepage.restore.access;"
oncommand="restoreSession();"/> oncommand="restoreSession();"/>
#else #else
<button id="errorTryAgain" label="&restorepage.restoreButton;" <button id="errorTryAgain" label="&restorepage.tryagainButton;"
accesskey="&restorepage.restore.access;" accesskey="&restorepage.restore.access;"
oncommand="restoreSession();"/> oncommand="restoreSession();"/>
<button id="errorCancel" label="&restorepage.cancelButton;" <button id="errorCancel" label="&restorepage.cancelButton;"

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

@ -609,6 +609,8 @@ init.d/README
redo-prebinding.sh redo-prebinding.sh
res/viewer.properties res/viewer.properties
res/bloatcycle.html res/bloatcycle.html
res/broken-image.gif
res/loading-image.gif
components/browsersearch.xpt components/browsersearch.xpt
components/nsResetPref.js components/nsResetPref.js
plugins/Default Plugin.plugin/Contents/Info.plist plugins/Default Plugin.plugin/Contents/Info.plist

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

@ -327,8 +327,8 @@ bin/res/grabber.gif
bin/res/viewsource.css bin/res/viewsource.css
bin/res/mathml.css bin/res/mathml.css
bin/res/arrow.gif bin/res/arrow.gif
bin/res/loading-image.gif bin/res/loading-image.png
bin/res/broken-image.gif bin/res/broken-image.png
bin/res/fonts/* bin/res/fonts/*
bin/res/dtd/* bin/res/dtd/*
bin/res/html/* bin/res/html/*

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

@ -323,8 +323,8 @@ bin\res\grabber.gif
bin\res\viewsource.css bin\res\viewsource.css
bin\res\mathml.css bin\res\mathml.css
bin\res\arrow.gif bin\res\arrow.gif
bin\res\loading-image.gif bin\res\loading-image.png
bin\res\broken-image.gif bin\res\broken-image.png
bin\res\fonts\* bin\res\fonts\*
bin\res\dtd\* bin\res\dtd\*
bin\res\html\* bin\res\html\*

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

@ -17,6 +17,12 @@ browser.contentHandlers.types.2.uri=http://fusion.google.com/add?feedurl=%s
# Keyword URL (for location bar searches) # Keyword URL (for location bar searches)
keyword.URL=http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q= keyword.URL=http://www.google.com/search?ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=
# URL for site-specific search engines
# TRANSLATION NOTE: {moz:domain} and {searchTerms} are placeholders for the site
# to be searched and the user's search query. Place them in the appropriate location
# for your locale's URL but do not translate them.
browser.search.siteSearchURL=http://www.google.com/search?hl=en&q=site%3A{moz:domain}+{searchTerms}
# increment this number when anything gets changed in the list below. This will # increment this number when anything gets changed in the list below. This will
# cause Firefox to re-read these prefs and inject any new handlers into the # cause Firefox to re-read these prefs and inject any new handlers into the
# profile database. Note that "new" is defined as "has a different URL"; this # profile database. Note that "new" is defined as "has a different URL"; this

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

@ -1,13 +1,14 @@
<!ENTITY restorepage.tabtitle "Restore Session"> <!ENTITY restorepage.tabtitle "Restore Session">
<!ENTITY restorepage.pagetitle "Would you like to restore your session?">
<!-- LOCALIZATION NOTE: If "closed unexpectedly" sounds too awkward in the translation,
you may translate "crash" instead (even though it's IT-speak) -->
<!ENTITY restorepage.issueDesc "Your previous &brandShortName; session closed unexpectedly. We sincerely apologize for the inconvenience. You can restore the tabs and windows from your previous session, or start a new session if they are no longer needed.">
<!ENTITY restorepage.remedies "If &brandShortName; closes repeatedly:">
<!ENTITY restorepage.dueToChrome "Try disabling any recently added extensions in the Add-ons Manager.">
<!ENTITY restorepage.dueToContent "Try restoring your session without any Web pages you suspect might be causing the problem:">
<!ENTITY restorepage.restoreButton "Restore Previous Session"> <!-- LOCALIZATION NOTE: The title is intended to be apologetic and disarming, expressing dismay
and regret that we are unable to restore the session for the user -->
<!ENTITY restorepage.errorTitle "Well, this is embarrassing.">
<!ENTITY restorepage.problemDesc "&brandShortName; is having trouble recovering your windows and tabs. This is usually caused by a recently opened web page.">
<!ENTITY restorepage.tryThis "You can try:">
<!ENTITY restorepage.restoreSome "Removing one or more tabs that you think may be causing the problem">
<!ENTITY restorepage.startNew "Starting an entirely new browsing session">
<!ENTITY restorepage.tryagainButton "Restore">
<!ENTITY restorepage.restore.access "R"> <!ENTITY restorepage.restore.access "R">
<!ENTITY restorepage.cancelButton "Start New Session"> <!ENTITY restorepage.cancelButton "Start New Session">
<!ENTITY restorepage.cancel.access "S"> <!ENTITY restorepage.cancel.access "S">

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

@ -61,7 +61,22 @@ blockedpluginsMessage.searchButton.accesskey=U
# Sanitize # Sanitize
sanitizeWithPromptLabel2=Clear Recent History… sanitizeWithPromptLabel2=Clear Recent History…
sanitizeButton2=Clear Private Data # LOCALIZATION NOTE (sanitizeDialog2.everything.title): When "Time range to
# clear" is set to "Everything", the Clear Recent History dialog's title is
# changed to this. See UI mockup and comment 11 at bug 480169 -->
sanitizeDialog2.everything.title=Clear All History
sanitizeButtonOK=Clear Now
# LOCALIZATION NOTE (sanitizeEverythingWarning): Warning that appears when "Time
# range to clear" is set to "Everything" in Clear Recent History dialog. UI
# mockup at bug 480169. This value is a semi-colon list of plural forms. #1 is
# replaced with the number of history visits. %S is replaced with the date of
# the oldest visit.
# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
sanitizeEverythingWarning=All history will be cleared. Your history includes one page visit since %S.;All history will be cleared. Your history includes #1 page visits since %S.
# LOCALIZATION NOTE (sanitizeEverythingNoVisitsWarning): Used in same context
# as sanitizeEverythingWarning except this is shown instead when there are no
# visits in the user's history.
sanitizeEverythingNoVisitsWarning=All history will be cleared.
# Check for Updates # Check for Updates
updatesItem_default=Check for Updates… updatesItem_default=Check for Updates…

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

@ -1,5 +1,7 @@
<!ENTITY history.label "History"> <!ENTITY history.label "History">
<!ENTITY locationBar.label "Location Bar">
<!ENTITY locbar.pre.label "When using the location bar, suggest:"> <!ENTITY locbar.pre.label "When using the location bar, suggest:">
<!ENTITY locbar.pre.accessKey "l"> <!ENTITY locbar.pre.accessKey "l">
<!ENTITY locbar.post.label ""> <!ENTITY locbar.post.label "">

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

@ -1,43 +1,62 @@
<!ENTITY sanitizePrefs.title "Clear Private Data"> <!ENTITY sanitizePrefs2.title "Settings for Clearing History">
<!ENTITY sanitizeDialog2.title "Clear Recent History"> <!ENTITY sanitizeDialog2.title "Clear Recent History">
<!ENTITY sanitizeItems.label "Clear the following items now:"> <!ENTITY sanitizeItems.label "Clear the following items now:">
<!ENTITY clearDataSettings2.label "When I quit &brandShortName;, it should automatically clear all:"> <!ENTITY clearDataSettings2.label "When I quit &brandShortName;, it should automatically clear all:">
<!-- XXX rearrange entities to match physical layout when l10n isn't an issue --> <!-- XXX rearrange entities to match physical layout when l10n isn't an issue -->
<!-- LOCALIZATION NOTE (clearTimeDuration.*): "Time range to clear" dropdown.
<!ENTITY clearDuration.label "Remove "> See UI mockup at bug 480169 -->
<!ENTITY clearDuration.accesskey "R"> <!ENTITY clearTimeDuration.label "Time range to clear: ">
<!ENTITY clearDuration.lastHour "the last hour"> <!ENTITY clearTimeDuration.accesskey "T">
<!ENTITY clearDuration.last2Hours "the last 2 hours"> <!ENTITY clearTimeDuration.lastHour "Last Hour">
<!ENTITY clearDuration.last4Hours "the last 4 hours"> <!ENTITY clearTimeDuration.last2Hours "Last Two Hours">
<!ENTITY clearDuration.today "my history for today"> <!ENTITY clearTimeDuration.last4Hours "Last Four Hours">
<!ENTITY clearDuration.everything "my entire history"> <!ENTITY clearTimeDuration.today "Today">
<!-- Localization note (clearDuration.suffix) - trailing entity for languages <!ENTITY clearTimeDuration.everything "Everything">
<!-- Localization note (clearTimeDuration.suffix) - trailing entity for languages
that require it. --> that require it. -->
<!ENTITY clearDuration.suffix ""> <!ENTITY clearTimeDuration.suffix "">
<!ENTITY clearTimeDuration.dateColumn "Visit Date">
<!ENTITY clearTimeDuration.nameColumn "Name">
<!-- LOCALIZATION NOTE (detailsProgressiveDisclosure.*): Labels and accesskeys
of the "Details" progressive disclosure button. See UI mockup at bug
480169 -->
<!ENTITY detailsProgressiveDisclosure.label "Details">
<!ENTITY detailsProgressiveDisclosure.accesskey "e">
<!ENTITY historySection.label "History"> <!ENTITY historySection.label "History">
<!ENTITY dataSection.label "Data"> <!ENTITY dataSection.label "Data">
<!ENTITY itemVisitedPages.label "Visited Pages"> <!-- LOCALIZATION NOTE (item*): itemHistoryAndDownloads.* and
<!ENTITY itemVisitedPages.accesskey "V"> itemBrowsingHistory.* will never be used at the same time, so they can
<!ENTITY itemFormSearchEntries.label "Form &amp; Search Entries"> have the same accesskey. -->
<!ENTITY itemFormSearchEntries.accesskey "F"> <!ENTITY itemHistoryAndDownloads.label "Browsing and Download History">
<!ENTITY itemPasswords.label "Saved Passwords"> <!ENTITY itemHistoryAndDownloads.accesskey "B">
<!ENTITY itemPasswords.accesskey "P"> <!ENTITY itemBrowsingHistory.label "Browsing History">
<!ENTITY itemCookies.label "Cookies"> <!ENTITY itemBrowsingHistory.accesskey "B">
<!ENTITY itemCookies.accesskey "C"> <!ENTITY itemFormSearchHistory.label "Form &amp; Search History">
<!ENTITY itemWebCache.label "Web Cache"> <!ENTITY itemFormSearchHistory.accesskey "F">
<!ENTITY itemWebCache.accesskey "W"> <!ENTITY itemPasswords.label "Saved Passwords">
<!ENTITY itemOfflineApps.label "Offline Website Data"> <!ENTITY itemPasswords.accesskey "P">
<!ENTITY itemOfflineApps.accesskey "O"> <!ENTITY itemCookies.label "Cookies">
<!ENTITY itemDownloadList.label "Download List"> <!ENTITY itemCookies.accesskey "C">
<!ENTITY itemDownloadList.accesskey "D"> <!ENTITY itemCache.label "Cache">
<!ENTITY itemActiveLogins.label "Active Logins"> <!ENTITY itemCache.accesskey "A">
<!ENTITY itemActiveLogins.accesskey "L"> <!ENTITY itemOfflineApps.label "Offline Website Data">
<!ENTITY itemSiteSettings.label "Site-specific Settings"> <!ENTITY itemOfflineApps.accesskey "O">
<!ENTITY itemSiteSettings.accesskey "S"> <!ENTITY itemDownloadHistory.label "Download History">
<!ENTITY itemDownloadHistory.accesskey "D">
<!ENTITY itemActiveLogins.label "Active Logins">
<!ENTITY itemActiveLogins.accesskey "L">
<!ENTITY itemSitePreferences.label "Site Preferences">
<!ENTITY itemSitePreferences.accesskey "S">
<!ENTITY window.width "30em"> <!-- LOCALIZATION NOTE (sanitizeEverythingUndoWarning): Second warning paragraph
that appears when "Time range to clear" is set to "Everything". See UI
mockup at bug 480169 -->
<!ENTITY sanitizeEverythingUndoWarning "This action cannot be undone.">
<!ENTITY dialog.width "32em">
<!ENTITY column.width "14em"> <!ENTITY column.width "14em">

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

@ -59,3 +59,13 @@ body.normal > #errorPageContainer {
#footerDesc > p { #footerDesc > p {
font-size: 110%; /* to match the value set in chrome://global/skin/netError.css */ font-size: 110%; /* to match the value set in chrome://global/skin/netError.css */
} }
#moreInfoText {
font-size: 110%; /* to match the value set in chrome://global/skin/netError.css */
-moz-padding-start: 25px;
background: url("moz-icon://stock/gtk-dialog-info?size=menu") no-repeat top left;
}
body[dir="rtl"] #moreInfoText {
background-position: top right;
}

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

@ -38,7 +38,7 @@
%endif %endif
#errorPageContainer { #errorPageContainer {
background-image: url("moz-icon://stock/gtk-dialog-question?size=dialog"); background-image: url("moz-icon://stock/gtk-dialog-warning?size=dialog");
} }
#tabList { #tabList {

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

@ -222,7 +222,7 @@ menuitem:not([type]) {
} }
#placesContext_open\:newwindow, #placesContext_open\:newwindow,
menuitem[command="cmd_newNavigator"], #menu_newNavigator,
#context-openlink, #context-openlink,
#context-openframe { #context-openframe {
list-style-image: url("chrome://browser/skin/Toolbar-small.png"); list-style-image: url("chrome://browser/skin/Toolbar-small.png");
@ -231,14 +231,14 @@ menuitem[command="cmd_newNavigator"],
#placesContext_open\:newtab, #placesContext_open\:newtab,
#placesContext_openContainer\:tabs, #placesContext_openContainer\:tabs,
menuitem[command="cmd_newNavigatorTab"], #menu_newNavigatorTab,
#context-openlinkintab, #context-openlinkintab,
#context-openframeintab { #context-openframeintab {
list-style-image: url("chrome://browser/skin/Toolbar-small.png"); list-style-image: url("chrome://browser/skin/Toolbar-small.png");
-moz-image-region: rect(0px 64px 16px 48px); -moz-image-region: rect(0px 64px 16px 48px);
} }
menuitem[command="Browser:OpenFile"] { #menu_openFile {
list-style-image: url("moz-icon://stock/gtk-open?size=menu"); list-style-image: url("moz-icon://stock/gtk-open?size=menu");
} }
@ -254,7 +254,7 @@ menuitem[command="Browser:OpenFile"] {
list-style-image: url("moz-icon://stock/gtk-media-pause?size=menu"); list-style-image: url("moz-icon://stock/gtk-media-pause?size=menu");
} }
menuitem[command="Browser:SavePage"], #menu_savePage,
#context-savelink, #context-savelink,
#context-saveimage, #context-saveimage,
#context-savevideo, #context-savevideo,
@ -264,11 +264,11 @@ menuitem[command="Browser:SavePage"],
list-style-image: url("moz-icon://stock/gtk-save-as?size=menu"); list-style-image: url("moz-icon://stock/gtk-save-as?size=menu");
} }
menuitem[command="cmd_printPreview"] { #menu_printPreview {
list-style-image: url("moz-icon://stock/gtk-print-preview?size=menu"); list-style-image: url("moz-icon://stock/gtk-print-preview?size=menu");
} }
menuitem[command="cmd_print"], #menu_print,
#context-printframe { #context-printframe {
list-style-image: url("moz-icon://stock/gtk-print?size=menu"); list-style-image: url("moz-icon://stock/gtk-print?size=menu");
} }
@ -277,35 +277,38 @@ menuitem[command="cmd_print"],
list-style-image: url("moz-icon://stock/gtk-quit?size=menu"); list-style-image: url("moz-icon://stock/gtk-quit?size=menu");
} }
menuitem[command="cmd_undo"], #menu_undo,
#context-undo { #context-undo {
list-style-image: url("moz-icon://stock/gtk-undo?size=menu"); list-style-image: url("moz-icon://stock/gtk-undo?size=menu");
} }
menuitem[command="cmd_undo"][disabled], #menu_undo[disabled],
#context-undo[disabled] { #context-undo[disabled] {
list-style-image: url("moz-icon://stock/gtk-undo?size=menu&state=disabled"); list-style-image: url("moz-icon://stock/gtk-undo?size=menu&state=disabled");
} }
menuitem[command="cmd_redo"] { #menu_redo {
list-style-image: url("moz-icon://stock/gtk-redo?size=menu"); list-style-image: url("moz-icon://stock/gtk-redo?size=menu");
} }
menuitem[command="cmd_redo"][disabled] { #menu_redo[disabled] {
list-style-image: url("moz-icon://stock/gtk-redo?size=menu&state=disabled"); list-style-image: url("moz-icon://stock/gtk-redo?size=menu&state=disabled");
} }
menuitem[command="cmd_cut"], #menu_cut,
#placesContext_cut,
#context-cut { #context-cut {
list-style-image: url("moz-icon://stock/gtk-cut?size=menu"); list-style-image: url("moz-icon://stock/gtk-cut?size=menu");
} }
menuitem[command="cmd_cut"][disabled], #menu_cut[disabled],
#placesContext_cut[disabled],
#context-cut[disabled] { #context-cut[disabled] {
list-style-image: url("moz-icon://stock/gtk-cut?size=menu&state=disabled"); list-style-image: url("moz-icon://stock/gtk-cut?size=menu&state=disabled");
} }
menuitem[command="cmd_copy"], #menu_copy,
#placesContext_copy,
#context-copy, #context-copy,
#context-copyimage, #context-copyimage,
#context-copyvideourl, #context-copyvideourl,
@ -315,32 +318,40 @@ menuitem[command="cmd_copy"],
list-style-image: url("moz-icon://stock/gtk-copy?size=menu"); list-style-image: url("moz-icon://stock/gtk-copy?size=menu");
} }
menuitem[command="cmd_copy"][disabled], #menu_copy[disabled],
#placesContext_copy[disabled],
#context-copy[disabled] { #context-copy[disabled] {
list-style-image: url("moz-icon://stock/gtk-copy?size=menu&state=disabled"); list-style-image: url("moz-icon://stock/gtk-copy?size=menu&state=disabled");
} }
menuitem[command="cmd_paste"], #menu_paste,
#placesContext_paste,
#context-paste { #context-paste {
list-style-image: url("moz-icon://stock/gtk-paste?size=menu"); list-style-image: url("moz-icon://stock/gtk-paste?size=menu");
} }
menuitem[command="cmd_paste"][disabled], #menu_paste[disabled],
#placesContext_paste[disabled],
#context-paste[disabled] { #context-paste[disabled] {
list-style-image: url("moz-icon://stock/gtk-paste?size=menu&state=disabled"); list-style-image: url("moz-icon://stock/gtk-paste?size=menu&state=disabled");
} }
menuitem[command="cmd_delete"], #menu_delete,
#placesContext_delete,
#placesContext_delete_history,
#context-delete { #context-delete {
list-style-image: url("moz-icon://stock/gtk-delete?size=menu"); list-style-image: url("moz-icon://stock/gtk-delete?size=menu");
} }
menuitem[command="cmd_delete"][disabled], #menu_delete[disabled],
#placesContext_delete[disabled],
#placesContext_delete_history[disabled],
#context-delete[disabled] { #context-delete[disabled] {
list-style-image: url("moz-icon://stock/gtk-delete?size=menu&state=disabled"); list-style-image: url("moz-icon://stock/gtk-delete?size=menu&state=disabled");
} }
menuitem[command="cmd_selectAll"] { #menu_selectAll,
#context-selectall {
list-style-image: url("moz-icon://stock/gtk-select-all?size=menu"); list-style-image: url("moz-icon://stock/gtk-select-all?size=menu");
} }
@ -356,77 +367,77 @@ menuitem[command="cmd_selectAll"] {
list-style-image: url("moz-icon://stock/gtk-preferences?size=menu"); list-style-image: url("moz-icon://stock/gtk-preferences?size=menu");
} }
menuitem[command="Browser:Stop"], #menu_stop,
#context-stop { #context-stop {
list-style-image: url("moz-icon://stock/gtk-stop?size=menu"); list-style-image: url("moz-icon://stock/gtk-stop?size=menu");
} }
menuitem[command="Browser:Stop"][disabled], #menu_stop[disabled],
#context-stop[disabled] { #context-stop[disabled] {
list-style-image: url("moz-icon://stock/gtk-stop?size=menu&state=disabled"); list-style-image: url("moz-icon://stock/gtk-stop?size=menu&state=disabled");
} }
#menu_reload,
#placesContext_reload, #placesContext_reload,
#placesContext_reloadMicrosummary, #placesContext_reloadMicrosummary,
menuitem[command="Browser:ReloadOrDuplicate"],
#context-reload, #context-reload,
#context-reloadframe { #context-reloadframe {
list-style-image: url("moz-icon://stock/gtk-refresh?size=menu"); list-style-image: url("moz-icon://stock/gtk-refresh?size=menu");
} }
menuitem[command="Browser:ReloadOrDuplicate"][disabled], #menu_reload[disabled],
#context-reload[disabled] { #context-reload[disabled] {
list-style-image: url("moz-icon://stock/gtk-refresh?size=menu&state=disabled"); list-style-image: url("moz-icon://stock/gtk-refresh?size=menu&state=disabled");
} }
menuitem[command="cmd_fullZoomEnlarge"] { #menu_zoomEnlarge {
list-style-image: url("moz-icon://stock/gtk-zoom-in?size=menu"); list-style-image: url("moz-icon://stock/gtk-zoom-in?size=menu");
} }
menuitem[command="cmd_fullZoomReduce"] { #menu_zoomReduce {
list-style-image: url("moz-icon://stock/gtk-zoom-out?size=menu"); list-style-image: url("moz-icon://stock/gtk-zoom-out?size=menu");
} }
menuitem[command="cmd_fullZoomReset"] { #menu_zoomReset {
list-style-image: url("moz-icon://stock/gtk-zoom-100?size=menu"); list-style-image: url("moz-icon://stock/gtk-zoom-100?size=menu");
} }
menuitem[key="goBackKb"], #historyMenuBack,
#context-back { #context-back {
list-style-image: url("moz-icon://stock/gtk-go-back-ltr?size=menu"); list-style-image: url("moz-icon://stock/gtk-go-back-ltr?size=menu");
} }
menuitem[key="goBackKb"][disabled], #historyMenuBack[disabled],
#context-back[disabled] { #context-back[disabled] {
list-style-image: url("moz-icon://stock/gtk-go-back-ltr?size=menu&state=disabled"); list-style-image: url("moz-icon://stock/gtk-go-back-ltr?size=menu&state=disabled");
} }
menuitem[key="goBackKb"][chromedir="rtl"], #historyMenuBack[chromedir="rtl"],
#context-back[chromedir="rtl"] { #context-back[chromedir="rtl"] {
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=menu"); list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=menu");
} }
menuitem[key="goBackKb"][disabled][chromedir="rtl"], #historyMenuBack[disabled][chromedir="rtl"],
#context-back[disabled][chromedir="rtl"] { #context-back[disabled][chromedir="rtl"] {
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=menu&state=disabled"); list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=menu&state=disabled");
} }
menuitem[key="goForwardKb"], #historyMenuForward,
#context-forward { #context-forward {
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=menu"); list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=menu");
} }
menuitem[key="goForwardKb"][disabled], #historyMenuForward[disabled],
#context-forward[disabled] { #context-forward[disabled] {
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=menu&state=disabled"); list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=menu&state=disabled");
} }
menuitem[key="goForwardKb"][chromedir="rtl"], #historyMenuForward[chromedir="rtl"],
#context-forward[chromedir="rtl"] { #context-forward[chromedir="rtl"] {
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu"); list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu");
} }
menuitem[key="goForwardKb"][disabled][chromedir="rtl"], #historyMenuForward[disabled][chromedir="rtl"],
#context-forward[disabled][chromedir="rtl"] { #context-forward[disabled][chromedir="rtl"] {
list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu&state=disabled"); list-style-image: url("moz-icon://stock/gtk-go-forward-rtl?size=menu&state=disabled");
} }
@ -435,12 +446,12 @@ menuitem[key="goForwardKb"][disabled][chromedir="rtl"],
list-style-image: url("moz-icon://stock/gtk-home?size=menu"); list-style-image: url("moz-icon://stock/gtk-home?size=menu");
} }
menuitem[command="Browser:ShowAllHistory"] { #menu_showAllHistory {
list-style-image: url("chrome://browser/skin/Toolbar-small.png"); list-style-image: url("chrome://browser/skin/Toolbar-small.png");
-moz-image-region: rect(0px 32px 16px 16px); -moz-image-region: rect(0px 32px 16px 16px);
} }
menuitem[command="Browser:ShowAllBookmarks"] { #bookmarksShowAll {
list-style-image: url("chrome://browser/skin/Toolbar-small.png"); list-style-image: url("chrome://browser/skin/Toolbar-small.png");
-moz-image-region: rect(0px 48px 16px 32px); -moz-image-region: rect(0px 48px 16px 32px);
} }
@ -454,7 +465,7 @@ menuitem[command="Browser:ShowAllBookmarks"] {
-moz-image-region: rect(0px 16px 16px 0px); -moz-image-region: rect(0px 16px 16px 0px);
} }
menuitem[command="View:PageInfo"], #menu_pageInfo,
#context-viewinfo, #context-viewinfo,
#context-viewframeinfo { #context-viewframeinfo {
list-style-image: url("moz-icon://stock/gtk-info?size=menu"); list-style-image: url("moz-icon://stock/gtk-info?size=menu");
@ -469,7 +480,7 @@ menuitem[command="View:PageInfo"],
list-style-image: url("moz-icon://stock/gtk-clear?size=menu"); list-style-image: url("moz-icon://stock/gtk-clear?size=menu");
} }
menuitem[key="key_openHelp"] { #menu_openHelp {
list-style-image: url("moz-icon://stock/gtk-help?size=menu"); list-style-image: url("moz-icon://stock/gtk-help?size=menu");
} }

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

@ -84,7 +84,6 @@
} }
.small, .small[disabled="true"] { .small, .small[disabled="true"] {
font-size: x-small;
min-width: 0px; min-width: 0px;
padding: 0px 4px 0px 4px; padding: 0px 4px 0px 4px;
margin: 0px; margin: 0px;

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

@ -59,3 +59,13 @@ body.normal > #errorPageContainer {
#footerDesc > p { #footerDesc > p {
font-size: 110%; /* to match the value set in chrome://global/skin/netError.css */ font-size: 110%; /* to match the value set in chrome://global/skin/netError.css */
} }
#moreInfoText {
font-size: 110%; /* to match the value set in chrome://global/skin/netError.css */
-moz-padding-start: 25px;
background: url("chrome://global/skin/icons/information-16.png") no-repeat top left;
}
body[dir="rtl"] #moreInfoText {
background-position: top right;
}

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

@ -37,7 +37,7 @@
%endif %endif
#errorPageContainer { #errorPageContainer {
background-image: url("chrome://global/skin/icons/question-64.png"); background-image: url("chrome://global/skin/icons/warning-64.png");
} }
#tabList { #tabList {

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

@ -283,7 +283,6 @@
} }
.small { .small {
font-size: x-small;
min-width: 0px; min-width: 0px;
padding: 0px 4px 0px 4px; padding: 0px 4px 0px 4px;
margin: 0px; margin: 0px;

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

@ -59,3 +59,13 @@ body.normal > #errorPageContainer {
#footerDesc > p { #footerDesc > p {
font-size: 110%; /* to match the value set in chrome://global/skin/netError.css */ font-size: 110%; /* to match the value set in chrome://global/skin/netError.css */
} }
#moreInfoText {
font-size: 110%; /* to match the value set in chrome://global/skin/netError.css */
-moz-padding-start: 25px;
background: url("chrome://global/skin/icons/information-16.png") no-repeat top left;
}
body[dir="rtl"] #moreInfoText {
background-position: top right;
}

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

@ -37,7 +37,7 @@
%endif %endif
#errorPageContainer { #errorPageContainer {
background-image: url("chrome://global/skin/icons/question-48.png"); background-image: url("chrome://global/skin/icons/warning-large.png");
} }
#tabList { #tabList {

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

@ -137,7 +137,6 @@
} }
.small, .small[disabled="true"] { .small, .small[disabled="true"] {
font-size: x-small;
min-width: 0px; min-width: 0px;
padding: 0px 4px 0px 4px; padding: 0px 4px 0px 4px;
margin: 0px; margin: 0px;

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

@ -54,8 +54,13 @@ DIRS = win32
endif endif
ifdef WINCE ifdef WINCE
# We need jemalloc built before the shunt
ifdef MOZ_MEMORY
DIRS += wince/tools $(DEPTH)/memory/jemalloc wince/shunt
else
DIRS += wince/tools wince/shunt DIRS += wince/tools wince/shunt
endif endif
endif
DIRS += pgo DIRS += pgo

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

@ -44,10 +44,18 @@ MODULE = shunt
TOPSRCDIR = $(topsrcdir) TOPSRCDIR = $(topsrcdir)
OBJDIR = $(DEPTH) OBJDIR = $(DEPTH)
export NO_SHUNT = 1
include $(DEPTH)/config/autoconf.mk include $(DEPTH)/config/autoconf.mk
MODULE = mozce_shunt
LIBRARY_NAME = mozce_shunt
FORCE_SHARED_LIB= 1
DIST_INSTALL = 1
EXPORTS = include/windows.h \ EXPORTS = include/windows.h \
include/ymath.h \ include/ymath.h \
include/stdlib.h \
include/direct.h \ include/direct.h \
include/errno.h \ include/errno.h \
include/fcntl.h \ include/fcntl.h \
@ -60,32 +68,15 @@ EXPORTS = include/windows.h \
DIRS += include/sys DIRS += include/sys
BUILD_SWITCH = -Build ifdef MOZ_MEMORY
REBUILD_SWITCH = -Rebuild REQUIRES = jemalloc
CLEAN_SWITCH = -clean JEMALLOC_LIB = $(DIST)/lib/jemalloc.lib
CFLAGS += -DMOZ_MEMORY
CXXFLAGS += -DMOZ_MEMORY
endif
MOZCE_DEVENV=vs$(MOZ_MSVCVERSION) CPPSRCS = map.cpp
MOZCE_SHUNT_SLN=$(TOPSRCDIR)/build/wince/shunt/build/$(MOZCE_DEVENV)/mozce_shunt_static.sln DEFINES += -DMOZCE_SHUNT_EXPORTS
MOZCE_SHUNT_BUILDDIR=$(srcdir)/build/vs$(MOZ_MSVCVERSION)
MOZCE_PROJECT="Release|Windows Mobile 6 Professional SDK (ARMV4I)"
include $(topsrcdir)/config/rules.mk include $(topsrcdir)/config/rules.mk
$(MOZCE_SHUNT_BUILDDIR)/mozce_shunt.lib:: $(MOZCE_SHUNT_BUILDDIR)/mozce_shunt.dll
$(MOZCE_SHUNT_BUILDDIR)/mozce_shunt.dll:
devenv $(MOZCE_SHUNT_SLN) $(BUILD_SWITCH) $(MOZCE_PROJECT)
libs:: $(MOZCE_SHUNT_BUILDDIR)/mozce_shunt.dll $(MOZCE_SHUNT_BUILDDIR)/mozce_shunt.lib
$(INSTALL) $(MOZCE_SHUNT_BUILDDIR)/mozce_shunt.dll $(DIST)/bin
$(INSTALL) $(MOZCE_SHUNT_BUILDDIR)/mozce_shunt.lib $(DIST)/lib
install:: $(MOZCE_SHUNT_BUILDDIR)/mozce_shunt.dll $(MOZCE_SHUNT_BUILDDIR)/mozce_shunt.lib
$(SYSINSTALL) $(MOZCE_SHUNT_BUILDDIR)/mozce_shunt.dll $(DESTDIR)$(bindir)
$(SYSINSTALL) $(MOZCE_SHUNT_BUILDDIR)/mozce_shunt.lib $(DESTDIR)$(libdir)

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

@ -1,42 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mozce_shunt_static", "mozce_shunt_static.vcproj", "{082BAB06-D10F-4C57-B123-F84DC06C246D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|Win32 = Debug|Win32
Debug|Windows Mobile 6 Professional SDK (ARMV4I) = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
Debug|Windows Mobile 6 Standard SDK (ARMV4I) = Debug|Windows Mobile 6 Standard SDK (ARMV4I)
Release|Mixed Platforms = Release|Mixed Platforms
Release|Win32 = Release|Win32
Release|Windows Mobile 6 Professional SDK (ARMV4I) = Release|Windows Mobile 6 Professional SDK (ARMV4I)
Release|Windows Mobile 6 Standard SDK (ARMV4I) = Release|Windows Mobile 6 Standard SDK (ARMV4I)
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Mixed Platforms.ActiveCfg = Debug|Windows Mobile 6 Standard SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Mixed Platforms.Build.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Mixed Platforms.Deploy.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Win32.ActiveCfg = Debug|Windows Mobile 6 Standard SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Standard SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Mixed Platforms.ActiveCfg = Release|Windows Mobile 6 Standard SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Mixed Platforms.Build.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Mixed Platforms.Deploy.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Win32.ActiveCfg = Release|Windows Mobile 6 Standard SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Standard SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I)
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

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

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

@ -1,62 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mozce_shunt_static", "mozce_shunt_static.vcproj", "{082BAB06-D10F-4C57-B123-F84DC06C246D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Pocket PC 2003 (ARMV4) = Debug|Pocket PC 2003 (ARMV4)
Debug|Smartphone 2003 (ARMV4) = Debug|Smartphone 2003 (ARMV4)
Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)
Debug|Windows Mobile 6 Professional SDK (ARMV4I) = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
Debug|Windows Mobile 6 Standard SDK (ARMV4I) = Debug|Windows Mobile 6 Standard SDK (ARMV4I)
Release|Pocket PC 2003 (ARMV4) = Release|Pocket PC 2003 (ARMV4)
Release|Smartphone 2003 (ARMV4) = Release|Smartphone 2003 (ARMV4)
Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I) = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)
Release|Windows Mobile 6 Professional SDK (ARMV4I) = Release|Windows Mobile 6 Professional SDK (ARMV4I)
Release|Windows Mobile 6 Standard SDK (ARMV4I) = Release|Windows Mobile 6 Standard SDK (ARMV4I)
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Smartphone 2003 (ARMV4).ActiveCfg = Debug|Smartphone 2003 (ARMV4)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Smartphone 2003 (ARMV4).Build.0 = Debug|Smartphone 2003 (ARMV4)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Smartphone 2003 (ARMV4).Deploy.0 = Debug|Smartphone 2003 (ARMV4)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Professional SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 6 Standard SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 6 Standard SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Smartphone 2003 (ARMV4).ActiveCfg = Release|Smartphone 2003 (ARMV4)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Smartphone 2003 (ARMV4).Build.0 = Release|Smartphone 2003 (ARMV4)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Smartphone 2003 (ARMV4).Deploy.0 = Release|Smartphone 2003 (ARMV4)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Smartphone SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Windows Mobile 6 Professional SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Professional SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Windows Mobile 6 Professional SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Professional SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 6 Standard SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I)
{082BAB06-D10F-4C57-B123-F84DC06C246D}.Release|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I)
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

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

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

@ -40,12 +40,82 @@
#define MOZCE_SHUNT_H #define MOZCE_SHUNT_H
#ifdef MOZCE_SHUNT_EXPORTS #ifdef MOZCE_SHUNT_EXPORTS
#define _CRTIMP __declspec(dllexport)
#define MOZCE_SHUNT_API __declspec(dllexport) #define MOZCE_SHUNT_API __declspec(dllexport)
#define MOZCE_SHUNT_IMPORT_API __declspec(dllexport)
#else #else
#define MOZCE_SHUNT_API __declspec(dllimport) #define MOZCE_SHUNT_API
#define MOZCE_SHUNT_IMPORT_API __declspec(dllimport)
#endif
#ifdef MOZ_MEMORY
#ifdef __cplusplus
#define _NEW_
void * operator new(size_t _Size);
void operator delete(void * ptr);
void *operator new[](size_t size);
void operator delete[](void *ptr);
extern "C" {
#endif
extern void* moz_malloc(size_t);
extern void* moz_valloc(size_t);
extern void* moz_calloc(size_t, size_t);
extern void* moz_realloc(void*, unsigned int);
extern void moz_free(void*);
MOZCE_SHUNT_API void* __cdecl malloc(size_t);
MOZCE_SHUNT_API void* __cdecl valloc(size_t);
MOZCE_SHUNT_API void* __cdecl calloc(size_t, size_t);
MOZCE_SHUNT_API void* __cdecl realloc(void*, unsigned int);
MOZCE_SHUNT_API void __cdecl free(void*);
MOZCE_SHUNT_API char*
mozce_strdup(const char*);
MOZCE_SHUNT_API unsigned short*
mozce_wcsdup(const unsigned short* );
MOZCE_SHUNT_API char*
mozce_strndup(const char *, unsigned int);
MOZCE_SHUNT_API unsigned short*
mozce_wcsndup(const unsigned short*, unsigned int);
#ifdef __cplusplus
} //extern "C"
#endif
#undef _strdup
#undef strdup
#undef _strndup
#undef strndup
#undef _wcsdup
#undef wcsdup
#undef _wcsndup
#undef wcsndup
#define _strdup mozce_strdup
#define _strndup mozce_strndup
#define _wcsdup mozce_wcsdup
#define _wcsndup mozce_wcsndup
#endif #endif
#define strdup _strdup #define strdup _strdup
#define strndup _strndup
#define wcsdup _wcsdup
#define wcsndup _wcsndup
#define strcmpi _stricmp #define strcmpi _stricmp
#define stricmp _stricmp #define stricmp _stricmp
#define wgetcwd _wgetcwd #define wgetcwd _wgetcwd
@ -60,8 +130,8 @@ extern "C" {
#endif #endif
/* errno and family */ /* errno and family */
extern MOZCE_SHUNT_API int errno; extern MOZCE_SHUNT_IMPORT_API int errno;
MOZCE_SHUNT_API char* strerror(int); MOZCE_SHUNT_IMPORT_API char* strerror(int);
/* abort */ /* abort */
MOZCE_SHUNT_API void abort(void); MOZCE_SHUNT_API void abort(void);

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

@ -0,0 +1,76 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is MOZCE Lib.
*
* The Initial Developer of the Original Code is Brad Lassey <blassey@mozilla.com>.
* Portions created by the Initial Developer are Copyright (C) 2009
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef MOZCE_STDLIB_H
#define MOZCE_STDLIB_H
#ifdef MOZ_MEMORY
#undef strdup
#undef _strdup
#undef wcsdup
#undef _wcsdup
#undef strndup
#undef _strndup
#undef wcsndup
#undef _wcsndup
#endif
#include "@WINCE_SDK_DIR@/Include/Armv4i/stdlib.h"
#ifdef MOZ_MEMORY
#undef strdup
#undef _strdup
#undef wcsdup
#undef _wcsdup
#undef strndup
#undef _strndup
#undef wcsndup
#undef _wcsndup
#define _strdup mozce_strdup
#define strdup _strdup
#define _strndup mozce_strndup
#define strndup _strndup
#define _wcsdup mozce_wcsdup
#define wcsdup _wcsdup
#define _wcsndup mozce_wcsndup
#define wcsndup _wcsndup
#endif
#endif

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

@ -45,5 +45,5 @@ include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk include $(topsrcdir)/config/rules.mk
export:: $(srcdir)/stat.h $(srcdir)/types.h export:: $(srcdir)/stat.h $(srcdir)/types.h
$(INSTALL) $^ $(DIST)/include/shunt/sys $(INSTALL) $^ $(DIST)/include/mozce_shunt/sys

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

@ -36,11 +36,78 @@
* *
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
#include "stdlib.h"
#include "include/mozce_shunt.h"
#include "time_conversions.h"
#include <stdlib.h>
#include "Windows.h" #include "Windows.h"
#include "mozce_shunt.h" #ifdef MOZ_MEMORY
#include "time_conversions.h" void * operator new(size_t _Size)
{
void *p = moz_malloc(_Size);
return (p);
}
void operator delete(void * ptr)
{
moz_free(ptr);
}
void *operator new[](size_t size)
{
void* p = moz_malloc(size);
return (p);
}
void operator delete[](void *ptr)
{
moz_free(ptr);
}
MOZCE_SHUNT_API char*
mozce_strndup( const char *src, size_t len ) {
char* dst = (char*)moz_malloc(len + 1);
if(dst)
strncpy(dst, src, len + 1);
return dst;
}
MOZCE_SHUNT_API char*
mozce_strdup(const char *src ) {
size_t len = strlen(src);
return mozce_strndup(src, len );
}
MOZCE_SHUNT_API unsigned short*
mozce_wcsndup( const unsigned short *src, size_t len ) {
wchar_t* dst = (wchar_t*)moz_malloc(sizeof(wchar_t) * (len + 1));
if(dst)
wcsncpy(dst, src, len + 1);
return dst;
}
MOZCE_SHUNT_API unsigned short*
mozce_wcsdup( const unsigned short *src ) {
size_t len = wcslen(src);
return mozce_wcsndup(src, len);
}
MOZCE_SHUNT_API void* __cdecl malloc(size_t size) {
return moz_malloc(size);
}
MOZCE_SHUNT_API void* __cdecl valloc(size_t size) {
return moz_valloc(size);
}
MOZCE_SHUNT_API void* __cdecl calloc(size_t size, size_t num) {
return moz_calloc(size, num);
}
MOZCE_SHUNT_API void* __cdecl realloc(void* ptr, size_t size) {
return moz_realloc(ptr, size);
}
MOZCE_SHUNT_API void __cdecl free(void* ptr) {
return moz_free(ptr);
}
#endif
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
// Environment Variable Stuff // Environment Variable Stuff
@ -324,12 +391,12 @@ MOZCE_SHUNT_API unsigned int ExpandEnvironmentStringsW(const unsigned short* lpS
// errno // errno
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
MOZCE_SHUNT_API char* strerror(int inErrno) MOZCE_SHUNT_IMPORT_API char* strerror(int inErrno)
{ {
return "Unknown Error"; return "Unknown Error";
} }
MOZCE_SHUNT_API int errno = 0; MOZCE_SHUNT_IMPORT_API int errno = 0;
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////

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

@ -35,17 +35,23 @@
# #
# ***** END LICENSE BLOCK ***** # ***** END LICENSE BLOCK *****
# this file is used directly during configure as well as included from Makefile.in
DEVENV_FLAG=- DEVENV_FLAG=-
CC=cl -O2 CC=cl -O2
MOZCE_DEVENV=vs$(MOZ_MSVCVERSION) MOZCE_DEVENV=vs$(MOZ_MSVCVERSION)
MOZCE_SHUNT_SLN=$(TOPSRCDIR)/build/wince/shunt/build/$(MOZCE_DEVENV)/mozce_shunt_static.sln
MOZCE_PROJECT="Release|Windows Mobile 6 Professional SDK (ARMV4I)"
MOZCE_SHUNT_DLL=../shunt/build/$(MOZCE_DEVENV)/mozce_shunt.dll
MOZCE_TOOLS_DIR=$(TOPSRCDIR)/build/wince/tools MOZCE_TOOLS_DIR=$(TOPSRCDIR)/build/wince/tools
ifdef MOZCE_NOT_CONFIGURE
MOZCE_TOOLS_BIN_DIR=$(OBJDIR)/build/wince/tools
else
# if we're building the tools in configure, we want them to go directly to the sdk
# so they get rebuilt once we have a full environment
MOZCE_TOOLS_BIN_DIR=$(OBJDIR)/dist/sdk/bin MOZCE_TOOLS_BIN_DIR=$(OBJDIR)/dist/sdk/bin
endif
BUILD_SWITCH=$(DEVENV_FLAG)Build BUILD_SWITCH=$(DEVENV_FLAG)Build
REBUILD_SWITCH=$(DEVENV_FLAG)Rebuild REBUILD_SWITCH=$(DEVENV_FLAG)Rebuild
@ -81,55 +87,49 @@ endif
endif endif
ifdef VPATH ifdef VPATH
CFLAGS += -DSHUNT_INC='"$(OBJDIR)/dist/include/shunt"' CFLAGS += -DSHUNT_INC='"$(OBJDIR)/dist/include/mozce_shunt"'
else CFLAGS += -DSHUNT_LIB='"$(OBJDIR)/dist/lib"'
CFLAGS += -DSHUNT_INC='"$(TOPSRCDIR)/build/wince/shunt/include"' CFLAGS += -DJEMALLOC_LIB='"$(OBJDIR)/dist/lib/jemalloc.lib"'
endif endif
CFLAGS += -DEBUG -Zi CFLAGS += -DEBUG -Zi
all: libs SDK_TOOLS = $(MOZCE_TOOLS_BIN_DIR)/arm-wince-as.exe \
$(MOZCE_TOOLS_BIN_DIR)/arm-wince-gcc.exe \
$(MOZCE_TOOLS_BIN_DIR)/arm-wince-lib.exe \
$(MOZCE_TOOLS_BIN_DIR)/arm-wince-link.exe \
$(MOZCE_TOOLS_BIN_DIR)/arm-wince-res.exe
libs: output_some_env \ all: libs export
$(MOZCE_TOOLS_BIN_DIR)/arm-wince-as.exe \
$(MOZCE_TOOLS_BIN_DIR)/arm-wince-gcc.exe \ libs: $(SDK_TOOLS)
$(MOZCE_TOOLS_BIN_DIR)/arm-wince-lib.exe \
$(MOZCE_TOOLS_BIN_DIR)/arm-wince-link.exe \
$(MOZCE_TOOLS_BIN_DIR)/arm-wince-res.exe
devenv $(MOZCE_SHUNT_SLN) $(BUILD_SWITCH) $(MOZCE_PROJECT)
clean: clobber clean: clobber
clobber: clobber:
rm $(MOZCE_TOOLS_BIN_DIR)/arm-wince-as.exe rm $(MOZCE_TOOLS_BIN_DIR)/*.exe
rm $(MOZCE_TOOLS_BIN_DIR)/arm-wince-gcc.exe
rm $(MOZCE_TOOLS_BIN_DIR)/arm-wince-lib.exe
rm $(MOZCE_TOOLS_BIN_DIR)/arm-wince-link.exe
rm $(MOZCE_TOOLS_BIN_DIR)/arm-wince-res.exe
devenv $(MOZCE_SHUNT_SLN) $(CLEAN_SWITCH) $(MOZCE_PROJECT)
output_some_env:
@echo FOUND $(MOZCE_DEVENV)
@echo FOUND $(MOZCE_DEVENV): VSINSTALLDIR=$(VSINSTALLDIR) / MINGW32=$(MINGW32) / MSYSTEM=$(MSYSTEM)
@echo FOUND $(MOZCE_DEVENV)
$(MOZCE_TOOLS_BIN_DIR)/arm-wince-as.exe: $(MOZCE_TOOLS_DIR)/arm-wince-as.c $(MOZCE_TOOLS_DIR)/toolspath.h $(MOZCE_TOOLS_DIR)/Makefile $(MOZCE_TOOLS_BIN_DIR)/arm-wince-as.exe: $(MOZCE_TOOLS_DIR)/arm-wince-as.c $(MOZCE_TOOLS_DIR)/toolspath.h $(MOZCE_TOOLS_DIR)/Makefile
mkdir -p $(MOZCE_TOOLS_BIN_DIR); mkdir -p $(MOZCE_TOOLS_BIN_DIR);
$(CC) $(CFLAGS) -Fe$@ $(MOZCE_TOOLS_DIR)/arm-wince-as.c $(CC) $(CFLAGS) -Fo$(MOZCE_TOOLS_BIN_DIR) -Fe$@ $(MOZCE_TOOLS_DIR)/arm-wince-as.c
$(MOZCE_TOOLS_BIN_DIR)/arm-wince-gcc.exe: $(MOZCE_TOOLS_DIR)/arm-wince-gcc.c $(MOZCE_TOOLS_DIR)/toolspath.h $(MOZCE_TOOLS_DIR)/Makefile $(MOZCE_TOOLS_BIN_DIR)/arm-wince-gcc.exe: $(MOZCE_TOOLS_DIR)/arm-wince-gcc.c $(MOZCE_TOOLS_DIR)/toolspath.h $(MOZCE_TOOLS_DIR)/Makefile
mkdir -p $(MOZCE_TOOLS_BIN_DIR); mkdir -p $(MOZCE_TOOLS_BIN_DIR);
$(CC) $(CFLAGS) -Fe$@ $(MOZCE_TOOLS_DIR)/arm-wince-gcc.c $(CC) $(CFLAGS) -Fo$(MOZCE_TOOLS_BIN_DIR) -Fe$@ $(MOZCE_TOOLS_DIR)/arm-wince-gcc.c
$(MOZCE_TOOLS_BIN_DIR)/arm-wince-lib.exe: $(MOZCE_TOOLS_DIR)/arm-wince-lib.c $(MOZCE_TOOLS_DIR)/toolspath.h $(MOZCE_TOOLS_DIR)/Makefile $(MOZCE_TOOLS_BIN_DIR)/arm-wince-lib.exe: $(MOZCE_TOOLS_DIR)/arm-wince-lib.c $(MOZCE_TOOLS_DIR)/toolspath.h $(MOZCE_TOOLS_DIR)/Makefile
mkdir -p $(MOZCE_TOOLS_BIN_DIR); mkdir -p $(MOZCE_TOOLS_BIN_DIR);
$(CC) $(CFLAGS) -Fe$@ $(MOZCE_TOOLS_DIR)/arm-wince-lib.c $(CC) $(CFLAGS) -Fo$(MOZCE_TOOLS_BIN_DIR) -Fe$@ $(MOZCE_TOOLS_DIR)/arm-wince-lib.c
$(MOZCE_TOOLS_BIN_DIR)/arm-wince-link.exe: $(MOZCE_TOOLS_DIR)/arm-wince-link.c $(MOZCE_TOOLS_DIR)/toolspath.h $(MOZCE_TOOLS_DIR)/Makefile $(MOZCE_TOOLS_BIN_DIR)/arm-wince-link.exe: $(MOZCE_TOOLS_DIR)/arm-wince-link.c $(MOZCE_TOOLS_DIR)/toolspath.h $(MOZCE_TOOLS_DIR)/Makefile
mkdir -p $(MOZCE_TOOLS_BIN_DIR); mkdir -p $(MOZCE_TOOLS_BIN_DIR);
$(CC) $(CFLAGS) -Fe$@ $(MOZCE_TOOLS_DIR)/arm-wince-link.c $(CC) $(CFLAGS) -Fo$(MOZCE_TOOLS_BIN_DIR) -Fe$@ $(MOZCE_TOOLS_DIR)/arm-wince-link.c
$(MOZCE_TOOLS_BIN_DIR)/arm-wince-res.exe: $(MOZCE_TOOLS_DIR)/arm-wince-res.c $(MOZCE_TOOLS_DIR)/toolspath.h $(MOZCE_TOOLS_DIR)/Makefile $(MOZCE_TOOLS_BIN_DIR)/arm-wince-res.exe: $(MOZCE_TOOLS_DIR)/arm-wince-res.c $(MOZCE_TOOLS_DIR)/toolspath.h $(MOZCE_TOOLS_DIR)/Makefile
mkdir -p $(MOZCE_TOOLS_BIN_DIR); mkdir -p $(MOZCE_TOOLS_BIN_DIR);
$(CC) $(CFLAGS) -Fe$@ $(MOZCE_TOOLS_DIR)/arm-wince-res.c $(CC) $(CFLAGS) -Fo$(MOZCE_TOOLS_BIN_DIR) -Fe$@ $(MOZCE_TOOLS_DIR)/arm-wince-res.c
export:: $(SDK_TOOLS)
mkdir -p $(OBJDIR)/dist/sdk/bin
cp $^ $(OBJDIR)/dist/sdk/bin

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

@ -43,9 +43,14 @@ VPATH = @srcdir@
TOPSRCDIR = $(topsrcdir) TOPSRCDIR = $(topsrcdir)
OBJDIR = $(shell cd $(DEPTH); pwd -W) OBJDIR = $(shell cd $(DEPTH); pwd -W)
CFLAGS += -DHAVE_SHUNT
MOZCE_NOT_CONFIGURE=1
include $(DEPTH)/config/autoconf.mk include $(DEPTH)/config/autoconf.mk
ifdef MOZ_MEMORY
CFLAGS += -DMOZ_MEMORY
endif
include $(topsrcdir)/build/wince/tools/Makefile include $(topsrcdir)/build/wince/tools/Makefile
export:: export::

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

@ -13,9 +13,16 @@ main(int argc, char **argv)
char outputFileArg[1000]; char outputFileArg[1000];
args[i++] = CL_PATH; args[i++] = CL_PATH;
args[i++] = "/I\"" SHUNT_INC "\"";
args[i++] = "/FI\"mozce_shunt.h\"";
#ifdef HAVE_SHUNT // simple test to see if we're in configure or not
if(!getenv("NO_SHUNT")) {
args[i++] = "/I\"" SHUNT_INC "\"";
args[i++] = "/FI\"mozce_shunt.h\"";
}
#endif
#ifdef MOZ_MEMORY
args[i++] = "/DMOZ_MEMORY";
#endif
args[i++] = "/DMOZCE_STATIC_BUILD"; args[i++] = "/DMOZCE_STATIC_BUILD";
args[i++] = "/DUNICODE"; args[i++] = "/DUNICODE";
args[i++] = "/D_UNICODE_"; args[i++] = "/D_UNICODE_";
@ -30,7 +37,6 @@ main(int argc, char **argv)
args[i++] = "/D_WINDOWS"; args[i++] = "/D_WINDOWS";
args[i++] = "/DNO_ERRNO"; args[i++] = "/DNO_ERRNO";
args[i++] = "/Zc:wchar_t-"; //
args[i++] = "/GS-"; // disable security checks args[i++] = "/GS-"; // disable security checks
args[i++] = "/GR-"; // disable C++ RTTI args[i++] = "/GR-"; // disable C++ RTTI
@ -73,16 +79,19 @@ main(int argc, char **argv)
args[i++] = "/LIBPATH:\"" WCE_LIB "\""; args[i++] = "/LIBPATH:\"" WCE_LIB "\"";
args[i++] = "/LIBPATH:\"" WCE_CRT "\""; args[i++] = "/LIBPATH:\"" WCE_CRT "\"";
args[i++] = "/LIBPATH:\"" SHUNT_LIB "\""; args[i++] = "/NODEFAULTLIB";
args[i++] = "mozce_shunt.lib"; #ifdef MOZ_MEMORY
args[i++] = JEMALLOC_LIB;
#endif
#ifdef HAVE_SHUNT // simple test to see if we're in configure or not
if(!getenv("NO_SHUNT")) {
args[i++] = "/LIBPATH:\"" SHUNT_LIB "\"";
args[i++] = "mozce_shunt.lib";
}
#endif
args[i++] = "winsock.lib"; args[i++] = "winsock.lib";
args[i++] = "corelibc.lib"; args[i++] = "corelibc.lib";
args[i++] = "coredll.lib"; args[i++] = "coredll.lib";
//args[i++] = "/NODEFAULTLIB:LIBC";
args[i++] = "/NODEFAULTLIB:OLDNAMES";
} }
args[i] = NULL; args[i] = NULL;

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

@ -13,17 +13,22 @@ main(int argc, char **argv)
args[i++] = "/LIBPATH:\"" WCE_LIB "\""; args[i++] = "/LIBPATH:\"" WCE_LIB "\"";
args[i++] = "/LIBPATH:\"" WCE_CRT "\""; args[i++] = "/LIBPATH:\"" WCE_CRT "\"";
args[i++] = "/LIBPATH:\"" SHUNT_LIB "\""; args[i++] = "/NODEFAULTLIB";
#ifdef MOZ_MEMORY
args[i++] = JEMALLOC_LIB;
#endif
#ifdef HAVE_SHUNT // simple test to see if we're in configure or not
if(getenv("NO_SHUNT") == NULL) {
args[i++] = "/LIBPATH:\"" SHUNT_LIB "\"";
args[i++] = "mozce_shunt.lib";
}
#endif
args[i++] = "corelibc.lib"; args[i++] = "corelibc.lib";
args[i++] = "coredll.lib"; args[i++] = "coredll.lib";
args[i++] = "ceshell.lib"; args[i++] = "ceshell.lib";
args[i++] = "mmtimer.lib"; args[i++] = "mmtimer.lib";
args[i++] = "mozce_shunt.lib";
args[i++] = "/NODEFAULTLIB:LIBC";
args[i++] = "/NODEFAULTLIB:OLDNAMES";
args[i++] = "/NODEFAULTLIB:MSVCRT";
// if -DLL is not passed, then change the entry to 'main' // if -DLL is not passed, then change the entry to 'main'
while(argv[j]) { while(argv[j]) {

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

@ -11,7 +11,7 @@
#define WCE_INC VC_PATH "ce\\include" #define WCE_INC VC_PATH "ce\\include"
#ifndef SHUNT_LIB #ifndef SHUNT_LIB
#define SHUNT_LIB TOPSRCDIR "/build/wince/shunt/build/" MOZCE_DEVENV #define SHUNT_LIB ""
#endif #endif
#ifndef SHUNT_INC #ifndef SHUNT_INC

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

@ -37,7 +37,7 @@
*/ */
const MANIFESTS = [ const MANIFESTS = [
do_get_file("chrome/test/unit/data/test_bug292789.manifest") do_get_file("data/test_bug292789.manifest")
]; ];
registerManifests(MANIFESTS); registerManifests(MANIFESTS);

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

@ -38,7 +38,7 @@
var MANIFESTS = [ var MANIFESTS = [
do_get_file("chrome/test/unit/data/test_bug380398.manifest") do_get_file("data/test_bug380398.manifest")
]; ];
registerManifests(MANIFESTS); registerManifests(MANIFESTS);
@ -83,7 +83,7 @@ var chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"]
.getService(Ci.nsIChromeRegistry); .getService(Ci.nsIChromeRegistry);
chromeReg.checkForNewChrome(); chromeReg.checkForNewChrome();
var target = gIOS.newFileURI(do_get_file("chrome/test/unit/data")); var target = gIOS.newFileURI(do_get_file("data"));
target = target.spec + "test/test.xul"; target = target.spec + "test/test.xul";
function test_succeeded_mapping(namespace) function test_succeeded_mapping(namespace)

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

@ -37,7 +37,7 @@
*/ */
var MANIFESTS = [ var MANIFESTS = [
do_get_file("chrome/test/unit/data/test_bug397073.manifest") do_get_file("data/test_bug397073.manifest")
]; ];
@ -83,7 +83,7 @@ var chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"]
.getService(Ci.nsIChromeRegistry); .getService(Ci.nsIChromeRegistry);
chromeReg.checkForNewChrome(); chromeReg.checkForNewChrome();
var target = gIOS.newFileURI(do_get_file("chrome/test/unit/data")); var target = gIOS.newFileURI(do_get_file("data"));
target = target.spec + "test/test.xul"; target = target.spec + "test/test.xul";
function test_succeeded_mapping(namespace) function test_succeeded_mapping(namespace)

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

@ -37,7 +37,7 @@
*/ */
var MANIFESTS = [ var MANIFESTS = [
do_get_file("chrome/test/unit/data/test_bug399707.manifest") do_get_file("data/test_bug399707.manifest")
]; ];
registerManifests(MANIFESTS); registerManifests(MANIFESTS);
@ -82,7 +82,7 @@ var chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"]
.getService(Ci.nsIChromeRegistry); .getService(Ci.nsIChromeRegistry);
chromeReg.checkForNewChrome(); chromeReg.checkForNewChrome();
var target = gIOS.newFileURI(do_get_file("chrome/test/unit/data")); var target = gIOS.newFileURI(do_get_file("data"));
target = target.spec + "test/test.xul"; target = target.spec + "test/test.xul";
function test_succeeded_mapping(namespace) function test_succeeded_mapping(namespace)

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

@ -37,7 +37,7 @@
*/ */
var MANIFESTS = [ var MANIFESTS = [
do_get_file("chrome/test/unit/data/test_bug401153.manifest") do_get_file("data/test_bug401153.manifest")
]; ];
registerManifests(MANIFESTS); registerManifests(MANIFESTS);
@ -106,7 +106,7 @@ function test_failed_mapping(namespace)
function run_test() function run_test()
{ {
var data = gIOS.newFileURI(do_get_file("chrome/test/unit/data")).spec; var data = gIOS.newFileURI(do_get_file("data")).spec;
test_succeeded_mapping("test1", data + "test1/"); test_succeeded_mapping("test1", data + "test1/");
test_succeeded_mapping("test3", "jar:" + data + "test3.jar!/resources/"); test_succeeded_mapping("test3", "jar:" + data + "test3.jar!/resources/");
test_failed_mapping("test4"); test_failed_mapping("test4");

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

@ -38,7 +38,7 @@
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
let manifests = [ let manifests = [
do_get_file("chrome/test/unit/data/test_data_protocol_registration.manifest"), do_get_file("data/test_data_protocol_registration.manifest"),
]; ];
registerManifests(manifests); registerManifests(manifests);

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

@ -38,7 +38,7 @@
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
let manifests = [ let manifests = [
do_get_file("chrome/test/unit/data/test_no_remote_registration.manifest"), do_get_file("data/test_no_remote_registration.manifest"),
]; ];
registerManifests(manifests); registerManifests(manifests);

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

@ -168,7 +168,6 @@ endif # MOZ_BUILD_PROJECTS
# 'configure' scripts generated by autoconf. # 'configure' scripts generated by autoconf.
CONFIGURES := $(TOPSRCDIR)/configure CONFIGURES := $(TOPSRCDIR)/configure
CONFIGURES += $(TOPSRCDIR)/nsprpub/configure
CONFIGURES += $(TOPSRCDIR)/js/src/configure CONFIGURES += $(TOPSRCDIR)/js/src/configure
####################################################################### #######################################################################
@ -290,7 +289,7 @@ CONFIG_STATUS_DEPS := \
$(wildcard $(CONFIGURES)) \ $(wildcard $(CONFIGURES)) \
$(TOPSRCDIR)/allmakefiles.sh \ $(TOPSRCDIR)/allmakefiles.sh \
$(TOPSRCDIR)/.mozconfig.mk \ $(TOPSRCDIR)/.mozconfig.mk \
$(wildcard $(TOPSRCDIR)/directory/c-sdk/configure) \ $(wildcard $(TOPSRCDIR)/nsprpub/configure) \
$(wildcard $(TOPSRCDIR)/config/milestone.txt) \ $(wildcard $(TOPSRCDIR)/config/milestone.txt) \
$(wildcard $(TOPSRCDIR)/config/chrome-versions.sh) \ $(wildcard $(TOPSRCDIR)/config/chrome-versions.sh) \
$(wildcard $(addsuffix confvars.sh,$(wildcard $(TOPSRCDIR)/*/))) \ $(wildcard $(addsuffix confvars.sh,$(wildcard $(TOPSRCDIR)/*/))) \

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

@ -159,7 +159,7 @@ MOZ_WIDGET_SUPPORT_LIBS = $(DIST)/lib/$(LIB_PREFIX)widgetsupport_s.$(LIB_SUFF
ifdef MOZ_MEMORY ifdef MOZ_MEMORY
ifneq ($(OS_ARCH),WINNT) ifneq ($(OS_ARCH),WINNT)
JEMALLOC_LIBS = $(MKSHLIB_FORCE_ALL) $(call EXPAND_LIBNAME,jemalloc) $(MKSHLIB_UNFORCE_ALL) JEMALLOC_LIBS = $(MKSHLIB_FORCE_ALL) $(call EXPAND_LIBNAME_PATH,jemalloc,$(DIST)/lib) $(MKSHLIB_UNFORCE_ALL)
endif endif
endif endif

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

@ -131,9 +131,15 @@ endif
testxpcobjdir = $(DEPTH)/_tests/xpcshell testxpcobjdir = $(DEPTH)/_tests/xpcshell
# Test file installation # Test file installation
ifdef NSINSTALL_BIN
# nsinstall in moztools can't recursively copy directories, so use nsinstall.py
TEST_INSTALLER = $(PYTHON) $(topsrcdir)/config/nsinstall.py
else
TEST_INSTALLER = $(INSTALL)
endif
define _INSTALL_TESTS define _INSTALL_TESTS
$(INSTALL) $(wildcard $(srcdir)/$(dir)/*.js) $(testxpcobjdir)/$(MODULE)/$(dir) $(TEST_INSTALLER) $(wildcard $(srcdir)/$(dir)/*) $(testxpcobjdir)/$(MODULE)/$(dir)
endef # do not remove the blank line! endef # do not remove the blank line!
@ -141,6 +147,9 @@ SOLO_FILE ?= $(error Specify a test filename in SOLO_FILE when using check-inter
libs:: libs::
$(foreach dir,$(XPCSHELL_TESTS),$(_INSTALL_TESTS)) $(foreach dir,$(XPCSHELL_TESTS),$(_INSTALL_TESTS))
$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl \
$(testxpcobjdir)/all-test-dirs.list \
$(addprefix $(MODULE)/,$(XPCSHELL_TESTS))
testxpcsrcdir = $(topsrcdir)/testing/xpcshell testxpcsrcdir = $(topsrcdir)/testing/xpcshell
@ -149,7 +158,6 @@ check::
$(PYTHON) -u \ $(PYTHON) -u \
$(testxpcsrcdir)/runxpcshelltests.py \ $(testxpcsrcdir)/runxpcshelltests.py \
$(DIST)/bin/xpcshell \ $(DIST)/bin/xpcshell \
$(topsrcdir) \
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir)) $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
# Execute a single test, specified in $(SOLO_FILE), but don't automatically # Execute a single test, specified in $(SOLO_FILE), but don't automatically
@ -161,7 +169,6 @@ check-interactive::
--test=$(SOLO_FILE) \ --test=$(SOLO_FILE) \
--interactive \ --interactive \
$(DIST)/bin/xpcshell \ $(DIST)/bin/xpcshell \
$(topsrcdir) \
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir)) $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
# Execute a single test, specified in $(SOLO_FILE) # Execute a single test, specified in $(SOLO_FILE)
@ -170,7 +177,6 @@ check-one::
$(testxpcsrcdir)/runxpcshelltests.py \ $(testxpcsrcdir)/runxpcshelltests.py \
--test=$(SOLO_FILE) \ --test=$(SOLO_FILE) \
$(DIST)/bin/xpcshell \ $(DIST)/bin/xpcshell \
$(topsrcdir) \
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir)) $(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
endif # XPCSHELL_TESTS endif # XPCSHELL_TESTS

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

@ -5872,7 +5872,6 @@ if test -n "$MOZ_TREE_FREETYPE"; then
AC_SUBST(MOZ_TREE_FREETYPE) AC_SUBST(MOZ_TREE_FREETYPE)
MOZ_ENABLE_CAIRO_FT=1 MOZ_ENABLE_CAIRO_FT=1
FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1" FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
FC_FONT_FEATURE="#define CAIRO_DISABLE_FONTCONFIG 1"
FT2_CFLAGS="-I${topsrcdir}/modules/freetype2/include" FT2_CFLAGS="-I${topsrcdir}/modules/freetype2/include"
CAIRO_FT_CFLAGS="-I${topsrcdir}/modules/freetype2/include" CAIRO_FT_CFLAGS="-I${topsrcdir}/modules/freetype2/include"
FT2_LIBS="${LIBXUL_DIST}/lib/freetype2.lib" FT2_LIBS="${LIBXUL_DIST}/lib/freetype2.lib"
@ -6589,6 +6588,10 @@ if test "$MOZ_MEMORY"; then
DLLFLAGS="$DLLFLAGS -MANIFEST:NO" DLLFLAGS="$DLLFLAGS -MANIFEST:NO"
export DLLFLAGS export DLLFLAGS
;; ;;
*wince)
AC_DEFINE(MOZ_MEMORY_WINCE)
AC_DEFINE(MOZ_MEMORY_WINDOWS)
;;
*) *)
AC_MSG_ERROR([--enable-jemalloc not supported on ${target}]) AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
;; ;;
@ -7543,6 +7546,7 @@ if test "$MOZ_TREE_CAIRO"; then
PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1" PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1" PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1" FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
MOZ_ENABLE_CAIRO_FT=1 MOZ_ENABLE_CAIRO_FT=1
CAIRO_FT_CFLAGS="$FT2_CFLAGS" CAIRO_FT_CFLAGS="$FT2_CFLAGS"
fi fi
@ -7566,6 +7570,7 @@ if test "$MOZ_TREE_CAIRO"; then
if test "$MOZ_WIDGET_TOOLKIT" = "os2"; then if test "$MOZ_WIDGET_TOOLKIT" = "os2"; then
OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1" OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1" FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1" PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
MOZ_ENABLE_CAIRO_FT=1 MOZ_ENABLE_CAIRO_FT=1
CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include" CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
@ -7575,6 +7580,7 @@ if test "$MOZ_TREE_CAIRO"; then
PKG_CHECK_MODULES(CAIRO_FT, fontconfig freetype2) PKG_CHECK_MODULES(CAIRO_FT, fontconfig freetype2)
BEOS_SURFACE_FEATURE="#define CAIRO_HAS_BEOS_SURFACE 1" BEOS_SURFACE_FEATURE="#define CAIRO_HAS_BEOS_SURFACE 1"
FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1" FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
MOZ_ENABLE_CAIRO_FT=1 MOZ_ENABLE_CAIRO_FT=1
fi fi
AC_SUBST(MOZ_ENABLE_CAIRO_FT) AC_SUBST(MOZ_ENABLE_CAIRO_FT)

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

@ -99,7 +99,6 @@ class nsIRunnable;
class nsIInterfaceRequestor; class nsIInterfaceRequestor;
template<class E> class nsCOMArray; template<class E> class nsCOMArray;
class nsIPref; class nsIPref;
class nsVoidArray;
struct JSRuntime; struct JSRuntime;
class nsICaseConversion; class nsICaseConversion;
class nsIUGenCategory; class nsIUGenCategory;
@ -212,12 +211,9 @@ public:
/* /*
* This method fills the |aArray| with all ancestor nodes of |aNode| * This method fills the |aArray| with all ancestor nodes of |aNode|
* including |aNode| at the zero index. * including |aNode| at the zero index.
*
* These elements were |nsIDOMNode*|s before casting to |void*| and must
* be cast back to |nsIDOMNode*| on usage, or bad things will happen.
*/ */
static nsresult GetAncestors(nsIDOMNode* aNode, static nsresult GetAncestors(nsIDOMNode* aNode,
nsVoidArray* aArray); nsTArray<nsIDOMNode*>* aArray);
/* /*
* This method fills |aAncestorNodes| with all ancestor nodes of |aNode| * This method fills |aAncestorNodes| with all ancestor nodes of |aNode|
@ -225,16 +221,12 @@ public:
* For each ancestor, there is a corresponding element in |aAncestorOffsets| * For each ancestor, there is a corresponding element in |aAncestorOffsets|
* which is the IndexOf the child in relation to its parent. * which is the IndexOf the child in relation to its parent.
* *
* The elements of |aAncestorNodes| were |nsIContent*|s before casting to
* |void*| and must be cast back to |nsIContent*| on usage, or bad things
* will happen.
*
* This method just sucks. * This method just sucks.
*/ */
static nsresult GetAncestorsAndOffsets(nsIDOMNode* aNode, static nsresult GetAncestorsAndOffsets(nsIDOMNode* aNode,
PRInt32 aOffset, PRInt32 aOffset,
nsVoidArray* aAncestorNodes, nsTArray<nsIContent*>* aAncestorNodes,
nsVoidArray* aAncestorOffsets); nsTArray<PRInt32>* aAncestorOffsets);
/* /*
* The out parameter, |aCommonAncestor| will be the closest node, if any, * The out parameter, |aCommonAncestor| will be the closest node, if any,
@ -837,7 +829,7 @@ public:
static nsresult ReleasePtrOnShutdown(nsISupports** aSupportsPtr) { static nsresult ReleasePtrOnShutdown(nsISupports** aSupportsPtr) {
NS_ASSERTION(aSupportsPtr, "Expect to crash!"); NS_ASSERTION(aSupportsPtr, "Expect to crash!");
NS_ASSERTION(*aSupportsPtr, "Expect to crash!"); NS_ASSERTION(*aSupportsPtr, "Expect to crash!");
return sPtrsToPtrsToRelease->AppendElement(aSupportsPtr) ? NS_OK : return sPtrsToPtrsToRelease->AppendElement(aSupportsPtr) != nsnull ? NS_OK :
NS_ERROR_OUT_OF_MEMORY; NS_ERROR_OUT_OF_MEMORY;
} }
@ -1463,7 +1455,7 @@ private:
static nsIUGenCategory* sGenCat; static nsIUGenCategory* sGenCat;
// Holds pointers to nsISupports* that should be released at shutdown // Holds pointers to nsISupports* that should be released at shutdown
static nsVoidArray* sPtrsToPtrsToRelease; static nsTArray<nsISupports**>* sPtrsToPtrsToRelease;
static nsIScriptRuntime* sScriptRuntimes[NS_STID_ARRAY_UBOUND]; static nsIScriptRuntime* sScriptRuntimes[NS_STID_ARRAY_UBOUND];
static PRInt32 sScriptRootCount[NS_STID_ARRAY_UBOUND]; static PRInt32 sScriptRootCount[NS_STID_ARRAY_UBOUND];

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

@ -48,7 +48,6 @@
class nsIAtom; class nsIAtom;
class nsIDocument; class nsIDocument;
class nsPresContext; class nsPresContext;
class nsVoidArray;
class nsIDOMEvent; class nsIDOMEvent;
class nsIContent; class nsIContent;
class nsIEventListenerManager; class nsIEventListenerManager;

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

@ -101,8 +101,8 @@ class nsFrameLoader;
// IID for the nsIDocument interface // IID for the nsIDocument interface
#define NS_IDOCUMENT_IID \ #define NS_IDOCUMENT_IID \
{ 0xdd9bd470, 0x6315, 0x4e67, \ { 0x6e467d95, 0x9934, 0x422a, \
{ 0xa8, 0x8a, 0x78, 0xbf, 0x92, 0xb4, 0x5a, 0xdf } } { 0x81, 0x07, 0x3f, 0xff, 0xe1, 0x38, 0xe6, 0x1e } }
// Flag for AddStyleSheet(). // Flag for AddStyleSheet().
#define NS_STYLESHEET_FROM_CATALOG (1 << 0) #define NS_STYLESHEET_FROM_CATALOG (1 << 0)
@ -125,8 +125,7 @@ public:
mCompatMode(eCompatibility_FullStandards), mCompatMode(eCompatibility_FullStandards),
mIsInitialDocumentInWindow(PR_FALSE), mIsInitialDocumentInWindow(PR_FALSE),
mMayStartLayout(PR_TRUE), mMayStartLayout(PR_TRUE),
mPartID(0), mPartID(0)
mJSObject(nsnull)
{ {
mParentPtrBits |= PARENT_BIT_INDOCUMENT; mParentPtrBits |= PARENT_BIT_INDOCUMENT;
} }
@ -995,16 +994,6 @@ public:
mMayStartLayout = aMayStartLayout; mMayStartLayout = aMayStartLayout;
} }
JSObject* GetJSObject() const
{
return mJSObject;
}
void SetJSObject(JSObject *aJSObject)
{
mJSObject = aJSObject;
}
// This method should return an addrefed nsIParser* or nsnull. Implementations // This method should return an addrefed nsIParser* or nsnull. Implementations
// should transfer ownership of the parser to the caller. // should transfer ownership of the parser to the caller.
virtual already_AddRefed<nsIParser> GetFragmentParser() { virtual already_AddRefed<nsIParser> GetFragmentParser() {
@ -1247,12 +1236,6 @@ protected:
nsCOMPtr<nsIDocument> mDisplayDocument; nsCOMPtr<nsIDocument> mDisplayDocument;
PRUint32 mEventsSuppressed; PRUint32 mEventsSuppressed;
private:
// JSObject cache. Only to be used for performance
// optimizations. This will be set once this document is touched
// from JS, and it will be unset once the JSObject is finalized.
JSObject *mJSObject;
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocument, NS_IDOCUMENT_IID) NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocument, NS_IDOCUMENT_IID)

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

@ -59,7 +59,6 @@ class nsEventChainPreVisitor;
class nsEventChainPostVisitor; class nsEventChainPostVisitor;
class nsIEventListenerManager; class nsIEventListenerManager;
class nsIPrincipal; class nsIPrincipal;
class nsVoidArray;
class nsIMutationObserver; class nsIMutationObserver;
class nsChildContentList; class nsChildContentList;
class nsNodeWeakReference; class nsNodeWeakReference;

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

@ -39,9 +39,11 @@
#ifndef nsXMLNameSpaceMap_h_ #ifndef nsXMLNameSpaceMap_h_
#define nsXMLNameSpaceMap_h_ #define nsXMLNameSpaceMap_h_
#include "nsVoidArray.h" #include "nsString.h"
#include "nsTArray.h"
class nsIAtom; class nsIAtom;
class nsNameSpaceEntry;
/** /**
* nsXMLNameSpaceMap contains a set of prefixes which are mapped onto * nsXMLNameSpaceMap contains a set of prefixes which are mapped onto
@ -94,7 +96,7 @@ public:
private: private:
nsXMLNameSpaceMap() NS_HIDDEN; // use Create() to create new instances nsXMLNameSpaceMap() NS_HIDDEN; // use Create() to create new instances
nsVoidArray mNameSpaces; nsTArray<nsNameSpaceEntry*> mNameSpaces;
}; };
#endif #endif

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

@ -47,7 +47,7 @@
#include "nsIComponentManager.h" #include "nsIComponentManager.h"
#include "nsContentCID.h" #include "nsContentCID.h"
#include "nsLayoutCID.h" #include "nsLayoutCID.h"
#include "nsVoidArray.h" #include "nsTArray.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsINode.h" #include "nsINode.h"
@ -155,19 +155,19 @@ public:
protected: protected:
nsINode* GetDeepFirstChild(nsINode *aRoot, nsVoidArray *aIndexes); nsINode* GetDeepFirstChild(nsINode *aRoot, nsTArray<PRInt32> *aIndexes);
nsINode* GetDeepLastChild(nsINode *aRoot, nsVoidArray *aIndexes); nsINode* GetDeepLastChild(nsINode *aRoot, nsTArray<PRInt32> *aIndexes);
// Get the next sibling of aNode. Note that this will generally return null // Get the next sibling of aNode. Note that this will generally return null
// if aNode happens not to be a content node. That's OK. // if aNode happens not to be a content node. That's OK.
nsINode* GetNextSibling(nsINode *aNode, nsVoidArray *aIndexes); nsINode* GetNextSibling(nsINode *aNode, nsTArray<PRInt32> *aIndexes);
// Get the prev sibling of aNode. Note that this will generally return null // Get the prev sibling of aNode. Note that this will generally return null
// if aNode happens not to be a content node. That's OK. // if aNode happens not to be a content node. That's OK.
nsINode* GetPrevSibling(nsINode *aNode, nsVoidArray *aIndexes); nsINode* GetPrevSibling(nsINode *aNode, nsTArray<PRInt32> *aIndexes);
nsINode* NextNode(nsINode *aNode, nsVoidArray *aIndexes); nsINode* NextNode(nsINode *aNode, nsTArray<PRInt32> *aIndexes);
nsINode* PrevNode(nsINode *aNode, nsVoidArray *aIndexes); nsINode* PrevNode(nsINode *aNode, nsTArray<PRInt32> *aIndexes);
// WARNING: This function is expensive // WARNING: This function is expensive
nsresult RebuildIndexStack(); nsresult RebuildIndexStack();
@ -180,7 +180,7 @@ protected:
nsCOMPtr<nsINode> mCommonParent; nsCOMPtr<nsINode> mCommonParent;
// used by nsContentIterator to cache indices // used by nsContentIterator to cache indices
nsAutoVoidArray mIndexes; nsAutoTArray<PRInt32, 8> mIndexes;
// used by nsSubtreeIterator to cache indices. Why put them in the base class? // used by nsSubtreeIterator to cache indices. Why put them in the base class?
// Because otherwise I have to duplicate the routines GetNextSibling etc across both classes, // Because otherwise I have to duplicate the routines GetNextSibling etc across both classes,
@ -539,7 +539,7 @@ nsresult nsContentIterator::RebuildIndexStack()
if (!parent) if (!parent)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
mIndexes.InsertElementAt(NS_INT32_TO_PTR(parent->IndexOf(current)), 0); mIndexes.InsertElementAt(0, parent->IndexOf(current));
current = parent; current = parent;
} }
@ -558,7 +558,8 @@ nsContentIterator::MakeEmpty()
} }
nsINode* nsINode*
nsContentIterator::GetDeepFirstChild(nsINode *aRoot, nsVoidArray *aIndexes) nsContentIterator::GetDeepFirstChild(nsINode *aRoot,
nsTArray<PRInt32> *aIndexes)
{ {
if (!aRoot) { if (!aRoot) {
return nsnull; return nsnull;
@ -572,7 +573,7 @@ nsContentIterator::GetDeepFirstChild(nsINode *aRoot, nsVoidArray *aIndexes)
if (aIndexes) if (aIndexes)
{ {
// Add this node to the stack of indexes // Add this node to the stack of indexes
aIndexes->AppendElement(NS_INT32_TO_PTR(0)); aIndexes->AppendElement(0);
} }
n = nChild; n = nChild;
nChild = n->GetChildAt(0); nChild = n->GetChildAt(0);
@ -582,7 +583,7 @@ nsContentIterator::GetDeepFirstChild(nsINode *aRoot, nsVoidArray *aIndexes)
} }
nsINode* nsINode*
nsContentIterator::GetDeepLastChild(nsINode *aRoot, nsVoidArray *aIndexes) nsContentIterator::GetDeepLastChild(nsINode *aRoot, nsTArray<PRInt32> *aIndexes)
{ {
if (!aRoot) { if (!aRoot) {
return nsnull; return nsnull;
@ -600,7 +601,7 @@ nsContentIterator::GetDeepLastChild(nsINode *aRoot, nsVoidArray *aIndexes)
if (aIndexes) if (aIndexes)
{ {
// Add this node to the stack of indexes // Add this node to the stack of indexes
aIndexes->AppendElement(NS_INT32_TO_PTR(numChildren)); aIndexes->AppendElement(numChildren);
} }
numChildren = nChild->GetChildCount(); numChildren = nChild->GetChildCount();
n = nChild; n = nChild;
@ -614,7 +615,7 @@ nsContentIterator::GetDeepLastChild(nsINode *aRoot, nsVoidArray *aIndexes)
// Get the next sibling, or parents next sibling, or grandpa's next sibling... // Get the next sibling, or parents next sibling, or grandpa's next sibling...
nsINode * nsINode *
nsContentIterator::GetNextSibling(nsINode *aNode, nsContentIterator::GetNextSibling(nsINode *aNode,
nsVoidArray *aIndexes) nsTArray<PRInt32> *aIndexes)
{ {
if (!aNode) if (!aNode)
return nsnull; return nsnull;
@ -623,13 +624,14 @@ nsContentIterator::GetNextSibling(nsINode *aNode,
if (!parent) if (!parent)
return nsnull; return nsnull;
PRInt32 indx; PRInt32 indx = 0;
if (aIndexes) NS_ASSERTION(!aIndexes || !aIndexes->IsEmpty(),
"ContentIterator stack underflow");
if (aIndexes && !aIndexes->IsEmpty())
{ {
NS_ASSERTION(aIndexes->Count() > 0, "ContentIterator stack underflow");
// use the last entry on the Indexes array for the current index // use the last entry on the Indexes array for the current index
indx = NS_PTR_TO_INT32((*aIndexes)[aIndexes->Count()-1]); indx = (*aIndexes)[aIndexes->Length()-1];
} }
else else
indx = mCachedIndex; indx = mCachedIndex;
@ -648,9 +650,9 @@ nsContentIterator::GetNextSibling(nsINode *aNode,
if ((sib = parent->GetChildAt(++indx))) if ((sib = parent->GetChildAt(++indx)))
{ {
// update index cache // update index cache
if (aIndexes) if (aIndexes && !aIndexes->IsEmpty())
{ {
aIndexes->ReplaceElementAt(NS_INT32_TO_PTR(indx),aIndexes->Count()-1); aIndexes->ElementAt(aIndexes->Length()-1) = indx;
} }
else mCachedIndex = indx; else mCachedIndex = indx;
} }
@ -663,8 +665,8 @@ nsContentIterator::GetNextSibling(nsINode *aNode,
// pop node off the stack, go up one level and return parent or fail. // pop node off the stack, go up one level and return parent or fail.
// Don't leave the index empty, especially if we're // Don't leave the index empty, especially if we're
// returning NULL. This confuses other parts of the code. // returning NULL. This confuses other parts of the code.
if (aIndexes->Count() > 1) if (aIndexes->Length() > 1)
aIndexes->RemoveElementAt(aIndexes->Count()-1); aIndexes->RemoveElementAt(aIndexes->Length()-1);
} }
} }
@ -678,7 +680,7 @@ nsContentIterator::GetNextSibling(nsINode *aNode,
// Get the prev sibling, or parents prev sibling, or grandpa's prev sibling... // Get the prev sibling, or parents prev sibling, or grandpa's prev sibling...
nsINode* nsINode*
nsContentIterator::GetPrevSibling(nsINode *aNode, nsContentIterator::GetPrevSibling(nsINode *aNode,
nsVoidArray *aIndexes) nsTArray<PRInt32> *aIndexes)
{ {
if (!aNode) if (!aNode)
return nsnull; return nsnull;
@ -687,13 +689,14 @@ nsContentIterator::GetPrevSibling(nsINode *aNode,
if (!parent) if (!parent)
return nsnull; return nsnull;
PRInt32 indx; PRInt32 indx = 0;
if (aIndexes) NS_ASSERTION(!aIndexes || !aIndexes->IsEmpty(),
"ContentIterator stack underflow");
if (aIndexes && !aIndexes->IsEmpty())
{ {
NS_ASSERTION(aIndexes->Count() > 0, "ContentIterator stack underflow");
// use the last entry on the Indexes array for the current index // use the last entry on the Indexes array for the current index
indx = NS_PTR_TO_INT32((*aIndexes)[aIndexes->Count()-1]); indx = (*aIndexes)[aIndexes->Length()-1];
} }
else else
indx = mCachedIndex; indx = mCachedIndex;
@ -711,18 +714,18 @@ nsContentIterator::GetPrevSibling(nsINode *aNode,
if (indx > 0 && (sib = parent->GetChildAt(--indx))) if (indx > 0 && (sib = parent->GetChildAt(--indx)))
{ {
// update index cache // update index cache
if (aIndexes) if (aIndexes && !aIndexes->IsEmpty())
{ {
aIndexes->ReplaceElementAt(NS_INT32_TO_PTR(indx),aIndexes->Count()-1); aIndexes->ElementAt(aIndexes->Length()-1) = indx;
} }
else mCachedIndex = indx; else mCachedIndex = indx;
} }
else if (parent != mCommonParent) else if (parent != mCommonParent)
{ {
if (aIndexes) if (aIndexes && !aIndexes->IsEmpty())
{ {
// pop node off the stack, go up one level and try again. // pop node off the stack, go up one level and try again.
aIndexes->RemoveElementAt(aIndexes->Count()-1); aIndexes->RemoveElementAt(aIndexes->Length()-1);
} }
return GetPrevSibling(parent, aIndexes); return GetPrevSibling(parent, aIndexes);
} }
@ -731,7 +734,7 @@ nsContentIterator::GetPrevSibling(nsINode *aNode,
} }
nsINode* nsINode*
nsContentIterator::NextNode(nsINode *aNode, nsVoidArray *aIndexes) nsContentIterator::NextNode(nsINode *aNode, nsTArray<PRInt32> *aIndexes)
{ {
nsINode *n = aNode; nsINode *n = aNode;
nsINode *nextNode = nsnull; nsINode *nextNode = nsnull;
@ -747,7 +750,7 @@ nsContentIterator::NextNode(nsINode *aNode, nsVoidArray *aIndexes)
if (aIndexes) if (aIndexes)
{ {
// push an entry on the index stack // push an entry on the index stack
aIndexes->AppendElement(NS_INT32_TO_PTR(0)); aIndexes->AppendElement(0);
} }
else mCachedIndex = 0; else mCachedIndex = 0;
@ -761,14 +764,15 @@ nsContentIterator::NextNode(nsINode *aNode, nsVoidArray *aIndexes)
{ {
nsINode *parent = n->GetNodeParent(); nsINode *parent = n->GetNodeParent();
nsINode *nSibling = nsnull; nsINode *nSibling = nsnull;
PRInt32 indx; PRInt32 indx = 0;
// get the cached index // get the cached index
if (aIndexes) NS_ASSERTION(!aIndexes || !aIndexes->IsEmpty(),
"ContentIterator stack underflow");
if (aIndexes && !aIndexes->IsEmpty())
{ {
NS_ASSERTION(aIndexes->Count() > 0, "ContentIterator stack underflow");
// use the last entry on the Indexes array for the current index // use the last entry on the Indexes array for the current index
indx = NS_PTR_TO_INT32((*aIndexes)[aIndexes->Count()-1]); indx = (*aIndexes)[aIndexes->Length()-1];
} }
else indx = mCachedIndex; else indx = mCachedIndex;
@ -788,10 +792,10 @@ nsContentIterator::NextNode(nsINode *aNode, nsVoidArray *aIndexes)
if (nSibling) if (nSibling)
{ {
// update cache // update cache
if (aIndexes) if (aIndexes && !aIndexes->IsEmpty())
{ {
// replace an entry on the index stack // replace an entry on the index stack
aIndexes->ReplaceElementAt(NS_INT32_TO_PTR(indx),aIndexes->Count()-1); aIndexes->ElementAt(aIndexes->Length()-1) = indx;
} }
else mCachedIndex = indx; else mCachedIndex = indx;
@ -806,8 +810,8 @@ nsContentIterator::NextNode(nsINode *aNode, nsVoidArray *aIndexes)
// pop an entry off the index stack // pop an entry off the index stack
// Don't leave the index empty, especially if we're // Don't leave the index empty, especially if we're
// returning NULL. This confuses other parts of the code. // returning NULL. This confuses other parts of the code.
if (aIndexes->Count() > 1) if (aIndexes->Length() > 1)
aIndexes->RemoveElementAt(aIndexes->Count()-1); aIndexes->RemoveElementAt(aIndexes->Length()-1);
} }
else mCachedIndex = 0; // this might be wrong, but we are better off guessing else mCachedIndex = 0; // this might be wrong, but we are better off guessing
nextNode = parent; nextNode = parent;
@ -817,7 +821,7 @@ nsContentIterator::NextNode(nsINode *aNode, nsVoidArray *aIndexes)
} }
nsINode* nsINode*
nsContentIterator::PrevNode(nsINode *aNode, nsVoidArray *aIndexes) nsContentIterator::PrevNode(nsINode *aNode, nsTArray<PRInt32> *aIndexes)
{ {
nsINode *prevNode = nsnull; nsINode *prevNode = nsnull;
nsINode *n = aNode; nsINode *n = aNode;
@ -826,14 +830,15 @@ nsContentIterator::PrevNode(nsINode *aNode, nsVoidArray *aIndexes)
{ {
nsINode *parent = n->GetNodeParent(); nsINode *parent = n->GetNodeParent();
nsINode *nSibling = nsnull; nsINode *nSibling = nsnull;
PRInt32 indx; PRInt32 indx = 0;
// get the cached index // get the cached index
if (aIndexes) NS_ASSERTION(!aIndexes || !aIndexes->IsEmpty(),
"ContentIterator stack underflow");
if (aIndexes && !aIndexes->IsEmpty())
{ {
NS_ASSERTION(aIndexes->Count() > 0, "ContentIterator stack underflow");
// use the last entry on the Indexes array for the current index // use the last entry on the Indexes array for the current index
indx = NS_PTR_TO_INT32((*aIndexes)[aIndexes->Count()-1]); indx = (*aIndexes)[aIndexes->Length()-1];
} }
else indx = mCachedIndex; else indx = mCachedIndex;
@ -853,10 +858,10 @@ nsContentIterator::PrevNode(nsINode *aNode, nsVoidArray *aIndexes)
if (indx && (nSibling = parent->GetChildAt(--indx))) if (indx && (nSibling = parent->GetChildAt(--indx)))
{ {
// update cache // update cache
if (aIndexes) if (aIndexes && !aIndexes->IsEmpty())
{ {
// replace an entry on the index stack // replace an entry on the index stack
aIndexes->ReplaceElementAt(NS_INT32_TO_PTR(indx),aIndexes->Count()-1); aIndexes->ElementAt(aIndexes->Length()-1) = indx;
} }
else mCachedIndex = indx; else mCachedIndex = indx;
@ -866,10 +871,10 @@ nsContentIterator::PrevNode(nsINode *aNode, nsVoidArray *aIndexes)
// else it's the parent // else it's the parent
// update cache // update cache
if (aIndexes) if (aIndexes && !aIndexes->IsEmpty())
{ {
// pop an entry off the index stack // pop an entry off the index stack
aIndexes->RemoveElementAt(aIndexes->Count()-1); aIndexes->RemoveElementAt(aIndexes->Length()-1);
} }
else mCachedIndex = 0; // this might be wrong, but we are better off guessing else mCachedIndex = 0; // this might be wrong, but we are better off guessing
prevNode = parent; prevNode = parent;
@ -887,7 +892,7 @@ nsContentIterator::PrevNode(nsINode *aNode, nsVoidArray *aIndexes)
if (aIndexes) if (aIndexes)
{ {
// push an entry on the index stack // push an entry on the index stack
aIndexes->AppendElement(NS_INT32_TO_PTR(numChildren)); aIndexes->AppendElement(numChildren);
} }
else mCachedIndex = numChildren; else mCachedIndex = numChildren;
@ -1043,8 +1048,8 @@ nsContentIterator::PositionAt(nsINode* aCurNode)
// We can be at ANY node in the sequence. // We can be at ANY node in the sequence.
// Need to regenerate the array of indexes back to the root or common parent! // Need to regenerate the array of indexes back to the root or common parent!
nsAutoVoidArray oldParentStack; nsAutoTArray<nsINode*, 8> oldParentStack;
nsAutoVoidArray newIndexes; nsAutoTArray<PRInt32, 8> newIndexes;
// Get a list of the parents up to the root, then compare the new node // Get a list of the parents up to the root, then compare the new node
// with entries in that array until we find a match (lowest common // with entries in that array until we find a match (lowest common
@ -1055,17 +1060,17 @@ nsContentIterator::PositionAt(nsINode* aCurNode)
// we know the depth we're down (though we may not have started at the // we know the depth we're down (though we may not have started at the
// top). // top).
if (!oldParentStack.SizeTo(mIndexes.Count()+1)) if (!oldParentStack.SetCapacity(mIndexes.Length()+1))
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
// We want to loop mIndexes.Count() + 1 times here, because we want to make // We want to loop mIndexes.Length() + 1 times here, because we want to make
// sure we include mCommonParent in the oldParentStack, for use in the next // sure we include mCommonParent in the oldParentStack, for use in the next
// for loop, and mIndexes only has entries for nodes from tempNode up through // for loop, and mIndexes only has entries for nodes from tempNode up through
// an ancestor of tempNode that's a child of mCommonParent. // an ancestor of tempNode that's a child of mCommonParent.
for (PRInt32 i = mIndexes.Count()+1; i > 0 && tempNode; i--) for (PRInt32 i = mIndexes.Length()+1; i > 0 && tempNode; i--)
{ {
// Insert at head since we're walking up // Insert at head since we're walking up
oldParentStack.InsertElementAt(tempNode,0); oldParentStack.InsertElementAt(0, tempNode);
nsINode *parent = tempNode->GetNodeParent(); nsINode *parent = tempNode->GetNodeParent();
@ -1076,8 +1081,8 @@ nsContentIterator::PositionAt(nsINode* aCurNode)
{ {
// The position was moved to a parent of the current position. // The position was moved to a parent of the current position.
// All we need to do is drop some indexes. Shortcut here. // All we need to do is drop some indexes. Shortcut here.
mIndexes.RemoveElementsAt(mIndexes.Count() - oldParentStack.Count(), mIndexes.RemoveElementsAt(mIndexes.Length() - oldParentStack.Length(),
oldParentStack.Count()); oldParentStack.Length());
mIsDone = PR_FALSE; mIsDone = PR_FALSE;
return NS_OK; return NS_OK;
} }
@ -1095,7 +1100,7 @@ nsContentIterator::PositionAt(nsINode* aCurNode)
PRInt32 indx = parent->IndexOf(newCurNode); PRInt32 indx = parent->IndexOf(newCurNode);
// insert at the head! // insert at the head!
newIndexes.InsertElementAt(NS_INT32_TO_PTR(indx),0); newIndexes.InsertElementAt(0, indx);
// look to see if the parent is in the stack // look to see if the parent is in the stack
indx = oldParentStack.IndexOf(parent); indx = oldParentStack.IndexOf(parent);
@ -1103,12 +1108,12 @@ nsContentIterator::PositionAt(nsINode* aCurNode)
{ {
// ok, the parent IS on the old stack! Rework things. // ok, the parent IS on the old stack! Rework things.
// we want newIndexes to replace all nodes equal to or below the match // we want newIndexes to replace all nodes equal to or below the match
// Note that index oldParentStack.Count()-1 is the last node, which is // Note that index oldParentStack.Length()-1 is the last node, which is
// one BELOW the last index in the mIndexes stack. In other words, we // one BELOW the last index in the mIndexes stack. In other words, we
// want to remove elements starting at index (indx+1). // want to remove elements starting at index (indx+1).
PRInt32 numToDrop = oldParentStack.Count()-(1+indx); PRInt32 numToDrop = oldParentStack.Length()-(1+indx);
if (numToDrop > 0) if (numToDrop > 0)
mIndexes.RemoveElementsAt(mIndexes.Count() - numToDrop,numToDrop); mIndexes.RemoveElementsAt(mIndexes.Length() - numToDrop, numToDrop);
mIndexes.AppendElements(newIndexes); mIndexes.AppendElements(newIndexes);
break; break;
@ -1190,12 +1195,12 @@ protected:
nsCOMPtr<nsIDOMRange> mRange; nsCOMPtr<nsIDOMRange> mRange;
// these arrays all typically are used and have elements // these arrays all typically are used and have elements
#if 0 #if 0
nsAutoVoidArray mStartNodes; nsAutoTArray<nsIContent*, 8> mStartNodes;
nsAutoVoidArray mStartOffsets; nsAutoTArray<PRInt32, 8> mStartOffsets;
#endif #endif
nsAutoVoidArray mEndNodes; nsAutoTArray<nsIContent*, 8> mEndNodes;
nsAutoVoidArray mEndOffsets; nsAutoTArray<PRInt32, 8> mEndOffsets;
}; };
nsresult NS_NewContentSubtreeIterator(nsIContentIterator** aInstancePtrResult); nsresult NS_NewContentSubtreeIterator(nsIContentIterator** aInstancePtrResult);

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

@ -205,7 +205,7 @@ nsILineBreaker *nsContentUtils::sLineBreaker;
nsIWordBreaker *nsContentUtils::sWordBreaker; nsIWordBreaker *nsContentUtils::sWordBreaker;
nsICaseConversion *nsContentUtils::sCaseConv; nsICaseConversion *nsContentUtils::sCaseConv;
nsIUGenCategory *nsContentUtils::sGenCat; nsIUGenCategory *nsContentUtils::sGenCat;
nsVoidArray *nsContentUtils::sPtrsToPtrsToRelease; nsTArray<nsISupports**> *nsContentUtils::sPtrsToPtrsToRelease;
nsIScriptRuntime *nsContentUtils::sScriptRuntimes[NS_STID_ARRAY_UBOUND]; nsIScriptRuntime *nsContentUtils::sScriptRuntimes[NS_STID_ARRAY_UBOUND];
PRInt32 nsContentUtils::sScriptRootCount[NS_STID_ARRAY_UBOUND]; PRInt32 nsContentUtils::sScriptRootCount[NS_STID_ARRAY_UBOUND];
PRUint32 nsContentUtils::sJSGCThingRootCount; PRUint32 nsContentUtils::sJSGCThingRootCount;
@ -329,7 +329,7 @@ nsContentUtils::Init()
sImgLoader = nsnull; sImgLoader = nsnull;
} }
sPtrsToPtrsToRelease = new nsVoidArray(); sPtrsToPtrsToRelease = new nsTArray<nsISupports**>();
if (!sPtrsToPtrsToRelease) { if (!sPtrsToPtrsToRelease) {
return NS_ERROR_OUT_OF_MEMORY; return NS_ERROR_OUT_OF_MEMORY;
} }
@ -866,8 +866,8 @@ nsContentUtils::Shutdown()
NS_IF_RELEASE(sContentPolicyService); NS_IF_RELEASE(sContentPolicyService);
sTriedToGetContentPolicy = PR_FALSE; sTriedToGetContentPolicy = PR_FALSE;
PRInt32 i; PRUint32 i;
for (i = 0; i < PRInt32(PropertiesFile_COUNT); ++i) for (i = 0; i < PropertiesFile_COUNT; ++i)
NS_IF_RELEASE(sStringBundles[i]); NS_IF_RELEASE(sStringBundles[i]);
NS_IF_RELEASE(sStringBundleService); NS_IF_RELEASE(sStringBundleService);
NS_IF_RELEASE(sConsoleService); NS_IF_RELEASE(sConsoleService);
@ -897,9 +897,8 @@ nsContentUtils::Shutdown()
sEventTable = nsnull; sEventTable = nsnull;
if (sPtrsToPtrsToRelease) { if (sPtrsToPtrsToRelease) {
for (i = 0; i < sPtrsToPtrsToRelease->Count(); ++i) { for (i = 0; i < sPtrsToPtrsToRelease->Length(); ++i) {
nsISupports** ptrToPtr = nsISupports** ptrToPtr = sPtrsToPtrsToRelease->ElementAt(i);
static_cast<nsISupports**>(sPtrsToPtrsToRelease->ElementAt(i));
NS_RELEASE(*ptrToPtr); NS_RELEASE(*ptrToPtr);
} }
delete sPtrsToPtrsToRelease; delete sPtrsToPtrsToRelease;
@ -1401,7 +1400,7 @@ nsContentUtils::ContentIsDescendantOf(nsINode* aPossibleDescendant,
// static // static
nsresult nsresult
nsContentUtils::GetAncestors(nsIDOMNode* aNode, nsContentUtils::GetAncestors(nsIDOMNode* aNode,
nsVoidArray* aArray) nsTArray<nsIDOMNode*>* aArray)
{ {
NS_ENSURE_ARG_POINTER(aNode); NS_ENSURE_ARG_POINTER(aNode);
@ -1421,8 +1420,8 @@ nsContentUtils::GetAncestors(nsIDOMNode* aNode,
nsresult nsresult
nsContentUtils::GetAncestorsAndOffsets(nsIDOMNode* aNode, nsContentUtils::GetAncestorsAndOffsets(nsIDOMNode* aNode,
PRInt32 aOffset, PRInt32 aOffset,
nsVoidArray* aAncestorNodes, nsTArray<nsIContent*>* aAncestorNodes,
nsVoidArray* aAncestorOffsets) nsTArray<PRInt32>* aAncestorOffsets)
{ {
NS_ENSURE_ARG_POINTER(aNode); NS_ENSURE_ARG_POINTER(aNode);
@ -1432,26 +1431,26 @@ nsContentUtils::GetAncestorsAndOffsets(nsIDOMNode* aNode,
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
if (aAncestorNodes->Count() != 0) { if (!aAncestorNodes->IsEmpty()) {
NS_WARNING("aAncestorNodes is not empty"); NS_WARNING("aAncestorNodes is not empty");
aAncestorNodes->Clear(); aAncestorNodes->Clear();
} }
if (aAncestorOffsets->Count() != 0) { if (!aAncestorOffsets->IsEmpty()) {
NS_WARNING("aAncestorOffsets is not empty"); NS_WARNING("aAncestorOffsets is not empty");
aAncestorOffsets->Clear(); aAncestorOffsets->Clear();
} }
// insert the node itself // insert the node itself
aAncestorNodes->AppendElement(content.get()); aAncestorNodes->AppendElement(content.get());
aAncestorOffsets->AppendElement(NS_INT32_TO_PTR(aOffset)); aAncestorOffsets->AppendElement(aOffset);
// insert all the ancestors // insert all the ancestors
nsIContent* child = content; nsIContent* child = content;
nsIContent* parent = child->GetParent(); nsIContent* parent = child->GetParent();
while (parent) { while (parent) {
aAncestorNodes->AppendElement(parent); aAncestorNodes->AppendElement(parent);
aAncestorOffsets->AppendElement(NS_INT32_TO_PTR(parent->IndexOf(child))); aAncestorOffsets->AppendElement(parent->IndexOf(child));
child = parent; child = parent;
parent = parent->GetParent(); parent = parent->GetParent();
} }

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

@ -47,7 +47,6 @@
#include "nsIDOMDOMStringList.h" #include "nsIDOMDOMStringList.h"
#include "nsIDOMNameList.h" #include "nsIDOMNameList.h"
#include "nsVoidArray.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "nsString.h" #include "nsString.h"

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

@ -304,7 +304,6 @@ nsUint32ToContentHashEntry::VisitContent(Visitor* aVisitor)
} }
} }
#define ID_NOT_IN_DOCUMENT ((nsIContent *)2)
#define NAME_NOT_VALID ((nsBaseContentList*)1) #define NAME_NOT_VALID ((nsBaseContentList*)1)
nsIdentifierMapEntry::~nsIdentifierMapEntry() nsIdentifierMapEntry::~nsIdentifierMapEntry()
@ -349,13 +348,9 @@ nsIdentifierMapEntry::CreateNameContentList()
} }
nsIContent* nsIContent*
nsIdentifierMapEntry::GetIdContent(PRBool* aNotInDocument) nsIdentifierMapEntry::GetIdContent()
{ {
nsIContent* c = static_cast<nsIContent*>(mIdContentList.SafeElementAt(0)); return static_cast<nsIContent*>(mIdContentList.SafeElementAt(0));
if (aNotInDocument) {
*aNotInDocument = c == ID_NOT_IN_DOCUMENT;
}
return c != ID_NOT_IN_DOCUMENT ? c : nsnull;
} }
void void
@ -424,28 +419,23 @@ nsIdentifierMapEntry::AddIdContent(nsIContent* aContent)
NS_PRECONDITION(aContent, "Must have content"); NS_PRECONDITION(aContent, "Must have content");
NS_PRECONDITION(mIdContentList.IndexOf(nsnull) < 0, NS_PRECONDITION(mIdContentList.IndexOf(nsnull) < 0,
"Why is null in our list?"); "Why is null in our list?");
NS_PRECONDITION(aContent != ID_NOT_IN_DOCUMENT,
"Bogus content pointer");
nsIContent* currentContent = static_cast<nsIContent*>(mIdContentList.SafeElementAt(0)); #ifdef DEBUG
if (currentContent == ID_NOT_IN_DOCUMENT) { nsIContent* currentContent =
NS_ASSERTION(mIdContentList.Count() == 1, "Bogus count"); static_cast<nsIContent*>(mIdContentList.SafeElementAt(0));
mIdContentList.ReplaceElementAt(aContent, 0); #endif
FireChangeCallbacks(nsnull, aContent);
return PR_TRUE;
}
// Common case // Common case
if (mIdContentList.Count() == 0) { if (mIdContentList.Count() == 0) {
if (!mIdContentList.AppendElement(aContent)) if (!mIdContentList.AppendElement(aContent))
return PR_FALSE; return PR_FALSE;
NS_ASSERTION(currentContent == nsnull, "How did that happen?");
FireChangeCallbacks(nsnull, aContent); FireChangeCallbacks(nsnull, aContent);
return PR_TRUE; return PR_TRUE;
} }
// We seem to have multiple content nodes for the same id, or we're doing our // We seem to have multiple content nodes for the same id, or XUL is messing
// top-down registration when the id table is going live. Search for the // with us. Search for the right place to insert the content.
// right place to insert the content.
PRInt32 start = 0; PRInt32 start = 0;
PRInt32 end = mIdContentList.Count(); PRInt32 end = mIdContentList.Count();
do { do {
@ -457,6 +447,8 @@ nsIdentifierMapEntry::AddIdContent(nsIContent* aContent)
nsIContent* curContent = static_cast<nsIContent*>(mIdContentList[cur]); nsIContent* curContent = static_cast<nsIContent*>(mIdContentList[cur]);
if (curContent == aContent) { if (curContent == aContent) {
// Already in the list, so already in the right spot. Get out of here. // Already in the list, so already in the right spot. Get out of here.
// XXXbz this only happens because XUL does all sorts of random
// UpdateIdTableEntry calls. Hate, hate, hate!
return PR_TRUE; return PR_TRUE;
} }
@ -470,7 +462,10 @@ nsIdentifierMapEntry::AddIdContent(nsIContent* aContent)
if (!mIdContentList.InsertElementAt(aContent, start)) if (!mIdContentList.InsertElementAt(aContent, start))
return PR_FALSE; return PR_FALSE;
if (start == 0) { if (start == 0) {
FireChangeCallbacks(currentContent, aContent); nsIContent* oldContent =
static_cast<nsIContent*>(mIdContentList.SafeElementAt(1));
NS_ASSERTION(currentContent == oldContent, "How did that happen?");
FireChangeCallbacks(oldContent, aContent);
} }
return PR_TRUE; return PR_TRUE;
} }
@ -493,15 +488,6 @@ nsIdentifierMapEntry::RemoveIdContent(nsIContent* aContent)
return mIdContentList.Count() == 0 && !mNameContentList && !mChangeCallbacks; return mIdContentList.Count() == 0 && !mNameContentList && !mChangeCallbacks;
} }
void
nsIdentifierMapEntry::FlagIDNotInDocument()
{
NS_ASSERTION(mIdContentList.Count() == 0,
"Flagging ID not in document when we have content?");
// Note that if this fails that's OK; this is just an optimization
mIdContentList.AppendElement(ID_NOT_IN_DOCUMENT);
}
void void
nsIdentifierMapEntry::AddNameContent(nsIContent* aContent) nsIdentifierMapEntry::AddNameContent(nsIContent* aContent)
{ {
@ -2307,11 +2293,9 @@ nsDocument::UpdateIdTableEntry(nsIContent *aContent)
if (!id) if (!id)
return; return;
PRBool liveTable = IdTableIsLive(); nsIdentifierMapEntry *entry = mIdentifierMap.PutEntry(id);
nsIdentifierMapEntry *entry =
liveTable ? mIdentifierMap.PutEntry(id) : mIdentifierMap.GetEntry(id);
if (entry) { if (entry) { /* True except on OOM */
entry->AddIdContent(aContent); entry->AddIdContent(aContent);
} }
} }
@ -2324,7 +2308,7 @@ nsDocument::RemoveFromIdTable(nsIContent *aContent)
return; return;
nsIdentifierMapEntry *entry = mIdentifierMap.GetEntry(id); nsIdentifierMapEntry *entry = mIdentifierMap.GetEntry(id);
if (!entry) if (!entry) /* Should be false unless we had OOM when adding the entry */
return; return;
if (entry->RemoveIdContent(aContent)) { if (entry->RemoveIdContent(aContent)) {
@ -2335,35 +2319,51 @@ nsDocument::RemoveFromIdTable(nsIContent *aContent)
void void
nsDocument::UnregisterNamedItems(nsIContent *aContent) nsDocument::UnregisterNamedItems(nsIContent *aContent)
{ {
if (aContent->IsNodeOfType(nsINode::eTEXT)) { if (!aContent->IsNodeOfType(nsINode::eELEMENT)) {
// Text nodes are not named items nor can they have children. // non-element nodes are not named items nor can they have children.
return; return;
} }
RemoveFromNameTable(aContent); RemoveFromNameTable(aContent);
RemoveFromIdTable(aContent); RemoveFromIdTable(aContent);
PRUint32 i, count = aContent->GetChildCount(); #ifdef DEBUG
for (i = 0; i < count; ++i) { nsMutationGuard debugMutationGuard;
UnregisterNamedItems(aContent->GetChildAt(i)); #endif
PRUint32 count;
nsIContent * const * kidSlot = aContent->GetChildArray(&count);
nsIContent * const * end = kidSlot + count;
for (; kidSlot != end; ++kidSlot) {
UnregisterNamedItems(*kidSlot);
} }
NS_ASSERTION(!debugMutationGuard.Mutated(0), "Unexpected mutations happened");
} }
void void
nsDocument::RegisterNamedItems(nsIContent *aContent) nsDocument::RegisterNamedItems(nsIContent *aContent)
{ {
if (aContent->IsNodeOfType(nsINode::eTEXT)) { if (!aContent->IsNodeOfType(nsINode::eELEMENT)) {
// Text nodes are not named items nor can they have children. // non-element nodes are not named items nor can they have children.
return; return;
} }
UpdateNameTableEntry(aContent); UpdateNameTableEntry(aContent);
UpdateIdTableEntry(aContent); UpdateIdTableEntry(aContent);
PRUint32 i, count = aContent->GetChildCount(); #ifdef DEBUG
for (i = 0; i < count; ++i) { nsMutationGuard debugMutationGuard;
RegisterNamedItems(aContent->GetChildAt(i)); #endif
PRUint32 count;
nsIContent * const * kidSlot = aContent->GetChildArray(&count);
nsIContent * const * end = kidSlot + count;
for (; kidSlot != end; ++kidSlot) {
RegisterNamedItems(*kidSlot);
} }
NS_ASSERTION(!debugMutationGuard.Mutated(0), "Unexpected mutations happened");
} }
void void
@ -2373,10 +2373,18 @@ nsDocument::ContentAppended(nsIDocument* aDocument,
{ {
NS_ASSERTION(aDocument == this, "unexpected doc"); NS_ASSERTION(aDocument == this, "unexpected doc");
PRUint32 count = aContainer->GetChildCount(); #ifdef DEBUG
for (PRUint32 i = aNewIndexInContainer; i < count; ++i) { nsMutationGuard debugMutationGuard;
RegisterNamedItems(aContainer->GetChildAt(i)); #endif
PRUint32 count;
nsIContent * const * kidSlot = aContainer->GetChildArray(&count);
nsIContent * const * end = kidSlot + count;
for (kidSlot += aNewIndexInContainer; kidSlot != end; ++kidSlot) {
RegisterNamedItems(*kidSlot);
} }
NS_ASSERTION(!debugMutationGuard.Mutated(0), "Unexpected mutations happened");
} }
void void
@ -2821,11 +2829,10 @@ nsDocument::SetDocumentCharacterSet(const nsACString& aCharSetID)
} }
#endif #endif
PRInt32 n = mCharSetObservers.Count(); PRInt32 n = mCharSetObservers.Length();
for (PRInt32 i = 0; i < n; i++) { for (PRInt32 i = 0; i < n; i++) {
nsIObserver* observer = nsIObserver* observer = mCharSetObservers.ElementAt(i);
static_cast<nsIObserver *>(mCharSetObservers.ElementAt(i));
observer->Observe(static_cast<nsIDocument *>(this), "charset", observer->Observe(static_cast<nsIDocument *>(this), "charset",
NS_ConvertASCIItoUTF16(aCharSetID).get()); NS_ConvertASCIItoUTF16(aCharSetID).get());
@ -3755,19 +3762,6 @@ nsDocument::CheckGetElementByIdArg(const nsIAtom* aId)
return PR_TRUE; return PR_TRUE;
} }
static void
MatchAllElementsId(nsIContent* aContent, nsIAtom* aId, nsIdentifierMapEntry* aEntry)
{
if (aId == aContent->GetID()) {
aEntry->AddIdContent(aContent);
}
PRUint32 i, count = aContent->GetChildCount();
for (i = 0; i < count; i++) {
MatchAllElementsId(aContent->GetChildAt(i), aId, aEntry);
}
}
nsIdentifierMapEntry* nsIdentifierMapEntry*
nsDocument::GetElementByIdInternal(nsIAtom* aID) nsDocument::GetElementByIdInternal(nsIAtom* aID)
{ {
@ -3781,10 +3775,9 @@ nsDocument::GetElementByIdInternal(nsIAtom* aID)
if (entry->GetIdContent()) if (entry->GetIdContent())
return entry; return entry;
// Now we have to flush. It could be that we have a cached "not in // Now we have to flush. It could be that we know nothing about this ID yet
// document" or know nothing about this ID yet but more content has been // but more content has been added to the document since. Note that we have
// added to the document since. Note that we have to flush notifications, // to flush notifications, so that the entry will get updated properly.
// so that the entry will get updated properly.
// Make sure to stash away the current generation so we can check whether // Make sure to stash away the current generation so we can check whether
// the table changes when we flush. // the table changes when we flush.
@ -3799,53 +3792,6 @@ nsDocument::GetElementByIdInternal(nsIAtom* aID)
entry = mIdentifierMap.PutEntry(aID); entry = mIdentifierMap.PutEntry(aID);
} }
PRBool isNotInDocument;
nsIContent *e = entry->GetIdContent(&isNotInDocument);
if (e || isNotInDocument)
return entry;
// Status of this id is unknown, search document
nsIContent* root = GetRootContent();
if (!IdTableIsLive()) {
if (IdTableShouldBecomeLive()) {
// Just make sure our table is up to date and call this method again
// to look up in the hashtable.
if (root) {
RegisterNamedItems(root);
}
return GetElementByIdInternal(aID);
}
if (root) {
// No-one should have registered an ID change callback yet. We don't
// want to fire one as a side-effect of getElementById! This shouldn't
// happen, since if someone called AddIDTargetObserver already for
// this ID, we should have filled in this entry with content or
// not-in-document.
NS_ASSERTION(!entry->HasContentChangeCallback(),
"No callbacks should be registered while we set up this entry");
MatchAllElementsId(root, aID, entry);
e = entry->GetIdContent();
}
}
if (!e) {
#ifdef DEBUG
// No reason to call MatchElementId if !IdTableIsLive, since
// we'd have done just that already
if (IdTableIsLive() && root && aID != nsGkAtoms::_empty) {
nsIContent* eDebug =
nsContentUtils::MatchElementId(root, aID);
NS_ASSERTION(!eDebug,
"We got null for |e| but MatchElementId found something?");
}
#endif
// There is no element with the given id in the document, cache
// the fact that it's not in the document
entry->FlagIDNotInDocument();
return entry;
}
return entry; return entry;
} }
@ -3864,10 +3810,8 @@ nsDocument::GetElementById(const nsAString& aElementId,
nsIdentifierMapEntry *entry = GetElementByIdInternal(idAtom); nsIdentifierMapEntry *entry = GetElementByIdInternal(idAtom);
NS_ENSURE_TRUE(entry, NS_ERROR_OUT_OF_MEMORY); NS_ENSURE_TRUE(entry, NS_ERROR_OUT_OF_MEMORY);
PRBool isNotInDocument; nsIContent *e = entry->GetIdContent();
nsIContent *e = entry->GetIdContent(&isNotInDocument); if (!e)
NS_ASSERTION(e || isNotInDocument, "Incomplete map entry!");
if (isNotInDocument)
return NS_OK; return NS_OK;
return CallQueryInterface(e, aReturn); return CallQueryInterface(e, aReturn);

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

@ -49,6 +49,7 @@
#include "nsWeakReference.h" #include "nsWeakReference.h"
#include "nsWeakPtr.h" #include "nsWeakPtr.h"
#include "nsVoidArray.h" #include "nsVoidArray.h"
#include "nsTArray.h"
#include "nsHashSets.h" #include "nsHashSets.h"
#include "nsIDOMXMLDocument.h" #include "nsIDOMXMLDocument.h"
#include "nsIDOM3Document.h" #include "nsIDOM3Document.h"
@ -256,10 +257,11 @@ public:
/** /**
* Returns the element if we know the element associated with this * Returns the element if we know the element associated with this
* id. Otherwise returns null. * id. Otherwise returns null.
* @param aIsNotInDocument if non-null, we set the output to true
* if we know for sure the element is not in the document.
*/ */
nsIContent* GetIdContent(PRBool* aIsNotInDocument = nsnull); nsIContent* GetIdContent();
/**
* Append all the elements with this id to aElements
*/
void AppendAllIdContent(nsCOMArray<nsIContent>* aElements); void AppendAllIdContent(nsCOMArray<nsIContent>* aElements);
/** /**
* This can fire ID change callbacks. * This can fire ID change callbacks.
@ -272,7 +274,6 @@ public:
* @return true if this map entry should be removed * @return true if this map entry should be removed
*/ */
PRBool RemoveIdContent(nsIContent* aContent); PRBool RemoveIdContent(nsIContent* aContent);
void FlagIDNotInDocument();
PRBool HasContentChangeCallback() { return mChangeCallbacks != nsnull; } PRBool HasContentChangeCallback() { return mChangeCallbacks != nsnull; }
void AddContentChangeCallback(nsIDocument::IDTargetObserver aCallback, void* aData); void AddContentChangeCallback(nsIDocument::IDTargetObserver aCallback, void* aData);
@ -317,8 +318,7 @@ public:
private: private:
void FireChangeCallbacks(nsIContent* aOldContent, nsIContent* aNewContent); void FireChangeCallbacks(nsIContent* aOldContent, nsIContent* aNewContent);
// The single element ID_NOT_IN_DOCUMENT, or empty to indicate we // empty if there are no nodes with this ID
// don't know what element(s) have this key as an ID
nsSmallVoidArray mIdContentList; nsSmallVoidArray mIdContentList;
// NAME_NOT_VALID if this id cannot be used as a 'name' // NAME_NOT_VALID if this id cannot be used as a 'name'
nsBaseContentList *mNameContentList; nsBaseContentList *mNameContentList;
@ -1099,7 +1099,7 @@ protected:
nsCString mReferrer; nsCString mReferrer;
nsString mLastModified; nsString mLastModified;
nsVoidArray mCharSetObservers; nsTArray<nsIObserver*> mCharSetObservers;
PLDHashTable *mSubDocuments; PLDHashTable *mSubDocuments;
@ -1148,8 +1148,8 @@ protected:
* 1) Attribute changes affect the table immediately (removing and adding * 1) Attribute changes affect the table immediately (removing and adding
* entries as needed). * entries as needed).
* 2) Removals from the DOM affect the table immediately * 2) Removals from the DOM affect the table immediately
* 3) Additions to the DOM always update existing entries, but only add new * 3) Additions to the DOM always update existing entries for names, and add
* ones if IdTableIsLive() is true. * new ones for IDs.
*/ */
nsTHashtable<nsIdentifierMapEntry> mIdentifierMap; nsTHashtable<nsIdentifierMapEntry> mIdentifierMap;
@ -1191,22 +1191,6 @@ protected:
PRUint8 mDefaultElementType; PRUint8 mDefaultElementType;
PRBool IdTableIsLive() const {
// live if we've had over 63 misses
return (mIdMissCount & 0x40) != 0;
}
void SetIdTableLive() {
mIdMissCount = 0x40;
}
PRBool IdTableShouldBecomeLive() {
NS_ASSERTION(!IdTableIsLive(),
"Shouldn't be called if table is already live!");
++mIdMissCount;
return IdTableIsLive();
}
PRUint8 mIdMissCount;
nsInterfaceHashtable<nsVoidPtrHashKey, nsPIBoxObject> *mBoxObjectTable; nsInterfaceHashtable<nsVoidPtrHashKey, nsPIBoxObject> *mBoxObjectTable;
// The channel that got passed to StartDocumentLoad(), if any // The channel that got passed to StartDocumentLoad(), if any

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

@ -76,6 +76,7 @@
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsUnicharUtils.h" #include "nsUnicharUtils.h"
#include "nsReadableUtils.h" #include "nsReadableUtils.h"
#include "nsTArray.h"
nsresult NS_NewDomSelection(nsISelection **aDomSelection); nsresult NS_NewDomSelection(nsISelection **aDomSelection);
@ -109,9 +110,9 @@ protected:
nsIDOMNode* aNode, nsIDOMNode* aNode,
nsAString& aString, nsAString& aString,
PRInt32 aDepth); PRInt32 aDepth);
nsresult SerializeRangeContextStart(const nsVoidArray& aAncestorArray, nsresult SerializeRangeContextStart(const nsTArray<nsIDOMNode*>& aAncestorArray,
nsAString& aString); nsAString& aString);
nsresult SerializeRangeContextEnd(const nsVoidArray& aAncestorArray, nsresult SerializeRangeContextEnd(const nsTArray<nsIDOMNode*>& aAncestorArray,
nsAString& aString); nsAString& aString);
nsresult FlushText(nsAString& aString, PRBool aForce); nsresult FlushText(nsAString& aString, PRBool aForce);
@ -139,11 +140,11 @@ protected:
PRUint32 mEndDepth; PRUint32 mEndDepth;
PRInt32 mStartRootIndex; PRInt32 mStartRootIndex;
PRInt32 mEndRootIndex; PRInt32 mEndRootIndex;
nsAutoVoidArray mCommonAncestors; nsAutoTArray<nsIDOMNode*, 8> mCommonAncestors;
nsAutoVoidArray mStartNodes; nsAutoTArray<nsIContent*, 8> mStartNodes;
nsAutoVoidArray mStartOffsets; nsAutoTArray<PRInt32, 8> mStartOffsets;
nsAutoVoidArray mEndNodes; nsAutoTArray<nsIContent*, 8> mEndNodes;
nsAutoVoidArray mEndOffsets; nsAutoTArray<PRInt32, 8> mEndOffsets;
PRPackedBool mHaltRangeHint; PRPackedBool mHaltRangeHint;
PRPackedBool mIsCopying; // Set to PR_TRUE only while copying PRPackedBool mIsCopying; // Set to PR_TRUE only while copying
PRPackedBool mNodeIsContainer; PRPackedBool mNodeIsContainer;
@ -542,18 +543,18 @@ static PRInt32 IndexOf(nsIDOMNode* aParent, nsIDOMNode* aChild)
return parent->IndexOf(child); return parent->IndexOf(child);
} }
static inline PRInt32 GetIndex(nsVoidArray& aIndexArray) static inline PRInt32 GetIndex(nsTArray<PRInt32>& aIndexArray)
{ {
PRInt32 count = aIndexArray.Count(); PRInt32 count = aIndexArray.Length();
if (count) { if (count) {
return (PRInt32)aIndexArray.ElementAt(count - 1); return aIndexArray.ElementAt(count - 1);
} }
return 0; return 0;
} }
static nsresult GetNextNode(nsIDOMNode* aNode, nsVoidArray& aIndexArray, static nsresult GetNextNode(nsIDOMNode* aNode, nsTArray<PRInt32>& aIndexArray,
nsIDOMNode*& aNextNode, nsIDOMNode*& aNextNode,
nsRangeIterationDirection& aDirection) nsRangeIterationDirection& aDirection)
{ {
@ -567,7 +568,7 @@ static nsresult GetNextNode(nsIDOMNode* aNode, nsVoidArray& aIndexArray,
ChildAt(aNode, 0, aNextNode); ChildAt(aNode, 0, aNextNode);
NS_ENSURE_TRUE(aNextNode, NS_ERROR_FAILURE); NS_ENSURE_TRUE(aNextNode, NS_ERROR_FAILURE);
aIndexArray.AppendElement((void *)0); aIndexArray.AppendElement(0);
aDirection = kDirectionIn; aDirection = kDirectionIn;
} else if (aDirection == kDirectionIn) { } else if (aDirection == kDirectionIn) {
@ -582,15 +583,15 @@ static nsresult GetNextNode(nsIDOMNode* aNode, nsVoidArray& aIndexArray,
aNode->GetParentNode(getter_AddRefs(parent)); aNode->GetParentNode(getter_AddRefs(parent));
NS_ENSURE_TRUE(parent, NS_ERROR_FAILURE); NS_ENSURE_TRUE(parent, NS_ERROR_FAILURE);
PRInt32 count = aIndexArray.Count(); PRInt32 count = aIndexArray.Length();
if (count) { if (count) {
PRInt32 indx = (PRInt32)aIndexArray.ElementAt(count - 1); PRInt32 indx = aIndexArray.ElementAt(count - 1);
ChildAt(parent, indx + 1, aNextNode); ChildAt(parent, indx + 1, aNextNode);
if (aNextNode) if (aNextNode)
aIndexArray.ReplaceElementAt((void *)(indx + 1), count - 1); aIndexArray.ElementAt(count - 1) = indx + 1;
else else
aIndexArray.RemoveElementAt(count - 1); aIndexArray.RemoveElementAt(count - 1);
} else { } else {
@ -600,7 +601,7 @@ static nsresult GetNextNode(nsIDOMNode* aNode, nsVoidArray& aIndexArray,
ChildAt(parent, indx + 1, aNextNode); ChildAt(parent, indx + 1, aNextNode);
if (aNextNode) if (aNextNode)
aIndexArray.AppendElement((void *)(indx + 1)); aIndexArray.AppendElement(indx + 1);
} }
} }
@ -670,12 +671,12 @@ nsDocumentEncoder::SerializeRangeNodes(nsIDOMRange* aRange,
// get start and end nodes for this recursion level // get start and end nodes for this recursion level
nsCOMPtr<nsIContent> startNode, endNode; nsCOMPtr<nsIContent> startNode, endNode;
PRInt32 start = mStartRootIndex - aDepth; PRInt32 start = mStartRootIndex - aDepth;
if (start >= 0 && start <= mStartNodes.Count()) if (start >= 0 && start <= mStartNodes.Length())
startNode = static_cast<nsIContent *>(mStartNodes[start]); startNode = mStartNodes[start];
PRInt32 end = mEndRootIndex - aDepth; PRInt32 end = mEndRootIndex - aDepth;
if (end >= 0 && end <= mEndNodes.Count()) if (end >= 0 && end <= mEndNodes.Length())
endNode = static_cast<nsIContent *>(mEndNodes[end]); endNode = mEndNodes[end];
if ((startNode != content) && (endNode != content)) if ((startNode != content) && (endNode != content))
{ {
@ -728,9 +729,9 @@ nsDocumentEncoder::SerializeRangeNodes(nsIDOMRange* aRange,
nsCOMPtr<nsIDOMNode> childAsNode; nsCOMPtr<nsIDOMNode> childAsNode;
PRInt32 startOffset = 0, endOffset = -1; PRInt32 startOffset = 0, endOffset = -1;
if (startNode == content && mStartRootIndex >= aDepth) if (startNode == content && mStartRootIndex >= aDepth)
startOffset = NS_PTR_TO_INT32(mStartOffsets[mStartRootIndex - aDepth]); startOffset = mStartOffsets[mStartRootIndex - aDepth];
if (endNode == content && mEndRootIndex >= aDepth) if (endNode == content && mEndRootIndex >= aDepth)
endOffset = NS_PTR_TO_INT32(mEndOffsets[mEndRootIndex - aDepth]) ; endOffset = mEndOffsets[mEndRootIndex - aDepth];
// generated content will cause offset values of -1 to be returned. // generated content will cause offset values of -1 to be returned.
PRInt32 j; PRInt32 j;
PRUint32 childCount = content->GetChildCount(); PRUint32 childCount = content->GetChildCount();
@ -777,14 +778,14 @@ nsDocumentEncoder::SerializeRangeNodes(nsIDOMRange* aRange,
} }
nsresult nsresult
nsDocumentEncoder::SerializeRangeContextStart(const nsVoidArray& aAncestorArray, nsDocumentEncoder::SerializeRangeContextStart(const nsTArray<nsIDOMNode*>& aAncestorArray,
nsAString& aString) nsAString& aString)
{ {
PRInt32 i = aAncestorArray.Count(); PRInt32 i = aAncestorArray.Length();
nsresult rv = NS_OK; nsresult rv = NS_OK;
while (i > 0) { while (i > 0) {
nsIDOMNode *node = (nsIDOMNode *)aAncestorArray.ElementAt(--i); nsIDOMNode *node = aAncestorArray.ElementAt(--i);
if (!node) if (!node)
break; break;
@ -801,15 +802,15 @@ nsDocumentEncoder::SerializeRangeContextStart(const nsVoidArray& aAncestorArray,
} }
nsresult nsresult
nsDocumentEncoder::SerializeRangeContextEnd(const nsVoidArray& aAncestorArray, nsDocumentEncoder::SerializeRangeContextEnd(const nsTArray<nsIDOMNode*>& aAncestorArray,
nsAString& aString) nsAString& aString)
{ {
PRInt32 i = 0; PRInt32 i = 0;
PRInt32 count = aAncestorArray.Count(); PRInt32 count = aAncestorArray.Length();
nsresult rv = NS_OK; nsresult rv = NS_OK;
while (i < count) { while (i < count) {
nsIDOMNode *node = (nsIDOMNode *)aAncestorArray.ElementAt(i++); nsIDOMNode *node = aAncestorArray.ElementAt(i++);
if (!node) if (!node)
break; break;
@ -1256,11 +1257,11 @@ nsHTMLCopyEncoder::EncodeToStringWithContext(nsAString& aContextString,
// where all the cells are in the same table. // where all the cells are in the same table.
// leaf of ancestors might be text node. If so discard it. // leaf of ancestors might be text node. If so discard it.
PRInt32 count = mCommonAncestors.Count(); PRInt32 count = mCommonAncestors.Length();
PRInt32 i; PRInt32 i;
nsCOMPtr<nsIDOMNode> node; nsCOMPtr<nsIDOMNode> node;
if (count > 0) if (count > 0)
node = static_cast<nsIDOMNode *>(mCommonAncestors.ElementAt(0)); node = mCommonAncestors.ElementAt(0);
if (node && IsTextNode(node)) if (node && IsTextNode(node))
{ {
@ -1275,13 +1276,13 @@ nsHTMLCopyEncoder::EncodeToStringWithContext(nsAString& aContextString,
i = count; i = count;
while (i > 0) while (i > 0)
{ {
node = static_cast<nsIDOMNode *>(mCommonAncestors.ElementAt(--i)); node = mCommonAncestors.ElementAt(--i);
SerializeNodeStart(node, 0, -1, aContextString); SerializeNodeStart(node, 0, -1, aContextString);
} }
//i = 0; guaranteed by above //i = 0; guaranteed by above
while (i < count) while (i < count)
{ {
node = static_cast<nsIDOMNode *>(mCommonAncestors.ElementAt(i++)); node = mCommonAncestors.ElementAt(i++);
SerializeNodeEnd(node, aContextString); SerializeNodeEnd(node, aContextString);
} }

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

@ -47,7 +47,6 @@
#include "nsIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsIDOM3Text.h" #include "nsIDOM3Text.h"
#include "nsTextFragment.h" #include "nsTextFragment.h"
#include "nsVoidArray.h"
#include "nsDOMError.h" #include "nsDOMError.h"
#include "nsIEventListenerManager.h" #include "nsIEventListenerManager.h"
#include "nsGenericElement.h" #include "nsGenericElement.h"

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

@ -76,7 +76,6 @@ class nsIDOMNamedNodeMap;
class nsDOMCSSDeclaration; class nsDOMCSSDeclaration;
class nsIDOMCSSStyleDeclaration; class nsIDOMCSSStyleDeclaration;
class nsIURI; class nsIURI;
class nsVoidArray;
class nsINodeInfo; class nsINodeInfo;
class nsIControllers; class nsIControllers;
class nsIDOMNSFeatureFactory; class nsIDOMNSFeatureFactory;

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

@ -1663,6 +1663,7 @@ GK_ATOM(viewProperty, "ViewProperty")
// Content property names // Content property names
GK_ATOM(genConInitializerProperty, "QuoteNodeProperty") GK_ATOM(genConInitializerProperty, "QuoteNodeProperty")
GK_ATOM(labelMouseDownPtProperty, "LabelMouseDownPtProperty")
// Languages for lang-specific transforms // Languages for lang-specific transforms
GK_ATOM(Japanese, "ja") GK_ATOM(Japanese, "ja")

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

@ -101,12 +101,10 @@ nsHTMLContentSerializer::nsHTMLContentSerializer()
nsHTMLContentSerializer::~nsHTMLContentSerializer() nsHTMLContentSerializer::~nsHTMLContentSerializer()
{ {
NS_ASSERTION(mOLStateStack.Count() == 0, "Expected OL State stack to be empty"); NS_ASSERTION(mOLStateStack.IsEmpty(), "Expected OL State stack to be empty");
if (mOLStateStack.Count() > 0){ if (!mOLStateStack.IsEmpty()){
for (PRInt32 i = 0; i < mOLStateStack.Count(); i++){ for (PRUint32 i = 0; i < mOLStateStack.Length(); i++){
olState* state = (olState*)mOLStateStack[i]; delete mOLStateStack[i];
delete state;
mOLStateStack.RemoveElementAt(i);
} }
} }
} }
@ -788,12 +786,12 @@ nsHTMLContentSerializer::AppendElementEnd(nsIDOMElement *aElement,
} }
if (mIsCopying && (name == nsGkAtoms::ol)){ if (mIsCopying && (name == nsGkAtoms::ol)){
NS_ASSERTION((mOLStateStack.Count() > 0), "Cannot have an empty OL Stack"); NS_ASSERTION(!mOLStateStack.IsEmpty(), "Cannot have an empty OL Stack");
/* Though at this point we must always have an state to be deleted as all /* Though at this point we must always have an state to be deleted as all
the OL opening tags are supposed to push an olState object to the stack*/ the OL opening tags are supposed to push an olState object to the stack*/
if (mOLStateStack.Count() > 0) { if (!mOLStateStack.IsEmpty()) {
olState* state = (olState*)mOLStateStack.ElementAt(mOLStateStack.Count() -1); olState* state = mOLStateStack.ElementAt(mOLStateStack.Length() -1);
mOLStateStack.RemoveElementAt(mOLStateStack.Count() -1); mOLStateStack.RemoveElementAt(mOLStateStack.Length() -1);
delete state; delete state;
} }
} }
@ -1243,12 +1241,12 @@ nsHTMLContentSerializer::SerializeLIValueAttribute(nsIDOMElement* aElement,
PRInt32 offset = 0; PRInt32 offset = 0;
olState defaultOLState(0, PR_FALSE); olState defaultOLState(0, PR_FALSE);
olState* state = nsnull; olState* state = nsnull;
if (mOLStateStack.Count() > 0) if (!mOLStateStack.IsEmpty())
state = (olState*)mOLStateStack.ElementAt(mOLStateStack.Count()-1); state = mOLStateStack.ElementAt(mOLStateStack.Length()-1);
/* Though we should never reach to a "state" as null or mOLStateStack.Count() == 0 /* Though we should never reach to a "state" as null or mOLStateStack.IsEmpty()
at this point as all LI are supposed to be inside some OL and OL tag should have at this point as all LI are supposed to be inside some OL and OL tag should have
pushed a state to the olStateStack.*/ pushed a state to the olStateStack.*/
if (!state || mOLStateStack.Count() == 0) if (!state || mOLStateStack.IsEmpty())
state = &defaultOLState; state = &defaultOLState;
PRInt32 startVal = state->startVal; PRInt32 startVal = state->startVal;
state->isFirstListItem = PR_FALSE; state->isFirstListItem = PR_FALSE;
@ -1315,8 +1313,8 @@ nsHTMLContentSerializer::IsFirstChildOfOL(nsIDOMElement* aElement){
if (parentName.LowerCaseEqualsLiteral("ol")) { if (parentName.LowerCaseEqualsLiteral("ol")) {
olState defaultOLState(0, PR_FALSE); olState defaultOLState(0, PR_FALSE);
olState* state = nsnull; olState* state = nsnull;
if (mOLStateStack.Count() > 0) if (!mOLStateStack.IsEmpty())
state = (olState*)mOLStateStack.ElementAt(mOLStateStack.Count()-1); state = mOLStateStack.ElementAt(mOLStateStack.Length()-1);
/* Though we should never reach to a "state" as null at this point as /* Though we should never reach to a "state" as null at this point as
all LI are supposed to be inside some OL and OL tag should have pushed all LI are supposed to be inside some OL and OL tag should have pushed
a state to the mOLStateStack.*/ a state to the mOLStateStack.*/

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

@ -48,6 +48,7 @@
#include "nsXMLContentSerializer.h" #include "nsXMLContentSerializer.h"
#include "nsIEntityConverter.h" #include "nsIEntityConverter.h"
#include "nsString.h" #include "nsString.h"
#include "nsTArray.h"
class nsIContent; class nsIContent;
class nsIAtom; class nsIAtom;
@ -168,7 +169,8 @@ class nsHTMLContentSerializer : public nsXMLContentSerializer {
PRBool isFirstListItem; PRBool isFirstListItem;
}; };
nsAutoVoidArray mOLStateStack;// Stack to store one olState struct per <OL>. // Stack to store one olState struct per <OL>.
nsAutoTArray<olState*, 8> mOLStateStack;
}; };
nsresult nsresult

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

@ -235,21 +235,21 @@ nsPlainTextSerializer::Init(PRUint32 aFlags, PRUint32 aWrapColumn,
} }
PRBool PRBool
nsPlainTextSerializer::GetLastBool(const nsVoidArray& aStack) nsPlainTextSerializer::GetLastBool(const nsTArray<PRPackedBool>& aStack)
{ {
PRUint32 size = aStack.Count(); PRUint32 size = aStack.Length();
if (size == 0) { if (size == 0) {
return PR_FALSE; return PR_FALSE;
} }
return (aStack.ElementAt(size-1) != reinterpret_cast<void*>(PR_FALSE)); return aStack.ElementAt(size-1);
} }
void void
nsPlainTextSerializer::SetLastBool(nsVoidArray& aStack, PRBool aValue) nsPlainTextSerializer::SetLastBool(nsTArray<PRPackedBool>& aStack, PRBool aValue)
{ {
PRUint32 size = aStack.Count(); PRUint32 size = aStack.Length();
if (size > 0) { if (size > 0) {
aStack.ReplaceElementAt(reinterpret_cast<void*>(aValue), size-1); aStack.ElementAt(size-1) = aValue;
} }
else { else {
NS_ERROR("There is no \"Last\" value"); NS_ERROR("There is no \"Last\" value");
@ -257,18 +257,18 @@ nsPlainTextSerializer::SetLastBool(nsVoidArray& aStack, PRBool aValue)
} }
void void
nsPlainTextSerializer::PushBool(nsVoidArray& aStack, PRBool aValue) nsPlainTextSerializer::PushBool(nsTArray<PRPackedBool>& aStack, PRBool aValue)
{ {
aStack.AppendElement(reinterpret_cast<void*>(aValue)); aStack.AppendElement(PRPackedBool(aValue));
} }
PRBool PRBool
nsPlainTextSerializer::PopBool(nsVoidArray& aStack) nsPlainTextSerializer::PopBool(nsTArray<PRPackedBool>& aStack)
{ {
PRBool returnValue = PR_FALSE; PRBool returnValue = PR_FALSE;
PRUint32 size = aStack.Count(); PRUint32 size = aStack.Length();
if (size > 0) { if (size > 0) {
returnValue = (aStack.ElementAt(size-1) != reinterpret_cast<void*>(PR_FALSE)); returnValue = aStack.ElementAt(size-1);
aStack.RemoveElementAt(size-1); aStack.RemoveElementAt(size-1);
} }
return returnValue; return returnValue;
@ -681,7 +681,7 @@ nsPlainTextSerializer::DoOpenContainer(const nsIParserNode* aNode, PRInt32 aTag)
AddToLine(NS_LITERAL_STRING("\t").get(), 1); AddToLine(NS_LITERAL_STRING("\t").get(), 1);
mInWhitespace = PR_TRUE; mInWhitespace = PR_TRUE;
} }
else if (mHasWrittenCellsForRow.Count() == 0) { else if (mHasWrittenCellsForRow.IsEmpty()) {
// We don't always see a <tr> (nor a <table>) before the <td> if we're // We don't always see a <tr> (nor a <table>) before the <td> if we're
// copying part of a table // copying part of a table
PushBool(mHasWrittenCellsForRow, PR_TRUE); // will never be popped PushBool(mHasWrittenCellsForRow, PR_TRUE); // will never be popped

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

@ -54,7 +54,7 @@
#include "nsIAtom.h" #include "nsIAtom.h"
#include "nsIHTMLToTextSink.h" #include "nsIHTMLToTextSink.h"
#include "nsIDocumentEncoder.h" #include "nsIDocumentEncoder.h"
#include "nsVoidArray.h" #include "nsTArray.h"
class nsPlainTextSerializer : public nsIContentSerializer, class nsPlainTextSerializer : public nsIContentSerializer,
@ -164,10 +164,10 @@ protected:
} }
// Stack handling functions // Stack handling functions
PRBool GetLastBool(const nsVoidArray& aStack); PRBool GetLastBool(const nsTArray<PRPackedBool>& aStack);
void SetLastBool(nsVoidArray& aStack, PRBool aValue); void SetLastBool(nsTArray<PRPackedBool>& aStack, PRBool aValue);
void PushBool(nsVoidArray& aStack, PRBool aValue); void PushBool(nsTArray<PRPackedBool>& aStack, PRBool aValue);
PRBool PopBool(nsVoidArray& aStack); PRBool PopBool(nsTArray<PRPackedBool>& aStack);
protected: protected:
nsString mCurrentLine; nsString mCurrentLine;
@ -241,11 +241,11 @@ protected:
nsCOMPtr<nsIContent> mContent; nsCOMPtr<nsIContent> mContent;
// For handling table rows // For handling table rows
nsAutoVoidArray mHasWrittenCellsForRow; // really an array of bools nsAutoTArray<PRPackedBool, 8> mHasWrittenCellsForRow;
// Values gotten in OpenContainer that is (also) needed in CloseContainer // Values gotten in OpenContainer that is (also) needed in CloseContainer
nsAutoVoidArray mCurrentNodeIsConverted; // really an array of bools nsAutoTArray<PRPackedBool, 8> mCurrentNodeIsConverted;
nsAutoVoidArray mIsInCiteBlockquote; // really an array of bools nsAutoTArray<PRPackedBool, 8> mIsInCiteBlockquote;
// The output data // The output data
nsAString* mOutputString; nsAString* mOutputString;

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

@ -53,8 +53,6 @@
#include "prmon.h" #include "prmon.h"
#include "nsStubMutationObserver.h" #include "nsStubMutationObserver.h"
class nsVoidArray;
// ------------------------------------------------------------------------------- // -------------------------------------------------------------------------------
class nsRangeUtils : public nsIRangeUtils class nsRangeUtils : public nsIRangeUtils

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

@ -44,7 +44,6 @@
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsAString.h" #include "nsAString.h"
#include "nsVoidArray.h"
#include "nsIScriptEventManager.h" #include "nsIScriptEventManager.h"
#include "nsIDOMNodeList.h" #include "nsIDOMNodeList.h"

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

@ -199,14 +199,15 @@ IsScriptEventHandler(nsIScriptElement *aScriptElement)
} }
nsresult nsresult
nsScriptLoader::CheckContentPolicy(nsScriptLoadRequest *aRequest, nsScriptLoader::CheckContentPolicy(nsIDocument* aDocument,
nsISupports *aContext, nsISupports *aContext,
nsIURI *aURI,
const nsAString &aType) const nsAString &aType)
{ {
PRInt16 shouldLoad = nsIContentPolicy::ACCEPT; PRInt16 shouldLoad = nsIContentPolicy::ACCEPT;
nsresult rv = NS_CheckContentLoadPolicy(nsIContentPolicy::TYPE_SCRIPT, nsresult rv = NS_CheckContentLoadPolicy(nsIContentPolicy::TYPE_SCRIPT,
aRequest->mURI, aURI,
mDocument->NodePrincipal(), aDocument->NodePrincipal(),
aContext, aContext,
NS_LossyConvertUTF16toASCII(aType), NS_LossyConvertUTF16toASCII(aType),
nsnull, //extra nsnull, //extra
@ -224,20 +225,34 @@ nsScriptLoader::CheckContentPolicy(nsScriptLoadRequest *aRequest,
} }
nsresult nsresult
nsScriptLoader::StartLoad(nsScriptLoadRequest *aRequest, const nsAString &aType) nsScriptLoader::ShouldLoadScript(nsIDocument* aDocument,
nsISupports* aContext,
nsIURI* aURI,
const nsAString &aType)
{ {
// Check that the containing page is allowed to load this URI. // Check that the containing page is allowed to load this URI.
nsresult rv = nsContentUtils::GetSecurityManager()-> nsresult rv = nsContentUtils::GetSecurityManager()->
CheckLoadURIWithPrincipal(mDocument->NodePrincipal(), aRequest->mURI, CheckLoadURIWithPrincipal(aDocument->NodePrincipal(), aURI,
nsIScriptSecurityManager::ALLOW_CHROME); nsIScriptSecurityManager::ALLOW_CHROME);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
// After the security manager, the content-policy stuff gets a veto // After the security manager, the content-policy stuff gets a veto
rv = CheckContentPolicy(aDocument, aContext, aURI, aType);
if (NS_FAILED(rv)) {
return rv;
}
return NS_OK;
}
nsresult
nsScriptLoader::StartLoad(nsScriptLoadRequest *aRequest, const nsAString &aType)
{
nsISupports *context = aRequest->mElement.get() nsISupports *context = aRequest->mElement.get()
? static_cast<nsISupports *>(aRequest->mElement.get()) ? static_cast<nsISupports *>(aRequest->mElement.get())
: static_cast<nsISupports *>(mDocument); : static_cast<nsISupports *>(mDocument);
rv = CheckContentPolicy(aRequest, context, aType); nsresult rv = ShouldLoadScript(mDocument, context, aRequest->mURI, aType);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
return rv; return rv;
} }
@ -485,7 +500,7 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
request->mDefer = mDeferEnabled && aElement->GetScriptDeferred(); request->mDefer = mDeferEnabled && aElement->GetScriptDeferred();
mPreloads.RemoveElementAt(i); mPreloads.RemoveElementAt(i);
rv = CheckContentPolicy(request, aElement, type); rv = CheckContentPolicy(mDocument, aElement, request->mURI, type);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
// Note, we're dropping our last ref to request here. // Note, we're dropping our last ref to request here.
return rv; return rv;

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

@ -180,6 +180,15 @@ public:
*/ */
void ProcessPendingRequests(); void ProcessPendingRequests();
/**
* Check whether it's OK to load a script from aURI in
* aDocument.
*/
static nsresult ShouldLoadScript(nsIDocument* aDocument,
nsISupports* aContext,
nsIURI* aURI,
const nsAString &aType);
/** /**
* Check whether it's OK to execute a script loaded via aChannel in * Check whether it's OK to execute a script loaded via aChannel in
* aDocument. * aDocument.
@ -233,9 +242,10 @@ protected:
/** /**
* Helper function to check the content policy for a given request. * Helper function to check the content policy for a given request.
*/ */
nsresult CheckContentPolicy(nsScriptLoadRequest *aRequest, static nsresult CheckContentPolicy(nsIDocument* aDocument,
nsISupports *aContext, nsISupports *aContext,
const nsAString &aType); nsIURI *aURI,
const nsAString &aType);
/** /**
* Start a load for aRequest's URI. * Start a load for aRequest's URI.

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

@ -57,7 +57,6 @@
#include "nsISimpleUnicharStreamFactory.h" #include "nsISimpleUnicharStreamFactory.h"
#include "nsNetUtil.h" #include "nsNetUtil.h"
#include "nsUnicharUtils.h" #include "nsUnicharUtils.h"
#include "nsVoidArray.h"
#include "nsCRT.h" #include "nsCRT.h"
#include "nsXPCOMCIDInternal.h" #include "nsXPCOMCIDInternal.h"
#include "nsUnicharInputStream.h" #include "nsUnicharInputStream.h"

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

@ -558,9 +558,8 @@ PRInt32 nsTreeWalker::IndexOf(nsINode* aParent,
nsINode* aChild, nsINode* aChild,
PRInt32 aIndexPos) PRInt32 aIndexPos)
{ {
if (aIndexPos >= 0 && aIndexPos < mPossibleIndexes.Count()) { if (aIndexPos >= 0 && aIndexPos < PRInt32(mPossibleIndexes.Length())) {
PRInt32 possibleIndex = PRInt32 possibleIndex = mPossibleIndexes.ElementAt(aIndexPos);
NS_PTR_TO_INT32(mPossibleIndexes.FastElementAt(aIndexPos));
if (aChild == aParent->GetChildAt(possibleIndex)) { if (aChild == aParent->GetChildAt(possibleIndex)) {
return possibleIndex; return possibleIndex;
} }

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

@ -47,7 +47,7 @@
#include "nsIDOMTreeWalker.h" #include "nsIDOMTreeWalker.h"
#include "nsTraversal.h" #include "nsTraversal.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsVoidArray.h" #include "nsTArray.h"
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
class nsINode; class nsINode;
@ -74,9 +74,8 @@ private:
/* /*
* Array with all child indexes up the tree. This should only be * Array with all child indexes up the tree. This should only be
* considered a hint and the value could be wrong. * considered a hint and the value could be wrong.
* The array contains casted PRInt32's
*/ */
nsAutoVoidArray mPossibleIndexes; nsAutoTArray<PRInt32, 8> mPossibleIndexes;
/* /*
* Position of mCurrentNode in mPossibleIndexes * Position of mCurrentNode in mPossibleIndexes
@ -168,9 +167,10 @@ private:
*/ */
void SetChildIndex(PRInt32 aIndexPos, PRInt32 aChildIndex) void SetChildIndex(PRInt32 aIndexPos, PRInt32 aChildIndex)
{ {
if (aIndexPos != -1) if (aIndexPos >= 0 &&
mPossibleIndexes.ReplaceElementAt(NS_INT32_TO_PTR(aChildIndex), mPossibleIndexes.EnsureLengthAtLeast(aIndexPos+1)) {
aIndexPos); mPossibleIndexes.ElementAt(aIndexPos) = aChildIndex;
}
} }
}; };

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

@ -64,11 +64,11 @@
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsAttrName.h" #include "nsAttrName.h"
typedef struct { struct NameSpaceDecl {
nsString mPrefix; nsString mPrefix;
nsString mURI; nsString mURI;
nsIDOMElement* mOwner; nsIDOMElement* mOwner;
} NameSpaceDecl; };
nsresult NS_NewXMLContentSerializer(nsIContentSerializer** aSerializer) nsresult NS_NewXMLContentSerializer(nsIContentSerializer** aSerializer)
{ {
@ -346,7 +346,7 @@ nsXMLContentSerializer::PushNameSpaceDecl(const nsAString& aPrefix,
// we pop the stack // we pop the stack
decl->mOwner = aOwner; decl->mOwner = aOwner;
mNameSpaceStack.AppendElement((void*)decl); mNameSpaceStack.AppendElement(decl);
return NS_OK; return NS_OK;
} }
@ -355,9 +355,9 @@ nsXMLContentSerializer::PopNameSpaceDeclsFor(nsIDOMElement* aOwner)
{ {
PRInt32 index, count; PRInt32 index, count;
count = mNameSpaceStack.Count(); count = mNameSpaceStack.Length();
for (index = count - 1; index >= 0; index--) { for (index = count - 1; index >= 0; index--) {
NameSpaceDecl* decl = (NameSpaceDecl*)mNameSpaceStack.ElementAt(index); NameSpaceDecl* decl = mNameSpaceStack.ElementAt(index);
if (decl->mOwner != aOwner) { if (decl->mOwner != aOwner) {
break; break;
} }
@ -411,10 +411,10 @@ nsXMLContentSerializer::ConfirmPrefix(nsAString& aPrefix,
// later (so in a more outer scope) see it bound to aURI we can't reuse it. // later (so in a more outer scope) see it bound to aURI we can't reuse it.
PRBool haveSeenOurPrefix = PR_FALSE; PRBool haveSeenOurPrefix = PR_FALSE;
PRInt32 count = mNameSpaceStack.Count(); PRInt32 count = mNameSpaceStack.Length();
PRInt32 index = count - 1; PRInt32 index = count - 1;
while (index >= 0) { while (index >= 0) {
NameSpaceDecl* decl = (NameSpaceDecl*)mNameSpaceStack.ElementAt(index); NameSpaceDecl* decl = mNameSpaceStack.ElementAt(index);
// Check if we've found a prefix match // Check if we've found a prefix match
if (aPrefix.Equals(decl->mPrefix)) { if (aPrefix.Equals(decl->mPrefix)) {
@ -464,8 +464,7 @@ nsXMLContentSerializer::ConfirmPrefix(nsAString& aPrefix,
PRBool prefixOK = PR_TRUE; PRBool prefixOK = PR_TRUE;
PRInt32 index2; PRInt32 index2;
for (index2 = count-1; index2 > index && prefixOK; --index2) { for (index2 = count-1; index2 > index && prefixOK; --index2) {
NameSpaceDecl* decl2 = NameSpaceDecl* decl2 = mNameSpaceStack.ElementAt(index2);
(NameSpaceDecl*)mNameSpaceStack.ElementAt(index2);
prefixOK = (decl2->mPrefix != decl->mPrefix); prefixOK = (decl2->mPrefix != decl->mPrefix);
} }

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

@ -47,10 +47,12 @@
#include "nsIContentSerializer.h" #include "nsIContentSerializer.h"
#include "nsISupportsUtils.h" #include "nsISupportsUtils.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsVoidArray.h" #include "nsTArray.h"
#include "nsString.h"
class nsIDOMNode; class nsIDOMNode;
class nsIAtom; class nsIAtom;
struct NameSpaceDecl;
class nsXMLContentSerializer : public nsIContentSerializer { class nsXMLContentSerializer : public nsIContentSerializer {
public: public:
@ -156,7 +158,7 @@ class nsXMLContentSerializer : public nsIContentSerializer {
void MaybeFlagNewline(nsIDOMNode* aNode); void MaybeFlagNewline(nsIDOMNode* aNode);
PRInt32 mPrefixIndex; PRInt32 mPrefixIndex;
nsVoidArray mNameSpaceStack; nsTArray<NameSpaceDecl*> mNameSpaceStack;
// nsIDocumentEncoder flags // nsIDocumentEncoder flags
PRUint32 mFlags; PRUint32 mFlags;

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

@ -82,12 +82,11 @@ nsXMLNameSpaceMap::nsXMLNameSpaceMap()
nsresult nsresult
nsXMLNameSpaceMap::AddPrefix(nsIAtom *aPrefix, PRInt32 aNameSpaceID) nsXMLNameSpaceMap::AddPrefix(nsIAtom *aPrefix, PRInt32 aNameSpaceID)
{ {
PRInt32 count = mNameSpaces.Count(); PRUint32 count = mNameSpaces.Length();
nsNameSpaceEntry *foundEntry = nsnull; nsNameSpaceEntry *foundEntry = nsnull;
for (PRInt32 i = 0; i < count; ++i) { for (PRUint32 i = 0; i < count; ++i) {
nsNameSpaceEntry *entry = static_cast<nsNameSpaceEntry*> nsNameSpaceEntry *entry = mNameSpaces.ElementAt(i);
(mNameSpaces.FastElementAt(i));
NS_ASSERTION(entry, "null entry in namespace map!"); NS_ASSERTION(entry, "null entry in namespace map!");
@ -101,7 +100,7 @@ nsXMLNameSpaceMap::AddPrefix(nsIAtom *aPrefix, PRInt32 aNameSpaceID)
foundEntry = new nsNameSpaceEntry(aPrefix); foundEntry = new nsNameSpaceEntry(aPrefix);
NS_ENSURE_TRUE(foundEntry, NS_ERROR_OUT_OF_MEMORY); NS_ENSURE_TRUE(foundEntry, NS_ERROR_OUT_OF_MEMORY);
if (!mNameSpaces.AppendElement(foundEntry)) { if (mNameSpaces.AppendElement(foundEntry) == nsnull) {
delete foundEntry; delete foundEntry;
return NS_ERROR_OUT_OF_MEMORY; return NS_ERROR_OUT_OF_MEMORY;
} }
@ -126,11 +125,10 @@ nsXMLNameSpaceMap::AddPrefix(nsIAtom *aPrefix, nsString &aURI)
void void
nsXMLNameSpaceMap::RemovePrefix(nsIAtom *aPrefix) nsXMLNameSpaceMap::RemovePrefix(nsIAtom *aPrefix)
{ {
PRInt32 count = mNameSpaces.Count(); PRUint32 count = mNameSpaces.Length();
for (PRInt32 i = 0; i < count; ++i) { for (PRUint32 i = 0; i < count; ++i) {
nsNameSpaceEntry *entry = static_cast<nsNameSpaceEntry*> nsNameSpaceEntry *entry = mNameSpaces.ElementAt(i);
(mNameSpaces.FastElementAt(i));
NS_ASSERTION(entry, "null entry in namespace map!"); NS_ASSERTION(entry, "null entry in namespace map!");
@ -144,11 +142,10 @@ nsXMLNameSpaceMap::RemovePrefix(nsIAtom *aPrefix)
PRInt32 PRInt32
nsXMLNameSpaceMap::FindNameSpaceID(nsIAtom *aPrefix) const nsXMLNameSpaceMap::FindNameSpaceID(nsIAtom *aPrefix) const
{ {
PRInt32 count = mNameSpaces.Count(); PRUint32 count = mNameSpaces.Length();
for (PRInt32 i = 0; i < count; ++i) { for (PRUint32 i = 0; i < count; ++i) {
nsNameSpaceEntry *entry = static_cast<nsNameSpaceEntry*> nsNameSpaceEntry *entry = mNameSpaces.ElementAt(i);
(mNameSpaces.FastElementAt(i));
NS_ASSERTION(entry, "null entry in namespace map!"); NS_ASSERTION(entry, "null entry in namespace map!");
@ -166,11 +163,10 @@ nsXMLNameSpaceMap::FindNameSpaceID(nsIAtom *aPrefix) const
nsIAtom* nsIAtom*
nsXMLNameSpaceMap::FindPrefix(PRInt32 aNameSpaceID) const nsXMLNameSpaceMap::FindPrefix(PRInt32 aNameSpaceID) const
{ {
PRInt32 count = mNameSpaces.Count(); PRUint32 count = mNameSpaces.Length();
for (PRInt32 i = 0; i < count; ++i) { for (PRUint32 i = 0; i < count; ++i) {
nsNameSpaceEntry *entry = static_cast<nsNameSpaceEntry*> nsNameSpaceEntry *entry = mNameSpaces.ElementAt(i);
(mNameSpaces.FastElementAt(i));
NS_ASSERTION(entry, "null entry in namespace map!"); NS_ASSERTION(entry, "null entry in namespace map!");
@ -182,14 +178,11 @@ nsXMLNameSpaceMap::FindPrefix(PRInt32 aNameSpaceID) const
return nsnull; return nsnull;
} }
static PRBool DeleteEntry(void *aElement, void *aData)
{
delete static_cast<nsNameSpaceEntry*>(aElement);
return PR_TRUE;
}
void void
nsXMLNameSpaceMap::Clear() nsXMLNameSpaceMap::Clear()
{ {
mNameSpaces.EnumerateForwards(DeleteEntry, nsnull); for (PRUint32 i = 0, len = mNameSpaces.Length(); i < len; ++i) {
delete mNameSpaces[i];
}
mNameSpaces.Clear();
} }

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

@ -48,6 +48,7 @@ _TEST_FILES = \
$(NULL) $(NULL)
_CHROME_FILES = \ _CHROME_FILES = \
test_bug206691.xul \
test_bug421622.xul \ test_bug421622.xul \
test_bug429785.xul \ test_bug429785.xul \
test_bug430050.xul \ test_bug430050.xul \

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

@ -0,0 +1,35 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
type="text/css"?>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=206691
-->
<window title="Mozilla Bug 206691"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<!-- test results are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml">
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=206691"
target="_blank">Mozilla Bug 206691</a>
</body>
<!-- test code goes here -->
<script type="application/javascript"><![CDATA[
/** Test for Bug 206691 **/
SimpleTest.waitForExplicitFinish();
addLoadEvent(function() {
var xhr = new XMLHttpRequest();
xhr.open("GET", location, false);
xhr.send();
ok(xhr.responseText, "We should have response content!");
SimpleTest.finish();
});
]]></script>
</window>

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

@ -36,7 +36,6 @@
* *
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
const gBasePath = "content/base/test/unit/";
const nsIDocumentEncoder = Components.interfaces.nsIDocumentEncoder; const nsIDocumentEncoder = Components.interfaces.nsIDocumentEncoder;
const replacementChar = Components.interfaces.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER; const replacementChar = Components.interfaces.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER;
@ -45,7 +44,7 @@ function loadContentFile(aFile, aCharset) {
if(aCharset == undefined) if(aCharset == undefined)
aCharset = 'UTF-8'; aCharset = 'UTF-8';
var file = do_get_file(gBasePath+aFile); var file = do_get_file(aFile);
var ios = Components.classes['@mozilla.org/network/io-service;1'] var ios = Components.classes['@mozilla.org/network/io-service;1']
.getService(Components.interfaces.nsIIOService); .getService(Components.interfaces.nsIIOService);
var chann = ios.newChannelFromURI ( ios.newFileURI (file) ); var chann = ios.newChannelFromURI ( ios.newFileURI (file) );

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