Merging mozilla-central once more to hopefully clear windows unit tests

This commit is contained in:
Ben Turner 2009-09-20 10:47:21 -07:00
commit 66a36315ce
107 changed files with 744 additions and 772 deletions

View File

@ -203,9 +203,8 @@ public:
/** /**
* Set accessible parent. * Set accessible parent.
* XXX: shouldn't be virtual, bug 496783
*/ */
virtual void SetParent(nsIAccessible *aParent); void SetParent(nsIAccessible *aParent);
/** /**
* Set first accessible child. * Set first accessible child.

View File

@ -232,9 +232,10 @@ nsresult
nsHTMLLIAccessible::Shutdown() nsHTMLLIAccessible::Shutdown()
{ {
if (mBulletAccessible) { if (mBulletAccessible) {
// Ensure that weak pointer to this is nulled out // Ensure that pointer to this is nulled out.
mBulletAccessible->Shutdown(); mBulletAccessible->Shutdown();
} }
nsresult rv = nsLinkableAccessible::Shutdown(); nsresult rv = nsLinkableAccessible::Shutdown();
mBulletAccessible = nsnull; mBulletAccessible = nsnull;
return rv; return rv;
@ -283,7 +284,7 @@ void nsHTMLLIAccessible::CacheChildren()
if (mBulletAccessible) { if (mBulletAccessible) {
mBulletAccessible->SetNextSibling(mFirstChild); mBulletAccessible->SetNextSibling(mFirstChild);
mBulletAccessible->SetParent(this); // Set weak parent; mBulletAccessible->SetParent(this);
SetFirstChild(mBulletAccessible); SetFirstChild(mBulletAccessible);
++ mAccChildCount; ++ mAccChildCount;
} }
@ -294,8 +295,7 @@ void nsHTMLLIAccessible::CacheChildren()
nsHTMLListBulletAccessible:: nsHTMLListBulletAccessible::
nsHTMLListBulletAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell, nsHTMLListBulletAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell,
const nsAString& aBulletText) : const nsAString& aBulletText) :
nsLeafAccessible(aDomNode, aShell), mWeakParent(nsnull), nsLeafAccessible(aDomNode, aShell), mBulletText(aBulletText)
mBulletText(aBulletText)
{ {
mBulletText += ' '; // Otherwise bullets are jammed up against list text mBulletText += ' '; // Otherwise bullets are jammed up against list text
} }
@ -312,8 +312,6 @@ nsresult
nsHTMLListBulletAccessible::Shutdown() nsHTMLListBulletAccessible::Shutdown()
{ {
mBulletText.Truncate(); mBulletText.Truncate();
mWeakParent = nsnull;
return nsLeafAccessible::Shutdown(); return nsLeafAccessible::Shutdown();
} }
@ -343,17 +341,12 @@ nsHTMLListBulletAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraS
return NS_OK; return NS_OK;
} }
void
nsHTMLListBulletAccessible::SetParent(nsIAccessible *aParent)
{
mParent = nsnull;
mWeakParent = aParent;
}
NS_IMETHODIMP NS_IMETHODIMP
nsHTMLListBulletAccessible::GetParent(nsIAccessible **aParentAccessible) nsHTMLListBulletAccessible::GetParent(nsIAccessible **aParent)
{ {
NS_IF_ADDREF(*aParentAccessible = mWeakParent); NS_ENSURE_ARG_POINTER(aParent);
NS_IF_ADDREF(*aParent = mParent);
return NS_OK; return NS_OK;
} }

View File

@ -109,11 +109,7 @@ public:
// nsIAccessible // nsIAccessible
NS_IMETHOD GetName(nsAString& aName); NS_IMETHOD GetName(nsAString& aName);
NS_IMETHOD GetParent(nsIAccessible **aParent);
// Don't cache via unique ID -- bullet accessible shares the same dom node as
// this LI accessible. Also, don't cache via mParent/SetParent(), prevent
// circular reference since li holds onto us.
NS_IMETHOD GetParent(nsIAccessible **aParentAccessible);
// nsAccessNode // nsAccessNode
virtual nsresult Shutdown(); virtual nsresult Shutdown();
@ -121,7 +117,6 @@ public:
// nsAccessible // nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole); virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState); virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
virtual void SetParent(nsIAccessible *aParent);
virtual nsresult AppendTextTo(nsAString& aText, PRUint32 aStartOffset, virtual nsresult AppendTextTo(nsAString& aText, PRUint32 aStartOffset,
PRUint32 aLength); PRUint32 aLength);
@ -132,7 +127,6 @@ protected:
// nsIAnonymousFrame::GetText() ? However, in practice storing the bullet text // nsIAnonymousFrame::GetText() ? However, in practice storing the bullet text
// here should not be a problem if we invalidate the right parts of // here should not be a problem if we invalidate the right parts of
// the accessibility cache when mutation events occur. // the accessibility cache when mutation events occur.
nsIAccessible *mWeakParent;
nsString mBulletText; nsString mBulletText;
}; };

View File

@ -68,7 +68,6 @@ _TEST_FILES =\
states.js \ states.js \
table.js \ table.js \
value.js \ value.js \
test_accessnode_invalidation.html \
test_actions.xul \ test_actions.xul \
test_actions_anchors.html \ test_actions_anchors.html \
test_actions_aria.html \ test_actions_aria.html \
@ -103,6 +102,8 @@ _TEST_FILES =\
test_events_valuechange.html \ test_events_valuechange.html \
test_groupattrs.xul \ test_groupattrs.xul \
test_groupattrs.html \ test_groupattrs.html \
test_invalidate_accessnode.html \
test_invalidate_elmli.html \
test_name.html \ test_name.html \
test_name.xul \ test_name.xul \
test_name_button.html \ test_name_button.html \

View File

@ -34,7 +34,17 @@ function waitForEvent(aEventType, aTarget, aFunc, aContext, aArg1, aArg2)
{ {
var handler = { var handler = {
handleEvent: function handleEvent(aEvent) { handleEvent: function handleEvent(aEvent) {
if (!aTarget || aTarget == aEvent.DOMNode) {
if (aTarget) {
if (aTarget instanceof nsIAccessible &&
aTarget != aEvent.accessible)
return;
if (aTarget instanceof nsIDOMNode &&
aTarget != aEvent.DOMNode)
return;
}
unregisterA11yEventListener(aEventType, this); unregisterA11yEventListener(aEventType, this);
window.setTimeout( window.setTimeout(
@ -45,7 +55,6 @@ function waitForEvent(aEventType, aTarget, aFunc, aContext, aArg1, aArg2)
0 0
); );
} }
}
}; };
registerA11yEventListener(aEventType, handler); registerA11yEventListener(aEventType, handler);
@ -91,6 +100,12 @@ function unregisterA11yEventListener(aEventType, aEventHandler)
*/ */
const INVOKER_ACTION_FAILED = 1; const INVOKER_ACTION_FAILED = 1;
/**
* Return value of eventQueue.onFinish. Indicates eventQueue should not finish
* tests.
*/
const DO_NOT_FINISH_TEST = 1;
/** /**
* Common invoker checker (see eventSeq of eventQueue). * Common invoker checker (see eventSeq of eventQueue).
*/ */
@ -145,7 +160,7 @@ function invokerChecker(aEventType, aTarget)
* getID: function(){} // returns invoker ID * getID: function(){} // returns invoker ID
* }; * };
* *
* @param aEventType [optional] the default event type (isn't used if * @param aEventType [in, optional] the default event type (isn't used if
* invoker defines eventSeq property). * invoker defines eventSeq property).
*/ */
function eventQueue(aEventType) function eventQueue(aEventType)
@ -240,8 +255,10 @@ function eventQueue(aEventType)
gA11yEventApplicantsCount--; gA11yEventApplicantsCount--;
listenA11yEvents(false); listenA11yEvents(false);
this.onFinish(); var res = this.onFinish();
if (res != DO_NOT_FINISH_TEST)
SimpleTest.finish(); SimpleTest.finish();
return; return;
} }
@ -521,6 +538,54 @@ function eventQueue(aEventType)
this.mEventSeqIdx = -1; this.mEventSeqIdx = -1;
} }
/**
* Deal with action sequence. Used when you need to execute couple of actions
* each after other one.
*/
function sequence()
{
/**
* Append new sequence item.
*
* @param aProcessor [in] object implementing interface
* {
* // execute item action
* process: function() {},
* // callback, is called when item was processed
* onProcessed: function() {}
* };
* @param aEventType [in] event type of expected event on item action
* @param aTarget [in] event target of expected event on item action
* @param aItemID [in] identifier of item
*/
this.append = function sequence_append(aProcessor, aEventType, aTarget,
aItemID)
{
var item = new sequenceItem(aProcessor, aEventType, aTarget, aItemID);
this.items.push(item);
}
/**
* Process next sequence item.
*/
this.processNext = function sequence_processNext()
{
this.idx++;
if (this.idx >= this.items.length) {
ok(false, "End of sequence: nothing to process!");
SimpleTest.finish();
return;
}
this.items[this.idx].startProcess();
}
this.items = new Array();
this.idx = -1;
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Private implementation details. // Private implementation details.
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -637,3 +702,42 @@ function dumpInfoToDOM(aInfo, aDumpNode)
container.textContent = aInfo; container.textContent = aInfo;
dumpElm.appendChild(container); dumpElm.appendChild(container);
} }
////////////////////////////////////////////////////////////////////////////////
// Sequence
/**
* Base class of sequence item.
*/
function sequenceItem(aProcessor, aEventType, aTarget, aItemID)
{
// private
this.startProcess = function sequenceItem_startProcess()
{
this.queue.invoke();
}
var item = this;
this.queue = new eventQueue();
this.queue.onFinish = function()
{
aProcessor.onProcessed();
return DO_NOT_FINISH_TEST;
}
var invoker = {
invoke: function invoker_invoke() {
return aProcessor.process();
},
getID: function invoker_getID()
{
return aItemID;
},
eventSeq: [ new invokerChecker(aEventType, aTarget) ]
};
this.queue.push(invoker);
}

View File

@ -38,6 +38,7 @@ const ROLE_ROW = nsIAccessibleRole.ROLE_ROW;
const ROLE_ROWHEADER = nsIAccessibleRole.ROLE_ROWHEADER; const ROLE_ROWHEADER = nsIAccessibleRole.ROLE_ROWHEADER;
const ROLE_SECTION = nsIAccessibleRole.ROLE_SECTION; const ROLE_SECTION = nsIAccessibleRole.ROLE_SECTION;
const ROLE_SLIDER = nsIAccessibleRole.ROLE_SLIDER; const ROLE_SLIDER = nsIAccessibleRole.ROLE_SLIDER;
const ROLE_STATICTEXT = nsIAccessibleRole.ROLE_STATICTEXT;
const ROLE_TABLE = nsIAccessibleRole.ROLE_TABLE; const ROLE_TABLE = nsIAccessibleRole.ROLE_TABLE;
const ROLE_TEXT_CONTAINER = nsIAccessibleRole.ROLE_TEXT_CONTAINER; const ROLE_TEXT_CONTAINER = nsIAccessibleRole.ROLE_TEXT_CONTAINER;
const ROLE_TEXT_LEAF = nsIAccessibleRole.ROLE_TEXT_LEAF; const ROLE_TEXT_LEAF = nsIAccessibleRole.ROLE_TEXT_LEAF;

View File

@ -0,0 +1,168 @@
<!DOCTYPE html>
<html>
<head>
<title>Test HTML li and listitem bullet accessible cache</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/role.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/events.js"></script>
<script type="application/javascript">
////////////////////////////////////////////////////////////////////////////
// Helpers
function testDefunctAccessible(aAcc, aNodeOrId)
{
if (aNodeOrId)
ok(!isAccessible(aNodeOrId),
"Accessible for " + aNodeOrId + " wasn't properly shut down!");
ok(!aAcc.firstChild, "There is first child for shut down accessible!");
ok(!aAcc.lastChild, "There is last child for shut down accessible!");
ok(!aAcc.children.length, "There are children for shut down accessible!");
// nextSibling
var success = false;
try {
aAcc.nextSibling;
} catch (e) {
success = (e.result == Components.results.NS_ERROR_FAILURE);
}
ok(success, "There is next sibling for shut down accessible!");
// previousSibling
var success = false;
try {
aAcc.previousSibling;
} catch (e) {
success = (e.result == Components.results.NS_ERROR_FAILURE);
}
ok(success, "There is previous sibling for shut down accessible!");
// parent
var success = false;
try {
aAcc.parent;
} catch (e) {
success = (e.result == Components.results.NS_ERROR_FAILURE);
}
ok(success, "There is parent for shut down accessible!");
}
function testLiAccessibleTree()
{
// Test accessible tree.
var accTree = {
role: ROLE_LISTITEM,
children: [
{
role: ROLE_STATICTEXT,
children: []
},
{
role: ROLE_TEXT_LEAF,
children: []
}
]
};
testAccessibleTree("li", accTree);
}
////////////////////////////////////////////////////////////////////////////
// Sequence item processors
function hideProcessor()
{
this.liNode = getNode("li");
this.li = getAccessible(this.liNode);
this.bullet = this.li.firstChild;
this.process = function hideProcessor_process()
{
this.liNode.style.display = "none";
}
this.onProcessed = function hideProcessor_onProcessed()
{
window.setTimeout(
function(aArg1, aArg2)
{
testDefunctAccessible(aArg1, aArg2);
gSequence.processNext();
},
0, this.li, this.liNode
);
}
};
function showProcessor()
{
this.liNode = getNode("li");
this.process = function showProcessor_process()
{
this.liNode.style.display = "list-item";
}
this.onProcessed = function showProcessor_onProcessed()
{
testLiAccessibleTree();
SimpleTest.finish();
}
};
////////////////////////////////////////////////////////////////////////////
// Test
var gSequence = null;
function doTest()
{
testLiAccessibleTree();
gSequence = new sequence();
gSequence.append(new hideProcessor(), EVENT_HIDE, getAccessible("li"),
"hide HTML li");
gSequence.append(new showProcessor(), EVENT_SHOW, getNode("li"),
"show HTML li");
gSequence.processNext(); // SimpleTest.finish() will be called in the end
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
</script>
</head>
<body>
<a target="_blank"
title="setParent shouldn't be virtual"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=496783">Mozilla Bug 496783</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<ul>
<li id="li">item1</li>
</ul>
</body>
</html>

View File

@ -105,14 +105,14 @@ STATIC_COMPONENTS_LINKER_PATH = -L$(DEPTH)/staticlib
endif endif
LIBS += $(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX) LIBS += $(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
else else
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
LIBS += $(DIST)/bin/XUL LIBS += $(DIST)/bin/XUL
else else
EXTRA_DSO_LIBS += xul EXTRA_DSO_LIBS += xul
endif endif
endif endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
TK_LIBS := $(TK_LIBS) TK_LIBS := $(TK_LIBS)
endif endif
@ -308,7 +308,7 @@ libs:: $(srcdir)/profile/prefs.js
libs:: $(srcdir)/blocklist.xml libs:: $(srcdir)/blocklist.xml
$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin $(INSTALL) $(IFLAGS1) $^ $(DIST)/bin
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
APP_NAME = $(MOZ_APP_DISPLAYNAME) APP_NAME = $(MOZ_APP_DISPLAYNAME)

View File

@ -68,7 +68,7 @@ DEFINES += \
-DPRE_RELEASE_SUFFIX="$(PRE_RELEASE_SUFFIX)" \ -DPRE_RELEASE_SUFFIX="$(PRE_RELEASE_SUFFIX)" \
$(NULL) $(NULL)
ifneq (,$(filter windows gtk2 mac cocoa, $(MOZ_WIDGET_TOOLKIT))) ifneq (,$(filter windows gtk2 cocoa, $(MOZ_WIDGET_TOOLKIT)))
DEFINES += -DHAVE_SHELL_SERVICE=1 DEFINES += -DHAVE_SHELL_SERVICE=1
endif endif
@ -76,7 +76,7 @@ ifdef MOZ_UPDATER
DEFINES += -DMOZ_UPDATER=1 DEFINES += -DMOZ_UPDATER=1
endif endif
ifneq (,$(filter windows mac cocoa gtk2, $(MOZ_WIDGET_TOOLKIT))) ifneq (,$(filter windows cocoa gtk2, $(MOZ_WIDGET_TOOLKIT)))
ifneq ($(OS_ARCH),WINCE) ifneq ($(OS_ARCH),WINCE)
DEFINES += -DCONTEXT_COPY_IMAGE_CONTENTS=1 DEFINES += -DCONTEXT_COPY_IMAGE_CONTENTS=1
endif endif

View File

@ -450,7 +450,7 @@ var PlacesCommandHook = {
* Adds a bookmark to the page loaded in the current tab. * Adds a bookmark to the page loaded in the current tab.
*/ */
bookmarkCurrentPage: function PCH_bookmarkCurrentPage(aShowEditUI, aParent) { bookmarkCurrentPage: function PCH_bookmarkCurrentPage(aShowEditUI, aParent) {
this.bookmarkPage(getBrowser().selectedBrowser, aParent, aShowEditUI); this.bookmarkPage(gBrowser.selectedBrowser, aParent, aShowEditUI);
}, },
/** /**
@ -484,19 +484,18 @@ var PlacesCommandHook = {
*/ */
_getUniqueTabInfo: function BATC__getUniqueTabInfo() { _getUniqueTabInfo: function BATC__getUniqueTabInfo() {
var tabList = []; var tabList = [];
var seenURIs = []; var seenURIs = {};
var browsers = getBrowser().browsers; var browsers = gBrowser.browsers;
for (var i = 0; i < browsers.length; ++i) { for (var i = 0; i < browsers.length; ++i) {
var webNav = browsers[i].webNavigation; let uri = browsers[i].currentURI;
var uri = webNav.currentURI;
// skip redundant entries // skip redundant entries
if (uri.spec in seenURIs) if (uri.spec in seenURIs)
continue; continue;
// add to the set of seen URIs // add to the set of seen URIs
seenURIs[uri.spec] = true; seenURIs[uri.spec] = null;
tabList.push(uri); tabList.push(uri);
} }
return tabList; return tabList;
@ -1166,7 +1165,7 @@ var PlacesStarButton = {
if (!starIcon) if (!starIcon)
return; return;
var uri = getBrowser().currentURI; var uri = gBrowser.currentURI;
this._starred = uri && (PlacesUtils.getMostRecentBookmarkForURI(uri) != -1 || this._starred = uri && (PlacesUtils.getMostRecentBookmarkForURI(uri) != -1 ||
PlacesUtils.getMostRecentFolderForFeedURI(uri) != -1); PlacesUtils.getMostRecentFolderForFeedURI(uri) != -1);
if (this._starred) { if (this._starred) {

View File

@ -873,10 +873,17 @@ function makePreview(row)
if (!mimeType) if (!mimeType)
mimeType = getContentTypeFromHeaders(cacheEntryDescriptor); mimeType = getContentTypeFromHeaders(cacheEntryDescriptor);
// if we have a data url, get the MIME type from the url
if (!mimeType && /^data:/.test(url)) {
let dataMimeType = /^data:(image\/[^;,]+)/i.exec(url);
if (dataMimeType)
mimeType = dataMimeType[1].toLowerCase();
}
var imageType; var imageType;
if (mimeType) { if (mimeType) {
// We found the type, try to display it nicely // We found the type, try to display it nicely
var imageMimeType = /^image\/(.*)/.exec(mimeType); let imageMimeType = /^image\/(.*)/i.exec(mimeType);
if (imageMimeType) { if (imageMimeType) {
imageType = imageMimeType[1].toUpperCase(); imageType = imageMimeType[1].toUpperCase();
if (numFrames > 1) if (numFrames > 1)

View File

@ -140,7 +140,7 @@ _BROWSER_FILES = \
browser_relatedTabs.js \ browser_relatedTabs.js \
$(NULL) $(NULL)
ifeq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
_BROWSER_FILES += browser_bug462289.js _BROWSER_FILES += browser_bug462289.js
else else
_BROWSER_FILES += browser_customize.js _BROWSER_FILES += browser_customize.js

View File

@ -49,7 +49,7 @@ SHARED_LIBRARY_LIBS = \
../about/$(LIB_PREFIX)browserabout_s.$(LIB_SUFFIX) \ ../about/$(LIB_PREFIX)browserabout_s.$(LIB_SUFFIX) \
$(NULL) $(NULL)
ifneq (,$(filter windows mac cocoa gtk2, $(MOZ_WIDGET_TOOLKIT))) ifneq (,$(filter windows cocoa gtk2, $(MOZ_WIDGET_TOOLKIT)))
SHARED_LIBRARY_LIBS += ../shell/src/$(LIB_PREFIX)shellservice_s.$(LIB_SUFFIX) SHARED_LIBRARY_LIBS += ../shell/src/$(LIB_PREFIX)shellservice_s.$(LIB_SUFFIX)
endif endif
@ -72,7 +72,7 @@ EXTRA_DSO_LDOPTS += \
# Mac: Need to link with CoreFoundation for Mac Migrators (PList reading code) # Mac: Need to link with CoreFoundation for Mac Migrators (PList reading code)
# GTK2: Need to link with glib for GNOME shell service # GTK2: Need to link with glib for GNOME shell service
ifneq (,$(filter mac cocoa gtk2,$(MOZ_WIDGET_TOOLKIT))) ifneq (,$(filter cocoa gtk2,$(MOZ_WIDGET_TOOLKIT)))
EXTRA_DSO_LDOPTS += \ EXTRA_DSO_LDOPTS += \
$(TK_LIBS) \ $(TK_LIBS) \
$(NULL) $(NULL)

View File

@ -72,7 +72,7 @@ CPPSRCS += nsIEProfileMigrator.cpp \
$(NULL) $(NULL)
endif endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
CPPSRCS += nsSafariProfileMigrator.cpp \ CPPSRCS += nsSafariProfileMigrator.cpp \
nsMacIEProfileMigrator.cpp \ nsMacIEProfileMigrator.cpp \
nsOmniWebProfileMigrator.cpp \ nsOmniWebProfileMigrator.cpp \

View File

@ -918,8 +918,7 @@ var PlacesUIUtils = {
var loadInBackground = where == "tabshifted" ? true : false; var loadInBackground = where == "tabshifted" ? true : false;
var replaceCurrentTab = where == "tab" ? false : true; var replaceCurrentTab = where == "tab" ? false : true;
browserWindow.getBrowser().loadTabs(urls, loadInBackground, browserWindow.gBrowser.loadTabs(urls, loadInBackground, replaceCurrentTab);
replaceCurrentTab);
}, },
openContainerNodeInTabs: function PU_openContainerInTabs(aNode, aEvent) { openContainerNodeInTabs: function PU_openContainerInTabs(aNode, aEvent) {

View File

@ -54,7 +54,7 @@ DEFINES += \
-DMOZ_APP_DISPLAYNAME=$(MOZ_APP_DISPLAYNAME) \ -DMOZ_APP_DISPLAYNAME=$(MOZ_APP_DISPLAYNAME) \
$(NULL) $(NULL)
ifneq (,$(filter windows gtk2 mac cocoa, $(MOZ_WIDGET_TOOLKIT))) ifneq (,$(filter windows gtk2 cocoa, $(MOZ_WIDGET_TOOLKIT)))
DEFINES += -DHAVE_SHELL_SERVICE=1 DEFINES += -DHAVE_SHELL_SERVICE=1
endif endif

View File

@ -30,8 +30,6 @@ browser.jar:
* content/browser/preferences/sanitize.xul * content/browser/preferences/sanitize.xul
* content/browser/preferences/security.xul * content/browser/preferences/security.xul
* content/browser/preferences/security.js * content/browser/preferences/security.js
* content/browser/preferences/securityWarnings.xul
* content/browser/preferences/securityWarnings.js
* content/browser/preferences/selectBookmark.xul * content/browser/preferences/selectBookmark.xul
* content/browser/preferences/selectBookmark.js * content/browser/preferences/selectBookmark.js
* content/browser/preferences/tabs.xul * content/browser/preferences/tabs.xul

View File

@ -244,20 +244,6 @@ var gSecurityPane = {
document.documentElement.openWindow("Toolkit:PasswordManager", document.documentElement.openWindow("Toolkit:PasswordManager",
"chrome://passwordmgr/content/passwordManager.xul", "chrome://passwordmgr/content/passwordManager.xul",
"", null); "", null);
},
// WARNING MESSAGES
/**
* Displays the security warnings dialog which allows changing the
* "submitting unencrypted information", "moving from secure to unsecure",
* etc. dialogs that every user immediately disables when he sees them.
*/
showWarningMessageSettings: function ()
{
document.documentElement.openSubDialog("chrome://browser/content/preferences/securityWarnings.xul",
"", null);
} }
}; };

View File

@ -141,20 +141,6 @@
</hbox> </hbox>
</groupbox> </groupbox>
<!-- Warning Messages -->
<hbox class="bottomBox">
<groupbox id="warningMessagesGroup" orient="horizontal" flex="1"
align="center">
<caption label="&warnings.label;"/>
<description control="warningSettings" flex="1">&chooseWarnings.label;</description>
<button id="warningSettings"
label="&warningSettings.label;"
accesskey="&warningSettings.accesskey;"
oncommand="gSecurityPane.showWarningMessageSettings();"/>
</groupbox>
</hbox>
</prefpane> </prefpane>
</overlay> </overlay>

View File

@ -1,44 +0,0 @@
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# ***** 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 the Firefox Preferences System.
#
# The Initial Developer of the Original Code is
# Gavin Sharp.
# Portions created by the Initial Developer are Copyright (C) 2006
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Gavin Sharp <gavin@gavinsharp.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
function secWarningSyncTo(aEvent) {
var prefName = aEvent.target.getAttribute("preference") + ".show_once";
var prefOnce = document.getElementById(prefName);
prefOnce.value = false;
return undefined;
}

View File

@ -1,115 +0,0 @@
<?xml version="1.0"?>
# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# ***** 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 the Firefox Preferences System.
#
# The Initial Developer of the Original Code is
# Gavin Sharp.
# Portions created by the Initial Developer are Copyright (C) 2006
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Gavin Sharp <gavin@gavinsharp.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
<!DOCTYPE prefwindow SYSTEM "chrome://browser/locale/preferences/securityWarnings.dtd">
<?xml-stylesheet href="chrome://global/skin/"?>
<prefwindow id="SecurityWarnings" type="child"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&securityWarnings.title;"
dlgbuttons="accept,cancel">
<prefpane id="SecurityWarningsPane">
<preferences>
<preference id="security.warn_entering_secure"
name="security.warn_entering_secure"
type="bool"/>
<preference id="security.warn_entering_secure.show_once"
name="security.warn_entering_secure.show_once"
type="bool"/>
<preference id="security.warn_entering_weak"
name="security.warn_entering_weak"
type="bool"/>
<preference id="security.warn_entering_weak.show_once"
name="security.warn_entering_weak.show_once"
type="bool"/>
<preference id="security.warn_leaving_secure"
name="security.warn_leaving_secure"
type="bool"/>
<preference id="security.warn_leaving_secure.show_once"
name="security.warn_leaving_secure.show_once"
type="bool"/>
<preference id="security.warn_submit_insecure"
name="security.warn_submit_insecure"
type="bool"/>
<preference id="security.warn_submit_insecure.show_once"
name="security.warn_submit_insecure.show_once"
type="bool"/>
<preference id="security.warn_viewing_mixed"
name="security.warn_viewing_mixed"
type="bool"/>
<preference id="security.warn_viewing_mixed.show_once"
name="security.warn_viewing_mixed.show_once"
type="bool"/>
</preferences>
<script type="application/x-javascript" src="chrome://browser/content/preferences/securityWarnings.js"/>
<description value="&security.warn_when;"/>
<vbox class="indent">
<checkbox id="warn_entering_secure"
onsynctopreference="secWarningSyncTo(event);"
label="&security.warn_entering_secure.label;"
accesskey="&security.warn_entering_secure.accesskey;"
preference="security.warn_entering_secure"/>
<checkbox id="warn_entering_weak"
onsynctopreference="secWarningSyncTo(event);"
label="&security.warn_entering_weak.label;"
accesskey="&security.warn_entering_weak.accesskey;"
preference="security.warn_entering_weak"/>
<checkbox id="warn_leaving_secure"
onsynctopreference="secWarningSyncTo(event);"
label="&security.warn_leaving_secure.label;"
accesskey="&security.warn_leaving_secure.accesskey;"
preference="security.warn_leaving_secure"/>
<checkbox id="warn_submit_insecure"
onsynctopreference="secWarningSyncTo(event);"
label="&security.warn_submit_insecure.label;"
accesskey="&security.warn_submit_insecure.accesskey;"
preference="security.warn_submit_insecure"/>
<checkbox id="warn_viewing_mixed"
onsynctopreference="secWarningSyncTo(event);"
label="&security.warn_viewing_mixed.label;"
accesskey="&security.warn_viewing_mixed.accesskey;"
preference="security.warn_viewing_mixed"/>
</vbox>
</prefpane>
</prefwindow>

View File

@ -187,7 +187,7 @@ PrivateBrowsingService.prototype = {
while (viewSrcWindowsEnum.hasMoreElements()) { while (viewSrcWindowsEnum.hasMoreElements()) {
let win = viewSrcWindowsEnum.getNext(); let win = viewSrcWindowsEnum.getNext();
if (this._inPrivateBrowsing) { if (this._inPrivateBrowsing) {
let plainURL = win.getBrowser().currentURI.spec; let plainURL = win.gBrowser.currentURI.spec;
if (plainURL.indexOf("view-source:") == 0) { if (plainURL.indexOf("view-source:") == 0) {
plainURL = plainURL.substr(12); plainURL = plainURL.substr(12);
this._viewSrcURLs.push(plainURL); this._viewSrcURLs.push(plainURL);

View File

@ -47,7 +47,7 @@ include $(topsrcdir)/config/rules.mk
# The browser chrome test for bug 415846 doesn't run on Mac because of its # The browser chrome test for bug 415846 doesn't run on Mac because of its
# bizarre special-and-unique snowflake of a help menu. # bizarre special-and-unique snowflake of a help menu.
ifeq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT)))
_NON_MAC_BROWSER_TESTS = browser_bug415846.js _NON_MAC_BROWSER_TESTS = browser_bug415846.js
endif endif

View File

@ -56,7 +56,7 @@ interface nsIDOMNode;
* by looking for "navigator:browser" windows. * by looking for "navigator:browser" windows.
* *
* * "Tabbrowser tabs" are all the child nodes of a browser window's * * "Tabbrowser tabs" are all the child nodes of a browser window's
* |getBrowser().tabContainer| such as e.g. |getBrowser().selectedTab|. * |gBrowser.tabContainer| such as e.g. |gBrowser.selectedTab|.
*/ */
[scriptable, uuid(70592a0d-87d3-459c-8db7-dcb8d47af78e)] [scriptable, uuid(70592a0d-87d3-459c-8db7-dcb8d47af78e)]

View File

@ -948,7 +948,7 @@ SessionStoreService.prototype = {
var sourceWindow = aTab.ownerDocument.defaultView; var sourceWindow = aTab.ownerDocument.defaultView;
this._updateTextAndScrollDataForTab(sourceWindow, aTab.linkedBrowser, tabState, true); this._updateTextAndScrollDataForTab(sourceWindow, aTab.linkedBrowser, tabState, true);
var newTab = aWindow.getBrowser().addTab(); var newTab = aWindow.gBrowser.addTab();
this.restoreHistoryPrecursor(aWindow, [newTab], [tabState], 0, 0, 0); this.restoreHistoryPrecursor(aWindow, [newTab], [tabState], 0, 0, 0);
return newTab; return newTab;
@ -1118,7 +1118,7 @@ SessionStoreService.prototype = {
* Window reference * Window reference
*/ */
_saveWindowHistory: function sss_saveWindowHistory(aWindow) { _saveWindowHistory: function sss_saveWindowHistory(aWindow) {
var tabbrowser = aWindow.getBrowser(); var tabbrowser = aWindow.gBrowser;
var tabs = tabbrowser.mTabs; var tabs = tabbrowser.mTabs;
var tabsData = this._windows[aWindow.__SSi].tabs = []; var tabsData = this._windows[aWindow.__SSi].tabs = [];
@ -1399,7 +1399,7 @@ SessionStoreService.prototype = {
* Window reference * Window reference
*/ */
_updateTextAndScrollData: function sss_updateTextAndScrollData(aWindow) { _updateTextAndScrollData: function sss_updateTextAndScrollData(aWindow) {
var browsers = aWindow.getBrowser().browsers; var browsers = aWindow.gBrowser.browsers;
for (var i = 0; i < browsers.length; i++) { for (var i = 0; i < browsers.length; i++) {
try { try {
var tabData = this._windows[aWindow.__SSi].tabs[i]; var tabData = this._windows[aWindow.__SSi].tabs[i];
@ -1917,7 +1917,7 @@ SessionStoreService.prototype = {
*/ */
restoreHistoryPrecursor: restoreHistoryPrecursor:
function sss_restoreHistoryPrecursor(aWindow, aTabs, aTabData, aSelectTab, aIx, aCount) { function sss_restoreHistoryPrecursor(aWindow, aTabs, aTabData, aSelectTab, aIx, aCount) {
var tabbrowser = aWindow.getBrowser(); var tabbrowser = aWindow.gBrowser;
// make sure that all browsers and their histories are available // make sure that all browsers and their histories are available
// - if one's not, resume this check in 100ms (repeat at most 10 times) // - if one's not, resume this check in 100ms (repeat at most 10 times)
@ -2031,7 +2031,7 @@ SessionStoreService.prototype = {
var tab = aTabs.shift(); var tab = aTabs.shift();
var tabData = aTabData.shift(); var tabData = aTabData.shift();
var browser = aWindow.getBrowser().getBrowserForTab(tab); var browser = aWindow.gBrowser.getBrowserForTab(tab);
var history = browser.webNavigation.sessionHistory; var history = browser.webNavigation.sessionHistory;
if (history.count > 0) { if (history.count > 0) {
@ -2727,7 +2727,7 @@ SessionStoreService.prototype = {
return; return;
} }
try { try {
var currentURI = aWindow.getBrowser().currentURI.clone(); var currentURI = aWindow.gBrowser.currentURI.clone();
// if the current URI contains a username/password, remove it // if the current URI contains a username/password, remove it
try { try {
currentURI.userPass = ""; currentURI.userPass = "";

View File

@ -51,7 +51,7 @@ ifneq (,$(filter WINCE WINNT,$(OS_ARCH)))
XPIDLSRCS += nsIWindowsShellService.idl XPIDLSRCS += nsIWindowsShellService.idl
endif endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
XPIDLSRCS += nsIMacShellService.idl XPIDLSRCS += nsIMacShellService.idl
endif endif

View File

@ -53,7 +53,7 @@ endif
ifneq (,$(filter WINCE WINNT,$(OS_ARCH))) ifneq (,$(filter WINCE WINNT,$(OS_ARCH)))
CPPSRCS = nsWindowsShellService.cpp CPPSRCS = nsWindowsShellService.cpp
else else
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
CPPSRCS = nsMacShellService.cpp CPPSRCS = nsMacShellService.cpp
else else
ifeq ($(MOZ_WIDGET_TOOLKIT), gtk2) ifeq ($(MOZ_WIDGET_TOOLKIT), gtk2)

View File

@ -79,7 +79,9 @@ function test() {
let browser = gBrowser.getBrowserAtIndex(gPageB.index); let browser = gBrowser.getBrowserAtIndex(gPageB.index);
browser.addProgressListener({ browser.addProgressListener({
onStateChange: function(webProgress, request, stateFlags, status) { onStateChange: function (webProgress, request, stateFlags, status) {
info("onStateChange: " + stateFlags);
const complete = Ci.nsIWebProgressListener.STATE_IS_WINDOW + const complete = Ci.nsIWebProgressListener.STATE_IS_WINDOW +
Ci.nsIWebProgressListener.STATE_IS_NETWORK + Ci.nsIWebProgressListener.STATE_IS_NETWORK +
Ci.nsIWebProgressListener.STATE_STOP; Ci.nsIWebProgressListener.STATE_STOP;
@ -89,18 +91,13 @@ function test() {
} }
}, },
onLocationChange: function() { return 0; }, onLocationChange: function () 0,
onProgressChange: function() { return 0; }, onProgressChange: function () 0,
onStatusChange: function() { return 0; }, onStatusChange: function () 0,
onSecurityChange: function() { return 0; }, onSecurityChange: function () 0,
QueryInterface: function(iid) { QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference,
if (iid.equals(Ci.nsISupportsWeakReference) || Ci.nsIWebProgressListener,
iid.equals(Ci.nsIWebProgressListener) || Ci.nsISupports])
iid.equals(Ci.nsISupports))
return this;
throw Components.results.NS_ERROR_NO_INTERFACE;
}
}); });
// test loading new content with a frame into a tab // test loading new content with a frame into a tab
@ -111,6 +108,7 @@ function test() {
function onPageBLoadWithFrames(event) { function onPageBLoadWithFrames(event) {
gPageLoadCount++; gPageLoadCount++;
info("onPageBLoadWithFrames: " + gPageLoadCount);
} }
function onPageBLoadComplete() { function onPageBLoadComplete() {

View File

@ -103,7 +103,7 @@ $(MOZ_PKG_MANIFEST): $(MOZ_PKG_MANIFEST_P)
GARBAGE += $(MOZ_PKG_MANIFEST) GARBAGE += $(MOZ_PKG_MANIFEST)
endif endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
MOZ_PKG_MAC_DSSTORE=branding/dsstore MOZ_PKG_MAC_DSSTORE=branding/dsstore
MOZ_PKG_MAC_BACKGROUND=branding/background.png MOZ_PKG_MAC_BACKGROUND=branding/background.png
MOZ_PKG_MAC_ICON=branding/disk.icns MOZ_PKG_MAC_ICON=branding/disk.icns

View File

@ -32,11 +32,3 @@
<!ENTITY savedPasswords.label "Saved Passwords…"> <!ENTITY savedPasswords.label "Saved Passwords…">
<!ENTITY savedPasswords.accesskey "P"> <!ENTITY savedPasswords.accesskey "P">
<!ENTITY warnings.label "Warning Messages">
<!ENTITY chooseWarnings.label "Choose which warning messages you want to see while browsing the web">
<!ENTITY warningSettings.label "Settings…">
<!ENTITY warningSettings.accesskey "S">

View File

@ -1,13 +0,0 @@
<!ENTITY securityWarnings.title "Security Warnings">
<!ENTITY security.warn_when "Show a warning dialog when:">
<!ENTITY security.warn_entering_secure.label "I am about to view an encrypted page.">
<!ENTITY security.warn_entering_secure.accesskey "v">
<!ENTITY security.warn_entering_weak.label "I am about to view a page that uses low-grade encryption.">
<!ENTITY security.warn_entering_weak.accesskey "g">
<!ENTITY security.warn_leaving_secure.label "I leave an encrypted page for one that isn't encrypted.">
<!ENTITY security.warn_leaving_secure.accesskey "l">
<!ENTITY security.warn_submit_insecure.label "I submit information that's not encrypted.">
<!ENTITY security.warn_submit_insecure.accesskey "s">
<!ENTITY security.warn_viewing_mixed.label "I'm about to view an encrypted page that contains some unencrypted information.">
<!ENTITY security.warn_viewing_mixed.accesskey "u">

View File

@ -59,7 +59,6 @@
locale/browser/preferences/preferences.properties (%chrome/browser/preferences/preferences.properties) locale/browser/preferences/preferences.properties (%chrome/browser/preferences/preferences.properties)
locale/browser/preferences/privacy.dtd (%chrome/browser/preferences/privacy.dtd) locale/browser/preferences/privacy.dtd (%chrome/browser/preferences/privacy.dtd)
locale/browser/preferences/security.dtd (%chrome/browser/preferences/security.dtd) locale/browser/preferences/security.dtd (%chrome/browser/preferences/security.dtd)
locale/browser/preferences/securityWarnings.dtd (%chrome/browser/preferences/securityWarnings.dtd)
locale/browser/preferences/tabs.dtd (%chrome/browser/preferences/tabs.dtd) locale/browser/preferences/tabs.dtd (%chrome/browser/preferences/tabs.dtd)
locale/browser/sidebar/sidebar.properties (%chrome/browser/sidebar/sidebar.properties) locale/browser/sidebar/sidebar.properties (%chrome/browser/sidebar/sidebar.properties)
% locale browser-region @AB_CD@ %locale/browser-region/ % locale browser-region @AB_CD@ %locale/browser-region/

View File

@ -50,7 +50,7 @@ include $(DEPTH)/config/autoconf.mk
# MacOS X Pinstripe # MacOS X Pinstripe
# #
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
DIRS = pinstripe DIRS = pinstripe
else else
DIRS = winstripe DIRS = winstripe

View File

@ -1,142 +0,0 @@
#!/bin/sh
prefix=%prefix%
exec_prefix=%exec_prefix%
exec_prefix_set=no
usage()
{
cat <<EOF
Usage: $0 [OPTIONS] [LIBRARIES]
Options:
[--prefix[=DIR]]
[--exec-prefix[=DIR]]
[--version]
[--defines]
[--libs] [libraries]
[--cflags] [components]
[--idlflags]
Components:
*
Libraries:
xpcom
nspr
js
jsj
gfx
EOF
exit $1
}
if test $# -eq 0; then
usage 1 1>&2
fi
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--prefix=*)
prefix=$optarg
if test $exec_prefix_set = no ; then
exec_prefix=$optarg
fi
;;
--prefix)
echo_prefix=yes
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
;;
--exec-prefix)
echo_exec_prefix=yes
;;
--version)
echo %MOZILLA_VERSION%
exit 0
;;
--cflags)
if test "%includedir%" != /usr/include ; then
includes="-I%includedir%"
fi
echo_cflags=yes
;;
--defines)
echo_defines=yes
;;
--libs)
echo_libs=yes
;;
--idlflags)
echo_idlflags=yes
;;
xpcom|js|nspr|gfx|jsj)
echo_components="$echo_components $1"
echo_libraries="$echo_libraries $1"
;;
xpconnect)
echo_components="$echo_components $1"
;;
"")
usage 1 1>&2
;;
*)
echo_components="$echo_components $1"
;;
esac
shift
done
if test "$echo_prefix" = "yes"; then
echo $prefix
fi
if test "$echo_exec_prefix" = "yes"; then
echo $exec_prefix
fi
if test "$echo_defines" = "yes"; then
echo %DEFS%
fi
if test "$echo_cflags" = "yes"; then
nspr_cflags="%FULL_NSPR_CFLAGS%"
for n in $echo_components; do
component_includes="$component_includes -I%includedir%/$n"
done
echo $component_includes $includes $nspr_cflags
fi
if test "$echo_idlflags" = "yes"; then
echo "-I%idldir%"
fi
_nspr_libs="%FULL_NSPR_LIBS%"
_xpcom_libs="-lxpcom $_nspr_libs"
_js_libs="-ljs"
if test "$echo_libs" = "yes"; then
for l in $echo_libraries; do
case "$l" in
gfx)
libs="$libs -lgkgfx $_xpcom_libs"
;;
xpcom)
libs="$libs $_xpcom_libs"
;;
nspr)
libs="$libs $_nspr_libs"
;;
js)
libs="$libs $_js_libs"
;;
jsj)
libs="$libs -ljsj $_js_libs $_xpcom_libs"
;;
esac
done
echo -L%libdir% $libs
fi

View File

@ -1,8 +0,0 @@
USE_PTHREADS=@MOZ_NSPRENV_USE_PTHREADS@
BUILD_OPT=@MOZ_NSPRENV_BUILD_OPT@
NS_USE_GCC=@MOZ_NSPRENV_NS_USE_GCC@
NO_MDUPDATE=@MOZ_NSPRENV_NO_MDUPDATE@
NS_USE_NATIVE=@MOZ_NSPRENV_NS_USE_NATIVE@
MOZILLA_CLIENT=@MOZ_NSPRENV_MOZILLA_CLIENT@
CLASSIC_NSPR=@MOZ_NSPRENV_CLASSIC_NSPR@
GC_LEAK_DETECTOR=@MOZ_NSPRENV_GC_LEAK_DETECTOR@

View File

@ -1,12 +0,0 @@
DIST=@MOZ_NSPRENV_DIST@
MOZ_NSPRENV_OVERRIDE_MAKE=@MOZ_NSPRENV_OVERRIDE_MAKE@
MOZ_NSPRENV_OVERRIDE_DSO_LDOPTS=@MOZ_NSPRENV_OVERRIDE_DSO_LDOPTS@
ifdef MOZ_NSPRENV_OVERRIDE_MAKE
MAKE=$(MOZ_NSPRENV_OVERRIDE_MAKE)
endif
ifdef MOZ_NSPRENV_OVERRIDE_DSO_LDOPTS
DSO_LDOPTS=$(MOZ_NSPRENV_OVERRIDE_DSO_LDOPTS)
endif

View File

@ -66,7 +66,7 @@ ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS) EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS)
endif endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
EXTRA_DSO_LDOPTS += $(TK_LIBS) EXTRA_DSO_LDOPTS += $(TK_LIBS)
endif endif

View File

@ -233,8 +233,6 @@ MOZ_PERMISSIONS = @MOZ_PERMISSIONS@
MOZ_XTF = @MOZ_XTF@ MOZ_XTF = @MOZ_XTF@
MOZ_NO_INSPECTOR_APIS = @MOZ_NO_INSPECTOR_APIS@ MOZ_NO_INSPECTOR_APIS = @MOZ_NO_INSPECTOR_APIS@
MOZ_SVG = @MOZ_SVG@ MOZ_SVG = @MOZ_SVG@
MOZ_ENABLE_CANVAS = @MOZ_ENABLE_CANVAS@
MOZ_ENABLE_CANVAS3D = @MOZ_ENABLE_CANVAS3D@
MOZ_CAIRO_CFLAGS = @MOZ_CAIRO_CFLAGS@ MOZ_CAIRO_CFLAGS = @MOZ_CAIRO_CFLAGS@
MOZ_SMIL = @MOZ_SMIL@ MOZ_SMIL = @MOZ_SMIL@
MOZ_XSLT_STANDALONE = @MOZ_XSLT_STANDALONE@ MOZ_XSLT_STANDALONE = @MOZ_XSLT_STANDALONE@

View File

@ -20,6 +20,6 @@ ifeq ($(OS_ARCH),IRIX)
LDFLAGS += -Wl,-LD_LAYOUT:lgot_buffer=80 LDFLAGS += -Wl,-LD_LAYOUT:lgot_buffer=80
endif endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
LIBS += -framework QuickTime -framework IOKit -lcrypto LIBS += -framework QuickTime -framework IOKit -lcrypto
endif endif

View File

@ -4460,8 +4460,6 @@ MOZ_ACTIVEX_SCRIPTING_SUPPORT=
MOZ_BRANDING_DIRECTORY= MOZ_BRANDING_DIRECTORY=
MOZ_OFFICIAL_BRANDING= MOZ_OFFICIAL_BRANDING=
MOZ_DBGRINFO_MODULES= MOZ_DBGRINFO_MODULES=
MOZ_ENABLE_CANVAS=1
MOZ_ENABLE_CANVAS3D=1
MOZ_FEEDS=1 MOZ_FEEDS=1
MOZ_IMG_DECODERS_DEFAULT="png gif jpeg bmp icon" MOZ_IMG_DECODERS_DEFAULT="png gif jpeg bmp icon"
MOZ_IMG_ENCODERS_DEFAULT="png jpeg" MOZ_IMG_ENCODERS_DEFAULT="png jpeg"
@ -5782,24 +5780,6 @@ if test "$MOZ_MATHML"; then
AC_DEFINE(MOZ_MATHML) AC_DEFINE(MOZ_MATHML)
fi fi
dnl ========================================================
dnl Canvas
dnl ========================================================
if test -n "$MOZ_ENABLE_CANVAS"; then
AC_DEFINE(MOZ_ENABLE_CANVAS)
fi
AC_SUBST(MOZ_ENABLE_CANVAS)
MOZ_ARG_DISABLE_BOOL(webgl,
[ --disable-webgl Disable WebGL context (canvas 3d)],
MOZ_ENABLE_CANVAS3D=,
MOZ_ENABLE_CANVAS3D=1 )
if test -n "$MOZ_ENABLE_CANVAS3D"; then
AC_DEFINE(MOZ_ENABLE_CANVAS3D)
fi
AC_SUBST(MOZ_ENABLE_CANVAS3D)
dnl ======================================================== dnl ========================================================
dnl SVG dnl SVG
dnl ======================================================== dnl ========================================================
@ -7399,7 +7379,7 @@ if test "$MOZ_TREE_CAIRO"; then
if test "$MOZ_WIDGET_TOOLKIT" = "qt"; then if test "$MOZ_WIDGET_TOOLKIT" = "qt"; then
QPAINTER_SURFACE_FEATURE="#define CAIRO_HAS_QPAINTER_SURFACE 1" QPAINTER_SURFACE_FEATURE="#define CAIRO_HAS_QPAINTER_SURFACE 1"
fi fi
if test "$MOZ_WIDGET_TOOLKIT" = "mac" -o "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then if test "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1" QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1" QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1" QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"

View File

@ -43,6 +43,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk include $(DEPTH)/config/autoconf.mk
MODULE = content MODULE = content
XPIDL_MODULE = content_canvas
EXPORTS = \ EXPORTS = \
nsICanvasRenderingContextInternal.h \ nsICanvasRenderingContextInternal.h \
@ -50,14 +51,8 @@ EXPORTS = \
WebGLArray.h \ WebGLArray.h \
$(NULL) $(NULL)
ifdef MOZ_ENABLE_CANVAS3D
XPIDL_MODULE = content_canvas
XPIDLSRCS = \ XPIDLSRCS = \
nsICanvasGLPrivate.idl \ nsICanvasGLPrivate.idl \
$(NULL) $(NULL)
endif
include $(topsrcdir)/config/rules.mk include $(topsrcdir)/config/rules.mk

View File

@ -57,10 +57,10 @@ CPPSRCS = \
# only allow on platforms/toolkits we know are good # only allow on platforms/toolkits we know are good
ifneq (,$(NS_OSSO)$(WINCE)$(filter-out windows cocoa gtk2,$(MOZ_WIDGET_TOOLKIT))) ifneq (,$(NS_OSSO)$(WINCE)$(filter-out windows cocoa gtk2,$(MOZ_WIDGET_TOOLKIT)))
MOZ_ENABLE_CANVAS3D= DISABLE_WEBGL=1
endif endif
ifdef MOZ_ENABLE_CANVAS3D ifndef DISABLE_WEBGL
CPPSRCS += \ CPPSRCS += \
WebGLContext.cpp \ WebGLContext.cpp \
@ -90,7 +90,7 @@ DEFINES += -DUSE_WGL
endif endif
endif endif
ifneq (,$(filter $(MOZ_WIDGET_TOOLKIT),mac cocoa)) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
CPPSRCS += nsGLPbufferCGL.cpp CPPSRCS += nsGLPbufferCGL.cpp
DEFINES += -DUSE_CGL DEFINES += -DUSE_CGL
endif endif

View File

@ -51,6 +51,7 @@
#define MAX_SYMBOL_NAMES 5 #define MAX_SYMBOL_NAMES 5
#ifdef MOZ_X11 #ifdef MOZ_X11
#define GLX_GLXEXT_LEGACY
#include <GL/glx.h> #include <GL/glx.h>
#endif #endif

View File

@ -58,6 +58,7 @@
#endif #endif
#if defined(XP_UNIX) && defined(MOZ_X11) #if defined(XP_UNIX) && defined(MOZ_X11)
#define GLX_GLXEXT_LEGACY
#include "GL/glx.h" #include "GL/glx.h"
#endif #endif

View File

@ -55,9 +55,20 @@ class WGLWrap
public: public:
WGLWrap() : fCreatePbuffer(0) { } WGLWrap() : fCreatePbuffer(0) { }
bool InitEarly();
bool Init(); bool Init();
public: public:
// early init
typedef HANDLE (WINAPI * PFNWGLCREATECONTEXTPROC) (HDC hDC);
PFNWGLCREATECONTEXTPROC fCreateContext;
typedef BOOL (WINAPI * PFNWGLMAKECURRENTPROC) (HDC hDC, HANDLE hglrc);
PFNWGLMAKECURRENTPROC fMakeCurrent;
typedef PROC (WINAPI * PFNWGLGETPROCADDRESSPROC) (LPCSTR proc);
PFNWGLGETPROCADDRESSPROC fGetProcAddress;
typedef BOOL (WINAPI * PFNWGLDELETECONTEXTPROC) (HANDLE hglrc);
PFNWGLDELETECONTEXTPROC fDeleteContext;
typedef HANDLE (WINAPI * PFNWGLCREATEPBUFFERPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); typedef HANDLE (WINAPI * PFNWGLCREATEPBUFFERPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList);
PFNWGLCREATEPBUFFERPROC fCreatePbuffer; PFNWGLCREATEPBUFFERPROC fCreatePbuffer;
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERPROC) (HANDLE hPbuffer); typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERPROC) (HANDLE hPbuffer);
@ -71,6 +82,23 @@ public:
PFNWGLGETPIXELFORMATATTRIBIVPROC fGetPixelFormatAttribiv; PFNWGLGETPIXELFORMATATTRIBIVPROC fGetPixelFormatAttribiv;
}; };
bool
WGLWrap::InitEarly()
{
if (fCreateContext)
return true;
SymLoadStruct symbols[] = {
{ (PRFuncPtr*) &fCreateContext, { "wglCreateContext", NULL } },
{ (PRFuncPtr*) &fMakeCurrent, { "wglMakeCurrent", NULL } },
{ (PRFuncPtr*) &fGetProcAddress, { "wglGetProcAddress", NULL } },
{ (PRFuncPtr*) &fDeleteContext, { "wglDeleteContext", NULL } },
{ NULL, { NULL } }
};
return LoadSymbols(&symbols[0], false);
}
bool bool
WGLWrap::Init() WGLWrap::Init()
{ {
@ -108,7 +136,10 @@ nsGLPbufferWGL::Init(WebGLContext *priv)
if (!gWGLWrap.OpenLibrary(opengl32)) if (!gWGLWrap.OpenLibrary(opengl32))
return PR_FALSE; return PR_FALSE;
gWGLWrap.SetLookupFunc((LibrarySymbolLoader::PlatformLookupFunction) wglGetProcAddress); if (!gWGLWrap.InitEarly())
return PR_FALSE;
gWGLWrap.SetLookupFunc((LibrarySymbolLoader::PlatformLookupFunction) gWGLWrap.fGetProcAddress);
mPriv = priv; mPriv = priv;
@ -156,13 +187,13 @@ nsGLPbufferWGL::Init(WebGLContext *priv)
} }
// create rendering context // create rendering context
mGlewWglContext = wglCreateContext(mGlewDC); mGlewWglContext = gWGLWrap.fCreateContext(mGlewDC);
if (!mGlewWglContext) { if (!mGlewWglContext) {
LogMessage("Canvas 3D: wglCreateContext failed"); LogMessage("Canvas 3D: wglCreateContext failed");
return PR_FALSE; return PR_FALSE;
} }
if (!wglMakeCurrent(mGlewDC, (HGLRC) mGlewWglContext)) { if (!gWGLWrap.fMakeCurrent(mGlewDC, (HGLRC) mGlewWglContext)) {
LogMessage("Canvas 3D: wglMakeCurrent failed"); LogMessage("Canvas 3D: wglMakeCurrent failed");
return PR_FALSE; return PR_FALSE;
} }
@ -178,7 +209,7 @@ nsGLPbufferWGL::Init(WebGLContext *priv)
return PR_FALSE; return PR_FALSE;
} }
mGLWrap.SetLookupFunc((LibrarySymbolLoader::PlatformLookupFunction) wglGetProcAddress); mGLWrap.SetLookupFunc((LibrarySymbolLoader::PlatformLookupFunction) gWGLWrap.fGetProcAddress);
if (!mGLWrap.Init(GLES20Wrap::TRY_NATIVE_GL)) { if (!mGLWrap.Init(GLES20Wrap::TRY_NATIVE_GL)) {
LogMessage("Canvas 3D: GLWrap init failed"); LogMessage("Canvas 3D: GLWrap init failed");
@ -224,7 +255,7 @@ nsGLPbufferWGL::Resize(PRInt32 width, PRInt32 height)
0, 0,
height * mThebesSurface->Stride()); height * mThebesSurface->Stride());
if (!wglMakeCurrent(mGlewDC, (HGLRC) mGlewWglContext)) { if (!gWGLWrap.fMakeCurrent(mGlewDC, (HGLRC) mGlewWglContext)) {
fprintf (stderr, "Error: %d\n", GetLastError()); fprintf (stderr, "Error: %d\n", GetLastError());
LogMessage("Canvas 3D: wglMakeCurrent failed"); LogMessage("Canvas 3D: wglMakeCurrent failed");
return PR_FALSE; return PR_FALSE;
@ -350,7 +381,7 @@ TRY_FIND_AGAIN:
} }
mPbufferDC = gWGLWrap.fGetPbufferDC(mPbuffer); mPbufferDC = gWGLWrap.fGetPbufferDC(mPbuffer);
mPbufferContext = wglCreateContext(mPbufferDC); mPbufferContext = gWGLWrap.fCreateContext(mPbufferDC);
mWindowsSurface = new gfxWindowsSurface(gfxIntSize(width, height), gfxASurface::ImageFormatARGB32); mWindowsSurface = new gfxWindowsSurface(gfxIntSize(width, height), gfxASurface::ImageFormatARGB32);
if (mWindowsSurface && mWindowsSurface->CairoStatus() == 0) if (mWindowsSurface && mWindowsSurface->CairoStatus() == 0)
@ -370,7 +401,7 @@ nsGLPbufferWGL::Destroy()
mThebesSurface = nsnull; mThebesSurface = nsnull;
if (mPbuffer) { if (mPbuffer) {
wglDeleteContext((HGLRC) mPbufferContext); gWGLWrap.fDeleteContext((HGLRC) mPbufferContext);
gWGLWrap.fDestroyPbuffer(mPbuffer); gWGLWrap.fDestroyPbuffer(mPbuffer);
mPbuffer = nsnull; mPbuffer = nsnull;
} }
@ -381,7 +412,7 @@ nsGLPbufferWGL::~nsGLPbufferWGL()
Destroy(); Destroy();
if (mGlewWglContext) { if (mGlewWglContext) {
wglDeleteContext((HGLRC) mGlewWglContext); gWGLWrap.fDeleteContext((HGLRC) mGlewWglContext);
mGlewWglContext = nsnull; mGlewWglContext = nsnull;
} }
@ -401,7 +432,7 @@ nsGLPbufferWGL::MakeContextCurrent()
if (sCurrentContextToken == mPbufferContext) if (sCurrentContextToken == mPbufferContext)
return; return;
wglMakeCurrent (mPbufferDC, (HGLRC) mPbufferContext); gWGLWrap.fMakeCurrent (mPbufferDC, (HGLRC) mPbufferContext);
sCurrentContextToken = mPbufferContext; sCurrentContextToken = mPbufferContext;
} }

View File

@ -45,7 +45,7 @@ include $(DEPTH)/config/autoconf.mk
ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH))) ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))
DIRS = win DIRS = win
else else
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
DIRS = mac DIRS = mac
else else
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2) ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)

View File

@ -96,7 +96,7 @@ LOCAL_INCLUDES = \
-I$(topsrcdir)/uriloader/exthandler \ -I$(topsrcdir)/uriloader/exthandler \
$(NULL) $(NULL)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
LOCAL_INCLUDES += -I$(topsrcdir)/uriloader/exthandler/mac LOCAL_INCLUDES += -I$(topsrcdir)/uriloader/exthandler/mac
EXTRA_DSO_LDOPTS += \ EXTRA_DSO_LDOPTS += \
$(TK_LIBS) \ $(TK_LIBS) \

View File

@ -430,13 +430,9 @@
#include "nsIDOMSVGZoomEvent.h" #include "nsIDOMSVGZoomEvent.h"
#endif // MOZ_SVG #endif // MOZ_SVG
#ifdef MOZ_ENABLE_CANVAS
#include "nsIDOMCanvasRenderingContext2D.h" #include "nsIDOMCanvasRenderingContext2D.h"
#ifdef MOZ_ENABLE_CANVAS3D
#include "nsICanvasRenderingContextWebGL.h" #include "nsICanvasRenderingContextWebGL.h"
#include "WebGLArray.h" #include "WebGLArray.h"
#endif
#endif
#include "nsIImageDocument.h" #include "nsIImageDocument.h"
@ -1148,7 +1144,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
NS_DEFINE_CLASSINFO_DATA(HTMLCanvasElement, nsHTMLElementSH, NS_DEFINE_CLASSINFO_DATA(HTMLCanvasElement, nsHTMLElementSH,
ELEMENT_SCRIPTABLE_FLAGS) ELEMENT_SCRIPTABLE_FLAGS)
#ifdef MOZ_ENABLE_CANVAS
NS_DEFINE_CLASSINFO_DATA(CanvasRenderingContext2D, nsDOMGenericSH, NS_DEFINE_CLASSINFO_DATA(CanvasRenderingContext2D, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS) DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(CanvasGradient, nsDOMGenericSH, NS_DEFINE_CLASSINFO_DATA(CanvasGradient, nsDOMGenericSH,
@ -1157,7 +1152,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
DOM_DEFAULT_SCRIPTABLE_FLAGS) DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(TextMetrics, nsDOMGenericSH, NS_DEFINE_CLASSINFO_DATA(TextMetrics, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS) DOM_DEFAULT_SCRIPTABLE_FLAGS)
#endif // MOZ_ENABLE_CANVAS
NS_DEFINE_CLASSINFO_DATA(SmartCardEvent, nsDOMGenericSH, NS_DEFINE_CLASSINFO_DATA(SmartCardEvent, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS) DOM_DEFAULT_SCRIPTABLE_FLAGS)
@ -1318,7 +1312,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
NS_DEFINE_CLASSINFO_DATA(Worker, nsDOMGenericSH, NS_DEFINE_CLASSINFO_DATA(Worker, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS) DOM_DEFAULT_SCRIPTABLE_FLAGS)
#ifdef MOZ_ENABLE_CANVAS3D
NS_DEFINE_CLASSINFO_DATA(CanvasRenderingContextWebGL, nsDOMGenericSH, NS_DEFINE_CLASSINFO_DATA(CanvasRenderingContextWebGL, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS) DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(WebGLBuffer, nsDOMGenericSH, NS_DEFINE_CLASSINFO_DATA(WebGLBuffer, nsDOMGenericSH,
@ -1347,7 +1340,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
DOM_DEFAULT_SCRIPTABLE_FLAGS) DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(WebGLUnsignedIntArray, nsDOMGenericSH, NS_DEFINE_CLASSINFO_DATA(WebGLUnsignedIntArray, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS) DOM_DEFAULT_SCRIPTABLE_FLAGS)
#endif
}; };
// Objects that shuld be constructable through |new Name();| // Objects that shuld be constructable through |new Name();|
@ -1382,7 +1374,8 @@ struct nsConstructorFuncMapData
static const nsConstructorFuncMapData kConstructorFuncMap[] = static const nsConstructorFuncMapData kConstructorFuncMap[] =
{ {
NS_DEFINE_CONSTRUCTOR_FUNC_DATA(Worker, nsDOMWorker::NewWorker) NS_DEFINE_CONSTRUCTOR_FUNC_DATA(Worker, nsDOMWorker::NewWorker)
#ifdef MOZ_ENABLE_CANVAS3D
// WebGL Array Types
NS_DEFINE_CONSTRUCTOR_FUNC_DATA(WebGLFloatArray, NS_NewCanvasFloatArray) NS_DEFINE_CONSTRUCTOR_FUNC_DATA(WebGLFloatArray, NS_NewCanvasFloatArray)
NS_DEFINE_CONSTRUCTOR_FUNC_DATA(WebGLByteArray, NS_NewCanvasByteArray) NS_DEFINE_CONSTRUCTOR_FUNC_DATA(WebGLByteArray, NS_NewCanvasByteArray)
NS_DEFINE_CONSTRUCTOR_FUNC_DATA(WebGLUnsignedByteArray, NS_NewCanvasUnsignedByteArray) NS_DEFINE_CONSTRUCTOR_FUNC_DATA(WebGLUnsignedByteArray, NS_NewCanvasUnsignedByteArray)
@ -1390,7 +1383,6 @@ static const nsConstructorFuncMapData kConstructorFuncMap[] =
NS_DEFINE_CONSTRUCTOR_FUNC_DATA(WebGLUnsignedShortArray, NS_NewCanvasUnsignedShortArray) NS_DEFINE_CONSTRUCTOR_FUNC_DATA(WebGLUnsignedShortArray, NS_NewCanvasUnsignedShortArray)
NS_DEFINE_CONSTRUCTOR_FUNC_DATA(WebGLIntArray, NS_NewCanvasIntArray) NS_DEFINE_CONSTRUCTOR_FUNC_DATA(WebGLIntArray, NS_NewCanvasIntArray)
NS_DEFINE_CONSTRUCTOR_FUNC_DATA(WebGLUnsignedIntArray, NS_NewCanvasUnsignedIntArray) NS_DEFINE_CONSTRUCTOR_FUNC_DATA(WebGLUnsignedIntArray, NS_NewCanvasUnsignedIntArray)
#endif
}; };
nsIXPConnect *nsDOMClassInfo::sXPConnect = nsnull; nsIXPConnect *nsDOMClassInfo::sXPConnect = nsnull;
@ -3391,7 +3383,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_END
#ifdef MOZ_ENABLE_CANVAS
DOM_CLASSINFO_MAP_BEGIN(CanvasRenderingContext2D, nsIDOMCanvasRenderingContext2D) DOM_CLASSINFO_MAP_BEGIN(CanvasRenderingContext2D, nsIDOMCanvasRenderingContext2D)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCanvasRenderingContext2D) DOM_CLASSINFO_MAP_ENTRY(nsIDOMCanvasRenderingContext2D)
DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_END
@ -3407,7 +3398,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_BEGIN(TextMetrics, nsIDOMTextMetrics) DOM_CLASSINFO_MAP_BEGIN(TextMetrics, nsIDOMTextMetrics)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMTextMetrics) DOM_CLASSINFO_MAP_ENTRY(nsIDOMTextMetrics)
DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_END
#endif // MOZ_ENABLE_CANVAS
DOM_CLASSINFO_MAP_BEGIN(XSLTProcessor, nsIXSLTProcessor) DOM_CLASSINFO_MAP_BEGIN(XSLTProcessor, nsIXSLTProcessor)
DOM_CLASSINFO_MAP_ENTRY(nsIXSLTProcessor) DOM_CLASSINFO_MAP_ENTRY(nsIXSLTProcessor)
@ -3641,7 +3631,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_END
#ifdef MOZ_ENABLE_CANVAS3D
DOM_CLASSINFO_MAP_BEGIN(CanvasRenderingContextWebGL, nsICanvasRenderingContextWebGL) DOM_CLASSINFO_MAP_BEGIN(CanvasRenderingContextWebGL, nsICanvasRenderingContextWebGL)
DOM_CLASSINFO_MAP_ENTRY(nsICanvasRenderingContextWebGL) DOM_CLASSINFO_MAP_ENTRY(nsICanvasRenderingContextWebGL)
DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_END
@ -3697,7 +3686,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_BEGIN(WebGLUnsignedIntArray, nsIWebGLUnsignedIntArray) DOM_CLASSINFO_MAP_BEGIN(WebGLUnsignedIntArray, nsIWebGLUnsignedIntArray)
DOM_CLASSINFO_MAP_ENTRY(nsIWebGLUnsignedIntArray) DOM_CLASSINFO_MAP_ENTRY(nsIWebGLUnsignedIntArray)
DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_END
#endif
#ifdef NS_DEBUG #ifdef NS_DEBUG
{ {

View File

@ -354,12 +354,10 @@ enum nsDOMClassInfoID {
// Canvas // Canvas
eDOMClassInfo_HTMLCanvasElement_id, eDOMClassInfo_HTMLCanvasElement_id,
#ifdef MOZ_ENABLE_CANVAS
eDOMClassInfo_CanvasRenderingContext2D_id, eDOMClassInfo_CanvasRenderingContext2D_id,
eDOMClassInfo_CanvasGradient_id, eDOMClassInfo_CanvasGradient_id,
eDOMClassInfo_CanvasPattern_id, eDOMClassInfo_CanvasPattern_id,
eDOMClassInfo_TextMetrics_id, eDOMClassInfo_TextMetrics_id,
#endif
// SmartCard Events // SmartCard Events
eDOMClassInfo_SmartCardEvent_id, eDOMClassInfo_SmartCardEvent_id,
@ -463,7 +461,7 @@ enum nsDOMClassInfoID {
eDOMClassInfo_Worker_id, eDOMClassInfo_Worker_id,
#ifdef MOZ_ENABLE_CANVAS3D // WebGL
eDOMClassInfo_CanvasRenderingContextWebGL_id, eDOMClassInfo_CanvasRenderingContextWebGL_id,
eDOMClassInfo_WebGLBuffer_id, eDOMClassInfo_WebGLBuffer_id,
eDOMClassInfo_WebGLTexture_id, eDOMClassInfo_WebGLTexture_id,
@ -472,6 +470,7 @@ enum nsDOMClassInfoID {
eDOMClassInfo_WebGLFramebuffer_id, eDOMClassInfo_WebGLFramebuffer_id,
eDOMClassInfo_WebGLRenderbuffer_id, eDOMClassInfo_WebGLRenderbuffer_id,
// WebGL Buffers
eDOMClassInfo_WebGLFloatArray_id, eDOMClassInfo_WebGLFloatArray_id,
eDOMClassInfo_WebGLByteArray_id, eDOMClassInfo_WebGLByteArray_id,
eDOMClassInfo_WebGLUnsignedByteArray_id, eDOMClassInfo_WebGLUnsignedByteArray_id,
@ -479,7 +478,6 @@ enum nsDOMClassInfoID {
eDOMClassInfo_WebGLUnsignedShortArray_id, eDOMClassInfo_WebGLUnsignedShortArray_id,
eDOMClassInfo_WebGLIntArray_id, eDOMClassInfo_WebGLIntArray_id,
eDOMClassInfo_WebGLUnsignedIntArray_id, eDOMClassInfo_WebGLUnsignedIntArray_id,
#endif
// This one better be the last one in this list // This one better be the last one in this list
eDOMClassInfoIDCount eDOMClassInfoIDCount

View File

@ -46,10 +46,9 @@ MODULE = dom
XPIDL_MODULE = dom_canvas XPIDL_MODULE = dom_canvas
GRE_MODULE = 1 GRE_MODULE = 1
XPIDLSRCS = nsIDOMCanvasRenderingContext2D.idl XPIDLSRCS = \
nsIDOMCanvasRenderingContext2D.idl \
ifdef MOZ_ENABLE_CANVAS3D nsICanvasRenderingContextWebGL.idl \
XPIDLSRCS += nsICanvasRenderingContextWebGL.idl $(NULL)
endif
include $(topsrcdir)/config/rules.mk include $(topsrcdir)/config/rules.mk

View File

@ -71,7 +71,7 @@ EXTRA_DSO_LDOPTS= \
$(MOZ_COMPONENT_LIBS) \ $(MOZ_COMPONENT_LIBS) \
$(NULL) $(NULL)
ifeq (mac,$(MOZ_WIDGET_TOOLKIT)) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
EXTRA_DSO_LDOPTS += $(TK_LIBS) EXTRA_DSO_LDOPTS += $(TK_LIBS)
endif endif

View File

@ -95,7 +95,7 @@ OS_LIBS += $(call EXPAND_LIBNAME,winspool comdlg32)
endif endif
endif endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
LOCAL_INCLUDES += -I$(srcdir)/../printingui/src/mac LOCAL_INCLUDES += -I$(srcdir)/../printingui/src/mac
endif endif
@ -109,7 +109,7 @@ EXTRA_DSO_LDOPTS = \
$(MOZ_JS_LIBS) \ $(MOZ_JS_LIBS) \
$(NULL) $(NULL)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
EXTRA_DSO_LDOPTS += \ EXTRA_DSO_LDOPTS += \
$(TK_LIBS) \ $(TK_LIBS) \
$(NULL) $(NULL)

View File

@ -54,7 +54,7 @@ ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
PLATFORM_DIR = win PLATFORM_DIR = win
endif endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
PLATFORM_DIR = mac PLATFORM_DIR = mac
endif endif

View File

@ -43,7 +43,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk include $(topsrcdir)/config/rules.mk
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
BASEBROWSER = basebrowser-mac-macho BASEBROWSER = basebrowser-mac-macho
CLIENTMANIFEST = client-mac-macho CLIENTMANIFEST = client-mac-macho
_PLATFORM = unix _PLATFORM = unix

View File

@ -81,7 +81,7 @@ EXTRA_DSO_LDOPTS = \
$(NULL) $(NULL)
# Need to link with CoreFoundation on Mac # Need to link with CoreFoundation on Mac
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
EXTRA_DSO_LDOPTS += $(TK_LIBS) EXTRA_DSO_LDOPTS += $(TK_LIBS)
endif endif

View File

@ -78,7 +78,7 @@ AUTOCFG_JS_EXPORTS = \
$(srcdir)/prefcalls.js \ $(srcdir)/prefcalls.js \
$(NULL) $(NULL)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
AUTOCFG_JS_EXPORTS += $(srcdir)/mac/platform.js AUTOCFG_JS_EXPORTS += $(srcdir)/mac/platform.js
else else
ifeq ($(MOZ_WIDGET_TOOLKIT), windows) ifeq ($(MOZ_WIDGET_TOOLKIT), windows)

View File

@ -182,7 +182,7 @@ CSRCS += $(PSPDF_BASE_CSRCS) $(PDF_CSRCS)
EXPORTS_cairo += $(PDF_EXPORTS) EXPORTS_cairo += $(PDF_EXPORTS)
endif endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
CSRCS += cairo-quartz-surface.c cairo-quartz-image-surface.c cairo-quartz-font.c CSRCS += cairo-quartz-surface.c cairo-quartz-image-surface.c cairo-quartz-font.c
EXPORTS_cairo += cairo-quartz.h cairo-quartz-image.h EXPORTS_cairo += cairo-quartz.h cairo-quartz-image.h
endif endif

View File

@ -92,7 +92,7 @@ EXPORTS += gfxPangoFonts.h
EXPORTS += gfxPDFSurface.h EXPORTS += gfxPDFSurface.h
endif endif
ifneq (,$(filter $(MOZ_WIDGET_TOOLKIT),mac cocoa)) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
EXPORTS += gfxPlatformMac.h \ EXPORTS += gfxPlatformMac.h \
gfxQuartzSurface.h \ gfxQuartzSurface.h \
gfxQuartzImageSurface.h \ gfxQuartzImageSurface.h \

View File

@ -341,9 +341,9 @@ cairo_font_face_t *gfxOS2Font::CairoFontFace()
FcPattern *fcPattern = FcPatternCreate(); FcPattern *fcPattern = FcPatternCreate();
// add (family) name to pattern // add (family) name to pattern
// (the conversion should work, font names don't contain high bit chars) // convert name because FC stores it in UTF8 while we have it in UTF16
FcPatternAddString(fcPattern, FC_FAMILY, FcPatternAddString(fcPattern, FC_FAMILY,
(FcChar8 *)NS_LossyConvertUTF16toASCII(GetName()).get()); (FcChar8 *)NS_ConvertUTF16toUTF8(GetName()).get());
// adjust font weight using the offset // adjust font weight using the offset
// The requirements outlined in gfxFont.h are difficult to meet without // The requirements outlined in gfxFont.h are difficult to meet without

View File

@ -55,7 +55,7 @@ CPPSRCS = \
$(NULL) $(NULL)
# see also intl/locale/src/Makefile.in # see also intl/locale/src/Makefile.in
ifneq (,$(filter mac os2 windows, $(MOZ_WIDGET_TOOLKIT))) ifneq (,$(filter os2 windows, $(MOZ_WIDGET_TOOLKIT)))
LOCALE_DIR = $(MOZ_WIDGET_TOOLKIT) LOCALE_DIR = $(MOZ_WIDGET_TOOLKIT)
else else
ifeq ($(MOZ_WIDGET_TOOLKIT), cocoa) ifeq ($(MOZ_WIDGET_TOOLKIT), cocoa)
@ -86,7 +86,7 @@ EXTRA_DSO_LDOPTS = \
$(MOZ_COMPONENT_LIBS) \ $(MOZ_COMPONENT_LIBS) \
$(NULL) $(NULL)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
EXTRA_DSO_LDOPTS += \ EXTRA_DSO_LDOPTS += \
$(TK_LIBS) \ $(TK_LIBS) \
$(NULL) $(NULL)

View File

@ -49,7 +49,7 @@ DIRS = public idl src
ifdef ENABLE_TESTS ifdef ENABLE_TESTS
DIRS += tests DIRS += tests
ifneq (,$(filter mac cocoa windows, $(MOZ_WIDGET_TOOLKIT))) ifneq (,$(filter cocoa windows, $(MOZ_WIDGET_TOOLKIT)))
DIRS += tests_multilocale DIRS += tests_multilocale
endif endif
endif endif

View File

@ -47,7 +47,7 @@ LIBRARY_NAME = nslocale_s
LIBXUL_LIBRARY = 1 LIBXUL_LIBRARY = 1
ifneq (,$(filter mac os2 windows, $(MOZ_WIDGET_TOOLKIT))) ifneq (,$(filter os2 windows, $(MOZ_WIDGET_TOOLKIT)))
DIRS = $(MOZ_WIDGET_TOOLKIT) DIRS = $(MOZ_WIDGET_TOOLKIT)
else else
ifeq ($(MOZ_WIDGET_TOOLKIT), cocoa) ifeq ($(MOZ_WIDGET_TOOLKIT), cocoa)

View File

@ -87,7 +87,7 @@ else
ifeq ($(MOZ_WIDGET_TOOLKIT),windows) ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
CPPSRCS += nsWinCharset.cpp CPPSRCS += nsWinCharset.cpp
else else
ifneq (,$(filter cocoa mac, $(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
CPPSRCS += nsMacCharset.cpp CPPSRCS += nsMacCharset.cpp
else else
ifeq ($(OS_ARCH),BeOS) ifeq ($(OS_ARCH),BeOS)
@ -108,7 +108,7 @@ EXTRA_DSO_LDOPTS = \
LOCAL_INCLUDES = -I$(srcdir)/../util LOCAL_INCLUDES = -I$(srcdir)/../util
ifneq (,$(filter cocoa mac, $(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
EXTRA_DSO_LDOPTS += $(TK_LIBS) EXTRA_DSO_LDOPTS += $(TK_LIBS)
endif endif

View File

@ -57,6 +57,31 @@ function hasAttribute(c, attrname)
return false; return false;
} }
// This is useful for detecting method overrides
function signaturesMatch(m1, m2)
{
if (m1.shortName != m2.shortName)
return false;
if (m1.isVirtual != m2.isVirtual)
return false;
if (m1.isStatic != m2.isStatic)
return false;
let p1 = m1.type.parameters;
let p2 = m2.type.parameters;
if (p1.length != p2.length)
return false;
for (let i = 0; i < p1.length; ++i)
if (p1[i] !== p2[i])
return false;
return true;
}
const forward_functions = [ const forward_functions = [
'process_type', 'process_type',
'process_tree_type', 'process_tree_type',

View File

@ -49,7 +49,7 @@ PROGRAM = xpcshell$(BIN_SUFFIX)
CPPSRCS = xpcshell.cpp CPPSRCS = xpcshell.cpp
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
CMMSRCS += xpcshellMacUtils.mm CMMSRCS += xpcshellMacUtils.mm
endif endif

View File

@ -697,8 +697,10 @@ def writeQuickStub(f, customMethodCalls, member, stubName, isSetter=False):
if isMethod: if isMethod:
code = customMethodCall['code'] code = customMethodCall['code']
elif isGetter:
code = customMethodCall['getter_code']
else: else:
code = customMethodCall['getter_code' if isGetter else 'setter_code'] code = customMethodCall['setter_code']
stubName = templateName stubName = templateName
else: else:
callTemplate = "" callTemplate = ""

View File

@ -197,6 +197,7 @@
#endif #endif
#include "nsPlaceholderFrame.h" #include "nsPlaceholderFrame.h"
#include "nsHTMLFrame.h"
// Content viewer interfaces // Content viewer interfaces
#include "nsIContentViewer.h" #include "nsIContentViewer.h"
@ -5247,12 +5248,23 @@ PresShell::RenderDocument(const nsRect& aRect, PRUint32 aFlags,
(aFlags & RENDER_CARET) != 0); (aFlags & RENDER_CARET) != 0);
nsDisplayList list; nsDisplayList list;
nsRect canvasArea(
builder.ToReferenceFrame(rootFrame), rootFrame->GetSize());
nsRect rect(aRect); nsRect rect(aRect);
nsIFrame* rootScrollFrame = GetRootScrollFrame(); nsIFrame* rootScrollFrame = GetRootScrollFrame();
if ((aFlags & RENDER_IGNORE_VIEWPORT_SCROLLING) && rootScrollFrame) { if ((aFlags & RENDER_IGNORE_VIEWPORT_SCROLLING) && rootScrollFrame) {
nsPoint pos = GetRootScrollFrameAsScrollable()->GetScrollPosition(); nsIScrollableFrame* rootScrollableFrame =
GetRootScrollFrameAsScrollable();
nsPoint pos = rootScrollableFrame->GetScrollPosition();
rect.MoveBy(-pos); rect.MoveBy(-pos);
builder.SetIgnoreScrollFrame(rootScrollFrame); builder.SetIgnoreScrollFrame(rootScrollFrame);
CanvasFrame* canvasFrame =
do_QueryFrame(rootScrollableFrame->GetScrolledFrame());
if (canvasFrame) {
canvasArea = canvasFrame->CanvasArea();
}
} }
builder.SetBackgroundOnly(PR_FALSE); builder.SetBackgroundOnly(PR_FALSE);
@ -5262,7 +5274,7 @@ PresShell::RenderDocument(const nsRect& aRect, PRUint32 aFlags,
// Add the canvas background color. // Add the canvas background color.
nsresult rv = nsresult rv =
rootFrame->PresContext()->PresShell()->AddCanvasBackgroundColorItem( rootFrame->PresContext()->PresShell()->AddCanvasBackgroundColorItem(
builder, list, rootFrame); builder, list, rootFrame, &canvasArea);
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
rv = rootFrame->BuildDisplayListForStackingContext(&builder, rect, &list); rv = rootFrame->BuildDisplayListForStackingContext(&builder, rect, &list);

View File

@ -78,6 +78,7 @@ _TEST_FILES = \
decoration_line_rendering.js \ decoration_line_rendering.js \
test_bug495648.xul \ test_bug495648.xul \
bug495648.rdf \ bug495648.rdf \
test_bug514127.html \
$(NULL) $(NULL)
# test_bug396024.html is currently disabled because it interacts badly with # test_bug396024.html is currently disabled because it interacts badly with
# the "You can't print-preview while the page is loading" dialog. # the "You can't print-preview while the page is loading" dialog.

View File

@ -0,0 +1,50 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=514127
-->
<head>
<title>Test for Bug 514127</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<p><a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=514127">Mozilla Bug 514127</a></p>
<!--
iframe source is
<html><body style='background: rgb(0,0,255); width: 100px; height: 50100px;'></body></html>
-->
<iframe id="source" width="50" height="50"
src="data:text/html,%3Chtml%3E%3Cbody%20style%3D%27background%3A%20rgb%280%2C0%2C255%29%3B%20width%3A%20100px%3B%20height%3A%2050100px%3B%27%3E%3C%2Fbody%3E%3C%2Fhtml%3E"></iframe>
<canvas id="scratch" width="50" height="50"></canvas>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 514127 **/
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var canvas = document.getElementById('scratch');
var source = document.getElementById('source').contentWindow;
var context = canvas.getContext("2d");
context.clearRect(0, 0, canvas.width, canvas.height);
context.drawWindow(source, 25, 50000, canvas.width, canvas.height,
"transparent");
var data = context.getImageData(0, 0, canvas.width, canvas.height).data;
var failed = false;
for (var i = 0; i < data.length; i+=4) {
if (data[i] != 0 || data[i+1] != 0 || data[i+2] != 255 || data[i+3] != 255) {
failed = true;
break;
}
}
ok(!failed, "all pixels blue");
</script>
</pre>
</body>
</html>

View File

@ -224,19 +224,10 @@ EXTRA_DSO_LDOPTS += $(MOZ_QT_LIBS) \
$(NULL) $(NULL)
endif endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
EXTRA_DSO_LDOPTS += $(TK_LIBS) EXTRA_DSO_LDOPTS += $(TK_LIBS)
ifdef MOZ_ENABLE_CANVAS3D
OS_LIBS += -framework OpenGL OS_LIBS += -framework OpenGL
endif endif
endif
ifneq (,$(filter windows,$(MOZ_WIDGET_TOOLKIT)))
ifdef MOZ_ENABLE_CANVAS3D
OS_LIBS += opengl32.lib
endif
endif
# Add explicit X11 dependency when building against X11 toolkits # Add explicit X11 dependency when building against X11 toolkits
ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT))) ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))

View File

@ -206,12 +206,8 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLEditor)
#include "nsHTMLCanvasFrame.h" #include "nsHTMLCanvasFrame.h"
#ifdef MOZ_ENABLE_CANVAS
#include "nsIDOMCanvasRenderingContext2D.h" #include "nsIDOMCanvasRenderingContext2D.h"
#ifdef MOZ_ENABLE_CANVAS3D
#include "nsICanvasRenderingContextWebGL.h" #include "nsICanvasRenderingContextWebGL.h"
#endif
#endif
class nsIDocumentLoaderFactory; class nsIDocumentLoaderFactory;
@ -403,12 +399,8 @@ nsresult NS_NewContainerBoxObject(nsIBoxObject** aResult);
nsresult NS_NewTreeBoxObject(nsIBoxObject** aResult); nsresult NS_NewTreeBoxObject(nsIBoxObject** aResult);
#endif #endif
#ifdef MOZ_ENABLE_CANVAS
nsresult NS_NewCanvasRenderingContext2D(nsIDOMCanvasRenderingContext2D** aResult); nsresult NS_NewCanvasRenderingContext2D(nsIDOMCanvasRenderingContext2D** aResult);
#ifdef MOZ_ENABLE_CANVAS3D
nsresult NS_NewCanvasRenderingContextWebGL(nsICanvasRenderingContextWebGL** aResult); nsresult NS_NewCanvasRenderingContextWebGL(nsICanvasRenderingContextWebGL** aResult);
#endif
#endif
nsresult NS_CreateFrameTraversal(nsIFrameTraversal** aResult); nsresult NS_CreateFrameTraversal(nsIFrameTraversal** aResult);
@ -540,12 +532,8 @@ MAKE_CTOR(CreateVideoDocument, nsIDocument, NS_NewVid
#endif #endif
MAKE_CTOR(CreateFocusManager, nsIFocusManager, NS_NewFocusManager) MAKE_CTOR(CreateFocusManager, nsIFocusManager, NS_NewFocusManager)
#ifdef MOZ_ENABLE_CANVAS
MAKE_CTOR(CreateCanvasRenderingContext2D, nsIDOMCanvasRenderingContext2D, NS_NewCanvasRenderingContext2D) MAKE_CTOR(CreateCanvasRenderingContext2D, nsIDOMCanvasRenderingContext2D, NS_NewCanvasRenderingContext2D)
#ifdef MOZ_ENABLE_CANVAS3D
MAKE_CTOR(CreateCanvasRenderingContextWebGL, nsICanvasRenderingContextWebGL, NS_NewCanvasRenderingContextWebGL) MAKE_CTOR(CreateCanvasRenderingContextWebGL, nsICanvasRenderingContextWebGL, NS_NewCanvasRenderingContextWebGL)
#endif
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsStyleSheetService, Init) NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsStyleSheetService, Init)
@ -1075,18 +1063,14 @@ static const nsModuleComponentInfo gComponents[] = {
UnregisterHTMLAudioElement }, UnregisterHTMLAudioElement },
#endif #endif
#ifdef MOZ_ENABLE_CANVAS
{ "Canvas 2D Rendering Context", { "Canvas 2D Rendering Context",
NS_CANVASRENDERINGCONTEXT2D_CID, NS_CANVASRENDERINGCONTEXT2D_CID,
"@mozilla.org/content/canvas-rendering-context;1?id=2d", "@mozilla.org/content/canvas-rendering-context;1?id=2d",
CreateCanvasRenderingContext2D }, CreateCanvasRenderingContext2D },
#ifdef MOZ_ENABLE_CANVAS3D
{ "Canvas WebGL Rendering Context", { "Canvas WebGL Rendering Context",
NS_CANVASRENDERINGCONTEXTWEBGL_CID, NS_CANVASRENDERINGCONTEXTWEBGL_CID,
"@mozilla.org/content/canvas-rendering-context;1?id=moz-webgl", "@mozilla.org/content/canvas-rendering-context;1?id=moz-webgl",
CreateCanvasRenderingContextWebGL }, CreateCanvasRenderingContextWebGL },
#endif
#endif
{ "XML document encoder", { "XML document encoder",
NS_TEXT_ENCODER_CID, NS_TEXT_ENCODER_CID,

View File

@ -37,6 +37,7 @@
/* rendering object that goes directly inside the document's scrollbars */ /* rendering object that goes directly inside the document's scrollbars */
#include "nsHTMLFrame.h"
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
#include "nsHTMLParts.h" #include "nsHTMLParts.h"
#include "nsHTMLContainerFrame.h" #include "nsHTMLContainerFrame.h"
@ -70,121 +71,6 @@
#define CANVAS_ABS_POS_CHILD_LIST NS_CONTAINER_LIST_COUNT_INCL_OC #define CANVAS_ABS_POS_CHILD_LIST NS_CONTAINER_LIST_COUNT_INCL_OC
// Interface IDs
/**
* Root frame class.
*
* The root frame is the parent frame for the document element's frame.
* It only supports having a single child frame which must be an area
* frame
*/
class CanvasFrame : public nsHTMLContainerFrame,
public nsIScrollPositionListener,
public nsICanvasFrame {
public:
CanvasFrame(nsStyleContext* aContext)
: nsHTMLContainerFrame(aContext), mDoPaintFocus(PR_FALSE),
mAbsoluteContainer(nsGkAtoms::absoluteList) {}
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
// nsISupports (nsIScrollPositionListener)
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
virtual void Destroy();
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsFrameList& aChildList);
NS_IMETHOD AppendFrames(nsIAtom* aListName,
nsFrameList& aFrameList);
NS_IMETHOD InsertFrames(nsIAtom* aListName,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList);
NS_IMETHOD RemoveFrame(nsIAtom* aListName,
nsIFrame* aOldFrame);
virtual nsIAtom* GetAdditionalChildListName(PRInt32 aIndex) const;
virtual nsFrameList GetChildList(nsIAtom* aListName) const;
virtual nscoord GetMinWidth(nsIRenderingContext *aRenderingContext);
virtual nscoord GetPrefWidth(nsIRenderingContext *aRenderingContext);
NS_IMETHOD Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
virtual PRBool IsContainingBlock() const { return PR_TRUE; }
virtual PRBool IsFrameOfType(PRUint32 aFlags) const
{
return nsHTMLContainerFrame::IsFrameOfType(aFlags &
~(nsIFrame::eCanContainOverflowContainers));
}
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists);
void PaintFocus(nsIRenderingContext& aRenderingContext, nsPoint aPt);
// nsIScrollPositionListener
NS_IMETHOD ScrollPositionWillChange(nsIScrollableView* aScrollable, nscoord aX, nscoord aY);
virtual void ViewPositionDidChange(nsIScrollableView* aScrollable,
nsTArray<nsIWidget::Configuration>* aConfigurations) {}
NS_IMETHOD ScrollPositionDidChange(nsIScrollableView* aScrollable, nscoord aX, nscoord aY);
// nsICanvasFrame
NS_IMETHOD SetHasFocus(PRBool aHasFocus);
/**
* Get the "type" of the frame
*
* @see nsGkAtoms::canvasFrame
*/
virtual nsIAtom* GetType() const;
virtual nsresult StealFrame(nsPresContext* aPresContext,
nsIFrame* aChild,
PRBool aForceNormal)
{
NS_ASSERTION(!aForceNormal, "No-one should be passing this in here");
// CanvasFrame keeps overflow container continuations of its child
// frame in main child list
nsresult rv = nsContainerFrame::StealFrame(aPresContext, aChild, PR_TRUE);
if (NS_FAILED(rv)) {
rv = nsContainerFrame::StealFrame(aPresContext, aChild);
}
return rv;
}
#ifdef DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const;
#endif
NS_IMETHOD GetContentForEvent(nsPresContext* aPresContext,
nsEvent* aEvent,
nsIContent** aContent);
nsRect CanvasArea() const;
protected:
virtual PRIntn GetSkipSides() const;
// Data members
PRPackedBool mDoPaintFocus;
nsCOMPtr<nsIViewManager> mViewManager;
nsAbsoluteContainingBlock mAbsoluteContainer;
private:
NS_IMETHOD_(nsrefcnt) AddRef() { return NS_OK; }
NS_IMETHOD_(nsrefcnt) Release() { return NS_OK; }
};
//----------------------------------------------------------------------
nsIFrame* nsIFrame*
NS_NewCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) NS_NewCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
@ -197,6 +83,7 @@ NS_IMPL_FRAMEARENA_HELPERS(CanvasFrame)
NS_IMPL_QUERY_INTERFACE1(CanvasFrame, nsIScrollPositionListener) NS_IMPL_QUERY_INTERFACE1(CanvasFrame, nsIScrollPositionListener)
NS_QUERYFRAME_HEAD(CanvasFrame) NS_QUERYFRAME_HEAD(CanvasFrame)
NS_QUERYFRAME_ENTRY(CanvasFrame)
NS_QUERYFRAME_ENTRY(nsICanvasFrame) NS_QUERYFRAME_ENTRY(nsICanvasFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame) NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame)

View File

@ -0,0 +1,172 @@
/* -*- 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
*
* 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 ***** */
/* rendering object that goes directly inside the document's scrollbars */
#ifndef nsHTMLFrame_h___
#define nsHTMLFrame_h___
#include "nsHTMLContainerFrame.h"
#include "nsPresContext.h"
#include "nsStyleContext.h"
#include "nsIView.h"
#include "nsIViewManager.h"
#include "nsIRenderingContext.h"
#include "nsGUIEvent.h"
#include "nsGkAtoms.h"
#include "nsIScrollPositionListener.h"
#include "nsDisplayList.h"
#include "nsAbsoluteContainingBlock.h"
// for focus
#include "nsIScrollableView.h"
#include "nsICanvasFrame.h"
/**
* Root frame class.
*
* The root frame is the parent frame for the document element's frame.
* It only supports having a single child frame which must be an area
* frame
*/
class CanvasFrame : public nsHTMLContainerFrame,
public nsIScrollPositionListener,
public nsICanvasFrame {
public:
CanvasFrame(nsStyleContext* aContext)
: nsHTMLContainerFrame(aContext), mDoPaintFocus(PR_FALSE),
mAbsoluteContainer(nsGkAtoms::absoluteList) {}
NS_DECL_QUERYFRAME_TARGET(CanvasFrame)
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
// nsISupports (nsIScrollPositionListener)
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
virtual void Destroy();
NS_IMETHOD SetInitialChildList(nsIAtom* aListName,
nsFrameList& aChildList);
NS_IMETHOD AppendFrames(nsIAtom* aListName,
nsFrameList& aFrameList);
NS_IMETHOD InsertFrames(nsIAtom* aListName,
nsIFrame* aPrevFrame,
nsFrameList& aFrameList);
NS_IMETHOD RemoveFrame(nsIAtom* aListName,
nsIFrame* aOldFrame);
virtual nsIAtom* GetAdditionalChildListName(PRInt32 aIndex) const;
virtual nsFrameList GetChildList(nsIAtom* aListName) const;
virtual nscoord GetMinWidth(nsIRenderingContext *aRenderingContext);
virtual nscoord GetPrefWidth(nsIRenderingContext *aRenderingContext);
NS_IMETHOD Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
virtual PRBool IsContainingBlock() const { return PR_TRUE; }
virtual PRBool IsFrameOfType(PRUint32 aFlags) const
{
return nsHTMLContainerFrame::IsFrameOfType(aFlags &
~(nsIFrame::eCanContainOverflowContainers));
}
NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists);
void PaintFocus(nsIRenderingContext& aRenderingContext, nsPoint aPt);
// nsIScrollPositionListener
NS_IMETHOD ScrollPositionWillChange(nsIScrollableView* aScrollable, nscoord aX, nscoord aY);
virtual void ViewPositionDidChange(nsIScrollableView* aScrollable,
nsTArray<nsIWidget::Configuration>* aConfigurations) {}
NS_IMETHOD ScrollPositionDidChange(nsIScrollableView* aScrollable, nscoord aX, nscoord aY);
// nsICanvasFrame
NS_IMETHOD SetHasFocus(PRBool aHasFocus);
/**
* Get the "type" of the frame
*
* @see nsGkAtoms::canvasFrame
*/
virtual nsIAtom* GetType() const;
virtual nsresult StealFrame(nsPresContext* aPresContext,
nsIFrame* aChild,
PRBool aForceNormal)
{
NS_ASSERTION(!aForceNormal, "No-one should be passing this in here");
// CanvasFrame keeps overflow container continuations of its child
// frame in main child list
nsresult rv = nsContainerFrame::StealFrame(aPresContext, aChild, PR_TRUE);
if (NS_FAILED(rv)) {
rv = nsContainerFrame::StealFrame(aPresContext, aChild);
}
return rv;
}
#ifdef DEBUG
NS_IMETHOD GetFrameName(nsAString& aResult) const;
#endif
NS_IMETHOD GetContentForEvent(nsPresContext* aPresContext,
nsEvent* aEvent,
nsIContent** aContent);
nsRect CanvasArea() const;
protected:
virtual PRIntn GetSkipSides() const;
// Data members
PRPackedBool mDoPaintFocus;
nsCOMPtr<nsIViewManager> mViewManager;
nsAbsoluteContainingBlock mAbsoluteContainer;
private:
NS_IMETHOD_(nsrefcnt) AddRef() { return NS_OK; }
NS_IMETHOD_(nsrefcnt) Release() { return NS_OK; }
};
#endif /* nsHTMLFrame_h___ */

View File

@ -58,7 +58,7 @@ endif
ifeq ($(OS_ARCH),BeOS) ifeq ($(OS_ARCH),BeOS)
DIRS = icon/beos icon DIRS = icon/beos icon
endif endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
DIRS = icon/mac icon DIRS = icon/mac icon
endif endif
endif # icon endif # icon

View File

@ -2215,7 +2215,16 @@ imgContainer::RequestDecode()
if (mDecoded) if (mDecoded)
return NS_OK; return NS_OK;
// If we're within the decoder, request asynchronously // If we've already got a full decoder running, we have nothing to do
if (mDecoder && !(mDecoderFlags & imgIDecoder::DECODER_FLAG_HEADERONLY))
return NS_OK;
// If our callstack goes through a header-only decoder, we have a problem.
// We need to shutdown the header-only decoder and replace it with a full
// decoder, but can't do that from within the decoder itself. Thus, we post
// an asynchronous event to the event loop to do it later. Since
// RequestDecode() is an asynchronous function this works fine (though it's
// a little slower).
if (mInDecoder) { if (mInDecoder) {
nsRefPtr<imgDecodeRequestor> requestor = new imgDecodeRequestor(this); nsRefPtr<imgDecodeRequestor> requestor = new imgDecodeRequestor(this);
if (!requestor) if (!requestor)

View File

@ -72,7 +72,7 @@ ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
CPPSRCS += nsPluginsDirOS2.cpp CPPSRCS += nsPluginsDirOS2.cpp
CPPSRCS += nsPluginNativeWindowOS2.cpp CPPSRCS += nsPluginNativeWindowOS2.cpp
else else
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
CPPSRCS += nsPluginsDirDarwin.cpp CPPSRCS += nsPluginsDirDarwin.cpp
CPPSRCS += nsPluginNativeWindow.cpp CPPSRCS += nsPluginNativeWindow.cpp
else else
@ -101,7 +101,7 @@ EXTRA_DSO_LDOPTS = \
$(MOZ_JS_LIBS) \ $(MOZ_JS_LIBS) \
$(NULL) $(NULL)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
EXTRA_DSO_LDOPTS += $(TK_LIBS) EXTRA_DSO_LDOPTS += $(TK_LIBS)
endif endif

View File

@ -101,7 +101,7 @@ else
CPPSRCS += nsAutodialWinCE.cpp CPPSRCS += nsAutodialWinCE.cpp
endif endif
else else
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
CPPSRCS += nsURLHelperOSX.cpp CPPSRCS += nsURLHelperOSX.cpp
else else
CPPSRCS += nsURLHelperUnix.cpp CPPSRCS += nsURLHelperUnix.cpp

View File

@ -135,7 +135,7 @@ EXTRA_DSO_LDOPTS = \
$(ZLIB_LIBS) \ $(ZLIB_LIBS) \
$(NULL) $(NULL)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)))
EXTRA_DSO_LDOPTS += \ EXTRA_DSO_LDOPTS += \
-framework SystemConfiguration \ -framework SystemConfiguration \
$(TK_LIBS) \ $(TK_LIBS) \

View File

@ -75,7 +75,7 @@ CPPSRCS += \
$(NULL) $(NULL)
endif endif
ifeq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
CPPSRCS += \ CPPSRCS += \
nsBinHexDecoder.cpp \ nsBinHexDecoder.cpp \
$(NULL) $(NULL)

View File

@ -122,7 +122,7 @@ EXTRA_DSO_LDOPTS += \
$(MOZ_JS_LIBS) \ $(MOZ_JS_LIBS) \
$(NULL) $(NULL)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
EXTRA_DSO_LDOPTS += $(TK_LIBS) EXTRA_DSO_LDOPTS += $(TK_LIBS)
endif endif

View File

@ -63,7 +63,7 @@ EXTRA_DSO_LDOPTS += \
$(MOZ_COMPONENT_LIBS) \ $(MOZ_COMPONENT_LIBS) \
$(NULL) $(NULL)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
EXTRA_DSO_LDOPTS += $(TK_LIBS) EXTRA_DSO_LDOPTS += $(TK_LIBS)
endif endif

View File

@ -44,7 +44,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk include $(DEPTH)/config/autoconf.mk
ifdef MOZ_XUL ifdef MOZ_XUL
ifeq (,$(filter qt beos os2 mac photon cocoa windows,$(MOZ_WIDGET_TOOLKIT))) ifeq (,$(filter qt beos os2 photon cocoa windows,$(MOZ_WIDGET_TOOLKIT)))
DIRS = public src DIRS = public src
endif endif
endif endif

View File

@ -90,8 +90,8 @@ function test() {
info("new load count is " + loadCount); info("new load count is " + loadCount);
if (loadCount == 3) { if (loadCount == 3) {
window.getBrowser().removeEventListener("DOMContentLoaded", handleLoad, true); gBrowser.removeEventListener("DOMContentLoaded", handleLoad, true);
window.content.document.location.href = "about:blank"; content.location.href = "about:blank";
executeSoon(check_next_uri); executeSoon(check_next_uri);
} }
} }
@ -100,8 +100,8 @@ function test() {
if (URIs.length) { if (URIs.length) {
let uri = URIs.shift(); let uri = URIs.shift();
loadCount = 0; loadCount = 0;
window.getBrowser().addEventListener("DOMContentLoaded", handleLoad, true); gBrowser.addEventListener("DOMContentLoaded", handleLoad, true);
window.content.document.location.href = uri; content.location.href = uri;
} }
else { else {
setTimeout(confirm_results, LAZY_ADD_TIMER * 2); setTimeout(confirm_results, LAZY_ADD_TIMER * 2);

View File

@ -57,7 +57,7 @@ else
ifeq (,$(filter-out WINCE WINNT,$(OS_ARCH))) ifeq (,$(filter-out WINCE WINNT,$(OS_ARCH)))
CPPSRCS += nsUserInfoWin.cpp CPPSRCS += nsUserInfoWin.cpp
else else
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
CMMSRCS += nsUserInfoMac.mm CMMSRCS += nsUserInfoMac.mm
else else
CPPSRCS += nsUserInfoUnix.cpp CPPSRCS += nsUserInfoUnix.cpp

View File

@ -95,7 +95,7 @@ _TEST_FILES = findbar_window.xul \
# test_panel_focus.xul won't work if the Full Keyboard Access preference is set to # test_panel_focus.xul won't work if the Full Keyboard Access preference is set to
# textboxes and lists only, so skip this test on Mac # textboxes and lists only, so skip this test on Mac
ifeq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
_TEST_FILES += test_panel_focus.xul \ _TEST_FILES += test_panel_focus.xul \
window_panel_focus.xul window_panel_focus.xul
else else

View File

@ -135,7 +135,7 @@ _TEST_FILES = test_bug360220.xul \
videomask.css \ videomask.css \
$(NULL) $(NULL)
ifeq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
_TEST_FILES += test_menubar.xul \ _TEST_FILES += test_menubar.xul \
window_menubar.xul window_menubar.xul
endif endif

View File

@ -148,12 +148,6 @@ COMPONENT_LIBS += \
pipnss \ pipnss \
$(NULL) $(NULL)
ifdef MOZ_XMLEXTRAS
COMPONENT_LIBS += \
xmlextras \
$(NULL)
endif
ifdef MOZ_PLUGINS ifdef MOZ_PLUGINS
DEFINES += -DMOZ_PLUGINS DEFINES += -DMOZ_PLUGINS
COMPONENT_LIBS += \ COMPONENT_LIBS += \
@ -218,13 +212,6 @@ COMPONENT_LIBS += \
$(NULL) $(NULL)
endif endif
ifdef MOZ_WEBSERVICES
DEFINES += -DMOZ_WEBSERVICES
COMPONENT_LIBS += \
websrvcs \
$(NULL)
endif
ifdef MOZ_AUTH_EXTENSION ifdef MOZ_AUTH_EXTENSION
COMPONENT_LIBS += auth COMPONENT_LIBS += auth
DEFINES += -DMOZ_AUTH_EXTENSION DEFINES += -DMOZ_AUTH_EXTENSION
@ -258,7 +245,7 @@ COMPONENT_LIBS += \
endif endif
endif endif
ifeq (,$(filter qt beos os2 mac photon cocoa windows,$(MOZ_WIDGET_TOOLKIT))) ifeq (,$(filter qt beos os2 photon cocoa windows,$(MOZ_WIDGET_TOOLKIT)))
ifdef MOZ_XUL ifdef MOZ_XUL
ifdef MOZ_XPFE_COMPONENTS ifdef MOZ_XPFE_COMPONENTS
COMPONENT_LIBS += fileview COMPONENT_LIBS += fileview
@ -337,7 +324,7 @@ endif
ifeq (os2,$(MOZ_WIDGET_TOOLKIT)) ifeq (os2,$(MOZ_WIDGET_TOOLKIT))
COMPONENT_LIBS += wdgtos2 COMPONENT_LIBS += wdgtos2
endif endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
COMPONENT_LIBS += widget_mac COMPONENT_LIBS += widget_mac
endif endif
ifeq (qt,$(MOZ_WIDGET_TOOLKIT)) ifeq (qt,$(MOZ_WIDGET_TOOLKIT))
@ -370,9 +357,6 @@ ifneq (,$(filter layout-debug,$(MOZ_EXTENSIONS)))
COMPONENT_LIBS += gkdebug COMPONENT_LIBS += gkdebug
endif endif
ifdef MOZ_ENABLE_CANVAS3D
ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa) ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
EXTRA_DSO_LDOPTS += -framework OpenGL EXTRA_DSO_LDOPTS += -framework OpenGL
endif endif
endif

View File

@ -77,12 +77,9 @@ DEFINES += \
ifeq ($(MOZ_WIDGET_TOOLKIT),windows) ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
ifneq ($(OS_ARCH),WINCE) ifneq ($(OS_ARCH),WINCE)
OS_LIBS += $(call EXPAND_LIBNAME,usp10 oleaut32) OS_LIBS += $(call EXPAND_LIBNAME,usp10 oleaut32)
ifdef MOZ_ENABLE_CANVAS3D
OS_LIBS += $(call EXPAND_LIBNAME,opengl32)
endif endif
endif endif
endif ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
ifneq (,$(filter $(MOZ_WIDGET_TOOLKIT),mac cocoa))
EXTRA_DSO_LDOPTS += -lcups EXTRA_DSO_LDOPTS += -lcups
endif endif

View File

@ -148,13 +148,6 @@
#define PLUGINS_MODULES #define PLUGINS_MODULES
#endif #endif
#ifdef MOZ_WEBSERVICES
#define WEBSERVICES_MODULES \
MODULE(nsWebServicesModule)
#else
#define WEBSERVICES_MODULES
#endif
#ifdef MOZ_XPFE_COMPONENTS #ifdef MOZ_XPFE_COMPONENTS
#ifdef MOZ_RDF #ifdef MOZ_RDF
#define RDFAPP_MODULES \ #define RDFAPP_MODULES \
@ -230,12 +223,6 @@
#define SPELLCHECK_MODULE #define SPELLCHECK_MODULE
#endif #endif
#ifdef MOZ_XMLEXTRAS
#define XMLEXTRAS_MODULE MODULE(nsXMLExtrasModule)
#else
#define XMLEXTRAS_MODULE
#endif
#ifdef MOZ_XUL #ifdef MOZ_XUL
#ifdef MOZ_ENABLE_GTK2 #ifdef MOZ_ENABLE_GTK2
#define UNIXPROXY_MODULE MODULE(nsUnixProxyModule) #define UNIXPROXY_MODULE MODULE(nsUnixProxyModule)
@ -283,7 +270,6 @@
ICON_MODULE \ ICON_MODULE \
PLUGINS_MODULES \ PLUGINS_MODULES \
MODULE(nsLayoutModule) \ MODULE(nsLayoutModule) \
WEBSERVICES_MODULES \
MODULE(docshell_provider) \ MODULE(docshell_provider) \
MODULE(embedcomponents) \ MODULE(embedcomponents) \
MODULE(Browser_Embedding_Module) \ MODULE(Browser_Embedding_Module) \
@ -307,7 +293,6 @@
MODULE(NSS) \ MODULE(NSS) \
SYSTEMPREF_MODULES \ SYSTEMPREF_MODULES \
SPELLCHECK_MODULE \ SPELLCHECK_MODULE \
XMLEXTRAS_MODULE \
LAYOUT_DEBUG_MODULE \ LAYOUT_DEBUG_MODULE \
UNIXPROXY_MODULE \ UNIXPROXY_MODULE \
OSXPROXY_MODULE \ OSXPROXY_MODULE \

View File

@ -76,7 +76,7 @@ endif
ifdef MOZ_CRASHREPORTER ifdef MOZ_CRASHREPORTER
libs:: crashreporter.ini libs:: crashreporter.ini
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/crashreporter.app/Contents/MacOS $(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/crashreporter.app/Contents/MacOS
else else
$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET) $(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)

View File

@ -98,7 +98,7 @@ PACKAGER_NO_LIBS = 1
include $(topsrcdir)/toolkit/mozapps/installer/packager.mk include $(topsrcdir)/toolkit/mozapps/installer/packager.mk
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
STAGEDIST = $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_APPNAME)/$(_APPNAME)/Contents/MacOS STAGEDIST = $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_APPNAME)/$(_APPNAME)/Contents/MacOS
else else
STAGEDIST = $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_DIR) STAGEDIST = $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_DIR)
@ -108,7 +108,7 @@ $(STAGEDIST): AB_CD:=en-US
$(STAGEDIST): UNPACKAGE=$(ZIP_IN) $(STAGEDIST): UNPACKAGE=$(ZIP_IN)
$(STAGEDIST): $(ZIP_IN) $(STAGEDIST): $(ZIP_IN)
# only mac needs to remove the parent of STAGEDIST... # only mac needs to remove the parent of STAGEDIST...
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
$(RM) -r -v $(DIST)/l10n-stage $(RM) -r -v $(DIST)/l10n-stage
else else
# ... and windows doesn't like removing STAGEDIST itself, remove all children # ... and windows doesn't like removing STAGEDIST itself, remove all children
@ -133,7 +133,7 @@ repackage-zip:
cd $(DIST)/xpi-stage/locale-$(AB_CD) && \ cd $(DIST)/xpi-stage/locale-$(AB_CD) && \
tar --exclude=install.rdf --exclude=chrome.manifest $(TAR_CREATE_FLAGS) - * | ( cd $(STAGEDIST) && tar -xf - ) tar --exclude=install.rdf --exclude=chrome.manifest $(TAR_CREATE_FLAGS) - * | ( cd $(STAGEDIST) && tar -xf - )
ifneq (en,$(AB)) ifneq (en,$(AB))
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
mv $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_APPNAME)/$(_APPNAME)/Contents/Resources/en.lproj $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_APPNAME)/$(_APPNAME)/Contents/Resources/$(AB).lproj mv $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_APPNAME)/$(_APPNAME)/Contents/Resources/en.lproj $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_APPNAME)/$(_APPNAME)/Contents/Resources/$(AB).lproj
endif endif
endif endif
@ -148,7 +148,7 @@ ifdef MOZ_MAKE_COMPLETE_MAR
endif endif
# packaging done, undo l10n stuff # packaging done, undo l10n stuff
ifneq (en,$(AB)) ifneq (en,$(AB))
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
mv $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_APPNAME)/$(_APPNAME)/Contents/Resources/$(AB).lproj $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_APPNAME)/$(_APPNAME)/Contents/Resources/en.lproj mv $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_APPNAME)/$(_APPNAME)/Contents/Resources/$(AB).lproj $(_ABS_DIST)/l10n-stage/$(MOZ_PKG_APPNAME)/$(_APPNAME)/Contents/Resources/en.lproj
endif endif
endif endif

View File

@ -61,7 +61,7 @@ var timerService = {
while (entries.hasMoreElements()) { while (entries.hasMoreElements()) {
var entry = entries.getNext().QueryInterface(Components.interfaces.nsISupportsCString).data; var entry = entries.getNext().QueryInterface(Components.interfaces.nsISupportsCString).data;
var value = catMan.getCategoryEntry(CATEGORY_UPDATE_TIMER, entry); var value = catMan.getCategoryEntry(CATEGORY_UPDATE_TIMER, entry);
var timerID = value.split(",")[3]; var timerID = value.split(",")[2];
if (id == timerID) { if (id == timerID) {
return true; return true;
} }

View File

@ -43,7 +43,7 @@ include $(MOZILLA_DIR)/toolkit/mozapps/installer/package-name.mk
# This is how we create the binary packages we release to the public. # This is how we create the binary packages we release to the public.
ifndef MOZ_PKG_FORMAT ifndef MOZ_PKG_FORMAT
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
MOZ_PKG_FORMAT = DMG MOZ_PKG_FORMAT = DMG
else else
ifeq (,$(filter-out OS2 WINNT WINCE BeOS, $(OS_ARCH))) ifeq (,$(filter-out OS2 WINNT WINCE BeOS, $(OS_ARCH)))

View File

@ -106,7 +106,7 @@ OS_CXXFLAGS += $(TK_CFLAGS)
OS_LIBS += $(TK_LIBS) OS_LIBS += $(TK_LIBS)
endif endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
HAVE_PROGRESSUI = 1 HAVE_PROGRESSUI = 1
CMMSRCS += progressui_osx.mm launchchild_osx.mm CMMSRCS += progressui_osx.mm launchchild_osx.mm
OS_LIBS += -framework Cocoa OS_LIBS += -framework Cocoa
@ -142,7 +142,7 @@ libs:: updater.png
$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/icons $(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/icons
endif endif
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
libs:: libs::
$(NSINSTALL) -D $(DIST)/bin/updater.app $(NSINSTALL) -D $(DIST)/bin/updater.app
rsync -a -C --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/bin/updater.app rsync -a -C --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/bin/updater.app

View File

@ -45,7 +45,7 @@ include $(DEPTH)/config/autoconf.mk
DIRS = public src DIRS = public src
# Use Qute for non-Mac non-Phoenix apps # Use Qute for non-Mac non-Phoenix apps
ifeq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT)))
ifndef MOZ_PHOENIX ifndef MOZ_PHOENIX
DIRS += skin DIRS += skin
endif endif

View File

@ -52,7 +52,7 @@ include $(DEPTH)/config/autoconf.mk
# PMStripe overrides (toolkit/themes/pmstripe) # PMStripe overrides (toolkit/themes/pmstripe)
# faststripe Winstripe + faststripe (no native theme components) # faststripe Winstripe + faststripe (no native theme components)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
DIRS = pinstripe DIRS = pinstripe
else else

View File

@ -153,14 +153,6 @@ tier_gecko_dirs += \
xpfe/appshell \ xpfe/appshell \
$(NULL) $(NULL)
ifdef MOZ_XMLEXTRAS
tier_gecko_dirs += extensions/xmlextras
endif
ifdef MOZ_WEBSERVICES
tier_gecko_dirs += extensions/webservices
endif
ifdef MOZ_UNIVERSALCHARDET ifdef MOZ_UNIVERSALCHARDET
tier_gecko_dirs += extensions/universalchardet tier_gecko_dirs += extensions/universalchardet
endif endif

View File

@ -77,7 +77,7 @@ endif
include $(topsrcdir)/config/config.mk include $(topsrcdir)/config/config.mk
ifdef MOZ_ENABLE_LIBXUL ifdef MOZ_ENABLE_LIBXUL
ifeq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
EXTRA_DSO_LIBS = xul EXTRA_DSO_LIBS = xul
endif endif
endif endif
@ -92,7 +92,7 @@ LIBS += \
$(NULL) $(NULL)
ifdef MOZ_ENABLE_LIBXUL ifdef MOZ_ENABLE_LIBXUL
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
LIBS += $(DIST)/bin/XUL LIBS += $(DIST)/bin/XUL
endif endif
endif endif

View File

@ -53,7 +53,7 @@ PACKAGE_BASE_DIR = $(DIST)
# Default output location for update archive # Default output location for update archive
STAGE_DIR = $(DIST)/$(PKG_UPDATE_PATH) STAGE_DIR = $(DIST)/$(PKG_UPDATE_PATH)
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
ifdef UNIVERSAL_BINARY ifdef UNIVERSAL_BINARY
ifneq (,$(filter %/l10n-stage,$(PACKAGE_BASE_DIR))) ifneq (,$(filter %/l10n-stage,$(PACKAGE_BASE_DIR)))
PACKAGE_DIR = $(PACKAGE_BASE_DIR)/$(MOZ_PKG_APPNAME)/$(MOZ_APP_DISPLAYNAME).app PACKAGE_DIR = $(PACKAGE_BASE_DIR)/$(MOZ_PKG_APPNAME)/$(MOZ_APP_DISPLAYNAME).app

Some files were not shown because too many files have changed in this diff Show More