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$
(^|/)TAGS$
\.DS_Store$
(^|/)\.DS_Store$
# User files that may appear at the root
^\.mozconfig$

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

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

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

@ -292,7 +292,7 @@
<image id="thepreviewimage"/>
</hbox>
<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>
</vbox>
</vbox>

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

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

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

@ -68,9 +68,10 @@ _BROWSER_FILES = browser_sanitize-timespans.js \
browser_bug409481.js \
browser_bug413915.js \
browser_bug420160.js \
browser_bug432599.js \
browser_bug427559.js \
browser_bug432599.js \
browser_bug441778.js \
browser_bug455852.js \
browser_discovery.js \
discovery.html \
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
# Implemented in testing/testsuite-targets.mk
ifdef TEST_PATH
BROWSER_TEST_PATH = --test-path=$(TEST_PATH)
else
BROWSER_TEST_PATH =
endif
mochitest-browser-chrome:
$(RUN_MOCHITEST) --browser-chrome $(BROWSER_TEST_PATH)
$(RUN_MOCHITEST) --browser-chrome
$(CHECK_TEST_ERROR)
mochitest:: mochitest-browser-chrome

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

@ -973,26 +973,13 @@ PlacesController.prototype = {
}
}
else if (PlacesUtils.nodeIsDay(node)) {
// this is the oldest date
// for the last node endDate is end of epoch
var beginDate = 0;
// this is the newest date
// day nodes have time property set to the last day in the interval
var endDate = node.time;
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);
var query = node.getQueries({})[0];
var beginTime = query.beginTime;
var endTime = query.endTime;
NS_ASSERT(query && beginTime && endTime,
"A valid date container query should exist!");
// We want to exclude beginTime from the removal
bhist.removePagesByTimeframe(beginTime+1, endTime);
}
}

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

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

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

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

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

@ -71,7 +71,7 @@ function run_test() {
ps.setIntPref("browser.places.smartBookmarksVersion", -1);
// 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 {
ies.importHTMLFromFile(corruptBookmarksFile, true);
} catch(ex) { do_throw("couldn't import corrupt bookmarks file: " + ex); }

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

@ -102,7 +102,7 @@ function run_test() {
setIntPref("browser.places.smartBookmarksVersion", -1);
// 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
var bookmarksFileNew = dirSvc.get("ProfD", Ci.nsILocalFile);
bookmarksFileNew.append("bookmarks.exported.html");

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

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

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

@ -106,6 +106,14 @@
for (let i = 0; i < elements.length; ++ 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
if (mainWindow.gURLBar)
mainWindow.focusElement(mainWindow.gURLBar);
@ -153,6 +161,14 @@
<p id="footerText" class="showPrivate">&privatebrowsingpage.howToStop;</p>
<p id="footerTextNormal" class="showNormal">&privatebrowsingpage.howToStart;</p>
</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>

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

@ -116,7 +116,7 @@ function do_test()
// the active downloads array.
// 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");
// Open the database

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

@ -39,6 +39,6 @@
function run_test() {
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();
}

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

@ -40,6 +40,6 @@
function run_test() {
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();
}

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

@ -39,6 +39,6 @@
function run_test() {
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();
}

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

@ -40,6 +40,6 @@
function run_test() {
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();
}

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

@ -44,6 +44,6 @@
function run_test() {
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();
}

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

@ -44,6 +44,6 @@
function run_test() {
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();
}

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

@ -44,6 +44,6 @@
function run_test() {
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();
}

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

@ -44,6 +44,6 @@
function run_test() {
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();
}

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

@ -52,7 +52,7 @@
<title>&restorepage.tabtitle;</title>
<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="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"/>
</head>
@ -64,7 +64,7 @@
<!-- Error Title -->
<div id="errorTitle">
<h1 id="errorTitleText">&restorepage.pagetitle;</h1>
<h1 id="errorTitleText">&restorepage.errorTitle;</h1>
</div>
<!-- LONG CONTENT (the section most likely to require scrolling) -->
@ -72,20 +72,21 @@
<!-- Short Description -->
<div id="errorShortDesc">
<p id="errorShortDescText">&restorepage.issueDesc;</p>
<p id="errorShortDescText">&restorepage.problemDesc;</p>
</div>
<!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
<div id="errorLongDesc">
<p>&restorepage.remedies;</p>
<p>&restorepage.tryThis;</p>
<ul>
<li>&restorepage.dueToChrome;</li>
<li>&restorepage.dueToContent;</li>
<li>&restorepage.restoreSome;</li>
<li>&restorepage.startNew;</li>
</ul>
</div>
<!-- Short Description -->
<div id="errorTrailerDesc">
<p>&nbsp;</p>
<tree xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="tabList" flex="1" seltype="single" hidecolumnpicker="true"
onclick="onListClick(event);" onkeydown="onListKeyDown(event);"
@ -106,11 +107,11 @@
<button id="errorCancel" label="&restorepage.cancelButton;"
accesskey="&restorepage.cancel.access;"
oncommand="startNewSession();"/>
<button id="errorTryAgain" label="&restorepage.restoreButton;"
<button id="errorTryAgain" label="&restorepage.tryagainButton;"
accesskey="&restorepage.restore.access;"
oncommand="restoreSession();"/>
#else
<button id="errorTryAgain" label="&restorepage.restoreButton;"
<button id="errorTryAgain" label="&restorepage.tryagainButton;"
accesskey="&restorepage.restore.access;"
oncommand="restoreSession();"/>
<button id="errorCancel" label="&restorepage.cancelButton;"

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

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

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

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

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

@ -323,8 +323,8 @@ bin\res\grabber.gif
bin\res\viewsource.css
bin\res\mathml.css
bin\res\arrow.gif
bin\res\loading-image.gif
bin\res\broken-image.gif
bin\res\loading-image.png
bin\res\broken-image.png
bin\res\fonts\*
bin\res\dtd\*
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=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
# 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

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

@ -1,13 +1,14 @@
<!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.cancelButton "Start New Session">
<!ENTITY restorepage.cancel.access "S">

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

@ -61,7 +61,22 @@ blockedpluginsMessage.searchButton.accesskey=U
# Sanitize
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
updatesItem_default=Check for Updates…

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

@ -1,5 +1,7 @@
<!ENTITY history.label "History">
<!ENTITY locationBar.label "Location Bar">
<!ENTITY locbar.pre.label "When using the location bar, suggest:">
<!ENTITY locbar.pre.accessKey "l">
<!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 sanitizeItems.label "Clear the following items now:">
<!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 -->
<!ENTITY clearDuration.label "Remove ">
<!ENTITY clearDuration.accesskey "R">
<!ENTITY clearDuration.lastHour "the last hour">
<!ENTITY clearDuration.last2Hours "the last 2 hours">
<!ENTITY clearDuration.last4Hours "the last 4 hours">
<!ENTITY clearDuration.today "my history for today">
<!ENTITY clearDuration.everything "my entire history">
<!-- Localization note (clearDuration.suffix) - trailing entity for languages
<!-- LOCALIZATION NOTE (clearTimeDuration.*): "Time range to clear" dropdown.
See UI mockup at bug 480169 -->
<!ENTITY clearTimeDuration.label "Time range to clear: ">
<!ENTITY clearTimeDuration.accesskey "T">
<!ENTITY clearTimeDuration.lastHour "Last Hour">
<!ENTITY clearTimeDuration.last2Hours "Last Two Hours">
<!ENTITY clearTimeDuration.last4Hours "Last Four Hours">
<!ENTITY clearTimeDuration.today "Today">
<!ENTITY clearTimeDuration.everything "Everything">
<!-- Localization note (clearTimeDuration.suffix) - trailing entity for languages
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 dataSection.label "Data">
<!ENTITY itemVisitedPages.label "Visited Pages">
<!ENTITY itemVisitedPages.accesskey "V">
<!ENTITY itemFormSearchEntries.label "Form &amp; Search Entries">
<!ENTITY itemFormSearchEntries.accesskey "F">
<!ENTITY itemPasswords.label "Saved Passwords">
<!ENTITY itemPasswords.accesskey "P">
<!ENTITY itemCookies.label "Cookies">
<!ENTITY itemCookies.accesskey "C">
<!ENTITY itemWebCache.label "Web Cache">
<!ENTITY itemWebCache.accesskey "W">
<!ENTITY itemOfflineApps.label "Offline Website Data">
<!ENTITY itemOfflineApps.accesskey "O">
<!ENTITY itemDownloadList.label "Download List">
<!ENTITY itemDownloadList.accesskey "D">
<!ENTITY itemActiveLogins.label "Active Logins">
<!ENTITY itemActiveLogins.accesskey "L">
<!ENTITY itemSiteSettings.label "Site-specific Settings">
<!ENTITY itemSiteSettings.accesskey "S">
<!-- LOCALIZATION NOTE (item*): itemHistoryAndDownloads.* and
itemBrowsingHistory.* will never be used at the same time, so they can
have the same accesskey. -->
<!ENTITY itemHistoryAndDownloads.label "Browsing and Download History">
<!ENTITY itemHistoryAndDownloads.accesskey "B">
<!ENTITY itemBrowsingHistory.label "Browsing History">
<!ENTITY itemBrowsingHistory.accesskey "B">
<!ENTITY itemFormSearchHistory.label "Form &amp; Search History">
<!ENTITY itemFormSearchHistory.accesskey "F">
<!ENTITY itemPasswords.label "Saved Passwords">
<!ENTITY itemPasswords.accesskey "P">
<!ENTITY itemCookies.label "Cookies">
<!ENTITY itemCookies.accesskey "C">
<!ENTITY itemCache.label "Cache">
<!ENTITY itemCache.accesskey "A">
<!ENTITY itemOfflineApps.label "Offline Website Data">
<!ENTITY itemOfflineApps.accesskey "O">
<!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">

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

@ -59,3 +59,13 @@ body.normal > #errorPageContainer {
#footerDesc > p {
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
#errorPageContainer {
background-image: url("moz-icon://stock/gtk-dialog-question?size=dialog");
background-image: url("moz-icon://stock/gtk-dialog-warning?size=dialog");
}
#tabList {

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

@ -222,7 +222,7 @@ menuitem:not([type]) {
}
#placesContext_open\:newwindow,
menuitem[command="cmd_newNavigator"],
#menu_newNavigator,
#context-openlink,
#context-openframe {
list-style-image: url("chrome://browser/skin/Toolbar-small.png");
@ -231,14 +231,14 @@ menuitem[command="cmd_newNavigator"],
#placesContext_open\:newtab,
#placesContext_openContainer\:tabs,
menuitem[command="cmd_newNavigatorTab"],
#menu_newNavigatorTab,
#context-openlinkintab,
#context-openframeintab {
list-style-image: url("chrome://browser/skin/Toolbar-small.png");
-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");
}
@ -254,7 +254,7 @@ menuitem[command="Browser:OpenFile"] {
list-style-image: url("moz-icon://stock/gtk-media-pause?size=menu");
}
menuitem[command="Browser:SavePage"],
#menu_savePage,
#context-savelink,
#context-saveimage,
#context-savevideo,
@ -264,11 +264,11 @@ menuitem[command="Browser:SavePage"],
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");
}
menuitem[command="cmd_print"],
#menu_print,
#context-printframe {
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");
}
menuitem[command="cmd_undo"],
#menu_undo,
#context-undo {
list-style-image: url("moz-icon://stock/gtk-undo?size=menu");
}
menuitem[command="cmd_undo"][disabled],
#menu_undo[disabled],
#context-undo[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");
}
menuitem[command="cmd_redo"][disabled] {
#menu_redo[disabled] {
list-style-image: url("moz-icon://stock/gtk-redo?size=menu&state=disabled");
}
menuitem[command="cmd_cut"],
#menu_cut,
#placesContext_cut,
#context-cut {
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] {
list-style-image: url("moz-icon://stock/gtk-cut?size=menu&state=disabled");
}
menuitem[command="cmd_copy"],
#menu_copy,
#placesContext_copy,
#context-copy,
#context-copyimage,
#context-copyvideourl,
@ -315,32 +318,40 @@ menuitem[command="cmd_copy"],
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] {
list-style-image: url("moz-icon://stock/gtk-copy?size=menu&state=disabled");
}
menuitem[command="cmd_paste"],
#menu_paste,
#placesContext_paste,
#context-paste {
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] {
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 {
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] {
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");
}
@ -356,77 +367,77 @@ menuitem[command="cmd_selectAll"] {
list-style-image: url("moz-icon://stock/gtk-preferences?size=menu");
}
menuitem[command="Browser:Stop"],
#menu_stop,
#context-stop {
list-style-image: url("moz-icon://stock/gtk-stop?size=menu");
}
menuitem[command="Browser:Stop"][disabled],
#menu_stop[disabled],
#context-stop[disabled] {
list-style-image: url("moz-icon://stock/gtk-stop?size=menu&state=disabled");
}
#menu_reload,
#placesContext_reload,
#placesContext_reloadMicrosummary,
menuitem[command="Browser:ReloadOrDuplicate"],
#context-reload,
#context-reloadframe {
list-style-image: url("moz-icon://stock/gtk-refresh?size=menu");
}
menuitem[command="Browser:ReloadOrDuplicate"][disabled],
#menu_reload[disabled],
#context-reload[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");
}
menuitem[command="cmd_fullZoomReduce"] {
#menu_zoomReduce {
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");
}
menuitem[key="goBackKb"],
#historyMenuBack,
#context-back {
list-style-image: url("moz-icon://stock/gtk-go-back-ltr?size=menu");
}
menuitem[key="goBackKb"][disabled],
#historyMenuBack[disabled],
#context-back[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"] {
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"] {
list-style-image: url("moz-icon://stock/gtk-go-back-rtl?size=menu&state=disabled");
}
menuitem[key="goForwardKb"],
#historyMenuForward,
#context-forward {
list-style-image: url("moz-icon://stock/gtk-go-forward-ltr?size=menu");
}
menuitem[key="goForwardKb"][disabled],
#historyMenuForward[disabled],
#context-forward[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"] {
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"] {
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");
}
menuitem[command="Browser:ShowAllHistory"] {
#menu_showAllHistory {
list-style-image: url("chrome://browser/skin/Toolbar-small.png");
-moz-image-region: rect(0px 32px 16px 16px);
}
menuitem[command="Browser:ShowAllBookmarks"] {
#bookmarksShowAll {
list-style-image: url("chrome://browser/skin/Toolbar-small.png");
-moz-image-region: rect(0px 48px 16px 32px);
}
@ -454,7 +465,7 @@ menuitem[command="Browser:ShowAllBookmarks"] {
-moz-image-region: rect(0px 16px 16px 0px);
}
menuitem[command="View:PageInfo"],
#menu_pageInfo,
#context-viewinfo,
#context-viewframeinfo {
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");
}
menuitem[key="key_openHelp"] {
#menu_openHelp {
list-style-image: url("moz-icon://stock/gtk-help?size=menu");
}

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

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

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

@ -59,3 +59,13 @@ body.normal > #errorPageContainer {
#footerDesc > p {
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
#errorPageContainer {
background-image: url("chrome://global/skin/icons/question-64.png");
background-image: url("chrome://global/skin/icons/warning-64.png");
}
#tabList {

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

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

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

@ -59,3 +59,13 @@ body.normal > #errorPageContainer {
#footerDesc > p {
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
#errorPageContainer {
background-image: url("chrome://global/skin/icons/question-48.png");
background-image: url("chrome://global/skin/icons/warning-large.png");
}
#tabList {

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

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

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

@ -54,8 +54,13 @@ DIRS = win32
endif
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
endif
endif
DIRS += pgo

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

@ -44,10 +44,18 @@ MODULE = shunt
TOPSRCDIR = $(topsrcdir)
OBJDIR = $(DEPTH)
export NO_SHUNT = 1
include $(DEPTH)/config/autoconf.mk
MODULE = mozce_shunt
LIBRARY_NAME = mozce_shunt
FORCE_SHARED_LIB= 1
DIST_INSTALL = 1
EXPORTS = include/windows.h \
include/ymath.h \
include/stdlib.h \
include/direct.h \
include/errno.h \
include/fcntl.h \
@ -60,32 +68,15 @@ EXPORTS = include/windows.h \
DIRS += include/sys
BUILD_SWITCH = -Build
REBUILD_SWITCH = -Rebuild
CLEAN_SWITCH = -clean
ifdef MOZ_MEMORY
REQUIRES = jemalloc
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
MOZCE_SHUNT_BUILDDIR=$(srcdir)/build/vs$(MOZ_MSVCVERSION)
MOZCE_PROJECT="Release|Windows Mobile 6 Professional SDK (ARMV4I)"
DEFINES += -DMOZCE_SHUNT_EXPORTS
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
#ifdef MOZCE_SHUNT_EXPORTS
#define _CRTIMP __declspec(dllexport)
#define MOZCE_SHUNT_API __declspec(dllexport)
#define MOZCE_SHUNT_IMPORT_API __declspec(dllexport)
#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
#define strdup _strdup
#define strndup _strndup
#define wcsdup _wcsdup
#define wcsndup _wcsndup
#define strcmpi _stricmp
#define stricmp _stricmp
#define wgetcwd _wgetcwd
@ -60,8 +130,8 @@ extern "C" {
#endif
/* errno and family */
extern MOZCE_SHUNT_API int errno;
MOZCE_SHUNT_API char* strerror(int);
extern MOZCE_SHUNT_IMPORT_API int errno;
MOZCE_SHUNT_IMPORT_API char* strerror(int);
/* abort */
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
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 ***** */
#include "stdlib.h"
#include "include/mozce_shunt.h"
#include "time_conversions.h"
#include <stdlib.h>
#include "Windows.h"
#include "mozce_shunt.h"
#include "time_conversions.h"
#ifdef MOZ_MEMORY
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
@ -324,12 +391,12 @@ MOZCE_SHUNT_API unsigned int ExpandEnvironmentStringsW(const unsigned short* lpS
// errno
////////////////////////////////////////////////////////
MOZCE_SHUNT_API char* strerror(int inErrno)
MOZCE_SHUNT_IMPORT_API char* strerror(int inErrno)
{
return "Unknown Error";
}
MOZCE_SHUNT_API int errno = 0;
MOZCE_SHUNT_IMPORT_API int errno = 0;
////////////////////////////////////////////////////////

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

@ -35,17 +35,23 @@
#
# ***** END LICENSE BLOCK *****
# this file is used directly during configure as well as included from Makefile.in
DEVENV_FLAG=-
CC=cl -O2
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
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
endif
BUILD_SWITCH=$(DEVENV_FLAG)Build
REBUILD_SWITCH=$(DEVENV_FLAG)Rebuild
@ -81,55 +87,49 @@ endif
endif
ifdef VPATH
CFLAGS += -DSHUNT_INC='"$(OBJDIR)/dist/include/shunt"'
else
CFLAGS += -DSHUNT_INC='"$(TOPSRCDIR)/build/wince/shunt/include"'
CFLAGS += -DSHUNT_INC='"$(OBJDIR)/dist/include/mozce_shunt"'
CFLAGS += -DSHUNT_LIB='"$(OBJDIR)/dist/lib"'
CFLAGS += -DJEMALLOC_LIB='"$(OBJDIR)/dist/lib/jemalloc.lib"'
endif
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 \
$(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
devenv $(MOZCE_SHUNT_SLN) $(BUILD_SWITCH) $(MOZCE_PROJECT)
all: libs export
libs: $(SDK_TOOLS)
clean: clobber
clobber:
rm $(MOZCE_TOOLS_BIN_DIR)/arm-wince-as.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)
rm $(MOZCE_TOOLS_BIN_DIR)/*.exe
$(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);
$(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
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
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
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
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)
OBJDIR = $(shell cd $(DEPTH); pwd -W)
CFLAGS += -DHAVE_SHUNT
MOZCE_NOT_CONFIGURE=1
include $(DEPTH)/config/autoconf.mk
ifdef MOZ_MEMORY
CFLAGS += -DMOZ_MEMORY
endif
include $(topsrcdir)/build/wince/tools/Makefile
export::

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

@ -13,9 +13,16 @@ main(int argc, char **argv)
char outputFileArg[1000];
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++] = "/DUNICODE";
args[i++] = "/D_UNICODE_";
@ -30,7 +37,6 @@ main(int argc, char **argv)
args[i++] = "/D_WINDOWS";
args[i++] = "/DNO_ERRNO";
args[i++] = "/Zc:wchar_t-"; //
args[i++] = "/GS-"; // disable security checks
args[i++] = "/GR-"; // disable C++ RTTI
@ -73,16 +79,19 @@ main(int argc, char **argv)
args[i++] = "/LIBPATH:\"" WCE_LIB "\"";
args[i++] = "/LIBPATH:\"" WCE_CRT "\"";
args[i++] = "/LIBPATH:\"" SHUNT_LIB "\"";
args[i++] = "mozce_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")) {
args[i++] = "/LIBPATH:\"" SHUNT_LIB "\"";
args[i++] = "mozce_shunt.lib";
}
#endif
args[i++] = "winsock.lib";
args[i++] = "corelibc.lib";
args[i++] = "coredll.lib";
//args[i++] = "/NODEFAULTLIB:LIBC";
args[i++] = "/NODEFAULTLIB:OLDNAMES";
}
args[i] = NULL;

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

@ -13,17 +13,22 @@ main(int argc, char **argv)
args[i++] = "/LIBPATH:\"" WCE_LIB "\"";
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++] = "coredll.lib";
args[i++] = "ceshell.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'
while(argv[j]) {

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

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

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

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

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

@ -38,7 +38,7 @@
var MANIFESTS = [
do_get_file("chrome/test/unit/data/test_bug380398.manifest")
do_get_file("data/test_bug380398.manifest")
];
registerManifests(MANIFESTS);
@ -83,7 +83,7 @@ var chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"]
.getService(Ci.nsIChromeRegistry);
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";
function test_succeeded_mapping(namespace)

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

@ -37,7 +37,7 @@
*/
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);
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";
function test_succeeded_mapping(namespace)

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

@ -37,7 +37,7 @@
*/
var MANIFESTS = [
do_get_file("chrome/test/unit/data/test_bug399707.manifest")
do_get_file("data/test_bug399707.manifest")
];
registerManifests(MANIFESTS);
@ -82,7 +82,7 @@ var chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"]
.getService(Ci.nsIChromeRegistry);
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";
function test_succeeded_mapping(namespace)

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

@ -37,7 +37,7 @@
*/
var MANIFESTS = [
do_get_file("chrome/test/unit/data/test_bug401153.manifest")
do_get_file("data/test_bug401153.manifest")
];
registerManifests(MANIFESTS);
@ -106,7 +106,7 @@ function test_failed_mapping(namespace)
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("test3", "jar:" + data + "test3.jar!/resources/");
test_failed_mapping("test4");

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

@ -38,7 +38,7 @@
* ***** END LICENSE BLOCK ***** */
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);

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

@ -38,7 +38,7 @@
* ***** END LICENSE BLOCK ***** */
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);

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

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

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

@ -131,9 +131,15 @@ endif
testxpcobjdir = $(DEPTH)/_tests/xpcshell
# 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
$(INSTALL) $(wildcard $(srcdir)/$(dir)/*.js) $(testxpcobjdir)/$(MODULE)/$(dir)
$(TEST_INSTALLER) $(wildcard $(srcdir)/$(dir)/*) $(testxpcobjdir)/$(MODULE)/$(dir)
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::
$(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
@ -149,7 +158,6 @@ check::
$(PYTHON) -u \
$(testxpcsrcdir)/runxpcshelltests.py \
$(DIST)/bin/xpcshell \
$(topsrcdir) \
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
# Execute a single test, specified in $(SOLO_FILE), but don't automatically
@ -161,7 +169,6 @@ check-interactive::
--test=$(SOLO_FILE) \
--interactive \
$(DIST)/bin/xpcshell \
$(topsrcdir) \
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
# Execute a single test, specified in $(SOLO_FILE)
@ -170,7 +177,6 @@ check-one::
$(testxpcsrcdir)/runxpcshelltests.py \
--test=$(SOLO_FILE) \
$(DIST)/bin/xpcshell \
$(topsrcdir) \
$(foreach dir,$(XPCSHELL_TESTS),$(testxpcobjdir)/$(MODULE)/$(dir))
endif # XPCSHELL_TESTS

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

@ -5872,7 +5872,6 @@ if test -n "$MOZ_TREE_FREETYPE"; then
AC_SUBST(MOZ_TREE_FREETYPE)
MOZ_ENABLE_CAIRO_FT=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"
CAIRO_FT_CFLAGS="-I${topsrcdir}/modules/freetype2/include"
FT2_LIBS="${LIBXUL_DIST}/lib/freetype2.lib"
@ -6589,6 +6588,10 @@ if test "$MOZ_MEMORY"; then
DLLFLAGS="$DLLFLAGS -MANIFEST:NO"
export DLLFLAGS
;;
*wince)
AC_DEFINE(MOZ_MEMORY_WINCE)
AC_DEFINE(MOZ_MEMORY_WINDOWS)
;;
*)
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"
PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
MOZ_ENABLE_CAIRO_FT=1
CAIRO_FT_CFLAGS="$FT2_CFLAGS"
fi
@ -7566,6 +7570,7 @@ if test "$MOZ_TREE_CAIRO"; then
if test "$MOZ_WIDGET_TOOLKIT" = "os2"; then
OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 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"
MOZ_ENABLE_CAIRO_FT=1
CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
@ -7575,6 +7580,7 @@ if test "$MOZ_TREE_CAIRO"; then
PKG_CHECK_MODULES(CAIRO_FT, fontconfig freetype2)
BEOS_SURFACE_FEATURE="#define CAIRO_HAS_BEOS_SURFACE 1"
FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
MOZ_ENABLE_CAIRO_FT=1
fi
AC_SUBST(MOZ_ENABLE_CAIRO_FT)

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

@ -99,7 +99,6 @@ class nsIRunnable;
class nsIInterfaceRequestor;
template<class E> class nsCOMArray;
class nsIPref;
class nsVoidArray;
struct JSRuntime;
class nsICaseConversion;
class nsIUGenCategory;
@ -212,12 +211,9 @@ public:
/*
* This method fills the |aArray| with all ancestor nodes of |aNode|
* 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,
nsVoidArray* aArray);
nsTArray<nsIDOMNode*>* aArray);
/*
* 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|
* 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.
*/
static nsresult GetAncestorsAndOffsets(nsIDOMNode* aNode,
PRInt32 aOffset,
nsVoidArray* aAncestorNodes,
nsVoidArray* aAncestorOffsets);
nsTArray<nsIContent*>* aAncestorNodes,
nsTArray<PRInt32>* aAncestorOffsets);
/*
* The out parameter, |aCommonAncestor| will be the closest node, if any,
@ -837,7 +829,7 @@ public:
static nsresult ReleasePtrOnShutdown(nsISupports** aSupportsPtr) {
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;
}
@ -1463,7 +1455,7 @@ private:
static nsIUGenCategory* sGenCat;
// 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 PRInt32 sScriptRootCount[NS_STID_ARRAY_UBOUND];

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -47,7 +47,6 @@
#include "nsIDOMDOMStringList.h"
#include "nsIDOMNameList.h"
#include "nsVoidArray.h"
#include "nsTArray.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)
nsIdentifierMapEntry::~nsIdentifierMapEntry()
@ -349,13 +348,9 @@ nsIdentifierMapEntry::CreateNameContentList()
}
nsIContent*
nsIdentifierMapEntry::GetIdContent(PRBool* aNotInDocument)
nsIdentifierMapEntry::GetIdContent()
{
nsIContent* c = static_cast<nsIContent*>(mIdContentList.SafeElementAt(0));
if (aNotInDocument) {
*aNotInDocument = c == ID_NOT_IN_DOCUMENT;
}
return c != ID_NOT_IN_DOCUMENT ? c : nsnull;
return static_cast<nsIContent*>(mIdContentList.SafeElementAt(0));
}
void
@ -424,28 +419,23 @@ nsIdentifierMapEntry::AddIdContent(nsIContent* aContent)
NS_PRECONDITION(aContent, "Must have content");
NS_PRECONDITION(mIdContentList.IndexOf(nsnull) < 0,
"Why is null in our list?");
NS_PRECONDITION(aContent != ID_NOT_IN_DOCUMENT,
"Bogus content pointer");
nsIContent* currentContent = static_cast<nsIContent*>(mIdContentList.SafeElementAt(0));
if (currentContent == ID_NOT_IN_DOCUMENT) {
NS_ASSERTION(mIdContentList.Count() == 1, "Bogus count");
mIdContentList.ReplaceElementAt(aContent, 0);
FireChangeCallbacks(nsnull, aContent);
return PR_TRUE;
}
#ifdef DEBUG
nsIContent* currentContent =
static_cast<nsIContent*>(mIdContentList.SafeElementAt(0));
#endif
// Common case
if (mIdContentList.Count() == 0) {
if (!mIdContentList.AppendElement(aContent))
return PR_FALSE;
NS_ASSERTION(currentContent == nsnull, "How did that happen?");
FireChangeCallbacks(nsnull, aContent);
return PR_TRUE;
}
// We seem to have multiple content nodes for the same id, or we're doing our
// top-down registration when the id table is going live. Search for the
// right place to insert the content.
// We seem to have multiple content nodes for the same id, or XUL is messing
// with us. Search for the right place to insert the content.
PRInt32 start = 0;
PRInt32 end = mIdContentList.Count();
do {
@ -457,6 +447,8 @@ nsIdentifierMapEntry::AddIdContent(nsIContent* aContent)
nsIContent* curContent = static_cast<nsIContent*>(mIdContentList[cur]);
if (curContent == aContent) {
// 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;
}
@ -470,7 +462,10 @@ nsIdentifierMapEntry::AddIdContent(nsIContent* aContent)
if (!mIdContentList.InsertElementAt(aContent, start))
return PR_FALSE;
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;
}
@ -493,15 +488,6 @@ nsIdentifierMapEntry::RemoveIdContent(nsIContent* aContent)
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
nsIdentifierMapEntry::AddNameContent(nsIContent* aContent)
{
@ -2307,11 +2293,9 @@ nsDocument::UpdateIdTableEntry(nsIContent *aContent)
if (!id)
return;
PRBool liveTable = IdTableIsLive();
nsIdentifierMapEntry *entry =
liveTable ? mIdentifierMap.PutEntry(id) : mIdentifierMap.GetEntry(id);
nsIdentifierMapEntry *entry = mIdentifierMap.PutEntry(id);
if (entry) {
if (entry) { /* True except on OOM */
entry->AddIdContent(aContent);
}
}
@ -2324,7 +2308,7 @@ nsDocument::RemoveFromIdTable(nsIContent *aContent)
return;
nsIdentifierMapEntry *entry = mIdentifierMap.GetEntry(id);
if (!entry)
if (!entry) /* Should be false unless we had OOM when adding the entry */
return;
if (entry->RemoveIdContent(aContent)) {
@ -2335,35 +2319,51 @@ nsDocument::RemoveFromIdTable(nsIContent *aContent)
void
nsDocument::UnregisterNamedItems(nsIContent *aContent)
{
if (aContent->IsNodeOfType(nsINode::eTEXT)) {
// Text nodes are not named items nor can they have children.
if (!aContent->IsNodeOfType(nsINode::eELEMENT)) {
// non-element nodes are not named items nor can they have children.
return;
}
RemoveFromNameTable(aContent);
RemoveFromIdTable(aContent);
PRUint32 i, count = aContent->GetChildCount();
for (i = 0; i < count; ++i) {
UnregisterNamedItems(aContent->GetChildAt(i));
#ifdef DEBUG
nsMutationGuard debugMutationGuard;
#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
nsDocument::RegisterNamedItems(nsIContent *aContent)
{
if (aContent->IsNodeOfType(nsINode::eTEXT)) {
// Text nodes are not named items nor can they have children.
if (!aContent->IsNodeOfType(nsINode::eELEMENT)) {
// non-element nodes are not named items nor can they have children.
return;
}
UpdateNameTableEntry(aContent);
UpdateIdTableEntry(aContent);
PRUint32 i, count = aContent->GetChildCount();
for (i = 0; i < count; ++i) {
RegisterNamedItems(aContent->GetChildAt(i));
#ifdef DEBUG
nsMutationGuard debugMutationGuard;
#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
@ -2373,10 +2373,18 @@ nsDocument::ContentAppended(nsIDocument* aDocument,
{
NS_ASSERTION(aDocument == this, "unexpected doc");
PRUint32 count = aContainer->GetChildCount();
for (PRUint32 i = aNewIndexInContainer; i < count; ++i) {
RegisterNamedItems(aContainer->GetChildAt(i));
#ifdef DEBUG
nsMutationGuard debugMutationGuard;
#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
@ -2821,11 +2829,10 @@ nsDocument::SetDocumentCharacterSet(const nsACString& aCharSetID)
}
#endif
PRInt32 n = mCharSetObservers.Count();
PRInt32 n = mCharSetObservers.Length();
for (PRInt32 i = 0; i < n; i++) {
nsIObserver* observer =
static_cast<nsIObserver *>(mCharSetObservers.ElementAt(i));
nsIObserver* observer = mCharSetObservers.ElementAt(i);
observer->Observe(static_cast<nsIDocument *>(this), "charset",
NS_ConvertASCIItoUTF16(aCharSetID).get());
@ -3755,19 +3762,6 @@ nsDocument::CheckGetElementByIdArg(const nsIAtom* aId)
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*
nsDocument::GetElementByIdInternal(nsIAtom* aID)
{
@ -3781,10 +3775,9 @@ nsDocument::GetElementByIdInternal(nsIAtom* aID)
if (entry->GetIdContent())
return entry;
// Now we have to flush. It could be that we have a cached "not in
// document" or know nothing about this ID yet but more content has been
// added to the document since. Note that we have to flush notifications,
// so that the entry will get updated properly.
// Now we have to flush. It could be that we know nothing about this ID yet
// but more content has been added to the document since. Note that we have
// to flush notifications, so that the entry will get updated properly.
// Make sure to stash away the current generation so we can check whether
// the table changes when we flush.
@ -3799,53 +3792,6 @@ nsDocument::GetElementByIdInternal(nsIAtom* 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;
}
@ -3864,10 +3810,8 @@ nsDocument::GetElementById(const nsAString& aElementId,
nsIdentifierMapEntry *entry = GetElementByIdInternal(idAtom);
NS_ENSURE_TRUE(entry, NS_ERROR_OUT_OF_MEMORY);
PRBool isNotInDocument;
nsIContent *e = entry->GetIdContent(&isNotInDocument);
NS_ASSERTION(e || isNotInDocument, "Incomplete map entry!");
if (isNotInDocument)
nsIContent *e = entry->GetIdContent();
if (!e)
return NS_OK;
return CallQueryInterface(e, aReturn);

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

@ -49,6 +49,7 @@
#include "nsWeakReference.h"
#include "nsWeakPtr.h"
#include "nsVoidArray.h"
#include "nsTArray.h"
#include "nsHashSets.h"
#include "nsIDOMXMLDocument.h"
#include "nsIDOM3Document.h"
@ -256,10 +257,11 @@ public:
/**
* Returns the element if we know the element associated with this
* 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);
/**
* This can fire ID change callbacks.
@ -272,7 +274,6 @@ public:
* @return true if this map entry should be removed
*/
PRBool RemoveIdContent(nsIContent* aContent);
void FlagIDNotInDocument();
PRBool HasContentChangeCallback() { return mChangeCallbacks != nsnull; }
void AddContentChangeCallback(nsIDocument::IDTargetObserver aCallback, void* aData);
@ -317,8 +318,7 @@ public:
private:
void FireChangeCallbacks(nsIContent* aOldContent, nsIContent* aNewContent);
// The single element ID_NOT_IN_DOCUMENT, or empty to indicate we
// don't know what element(s) have this key as an ID
// empty if there are no nodes with this ID
nsSmallVoidArray mIdContentList;
// NAME_NOT_VALID if this id cannot be used as a 'name'
nsBaseContentList *mNameContentList;
@ -1099,7 +1099,7 @@ protected:
nsCString mReferrer;
nsString mLastModified;
nsVoidArray mCharSetObservers;
nsTArray<nsIObserver*> mCharSetObservers;
PLDHashTable *mSubDocuments;
@ -1148,8 +1148,8 @@ protected:
* 1) Attribute changes affect the table immediately (removing and adding
* entries as needed).
* 2) Removals from the DOM affect the table immediately
* 3) Additions to the DOM always update existing entries, but only add new
* ones if IdTableIsLive() is true.
* 3) Additions to the DOM always update existing entries for names, and add
* new ones for IDs.
*/
nsTHashtable<nsIdentifierMapEntry> mIdentifierMap;
@ -1191,22 +1191,6 @@ protected:
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;
// The channel that got passed to StartDocumentLoad(), if any

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

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

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

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

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

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

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

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

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

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

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

@ -48,6 +48,7 @@
#include "nsXMLContentSerializer.h"
#include "nsIEntityConverter.h"
#include "nsString.h"
#include "nsTArray.h"
class nsIContent;
class nsIAtom;
@ -168,7 +169,8 @@ class nsHTMLContentSerializer : public nsXMLContentSerializer {
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

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

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

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

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

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

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

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

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

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

@ -199,14 +199,15 @@ IsScriptEventHandler(nsIScriptElement *aScriptElement)
}
nsresult
nsScriptLoader::CheckContentPolicy(nsScriptLoadRequest *aRequest,
nsScriptLoader::CheckContentPolicy(nsIDocument* aDocument,
nsISupports *aContext,
nsIURI *aURI,
const nsAString &aType)
{
PRInt16 shouldLoad = nsIContentPolicy::ACCEPT;
nsresult rv = NS_CheckContentLoadPolicy(nsIContentPolicy::TYPE_SCRIPT,
aRequest->mURI,
mDocument->NodePrincipal(),
aURI,
aDocument->NodePrincipal(),
aContext,
NS_LossyConvertUTF16toASCII(aType),
nsnull, //extra
@ -224,20 +225,34 @@ nsScriptLoader::CheckContentPolicy(nsScriptLoadRequest *aRequest,
}
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.
nsresult rv = nsContentUtils::GetSecurityManager()->
CheckLoadURIWithPrincipal(mDocument->NodePrincipal(), aRequest->mURI,
CheckLoadURIWithPrincipal(aDocument->NodePrincipal(), aURI,
nsIScriptSecurityManager::ALLOW_CHROME);
NS_ENSURE_SUCCESS(rv, rv);
// 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()
? static_cast<nsISupports *>(aRequest->mElement.get())
: static_cast<nsISupports *>(mDocument);
rv = CheckContentPolicy(aRequest, context, aType);
nsresult rv = ShouldLoadScript(mDocument, context, aRequest->mURI, aType);
if (NS_FAILED(rv)) {
return rv;
}
@ -485,7 +500,7 @@ nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement)
request->mDefer = mDeferEnabled && aElement->GetScriptDeferred();
mPreloads.RemoveElementAt(i);
rv = CheckContentPolicy(request, aElement, type);
rv = CheckContentPolicy(mDocument, aElement, request->mURI, type);
if (NS_FAILED(rv)) {
// Note, we're dropping our last ref to request here.
return rv;

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

@ -180,6 +180,15 @@ public:
*/
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
* aDocument.
@ -233,9 +242,10 @@ protected:
/**
* Helper function to check the content policy for a given request.
*/
nsresult CheckContentPolicy(nsScriptLoadRequest *aRequest,
nsISupports *aContext,
const nsAString &aType);
static nsresult CheckContentPolicy(nsIDocument* aDocument,
nsISupports *aContext,
nsIURI *aURI,
const nsAString &aType);
/**
* Start a load for aRequest's URI.

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

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

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

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

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

@ -47,7 +47,7 @@
#include "nsIDOMTreeWalker.h"
#include "nsTraversal.h"
#include "nsCOMPtr.h"
#include "nsVoidArray.h"
#include "nsTArray.h"
#include "nsCycleCollectionParticipant.h"
class nsINode;
@ -74,9 +74,8 @@ private:
/*
* Array with all child indexes up the tree. This should only be
* 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
@ -168,9 +167,10 @@ private:
*/
void SetChildIndex(PRInt32 aIndexPos, PRInt32 aChildIndex)
{
if (aIndexPos != -1)
mPossibleIndexes.ReplaceElementAt(NS_INT32_TO_PTR(aChildIndex),
aIndexPos);
if (aIndexPos >= 0 &&
mPossibleIndexes.EnsureLengthAtLeast(aIndexPos+1)) {
mPossibleIndexes.ElementAt(aIndexPos) = aChildIndex;
}
}
};

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

@ -64,11 +64,11 @@
#include "nsContentUtils.h"
#include "nsAttrName.h"
typedef struct {
struct NameSpaceDecl {
nsString mPrefix;
nsString mURI;
nsIDOMElement* mOwner;
} NameSpaceDecl;
};
nsresult NS_NewXMLContentSerializer(nsIContentSerializer** aSerializer)
{
@ -346,7 +346,7 @@ nsXMLContentSerializer::PushNameSpaceDecl(const nsAString& aPrefix,
// we pop the stack
decl->mOwner = aOwner;
mNameSpaceStack.AppendElement((void*)decl);
mNameSpaceStack.AppendElement(decl);
return NS_OK;
}
@ -355,9 +355,9 @@ nsXMLContentSerializer::PopNameSpaceDeclsFor(nsIDOMElement* aOwner)
{
PRInt32 index, count;
count = mNameSpaceStack.Count();
count = mNameSpaceStack.Length();
for (index = count - 1; index >= 0; index--) {
NameSpaceDecl* decl = (NameSpaceDecl*)mNameSpaceStack.ElementAt(index);
NameSpaceDecl* decl = mNameSpaceStack.ElementAt(index);
if (decl->mOwner != aOwner) {
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.
PRBool haveSeenOurPrefix = PR_FALSE;
PRInt32 count = mNameSpaceStack.Count();
PRInt32 count = mNameSpaceStack.Length();
PRInt32 index = count - 1;
while (index >= 0) {
NameSpaceDecl* decl = (NameSpaceDecl*)mNameSpaceStack.ElementAt(index);
NameSpaceDecl* decl = mNameSpaceStack.ElementAt(index);
// Check if we've found a prefix match
if (aPrefix.Equals(decl->mPrefix)) {
@ -464,8 +464,7 @@ nsXMLContentSerializer::ConfirmPrefix(nsAString& aPrefix,
PRBool prefixOK = PR_TRUE;
PRInt32 index2;
for (index2 = count-1; index2 > index && prefixOK; --index2) {
NameSpaceDecl* decl2 =
(NameSpaceDecl*)mNameSpaceStack.ElementAt(index2);
NameSpaceDecl* decl2 = mNameSpaceStack.ElementAt(index2);
prefixOK = (decl2->mPrefix != decl->mPrefix);
}

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

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

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

@ -82,12 +82,11 @@ nsXMLNameSpaceMap::nsXMLNameSpaceMap()
nsresult
nsXMLNameSpaceMap::AddPrefix(nsIAtom *aPrefix, PRInt32 aNameSpaceID)
{
PRInt32 count = mNameSpaces.Count();
PRUint32 count = mNameSpaces.Length();
nsNameSpaceEntry *foundEntry = nsnull;
for (PRInt32 i = 0; i < count; ++i) {
nsNameSpaceEntry *entry = static_cast<nsNameSpaceEntry*>
(mNameSpaces.FastElementAt(i));
for (PRUint32 i = 0; i < count; ++i) {
nsNameSpaceEntry *entry = mNameSpaces.ElementAt(i);
NS_ASSERTION(entry, "null entry in namespace map!");
@ -101,7 +100,7 @@ nsXMLNameSpaceMap::AddPrefix(nsIAtom *aPrefix, PRInt32 aNameSpaceID)
foundEntry = new nsNameSpaceEntry(aPrefix);
NS_ENSURE_TRUE(foundEntry, NS_ERROR_OUT_OF_MEMORY);
if (!mNameSpaces.AppendElement(foundEntry)) {
if (mNameSpaces.AppendElement(foundEntry) == nsnull) {
delete foundEntry;
return NS_ERROR_OUT_OF_MEMORY;
}
@ -126,11 +125,10 @@ nsXMLNameSpaceMap::AddPrefix(nsIAtom *aPrefix, nsString &aURI)
void
nsXMLNameSpaceMap::RemovePrefix(nsIAtom *aPrefix)
{
PRInt32 count = mNameSpaces.Count();
PRUint32 count = mNameSpaces.Length();
for (PRInt32 i = 0; i < count; ++i) {
nsNameSpaceEntry *entry = static_cast<nsNameSpaceEntry*>
(mNameSpaces.FastElementAt(i));
for (PRUint32 i = 0; i < count; ++i) {
nsNameSpaceEntry *entry = mNameSpaces.ElementAt(i);
NS_ASSERTION(entry, "null entry in namespace map!");
@ -144,11 +142,10 @@ nsXMLNameSpaceMap::RemovePrefix(nsIAtom *aPrefix)
PRInt32
nsXMLNameSpaceMap::FindNameSpaceID(nsIAtom *aPrefix) const
{
PRInt32 count = mNameSpaces.Count();
PRUint32 count = mNameSpaces.Length();
for (PRInt32 i = 0; i < count; ++i) {
nsNameSpaceEntry *entry = static_cast<nsNameSpaceEntry*>
(mNameSpaces.FastElementAt(i));
for (PRUint32 i = 0; i < count; ++i) {
nsNameSpaceEntry *entry = mNameSpaces.ElementAt(i);
NS_ASSERTION(entry, "null entry in namespace map!");
@ -166,11 +163,10 @@ nsXMLNameSpaceMap::FindNameSpaceID(nsIAtom *aPrefix) const
nsIAtom*
nsXMLNameSpaceMap::FindPrefix(PRInt32 aNameSpaceID) const
{
PRInt32 count = mNameSpaces.Count();
PRUint32 count = mNameSpaces.Length();
for (PRInt32 i = 0; i < count; ++i) {
nsNameSpaceEntry *entry = static_cast<nsNameSpaceEntry*>
(mNameSpaces.FastElementAt(i));
for (PRUint32 i = 0; i < count; ++i) {
nsNameSpaceEntry *entry = mNameSpaces.ElementAt(i);
NS_ASSERTION(entry, "null entry in namespace map!");
@ -182,14 +178,11 @@ nsXMLNameSpaceMap::FindPrefix(PRInt32 aNameSpaceID) const
return nsnull;
}
static PRBool DeleteEntry(void *aElement, void *aData)
{
delete static_cast<nsNameSpaceEntry*>(aElement);
return PR_TRUE;
}
void
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)
_CHROME_FILES = \
test_bug206691.xul \
test_bug421622.xul \
test_bug429785.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 ***** */
const gBasePath = "content/base/test/unit/";
const nsIDocumentEncoder = Components.interfaces.nsIDocumentEncoder;
const replacementChar = Components.interfaces.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER;
@ -45,7 +44,7 @@ function loadContentFile(aFile, aCharset) {
if(aCharset == undefined)
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']
.getService(Components.interfaces.nsIIOService);
var chann = ios.newChannelFromURI ( ios.newFileURI (file) );

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