Merge places to mozilla-central.

This commit is contained in:
Shawn Wilsher 2009-07-19 18:21:55 -07:00
Родитель 97baf600c6 61c254b113
Коммит 231a5ea0d6
157 изменённых файлов: 4191 добавлений и 5197 удалений

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

@ -5,7 +5,6 @@
\.pyc$
(^|/)TAGS$
(^|/)\.DS_Store$
\.class$
# User files that may appear at the root
^\.mozconfig
@ -28,3 +27,6 @@ _OPT\.OBJ/
# SpiderMonkey configury
^js/src/configure$
^js/src/autom4te.cache$
# Java HTML5 parser classes
^parser/html/java/.*\.class$

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

@ -617,7 +617,17 @@ nsDocAccessible::Init()
nsCOMPtr<nsIAccessible> parentAccessible; // Ensure outer doc mParent accessible
GetParent(getter_AddRefs(parentAccessible));
return nsHyperTextAccessibleWrap::Init();
nsresult rv = nsHyperTextAccessibleWrap::Init();
NS_ENSURE_SUCCESS(rv, rv);
// Fire reorder event to notify new accessible document has been created and
// attached to the tree.
nsCOMPtr<nsIAccessibleEvent> reorderEvent =
new nsAccReorderEvent(mParent, PR_FALSE, PR_TRUE, mDOMNode);
NS_ENSURE_TRUE(reorderEvent, NS_ERROR_OUT_OF_MEMORY);
FireDelayedAccessibleEvent(reorderEvent);
return NS_OK;
}
nsresult

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

@ -88,6 +88,7 @@ _TEST_FILES =\
test_elm_table.html \
test_elm_txtcntnr.html \
test_events_caretmove.html \
test_events_doc.html \
test_events_focus.xul \
test_events_mutation.html \
test_events_tree.xul \

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

@ -0,0 +1,78 @@
<html>
<head>
<title>Accessible events testing for document</title>
<link rel="stylesheet" type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<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>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/events.js"></script>
<script type="application/javascript">
////////////////////////////////////////////////////////////////////////////
// Invokers
function changeIframeSrc(aIdentifier, aURL)
{
this.DOMNode = getNode(aIdentifier);
this.invoke = function changeIframeSrc_invoke()
{
this.DOMNode.src = aURL;
}
this.getID = function changeIframeSrc_getID()
{
return "change iframe src on " + aURL;
}
}
////////////////////////////////////////////////////////////////////////////
// Do tests
var gQueue = null;
// var gA11yEventDumpID = "eventdump"; // debug stuff
function doTests()
{
gQueue = new eventQueue(EVENT_REORDER);
gQueue.push(new changeIframeSrc("iframe", "about:"));
gQueue.push(new changeIframeSrc("iframe", "about:buildconfig"));
gQueue.invoke(); // Will call SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTests);
</script>
</head>
<body>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=420845"
title="Fire event_reorder on any embedded frames/iframes whos document has just loaded">
Mozilla Bug 420845
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<div id="testContainer">
<iframe id="iframe"></iframe>
</div>
<div id="eventdump"></div>
</body>
</html>

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

@ -303,8 +303,6 @@ ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
ICON_FILES = \
$(DIST)/branding/mozicon128.png \
$(DIST)/branding/mozicon50.xpm \
$(DIST)/branding/mozicon16.xpm \
$(DIST)/branding/document.png \
$(NULL)
@ -339,8 +337,6 @@ ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
endif
ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
cp $(srcdir)/mozicon128.png $(DIST)/branding/mozicon128.png
cp $(srcdir)/mozicon16.xpm $(DIST)/branding/mozicon16.xpm
cp $(srcdir)/mozicon50.xpm $(DIST)/branding/mozicon50.xpm
cp $(srcdir)/document.png $(DIST)/branding/document.png
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)

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

@ -1,156 +0,0 @@
/* XPM */
static char * mozicon16_xpm[] = {
"16 16 137 2",
" c None",
". c #388BBF",
"+ c #59ADD6",
"@ c #68CEEF",
"# c #62CCEE",
"$ c #45AAD7",
"% c #3578AF",
"& c #4A93C3",
"* c #5EA9D2",
"= c #72D1EF",
"- c #6DCCEC",
"; c #4B9FCE",
"> c #3483BA",
", c #1E67A5",
"' c #1B6BA5",
") c #2F7AB0",
"! c #48B9E0",
"~ c #5CC2E5",
"{ c #6ED0EE",
"] c #6FC9E9",
"^ c #4994C5",
"/ c #3783B9",
"( c #1E5D9D",
"_ c #1463A1",
": c #028DC4",
"< c #128DC3",
"[ c #27ABD7",
"} c #3CB8E0",
"| c #4EC0E5",
"1 c #5BC3E6",
"2 c #50A2CE",
"3 c #3B7EB5",
"4 c #3C93C4",
"5 c #2164A1",
"6 c #145A9A",
"7 c #0E8FC4",
"8 c #007EBA",
"9 c #0694C8",
"0 c #1896C7",
"a c #2B99C9",
"b c #3CB7DE",
"c c #48B9DF",
"d c #3E95C5",
"e c #2E71AB",
"f c #399DCA",
"g c #34A9D4",
"h c #2387BE",
"i c #1388C0",
"j c #0059A1",
"k c #005C9E",
"l c #00498B",
"m c #095897",
"n c #1869A3",
"o c #289CCA",
"p c #34B1DA",
"q c #3BB3DB",
"r c #3BB3DA",
"s c #35AFD7",
"t c #2BA2CF",
"u c #1E6AA2",
"v c #106AA7",
"w c #0258A0",
"x c #00357F",
"y c #002D71",
"z c #003175",
"A c #013A7E",
"B c #084889",
"C c #1577AF",
"D c #1FA1CF",
"E c #26A3D1",
"F c #28A2CF",
"G c #269ACA",
"H c #2088BE",
"I c #174784",
"J c #0B1F5F",
"K c #012568",
"L c #00206A",
"M c #00185A",
"N c #001F62",
"O c #002569",
"P c #002C70",
"Q c #0567A7",
"R c #0D81BB",
"S c #1485BD",
"T c #1883BC",
"U c #177DB7",
"V c #144A88",
"W c #0C1D5C",
"X c #030B47",
"Y c #00023B",
"Z c #00207A",
"` c #002072",
" . c #00236B",
".. c #001556",
"+. c #001B5E",
"@. c #003D81",
"#. c #01599E",
"$. c #04559E",
"%. c #0761A6",
"&. c #085499",
"*. c #061958",
"=. c #020843",
"-. c #000137",
";. c #001C79",
">. c #00155D",
",. c #000945",
"'. c #000B49",
"). c #000E4C",
"!. c #002367",
"~. c #002A6F",
"{. c #003E8B",
"]. c #003787",
"^. c #00175C",
"/. c #000035",
"(. c #000030",
"_. c #000E67",
":. c #00043B",
"<. c #000339",
"[. c #00043C",
"}. c #00053E",
"|. c #00063F",
"1. c #000E4F",
"2. c #00247E",
"3. c #00166A",
"4. c #00002E",
"5. c #00014F",
"6. c #000029",
"7. c #00012F",
"8. c #000953",
"9. c #000E6E",
"0. c #000A6C",
"a. c #000563",
"b. c #00002F",
"c. c #00001D",
"d. c #000025",
"e. c #000040",
"f. c #000033",
" ",
" . + @ # $ ",
" % & * = - ; > , ",
" ' ) ! ~ { ] ^ / ( _ ",
" : < [ } | 1 2 3 4 5 6 7 ",
" 8 9 0 a b c d e f g h i ",
" j k l m n o p q r s t u v w ",
" x y z A B C D E F G H I J K ",
" L M N O P Q R S T U V W X Y ",
" Z ` ...+.@.#.$.%.&.*.=.-. ",
" ;.>.,.'.).!.~.{.].^./.(. ",
" _.:.<.[.}.|.1.2.3.4. ",
" 5.6.(.4.7.8.9.0.a. ",
" b.b.c.d.e.f. ",
" ",
" "};

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

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

@ -385,6 +385,11 @@ pref("general.warnOnAboutConfig", false);
pref("javascript.options.showInConsole", false);
#endif
#ifdef WINCE
// Set the threshold higher to avoid some slow script warnings
pref("dom.max_script_run_time", 20);
#endif
// Make the status bar reliably present and unaffected by pages
pref("dom.disable_window_open_feature.status", true);
// This is the pref to control the location bar, change this to true to
@ -861,6 +866,7 @@ pref("browser.urlbar.delay", 1000);
// disable safe browsing, due to perf hit
pref("browser.safebrowsing.enabled", false);
pref("browser.safebrowsing.malware.enabled", false);
// don't check for default browser
pref("browser.shell.checkDefaultBrowser", false);

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

@ -65,6 +65,13 @@ toolbarpaletteitem[place="palette"] > toolbaritem > hbox[type="places"] {
font-weight: bold;
}
%ifdef MOZ_WIDGET_GTK2
/* Bookmarks override the "images-in-menus" metric in xul.css */
.bookmark-item > .menu-iconic-left {
visibility: inherit;
}
%endif
#editBMPanel_tagsSelector {
/* override default listbox width from xul.css */
width: auto;

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

@ -2646,16 +2646,22 @@ var browserDragAndDrop = {
case "text/x-moz-url":
var split = dt.getData(type).split("\n");
return [split[0], split[1]];
case "application/x-moz-file":
var file = dt.mozGetDataAt(type, 0);
var name = file instanceof Components.interfaces.nsIFile ? file.leafName : "";
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var fileHandler = ioService.getProtocolHandler("file")
.QueryInterface(Components.interfaces.nsIFileProtocolHandler);
return [fileHandler.getURLSpecFromFile(file), name];
}
}
// For shortcuts, we want to check for the file type last, so that the
// url pointed to in one of the url types is found first before the file
// type, which points to the actual file.
var file = dt.mozGetDataAt("application/x-moz-file", 0);
if (file) {
var name = file instanceof Ci.nsIFile ? file.leafName : "";
var ioService = Cc["@mozilla.org/network/io-service;1"]
.getService(Ci.nsIIOService);
var fileHandler = ioService.getProtocolHandler("file")
.QueryInterface(Ci.nsIFileProtocolHandler);
return [fileHandler.getURLSpecFromFile(file), name];
}
return [ , ];
},

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

@ -24,8 +24,6 @@ BROWSER_APP_FILES = \
default32.png \
default48.png \
mozicon128.png \
mozicon16.xpm \
mozicon50.xpm \
firefox.ico \
document.ico \
$(NULL)

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

@ -1,156 +0,0 @@
/* XPM */
static char * mozicon16_xpm[] = {
"16 16 137 2",
" c None",
". c #388BBF",
"+ c #59ADD6",
"@ c #68CEEF",
"# c #62CCEE",
"$ c #45AAD7",
"% c #3578AF",
"& c #4A93C3",
"* c #5EA9D2",
"= c #72D1EF",
"- c #6DCCEC",
"; c #4B9FCE",
"> c #3483BA",
", c #1E67A5",
"' c #1B6BA5",
") c #2F7AB0",
"! c #48B9E0",
"~ c #5CC2E5",
"{ c #6ED0EE",
"] c #6FC9E9",
"^ c #4994C5",
"/ c #3783B9",
"( c #1E5D9D",
"_ c #1463A1",
": c #028DC4",
"< c #128DC3",
"[ c #27ABD7",
"} c #3CB8E0",
"| c #4EC0E5",
"1 c #5BC3E6",
"2 c #50A2CE",
"3 c #3B7EB5",
"4 c #3C93C4",
"5 c #2164A1",
"6 c #145A9A",
"7 c #0E8FC4",
"8 c #007EBA",
"9 c #0694C8",
"0 c #1896C7",
"a c #2B99C9",
"b c #3CB7DE",
"c c #48B9DF",
"d c #3E95C5",
"e c #2E71AB",
"f c #399DCA",
"g c #34A9D4",
"h c #2387BE",
"i c #1388C0",
"j c #0059A1",
"k c #005C9E",
"l c #00498B",
"m c #095897",
"n c #1869A3",
"o c #289CCA",
"p c #34B1DA",
"q c #3BB3DB",
"r c #3BB3DA",
"s c #35AFD7",
"t c #2BA2CF",
"u c #1E6AA2",
"v c #106AA7",
"w c #0258A0",
"x c #00357F",
"y c #002D71",
"z c #003175",
"A c #013A7E",
"B c #084889",
"C c #1577AF",
"D c #1FA1CF",
"E c #26A3D1",
"F c #28A2CF",
"G c #269ACA",
"H c #2088BE",
"I c #174784",
"J c #0B1F5F",
"K c #012568",
"L c #00206A",
"M c #00185A",
"N c #001F62",
"O c #002569",
"P c #002C70",
"Q c #0567A7",
"R c #0D81BB",
"S c #1485BD",
"T c #1883BC",
"U c #177DB7",
"V c #144A88",
"W c #0C1D5C",
"X c #030B47",
"Y c #00023B",
"Z c #00207A",
"` c #002072",
" . c #00236B",
".. c #001556",
"+. c #001B5E",
"@. c #003D81",
"#. c #01599E",
"$. c #04559E",
"%. c #0761A6",
"&. c #085499",
"*. c #061958",
"=. c #020843",
"-. c #000137",
";. c #001C79",
">. c #00155D",
",. c #000945",
"'. c #000B49",
"). c #000E4C",
"!. c #002367",
"~. c #002A6F",
"{. c #003E8B",
"]. c #003787",
"^. c #00175C",
"/. c #000035",
"(. c #000030",
"_. c #000E67",
":. c #00043B",
"<. c #000339",
"[. c #00043C",
"}. c #00053E",
"|. c #00063F",
"1. c #000E4F",
"2. c #00247E",
"3. c #00166A",
"4. c #00002E",
"5. c #00014F",
"6. c #000029",
"7. c #00012F",
"8. c #000953",
"9. c #000E6E",
"0. c #000A6C",
"a. c #000563",
"b. c #00002F",
"c. c #00001D",
"d. c #000025",
"e. c #000040",
"f. c #000033",
" ",
" . + @ # $ ",
" % & * = - ; > , ",
" ' ) ! ~ { ] ^ / ( _ ",
" : < [ } | 1 2 3 4 5 6 7 ",
" 8 9 0 a b c d e f g h i ",
" j k l m n o p q r s t u v w ",
" x y z A B C D E F G H I J K ",
" L M N O P Q R S T U V W X Y ",
" Z ` ...+.@.#.$.%.&.*.=.-. ",
" ;.>.,.'.).!.~.{.].^./.(. ",
" _.:.<.[.}.|.1.2.3.4. ",
" 5.6.(.4.7.8.9.0.a. ",
" b.b.c.d.e.f. ",
" ",
" "};

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

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

@ -760,7 +760,7 @@
orientation = Ci.nsITreeView.DROP_ON;
}
return this.view.canDrop(row.value, orientation);
return this.view.canDrop(row.value, orientation, aEvent.dataTransfer);
]]></body>
</method>
@ -769,8 +769,8 @@
<parameter name="aEvent"/>
<parameter name="aFlavour"/>
<parameter name="aDragSession"/>
<body><![CDATA[
if (!this.canDrop(aEvent, aDragSession))
<body><![CDATA[
if (!this.canDrop(aEvent, aDragSession, aEvent.dataTransfer))
aEvent.dataTransfer.effectAllowed = "none";
]]></body>
</method>

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

@ -1510,7 +1510,7 @@ SessionStoreService.prototype = {
// get the domain for each URL
function extractHosts(aEntry) {
if (/^https?:\/\/(?:[^@\/\s]+@)?([\w.-]+)/.test(aEntry.url)) {
if (!hosts[RegExp.$1] && this._checkPrivacyLevel(this._getURIFromString(aEntry.url).schemeIs("https"))) {
if (!hosts[RegExp.$1] && _this._checkPrivacyLevel(_this._getURIFromString(aEntry.url).schemeIs("https"))) {
hosts[RegExp.$1] = true;
}
}
@ -1522,7 +1522,8 @@ SessionStoreService.prototype = {
}
}
this._windows[aWindow.__SSi].tabs.forEach(function(aTabData) { aTabData.entries.forEach(extractHosts, this); }, this);
var _this = this;
this._windows[aWindow.__SSi].tabs.forEach(function(aTabData) { aTabData.entries.forEach(extractHosts); });
},
/**
@ -1550,6 +1551,7 @@ SessionStoreService.prototype = {
aWindows[i].cookies = [];
var jscookies = {};
var _this = this;
// MAX_EXPIRY should be 2^63-1, but JavaScript can't handle that precision
var MAX_EXPIRY = Math.pow(2, 62);
aWindows.forEach(function(aWindow) {
@ -1557,7 +1559,7 @@ SessionStoreService.prototype = {
var list = cm.getCookiesFromHost(host);
while (list.hasMoreElements()) {
var cookie = list.getNext().QueryInterface(Ci.nsICookie2);
if (cookie.isSession && this._checkPrivacyLevel(cookie.isSecure)) {
if (cookie.isSession && _this._checkPrivacyLevel(cookie.isSecure)) {
// use the cookie's host, path, and name as keys into a hash,
// to make sure we serialize each cookie only once
var isInHash = false;
@ -1582,7 +1584,7 @@ SessionStoreService.prototype = {
}
}
}
}, this);
});
// don't include empty cookie sections
for (i = 0; i < aWindows.length; i++)

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

@ -110,8 +110,6 @@ classic.jar:
skin/classic/browser/preferences/Options.png (preferences/Options.png)
skin/classic/browser/preferences/saveFile.png (preferences/saveFile.png)
skin/classic/browser/preferences/preferences.css (preferences/preferences.css)
skin/classic/browser/preferences/panebutton-active.png (preferences/panebutton-active.png)
skin/classic/browser/preferences/panebutton-inactive.png (preferences/panebutton-inactive.png)
skin/classic/browser/preferences/applications.css (preferences/applications.css)
skin/classic/browser/tabbrowser/alltabs-box-bkgnd-icon.png (tabbrowser/alltabs-box-bkgnd-icon.png)
skin/classic/browser/tabbrowser/alltabs-box-overflow-bkgnd-animate.png (tabbrowser/alltabs-box-overflow-bkgnd-animate.png)

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

@ -39,14 +39,6 @@
# ***** END LICENSE BLOCK *****
*/
.prefWindow-dlgbuttons {
margin: 0 12px 8px;
}
#BrowserPreferences .prefWindow-dlgbuttons {
padding-top: 0 !important;
}
.windowDialog {
padding: 12px;
font: -moz-dialog;
@ -54,35 +46,6 @@
.paneSelector {
list-style-image: url("chrome://browser/skin/preferences/Options.png");
padding: 1px 4px;
-moz-appearance: -moz-mac-unified-toolbar;
margin: 0;
}
radio[pane] {
border: solid transparent;
border-width: 0 2px;
padding: 5px 4px 3px;
margin: 0;
-moz-appearance: none;
text-shadow: rgba(255, 255, 255, 0.4) 0 1px;
}
radio[pane]:active:hover {
text-shadow: none;
}
radio[pane][selected="true"] {
-moz-border-image: url("chrome://browser/skin/preferences/panebutton-active.png") 0 2 repeat stretch;
}
#BrowserPreferences:not([active="true"]) radio[pane][selected="true"] {
-moz-border-image: url("chrome://browser/skin/preferences/panebutton-inactive.png") 0 2 repeat stretch;
}
.paneButtonLabel {
margin: 0;
padding: 0;
}
/* ----- GENERAL BUTTON ----- */
@ -217,13 +180,17 @@ caption {
-moz-box-align: center;
}
#popupPolicyRow, #enableSoftwareInstallRow, #enableImagesRow {
#popupPolicyRow,
#enableSoftwareInstallRow,
#enableImagesRow {
margin-bottom: 4px !important;
padding-bottom: 4px !important;
border-bottom: 1px solid #ccc;
}
#browserUseCurrent, #browserUseBookmark, #browserUseBlank {
#browserUseCurrent,
#browserUseBookmark,
#browserUseBlank {
margin-top: 10px;
}

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

@ -24,7 +24,7 @@ endif
_PROFILE_DIR = $(TARGET_DEPTH)/_profile/pgo
_SYMBOLS_PATH = $(TARGET_DIST)/crashreporter-symbols
ABSOLUTE_TOPSRCDIR = $(call core_abspath,$(topsrcdir))
ABSOLUTE_TOPSRCDIR = $(call core_abspath,$(MOZILLA_DIR))
_CERTS_SRC_DIR = $(ABSOLUTE_TOPSRCDIR)/build/pgo/certs
AUTOMATION_PPARGS = \
@ -65,10 +65,10 @@ AUTOMATION_PPARGS += -DIS_DEBUG_BUILD=0
endif
$(CURDIR)/automationutils.py:
$(INSTALL) $(topsrcdir)/build/automationutils.py .
$(INSTALL) $(MOZILLA_DIR)/build/automationutils.py .
automation.py: $(topsrcdir)/build/automation.py.in $(topsrcdir)/build/automation-build.mk $(CURDIR)/automationutils.py
$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
automation.py: $(MOZILLA_DIR)/build/automation.py.in $(MOZILLA_DIR)/build/automation-build.mk $(CURDIR)/automationutils.py
$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py \
$(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $< > $@
GARBAGE += automation.py $(CURDIR)/automationutils.py

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

@ -30,6 +30,12 @@ void addLinkArgs(int k, int s, int *i, int *j, char** args, char** argv) {
args[(*i)++] = "/MAP";
args[(*i)++] = "/MAPINFO:EXPORTS";
if (getenv("LOCK_DLLS") != NULL) {
// lock our dlls in memory
args[(*i)++] = "/SECTION:.text,\!P";
args[(*i)++] = "/SECTION:.rdata,\!P";
}
#ifdef HAVE_SHUNT // simple test to see if we're in configure or not
if(getenv("NO_SHUNT") == NULL) {
args[(*i)++] = "/LIBPATH:\"" SHUNT_LIB "\"";

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

@ -48,12 +48,13 @@ include $(DEPTH)/config/autoconf.mk
# headers, so that we can use it to set up the wrapped system headers.
VISIBILITY_FLAGS =
ifneq (,$(CROSS_COMPILE)$(filter-out WINNT OS2,$(OS_ARCH)))
ifneq ($(OS_ARCH), WINCE)
HOST_PROGRAM = nsinstall$(HOST_BIN_SUFFIX)
ifeq (WINNT,$(HOST_OS_ARCH))
HOST_CSRCS = nsinstall_win.c
else
HOST_CSRCS = nsinstall.c pathsub.c
endif
endif
PLSRCS = nfspwd.pl
@ -90,6 +91,8 @@ NO_INSTALL=1
include $(topsrcdir)/config/rules.mk
HOST_CFLAGS += -DUNICODE -D_UNICODE
ifeq ($(OS_CONFIG),SunOS4.1)
NSPR_CFLAGS += -I$(srcdir)/../nsprpub/pr/include/md
endif

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

@ -785,15 +785,11 @@ endif
ifdef NSINSTALL_BIN
NSINSTALL = $(CYGWIN_WRAPPER) $(NSINSTALL_BIN)
else
ifeq (WINNT,$(CROSS_COMPILE)$(OS_ARCH))
NSINSTALL = $(CYGWIN_WRAPPER) $(MOZ_TOOLS_DIR)/bin/nsinstall
else
ifeq (OS2,$(CROSS_COMPILE)$(OS_ARCH))
NSINSTALL = $(MOZ_TOOLS_DIR)/nsinstall
else
NSINSTALL = $(CONFIG_TOOLS)/nsinstall
endif # OS2
endif # WINNT
endif # NSINSTALL_BIN

709
config/nsinstall_win.c Normal file
Просмотреть файл

@ -0,0 +1,709 @@
/*
* The nsinstall command for Win32
*
* Our gmake makefiles use the nsinstall command to create the
* object directories or installing headers and libs. This code was originally
* taken from shmsdos.c
*/
#include <direct.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <windows.h>
#pragma hdrstop
/*
* sh_FileFcn --
*
* A function that operates on a file. The pathname is either
* absolute or relative to the current directory, and contains
* no wildcard characters such as * and ?. Additional arguments
* can be passed to the function via the arg pointer.
*/
typedef BOOL (*sh_FileFcn)(
wchar_t *pathName,
WIN32_FIND_DATA *fileData,
void *arg);
static int shellCp (wchar_t **pArgv);
static int shellNsinstall (wchar_t **pArgv);
static int shellMkdir (wchar_t **pArgv);
static BOOL sh_EnumerateFiles(const wchar_t *pattern, const wchar_t *where,
sh_FileFcn fileFcn, void *arg, int *nFiles);
static const char *sh_GetLastErrorMessage(void);
static BOOL sh_DoCopy(wchar_t *srcFileName, DWORD srcFileAttributes,
wchar_t *dstFileName, DWORD dstFileAttributes,
int force, int recursive);
#define LONGPATH_PREFIX L"\\\\?\\"
#define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0]))
#define STR_LEN(a) (ARRAY_LEN(a) - 1)
/* changes all forward slashes in token to back slashes */
void changeForwardSlashesTpBackSlashes ( wchar_t *arg )
{
if ( arg == NULL )
return;
while ( *arg ) {
if ( *arg == '/' )
*arg = '\\';
arg++;
}
}
int wmain(int argc, wchar_t *argv[ ])
{
return shellNsinstall ( argv + 1 );
}
static int
shellNsinstall (wchar_t **pArgv)
{
int retVal = 0; /* exit status */
int dirOnly = 0; /* 1 if and only if -D is specified */
wchar_t **pSrc;
wchar_t **pDst;
/*
* Process the command-line options. We ignore the
* options except for -D. Some options, such as -m,
* are followed by an argument. We need to skip the
* argument too.
*/
while ( *pArgv && **pArgv == '-' ) {
wchar_t c = (*pArgv)[1]; /* The char after '-' */
if ( c == 'D' ) {
dirOnly = 1;
} else if ( c == 'm' ) {
pArgv++; /* skip the next argument */
}
pArgv++;
}
if ( !dirOnly ) {
/* There are files to install. Get source files */
if ( *pArgv ) {
pSrc = pArgv++;
} else {
fprintf( stderr, "nsinstall: not enough arguments\n");
return 3;
}
}
/* Get to last token to find destination directory */
if ( *pArgv ) {
pDst = pArgv++;
if ( dirOnly && *pArgv ) {
fprintf( stderr, "nsinstall: too many arguments with -D\n");
return 3;
}
} else {
fprintf( stderr, "nsinstall: not enough arguments\n");
return 3;
}
while ( *pArgv )
pDst = pArgv++;
retVal = shellMkdir ( pDst );
if ( retVal )
return retVal;
if ( !dirOnly )
retVal = shellCp ( pSrc );
return retVal;
}
static int
shellMkdir (wchar_t **pArgv)
{
int retVal = 0; /* assume valid return */
wchar_t *arg;
wchar_t *pArg;
wchar_t path[_MAX_PATH];
wchar_t tmpPath[_MAX_PATH];
wchar_t *pTmpPath = tmpPath;
/* All the options are simply ignored in this implementation */
while ( *pArgv && **pArgv == '-' ) {
if ( (*pArgv)[1] == 'm' ) {
pArgv++; /* skip the next argument (mode) */
}
pArgv++;
}
while ( *pArgv ) {
arg = *pArgv;
changeForwardSlashesTpBackSlashes ( arg );
pArg = arg;
pTmpPath = tmpPath;
while ( 1 ) {
/* create part of path */
while ( *pArg ) {
*pTmpPath++ = *pArg++;
if ( *pArg == '\\' )
break;
}
*pTmpPath = '\0';
/* check if directory alreay exists */
_wgetcwd ( path, _MAX_PATH );
if ( _wchdir ( tmpPath ) != -1 ) {
_wchdir ( path );
} else {
if ( _wmkdir ( tmpPath ) == -1 ) {
// while ( waitForDebug );
printf ( "%ls: ", tmpPath );
perror ( "Could not create the directory" );
retVal = 3;
break;
}
}
if ( *pArg == '\0' ) /* complete path? */
break;
/* loop for next directory */
}
pArgv++;
}
return retVal;
}
static const char *
sh_GetLastErrorMessage()
{
static char buf[128];
FormatMessageA(
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* default language */
buf,
sizeof(buf),
NULL
);
return buf;
}
/*
* struct sh_FileData --
*
* A pointer to the sh_FileData structure is passed into sh_RecordFileData,
* which will fill in the fields.
*/
struct sh_FileData {
wchar_t pathName[_MAX_PATH];
DWORD dwFileAttributes;
};
/*
* sh_RecordFileData --
*
* Record the pathname and attributes of the file in
* the sh_FileData structure pointed to by arg.
*
* Always return TRUE (successful completion).
*
* This function is intended to be passed into sh_EnumerateFiles
* to see if a certain pattern expands to exactly one file/directory,
* and if so, record its pathname and attributes.
*/
static BOOL
sh_RecordFileData(wchar_t *pathName, WIN32_FIND_DATA *findData, void *arg)
{
struct sh_FileData *fData = (struct sh_FileData *) arg;
wcscpy(fData->pathName, pathName);
fData->dwFileAttributes = findData->dwFileAttributes;
return TRUE;
}
static BOOL
sh_DoCopy(wchar_t *srcFileName,
DWORD srcFileAttributes,
wchar_t *dstFileName,
DWORD dstFileAttributes,
int force,
int recursive
)
{
if (dstFileAttributes != 0xFFFFFFFF) {
if ((dstFileAttributes & FILE_ATTRIBUTE_READONLY) && force) {
dstFileAttributes &= ~FILE_ATTRIBUTE_READONLY;
SetFileAttributes(dstFileName, dstFileAttributes);
}
}
if (srcFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
fprintf(stderr, "nsinstall: %ls is a directory\n",
srcFileName);
return FALSE;
} else {
DWORD r;
wchar_t longSrc[1004] = LONGPATH_PREFIX;
wchar_t longDst[1004] = LONGPATH_PREFIX;
r = GetFullPathName(srcFileName, 1000, longSrc + STR_LEN(LONGPATH_PREFIX), NULL);
if (!r) {
fprintf(stderr, "nsinstall: couldn't get full path of %ls: %s\n",
srcFileName, sh_GetLastErrorMessage());
return FALSE;
}
r = GetFullPathName(dstFileName, 1000, longDst + ARRAY_LEN(LONGPATH_PREFIX) - 1, NULL);
if (!r) {
fprintf(stderr, "nsinstall: couldn't get full path of %ls: %s\n",
dstFileName, sh_GetLastErrorMessage());
return FALSE;
}
if (!CopyFile(longSrc, longDst, FALSE)) {
fprintf(stderr, "nsinstall: cannot copy %ls to %ls: %s\n",
srcFileName, dstFileName, sh_GetLastErrorMessage());
return FALSE;
}
}
return TRUE;
}
/*
* struct sh_CpCmdArg --
*
* A pointer to the sh_CpCmdArg structure is passed into sh_CpFileCmd.
* The sh_CpCmdArg contains information about the cp command, and
* provide a buffer for constructing the destination file name.
*/
struct sh_CpCmdArg {
int force; /* -f option, ok to overwrite an existing
* read-only destination file */
int recursive; /* -r or -R option, recursively copy
* directories. Note: this field is not used
* by nsinstall and should always be 0. */
wchar_t *dstFileName; /* a buffer for constructing the destination
* file name */
wchar_t *dstFileNameMarker; /* points to where in the dstFileName buffer
* we should write the file component of the
* destination file */
};
/*
* sh_CpFileCmd --
*
* Copy a file to the destination directory
*
* This function is intended to be passed into sh_EnumerateFiles to
* copy all the files specified by the pattern to the destination
* directory.
*
* Return TRUE if the file is successfully copied, and FALSE otherwise.
*/
static BOOL
sh_CpFileCmd(wchar_t *pathName, WIN32_FIND_DATA *findData, void *cpArg)
{
BOOL retVal = TRUE;
struct sh_CpCmdArg *arg = (struct sh_CpCmdArg *) cpArg;
wcscpy(arg->dstFileNameMarker, findData->cFileName);
return sh_DoCopy(pathName, findData->dwFileAttributes,
arg->dstFileName, GetFileAttributes(arg->dstFileName),
arg->force, arg->recursive);
}
static int
shellCp (wchar_t **pArgv)
{
int retVal = 0;
wchar_t **pSrc;
wchar_t **pDst;
struct sh_CpCmdArg arg;
struct sh_FileData dstData;
int dstIsDir = 0;
int n;
arg.force = 0;
arg.recursive = 0;
arg.dstFileName = dstData.pathName;
arg.dstFileNameMarker = 0;
while (*pArgv && **pArgv == '-') {
wchar_t *p = *pArgv;
while (*(++p)) {
if (*p == 'f') {
arg.force = 1;
}
}
pArgv++;
}
/* the first source file */
if (*pArgv) {
pSrc = pArgv++;
} else {
fprintf(stderr, "nsinstall: not enough arguments\n");
return 3;
}
/* get to the last token to find destination */
if (*pArgv) {
pDst = pArgv++;
} else {
fprintf(stderr, "nsinstall: not enough arguments\n");
return 3;
}
while (*pArgv) {
pDst = pArgv++;
}
/*
* The destination pattern must unambiguously expand to exactly
* one file or directory.
*/
changeForwardSlashesTpBackSlashes(*pDst);
sh_EnumerateFiles(*pDst, *pDst, sh_RecordFileData, &dstData, &n);
assert(n >= 0);
if (n == 1) {
/*
* Is the destination a file or directory?
*/
if (dstData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
dstIsDir = 1;
}
} else if (n > 1) {
fprintf(stderr, "nsinstall: %ls: ambiguous destination file "
"or directory\n", *pDst);
return 3;
} else {
/*
* n == 0, meaning that destination file or directory does
* not exist. In this case the destination file directory
* name must be fully specified.
*/
wchar_t *p;
for (p = *pDst; *p; p++) {
if (*p == '*' || *p == '?') {
fprintf(stderr, "nsinstall: %ls: No such file or directory\n",
*pDst);
return 3;
}
}
/*
* Do not include the trailing \, if any, unless it is a root
* directory (\ or X:\).
*/
if (p > *pDst && p[-1] == '\\' && p != *pDst + 1 && p[-2] != ':') {
p[-1] = '\0';
}
wcscpy(dstData.pathName, *pDst);
dstData.dwFileAttributes = 0xFFFFFFFF;
}
/*
* If there are two or more source files, the destination has
* to be a directory.
*/
if (pDst - pSrc > 1 && !dstIsDir) {
fprintf(stderr, "nsinstall: cannot copy more than"
" one file to the same destination file\n");
return 3;
}
if (dstIsDir) {
arg.dstFileNameMarker = arg.dstFileName + wcslen(arg.dstFileName);
/*
* Now arg.dstFileNameMarker is pointing to the null byte at the
* end of string. We want to make sure that there is a \ at the
* end of string, and arg.dstFileNameMarker should point right
* after that \.
*/
if (arg.dstFileNameMarker[-1] != '\\') {
*(arg.dstFileNameMarker++) = '\\';
}
}
if (!dstIsDir) {
struct sh_FileData srcData;
assert(pDst - pSrc == 1);
changeForwardSlashesTpBackSlashes(*pSrc);
sh_EnumerateFiles(*pSrc, *pSrc, sh_RecordFileData, &srcData, &n);
if (n == 0) {
fprintf(stderr, "nsinstall: %ls: No such file or directory\n",
*pSrc);
retVal = 3;
} else if (n > 1) {
fprintf(stderr, "nsinstall: cannot copy more than one file or "
"directory to the same destination\n");
retVal = 3;
} else {
assert(n == 1);
if (sh_DoCopy(srcData.pathName, srcData.dwFileAttributes,
dstData.pathName, dstData.dwFileAttributes,
arg.force, arg.recursive) == FALSE) {
retVal = 3;
}
}
return retVal;
}
for ( ; *pSrc != *pDst; pSrc++) {
BOOL rv;
changeForwardSlashesTpBackSlashes(*pSrc);
rv = sh_EnumerateFiles(*pSrc, *pSrc, sh_CpFileCmd, &arg, &n);
if (rv == FALSE) {
retVal = 3;
} else {
if (n == 0) {
fprintf(stderr, "nsinstall: %ls: No such file or directory\n",
*pSrc);
retVal = 3;
}
}
}
return retVal;
}
/*
* sh_EnumerateFiles --
*
* Enumerate all the files in the specified pattern, which is a pathname
* containing possibly wildcard characters such as * and ?. fileFcn
* is called on each file, passing the expanded file name, a pointer
* to the file's WIN32_FILE_DATA, and the arg pointer.
*
* It is assumed that there are no wildcard characters before the
* character pointed to by 'where'.
*
* On return, *nFiles stores the number of files enumerated. *nFiles is
* set to this number whether sh_EnumerateFiles or 'fileFcn' succeeds
* or not.
*
* Return TRUE if the files are successfully enumerated and all
* 'fileFcn' invocations succeeded. Return FALSE if something went
* wrong.
*/
static BOOL sh_EnumerateFiles(
const wchar_t *pattern,
const wchar_t *where,
sh_FileFcn fileFcn,
void *arg,
int *nFiles
)
{
WIN32_FIND_DATA fileData;
HANDLE hSearch;
const wchar_t *src;
wchar_t *dst;
wchar_t fileName[_MAX_PATH];
wchar_t *fileNameMarker = fileName;
wchar_t *oldFileNameMarker;
BOOL hasWildcard = FALSE;
BOOL retVal = TRUE;
BOOL patternEndsInDotStar = FALSE;
BOOL patternEndsInDot = FALSE; /* a special case of
* patternEndsInDotStar */
int numDotsInPattern;
int len;
/*
* Windows expands patterns ending in ".", ".*", ".**", etc.
* differently from the glob expansion on Unix. For example,
* both "foo." and "foo.*" match "foo", and "*.*" matches
* everything, including filenames with no dots. So we need
* to throw away extra files returned by the FindNextFile()
* function. We require that a matched filename have at least
* the number of dots in the pattern.
*/
len = wcslen(pattern);
if (len >= 2) {
/* Start from the end of pattern and go backward */
const wchar_t *p = &pattern[len - 1];
/* We can have zero or more *'s */
while (p >= pattern && *p == '*') {
p--;
}
if (p >= pattern && *p == '.') {
patternEndsInDotStar = TRUE;
if (p == &pattern[len - 1]) {
patternEndsInDot = TRUE;
}
p--;
numDotsInPattern = 1;
while (p >= pattern && *p != '\\') {
if (*p == '.') {
numDotsInPattern++;
}
p--;
}
}
}
*nFiles = 0;
/*
* Copy pattern to fileName, but only up to and not including
* the first \ after the first wildcard letter.
*
* Make fileNameMarker point to one of the following:
* - the start of fileName, if fileName does not contain any \.
* - right after the \ before the first wildcard letter, if there is
* a wildcard character.
* - right after the last \, if there is no wildcard character.
*/
dst = fileName;
src = pattern;
while (src < where) {
if (*src == '\\') {
oldFileNameMarker = fileNameMarker;
fileNameMarker = dst + 1;
}
*(dst++) = *(src++);
}
while (*src && *src != '*' && *src != '?') {
if (*src == '\\') {
oldFileNameMarker = fileNameMarker;
fileNameMarker = dst + 1;
}
*(dst++) = *(src++);
}
if (*src) {
/*
* Must have seen the first wildcard letter
*/
hasWildcard = TRUE;
while (*src && *src != '\\') {
*(dst++) = *(src++);
}
}
/* Now src points to either null or \ */
assert(*src == '\0' || *src == '\\');
assert(hasWildcard || *src == '\0');
*dst = '\0';
/*
* If the pattern does not contain any wildcard characters, then
* we don't need to go the FindFirstFile route.
*/
if (!hasWildcard) {
/*
* See if it is the root directory, \, or X:\.
*/
assert(!wcscmp(fileName, pattern));
assert(wcslen(fileName) >= 1);
if (dst[-1] == '\\' && (dst == fileName + 1 || dst[-2] == ':')) {
fileData.cFileName[0] = '\0';
} else {
/*
* Do not include the trailing \, if any
*/
if (dst[-1] == '\\') {
assert(*fileNameMarker == '\0');
dst[-1] = '\0';
fileNameMarker = oldFileNameMarker;
}
wcscpy(fileData.cFileName, fileNameMarker);
}
fileData.dwFileAttributes = GetFileAttributes(fileName);
if (fileData.dwFileAttributes == 0xFFFFFFFF) {
return TRUE;
}
*nFiles = 1;
return (*fileFcn)(fileName, &fileData, arg);
}
hSearch = FindFirstFile(fileName, &fileData);
if (hSearch == INVALID_HANDLE_VALUE) {
return retVal;
}
do {
if (!wcscmp(fileData.cFileName, L".")
|| !wcscmp(fileData.cFileName, L"..")) {
/*
* Skip over . and ..
*/
continue;
}
if (patternEndsInDotStar) {
int nDots = 0;
wchar_t *p = fileData.cFileName;
while (*p) {
if (*p == '.') {
nDots++;
}
p++;
}
/* Now p points to the null byte at the end of file name */
if (patternEndsInDot && (p == fileData.cFileName
|| p[-1] != '.')) {
/*
* File name does not end in dot. Skip this file.
* Note: windows file name probably cannot end in dot,
* but we do this check anyway.
*/
continue;
}
if (nDots < numDotsInPattern) {
/*
* Not enough dots in file name. Must be an extra
* file in matching .* pattern. Skip this file.
*/
continue;
}
}
wcscpy(fileNameMarker, fileData.cFileName);
if (*src && *(src + 1)) {
/*
* More to go. Recurse.
*/
int n;
assert(*src == '\\');
where = fileName + wcslen(fileName);
wcscat(fileName, src);
sh_EnumerateFiles(fileName, where, fileFcn, arg, &n);
*nFiles += n;
} else {
assert(wcschr(fileName, '*') == NULL);
assert(wcschr(fileName, '?') == NULL);
(*nFiles)++;
if ((*fileFcn)(fileName, &fileData, arg) == FALSE) {
retVal = FALSE;
}
}
} while (FindNextFile(hSearch, &fileData));
FindClose(hSearch);
return retVal;
}

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

@ -139,8 +139,8 @@ endif
testxpcobjdir = $(DEPTH)/_tests/xpcshell
# Test file installation
ifdef NSINSTALL_BIN
# nsinstall in moztools can't recursively copy directories, so use nsinstall.py
ifeq (WINNT,$(HOST_OS_ARCH))
# Windows nsinstall can't recursively copy directories, so use nsinstall.py
TEST_INSTALLER = $(PYTHON) $(topsrcdir)/config/nsinstall.py
else
TEST_INSTALLER = $(INSTALL)

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

@ -822,12 +822,9 @@ if test -z "$PYTHON"; then
AC_MSG_ERROR([python was not found in \$PATH])
fi
MOZ_PATH_PROGS(NSINSTALL_BIN, nsinstall )
if test -z "$COMPILE_ENVIRONMENT"; then
if test -z "$NSINSTALL_BIN" || test "$NSINSTALL_BIN" = ":"; then
NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
fi
fi
AC_SUBST(NSINSTALL_BIN)
MOZ_PATH_PROG(DOXYGEN, doxygen, :)
@ -4575,7 +4572,6 @@ case "$target_os" in
if test -z "$GNU_CC"; then
XPC_IDISPATCH_SUPPORT=1
MOZ_NO_ACTIVEX_SUPPORT=
MOZ_ACTIVEX_SCRIPTING_SUPPORT=1
fi
;;
esac
@ -6074,11 +6070,11 @@ MOZ_ARG_DISABLE_BOOL(activex,
MOZ_NO_ACTIVEX_SUPPORT= )
AC_SUBST(MOZ_NO_ACTIVEX_SUPPORT)
MOZ_ARG_DISABLE_BOOL(activex-scripting,
[ --disable-activex-scripting
Disable building of ActiveX scripting support (win32)],
MOZ_ACTIVEX_SCRIPTING_SUPPORT=,
MOZ_ACTIVEX_SCRIPTING_SUPPORT=1)
MOZ_ARG_ENABLE_BOOL(activex-scripting,
[ --enable-activex-scripting
Enable building of ActiveX scripting support (win32)],
MOZ_ACTIVEX_SCRIPTING_SUPPORT=1,
MOZ_ACTIVEX_SCRIPTING_SUPPORT=)
AC_SUBST(MOZ_ACTIVEX_SCRIPTING_SUPPORT)
if test -n "$MOZ_NO_ACTIVEX_SUPPORT" -a -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT";

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

@ -1753,10 +1753,6 @@ nsGenericElement::nsDOMSlots::nsDOMSlots(PtrBits aFlags)
nsGenericElement::nsDOMSlots::~nsDOMSlots()
{
if (mStyle) {
mStyle->DropReference();
}
if (mAttributeMap) {
mAttributeMap->DropReference();
}
@ -4057,7 +4053,12 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsGenericElement)
{
nsDOMSlots *slots = tmp->GetExistingDOMSlots();
if (slots) {
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "slots mStyle");
cb.NoteXPCOMChild(slots->mStyle.get());
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "slots mAttributeMap");
cb.NoteXPCOMChild(slots->mAttributeMap.get());
if (tmp->IsNodeOfType(nsINode::eXUL))
cb.NoteXPCOMChild(slots->mControllers);
cb.NoteXPCOMChild(

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

@ -1,52 +0,0 @@
#
# ***** 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 mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = public src
# ifdef ENABLE_TESTS
# DIRS += test
# endif
include $(topsrcdir)/config/rules.mk

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

@ -1,9 +0,0 @@
The *.java files in this directory are the source files from which the
corresponding nsHtml5*.cpp and nsHtml5*.h files were generated in
../src/.
You can obtain the full Java version of the parser and the translator
program from
svn co http://svn.versiondude.net/whattf/htmlparser/trunk/ htmlparser
See run-cpp-translate.sh at the top level of the SVN checkout.

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

@ -1,51 +0,0 @@
#
# ***** 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 mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = html5
EXPORTS = \
nsHtml5Module.h \
$(NULL)
include $(topsrcdir)/config/rules.mk

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

@ -71,6 +71,10 @@
onNavComplete: nextTest
});
yield;
// Make sure we unsuppress painting before continuing
SimpleTest.executeSoon(nextTest)
yield;
// Search for some text that's on the second page (but not on
// the first page), and verify that it can be found.

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

@ -175,6 +175,7 @@
#include "nsIDOMRect.h"
#include "nsIDOMRGBColor.h"
#include "nsIDOMNSRGBAColor.h"
#include "nsDOMCSSAttrDeclaration.h"
// XBL related includes.
#include "nsIXBLService.h"
@ -10040,6 +10041,31 @@ nsCSSValueListSH::GetItemAt(nsISupports *aNative, PRUint32 aIndex,
// CSSStyleDeclaration helper
NS_IMETHODIMP
nsCSSStyleDeclSH::PreCreate(nsISupports *nativeObj, JSContext *cx,
JSObject *globalObj, JSObject **parentObj)
{
nsWrapperCache* cache = nsnull;
CallQueryInterface(nativeObj, &cache);
if (!cache) {
return nsDOMClassInfo::PreCreate(nativeObj, cx, globalObj, parentObj);
}
nsICSSDeclaration *declaration = static_cast<nsICSSDeclaration*>(nativeObj);
nsISupports *native_parent = declaration->GetParentObject();
if (!native_parent) {
return NS_ERROR_FAILURE;
}
jsval v;
nsresult rv = WrapNative(cx, globalObj, native_parent, &v);
NS_ENSURE_SUCCESS(rv, rv);
*parentObj = JSVAL_TO_OBJECT(v);
return NS_SUCCESS_ALLOW_SLIM_WRAPPERS;
}
nsresult
nsCSSStyleDeclSH::GetStringAt(nsISupports *aNative, PRInt32 aIndex,
nsAString& aResult)

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

@ -1423,6 +1423,9 @@ protected:
nsAString& aResult);
public:
NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx,
JSObject *globalObj, JSObject **parentObj);
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
{
return new nsCSSStyleDeclSH(aData);

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

@ -139,7 +139,7 @@
#include "nsIWebBrowserFind.h" // For window.find()
#include "nsIWebContentHandlerRegistrar.h"
#include "nsIWindowMediator.h" // For window.find()
#include "nsIComputedDOMStyle.h"
#include "nsComputedDOMStyle.h"
#include "nsIEntropyCollector.h"
#include "nsDOMCID.h"
#include "nsDOMError.h"
@ -207,7 +207,6 @@
static PRLogModuleInfo* gDOMLeakPRLog;
#endif
nsIFactory *nsGlobalWindow::sComputedDOMStyleFactory = nsnull;
nsIDOMStorageList *nsGlobalWindow::sGlobalStorageList = nsnull;
static nsIEntropyCollector *gEntropyCollector = nsnull;
@ -803,7 +802,6 @@ nsGlobalWindow::~nsGlobalWindow()
void
nsGlobalWindow::ShutDown()
{
NS_IF_RELEASE(sComputedDOMStyleFactory);
NS_IF_RELEASE(sGlobalStorageList);
if (gDumpFile && gDumpFile != stdout) {
@ -6899,27 +6897,14 @@ nsGlobalWindow::GetComputedStyle(nsIDOMElement* aElt,
return NS_OK;
}
nsresult rv = NS_OK;
nsCOMPtr<nsIComputedDOMStyle> compStyle;
if (!sComputedDOMStyleFactory) {
rv = CallGetClassObject("@mozilla.org/DOM/Level2/CSS/computedStyleDeclaration;1",
&sComputedDOMStyleFactory);
NS_ENSURE_SUCCESS(rv, rv);
}
rv =
sComputedDOMStyleFactory->CreateInstance(nsnull,
NS_GET_IID(nsIComputedDOMStyle),
getter_AddRefs(compStyle));
nsRefPtr<nsComputedDOMStyle> compStyle;
nsresult rv = NS_NewComputedDOMStyle(aElt, aPseudoElt, presShell,
getter_AddRefs(compStyle));
NS_ENSURE_SUCCESS(rv, rv);
rv = compStyle->Init(aElt, aPseudoElt, presShell);
NS_ENSURE_SUCCESS(rv, rv);
*aReturn = compStyle.forget().get();
return compStyle->QueryInterface(NS_GET_IID(nsIDOMCSSStyleDeclaration),
(void **) aReturn);
return NS_OK;
}
//*****************************************************************************

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

@ -781,7 +781,6 @@ protected:
friend class nsDOMScriptableHelper;
friend class nsDOMWindowUtils;
friend class PostMessageEvent;
static nsIFactory *sComputedDOMStyleFactory;
static nsIDOMStorageList* sGlobalStorageList;
};

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

@ -49,6 +49,7 @@ GRE_MODULE = 1
XPIDLSRCS = \
nsIDOMGeoGeolocation.idl \
nsIDOMGeoPosition.idl \
nsIDOMGeoPositionAddress.idl \
nsIDOMGeoPositionCoords.idl \
nsIDOMGeoPositionCallback.idl \
nsIDOMGeoPositionError.idl \

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

@ -37,10 +37,13 @@
#include "domstubs.idl"
#include "nsIDOMGeoPositionCoords.idl"
#include "nsIDOMGeoPositionAddress.idl"
[scriptable, uuid(76888EB0-5EAB-4BE6-BFE0-489EC4095358)]
[scriptable, uuid(23E5269F-4DD7-41C4-B52A-75918694C2DE)]
interface nsIDOMGeoPosition : nsISupports
{
readonly attribute nsIDOMGeoPositionCoords coords;
readonly attribute DOMTimeStamp timestamp;
readonly attribute nsIDOMGeoPositionCoords coords;
readonly attribute nsIDOMGeoPositionAddress address;
};

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

@ -1,4 +1,3 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@ -12,18 +11,18 @@
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
* The Original Code is Geolocation.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1999
* The Initial Developer of the Original Code is Mozilla Corporation
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Doug Turner <dougt@meer.net> (Original Author)
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* 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
@ -35,32 +34,19 @@
*
* ***** END LICENSE BLOCK ***** */
/* DOM object returned from element.getComputedStyle() */
#ifndef nsIComputedDOMStyle_h___
#define nsIComputedDOMStyle_h___
#include "domstubs.idl"
#include "nsICSSDeclaration.h"
class nsIDOMElement;
class nsIPresShell;
#define NS_ICOMPUTEDDOMSTYLE_IID \
{ 0x5f0197a1, 0xa873, 0x44e5, \
{0x96, 0x31, 0xac, 0xd6, 0xca, 0xb4, 0xf1, 0xe0 } }
class nsIComputedDOMStyle : public nsICSSDeclaration
[scriptable, uuid(98808DEB-C8E4-422C-BA97-08BF2031464C)]
interface nsIDOMGeoPositionAddress : nsISupports
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICOMPUTEDDOMSTYLE_IID)
NS_IMETHOD Init(nsIDOMElement *aElement, const nsAString& aPseudoElt,
nsIPresShell *aPresShell) = 0;
readonly attribute string streetNumber;
readonly attribute string street;
readonly attribute string premises;
readonly attribute string city;
readonly attribute string county;
readonly attribute string region;
readonly attribute string country;
readonly attribute string countryCode;
readonly attribute string postalCode;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIComputedDOMStyle, NS_ICOMPUTEDDOMSTYLE_IID)
nsresult
NS_NewComputedDOMStyle(nsIComputedDOMStyle** aComputedStyle);
#endif /* nsIComputedDOMStyle_h___ */

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

@ -186,6 +186,12 @@ nsGeoPosition::GetCoords(nsIDOMGeoPositionCoords * *aCoords)
return NS_OK;
}
NS_IMETHODIMP
nsGeoPosition::GetAddress(nsIDOMGeoPositionAddress** aAddress)
{
*aAddress = nsnull;
return NS_OK;
}
NS_IMETHODIMP
nsGeoPosition::GetTimestamp(DOMTimeStamp* aTimestamp)

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

@ -20,6 +20,37 @@ function LOG(aMsg) {
}
}
function WifiGeoAddressObject(streetNumber, street, premises, city, county, region, country, countryCode, postalCode) {
this.streetNumber = streetNumber;
this.street = street;
this.premises = premises;
this.city = city;
this.county = county;
this.region = region;
this.country = country;
this.countryCode = countryCode;
this.postalCode = postalCode;
}
WifiGeoAddressObject.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDOMGeoPositionAddress, Ci.nsIClassInfo]),
getInterfaces: function(countRef) {
var interfaces = [Ci.nsIDOMGeoPositionAddress, Ci.nsIClassInfo, Ci.nsISupports];
countRef.value = interfaces.length;
return interfaces;
},
getHelperForLanguage: function(language) null,
contractID: "",
classDescription: "wifi geo position address object",
classID: null,
implementationLanguage: Ci.nsIProgrammingLanguage.JAVASCRIPT,
flags: Ci.nsIClassInfo.DOM_OBJECT,
};
function WifiGeoCoordsObject(lat, lon, acc) {
this.latitude = lat;
this.longitude = lon;
@ -53,8 +84,24 @@ WifiGeoCoordsObject.prototype = {
speed: 0,
};
function WifiGeoPositionObject(lat, lon, acc) {
function WifiGeoPositionObject(lat, lon, acc, address) {
this.coords = new WifiGeoCoordsObject(lat, lon, acc);
if (address) {
this.address = new WifiGeoAddressObject(address.streetNumber,
address.street,
address.premises,
address.city,
address.county,
address.region,
address.county,
address.countryCode,
address.postalCode);
}
else
this.address = null;
this.timestamp = Date.now();
};
@ -238,9 +285,17 @@ WifiGeoPositionProvider.prototype = {
}
}
var address = null;
try {
address = response.location.address;
} catch (e) {
LOG("No address in response");
}
var newLocation = new WifiGeoPositionObject(response.location.latitude,
response.location.longitude,
response.location.accuracy);
response.location.accuracy,
address);
var update = Cc["@mozilla.org/geolocation/service;1"].getService(Ci.nsIGeolocationUpdate);
update.update(newLocation);
@ -250,7 +305,7 @@ WifiGeoPositionProvider.prototype = {
var request = {
version: "1.1.0",
// request_address: true,
request_address: true,
};
if (accessToken != "")

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

@ -179,6 +179,13 @@ nsGeoPosition::GetCoords(nsIDOMGeoPositionCoords * *aCoords)
return NS_OK;
}
NS_IMETHODIMP
nsGeoPosition::GetAddress(nsIDOMGeoPositionAddress** aAddress)
{
*aAddress = nsnull;
return NS_OK;
}
NS_IMPL_ISUPPORTS2(WinMobileLocationProvider, nsIGeolocationProvider, nsITimerCallback)
WinMobileLocationProvider::WinMobileLocationProvider():

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

@ -806,6 +806,8 @@ nsGeolocation::GetCurrentPosition(nsIDOMGeoPositionCallback *callback,
nsIDOMGeoPositionErrorCallback *errorCallback,
nsIDOMGeoPositionOptions *options)
{
NS_ENSURE_ARG_POINTER(callback);
if (sGeoEnabled == PR_FALSE)
return NS_ERROR_NOT_AVAILABLE;
@ -836,6 +838,8 @@ nsGeolocation::WatchPosition(nsIDOMGeoPositionCallback *aCallback,
nsIDOMGeoPositionOptions *aOptions,
PRInt32 *_retval NS_OUTPARAM)
{
NS_ENSURE_ARG_POINTER(aCallback);
if (sGeoEnabled == PR_FALSE)
return NS_ERROR_NOT_AVAILABLE;

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

@ -45,7 +45,7 @@ include $(DEPTH)/config/autoconf.mk
DIRS = webBrowser build
ifeq ($(OS_ARCH),WINNT)
ifneq (,$(filter $(OS_ARCH),WINNT WINCE))
ifndef MOZ_NO_ACTIVEX_SUPPORT
TOOL_DIRS += activex/src
endif

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

@ -168,7 +168,7 @@ HRESULT CControlEventSink::SubscribeToEvents(IUnknown *pControl)
DWORD dwCookie = 0;
if (!ccp ||
FAILED(ccp->FindConnectionPoint(m_EventIID, &cp)) ||
FAILED(cp->Advise(this, &m_dwEventCookie)))
FAILED(cp->Advise(this, &dwCookie)))
{
return E_FAIL;
}

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

@ -60,6 +60,7 @@ public:
BOOL
CDefaultControlSiteSecurityPolicy::ClassImplementsCategory(const CLSID &clsid, const CATID &catid, BOOL &bClassExists)
{
#ifndef WINCE
bClassExists = FALSE;
// Test if there is a CLSID entry. If there isn't then obviously
@ -116,6 +117,8 @@ CDefaultControlSiteSecurityPolicy::ClassImplementsCategory(const CLSID &clsid, c
return TRUE;
}
}
#endif
return FALSE;
}
@ -477,14 +480,14 @@ HRESULT CControlSite::Attach(HWND hwndParent, const RECT &rcPos, IUnknown *pInit
m_spIOleInPlaceObject = m_spObject;
m_spIOleInPlaceObjectWindowless = m_spObject;
m_spIOleInPlaceObject->SetObjectRects(&m_rcObjectPos, &m_rcObjectPos);
// In-place activate the object
if (m_bVisibleAtRuntime)
{
DoVerb(OLEIVERB_INPLACEACTIVATE);
}
m_spIOleInPlaceObject->SetObjectRects(&m_rcObjectPos, &m_rcObjectPos);
// For those objects which haven't had their client site set yet,
// it's done here.
if (!m_bSetClientSiteFirst)
@ -1273,7 +1276,9 @@ HRESULT STDMETHODCALLTYPE CControlSite::TransformCoords(/* [out][in] */ POINTL _
}
HDC hdc = ::GetDC(m_hWndParent);
#ifndef WINCE
::SetMapMode(hdc, MM_HIMETRIC);
#endif
POINT rgptConvert[2];
rgptConvert[0].x = 0;
rgptConvert[0].y = 0;
@ -1282,7 +1287,9 @@ HRESULT STDMETHODCALLTYPE CControlSite::TransformCoords(/* [out][in] */ POINTL _
{
rgptConvert[1].x = pPtlHimetric->x;
rgptConvert[1].y = pPtlHimetric->y;
#ifndef WINCE
::LPtoDP(hdc, rgptConvert, 2);
#endif
if (dwFlags & XFORMCOORDS_SIZE)
{
pPtfContainer->x = (float)(rgptConvert[1].x - rgptConvert[0].x);
@ -1302,7 +1309,9 @@ HRESULT STDMETHODCALLTYPE CControlSite::TransformCoords(/* [out][in] */ POINTL _
{
rgptConvert[1].x = (int)(pPtfContainer->x);
rgptConvert[1].y = (int)(pPtfContainer->y);
#ifndef WINCE
::DPtoLP(hdc, rgptConvert, 2);
#endif
if (dwFlags & XFORMCOORDS_SIZE)
{
pPtlHimetric->x = rgptConvert[1].x - rgptConvert[0].x;

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

@ -41,6 +41,9 @@
#include <mshtml.h>
/* this is all kinds of awesome; SHANDLE_PTR is in some basetsd.h but not others */
typedef long SHANDLE_PTR;
#include "nsIWebNavigation.h"
#include "nsIPrefBranch.h"
#include "nsIPrefLocalizedString.h"

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

@ -89,6 +89,30 @@
#pragma conform(forScope, push, atlhack, off)
#endif
#ifdef WINCE
/* atlbase.h on WINCE has a bug, in that it tries to use
* GetProcAddress with a wide string, when that is explicitly not
* supported. So we use C++ to overload that here, and implement
* something that works.
*/
#include <windows.h>
static FARPROC GetProcAddressA(HMODULE hMod, wchar_t *procName) {
FARPROC ret = NULL;
int len = wcslen(procName);
char *s = new char[len + 1];
for (int i = 0; i < len; i++) {
s[i] = (char) procName[i];
}
s[len-1] = 0;
ret = ::GetProcAddress(hMod, s);
delete [] s;
return ret;
}
#endif
#include <atlbase.h>
//You may derive a class from CComModule and use it if you want to override

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

@ -443,6 +443,8 @@ WillHandleCLSID(const CLSID &clsid, PluginInstanceData *pData)
PRBool classExists = PR_FALSE;
nsCOMPtr<nsIURI> uri;
MozAxPlugin::GetCurrentLocation(pData->pPluginInstance, getter_AddRefs(uri));
JSAutoRequest req(cx);
MozAxAutoPushJSContext autoContext(cx, uri);
dispSupport->IsClassSafeToHost(cx, cid, PR_TRUE, &classExists, &isSafe);
if (classExists && !isSafe)
@ -557,7 +559,26 @@ CreateControl(const CLSID &clsid, PluginInstanceData *pData, PropertyList &pl, L
PRBool hostSafeControlsOnly;
PRBool downloadControlsIfMissing;
#if defined(MOZ_ACTIVEX_PLUGIN_XPCONNECT) && defined(XPC_IDISPATCH_SUPPORT)
#ifdef MOZ_FLASH_ACTIVEX_PATCH
GUID flashGUID;
::CLSIDFromString(_T("{D27CDB6E-AE6D-11CF-96B8-444553540000}"), &flashGUID);
// HACK: Allow anything but downloading for the wrapped Flash control.
PRUint32 hostingFlags;
if (clsid == flashGUID)
{
hostingFlags = (nsIActiveXSecurityPolicy::HOSTING_FLAGS_HOST_SAFE_OBJECTS |
nsIActiveXSecurityPolicy::HOSTING_FLAGS_SCRIPT_SAFE_OBJECTS |
nsIActiveXSecurityPolicy::HOSTING_FLAGS_SCRIPT_ALL_OBJECTS |
nsIActiveXSecurityPolicy::HOSTING_FLAGS_HOST_ALL_OBJECTS);
}
else
{
hostingFlags = MozAxPlugin::PrefGetHostingFlags();
}
#else
PRUint32 hostingFlags = MozAxPlugin::PrefGetHostingFlags();
#endif
if (hostingFlags & nsIActiveXSecurityPolicy::HOSTING_FLAGS_HOST_SAFE_OBJECTS &&
!(hostingFlags & nsIActiveXSecurityPolicy::HOSTING_FLAGS_HOST_ALL_OBJECTS))
{
@ -786,7 +807,7 @@ NewControl(const char *pluginType,
char szCLSID[kCLSIDLen];
if (strlen(argv[i]) < sizeof(szCLSID))
{
if (strnicmp(argv[i], "CLSID:", 6) == 0)
if (_strnicmp(argv[i], "CLSID:", 6) == 0)
{
_snprintf(szCLSID, kCLSIDLen - 1, "{%s}", argv[i]+6);
}
@ -844,7 +865,7 @@ NewControl(const char *pluginType,
else
{
CComBSTR paramName;
if (strnicmp(argn[i], "PARAM_", 6) == 0)
if (_strnicmp(argn[i], "PARAM_", 6) == 0)
{
paramName = argn[i] + 6;
}
@ -933,6 +954,8 @@ NPError NPP_New(NPMIMEType pluginType,
MozAxPlugin::AddRef();
#endif
CoInitializeEx(NULL, COINIT_MULTITHREADED);
NPError rv = NPERR_GENERIC_ERROR;
/* if (strcmp(pluginType, MIME_OLEOBJECT1) == 0 ||
strcmp(pluginType, MIME_OLEOBJECT2) == 0) */
@ -951,6 +974,7 @@ NPError NPP_New(NPMIMEType pluginType,
#ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT
MozAxPlugin::Release();
#endif
CoUninitialize();
return rv;
}
@ -1014,6 +1038,8 @@ NPP_Destroy(NPP instance, NPSavedData** save)
instance->pdata = 0;
CoUninitialize();
return NPERR_NO_ERROR;
}

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

@ -47,7 +47,17 @@ include $(DEPTH)/config/autoconf.mk
MODULE = npmozax
LIBRARY_NAME = npmozax
ifdef WINCE
MOZ_FLASH_ACTIVEX_PATCH = 1
endif
ifdef MOZ_FLASH_ACTIVEX_PATCH
RESFILE = MozActiveX-flash.res
else
RESFILE = MozActiveX.res
endif
DEFFILE = npmozax.def
GRE_MODULE = 1
@ -93,7 +103,7 @@ MOZ_ACTIVEX_PLUGIN_XPCONNECT = 1
# XPConnect support in (Netscape 6.1+/Mozilla)
# Uncomment this line to install the plugin & policy
# MOZ_USE_ACTIVEX_PLUGIN = 1
MOZ_USE_ACTIVEX_PLUGIN = 1
# Settings will also be read from this supplemental file if it exists
-include $(srcdir)/plugin.mk
@ -146,6 +156,21 @@ ifdef MOZ_ACTIVEX_PLUGIN_XPCONNECT
LOCAL_INCLUDES += -I$(XPIDL_GEN_DIR)
endif
ifdef WINCE
OS_LIBS += \
coredll.lib \
ole32.lib \
oleaut32.lib \
uuid.lib \
ceshell.lib \
corelibc.lib \
atls.lib \
atlce400.lib \
urlmon.lib \
libcmt.lib \
comsuppw.lib \
$(NULL)
else
OS_LIBS += \
comdlg32.lib \
ole32.lib \
@ -153,6 +178,7 @@ OS_LIBS += \
uuid.lib \
shell32.lib \
$(NULL)
endif
ifdef MOZ_ACTIVEX_PLUGIN_LIVECONNECT
DEFINES += -DMOZ_ACTIVEX_PLUGIN_LIVECONNECT -DXPCOM_GLUE
@ -166,6 +192,10 @@ ifdef XPC_IDISPATCH_SUPPORT
DEFINES += -DXPC_IDISPATCH_SUPPORT
endif
ifdef MOZ_FLASH_ACTIVEX_PATCH
DEFINES += -DMOZ_FLASH_ACTIVEX_PATCH
endif
EXTRA_DSO_LDOPTS = \
$(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
$(MOZ_COMPONENT_LIBS) \
@ -212,8 +242,8 @@ install-typelib: $(XPIDL_GEN_DIR)/nsIMozAxPlugin.xpt
install-securitypolicy: nsAxSecurityPolicy.js
$(INSTALL) $< $(DIST)/bin/components
install-prefs: activex.js
$(INSTALL) $< $(DIST)/bin/defaults/pref
install-prefs: activex.js $(FLASHLITE_PREFS_JS)
$(INSTALL) $^ $(DIST)/bin/defaults/pref
ifdef MOZ_USE_ACTIVEX_PLUGIN
libs:: install-plugin install-prefs

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

@ -0,0 +1,130 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#if OSARCH != WINCE
#include "winresrc.h"
#else
#include <dlgs.h>
#include <winbase.h>
#include <commctrl.h>
#endif
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,4
PRODUCTVERSION 1,0,0,4
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904e4"
BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "\0"
VALUE "FileDescription", "Shockwave Flash 9.0 r83\0"
VALUE "FileExtents", "*.ocx|*.ocx|*.swf|*.flv\0"
VALUE "FileOpenName", "ActiveX (*.ocx)|ActiveX (*.ocx)|Adobe Flash Movie (*.swf)|Adobe Flash Video (*.flv)\0"
VALUE "FileVersion", "9, 0, 83, 0\0"
VALUE "InternalName", "NPMOZAX\0"
VALUE "LegalCopyright", "Copyright 1999, 2009\0"
VALUE "LegalTrademarks", "\0"
VALUE "MIMEType", "application/x-oleobject|application/oleobject|application/x-shockwave-flash|application/x-shockwave-flash\0"
VALUE "OriginalFilename", "NPMOZAX.DLL\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Shockwave Flash\0"
VALUE "ProductVersion", "9, 0, 83, 0\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
#endif // !_MAC
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// English (U.K.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English (U.K.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

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

@ -51,8 +51,9 @@ CComModule _Module;
BEGIN_OBJECT_MAP(ObjectMap)
END_OBJECT_MAP()
extern "C"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
#if 0
BOOL WINAPI
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
@ -65,3 +66,4 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
}
return TRUE; // ok
}
#endif

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

@ -59,12 +59,12 @@ BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "Mozilla ActiveX control and plugin module\0"
VALUE "FileExtents", "*.ocx|*.ocx\0"
VALUE "FileOpenName", "ActiveX (*.ocx)|ActiveX (*.ocx)\0"
VALUE "FileOpenName", "ActiveX (*.ocx)|ActiveX (*.ocx)|Adobe Flash Movie (*.swf)|Adobe Flash Movie (*.swf)\0"
VALUE "FileVersion", "1, 0, 0, 4\0"
VALUE "InternalName", "NPMOZAX\0"
VALUE "LegalCopyright", "Copyright 1999\0"
VALUE "LegalTrademarks", "\0"
VALUE "MIMEType", "application/x-oleobject|application/oleobject\0"
VALUE "MIMEType", "application/x-oleobject|application/oleobject|application/x-shockwave-flash|application/x-shockwave-flash\0"
VALUE "OriginalFilename", "NPMOZAX.DLL\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Mozilla ActiveX control and plugin support\0"

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

@ -65,6 +65,30 @@
#pragma conform(forScope, push, atlhack, off)
#endif
#ifdef WINCE
/* atlbase.h on WINCE has a bug, in that it tries to use
* GetProcAddress with a wide string, when that is explicitly not
* supported. So we use C++ to overload that here, and implement
* something that works.
*/
#include <windows.h>
static FARPROC GetProcAddressA(HMODULE hMod, wchar_t *procName) {
FARPROC ret = NULL;
int len = wcslen(procName);
char *s = new char[len + 1];
for (int i = 0; i < len; i++) {
s[i] = (char) procName[i];
}
s[len-1] = 0;
ret = ::GetProcAddress(hMod, s);
delete [] s;
return ret;
}
#endif
#include <atlbase.h>
//You may derive a class from CComModule and use it if you want to override
//something, but do not change the name of _Module

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

@ -57,6 +57,10 @@
//
// Neither Visual C++ 6.0 or 7.0 ship with this interface.
//
#ifdef WINCE
#define USE_HTIFACE
#endif
#ifdef USE_HTIFACE
#include <htiface.h>
#endif
@ -939,7 +943,27 @@ public:
mData(NULL),
mUseTarget(NULL)
{
#ifdef MOZ_FLASH_ACTIVEX_PATCH
// HACK+TODO:
//
// AddRef()ing here causes leaking the MozAxPlugin's
// PrefObserver() because IEDocument() itself leaks.
// CControlSite::Attach() adds references to this object that
// aren't countered; most likely in the
// DoVerb(OLEIVERB_INPLACEACTIVATE) call. Maybe it results in a
// circular reference but the rest of the problem happens inside
// ATL and COM, so good luck with that.
//
// Sadly, I have no time to debug the original problem
// throughoutly but leaking pref observers visibly causes XUL to
// crash upon exit. XUL tries to release the stale pref observer
// after npmozax.dll has long since been unloaded. Note that a
// callback to IEDocument after unloading npmozax.dll would also
// crash but that doesn't seem to happen after tearing down the
// plugin instance itself. -Simo
#else
MozAxPlugin::AddRef();
#endif
}
HRESULT Init(PluginInstanceData *pData)
@ -1009,7 +1033,11 @@ public:
{
mWindow->Release();
}
#ifdef MOZ_FLASH_ACTIVEX_PATCH
// HACK+TODO: See IEDocument::IEDocument()
#else
MozAxPlugin::Release();
#endif
}
BEGIN_COM_MAP(IEDocument)

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

@ -124,6 +124,11 @@ nsScriptablePeer::QueryInterface(const nsIID & aIID, void **aInstancePtr)
return (*aInstancePtr) ? NS_OK : NS_NOINTERFACE;
}
#ifdef WINCE
typedef _com_ptr_t<_com_IIID<IUnknown, &__uuidof(IUnknown)> > IUnknownPtr;
typedef _com_ptr_t<_com_IIID<IDispatch, &__uuidof(IDispatch)> > IDispatchPtr;
#endif
HRESULT
nsScriptablePeer::GetIDispatch(IDispatch **pdisp)
{
@ -378,7 +383,7 @@ nsScriptablePeer::ConvertVariants(VARIANT *aIn, nsIVariant **aOut)
nsIComponentManager *pManager = nsnull; // A frozen interface, even in 1.0.x
typedef nsresult (*Moz1XGetComponentManagerFunc)(nsIComponentManager* *result);
Moz1XGetComponentManagerFunc compMgr = (Moz1XGetComponentManagerFunc)
::GetProcAddress(hlib, "NS_GetComponentManager");
::GetProcAddress(hlib, "NS_GetComponentManager");
if (compMgr)
{
compMgr(&pManager);
@ -991,6 +996,21 @@ CLSID MozAxPlugin::GetCLSIDForType(const char *mimeType)
return CLSID_NULL;
}
#ifdef MOZ_FLASH_ACTIVEX_PATCH
// If the Flash activex control doesn't advertise the supported
// mimetypes correctly, we map Shockwave Flash manually to the
// appropriate CLSID of the ActiveX control here.
if (!strcmp(mimeType, "application/x-shockwave-flash"))
{
GUID guidValue;
// The Flash CLSID
::CLSIDFromString(_T("{D27CDB6E-AE6D-11CF-96B8-444553540000}"), &guidValue);
return guidValue;
}
#endif
// Read the registry to see if there is a CLSID for an object to be associated with
// this MIME type.
USES_CONVERSION;

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

@ -48,12 +48,13 @@ include $(DEPTH)/config/autoconf.mk
# headers, so that we can use it to set up the wrapped system headers.
VISIBILITY_FLAGS =
ifneq (,$(CROSS_COMPILE)$(filter-out WINNT OS2,$(OS_ARCH)))
ifneq (,$(filter-out SYMBIAN WINCE,$(OS_ARCH)))
HOST_PROGRAM = nsinstall$(HOST_BIN_SUFFIX)
ifeq (WINNT,$(HOST_OS_ARCH))
HOST_CSRCS = nsinstall_win.c
else
HOST_CSRCS = nsinstall.c pathsub.c
endif
endif
PLSRCS = nfspwd.pl
@ -82,6 +83,8 @@ NO_INSTALL=1
include $(topsrcdir)/config/rules.mk
HOST_CFLAGS += -DUNICODE -D_UNICODE
export:: $(TARGETS)
ifdef HOST_PROGRAM
$(INSTALL) $(HOST_PROGRAM) $(DIST)/bin

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

@ -785,15 +785,11 @@ endif
ifdef NSINSTALL_BIN
NSINSTALL = $(CYGWIN_WRAPPER) $(NSINSTALL_BIN)
else
ifeq (WINNT,$(CROSS_COMPILE)$(OS_ARCH))
NSINSTALL = $(CYGWIN_WRAPPER) $(MOZ_TOOLS_DIR)/bin/nsinstall
else
ifeq (OS2,$(CROSS_COMPILE)$(OS_ARCH))
NSINSTALL = $(MOZ_TOOLS_DIR)/nsinstall
else
NSINSTALL = $(CONFIG_TOOLS)/nsinstall
endif # OS2
endif # WINNT
endif # NSINSTALL_BIN

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

@ -0,0 +1,709 @@
/*
* The nsinstall command for Win32
*
* Our gmake makefiles use the nsinstall command to create the
* object directories or installing headers and libs. This code was originally
* taken from shmsdos.c
*/
#include <direct.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <windows.h>
#pragma hdrstop
/*
* sh_FileFcn --
*
* A function that operates on a file. The pathname is either
* absolute or relative to the current directory, and contains
* no wildcard characters such as * and ?. Additional arguments
* can be passed to the function via the arg pointer.
*/
typedef BOOL (*sh_FileFcn)(
wchar_t *pathName,
WIN32_FIND_DATA *fileData,
void *arg);
static int shellCp (wchar_t **pArgv);
static int shellNsinstall (wchar_t **pArgv);
static int shellMkdir (wchar_t **pArgv);
static BOOL sh_EnumerateFiles(const wchar_t *pattern, const wchar_t *where,
sh_FileFcn fileFcn, void *arg, int *nFiles);
static const char *sh_GetLastErrorMessage(void);
static BOOL sh_DoCopy(wchar_t *srcFileName, DWORD srcFileAttributes,
wchar_t *dstFileName, DWORD dstFileAttributes,
int force, int recursive);
#define LONGPATH_PREFIX L"\\\\?\\"
#define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0]))
#define STR_LEN(a) (ARRAY_LEN(a) - 1)
/* changes all forward slashes in token to back slashes */
void changeForwardSlashesTpBackSlashes ( wchar_t *arg )
{
if ( arg == NULL )
return;
while ( *arg ) {
if ( *arg == '/' )
*arg = '\\';
arg++;
}
}
int wmain(int argc, wchar_t *argv[ ])
{
return shellNsinstall ( argv + 1 );
}
static int
shellNsinstall (wchar_t **pArgv)
{
int retVal = 0; /* exit status */
int dirOnly = 0; /* 1 if and only if -D is specified */
wchar_t **pSrc;
wchar_t **pDst;
/*
* Process the command-line options. We ignore the
* options except for -D. Some options, such as -m,
* are followed by an argument. We need to skip the
* argument too.
*/
while ( *pArgv && **pArgv == '-' ) {
wchar_t c = (*pArgv)[1]; /* The char after '-' */
if ( c == 'D' ) {
dirOnly = 1;
} else if ( c == 'm' ) {
pArgv++; /* skip the next argument */
}
pArgv++;
}
if ( !dirOnly ) {
/* There are files to install. Get source files */
if ( *pArgv ) {
pSrc = pArgv++;
} else {
fprintf( stderr, "nsinstall: not enough arguments\n");
return 3;
}
}
/* Get to last token to find destination directory */
if ( *pArgv ) {
pDst = pArgv++;
if ( dirOnly && *pArgv ) {
fprintf( stderr, "nsinstall: too many arguments with -D\n");
return 3;
}
} else {
fprintf( stderr, "nsinstall: not enough arguments\n");
return 3;
}
while ( *pArgv )
pDst = pArgv++;
retVal = shellMkdir ( pDst );
if ( retVal )
return retVal;
if ( !dirOnly )
retVal = shellCp ( pSrc );
return retVal;
}
static int
shellMkdir (wchar_t **pArgv)
{
int retVal = 0; /* assume valid return */
wchar_t *arg;
wchar_t *pArg;
wchar_t path[_MAX_PATH];
wchar_t tmpPath[_MAX_PATH];
wchar_t *pTmpPath = tmpPath;
/* All the options are simply ignored in this implementation */
while ( *pArgv && **pArgv == '-' ) {
if ( (*pArgv)[1] == 'm' ) {
pArgv++; /* skip the next argument (mode) */
}
pArgv++;
}
while ( *pArgv ) {
arg = *pArgv;
changeForwardSlashesTpBackSlashes ( arg );
pArg = arg;
pTmpPath = tmpPath;
while ( 1 ) {
/* create part of path */
while ( *pArg ) {
*pTmpPath++ = *pArg++;
if ( *pArg == '\\' )
break;
}
*pTmpPath = '\0';
/* check if directory alreay exists */
_wgetcwd ( path, _MAX_PATH );
if ( _wchdir ( tmpPath ) != -1 ) {
_wchdir ( path );
} else {
if ( _wmkdir ( tmpPath ) == -1 ) {
// while ( waitForDebug );
printf ( "%ls: ", tmpPath );
perror ( "Could not create the directory" );
retVal = 3;
break;
}
}
if ( *pArg == '\0' ) /* complete path? */
break;
/* loop for next directory */
}
pArgv++;
}
return retVal;
}
static const char *
sh_GetLastErrorMessage()
{
static char buf[128];
FormatMessageA(
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* default language */
buf,
sizeof(buf),
NULL
);
return buf;
}
/*
* struct sh_FileData --
*
* A pointer to the sh_FileData structure is passed into sh_RecordFileData,
* which will fill in the fields.
*/
struct sh_FileData {
wchar_t pathName[_MAX_PATH];
DWORD dwFileAttributes;
};
/*
* sh_RecordFileData --
*
* Record the pathname and attributes of the file in
* the sh_FileData structure pointed to by arg.
*
* Always return TRUE (successful completion).
*
* This function is intended to be passed into sh_EnumerateFiles
* to see if a certain pattern expands to exactly one file/directory,
* and if so, record its pathname and attributes.
*/
static BOOL
sh_RecordFileData(wchar_t *pathName, WIN32_FIND_DATA *findData, void *arg)
{
struct sh_FileData *fData = (struct sh_FileData *) arg;
wcscpy(fData->pathName, pathName);
fData->dwFileAttributes = findData->dwFileAttributes;
return TRUE;
}
static BOOL
sh_DoCopy(wchar_t *srcFileName,
DWORD srcFileAttributes,
wchar_t *dstFileName,
DWORD dstFileAttributes,
int force,
int recursive
)
{
if (dstFileAttributes != 0xFFFFFFFF) {
if ((dstFileAttributes & FILE_ATTRIBUTE_READONLY) && force) {
dstFileAttributes &= ~FILE_ATTRIBUTE_READONLY;
SetFileAttributes(dstFileName, dstFileAttributes);
}
}
if (srcFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
fprintf(stderr, "nsinstall: %ls is a directory\n",
srcFileName);
return FALSE;
} else {
DWORD r;
wchar_t longSrc[1004] = LONGPATH_PREFIX;
wchar_t longDst[1004] = LONGPATH_PREFIX;
r = GetFullPathName(srcFileName, 1000, longSrc + STR_LEN(LONGPATH_PREFIX), NULL);
if (!r) {
fprintf(stderr, "nsinstall: couldn't get full path of %ls: %s\n",
srcFileName, sh_GetLastErrorMessage());
return FALSE;
}
r = GetFullPathName(dstFileName, 1000, longDst + ARRAY_LEN(LONGPATH_PREFIX) - 1, NULL);
if (!r) {
fprintf(stderr, "nsinstall: couldn't get full path of %ls: %s\n",
dstFileName, sh_GetLastErrorMessage());
return FALSE;
}
if (!CopyFile(longSrc, longDst, FALSE)) {
fprintf(stderr, "nsinstall: cannot copy %ls to %ls: %s\n",
srcFileName, dstFileName, sh_GetLastErrorMessage());
return FALSE;
}
}
return TRUE;
}
/*
* struct sh_CpCmdArg --
*
* A pointer to the sh_CpCmdArg structure is passed into sh_CpFileCmd.
* The sh_CpCmdArg contains information about the cp command, and
* provide a buffer for constructing the destination file name.
*/
struct sh_CpCmdArg {
int force; /* -f option, ok to overwrite an existing
* read-only destination file */
int recursive; /* -r or -R option, recursively copy
* directories. Note: this field is not used
* by nsinstall and should always be 0. */
wchar_t *dstFileName; /* a buffer for constructing the destination
* file name */
wchar_t *dstFileNameMarker; /* points to where in the dstFileName buffer
* we should write the file component of the
* destination file */
};
/*
* sh_CpFileCmd --
*
* Copy a file to the destination directory
*
* This function is intended to be passed into sh_EnumerateFiles to
* copy all the files specified by the pattern to the destination
* directory.
*
* Return TRUE if the file is successfully copied, and FALSE otherwise.
*/
static BOOL
sh_CpFileCmd(wchar_t *pathName, WIN32_FIND_DATA *findData, void *cpArg)
{
BOOL retVal = TRUE;
struct sh_CpCmdArg *arg = (struct sh_CpCmdArg *) cpArg;
wcscpy(arg->dstFileNameMarker, findData->cFileName);
return sh_DoCopy(pathName, findData->dwFileAttributes,
arg->dstFileName, GetFileAttributes(arg->dstFileName),
arg->force, arg->recursive);
}
static int
shellCp (wchar_t **pArgv)
{
int retVal = 0;
wchar_t **pSrc;
wchar_t **pDst;
struct sh_CpCmdArg arg;
struct sh_FileData dstData;
int dstIsDir = 0;
int n;
arg.force = 0;
arg.recursive = 0;
arg.dstFileName = dstData.pathName;
arg.dstFileNameMarker = 0;
while (*pArgv && **pArgv == '-') {
wchar_t *p = *pArgv;
while (*(++p)) {
if (*p == 'f') {
arg.force = 1;
}
}
pArgv++;
}
/* the first source file */
if (*pArgv) {
pSrc = pArgv++;
} else {
fprintf(stderr, "nsinstall: not enough arguments\n");
return 3;
}
/* get to the last token to find destination */
if (*pArgv) {
pDst = pArgv++;
} else {
fprintf(stderr, "nsinstall: not enough arguments\n");
return 3;
}
while (*pArgv) {
pDst = pArgv++;
}
/*
* The destination pattern must unambiguously expand to exactly
* one file or directory.
*/
changeForwardSlashesTpBackSlashes(*pDst);
sh_EnumerateFiles(*pDst, *pDst, sh_RecordFileData, &dstData, &n);
assert(n >= 0);
if (n == 1) {
/*
* Is the destination a file or directory?
*/
if (dstData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
dstIsDir = 1;
}
} else if (n > 1) {
fprintf(stderr, "nsinstall: %ls: ambiguous destination file "
"or directory\n", *pDst);
return 3;
} else {
/*
* n == 0, meaning that destination file or directory does
* not exist. In this case the destination file directory
* name must be fully specified.
*/
wchar_t *p;
for (p = *pDst; *p; p++) {
if (*p == '*' || *p == '?') {
fprintf(stderr, "nsinstall: %ls: No such file or directory\n",
*pDst);
return 3;
}
}
/*
* Do not include the trailing \, if any, unless it is a root
* directory (\ or X:\).
*/
if (p > *pDst && p[-1] == '\\' && p != *pDst + 1 && p[-2] != ':') {
p[-1] = '\0';
}
wcscpy(dstData.pathName, *pDst);
dstData.dwFileAttributes = 0xFFFFFFFF;
}
/*
* If there are two or more source files, the destination has
* to be a directory.
*/
if (pDst - pSrc > 1 && !dstIsDir) {
fprintf(stderr, "nsinstall: cannot copy more than"
" one file to the same destination file\n");
return 3;
}
if (dstIsDir) {
arg.dstFileNameMarker = arg.dstFileName + wcslen(arg.dstFileName);
/*
* Now arg.dstFileNameMarker is pointing to the null byte at the
* end of string. We want to make sure that there is a \ at the
* end of string, and arg.dstFileNameMarker should point right
* after that \.
*/
if (arg.dstFileNameMarker[-1] != '\\') {
*(arg.dstFileNameMarker++) = '\\';
}
}
if (!dstIsDir) {
struct sh_FileData srcData;
assert(pDst - pSrc == 1);
changeForwardSlashesTpBackSlashes(*pSrc);
sh_EnumerateFiles(*pSrc, *pSrc, sh_RecordFileData, &srcData, &n);
if (n == 0) {
fprintf(stderr, "nsinstall: %ls: No such file or directory\n",
*pSrc);
retVal = 3;
} else if (n > 1) {
fprintf(stderr, "nsinstall: cannot copy more than one file or "
"directory to the same destination\n");
retVal = 3;
} else {
assert(n == 1);
if (sh_DoCopy(srcData.pathName, srcData.dwFileAttributes,
dstData.pathName, dstData.dwFileAttributes,
arg.force, arg.recursive) == FALSE) {
retVal = 3;
}
}
return retVal;
}
for ( ; *pSrc != *pDst; pSrc++) {
BOOL rv;
changeForwardSlashesTpBackSlashes(*pSrc);
rv = sh_EnumerateFiles(*pSrc, *pSrc, sh_CpFileCmd, &arg, &n);
if (rv == FALSE) {
retVal = 3;
} else {
if (n == 0) {
fprintf(stderr, "nsinstall: %ls: No such file or directory\n",
*pSrc);
retVal = 3;
}
}
}
return retVal;
}
/*
* sh_EnumerateFiles --
*
* Enumerate all the files in the specified pattern, which is a pathname
* containing possibly wildcard characters such as * and ?. fileFcn
* is called on each file, passing the expanded file name, a pointer
* to the file's WIN32_FILE_DATA, and the arg pointer.
*
* It is assumed that there are no wildcard characters before the
* character pointed to by 'where'.
*
* On return, *nFiles stores the number of files enumerated. *nFiles is
* set to this number whether sh_EnumerateFiles or 'fileFcn' succeeds
* or not.
*
* Return TRUE if the files are successfully enumerated and all
* 'fileFcn' invocations succeeded. Return FALSE if something went
* wrong.
*/
static BOOL sh_EnumerateFiles(
const wchar_t *pattern,
const wchar_t *where,
sh_FileFcn fileFcn,
void *arg,
int *nFiles
)
{
WIN32_FIND_DATA fileData;
HANDLE hSearch;
const wchar_t *src;
wchar_t *dst;
wchar_t fileName[_MAX_PATH];
wchar_t *fileNameMarker = fileName;
wchar_t *oldFileNameMarker;
BOOL hasWildcard = FALSE;
BOOL retVal = TRUE;
BOOL patternEndsInDotStar = FALSE;
BOOL patternEndsInDot = FALSE; /* a special case of
* patternEndsInDotStar */
int numDotsInPattern;
int len;
/*
* Windows expands patterns ending in ".", ".*", ".**", etc.
* differently from the glob expansion on Unix. For example,
* both "foo." and "foo.*" match "foo", and "*.*" matches
* everything, including filenames with no dots. So we need
* to throw away extra files returned by the FindNextFile()
* function. We require that a matched filename have at least
* the number of dots in the pattern.
*/
len = wcslen(pattern);
if (len >= 2) {
/* Start from the end of pattern and go backward */
const wchar_t *p = &pattern[len - 1];
/* We can have zero or more *'s */
while (p >= pattern && *p == '*') {
p--;
}
if (p >= pattern && *p == '.') {
patternEndsInDotStar = TRUE;
if (p == &pattern[len - 1]) {
patternEndsInDot = TRUE;
}
p--;
numDotsInPattern = 1;
while (p >= pattern && *p != '\\') {
if (*p == '.') {
numDotsInPattern++;
}
p--;
}
}
}
*nFiles = 0;
/*
* Copy pattern to fileName, but only up to and not including
* the first \ after the first wildcard letter.
*
* Make fileNameMarker point to one of the following:
* - the start of fileName, if fileName does not contain any \.
* - right after the \ before the first wildcard letter, if there is
* a wildcard character.
* - right after the last \, if there is no wildcard character.
*/
dst = fileName;
src = pattern;
while (src < where) {
if (*src == '\\') {
oldFileNameMarker = fileNameMarker;
fileNameMarker = dst + 1;
}
*(dst++) = *(src++);
}
while (*src && *src != '*' && *src != '?') {
if (*src == '\\') {
oldFileNameMarker = fileNameMarker;
fileNameMarker = dst + 1;
}
*(dst++) = *(src++);
}
if (*src) {
/*
* Must have seen the first wildcard letter
*/
hasWildcard = TRUE;
while (*src && *src != '\\') {
*(dst++) = *(src++);
}
}
/* Now src points to either null or \ */
assert(*src == '\0' || *src == '\\');
assert(hasWildcard || *src == '\0');
*dst = '\0';
/*
* If the pattern does not contain any wildcard characters, then
* we don't need to go the FindFirstFile route.
*/
if (!hasWildcard) {
/*
* See if it is the root directory, \, or X:\.
*/
assert(!wcscmp(fileName, pattern));
assert(wcslen(fileName) >= 1);
if (dst[-1] == '\\' && (dst == fileName + 1 || dst[-2] == ':')) {
fileData.cFileName[0] = '\0';
} else {
/*
* Do not include the trailing \, if any
*/
if (dst[-1] == '\\') {
assert(*fileNameMarker == '\0');
dst[-1] = '\0';
fileNameMarker = oldFileNameMarker;
}
wcscpy(fileData.cFileName, fileNameMarker);
}
fileData.dwFileAttributes = GetFileAttributes(fileName);
if (fileData.dwFileAttributes == 0xFFFFFFFF) {
return TRUE;
}
*nFiles = 1;
return (*fileFcn)(fileName, &fileData, arg);
}
hSearch = FindFirstFile(fileName, &fileData);
if (hSearch == INVALID_HANDLE_VALUE) {
return retVal;
}
do {
if (!wcscmp(fileData.cFileName, L".")
|| !wcscmp(fileData.cFileName, L"..")) {
/*
* Skip over . and ..
*/
continue;
}
if (patternEndsInDotStar) {
int nDots = 0;
wchar_t *p = fileData.cFileName;
while (*p) {
if (*p == '.') {
nDots++;
}
p++;
}
/* Now p points to the null byte at the end of file name */
if (patternEndsInDot && (p == fileData.cFileName
|| p[-1] != '.')) {
/*
* File name does not end in dot. Skip this file.
* Note: windows file name probably cannot end in dot,
* but we do this check anyway.
*/
continue;
}
if (nDots < numDotsInPattern) {
/*
* Not enough dots in file name. Must be an extra
* file in matching .* pattern. Skip this file.
*/
continue;
}
}
wcscpy(fileNameMarker, fileData.cFileName);
if (*src && *(src + 1)) {
/*
* More to go. Recurse.
*/
int n;
assert(*src == '\\');
where = fileName + wcslen(fileName);
wcscat(fileName, src);
sh_EnumerateFiles(fileName, where, fileFcn, arg, &n);
*nFiles += n;
} else {
assert(wcschr(fileName, '*') == NULL);
assert(wcschr(fileName, '?') == NULL);
(*nFiles)++;
if ((*fileFcn)(fileName, &fileData, arg) == FALSE) {
retVal = FALSE;
}
}
} while (FindNextFile(hSearch, &fileData));
FindClose(hSearch);
return retVal;
}

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

@ -139,8 +139,8 @@ endif
testxpcobjdir = $(DEPTH)/_tests/xpcshell
# Test file installation
ifdef NSINSTALL_BIN
# nsinstall in moztools can't recursively copy directories, so use nsinstall.py
ifeq (WINNT,$(HOST_OS_ARCH))
# Windows nsinstall can't recursively copy directories, so use nsinstall.py
TEST_INSTALLER = $(PYTHON) $(topsrcdir)/config/nsinstall.py
else
TEST_INSTALLER = $(INSTALL)

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

@ -661,12 +661,9 @@ if test -z "$PYTHON"; then
AC_MSG_ERROR([python was not found in \$PATH])
fi
MOZ_PATH_PROGS(NSINSTALL_BIN, nsinstall )
if test -z "$COMPILE_ENVIRONMENT"; then
if test -z "$NSINSTALL_BIN" || test "$NSINSTALL_BIN" = ":"; then
NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
fi
fi
AC_SUBST(NSINSTALL_BIN)
MOZ_PATH_PROG(DOXYGEN, doxygen, :)

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

@ -655,7 +655,13 @@ Assembler::asm_store32(LIns *value, int dr, LIns *base)
ra = rA->reg;
rb = rB->reg;
}
STR(ra, rb, dr);
if (!isS12(dr)) {
STR(ra, IP, 0);
asm_add_imm(IP, rb, dr);
} else {
STR(ra, rb, dr);
}
}
void
@ -1117,13 +1123,15 @@ Assembler::BranchWithLink(NIns* addr)
// ARMv5 and above can use BLX <imm> for branches within ±32MB of the
// PC and BLX Rm for long branches.
if (isS24(offs>>2)) {
// the value we need to stick in the instruction; masked,
// because it will be sign-extended back to 32 bits.
intptr_t offs2 = (offs>>2) & 0xffffff;
if (((intptr_t)addr & 1) == 0) {
// The target is ARM, so just emit a BL.
// BL addr
NanoAssert( ((offs>>2) & ~0xffffff) == 0);
*(--_nIns) = (NIns)( (COND_AL) | (0xB<<24) | (offs>>2) );
*(--_nIns) = (NIns)( (COND_AL) | (0xB<<24) | (offs2) );
asm_output("bl %p", (void*)addr);
} else {
// The target is Thumb, so emit a BLX.
@ -1132,8 +1140,7 @@ Assembler::BranchWithLink(NIns* addr)
uint32_t H = (offs & 0x2) << 23;
// BLX addr
NanoAssert( ((offs>>2) & ~0xffffff) == 0);
*(--_nIns) = (NIns)( (0xF << 28) | (0x5<<25) | (H) | (offs>>2) );
*(--_nIns) = (NIns)( (0xF << 28) | (0x5<<25) | (H) | (offs2) );
asm_output("blx %p", (void*)addr);
}
} else {

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

@ -62,10 +62,14 @@
#include "nsIDirectoryService.h"
#include "nsILocalFile.h"
#include "nsDirectoryServiceDefs.h"
#include "nsAppDirectoryServiceDefs.h"
#include "jsapi.h"
#include "jsdbgapi.h"
#include "jsprf.h"
#include "nscore.h"
#include "nsArrayEnumerator.h"
#include "nsCOMArray.h"
#include "nsDirectoryServiceUtils.h"
#include "nsMemory.h"
#include "nsIGenericFactory.h"
#include "nsISupportsImpl.h"
@ -97,11 +101,12 @@
#include "nsIJSContextStack.h"
class XPCShellDirProvider : public nsIDirectoryServiceProvider
class XPCShellDirProvider : public nsIDirectoryServiceProvider2
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDIRECTORYSERVICEPROVIDER
NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
XPCShellDirProvider() { }
~XPCShellDirProvider() { }
@ -1803,7 +1808,9 @@ XPCShellDirProvider::Release()
return 1;
}
NS_IMPL_QUERY_INTERFACE1(XPCShellDirProvider, nsIDirectoryServiceProvider)
NS_IMPL_QUERY_INTERFACE2(XPCShellDirProvider,
nsIDirectoryServiceProvider,
nsIDirectoryServiceProvider2)
NS_IMETHODIMP
XPCShellDirProvider::GetFile(const char *prop, PRBool *persistent,
@ -1817,3 +1824,24 @@ XPCShellDirProvider::GetFile(const char *prop, PRBool *persistent,
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP
XPCShellDirProvider::GetFiles(const char *prop, nsISimpleEnumerator* *result)
{
if (mGREDir && !strcmp(prop, "ChromeML")) {
nsCOMArray<nsIFile> dirs;
nsCOMPtr<nsIFile> file;
mGREDir->Clone(getter_AddRefs(file));
file->AppendNative(NS_LITERAL_CSTRING("chrome"));
dirs.AppendObject(file);
nsresult rv = NS_GetSpecialDirectory(NS_APP_CHROME_DIR,
getter_AddRefs(file));
if (NS_SUCCEEDED(rv))
dirs.AppendObject(file);
return NS_NewArrayEnumerator(result, dirs);
}
return NS_ERROR_FAILURE;
}

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

@ -411,8 +411,12 @@ JSBool XPCDispConvert::COMArrayToJSArray(XPCCallContext& ccx,
}
else // This was maybe a VT_SAFEARRAY
{
#ifndef WINCE
if(FAILED(SafeArrayGetVartype(src.parray, &vartype)))
return JS_FALSE;
#else
return JS_FALSE;
#endif
}
jsval val = JSVAL_NULL;
AUTO_MARK_JSVAL(ccx, &val);

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

@ -64,16 +64,17 @@ ClassIsListed(HKEY hkeyRoot, const TCHAR *szKey, const CLSID &clsid, PRBool &lis
do {
USES_CONVERSION;
TCHAR szCLSID[64];
const DWORD kBufLength = sizeof(szCLSID) / sizeof(szCLSID[0]);
DWORD kBufLength = sizeof(szCLSID) / sizeof(szCLSID[0]);
DWORD len = kBufLength;
memset(szCLSID, 0, sizeof(szCLSID));
if(::RegEnumKey(keyList, i, szCLSID, kBufLength) != ERROR_SUCCESS)
if(::RegEnumKeyEx(keyList, i, szCLSID, &len, NULL, NULL, NULL, NULL) != ERROR_SUCCESS)
{
// End of list
break;
}
++i;
listIsEmpty = PR_FALSE;
szCLSID[kBufLength - 1] = TCHAR('\0');
szCLSID[len - 1] = TCHAR('\0');
CLSID clsidToCompare = GUID_NULL;
if(SUCCEEDED(::CLSIDFromString(T2OLE(szCLSID), &clsidToCompare)) &&
::IsEqualCLSID(clsid, clsidToCompare))
@ -113,6 +114,7 @@ ClassExists(const CLSID &clsid)
static PRBool
ClassImplementsCategory(const CLSID &clsid, const CATID &catid, PRBool &bClassExists)
{
#ifndef WINCE
bClassExists = ClassExists(clsid);
// Non existent classes won't implement any category...
if(!bClassExists)
@ -139,6 +141,7 @@ ClassImplementsCategory(const CLSID &clsid, const CATID &catid, PRBool &bClassEx
if(::IsEqualCATID(catid, catidNext))
return PR_TRUE; // Match
}
#endif
return PR_FALSE;
}

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

@ -132,7 +132,6 @@ import xpidl
import header
import os, re
import sys
import sets
# === Preliminaries
@ -485,10 +484,11 @@ def writeArgumentUnboxing(f, i, name, type, haveCcx, optional, rvdeclared):
else:
if not rvdeclared:
f.write(" nsresult rv;\n");
f.write(" nsCOMPtr<%s> %s;\n" % (type.name, name))
f.write(" %s *%s;\n" % (type.name, name))
f.write(" xpc_qsSelfRef %sref;\n" % name)
f.write(" rv = xpc_qsUnwrapArg<%s>("
"cx, %s, getter_AddRefs(%s));\n"
% (type.name, argVal, name))
"cx, %s, &%s, &%sref.ptr, %s);\n"
% (type.name, argVal, name, name, argPtr))
f.write(" if (NS_FAILED(rv)) {\n")
if isSetter:
f.write(" xpc_qsThrowBadSetterValue("
@ -708,7 +708,7 @@ def writeQuickStub(f, customMethodCalls, member, stubName, isSetter=False):
if isGetter:
pthisval = 'vp'
elif isSetter:
f.write(" xpc_qsTempRoot tvr(cx);\n")
f.write(" JSAutoTempValueRooter tvr(cx);\n")
pthisval = 'tvr.addr()'
else:
pthisval = '&vp[1]' # as above, ok to overwrite vp[1]
@ -915,7 +915,6 @@ traceableArgumentConversionTemplates = {
def writeTraceableArgumentConversion(f, member, i, name, type, haveCcx,
rvdeclared):
argVal = "_arg%d" % i
argPtr = "&" + argVal
params = {
'name': name,
@ -946,10 +945,11 @@ def writeTraceableArgumentConversion(f, member, i, name, type, haveCcx,
else:
if not rvdeclared:
f.write(" nsresult rv;\n");
f.write(" nsCOMPtr<%s> %s;\n" % (type.name, name))
f.write(" %s *%s;\n" % (type.name, name))
f.write(" xpc_qsSelfRef %sref;\n" % name)
f.write(" rv = xpc_qsUnwrapArg<%s>("
"cx, %s, getter_AddRefs(%s));\n"
% (type.name, argVal, name))
"cx, %s, &%s, &%sref.ptr, &vp.array[%d]);\n"
% (type.name, argVal, name, name, 1 + i))
f.write(" if (NS_FAILED(rv)) {\n")
if haveCcx:
f.write(" xpc_qsThrowBadArgWithCcx(ccx, rv, %d);\n" % i)
@ -1004,16 +1004,16 @@ def writeTraceableResultConv(f, type, paramNum):
elif isInterfaceType(type):
if isVariantType(type):
f.write(" JSBool ok = xpc_qsVariantToJsval(ccx, result, %d, "
"tvr.addr());\n" % paramNum)
"&vp.array[0]);\n" % paramNum)
else:
f.write(" AutoMarkingNativeInterfacePtr resultiface(ccx, "
"%s_Interface(ccx));\n" % type.name)
f.write(" JSBool ok = xpc_qsXPCOMObjectToJsval(ccx, result, "
"xpc_qsGetWrapperCache(result), resultiface, tvr.addr());"
"xpc_qsGetWrapperCache(result), resultiface, &vp.array[0]);"
"\n")
f.write(" if (!ok) {\n");
writeFailure(f, getTraceInfoDefaultReturn(type), 2)
f.write(" return *tvr.addr();\n")
f.write(" return vp.array[0];\n")
return
warn("Unable to convert result of type %s" % typeName)
@ -1055,13 +1055,13 @@ def writeTraceableQuickStub(f, customMethodCalls, member, stubName):
else:
f.write(" %s *self;\n" % customMethodCall['thisType'])
f.write(" xpc_qsSelfRef selfref;\n")
f.write(" xpc_qsTempRoot tvr(cx);\n")
f.write(" xpc_qsArgValArray<%d> vp(cx);\n" % (1 + len(member.params)))
if haveCcx:
f.write(" if (!xpc_qsUnwrapThisFromCcx(ccx, &self, &selfref.ptr, "
"tvr.addr())) {\n")
"&vp.array[0])) {\n")
else:
f.write(" if (!xpc_qsUnwrapThis(cx, obj, &self, &selfref.ptr, "
"tvr.addr())) {\n")
"&vp.array[0])) {\n")
writeFailure(f, getTraceInfoDefaultReturn(member.type), 2)
argNames = []
@ -1356,7 +1356,7 @@ def writeStubFile(filename, headerFilename, conf, interfaces):
make_targets.append(filename)
f = open(filename, 'w')
filesIncluded = sets.Set()
filesIncluded = set()
def includeType(type):
type = unaliasType(type)
@ -1397,7 +1397,7 @@ def writeStubFile(filename, headerFilename, conf, interfaces):
for iface in interfaces:
resulttypes.extend(writeIncludesForInterface(iface))
f.write("\n\n")
writeResultXPCInterfacesArray(f, conf, sets.ImmutableSet(resulttypes))
writeResultXPCInterfacesArray(f, conf, frozenset(resulttypes))
for iface in interfaces:
writeStubsForInterface(f, conf.customMethodCalls, iface)
writeDefiner(f, conf, interfaces)

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

@ -1129,6 +1129,13 @@ XPCConvert::NativeInterface2JSObject(XPCCallContext& ccx,
*d = slim;
return JS_TRUE;
}
// Even if ConstructSlimWrapper returns JS_FALSE it might
// have created a wrapper (while calling the PreCreate
// hook). In that case we need to fall through because we
// either have a slim wrapper that needs to be morphed or
// we have an XPCWrappedNative.
flat = cache->GetWrapper();
}
else if(!IS_WRAPPER_CLASS(STOBJ_GET_CLASS(flat)))
{

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

@ -135,6 +135,16 @@
#ifdef XPC_IDISPATCH_SUPPORT
// This goop was added because of EXCEPINFO in ThrowCOMError
// This include is here, because it needs to occur before the undefines below
#ifdef WINCE
/* atlbase.h on WINCE has a bug, in that it tries to use
* GetProcAddress with a wide string, when that is explicitly not
* supported. So we use C++ to overload that here, and implement
* something that works.
*/
#include <windows.h>
static FARPROC GetProcAddressA(HMODULE hMod, wchar_t *procName);
#endif /* WINCE */
#include <atlbase.h>
#include "oaidl.h"
// Nasty MS defines
@ -4157,6 +4167,27 @@ XPC_SOW_WrapObject(JSContext *cx, JSObject *parent, jsval v,
jsval *vp);
#ifdef XPC_IDISPATCH_SUPPORT
#ifdef WINCE
/* defined static near the top here */
FARPROC GetProcAddressA(HMODULE hMod, wchar_t *procName) {
FARPROC ret = NULL;
int len = wcslen(procName);
char *s = new char[len + 1];
for (int i = 0; i < len; i++) {
s[i] = (char) procName[i];
}
s[len-1] = 0;
ret = ::GetProcAddress(hMod, s);
delete [] s;
return ret;
}
#endif /* WINCE */
// IDispatch specific classes
#include "XPCDispPrivate.h"
#endif

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

@ -955,20 +955,36 @@ nsresult
xpc_qsUnwrapArgImpl(JSContext *cx,
jsval v,
const nsIID &iid,
void **ppArg)
void **ppArg,
nsISupports **ppArgRef,
jsval *vp)
{
// From XPCConvert::JSData2Native
if(JSVAL_IS_VOID(v) || JSVAL_IS_NULL(v))
{
*ppArg = nsnull;
*ppArgRef = nsnull;
return NS_OK;
}
if(!JSVAL_IS_OBJECT(v))
{
*ppArgRef = nsnull;
return ((JSVAL_IS_INT(v) && JSVAL_TO_INT(v) == 0)
? NS_ERROR_XPC_BAD_CONVERT_JS_ZERO_ISNOT_NULL
: NS_ERROR_XPC_BAD_CONVERT_JS);
}
JSObject *src = JSVAL_TO_OBJECT(v);
if(IS_SLIM_WRAPPER(src))
{
nsISupports *iface = static_cast<nsISupports*>(xpc_GetJSPrivate(src));
if(NS_FAILED(getNative(iface, GetOffsetsFromSlimWrapper(src),
src, iid, ppArg, ppArgRef, vp)))
return NS_ERROR_XPC_BAD_CONVERT_JS;
return NS_OK;
}
// From XPCConvert::JSObject2NativeInterface
XPCWrappedNative* wrappedNative =
XPCWrappedNative::GetWrappedNativeOfJSObject(cx, src);
@ -976,7 +992,8 @@ xpc_qsUnwrapArgImpl(JSContext *cx,
if(wrappedNative)
{
iface = wrappedNative->GetIdentityObject();
if(NS_FAILED(iface->QueryInterface(iid, ppArg)))
if(NS_FAILED(getNativeFromWrapper(wrappedNative, iid, ppArg, ppArgRef,
vp)))
return NS_ERROR_XPC_BAD_CONVERT_JS;
return NS_OK;
}
@ -987,7 +1004,10 @@ xpc_qsUnwrapArgImpl(JSContext *cx,
// This hack can be removed (or changed accordingly) when the
// DOM <-> E4X bindings are complete, see bug 270553
if(JS_TypeOfValue(cx, OBJECT_TO_JSVAL(src)) == JSTYPE_XML)
{
*ppArgRef = nsnull;
return NS_ERROR_XPC_BAD_CONVERT_JS;
}
// Does the JSObject have 'nsISupportness'?
// XXX hmm, I wonder if this matters anymore with no
@ -995,26 +1015,42 @@ xpc_qsUnwrapArgImpl(JSContext *cx,
if(XPCConvert::GetISupportsFromJSObject(src, &iface))
{
if(!iface || NS_FAILED(iface->QueryInterface(iid, ppArg)))
{
*ppArgRef = nsnull;
return NS_ERROR_XPC_BAD_CONVERT_JS;
}
*ppArgRef = static_cast<nsISupports*>(*ppArg);
return NS_OK;
}
// Create the ccx needed for quick stubs.
XPCCallContext ccx(JS_CALLER, cx);
if(!ccx.IsValid())
{
*ppArgRef = nsnull;
return NS_ERROR_XPC_BAD_CONVERT_JS;
}
nsXPCWrappedJS *wrapper;
nsresult rv =
nsXPCWrappedJS::GetNewOrUsed(ccx, src, iid, nsnull, &wrapper);
if(NS_FAILED(rv) || !wrapper)
{
*ppArgRef = nsnull;
return rv;
}
// We need to go through the QueryInterface logic to make this return
// the right thing for the various 'special' interfaces; e.g.
// nsIPropertyBag. We must use AggregatedQueryInterface in cases where
// there is an outer to avoid nasty recursion.
rv = wrapper->QueryInterface(iid, ppArg);
if(NS_SUCCEEDED(rv))
{
*ppArgRef = static_cast<nsISupports*>(*ppArg);
*vp = OBJECT_TO_JSVAL(wrapper->GetJSObject());
}
NS_RELEASE(wrapper);
return rv;
}

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

@ -289,25 +289,16 @@ struct xpc_qsSelfRef
nsISupports* ptr;
};
struct xpc_qsTempRoot
template<size_t N>
struct xpc_qsArgValArray
{
public:
explicit xpc_qsTempRoot(JSContext *cx)
: mContext(cx) {
JS_PUSH_SINGLE_TEMP_ROOT(cx, JSVAL_NULL, &mTvr);
xpc_qsArgValArray(JSContext *cx) : tvr(cx, N, array)
{
memset(array, 0, N * sizeof(jsval));
}
~xpc_qsTempRoot() {
JS_POP_TEMP_ROOT(mContext, &mTvr);
}
jsval * addr() {
return &mTvr.u.value;
}
private:
JSContext *mContext;
JSTempValueRooter mTvr;
JSAutoTempValueRooter tvr;
jsval array[N];
};
/**
@ -399,15 +390,17 @@ xpc_qsUnwrapThisFromCcx(XPCCallContext &ccx,
}
nsresult
xpc_qsUnwrapArgImpl(JSContext *cx, jsval v, const nsIID &iid, void **ppArg);
xpc_qsUnwrapArgImpl(JSContext *cx, jsval v, const nsIID &iid, void **ppArg,
nsISupports **ppArgRef, jsval *vp);
/** Convert a jsval to an XPCOM pointer. */
template <class T>
inline nsresult
xpc_qsUnwrapArg(JSContext *cx, jsval v, T **ppArg)
xpc_qsUnwrapArg(JSContext *cx, jsval v, T **ppArg, nsISupports **ppArgRef,
jsval *vp)
{
return xpc_qsUnwrapArgImpl(cx, v, NS_GET_TEMPLATE_IID(T),
reinterpret_cast<void **>(ppArg));
reinterpret_cast<void **>(ppArg), ppArgRef, vp);
}
inline nsWrapperCache*

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

@ -352,6 +352,7 @@ XPCThrower::ThrowCOMError(JSContext* cx, unsigned long COMErrorCode,
if(!nsXPCException::NameAndFormatForNSResult(rv, nsnull, &format))
format = "";
msg = format;
#ifndef WINCE
if(exception)
{
msg += static_cast<const char *>
@ -392,7 +393,13 @@ XPCThrower::ThrowCOMError(JSContext* cx, unsigned long COMErrorCode,
msg.AppendInt(static_cast<PRUint32>(COMErrorCode), 16);
}
}
#else
// No error object, so just report the result
msg += "COM Error Result = ";
msg.AppendInt(static_cast<PRUint32>(COMErrorCode), 16);
#endif
XPCThrower::BuildAndThrowException(cx, rv, msg.get());
}

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

@ -3787,6 +3787,16 @@ ConstructSlimWrapper(XPCCallContext &ccx, nsISupports *p, nsWrapperCache *cache,
}
}
// The PreCreate hook could have forced the creation of a wrapper, need
// to check for that here and return early.
JSObject* wrapper = cache->GetWrapper();
if(wrapper)
{
*rval = OBJECT_TO_JSVAL(wrapper);
return JS_TRUE;
}
AutoMarkingWrappedNativeProtoPtr xpcproto(ccx);
JSBool isGlobal = JS_FALSE;
xpcproto = XPCWrappedNativeProto::GetNewOrUsed(ccx, xpcScope, classInfo,
@ -3802,9 +3812,9 @@ ConstructSlimWrapper(XPCCallContext &ccx, nsISupports *p, nsWrapperCache *cache,
if(!jsclazz->addProperty)
return JS_FALSE;
JSObject* wrapper =
xpc_NewSystemInheritingJSObject(ccx, jsclazz,
xpcproto->GetJSProtoObject(), parent);
wrapper = xpc_NewSystemInheritingJSObject(ccx, jsclazz,
xpcproto->GetJSProtoObject(),
parent);
if(!JS_SetPrivate(ccx, wrapper, identityObj) ||
!JS_SetReservedSlot(ccx, wrapper, 0, PRIVATE_TO_JSVAL(xpcproto.get())))
return JS_FALSE;

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

@ -52,7 +52,6 @@
#include "nsICSSStyleSheet.h"
#include "nsICategoryManager.h"
#include "nsIComponentManager.h"
#include "nsIComputedDOMStyle.h"
#include "nsIContentIterator.h"
#include "nsIContentSerializer.h"
#include "nsIController.h"
@ -517,7 +516,6 @@ MAKE_CTOR(CreateXHTMLParanoidFragmentSink,nsIFragmentContentSink, NS_NewXHT
MAKE_CTOR(CreateSanitizingHTMLSerializer, nsIContentSerializer, NS_NewSanitizingHTMLSerializer)
MAKE_CTOR(CreateXBLService, nsIXBLService, NS_NewXBLService)
MAKE_CTOR(CreateContentPolicy, nsIContentPolicy, NS_NewContentPolicy)
MAKE_CTOR(CreateComputedDOMStyle, nsIComputedDOMStyle, NS_NewComputedDOMStyle)
#ifdef MOZ_XUL
MAKE_CTOR(CreateXULSortService, nsIXULSortService, NS_NewXULSortService)
// NS_NewXULContentBuilder
@ -1235,11 +1233,6 @@ static const nsModuleComponentInfo gComponents[] = {
RegisterNoDataProtocolContentPolicy,
UnregisterNoDataProtocolContentPolicy },
{ "DOM CSS Computed Style Declaration",
NS_COMPUTEDDOMSTYLE_CID,
"@mozilla.org/DOM/Level2/CSS/computedStyleDeclaration;1",
CreateComputedDOMStyle },
{ "XUL Controllers",
NS_XULCONTROLLERS_CID,
"@mozilla.org/xul/xul-controllers;1",

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

@ -0,0 +1,9 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
body { color: green }
</style>
</head>
<body>test</body>
</html>

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

@ -0,0 +1,19 @@
<!DOCTYPE HTML>
<html>
<head>
<style>
body { color: green }
</style>
<link rel="stylesheet"
href="data:text/css,@media no-such-medium { body { color: red } }"
type="text/css">
<link rel="stylesheet"
href="data:text/css,@media no-such-medium { body { color: red } }"
type="text/css">
<script>
// Force cloning of the second linked sheet
document.styleSheets[2].cssRules[0];
</script>
</head>
<body>test</body>
</html>

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

@ -1278,3 +1278,4 @@ fails-if(MOZ_WIDGET_TOOLKIT!="cocoa") == 488692-1.html 488692-1-ref.html # needs
== 502795-1.html 502795-1-ref.html
== 503364-1a.html 503364-1-ref.html
== 503364-1b.html 503364-1-ref.html
== 504032-1.html 504032-1-ref.html

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

@ -106,7 +106,6 @@ EXPORTS = \
nsICSSStyleRule.h \
nsICSSStyleRuleDOMWrapper.h \
nsICSSStyleSheet.h \
nsIComputedDOMStyle.h \
nsIHTMLCSSStyleSheet.h \
nsIInspectorCSSUtils.h \
nsIStyleRule.h \

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

@ -859,7 +859,7 @@ public:
virtual ~DOMCSSDeclarationImpl(void);
NS_IMETHOD GetParentRule(nsIDOMCSSRule **aParent);
virtual void DropReference(void);
void DropReference(void);
virtual nsresult GetCSSDeclaration(nsCSSDeclaration **aDecl,
PRBool aAllocate);
virtual nsresult GetCSSParsingEnvironment(nsIURI** aSheetURI,
@ -874,6 +874,11 @@ public:
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
virtual nsISupports *GetParentObject()
{
return nsnull;
}
friend class DOMCSSStyleRuleImpl;
protected:

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

@ -601,6 +601,7 @@ nsMediaList::Clone(nsMediaList** aResult)
return NS_ERROR_OUT_OF_MEMORY;
}
}
result->mIsEmpty = mIsEmpty;
NS_ADDREF(*aResult = result);
return NS_OK;
}

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

@ -77,6 +77,7 @@
#include "nsCSSKeywords.h"
#include "nsStyleCoord.h"
#include "nsDisplayList.h"
#include "nsDOMCSSDeclaration.h"
#if defined(DEBUG_bzbarsky) || defined(DEBUG_caillon)
#define DEBUG_ComputedDOMStyle
@ -90,27 +91,34 @@
static nsComputedDOMStyle *sCachedComputedDOMStyle;
nsresult
NS_NewComputedDOMStyle(nsIComputedDOMStyle** aComputedStyle)
NS_NewComputedDOMStyle(nsIDOMElement *aElement, const nsAString &aPseudoElt,
nsIPresShell *aPresShell,
nsComputedDOMStyle **aComputedStyle)
{
NS_ENSURE_ARG_POINTER(aComputedStyle);
nsRefPtr<nsComputedDOMStyle> computedStyle;
if (sCachedComputedDOMStyle) {
// There's an unused nsComputedDOMStyle cached, use it.
// But before we use it, re-initialize the object.
// Oh yeah baby, placement new!
*aComputedStyle = new (sCachedComputedDOMStyle) nsComputedDOMStyle();
computedStyle = new (sCachedComputedDOMStyle) nsComputedDOMStyle();
sCachedComputedDOMStyle = nsnull;
} else {
// No nsComputedDOMStyle cached, create a new one.
*aComputedStyle = new nsComputedDOMStyle();
NS_ENSURE_TRUE(*aComputedStyle, NS_ERROR_OUT_OF_MEMORY);
computedStyle = new nsComputedDOMStyle();
NS_ENSURE_TRUE(computedStyle, NS_ERROR_OUT_OF_MEMORY);
}
NS_ADDREF(*aComputedStyle);
nsresult rv = computedStyle->Init(aElement, aPseudoElt, aPresShell);
NS_ENSURE_SUCCESS(rv, rv);
*aComputedStyle = nsnull;
computedStyle.swap(*aComputedStyle);
return NS_OK;
}
@ -131,6 +139,7 @@ nsComputedDOMStyle::nsComputedDOMStyle()
nsComputedDOMStyle::~nsComputedDOMStyle()
{
ClearWrapper();
}
void
@ -146,19 +155,30 @@ nsComputedDOMStyle::Shutdown()
NS_IMPL_CYCLE_COLLECTION_CLASS(nsComputedDOMStyle)
NS_IMPL_CYCLE_COLLECTION_ROOT_BEGIN(nsComputedDOMStyle)
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_ROOT_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_0(nsComputedDOMStyle)
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsComputedDOMStyle)
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsComputedDOMStyle)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mContent)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
// QueryInterface implementation for nsComputedDOMStyle
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsComputedDOMStyle)
NS_INTERFACE_MAP_ENTRY(nsIComputedDOMStyle)
NS_INTERFACE_MAP_ENTRY(nsICSSDeclaration)
NS_INTERFACE_MAP_ENTRY(nsIDOMCSSStyleDeclaration)
NS_INTERFACE_TABLE_HEAD(nsComputedDOMStyle)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_OFFSET_AND_INTERFACE_TABLE_BEGIN(nsComputedDOMStyle)
NS_INTERFACE_TABLE_ENTRY(nsComputedDOMStyle, nsICSSDeclaration)
NS_INTERFACE_TABLE_ENTRY(nsComputedDOMStyle,
nsIDOMCSSStyleDeclaration)
NS_INTERFACE_TABLE_ENTRY(nsComputedDOMStyle, nsISupports)
NS_OFFSET_AND_INTERFACE_TABLE_END
NS_OFFSET_AND_INTERFACE_TABLE_TO_MAP_SEGUE
NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(nsComputedDOMStyle)
NS_INTERFACE_MAP_ENTRY_AGGREGATED(nsIDOMCSS2Properties, &mInner)
NS_INTERFACE_MAP_ENTRY_AGGREGATED(nsIDOMNSCSS2Properties, &mInner)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIComputedDOMStyle)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(ComputedCSSStyleDeclaration)
NS_INTERFACE_MAP_END

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

@ -41,7 +41,7 @@
#ifndef nsComputedDOMStyle_h__
#define nsComputedDOMStyle_h__
#include "nsIComputedDOMStyle.h"
#include "nsICSSDeclaration.h"
#include "nsROCSSPrimitiveValue.h"
#include "nsDOMCSSDeclaration.h"
@ -57,11 +57,12 @@
#include "nsAutoPtr.h"
#include "nsStyleStruct.h"
class nsComputedDOMStyle : public nsIComputedDOMStyle
class nsComputedDOMStyle : public nsICSSDeclaration,
public nsWrapperCache
{
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(nsComputedDOMStyle)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsComputedDOMStyle)
NS_IMETHOD Init(nsIDOMElement *aElement,
const nsAString& aPseudoElt,
@ -76,6 +77,11 @@ public:
static void Shutdown();
virtual nsISupports *GetParentObject()
{
return mContent;
}
private:
void AssertFlushedPendingReflows() {
NS_ASSERTION(mFlushedPendingReflows,
@ -448,5 +454,10 @@ private:
#endif
};
nsresult
NS_NewComputedDOMStyle(nsIDOMElement *aElement, const nsAString &aPseudoElt,
nsIPresShell *aPresShell,
nsComputedDOMStyle **aComputedStyle);
#endif /* nsComputedDOMStyle_h__ */

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

@ -52,14 +52,12 @@
#include "nsIPrincipal.h"
nsDOMCSSAttributeDeclaration::nsDOMCSSAttributeDeclaration(nsIContent *aContent)
: mContent(aContent)
{
MOZ_COUNT_CTOR(nsDOMCSSAttributeDeclaration);
// This reference is not reference-counted. The content
// object tells us when its about to go away.
NS_ASSERTION(aContent && aContent->IsNodeOfType(nsINode::eELEMENT),
"Inline style for non-element content?");
mContent = aContent;
}
nsDOMCSSAttributeDeclaration::~nsDOMCSSAttributeDeclaration()
@ -67,14 +65,32 @@ nsDOMCSSAttributeDeclaration::~nsDOMCSSAttributeDeclaration()
MOZ_COUNT_DTOR(nsDOMCSSAttributeDeclaration);
}
NS_IMPL_ADDREF(nsDOMCSSAttributeDeclaration)
NS_IMPL_RELEASE(nsDOMCSSAttributeDeclaration)
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMCSSAttributeDeclaration)
void
nsDOMCSSAttributeDeclaration::DropReference()
{
mContent = nsnull;
}
NS_IMPL_CYCLE_COLLECTION_ROOT_BEGIN(nsDOMCSSAttributeDeclaration)
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_ROOT_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDOMCSSAttributeDeclaration)
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mContent)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsDOMCSSAttributeDeclaration)
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDOMCSSAttributeDeclaration)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mContent)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_INTERFACE_MAP_BEGIN(nsDOMCSSAttributeDeclaration)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(nsDOMCSSAttributeDeclaration)
NS_IMPL_QUERY_TAIL_INHERITING(nsDOMCSSDeclaration)
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMCSSAttributeDeclaration)
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMCSSAttributeDeclaration)
nsresult
nsDOMCSSAttributeDeclaration::DeclarationChanged()

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

@ -40,26 +40,25 @@
#ifndef nsDOMCSSAttributeDeclaration_h___
#define nsDOMCSSAttributeDeclaration_h___
#include "nsIDOMCSSStyleDeclaration.h"
#include "nsDOMCSSDeclaration.h"
#include "nsString.h"
#include "nsWrapperCache.h"
#include "nsIContent.h"
class nsIContent;
class nsICSSLoader;
class nsICSSParser;
class nsDOMCSSAttributeDeclaration : public nsDOMCSSDeclaration
class nsDOMCSSAttributeDeclaration : public nsDOMCSSDeclaration,
public nsWrapperCache
{
public:
nsDOMCSSAttributeDeclaration(nsIContent *aContent);
~nsDOMCSSAttributeDeclaration();
// impl AddRef/Release; QI is implemented by our parent class
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMCSSAttributeDeclaration)
virtual void DropReference();
// If GetCSSDeclaration returns non-null, then the decl it returns
// is owned by our current style rule.
virtual nsresult GetCSSDeclaration(nsCSSDeclaration **aDecl,
@ -71,13 +70,15 @@ public:
nsICSSParser** aCSSParser);
NS_IMETHOD GetParentRule(nsIDOMCSSRule **aParent);
virtual nsISupports *GetParentObject()
{
return mContent;
}
protected:
virtual nsresult DeclarationChanged();
nsAutoRefCnt mRefCnt;
NS_DECL_OWNINGTHREAD
nsIContent *mContent;
nsCOMPtr<nsIContent> mContent;
};
#endif /* nsDOMCSSAttributeDeclaration_h___ */

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

@ -62,14 +62,15 @@ nsDOMCSSDeclaration::~nsDOMCSSDeclaration()
{
}
// QueryInterface implementation for nsDOMCSSDeclaration
NS_INTERFACE_MAP_BEGIN(nsDOMCSSDeclaration)
NS_INTERFACE_MAP_ENTRY(nsICSSDeclaration)
NS_INTERFACE_MAP_ENTRY(nsIDOMCSSStyleDeclaration)
NS_INTERFACE_TABLE_HEAD(nsDOMCSSDeclaration)
NS_OFFSET_AND_INTERFACE_TABLE_BEGIN(nsDOMCSSDeclaration)
NS_INTERFACE_TABLE_ENTRY(nsDOMCSSDeclaration, nsICSSDeclaration)
NS_INTERFACE_TABLE_ENTRY(nsDOMCSSDeclaration, nsIDOMCSSStyleDeclaration)
NS_INTERFACE_TABLE_ENTRY(nsDOMCSSDeclaration, nsISupports)
NS_OFFSET_AND_INTERFACE_TABLE_END
NS_OFFSET_AND_INTERFACE_TABLE_TO_MAP_SEGUE
NS_INTERFACE_MAP_ENTRY_AGGREGATED(nsIDOMCSS2Properties, &mInner)
NS_INTERFACE_MAP_ENTRY_AGGREGATED(nsIDOMNSCSS2Properties, &mInner)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMCSSStyleDeclaration)
NS_INTERFACE_MAP_ENTRY_CONTENT_CLASSINFO(CSSStyleDeclaration)
NS_INTERFACE_MAP_END

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

@ -93,7 +93,6 @@ public:
NS_IMETHOD Item(PRUint32 index, nsAString & _retval);
NS_IMETHOD GetParentRule(nsIDOMCSSRule * *aParentRule) = 0;
virtual void DropReference() = 0;
protected:
// Always fills in the out parameter, even on failure, and if the out
// parameter is null the nsresult will be the correct thing to

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

@ -84,6 +84,8 @@ public:
*/
NS_IMETHOD SetPropertyValue(const nsCSSProperty aPropID,
const nsAString& aValue) = 0;
virtual nsISupports *GetParentObject() = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsICSSDeclaration, NS_ICSSDECLARATION_IID)

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

@ -1212,23 +1212,32 @@ pref("font.minimum-size.x-unicode", 0);
pref("font.minimum-size.x-user-def", 0);
#ifdef XP_WIN
// On Windows CE, Arial sometimes isn't available;
// so we'll use Tahoma instead
#ifdef WINCE
#define WINDOWS_SANS_SERIF_FONT Tahoma
#else
#define WINDOWS_SANS_SERIF_FONT Arial
#endif
pref("font.name.serif.ar", "Times New Roman");
pref("font.name.sans-serif.ar", "Arial");
#expand pref("font.name.sans-serif.ar", "__WINDOWS_SANS_SERIF_FONT__");
pref("font.name.monospace.ar", "Courier New");
pref("font.name.cursive.ar", "Comic Sans MS");
pref("font.name.serif.el", "Times New Roman");
pref("font.name.sans-serif.el", "Arial");
#expand pref("font.name.sans-serif.el", "__WINDOWS_SANS_SERIF_FONT__");
pref("font.name.monospace.el", "Courier New");
pref("font.name.cursive.el", "Comic Sans MS");
pref("font.name.serif.he", "Narkisim");
pref("font.name.sans-serif.he", "Arial");
#expand pref("font.name.sans-serif.he", "__WINDOWS_SANS_SERIF_FONT__");
pref("font.name.monospace.he", "Fixed Miriam Transparent");
pref("font.name.cursive.he", "Guttman Yad");
pref("font.name-list.serif.he", "Narkisim, David");
pref("font.name-list.monospace.he", "Fixed Miriam Transparent, Miriam Fixed, Rod, Courier New");
pref("font.name-list.cursive.he", "Guttman Yad, Ktav, Arial");
#expand pref("font.name-list.cursive.he", "Guttman Yad, Ktav, __WINDOWS_SANS_SERIF_FONT__");
pref("font.name.serif.ja", " P明朝"); // "MS PMincho"
pref("font.name.sans-serif.ja", " Pゴシック"); // "MS PGothic"
@ -1253,32 +1262,32 @@ pref("font.name.monospace.th", "Tahoma");
pref("font.name.cursive.th", "Tahoma");
pref("font.name.serif.tr", "Times New Roman");
pref("font.name.sans-serif.tr", "Arial");
#expand pref("font.name.sans-serif.tr", "__WINDOWS_SANS_SERIF_FONT__");
pref("font.name.monospace.tr", "Courier New");
pref("font.name.cursive.tr", "Comic Sans MS");
pref("font.name.serif.x-baltic", "Times New Roman");
pref("font.name.sans-serif.x-baltic", "Arial");
#expand pref("font.name.sans-serif.x-baltic", "__WINDOWS_SANS_SERIF_FONT__");
pref("font.name.monospace.x-baltic", "Courier New");
pref("font.name.cursive.x-baltic", "Comic Sans MS");
pref("font.name.serif.x-central-euro", "Times New Roman");
pref("font.name.sans-serif.x-central-euro", "Arial");
#expand pref("font.name.sans-serif.x-central-euro", "__WINDOWS_SANS_SERIF_FONT__");
pref("font.name.monospace.x-central-euro", "Courier New");
pref("font.name.cursive.x-central-euro", "Comic Sans MS");
pref("font.name.serif.x-cyrillic", "Times New Roman");
pref("font.name.sans-serif.x-cyrillic", "Arial");
#expand pref("font.name.sans-serif.x-cyrillic", "__WINDOWS_SANS_SERIF_FONT__");
pref("font.name.monospace.x-cyrillic", "Courier New");
pref("font.name.cursive.x-cyrillic", "Comic Sans MS");
pref("font.name.serif.x-unicode", "Times New Roman");
pref("font.name.sans-serif.x-unicode", "Arial");
#expand pref("font.name.sans-serif.x-unicode", "__WINDOWS_SANS_SERIF_FONT__");
pref("font.name.monospace.x-unicode", "Courier New");
pref("font.name.cursive.x-unicode", "Comic Sans MS");
pref("font.name.serif.x-western", "Times New Roman");
pref("font.name.sans-serif.x-western", "Arial");
#expand pref("font.name.sans-serif.x-western", "__WINDOWS_SANS_SERIF_FONT__");
pref("font.name.monospace.x-western", "Courier New");
pref("font.name.cursive.x-western", "Comic Sans MS");
@ -1292,7 +1301,7 @@ pref("font.name-list.monospace.zh-CN", "MS Song, SimSun");
// Per Taiwanese users' demand. They don't want to use TC fonts for
// rendering Latin letters. (bug 88579)
pref("font.name.serif.zh-TW", "Times New Roman");
pref("font.name.sans-serif.zh-TW", "Arial");
#expand pref("font.name.sans-serif.zh-TW", "__WINDOWS_SANS_SERIF_FONT__");
pref("font.name.monospace.zh-TW", "細明體"); // MingLiU
pref("font.name-list.serif.zh-TW", "PMingLiu, MingLiU");
pref("font.name-list.sans-serif.zh-TW", "PMingLiU, MingLiU");
@ -1301,7 +1310,7 @@ pref("font.name-list.monospace.zh-TW", "MingLiU");
// hkscsm3u.ttf (HKSCS-2001) : http://www.microsoft.com/hk/hkscs
// Hong Kong users have the same demand about glyphs for Latin letters (bug 88579)
pref("font.name.serif.zh-HK", "Times New Roman");
pref("font.name.sans-serif.zh-HK", "Arial");
#expand pref("font.name.sans-serif.zh-HK", "__WINDOWS_SANS_SERIF_FONT__");
pref("font.name.monospace.zh-HK", "細明體_HKSCS");
pref("font.name-list.serif.zh-HK", "MingLiu_HKSCS, Ming(for ISO10646), MingLiU");
pref("font.name-list.sans-serif.zh-HK", "MingLiU_HKSCS, Ming(for ISO10646), MingLiU");
@ -2749,6 +2758,7 @@ pref("network.tcp.sendbuffer", 131072);
#ifdef WINCE
pref("mozilla.widget.disable-native-theme", true);
pref("gfx.color_management.mode", 0);
#endif
// Enable/Disable the geolocation API for content

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

@ -1912,13 +1912,6 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
return NPERR_NO_ERROR;
}
case NPNVserviceManager:
case NPNVDOMElement:
case NPNVDOMWindow: {
// we no longer hand out any XPCOM objects
return NPERR_GENERIC_ERROR;
}
case NPNVToolkit: {
#ifdef MOZ_WIDGET_GTK2
*((NPNToolkitType*)result) = NPNVGtk2;
@ -2000,6 +1993,41 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
}
#endif
// we no longer hand out any XPCOM objects, except on WINCE,
// where it's needed for the ActiveX shunt that makes Flash
// work until we get an NPAPI plugin there.
#ifdef WINCE
case NPNVDOMWindow: {
nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)npp->ndata;
NS_ENSURE_TRUE(inst, NPERR_GENERIC_ERROR);
nsIDOMWindow *domWindow = inst->GetDOMWindow().get();
if (domWindow) {
// Pass over ownership of domWindow to the caller.
(*(nsIDOMWindow**)result) = domWindow;
return NPERR_NO_ERROR;
}
return NPERR_GENERIC_ERROR;
}
case NPNVDOMElement: {
nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *) npp->ndata;
NS_ENSURE_TRUE(inst, NPERR_GENERIC_ERROR);
nsCOMPtr<nsIDOMElement> e;
inst->GetDOMElement(getter_AddRefs(e));
if (e) {
NS_ADDREF(*(nsIDOMElement**)result = e.get());
return NPERR_NO_ERROR;
}
return NPERR_GENERIC_ERROR;
}
#endif /* WINCE */
case NPNVserviceManager: // old XPCOM object, no longer supported
default:
return NPERR_GENERIC_ERROR;
}

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

@ -37,7 +37,6 @@
import codecs
import encodings.idna
import re
import sets
import sys
"""
@ -51,7 +50,7 @@ http://wiki.mozilla.org/Gecko:Effective_TLD_Service
def getEffectiveTLDs(path):
file = codecs.open(path, "r", "UTF-8")
domains = sets.Set()
domains = set()
while True:
line = file.readline()
# line always contains a line terminator unless the file is empty

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

@ -24,8 +24,6 @@ BROWSER_APP_FILES = \
default32.png \
default48.png \
mozicon128.png \
mozicon16.xpm \
mozicon50.xpm \
firefox.ico \
document.ico \
$(NULL)

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

@ -1,191 +0,0 @@
/* XPM */
static char * mozicon16_xpm[] = {
"16 16 172 2",
" c None",
". c #8B93A9",
"+ c #5E6882",
"@ c #666F89",
"# c #818C9B",
"$ c #9A9D91",
"% c #8D825A",
"& c #898179",
"* c #D57330",
"= c #D29C70",
"- c #6A7287",
"; c #845033",
"> c #D88533",
", c #6CB6DD",
"' c #6AAED8",
") c #4578A2",
"! c #65797D",
"~ c #F4DA6B",
"{ c #FFE26D",
"] c #A88459",
"^ c #DC7630",
"/ c #F0B476",
"( c #ED9029",
"_ c #E68127",
": c #ED9638",
"< c #4F89AF",
"[ c #69ACD4",
"} c #689DBC",
"| c #678A9C",
"1 c #9A8C64",
"2 c #FFDF68",
"3 c #B88D49",
"4 c #EBB47D",
"5 c #DC742A",
"6 c #EEAA64",
"7 c #7C5B3C",
"8 c #416989",
"9 c #4D91BA",
"0 c #7AB8D5",
"a c #6093B5",
"b c #417098",
"c c #8E8C71",
"d c #C0612B",
"e c #E56A17",
"f c #EE871E",
"g c #EAA472",
"h c #EAA576",
"i c #45586D",
"j c #3B769E",
"k c #57A6D1",
"l c #388CBF",
"m c #2B6E9B",
"n c #E9AC36",
"o c #DB9C40",
"p c #E36615",
"q c #ED8119",
"r c #EE8324",
"s c #FBA159",
"t c #8F6F5B",
"u c #1C527D",
"v c #256895",
"w c #2A9CCE",
"x c #3A9FCC",
"y c #226690",
"z c #226999",
"A c #C89638",
"B c #FFD85D",
"C c #EAA83A",
"D c #BC612E",
"E c #D16628",
"F c #504341",
"G c #1F476B",
"H c #256F9A",
"I c #0688C5",
"J c #174E78",
"K c #204D72",
"L c #B48135",
"M c #E9B244",
"N c #AB6049",
"O c #EC7A19",
"P c #D46B2C",
"Q c #7E5134",
"R c #254C6C",
"S c #B15F22",
"T c #7C543A",
"U c #1D5C89",
"V c #066EB1",
"W c #124470",
"X c #D59235",
"Y c #FFDB60",
"Z c #D79936",
"` c #8B5E64",
" . c #D14E14",
".. c #E87715",
"+. c #EE7E13",
"@. c #E07D2E",
"#. c #ED862D",
"$. c #EFA056",
"%. c #454958",
"&. c #0A528F",
"*. c #0A518A",
"=. c #474F4F",
"-. c #E1AD3C",
";. c #FFD648",
">. c #CA8734",
",. c #AA979E",
"'. c #944531",
"). c #E3660E",
"!. c #F0821D",
"~. c #984922",
"{. c #472F37",
"]. c #0D4577",
"^. c #176CA1",
"/. c #164168",
"(. c #D78933",
"_. c #FDCF48",
":. c #615C5E",
"<. c #A2685F",
"[. c #C54012",
"}. c #E36A0F",
"|. c #4A5762",
"1. c #804D37",
"2. c #FEA53D",
"3. c #FFCD62",
"4. c #83592C",
"5. c #C7C3C2",
"6. c #BA9B9A",
"7. c #96352B",
"8. c #C63509",
"9. c #D95810",
"0. c #E67115",
"a. c #F4992D",
"b. c #F5A22D",
"c. c #FBBE3C",
"d. c #C86F2D",
"e. c #746C71",
"f. c #986F75",
"g. c #7E1316",
"h. c #B91807",
"i. c #CF3C09",
"j. c #D5470E",
"k. c #DE5E14",
"l. c #E57121",
"m. c #E37A26",
"n. c #B36426",
"o. c #494453",
"p. c #C9C6C7",
"q. c #856D7C",
"r. c #572231",
"s. c #83080B",
"t. c #A70C07",
"u. c #A8100A",
"v. c #AA180C",
"w. c #AF2210",
"x. c #B41C0A",
"y. c #4B2623",
"z. c #484D62",
"A. c #B7B4B6",
"B. c #A69EA5",
"C. c #705D70",
"D. c #41324B",
"E. c #251A3C",
"F. c #1E193B",
"G. c #322846",
"H. c #43425C",
"I. c #8E8A96",
"J. c #B8B8BB",
"K. c #A4A2A7",
"L. c #96959D",
"M. c #9B9CA7",
"N. c #A0A1AA",
"O. c #ACAEB6",
" . + @ # $ % & ",
" * = - ; > , ' ) ! ~ { ] ",
" ^ / ( _ : ] < [ } | 1 { 2 3 ",
"4 5 ( ( ( 6 7 8 9 0 a b c { 2 ",
"d e ( ( f g h i j k k l m n 2 o ",
"d p q f r s t u v w x y z A B C ",
"D p q q E F G u H I y J K L B M ",
"N p O O P Q R S T U V W R X Y Z ",
"` ...+.r r @.#.$.%.&.*.=.-.;.>.",
",.'.).O !.+.~.{.].^./.F (.{ _.:.",
" <.[.}.r +.O F R |.1.2.B 3.4.5.",
" 6.7.8.9.0...O a.a.a.b.c.d.e. ",
" f.g.h.8.i.j.k.l.m._ n.o.p. ",
" q.r.s.t.u.v.w.x.y.z.A. ",
" B.C.D.E.F.G.H.I.J. ",
" K.L.M.N.O. "};

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

@ -1,299 +0,0 @@
/* XPM */
static char * default_xpm[] = {
"48 48 248 2",
" c None",
". c #7980B8",
"+ c #5269AA",
"@ c #133988",
"# c #155AA7",
"$ c #1181BC",
"% c #13508E",
"& c #2773AF",
"* c #6976B1",
"= c #146CAB",
"- c #1785C4",
"; c #35A7E4",
"> c #5988A8",
", c #1A639C",
"' c #618380",
") c #7F896D",
"! c #576768",
"~ c #414E6D",
"{ c #2882BB",
"] c #36A2DD",
"^ c #41AEE7",
"/ c #2D8FCF",
"( c #2A4D6F",
"_ c #DDC563",
": c #FDFA57",
"< c #F7CC2C",
"[ c #D0A634",
"} c #EEB88A",
"| c #E86918",
"1 c #40A3DD",
"2 c #296599",
"3 c #23568D",
"4 c #164778",
"5 c #16395A",
"6 c #072558",
"7 c #2C3B4D",
"8 c #9D8D2F",
"9 c #F8D801",
"0 c #FAE800",
"a c #F6B704",
"b c #FBD46D",
"c c #A5A5C9",
"d c #062C70",
"e c #061646",
"f c #0A2E62",
"g c #123D74",
"h c #6D6D6C",
"i c #A99269",
"j c #EDB16B",
"k c #BABCA3",
"l c #907241",
"m c #B27A1C",
"n c #F69B08",
"o c #F6A706",
"p c #F7A613",
"q c #E15707",
"r c #E58836",
"s c #AE99A3",
"t c #111A54",
"u c #05122B",
"v c #061538",
"w c #142646",
"x c #17334F",
"y c #4F4B50",
"z c #D28D3D",
"A c #F0AC4C",
"B c #756D57",
"C c #CEA753",
"D c #FDE55B",
"E c #FEFA7A",
"F c #F9E641",
"G c #F9C617",
"H c #FCD9A3",
"I c #E98B66",
"J c #D64804",
"K c #E17B25",
"L c #D86A27",
"M c #685049",
"N c #795B48",
"O c #635B5B",
"P c #E48529",
"Q c #E99737",
"R c #B8832E",
"S c #214357",
"T c #45402F",
"U c #CB8F1C",
"V c #FCF604",
"W c #F7C603",
"X c #FBE5B6",
"Y c #E36743",
"Z c #D63003",
"` c #E99C4C",
" . c #E17919",
".. c #172B5B",
"+. c #202A74",
"@. c #0D223C",
"#. c #7F5A1C",
"$. c #FDE56F",
"%. c #D15D41",
"&. c #B83404",
"*. c #D9782A",
"=. c #E27A06",
"-. c #277BC4",
";. c #624B23",
">. c #FBD659",
",. c #F1E084",
"'. c #DE7317",
"). c #E99725",
"!. c #F6B12B",
"~. c #EEA716",
"{. c #EB9515",
"]. c #E68714",
"^. c #CC590A",
"/. c #192963",
"(. c #66572F",
"_. c #E9A603",
":. c #AC320A",
"<. c #8D564E",
"[. c #4F6E8B",
"}. c #4A9DC9",
"|. c #FEFE92",
"1. c #D95708",
"2. c #4D2B18",
"3. c #E79209",
"4. c #FEFA86",
"5. c #FDE6A6",
"6. c #E6880C",
"7. c #DA6917",
"8. c #A4853C",
"9. c #D47350",
"0. c #CAAE8C",
"a. c #D1B76B",
"b. c #FCE424",
"c. c #F08F0D",
"d. c #FBEA3A",
"e. c #0B345A",
"f. c #836735",
"g. c #AB8B53",
"h. c #FEFD25",
"i. c #B9571B",
"j. c #C15822",
"k. c #B66F38",
"l. c #971703",
"m. c #532725",
"n. c #C09123",
"o. c #FEFD39",
"p. c #F9B517",
"q. c #FAC94B",
"r. c #A52504",
"s. c #38313D",
"t. c #9A8854",
"u. c #FEFC17",
"v. c #F9CA59",
"w. c #D35B23",
"x. c #B92707",
"y. c #113A6F",
"z. c #CC4621",
"A. c #BE4910",
"B. c #CD9750",
"C. c #C12A11",
"D. c #C8470A",
"E. c #C63605",
"F. c #A46F48",
"G. c #C97A36",
"H. c #89978D",
"I. c #0F3C75",
"J. c #A70209",
"K. c #D35615",
"L. c #E0650A",
"M. c #BC7036",
"N. c #0E3468",
"O. c #9A1124",
"P. c #25317F",
"Q. c #FCDB47",
"R. c #9B4967",
"S. c #D77707",
"T. c #CE5D15",
"U. c #A84515",
"V. c #342222",
"W. c #0A2543",
"X. c #A57736",
"Y. c #F9D515",
"Z. c #662817",
"`. c #040B26",
" + c #A06E32",
".+ c #C19471",
"++ c #970314",
"@+ c #D04911",
"#+ c #7E240E",
"$+ c #2D212E",
"%+ c #020935",
"&+ c #6C4538",
"*+ c #875F39",
"=+ c #FFFE6A",
"-+ c #883F67",
";+ c #291B1D",
">+ c #00071F",
",+ c #5C393C",
"'+ c #FEF2AE",
")+ c #FEFD4E",
"!+ c #CC9438",
"~+ c #B50501",
"{+ c #8B4B22",
"]+ c #7D4224",
"^+ c #FFFFC6",
"/+ c #BF9E8E",
"(+ c #762C5A",
"_+ c #C93B10",
":+ c #8B4E30",
"<+ c #543C54",
"[+ c #C66823",
"}+ c #D29A1D",
"|+ c #8E041A",
"1+ c #BC652C",
"2+ c #AE5B2C",
"3+ c #AF9393",
"4+ c #6E447E",
"5+ c #C11E00",
"6+ c #C32907",
"7+ c #FAE217",
"8+ c #650E41",
"9+ c #DF7931",
"0+ c #D86407",
"a+ c #7B0727",
"b+ c #DE9005",
"c+ c #DC8505",
"d+ c #EAB402",
"e+ c #EDC602",
"f+ c #A0776B",
"g+ c #B9140C",
"h+ c #C94617",
"i+ c #D04F22",
"j+ c #9C706E",
"k+ c #91697A",
"l+ c #850520",
"m+ c #79495B",
"n+ c #551D5F",
"o+ c #655191",
"p+ c #560D43",
"q+ c #81142A",
"r+ c #A81615",
"s+ c #A8371E",
"t+ c #8D362F",
"u+ c #632C4A",
"v+ c #563D7B",
"w+ c #453786",
"x+ c #471552",
"y+ c #3C185B",
" ",
" ",
" . + @ # # $ # % @ & * ",
" + @ = $ $ $ - ; ; $ = = = = = @ > ",
" + = $ $ $ $ $ $ ; ; ; - = # # , ' ) ! ~ ~ ",
" + % = = = = & & & { ] ^ ^ ; / = , % ( ! ) _ : < [ } ",
" | @ % % % % , , , , & & 1 ^ ^ ^ / & 2 3 4 5 6 6 7 8 9 0 a b ",
" | | } c d 6 e f g 4 4 h i j k & / ^ ^ ^ ^ { & 2 3 ( l m m n n o a a p ",
" q | r s t e u v w x y z A A i ( 3 / ^ ^ ^ 1 { & & & 2 ~ B C D E F G o n n H ",
" I J | K L M N y x 7 O P Q Q R x S & 1 ^ ^ { { & & & { 2 3 ( 5 T U < V V W n p X b ",
" Y Z J K j j j j j b ` .K Q y ..+./ ^ / & & { & { / ^ 1 & ( 5 w @.#.o 9 9 9 o A $. ",
" %.&.*.j A j A A Q Q K =. . .4 & -.] ^ -.-.& / ; ^ ^ ^ ^ / 3 3 ( ..w ;.n W W a n >.,. ",
" %.'.` ` A ).!.~.{.].=.=.'.^.y -.-.1 ^ ^ ] / ; ; ; ; ^ ^ 1 & 2 3 ( /.w (.n a _.o !.$. ",
" *.Q Q Q ~.~.{.{.].]. .'.'.^.:.<.[.> }.}.; ; ; ; ; ; ; ; ^ ^ { 3 { 2 3 S m n _.n !.|.X ",
" } P Q ~.{.{.{.].{.].]. . .'.1.:.J 1.q q 2.{ ] ; ; ; / ; ; ; ; 1 ] 1 1 { 2 S 3.n 3.n 4.5. ",
" Q ).).{.{.6.].].].K ]. .'.7.7.&.1.J q K i / ] ; ; ; ; ] / ] ] ] ] ] ] / & 8.m n !.o : $. ",
" Q ).].3.].].].].]. . .K '.K K 9.X X } 0.[.$ ] ] / ] ] { = , { / / / / / $ a.[ n $.a V b. ",
" j Q {.{.3.c.].].].]. . .'.| K K ` } j h 5 % - ; / $ { / / , , , { / / / / & i E c.$.d.0 9 ",
" Q ).].3.].].].].K . .'. .K K Q r I 7 e.% = / / - # , = { , , , , / / / -.3 f.E < $.D 9 W b ",
"j Q ).].{.].].].].]. . .'.K P Q Q A g.f @ = / / ; / = , & , , , , , & / -., @ f.h.G $.4.9 W !. ",
"` r ].{.{.6.].].].K .'. .P r Q ` A C @ # = - / / / = , , , , , , % { / { # % l 0 9 4.|.G a !. ",
"` ).].3.].6.].c. . . .K L i.j.j.k.C b % # $ -./ / / -., , , , , 3 % , { = , & R 9 W E |.< o !. ",
"j P ].3.].6.].K . .7.:.l.l.l.m.@.@.( @ # = -./ / / / / & , , 3 % % % % 4 ! & n.W G o.: p.n q. ",
"j K ].c.6.]. . . .'.r.l.l.l.r.s.f f f @ # = -.-./ -./ / 3 , , 3 % % % % 4 a.t.o o W V u.p.!.v. ",
"9.w.=.].]. . . . .7.l.l.r.r.x.N 4 @ @ # & -.-.-.-.{ -./ % 3 % % % @ % 4 y.C q.n n 9 0 V a >._ ",
"9.z.'. .K . .'.7.A.r.r.x.&.&. .O # # 2 & -.-.-.-.-.-.{ & % % 4 % 4 4 @ 4 B.E n n 9 9 0 p 4.j ",
" C.'.'. .K '.'.K D.:.&.&.E.E.7. .F.2 # # 2 h G.r A a.H.{ % 4 4 I.4 I.I., B.|.!.o W 9 9 q.|.j ",
" J.7. .'.'.'.'.'.K.E.E.D.J J L.'.K 7.M.M.'.K '.K r A ,.H.4 4 y.N.y.N.N.3 [ |.q.a a W G 4.$. ",
" O.K.'.'.L. .'.K '.D.Z J J q q '.'.K 7.'.'. . . .7.7.j g.I.y.f f 6 6 P.3 !.E Q.o < a >.|.>. ",
" R.z.w.'.S.'.'.'.| 7.q q q q q &.A.7.'.K '.L T.A.U.V.u W.e.N.6 t e w X.O Y.h.G n v.p.4.|.C ",
" x.L L.'.'.'.'. .7. .q q L.q K.l.l.l.r.r.:.:.Z.`.`.u e t t e e e + + +9 V W n b D 4.4..+ ",
" ++L @+'.'.S.'. .'.'.'.L.L.L.L.D.l.l.r.#+Z.$+@.u %+v e e e %+e &+6.*+n 9 9 a q.4.: =+Q. ",
" -+z.E. .'.'.S.L.'. .L. .7.'.L. .i.;+>+>+u w /.%+%+e e %+%+%+,+ .].c.a W W o '+)+o.)+!+ ",
" J.~+7.'.'.'.'.'.'.S.L. .L.'. .7. .{+v %+/.t %+%+%+%+%+%+]+| L .c._._._.v.^+V u.b./+ ",
" (+~+_+K 1.'.'. .'.'.S.'.'.S.L. .'.'.'.:+<+P.+.t %+%+m.[+'.'.'.'.6.3.3.~.|.4.V V }+ ",
" |+~+@+7.7.'.K '.'.'.'.'.'.S.=.L.'.'.'.'.'.1+2+[+ . .'.'. . .'.=.=.=.d.E d.0 9 3+ ",
" 4+~+5+K.6+7.K P 7. .'.'.'.'.'.'.'.'.'.'. .'.'.7.K 7.K 7. .7.L.L.S.7+o.: 9 9 R ",
" 8+~+5+J 5+K.9+K C.1.'. . .'.'.L.'. .K K P r r r r r K 7.q 0+S.9 V h.Y.9 _. ",
" a+~+6+Z ~+6+r 9+~+E.7.K K 7.K. .'.K K K K K K '.'.'.0+0+b+9 0 V V W a 3+ ",
" ++~+E.6+~+~+z.r C.~+_+w.P 9+K.@+K.7.'.'. . .'.7.0+c+_.d+e+0 0 e+_.f+ ",
" ++~+6+5+~+~+g+z.g+g+g+C.h+%.r L i+@+@+T.T.0+S.c+b+_.d+e+e+e+3.j+ ",
" a+~+~+~+~+~+~+g+g+g+g+g+g+g+_+h+w._+D.^.^.0+S.c+b+d+d+_.'.k+ ",
" 8+J.~+~+~+~+g+g+g+g+g+g+g+g+C.6+&.D.D.^.0+S.S.b+3.].2+ ",
" l+~+~+~+g+~+g+g+g+g+g+g+C.C.6+_+D.D.^.0+S.S.[+m+ ",
" n+a+~+g+g+g+g+g+g+g+g+g+C.6+E._+D.^.0+2+m+ ",
" o+p+q+r+g+g+g+g+g+g+x.C.E.s+t+u+v+ ",
" w+x+x+x+x+x+x+y+w+ ",
" "};

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

@ -46,7 +46,8 @@ sync:: clean \
cd htmlparser ; make sync ; cd ..
translate:: \
; java -jar translator.jar htmlparser/src .. ../nsHtml5AtomList.h
; mkdir -p ../javasrc ; \
java -jar translator.jar htmlparser/src .. ../nsHtml5AtomList.h
clean:: \
; cd javaparser ; make clean ; cd .. ; \

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

@ -39,6 +39,4 @@
SVN_BASE=http://svn.versiondude.net/whattf/htmlparser/trunk
sync:: \
; rm -rf src && \
svn co $(SVN_BASE)/src/nu/validator/htmlparser/impl src && \
find src -name .svn | xargs rm -rf
; ../sync-src.sh $(SVN_BASE)/src/nu/validator/htmlparser/impl

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

@ -45,15 +45,8 @@ libs:: \
jar cf javaparser.jar -C bin .
sync:: \
; rm -rf src && \
svn co $(SVN_BASE)/src && \
find src -name .svn | xargs rm -rf ; \
\
for file in COPYING COPYING.LESSER readme.txt ; \
do \
rm -f $$file ; \
svn cat $(SVN_BASE)/$$file > $$file ; \
done
; ../sync-src.sh $(SVN_BASE)/src && \
../sync-files.sh $(SVN_BASE) COPYING COPYING.LESSER readme.txt
clean:: \
; rm -rf bin javaparser.jar

18
parser/html/java/sync-files.sh Executable file
Просмотреть файл

@ -0,0 +1,18 @@
#!/usr/bin/env sh
if [ $# -gt 1 ]
then
REPO_BASE_URI=$1
shift
else
echo
echo "Usage: sh $0 http://path/to/source [file ...]"
echo
exit 1
fi
for file in $@
do
rm -f $file
svn cat $REPO_BASE_URI/$file > `basename $file`
done

27
parser/html/java/sync-src.sh Executable file
Просмотреть файл

@ -0,0 +1,27 @@
#!/usr/bin/env sh
if [ $# -eq 1 ]
then
REPO_URI=$1
else
echo
echo "Usage: sh $0 http://path/to/source"
echo
exit 1
fi
check_out() {
svn co $REPO_URI src-svn && \
find src-svn -name .svn | xargs rm -rf
}
copy_over() {
mkdir -p src && \
cp -r src-svn/* src/
}
clean_up() {
rm -rf src-svn
}
check_out && copy_over && clean_up

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

@ -45,15 +45,8 @@ libs:: \
jar cfm translator.jar manifest.txt -C bin .
sync:: \
; rm -rf src && \
svn co $(SVN_BASE)/translator-src src && \
find src -name .svn | xargs rm -rf ; \
\
for file in LICENSE.txt README.txt ; \
do \
rm -f $$file ; \
svn cat $(SVN_BASE)/$$file > $$file ; \
done
; ../sync-src.sh $(SVN_BASE)/translator-src && \
../sync-files.sh $(SVN_BASE) LICENSE.txt README.txt
clean:: \
; rm -rf bin translator.jar

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

@ -1 +0,0 @@
java/htmlparser/src

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