Merge last PGO green changeset from mozilla-inbound to mozilla-central

This commit is contained in:
Mike Hommey 2012-06-20 10:53:31 +02:00
commit e1f994d15f
329 changed files with 4075 additions and 2442 deletions

View File

@ -166,6 +166,7 @@ endif
OBJCOPY="$(OBJCOPY)" \ OBJCOPY="$(OBJCOPY)" \
$(PYTHON) $(topsrcdir)/toolkit/crashreporter/tools/symbolstore.py \ $(PYTHON) $(topsrcdir)/toolkit/crashreporter/tools/symbolstore.py \
$(MAKE_SYM_STORE_ARGS) \ $(MAKE_SYM_STORE_ARGS) \
--exclude="*test*" --exclude="*Test*" \
$(foreach dir,$(SYM_STORE_SOURCE_DIRS),-s $(dir)) \ $(foreach dir,$(SYM_STORE_SOURCE_DIRS),-s $(dir)) \
$(DUMP_SYMS_BIN) \ $(DUMP_SYMS_BIN) \
$(DIST)/crashreporter-symbols \ $(DIST)/crashreporter-symbols \

View File

@ -63,6 +63,7 @@
#include "nsTextFragment.h" #include "nsTextFragment.h"
#include "mozilla/FunctionTimer.h" #include "mozilla/FunctionTimer.h"
#include "mozilla/dom/Element.h" #include "mozilla/dom/Element.h"
#include "mozilla/Preferences.h"
#include "mozilla/Services.h" #include "mozilla/Services.h"
#include "mozilla/Util.h" #include "mozilla/Util.h"
@ -1819,8 +1820,30 @@ nsAccessibilityService::CreateAccessibleForXULTree(nsIContent* aContent,
// Services // Services
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
mozilla::a11y::FocusManager* namespace mozilla {
mozilla::a11y::FocusMgr() namespace a11y {
FocusManager*
FocusMgr()
{ {
return nsAccessibilityService::gAccessibilityService; return nsAccessibilityService::gAccessibilityService;
} }
EPlatformDisabledState
PlatformDisabledState()
{
static int disabledState = 0xff;
if (disabledState == 0xff) {
disabledState = Preferences::GetInt("accessibility.force_disabled", 0);
if (disabledState < ePlatformIsForceEnabled)
disabledState = ePlatformIsForceEnabled;
else if (disabledState > ePlatformIsDisabled)
disabledState = ePlatformIsDisabled;
}
return (EPlatformDisabledState)disabledState;
}
}
}

View File

@ -26,6 +26,17 @@ namespace a11y {
*/ */
FocusManager* FocusMgr(); FocusManager* FocusMgr();
enum EPlatformDisabledState {
ePlatformIsForceEnabled = -1,
ePlatformIsEnabled = 0,
ePlatformIsDisabled = 1
};
/**
* Return the platform disabled state.
*/
EPlatformDisabledState PlatformDisabledState();
#ifdef MOZ_ACCESSIBILITY_ATK #ifdef MOZ_ACCESSIBILITY_ATK
/** /**
* Perform initialization that should be done as soon as possible, in order * Perform initialization that should be done as soon as possible, in order

View File

@ -155,7 +155,11 @@ nsAccessiblePivot::SetTextRange(nsIAccessibleText* aTextAccessible,
(aStartOffset >= 0 || (aStartOffset != -1 && aEndOffset != -1)), (aStartOffset >= 0 || (aStartOffset != -1 && aEndOffset != -1)),
NS_ERROR_INVALID_ARG); NS_ERROR_INVALID_ARG);
nsRefPtr<HyperTextAccessible> newPosition = do_QueryObject(aTextAccessible); nsRefPtr<Accessible> acc(do_QueryObject(aTextAccessible));
if (!acc)
return NS_ERROR_INVALID_ARG;
HyperTextAccessible* newPosition = acc->AsHyperText();
if (!newPosition || !IsRootDescendant(newPosition)) if (!newPosition || !IsRootDescendant(newPosition))
return NS_ERROR_INVALID_ARG; return NS_ERROR_INVALID_ARG;
@ -170,7 +174,7 @@ nsAccessiblePivot::SetTextRange(nsIAccessibleText* aTextAccessible,
mEndOffset = aEndOffset; mEndOffset = aEndOffset;
nsRefPtr<Accessible> oldPosition = mPosition.forget(); nsRefPtr<Accessible> oldPosition = mPosition.forget();
mPosition = newPosition.forget(); mPosition = newPosition;
NotifyOfPivotChange(oldPosition, oldStart, oldEnd); NotifyOfPivotChange(oldPosition, oldStart, oldEnd);

View File

@ -55,12 +55,6 @@ HyperTextAccessible::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{ {
*aInstancePtr = nsnull; *aInstancePtr = nsnull;
if (aIID.Equals(NS_GET_IID(HyperTextAccessible))) {
*aInstancePtr = static_cast<HyperTextAccessible*>(this);
NS_ADDREF_THIS();
return NS_OK;
}
// ARIA roles that these interfaces are not appropriate for. // ARIA roles that these interfaces are not appropriate for.
if (!IsTextRole()) if (!IsTextRole())
return Accessible::QueryInterface(aIID, aInstancePtr); return Accessible::QueryInterface(aIID, aInstancePtr);

View File

@ -24,14 +24,6 @@ const PRUnichar kEmbeddedObjectChar = 0xfffc;
const PRUnichar kImaginaryEmbeddedObjectChar = ' '; const PRUnichar kImaginaryEmbeddedObjectChar = ' ';
const PRUnichar kForcedNewLineChar = '\n'; const PRUnichar kForcedNewLineChar = '\n';
#define NS_HYPERTEXTACCESSIBLE_IMPL_CID \
{ /* 245f3bc9-224f-4839-a92e-95239705f30b */ \
0x245f3bc9, \
0x224f, \
0x4839, \
{ 0xa9, 0x2e, 0x95, 0x23, 0x97, 0x05, 0xf3, 0x0b } \
}
/** /**
* Special Accessible that knows how contain both text and embedded objects * Special Accessible that knows how contain both text and embedded objects
*/ */
@ -48,7 +40,6 @@ public:
NS_DECL_NSIACCESSIBLETEXT NS_DECL_NSIACCESSIBLETEXT
NS_DECL_NSIACCESSIBLEHYPERTEXT NS_DECL_NSIACCESSIBLEHYPERTEXT
NS_DECL_NSIACCESSIBLEEDITABLETEXT NS_DECL_NSIACCESSIBLEEDITABLETEXT
NS_DECLARE_STATIC_IID_ACCESSOR(NS_HYPERTEXTACCESSIBLE_IMPL_CID)
// Accessible // Accessible
virtual PRInt32 GetLevelInternal(); virtual PRInt32 GetLevelInternal();
@ -410,9 +401,6 @@ private:
nsTArray<PRUint32> mOffsets; nsTArray<PRUint32> mOffsets;
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(HyperTextAccessible,
NS_HYPERTEXTACCESSIBLE_IMPL_CID)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Accessible downcasting method // Accessible downcasting method

View File

@ -324,9 +324,8 @@ HTMLTextFieldAccessible::
{ {
} }
NS_IMPL_ISUPPORTS_INHERITED3(HTMLTextFieldAccessible, NS_IMPL_ISUPPORTS_INHERITED2(HTMLTextFieldAccessible,
Accessible, Accessible,
HyperTextAccessible,
nsIAccessibleText, nsIAccessibleText,
nsIAccessibleEditableText) nsIAccessibleEditableText)

View File

@ -13,12 +13,14 @@
namespace mozilla { namespace mozilla {
namespace a11y { namespace a11y {
// Mac a11y whitelisting
static bool sA11yShouldBeEnabled = false; static bool sA11yShouldBeEnabled = false;
bool bool
ShouldA11yBeEnabled() ShouldA11yBeEnabled()
{ {
return sA11yShouldBeEnabled; EPlatformDisabledState disabledState = PlatformDisabledState();
return (disabledState == ePlatformIsForceEnabled) || ((disabledState == ePlatformIsEnabled) && sA11yShouldBeEnabled);
} }
} }

View File

@ -57,7 +57,7 @@ ToNSString(id aValue)
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
if ((self = [super initWithAccessible:accessible])) { if ((self = [super initWithAccessible:accessible])) {
CallQueryInterface(accessible, &mGeckoTextAccessible); mGeckoTextAccessible = accessible->AsHyperText();
CallQueryInterface(accessible, &mGeckoEditableTextAccessible); CallQueryInterface(accessible, &mGeckoEditableTextAccessible);
} }
return self; return self;
@ -312,7 +312,7 @@ ToNSString(id aValue)
{ {
NS_OBJC_BEGIN_TRY_ABORT_BLOCK; NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
NS_IF_RELEASE(mGeckoTextAccessible); mGeckoTextAccessible = nsnull;
NS_IF_RELEASE(mGeckoEditableTextAccessible); NS_IF_RELEASE(mGeckoEditableTextAccessible);
[super expire]; [super expire];

View File

@ -119,9 +119,8 @@ nsXFormsInputAccessible::
{ {
} }
NS_IMPL_ISUPPORTS_INHERITED3(nsXFormsInputAccessible, NS_IMPL_ISUPPORTS_INHERITED2(nsXFormsInputAccessible,
Accessible, Accessible,
HyperTextAccessible,
nsIAccessibleText, nsIAccessibleText,
nsIAccessibleEditableText) nsIAccessibleEditableText)

View File

@ -685,9 +685,8 @@ XULTextFieldAccessible::
{ {
} }
NS_IMPL_ISUPPORTS_INHERITED3(XULTextFieldAccessible, NS_IMPL_ISUPPORTS_INHERITED2(XULTextFieldAccessible,
Accessible, Accessible,
HyperTextAccessible,
nsIAccessibleText, nsIAccessibleText,
nsIAccessibleEditableText) nsIAccessibleEditableText)

View File

@ -307,6 +307,24 @@
attrs = {}; attrs = {};
testTextAttrs(ID, 123, attrs, defAttrs, 122, 130); testTextAttrs(ID, 123, attrs, defAttrs, 122, 130);
attrs = {
"text-line-through-style": "solid",
"text-line-through-color": gComputedStyle.color
};
testTextAttrs(ID, 131, attrs, defAttrs, 130, 143);
attrs = {};
testTextAttrs(ID, 144, attrs, defAttrs, 143, 151);
attrs = {
"text-line-through-style": "solid",
"text-line-through-color": gComputedStyle.color
};
testTextAttrs(ID, 152, attrs, defAttrs, 151, 164);
attrs = {};
testTextAttrs(ID, 165, attrs, defAttrs, 164, 172);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// area10, different single style spans in non-styled paragraph // area10, different single style spans in non-styled paragraph
ID = "area10"; ID = "area10";
@ -621,6 +639,8 @@
<span style="font-family: monospace;">Different font</span> normal <span style="font-family: monospace;">Different font</span> normal
<span style="text-decoration: underline;">underlined</span> normal <span style="text-decoration: underline;">underlined</span> normal
<span style="text-decoration: line-through;">strikethrough</span> normal <span style="text-decoration: line-through;">strikethrough</span> normal
<s>strikethrough</s> normal
<strike>strikethrough</strike> normal
</p> </p>
<p id="area10">Normal <p id="area10">Normal

View File

@ -1,6 +1,23 @@
/* This Source Code Form is subject to the terms of the Mozilla Public // Copyright (c) 2009 Thomas Robinson <tlrobinson.net>
* License, v. 2.0. If a copy of the MPL was not distributed with this //
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation files
// (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// This module was taken from narwhal: // This module was taken from narwhal:
// //

View File

@ -27,8 +27,15 @@ var gConnectionsDialog = {
var backupPortPref = document.getElementById("network.proxy.backup." + proxyPrefs[i] + "_port"); var backupPortPref = document.getElementById("network.proxy.backup." + proxyPrefs[i] + "_port");
backupServerURLPref.value = proxyServerURLPref.value; backupServerURLPref.value = proxyServerURLPref.value;
backupPortPref.value = proxyPortPref.value; backupPortPref.value = proxyPortPref.value;
proxyServerURLPref.value = httpProxyURLPref.value; // SOCKS: not a protocol: set value to empty/0 while shareProxies is on
proxyPortPref.value = httpProxyPortPref.value; if (proxyPrefs[i] == "socks") {
proxyServerURLPref.value = "";
proxyPortPref.value = 0;
} else {
// protocols get HTTP proxy's values
proxyServerURLPref.value = httpProxyURLPref.value;
proxyPortPref.value = httpProxyPortPref.value;
}
} }
} }
@ -134,6 +141,10 @@ var gConnectionsDialog = {
{ {
var shareProxiesPref = document.getElementById("network.proxy.share_proxy_settings"); var shareProxiesPref = document.getElementById("network.proxy.share_proxy_settings");
if (shareProxiesPref.value) { if (shareProxiesPref.value) {
// during shareProxiesPref SOCKS values are empty
if (aProtocol == 'socks') {
return aIsPort ? 0 : "";
}
var pref = document.getElementById("network.proxy.http" + (aIsPort ? "_port" : "")); var pref = document.getElementById("network.proxy.http" + (aIsPort ? "_port" : ""));
return pref.value; return pref.value;
} }

View File

@ -1676,18 +1676,18 @@ richlistitem[type~="action"][actiontype="switchtab"][selected="true"] > .ac-url-
} }
.panel-promo-box { .panel-promo-box {
margin: 16px 0 -2px; margin: 10px -10px -10px;
padding: 8px 10px;
border-top: 1px solid ThreeDShadow;
background-image: -moz-linear-gradient(hsla(0,0%,0%,.15), hsla(0,0%,0%,.08) 6px);
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
} }
@media (-moz-windows-default-theme) { @media (-moz-windows-default-theme) {
.panel-promo-box { .panel-promo-box {
margin: 8px -16px -16px; border-top-style: none;
padding: 8px 16px; background: #f1f5fb;
%ifndef WINSTRIPE_AERO
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
%endif
background-color: #f1f5fb;
color: GrayText; color: GrayText;
box-shadow: 0px 1px 2px rgb(204,214,234) inset; box-shadow: 0px 1px 2px rgb(204,214,234) inset;
} }

View File

@ -6,10 +6,6 @@
%include downloads.css %include downloads.css
%undef WINSTRIPE_AERO %undef WINSTRIPE_AERO
#downloadsPanel > .panel-arrowcontainer > .panel-arrowcontent > .panel-inner-arrowcontent {
padding: 0;
}
@media (-moz-windows-default-theme) { @media (-moz-windows-default-theme) {
#downloadsPanel[hasdownloads] > #downloadsHistory { #downloadsPanel[hasdownloads] > #downloadsHistory {
background-color: #f1f5fb; background-color: #f1f5fb;

View File

@ -16,11 +16,6 @@
border-top-left-radius: 6px; border-top-left-radius: 6px;
border-top-right-radius: 6px; border-top-right-radius: 6px;
} }
#downloadsPanel > .panel-arrowcontainer > .panel-arrowcontent {
/* Avoid that the arrow overlaps the selection on first item */
padding-top: 5px;
}
%endif %endif
#downloadsPanel > .panel-arrowcontainer > .panel-arrowcontent { #downloadsPanel > .panel-arrowcontainer > .panel-arrowcontent {

View File

@ -11,7 +11,7 @@
print_header() { print_header() {
_mozconfig=${MOZCONFIG:-$HOME/.mozconfig} _mozconfig=${MOZCONFIG:-$HOME/.mozconfig}
cat >> $tmp_file <<EOF cat <<EOF
# gmake # gmake
# This file is automatically generated for client.mk. # This file is automatically generated for client.mk.
# Do not edit. Edit $_mozconfig instead. # Do not edit. Edit $_mozconfig instead.
@ -20,11 +20,11 @@ EOF
} }
ac_add_options() { ac_add_options() {
echo "# $* is used by configure (not client.mk)" >> $tmp_file echo "# $* is used by configure (not client.mk)"
} }
ac_add_app_options() { ac_add_app_options() {
echo "# $* is used by configure (not client.mk)" >> $tmp_file echo "# $* is used by configure (not client.mk)"
} }
mk_add_options() { mk_add_options() {
@ -35,14 +35,14 @@ mk_add_options() {
_opt=`echo "$_opt" | sed -e 's/\([\"\\]\)/\\\1/g; s/@\([^@]*\)@/\$(\1)/g;'` _opt=`echo "$_opt" | sed -e 's/\([\"\\]\)/\\\1/g; s/@\([^@]*\)@/\$(\1)/g;'`
echo $_opt; echo $_opt;
opts="${opts:+$opts^}$_opt"; opts="${opts:+$opts^}$_opt";
done >> $tmp_file done
} }
mk_echo_options() { mk_echo_options() {
echo "Adding client.mk options from $FOUND_MOZCONFIG:" echo "Adding client.mk options from $FOUND_MOZCONFIG:" >&2
IFS=^ IFS=^
for _opt in $opts; do for _opt in $opts; do
echo " $_opt" echo " $_opt" >&2
done done
} }
@ -51,23 +51,19 @@ mk_echo_options() {
scriptdir=`dirname $0` scriptdir=`dirname $0`
topsrcdir=$1 topsrcdir=$1
out_file=$2
tmp_file="$out_file-tmp$$"
opts="" opts=""
trap "rm -f $tmp_file; exit 1" 1 2 15 print_header
print_header > $tmp_file
# If the path changes, configure should be rerun # If the path changes, configure should be rerun
echo "# PATH=$PATH" >> $tmp_file echo "# PATH=$PATH"
# If FOUND_MOZCONFIG isn't set, look for it and make sure the script doesn't error out # If FOUND_MOZCONFIG isn't set, look for it and make sure the script doesn't error out
isfoundset=${FOUND_MOZCONFIG+yes} isfoundset=${FOUND_MOZCONFIG+yes}
if [ -z $isfoundset ]; then if [ -z $isfoundset ]; then
FOUND_MOZCONFIG=`$scriptdir/mozconfig-find $topsrcdir` FOUND_MOZCONFIG=`$scriptdir/mozconfig-find $topsrcdir`
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo '$(error Fix above errors before continuing.)' >> $tmp_file echo '$(error Fix above errors before continuing.)'
else else
isfoundset=yes isfoundset=yes
fi fi
@ -78,15 +74,9 @@ if [ -n $isfoundset ]; then
then then
. "$FOUND_MOZCONFIG" . "$FOUND_MOZCONFIG"
fi fi
echo "export FOUND_MOZCONFIG := $FOUND_MOZCONFIG" >> $tmp_file echo "export FOUND_MOZCONFIG := $FOUND_MOZCONFIG"
if [ "$opts" ]; then if [ "$opts" ]; then
mk_echo_options mk_echo_options
fi fi
fi fi
if test -f $out_file && cmp -s $tmp_file $out_file; then
rm $tmp_file
else
mv -f $tmp_file $out_file
fi

View File

@ -501,6 +501,14 @@ class DeviceManager:
return str(buf.getvalue()[0:-1]).rstrip().split('\r') return str(buf.getvalue()[0:-1]).rstrip().split('\r')
@abstractmethod
def chmodDir(self, remoteDir):
"""
external function
returns:
success: True
failure: False
"""
class NetworkTools: class NetworkTools:
def __init__(self): def __init__(self):

View File

@ -168,7 +168,6 @@ class DeviceManagerADB(DeviceManager):
self.checkCmd(["push", os.path.realpath(localname), destname]) self.checkCmd(["push", os.path.realpath(localname), destname])
if (self.isDir(destname)): if (self.isDir(destname)):
destname = destname + "/" + os.path.basename(localname) destname = destname + "/" + os.path.basename(localname)
self.chmodDir(destname)
return True return True
except: except:
return False return False
@ -184,8 +183,6 @@ class DeviceManagerADB(DeviceManager):
return None return None
if 'file exists' in result.lower(): if 'file exists' in result.lower():
return name return name
self.chmodDir(name)
return name return name
except: except:
return None return None
@ -253,7 +250,6 @@ class DeviceManagerADB(DeviceManager):
targetDir = targetDir + dir targetDir = targetDir + dir
if (not self.dirExists(targetDir)): if (not self.dirExists(targetDir)):
self.mkDir(targetDir) self.mkDir(targetDir)
self.checkCmdAs(["shell", "chmod", "777", remoteDir])
return remoteDir return remoteDir
except: except:
print "pushing " + localDir + " to " + remoteDir + " failed" print "pushing " + localDir + " to " + remoteDir + " failed"
@ -752,20 +748,26 @@ class DeviceManagerADB(DeviceManager):
args.insert(2, self.packageName) args.insert(2, self.packageName)
return self.checkCmd(args) return self.checkCmd(args)
# external function
# returns:
# success: True
# failure: False
def chmodDir(self, remoteDir): def chmodDir(self, remoteDir):
if (self.isDir(remoteDir)): if (self.isDir(remoteDir)):
files = self.listFiles(remoteDir.strip()) files = self.listFiles(remoteDir.strip())
for f in files: for f in files:
if (self.isDir(remoteDir.strip() + "/" + f.strip())): remoteEntry = remoteDir.strip() + "/" + f.strip()
self.chmodDir(remoteDir.strip() + "/" + f.strip()) if (self.isDir(remoteEntry)):
self.chmodDir(remoteEntry)
else: else:
self.checkCmdAs(["shell", "chmod", "777", remoteDir.strip()]) self.checkCmdAs(["shell", "chmod", "777", remoteEntry])
print "chmod " + remoteDir.strip() print "chmod " + remoteEntry
self.checkCmdAs(["shell", "chmod", "777", remoteDir]) self.checkCmdAs(["shell", "chmod", "777", remoteDir])
print "chmod " + remoteDir print "chmod " + remoteDir
else: else:
self.checkCmdAs(["shell", "chmod", "777", remoteDir.strip()]) self.checkCmdAs(["shell", "chmod", "777", remoteDir.strip()])
print "chmod " + remoteDir.strip() print "chmod " + remoteDir.strip()
return True
def verifyADB(self): def verifyADB(self):
# Check to see if adb itself can be executed. # Check to see if adb itself can be executed.

View File

@ -1182,6 +1182,17 @@ class DeviceManagerSUT(DeviceManager):
return True return True
# external function
# returns:
# success: True
# failure: False
def chmodDir(self, remoteDir):
try:
self.runCmds(["chmod "+remoteDir])
except AgentError:
return False
return True
gCallbackData = '' gCallbackData = ''
class myServer(SocketServer.TCPServer): class myServer(SocketServer.TCPServer):

View File

@ -169,6 +169,7 @@ public class DoCommand {
TZGET ("tzget"), TZGET ("tzget"),
TZSET ("tzset"), TZSET ("tzset"),
ADB ("adb"), ADB ("adb"),
CHMOD ("chmod"),
UNKNOWN ("unknown"); UNKNOWN ("unknown");
private final String theCmd; private final String theCmd;
@ -732,6 +733,13 @@ public class DoCommand {
strReturn = Zip(Argv[1], (Argc == 3 ? Argv[2] : "")); strReturn = Zip(Argv[1], (Argc == 3 ? Argv[2] : ""));
break; break;
case CHMOD:
if (Argc == 2)
strReturn = ChmodDir(Argv[1]);
else
strReturn = sErrorPrefix + "Wrong number of arguments for chmod command!";
break;
case HELP: case HELP:
strReturn = PrintUsage(); strReturn = PrintUsage();
break; break;
@ -1910,14 +1918,6 @@ private void CancelNotification()
if (dstFile != null) { if (dstFile != null) {
dstFile.flush(); dstFile.flush();
dstFile.close(); dstFile.close();
// set the new file's permissions to rwxrwxrwx, if possible
Process pProc = Runtime.getRuntime().exec("chmod 777 "+sTmpFileName);
RedirOutputThread outThrd = new RedirOutputThread(pProc, null);
outThrd.start();
try {
outThrd.join(5000);
} catch (InterruptedException e) {
}
} }
if (lRead == lSize) { if (lRead == lSize) {
@ -2258,18 +2258,6 @@ private void CancelNotification()
File dir = new File(sTmpDir); File dir = new File(sTmpDir);
if (dir.mkdirs()) { if (dir.mkdirs()) {
// set the new dir's permissions to rwxrwxrwx, if possible
try {
Process pProc = Runtime.getRuntime().exec("chmod 777 "+sTmpDir);
RedirOutputThread outThrd = new RedirOutputThread(pProc, null);
outThrd.start();
try {
outThrd.join(5000);
} catch (InterruptedException e) {
}
} catch (IOException e) {
e.printStackTrace();
}
sRet = sDir + " successfully created"; sRet = sDir + " successfully created";
} }
} }
@ -3672,6 +3660,63 @@ private void CancelNotification()
return (sRet); return (sRet);
} }
public String ChmodDir(String sDir)
{
String sRet = "";
int nFiles = 0;
String sSubDir = null;
String sTmpDir = fixFileName(sDir);
File dir = new File(sTmpDir);
if (dir.isDirectory()) {
sRet = "Changing permissions for " + sTmpDir;
File [] files = dir.listFiles();
if (files != null) {
if ((nFiles = files.length) > 0) {
for (int lcv = 0; lcv < nFiles; lcv++) {
if (files[lcv].isDirectory()) {
sSubDir = files[lcv].getAbsolutePath();
sRet += "\n" + ChmodDir(sSubDir);
}
else {
// set the new file's permissions to rwxrwxrwx, if possible
try {
Process pProc = Runtime.getRuntime().exec("chmod 777 "+files[lcv]);
RedirOutputThread outThrd = new RedirOutputThread(pProc, null);
outThrd.start();
outThrd.join(5000);
sRet += "\n\tchmod " + files[lcv].getName() + " ok";
} catch (InterruptedException e) {
sRet += "\n\ttimeout waiting for chmod " + files[lcv].getName();
} catch (IOException e) {
sRet += "\n\tunable to chmod " + files[lcv].getName();
}
}
}
}
else
sRet += "\n\t<empty>";
}
}
// set the new directory's (or file's) permissions to rwxrwxrwx, if possible
try {
Process pProc = Runtime.getRuntime().exec("chmod 777 "+sTmpDir);
RedirOutputThread outThrd = new RedirOutputThread(pProc, null);
outThrd.start();
outThrd.join(5000);
sRet += "\n\tchmod " + sTmpDir + " ok";
} catch (InterruptedException e) {
sRet += "\n\ttimeout waiting for chmod " + sTmpDir;
} catch (IOException e) {
sRet += "\n\tunable to chmod " + sTmpDir;
}
return(sRet);
}
private String PrintUsage() private String PrintUsage()
{ {
String sRet = String sRet =
@ -3706,6 +3751,7 @@ private void CancelNotification()
"mkdr directory - create directory\n" + "mkdr directory - create directory\n" +
"dirw directory - tests whether the directory is writable\n" + "dirw directory - tests whether the directory is writable\n" +
"isdir directory - test whether the directory exists\n" + "isdir directory - test whether the directory exists\n" +
"chmod directory|file - change permissions of directory and contents (or file) to 777\n" +
"stat processid - stat process\n" + "stat processid - stat process\n" +
"dead processid - print whether the process is alive or hung\n" + "dead processid - print whether the process is alive or hung\n" +
"mems - dump memory stats\n" + "mems - dump memory stats\n" +

View File

@ -59,6 +59,7 @@
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/dom/BindingUtils.h" #include "mozilla/dom/BindingUtils.h"
#include "mozilla/StandardInteger.h" #include "mozilla/StandardInteger.h"
#include "mozilla/ClearOnShutdown.h"
using namespace mozilla; using namespace mozilla;
using namespace mozilla::dom; using namespace mozilla::dom;
@ -3144,7 +3145,7 @@ nsresult nsScriptSecurityManager::Init()
return NS_OK; return NS_OK;
} }
static nsScriptSecurityManager *gScriptSecMan = nsnull; static nsRefPtr<nsScriptSecurityManager> gScriptSecMan;
jsid nsScriptSecurityManager::sEnabledID = JSID_VOID; jsid nsScriptSecurityManager::sEnabledID = JSID_VOID;
@ -3156,7 +3157,6 @@ nsScriptSecurityManager::~nsScriptSecurityManager(void)
if(mDefaultPolicy) if(mDefaultPolicy)
mDefaultPolicy->Drop(); mDefaultPolicy->Drop();
delete mCapabilities; delete mCapabilities;
gScriptSecMan = nsnull;
} }
void void
@ -3180,14 +3180,12 @@ nsScriptSecurityManager::GetScriptSecurityManager()
{ {
if (!gScriptSecMan) if (!gScriptSecMan)
{ {
nsScriptSecurityManager* ssManager = new nsScriptSecurityManager(); nsRefPtr<nsScriptSecurityManager> ssManager = new nsScriptSecurityManager();
if (!ssManager)
return nsnull;
nsresult rv; nsresult rv;
rv = ssManager->Init(); rv = ssManager->Init();
NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to initialize nsScriptSecurityManager"); NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to initialize nsScriptSecurityManager");
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
delete ssManager;
return nsnull; return nsnull;
} }
@ -3195,10 +3193,10 @@ nsScriptSecurityManager::GetScriptSecurityManager()
nsIXPCSecurityManager::HOOK_ALL); nsIXPCSecurityManager::HOOK_ALL);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
NS_WARNING("Failed to install xpconnect security manager!"); NS_WARNING("Failed to install xpconnect security manager!");
delete ssManager;
return nsnull; return nsnull;
} }
ClearOnShutdown(&gScriptSecMan);
gScriptSecMan = ssManager; gScriptSecMan = ssManager;
} }
return gScriptSecMan; return gScriptSecMan;

View File

@ -95,10 +95,15 @@ MOZCONFIG_LOADER := build/autoconf/mozconfig2client-mk
MOZCONFIG_FINDER := build/autoconf/mozconfig-find MOZCONFIG_FINDER := build/autoconf/mozconfig-find
MOZCONFIG_MODULES := build/unix/uniq.pl MOZCONFIG_MODULES := build/unix/uniq.pl
run_for_side_effects := \ define CR
$(shell $(TOPSRCDIR)/$(MOZCONFIG_LOADER) $(TOPSRCDIR) $(TOPSRCDIR)/.mozconfig.mk > $(TOPSRCDIR)/.mozconfig.out)
include $(TOPSRCDIR)/.mozconfig.mk
endef
# As $(shell) doesn't preserve newlines, use sed to replace them with an
# unlikely sequence (||), which is then replaced back to newlines by make
# before evaluation.
$(eval $(subst ||,$(CR),$(shell $(TOPSRCDIR)/$(MOZCONFIG_LOADER) $(TOPSRCDIR) 2> $(TOPSRCDIR)/.mozconfig.out | sed 's/$$/||/')))
ifndef MOZ_OBJDIR ifndef MOZ_OBJDIR
MOZ_OBJDIR = obj-$(CONFIG_GUESS) MOZ_OBJDIR = obj-$(CONFIG_GUESS)
@ -293,7 +298,7 @@ configure-preqs = \
save-mozconfig \ save-mozconfig \
$(NULL) $(NULL)
save-mozconfig: save-mozconfig: $(FOUND_MOZCONFIG)
-cp $(FOUND_MOZCONFIG) $(OBJDIR)/.mozconfig -cp $(FOUND_MOZCONFIG) $(OBJDIR)/.mozconfig
configure:: $(configure-preqs) configure:: $(configure-preqs)

View File

@ -62,9 +62,10 @@ LIBXUL_DIST ?= $(DIST)
# FINAL_TARGET specifies the location into which we copy end-user-shipped # FINAL_TARGET specifies the location into which we copy end-user-shipped
# build products (typelibs, components, chrome). # build products (typelibs, components, chrome).
# #
# It will usually be the well-loved $(DIST)/bin, today, but can also be an # If XPI_NAME is set, the files will be shipped to $(DIST)/xpi-stage/$(XPI_NAME)
# XPI-contents staging directory for ambitious and right-thinking extensions. # If DIST_SUBDIR is set, the files will be shipped to $(DIST)/$(DIST_SUBDIR)
FINAL_TARGET = $(if $(XPI_NAME),$(DIST)/xpi-stage/$(XPI_NAME),$(DIST)/bin) # Otherwise, the default $(DIST)/bin will be used.
FINAL_TARGET = $(if $(XPI_NAME),$(DIST)/xpi-stage/$(XPI_NAME),$(if $(DIST_SUBDIR),$(DIST)/bin/$(DIST_SUBDIR),$(DIST)/bin))
ifdef XPI_NAME ifdef XPI_NAME
DEFINES += -DXPI_NAME=$(XPI_NAME) DEFINES += -DXPI_NAME=$(XPI_NAME)

View File

@ -4312,15 +4312,7 @@ MOZ_USE_NATIVE_POPUP_WINDOWS=
MOZ_ANDROID_HISTORY= MOZ_ANDROID_HISTORY=
MOZ_WEBSMS_BACKEND= MOZ_WEBSMS_BACKEND=
MOZ_GRAPHITE=1 MOZ_GRAPHITE=1
ACCESSIBILITY=1
case "${target}" in
*darwin*)
ACCESSIBILITY=
;;
*)
ACCESSIBILITY=1
;;
esac
case "$target_os" in case "$target_os" in
mingw*) mingw*)
@ -5269,10 +5261,9 @@ AC_DEFINE(IBMBIDI)
dnl ======================================================== dnl ========================================================
dnl accessibility support on by default on all platforms dnl accessibility support on by default on all platforms
dnl except OS X.
dnl ======================================================== dnl ========================================================
MOZ_ARG_DISABLE_BOOL(accessibility, MOZ_ARG_DISABLE_BOOL(accessibility,
[ --disable-accessibility Disable accessibility support (off by default on OS X)], [ --disable-accessibility Disable accessibility support],
ACCESSIBILITY=, ACCESSIBILITY=,
ACCESSIBILITY=1 ) ACCESSIBILITY=1 )
if test "$ACCESSIBILITY"; then if test "$ACCESSIBILITY"; then
@ -8941,7 +8932,9 @@ if test "$MOZ_JEMALLOC" -a "$MOZ_MEMORY"; then
for var in AS CC CXX CPP LD AR RANLIB STRIP CPPFLAGS EXTRA_CFLAGS LDFLAGS; do for var in AS CC CXX CPP LD AR RANLIB STRIP CPPFLAGS EXTRA_CFLAGS LDFLAGS; do
ac_configure_args="$ac_configure_args $var='`eval echo \\${${var}}`'" ac_configure_args="$ac_configure_args $var='`eval echo \\${${var}}`'"
done done
ac_configure_args="$ac_configure_args je_cv_static_page_shift=12" if test "$CROSS_COMPILE"; then
ac_configure_args="$ac_configure_args je_cv_static_page_shift=12"
fi
_save_cache_file="$cache_file" _save_cache_file="$cache_file"
cache_file=$_objdir/memory/jemalloc/src/config.cache cache_file=$_objdir/memory/jemalloc/src/config.cache
AC_OUTPUT_SUBDIRS(memory/jemalloc/src) AC_OUTPUT_SUBDIRS(memory/jemalloc/src)

View File

@ -250,65 +250,6 @@ public:
return OwnerDoc()->IsHTML(); return OwnerDoc()->IsHTML();
} }
/**
* Get the namespace that this element's tag is defined in
* @return the namespace
*/
PRInt32 GetNameSpaceID() const
{
return mNodeInfo->NamespaceID();
}
/**
* Get the tag for this element. This will always return a non-null
* atom pointer (as implied by the naming of the method).
*/
nsIAtom *Tag() const
{
return mNodeInfo->NameAtom();
}
/**
* Get the NodeInfo for this element
* @return the nodes node info
*/
nsINodeInfo *NodeInfo() const
{
return mNodeInfo;
}
inline bool IsInNamespace(PRInt32 aNamespace) const {
return mNodeInfo->NamespaceID() == aNamespace;
}
inline bool IsHTML() const {
return IsInNamespace(kNameSpaceID_XHTML);
}
inline bool IsHTML(nsIAtom* aTag) const {
return mNodeInfo->Equals(aTag, kNameSpaceID_XHTML);
}
inline bool IsSVG() const {
return IsInNamespace(kNameSpaceID_SVG);
}
inline bool IsSVG(nsIAtom* aTag) const {
return mNodeInfo->Equals(aTag, kNameSpaceID_SVG);
}
inline bool IsXUL() const {
return IsInNamespace(kNameSpaceID_XUL);
}
inline bool IsMathML() const {
return IsInNamespace(kNameSpaceID_MathML);
}
inline bool IsMathML(nsIAtom* aTag) const {
return mNodeInfo->Equals(aTag, kNameSpaceID_MathML);
}
/** /**
* Returns an atom holding the name of the attribute of type ID on * Returns an atom holding the name of the attribute of type ID on
* this content node (if applicable). Returns null for non-element * this content node (if applicable). Returns null for non-element

View File

@ -476,6 +476,75 @@ public:
return mNodeInfo->LocalName(); return mNodeInfo->LocalName();
} }
/**
* Get the namespace that this element's tag is defined in
* @return the namespace
*/
PRInt32 GetNameSpaceID() const
{
return mNodeInfo->NamespaceID();
}
/**
* Get the tag for this element. This will always return a non-null atom
* pointer (as implied by the naming of the method). For elements this is
* the non-namespaced tag, and for other nodes it's something like "#text",
* "#comment", "#document", etc.
*/
nsIAtom* Tag() const
{
return mNodeInfo->NameAtom();
}
/**
* Get the NodeInfo for this element
* @return the nodes node info
*/
nsINodeInfo* NodeInfo() const
{
return mNodeInfo;
}
bool IsInNamespace(PRInt32 aNamespace) const
{
return mNodeInfo->NamespaceID() == aNamespace;
}
bool IsHTML() const
{
return IsInNamespace(kNameSpaceID_XHTML);
}
bool IsHTML(nsIAtom* aTag) const
{
return mNodeInfo->Equals(aTag, kNameSpaceID_XHTML);
}
bool IsSVG() const
{
return IsInNamespace(kNameSpaceID_SVG);
}
bool IsSVG(nsIAtom* aTag) const
{
return mNodeInfo->Equals(aTag, kNameSpaceID_SVG);
}
bool IsXUL() const
{
return IsInNamespace(kNameSpaceID_XUL);
}
bool IsMathML() const
{
return IsInNamespace(kNameSpaceID_MathML);
}
bool IsMathML(nsIAtom* aTag) const
{
return mNodeInfo->Equals(aTag, kNameSpaceID_MathML);
}
nsINode* nsINode*
InsertBefore(nsINode *aNewChild, nsINode *aRefChild, nsresult *aReturn) InsertBefore(nsINode *aNewChild, nsINode *aRefChild, nsresult *aReturn)
{ {

View File

@ -9,12 +9,13 @@
#include "nsString.h" #include "nsString.h"
#include "mozIThirdPartyUtil.h" #include "mozIThirdPartyUtil.h"
#include "nsIEffectiveTLDService.h" #include "nsIEffectiveTLDService.h"
#include "mozilla/Attributes.h"
class nsIURI; class nsIURI;
class nsIChannel; class nsIChannel;
class nsIDOMWindow; class nsIDOMWindow;
class ThirdPartyUtil : public mozIThirdPartyUtil class ThirdPartyUtil MOZ_FINAL : public mozIThirdPartyUtil
{ {
public: public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS

View File

@ -5,10 +5,11 @@
#include "nsIObserver.h" #include "nsIObserver.h"
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
#include "mozilla/Attributes.h"
struct JSTracer; struct JSTracer;
class nsCCUncollectableMarker : public nsIObserver class nsCCUncollectableMarker MOZ_FINAL : public nsIObserver
{ {
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER NS_DECL_NSIOBSERVER

View File

@ -181,6 +181,7 @@ static NS_DEFINE_CID(kXTFServiceCID, NS_XTFSERVICE_CID);
#include "nsICharsetDetector.h" #include "nsICharsetDetector.h"
#include "nsICharsetDetectionObserver.h" #include "nsICharsetDetectionObserver.h"
#include "nsIPlatformCharset.h" #include "nsIPlatformCharset.h"
#include "mozilla/Attributes.h"
extern "C" int MOZ_XMLTranslateEntity(const char* ptr, const char* end, extern "C" int MOZ_XMLTranslateEntity(const char* ptr, const char* end,
const char** next, PRUnichar* result); const char** next, PRUnichar* result);
@ -307,15 +308,15 @@ EventListenerManagerHashClearEntry(PLDHashTable *table, PLDHashEntryHdr *entry)
lm->~EventListenerManagerMapEntry(); lm->~EventListenerManagerMapEntry();
} }
class SameOriginChecker : public nsIChannelEventSink, class SameOriginChecker MOZ_FINAL : public nsIChannelEventSink,
public nsIInterfaceRequestor public nsIInterfaceRequestor
{ {
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS
NS_DECL_NSICHANNELEVENTSINK NS_DECL_NSICHANNELEVENTSINK
NS_DECL_NSIINTERFACEREQUESTOR NS_DECL_NSIINTERFACEREQUESTOR
}; };
class CharsetDetectionObserver : public nsICharsetDetectionObserver class CharsetDetectionObserver MOZ_FINAL : public nsICharsetDetectionObserver
{ {
public: public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS

View File

@ -809,9 +809,9 @@ nsCORSListenerProxy::UpdateChannel(nsIChannel* aChannel, bool aAllowDataURI)
// Class used as streamlistener and notification callback when // Class used as streamlistener and notification callback when
// doing the initial OPTIONS request for a CORS check // doing the initial OPTIONS request for a CORS check
class nsCORSPreflightListener : public nsIStreamListener, class nsCORSPreflightListener MOZ_FINAL : public nsIStreamListener,
public nsIInterfaceRequestor, public nsIInterfaceRequestor,
public nsIChannelEventSink public nsIChannelEventSink
{ {
public: public:
nsCORSPreflightListener(nsIChannel* aOuterChannel, nsCORSPreflightListener(nsIChannel* aOuterChannel,

View File

@ -15,6 +15,7 @@
#include "nsIInterfaceRequestor.h" #include "nsIInterfaceRequestor.h"
#include "nsIChannelEventSink.h" #include "nsIChannelEventSink.h"
#include "nsIAsyncVerifyRedirectCallback.h" #include "nsIAsyncVerifyRedirectCallback.h"
#include "mozilla/Attributes.h"
class nsIURI; class nsIURI;
class nsIParser; class nsIParser;
@ -31,10 +32,10 @@ NS_StartCORSPreflight(nsIChannel* aRequestChannel,
nsTArray<nsCString>& aACUnsafeHeaders, nsTArray<nsCString>& aACUnsafeHeaders,
nsIChannel** aPreflightChannel); nsIChannel** aPreflightChannel);
class nsCORSListenerProxy : public nsIStreamListener, class nsCORSListenerProxy MOZ_FINAL : public nsIStreamListener,
public nsIInterfaceRequestor, public nsIInterfaceRequestor,
public nsIChannelEventSink, public nsIChannelEventSink,
public nsIAsyncVerifyRedirectCallback public nsIAsyncVerifyRedirectCallback
{ {
public: public:
nsCORSListenerProxy(nsIStreamListener* aOuter, nsCORSListenerProxy(nsIStreamListener* aOuter,

View File

@ -9,6 +9,7 @@
#include "nsDOMFile.h" #include "nsDOMFile.h"
#include "mozilla/CheckedInt.h" #include "mozilla/CheckedInt.h"
#include "mozilla/Attributes.h"
using namespace mozilla; using namespace mozilla;
@ -141,8 +142,8 @@ protected:
PRUint64 mDataBufferLen; PRUint64 mDataBufferLen;
}; };
class nsDOMBlobBuilder : public nsIDOMMozBlobBuilder, class nsDOMBlobBuilder MOZ_FINAL : public nsIDOMMozBlobBuilder,
public nsIJSNativeInitializer public nsIJSNativeInitializer
{ {
public: public:
nsDOMBlobBuilder() nsDOMBlobBuilder()

View File

@ -31,6 +31,7 @@
#include "nsJSUtils.h" #include "nsJSUtils.h"
#include "mozilla/CheckedInt.h" #include "mozilla/CheckedInt.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Attributes.h"
#include "plbase64.h" #include "plbase64.h"
#include "prmem.h" #include "prmem.h"
@ -44,8 +45,8 @@ using namespace mozilla::dom;
// ensure that the buffer underlying the stream we get // ensure that the buffer underlying the stream we get
// from NS_NewByteInputStream is held alive as long as the // from NS_NewByteInputStream is held alive as long as the
// stream is. We do that by passing back this class instead. // stream is. We do that by passing back this class instead.
class DataOwnerAdapter : public nsIInputStream, class DataOwnerAdapter MOZ_FINAL : public nsIInputStream,
public nsISeekableStream public nsISeekableStream
{ {
typedef nsDOMMemoryFile::DataOwner DataOwner; typedef nsDOMMemoryFile::DataOwner DataOwner;
public: public:

View File

@ -44,7 +44,7 @@ public:
} }
protected: protected:
~nsDOMTokenList(); virtual ~nsDOMTokenList();
nsresult CheckToken(const nsAString& aStr); nsresult CheckToken(const nsAString& aStr);
void AddInternal(const nsAttrValue* aAttr, const nsAString& aToken); void AddInternal(const nsAttrValue* aAttr, const nsAString& aToken);

View File

@ -20,8 +20,9 @@
#include "nsIContentPolicy.h" #include "nsIContentPolicy.h"
#include "mozilla/Attributes.h"
class nsDataDocumentContentPolicy : public nsIContentPolicy class nsDataDocumentContentPolicy MOZ_FINAL : public nsIContentPolicy
{ {
public: public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS

View File

@ -1169,8 +1169,7 @@ nsExternalResourceMap::ExternalResource::~ExternalResource()
// If we ever have an nsIDocumentObserver notification for stylesheet title // If we ever have an nsIDocumentObserver notification for stylesheet title
// changes, we could make this inherit from nsDOMStringList instead of // changes, we could make this inherit from nsDOMStringList instead of
// reimplementing nsIDOMDOMStringList. // reimplementing nsIDOMDOMStringList.
class nsDOMStyleSheetSetList : public nsIDOMDOMStringList class nsDOMStyleSheetSetList MOZ_FINAL : public nsIDOMDOMStringList
{ {
public: public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS
@ -7687,7 +7686,7 @@ namespace {
* Stub for LoadSheet(), since all we want is to get the sheet into * Stub for LoadSheet(), since all we want is to get the sheet into
* the CSSLoader's style cache * the CSSLoader's style cache
*/ */
class StubCSSLoaderObserver : public nsICSSLoaderObserver { class StubCSSLoaderObserver MOZ_FINAL : public nsICSSLoaderObserver {
public: public:
NS_IMETHOD NS_IMETHOD
StyleSheetLoaded(nsCSSStyleSheet*, bool, nsresult) StyleSheetLoaded(nsCSSStyleSheet*, bool, nsresult)

View File

@ -68,6 +68,7 @@
#include "nsIInlineEventHandlers.h" #include "nsIInlineEventHandlers.h"
#include "nsDataHashtable.h" #include "nsDataHashtable.h"
#include "mozilla/TimeStamp.h" #include "mozilla/TimeStamp.h"
#include "mozilla/Attributes.h"
#define XML_DECLARATION_BITS_DECLARATION_EXISTS (1 << 0) #define XML_DECLARATION_BITS_DECLARATION_EXISTS (1 << 0)
#define XML_DECLARATION_BITS_ENCODING_EXISTS (1 << 1) #define XML_DECLARATION_BITS_ENCODING_EXISTS (1 << 1)
@ -286,7 +287,7 @@ protected:
nsIDocument* mDocument; nsIDocument* mDocument;
}; };
class nsOnloadBlocker : public nsIRequest class nsOnloadBlocker MOZ_FINAL : public nsIRequest
{ {
public: public:
nsOnloadBlocker() {} nsOnloadBlocker() {}
@ -388,7 +389,7 @@ protected:
}; };
friend class PendingLoad; friend class PendingLoad;
class LoadgroupCallbacks : public nsIInterfaceRequestor class LoadgroupCallbacks MOZ_FINAL : public nsIInterfaceRequestor
{ {
public: public:
LoadgroupCallbacks(nsIInterfaceRequestor* aOtherCallbacks) LoadgroupCallbacks(nsIInterfaceRequestor* aOtherCallbacks)
@ -409,8 +410,8 @@ protected:
// XXXbz I wish we could just derive the _allcaps thing from _i // XXXbz I wish we could just derive the _allcaps thing from _i
#define DECL_SHIM(_i, _allcaps) \ #define DECL_SHIM(_i, _allcaps) \
class _i##Shim : public nsIInterfaceRequestor, \ class _i##Shim MOZ_FINAL : public nsIInterfaceRequestor, \
public _i \ public _i \
{ \ { \
public: \ public: \
_i##Shim(nsIInterfaceRequestor* aIfreq, _i* aRealPtr) \ _i##Shim(nsIInterfaceRequestor* aIfreq, _i* aRealPtr) \

View File

@ -31,6 +31,7 @@
#include "nsCrossSiteListenerProxy.h" #include "nsCrossSiteListenerProxy.h"
#include "nsWrapperCacheInlines.h" #include "nsWrapperCacheInlines.h"
#include "nsDOMEventTargetHelper.h" #include "nsDOMEventTargetHelper.h"
#include "mozilla/Attributes.h"
using namespace mozilla; using namespace mozilla;
@ -638,7 +639,7 @@ nsEventSource::OnStopRequest(nsIRequest *aRequest,
* Simple helper class that just forwards the redirect callback back * Simple helper class that just forwards the redirect callback back
* to the nsEventSource. * to the nsEventSource.
*/ */
class AsyncVerifyRedirectCallbackFwr : public nsIAsyncVerifyRedirectCallback class AsyncVerifyRedirectCallbackFwr MOZ_FINAL : public nsIAsyncVerifyRedirectCallback
{ {
public: public:
AsyncVerifyRedirectCallbackFwr(nsEventSource* aEventsource) AsyncVerifyRedirectCallbackFwr(nsEventSource* aEventsource)

View File

@ -21,6 +21,7 @@
#include "nsFrameMessageManager.h" #include "nsFrameMessageManager.h"
#include "Layers.h" #include "Layers.h"
#include "mozilla/dom/Element.h" #include "mozilla/dom/Element.h"
#include "mozilla/Attributes.h"
class nsIURI; class nsIURI;
class nsSubDocumentFrame; class nsSubDocumentFrame;
@ -56,7 +57,7 @@ class QX11EmbedContainer;
* Used to support asynchronous re-paints of content pixels; see * Used to support asynchronous re-paints of content pixels; see
* nsIContentView. * nsIContentView.
*/ */
class nsContentView : public nsIContentView class nsContentView MOZ_FINAL : public nsIContentView
{ {
public: public:
typedef mozilla::layers::FrameMetrics::ViewID ViewID; typedef mozilla::layers::FrameMetrics::ViewID ViewID;
@ -133,8 +134,8 @@ private:
}; };
class nsFrameLoader : public nsIFrameLoader, class nsFrameLoader MOZ_FINAL : public nsIFrameLoader,
public nsIContentViewManager public nsIContentViewManager
{ {
friend class AutoResetInShow; friend class AutoResetInShow;
typedef mozilla::dom::PBrowserParent PBrowserParent; typedef mozilla::dom::PBrowserParent PBrowserParent;

View File

@ -20,6 +20,7 @@
#include "mozilla/Services.h" #include "mozilla/Services.h"
#include "nsIObserverService.h" #include "nsIObserverService.h"
#include "nsThreadUtils.h" #include "nsThreadUtils.h"
#include "mozilla/Attributes.h"
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {
@ -46,8 +47,8 @@ typedef bool (*nsAsyncMessageCallback)(void* aCallbackData,
const nsAString& aMessage, const nsAString& aMessage,
const nsAString& aJSON); const nsAString& aJSON);
class nsFrameMessageManager : public nsIContentFrameMessageManager, class nsFrameMessageManager MOZ_FINAL : public nsIContentFrameMessageManager,
public nsIChromeFrameMessageManager public nsIChromeFrameMessageManager
{ {
public: public:
nsFrameMessageManager(bool aChrome, nsFrameMessageManager(bool aChrome,
@ -236,7 +237,7 @@ public:
nsFrameScriptExecutor* mExec; nsFrameScriptExecutor* mExec;
}; };
class nsScriptCacheCleaner : public nsIObserver class nsScriptCacheCleaner MOZ_FINAL : public nsIObserver
{ {
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS

View File

@ -34,6 +34,7 @@
#include "nsIDOMTouchEvent.h" #include "nsIDOMTouchEvent.h"
#include "nsIInlineEventHandlers.h" #include "nsIInlineEventHandlers.h"
#include "mozilla/CORSMode.h" #include "mozilla/CORSMode.h"
#include "mozilla/Attributes.h"
#include "nsISMILAttr.h" #include "nsISMILAttr.h"
@ -62,7 +63,7 @@ typedef PRUptrdiff PtrBits;
* and Item to its existing child list. * and Item to its existing child list.
* @see nsIDOMNodeList * @see nsIDOMNodeList
*/ */
class nsChildContentList : public nsINodeList class nsChildContentList MOZ_FINAL : public nsINodeList
{ {
public: public:
nsChildContentList(nsINode* aNode) nsChildContentList(nsINode* aNode)
@ -126,7 +127,7 @@ private:
* A class that implements nsIWeakReference * A class that implements nsIWeakReference
*/ */
class nsNodeWeakReference : public nsIWeakReference class nsNodeWeakReference MOZ_FINAL : public nsIWeakReference
{ {
public: public:
nsNodeWeakReference(nsINode* aNode) nsNodeWeakReference(nsINode* aNode)
@ -154,7 +155,7 @@ private:
/** /**
* Tearoff to use for nodes to implement nsISupportsWeakReference * Tearoff to use for nodes to implement nsISupportsWeakReference
*/ */
class nsNodeSupportsWeakRefTearoff : public nsISupportsWeakReference class nsNodeSupportsWeakRefTearoff MOZ_FINAL : public nsISupportsWeakReference
{ {
public: public:
nsNodeSupportsWeakRefTearoff(nsINode* aNode) nsNodeSupportsWeakRefTearoff(nsINode* aNode)
@ -177,7 +178,7 @@ private:
/** /**
* A tearoff class for nsGenericElement to implement NodeSelector * A tearoff class for nsGenericElement to implement NodeSelector
*/ */
class nsNodeSelectorTearoff : public nsIDOMNodeSelector class nsNodeSelectorTearoff MOZ_FINAL : public nsIDOMNodeSelector
{ {
public: public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
@ -1038,7 +1039,7 @@ _elementName::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const \
/** /**
* Tearoff class to implement nsITouchEventReceiver * Tearoff class to implement nsITouchEventReceiver
*/ */
class nsTouchEventReceiverTearoff : public nsITouchEventReceiver class nsTouchEventReceiverTearoff MOZ_FINAL : public nsITouchEventReceiver
{ {
public: public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
@ -1058,7 +1059,7 @@ private:
/** /**
* Tearoff class to implement nsIInlineEventHandlers * Tearoff class to implement nsIInlineEventHandlers
*/ */
class nsInlineEventHandlersTearoff : public nsIInlineEventHandlers class nsInlineEventHandlersTearoff MOZ_FINAL : public nsIInlineEventHandlers
{ {
public: public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS

View File

@ -14,12 +14,13 @@
#include "nsAttrAndChildArray.h" #include "nsAttrAndChildArray.h"
#include "nsMappedAttributeElement.h" #include "nsMappedAttributeElement.h"
#include "nsIStyleRule.h" #include "nsIStyleRule.h"
#include "mozilla/Attributes.h"
class nsIAtom; class nsIAtom;
class nsHTMLStyleSheet; class nsHTMLStyleSheet;
class nsRuleWalker; class nsRuleWalker;
class nsMappedAttributes : public nsIStyleRule class nsMappedAttributes MOZ_FINAL : public nsIStyleRule
{ {
public: public:
nsMappedAttributes(nsHTMLStyleSheet* aSheet, nsMappedAttributes(nsHTMLStyleSheet* aSheet,

View File

@ -20,8 +20,9 @@
#include "nsIContentPolicy.h" #include "nsIContentPolicy.h"
#include "mozilla/Attributes.h"
class nsNoDataProtocolContentPolicy : public nsIContentPolicy class nsNoDataProtocolContentPolicy MOZ_FINAL : public nsIContentPolicy
{ {
public: public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS

View File

@ -2081,28 +2081,29 @@ nsRange::InsertNode(nsIDOMNode* aNode)
NS_ENSURE_SUCCESS(res, res); NS_ENSURE_SUCCESS(res, res);
} }
// We might need to update the end to include the new node (bug 433662) // We might need to update the end to include the new node (bug 433662).
// Ideally we'd only do this if needed, but it's tricky to know when it's
// needed in advance (bug 765799).
PRInt32 newOffset; PRInt32 newOffset;
if (Collapsed()) { if (referenceNode) {
if (referenceNode) { newOffset = IndexOf(referenceNode);
newOffset = IndexOf(referenceNode); } else {
} else { PRUint32 length;
PRUint32 length; res = tChildList->GetLength(&length);
res = tChildList->GetLength(&length); NS_ENSURE_SUCCESS(res, res);
NS_ENSURE_SUCCESS(res, res); newOffset = length;
newOffset = length;
}
nsCOMPtr<nsINode> node = do_QueryInterface(aNode);
NS_ENSURE_STATE(node);
if (node->NodeType() == nsIDOMNode::DOCUMENT_FRAGMENT_NODE) {
newOffset += node->GetChildCount();
} else {
newOffset++;
}
} }
nsCOMPtr<nsINode> node = do_QueryInterface(aNode);
NS_ENSURE_STATE(node);
if (node->NodeType() == nsIDOMNode::DOCUMENT_FRAGMENT_NODE) {
newOffset += node->GetChildCount();
} else {
newOffset++;
}
// Now actually insert the node
nsCOMPtr<nsIDOMNode> tResultNode; nsCOMPtr<nsIDOMNode> tResultNode;
res = referenceParentNode->InsertBefore(aNode, referenceNode, getter_AddRefs(tResultNode)); res = referenceParentNode->InsertBefore(aNode, referenceNode, getter_AddRefs(tResultNode));
NS_ENSURE_SUCCESS(res, res); NS_ENSURE_SUCCESS(res, res);

View File

@ -45,6 +45,7 @@
#include "mozilla/FunctionTimer.h" #include "mozilla/FunctionTimer.h"
#include "mozilla/CORSMode.h" #include "mozilla/CORSMode.h"
#include "mozilla/Attributes.h"
#ifdef PR_LOGGING #ifdef PR_LOGGING
static PRLogModuleInfo* gCspPRLog; static PRLogModuleInfo* gCspPRLog;
@ -57,7 +58,7 @@ using namespace mozilla::dom;
// Per-request data structure // Per-request data structure
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
class nsScriptLoadRequest : public nsISupports { class nsScriptLoadRequest MOZ_FINAL : public nsISupports {
public: public:
nsScriptLoadRequest(nsIScriptElement* aElement, nsScriptLoadRequest(nsIScriptElement* aElement,
PRUint32 aVersion, PRUint32 aVersion,

View File

@ -76,6 +76,7 @@
#include "mozilla/dom/XMLHttpRequestBinding.h" #include "mozilla/dom/XMLHttpRequestBinding.h"
#include "nsIDOMFormData.h" #include "nsIDOMFormData.h"
#include "DictionaryHelpers.h" #include "DictionaryHelpers.h"
#include "mozilla/Attributes.h"
#include "nsWrapperCacheInlines.h" #include "nsWrapperCacheInlines.h"
#include "nsStreamListenerWrapper.h" #include "nsStreamListenerWrapper.h"
@ -3546,7 +3547,7 @@ nsXMLHttpRequest::ChangeState(PRUint32 aState, bool aBroadcast)
* Simple helper class that just forwards the redirect callback back * Simple helper class that just forwards the redirect callback back
* to the nsXMLHttpRequest. * to the nsXMLHttpRequest.
*/ */
class AsyncVerifyRedirectCallbackForwarder : public nsIAsyncVerifyRedirectCallback class AsyncVerifyRedirectCallbackForwarder MOZ_FINAL : public nsIAsyncVerifyRedirectCallback
{ {
public: public:
AsyncVerifyRedirectCallbackForwarder(nsXMLHttpRequest *xhr) AsyncVerifyRedirectCallbackForwarder(nsXMLHttpRequest *xhr)

View File

@ -50,6 +50,10 @@ public:
{ {
mCanvasElement = aParentCanvas; mCanvasElement = aParentCanvas;
} }
nsHTMLCanvasElement* GetParentObject() const
{
return mCanvasElement;
}
// Sets the dimensions of the canvas, in pixels. Called // Sets the dimensions of the canvas, in pixels. Called
// whenever the size of the element changes. // whenever the size of the element changes.

View File

@ -9,22 +9,6 @@
#include "mozilla/dom/ImageData.h" #include "mozilla/dom/ImageData.h"
static bool
GetPositiveInt(JSContext* cx, JSObject& obj, const char* name, uint32_t* out)
{
JS::Value temp;
int32_t signedInt;
if (!JS_GetProperty(cx, &obj, name, &temp) ||
!JS_ValueToECMAInt32(cx, temp, &signedInt)) {
return false;
}
if (signedInt <= 0) {
return xpc_qsThrow(cx, NS_ERROR_DOM_TYPE_MISMATCH_ERR);
}
*out = uint32_t(signedInt);
return true;
}
static bool static bool
GetImageData(JSContext* cx, JS::Value& imageData, GetImageData(JSContext* cx, JS::Value& imageData,
uint32_t* width, uint32_t* height, JS::Anchor<JSObject*>* array) uint32_t* width, uint32_t* height, JS::Anchor<JSObject*>* array)
@ -35,34 +19,17 @@ GetImageData(JSContext* cx, JS::Value& imageData,
nsIDOMImageData* domImageData; nsIDOMImageData* domImageData;
xpc_qsSelfRef imageDataRef; xpc_qsSelfRef imageDataRef;
if (NS_SUCCEEDED(xpc_qsUnwrapArg<nsIDOMImageData>(cx, imageData, nsresult rv = xpc_qsUnwrapArg<nsIDOMImageData>(cx, imageData, &domImageData,
&domImageData, &imageDataRef.ptr, &imageData);
&imageDataRef.ptr, if (NS_FAILED(rv)) {
&imageData))) { return xpc_qsThrow(cx, rv);
mozilla::dom::ImageData* concreteImageData =
static_cast<mozilla::dom::ImageData*>(domImageData);
*width = concreteImageData->GetWidth();
*height = concreteImageData->GetHeight();
array->set(concreteImageData->GetDataObject());
return true;
} }
// TODO - bug 625804: Remove support for duck-typed ImageData. mozilla::dom::ImageData* concreteImageData =
JSObject& dataObject = imageData.toObject(); static_cast<mozilla::dom::ImageData*>(domImageData);
*width = concreteImageData->GetWidth();
if (!GetPositiveInt(cx, dataObject, "width", width) || *height = concreteImageData->GetHeight();
!GetPositiveInt(cx, dataObject, "height", height)) { array->set(concreteImageData->GetDataObject());
return false;
}
JS::Value temp;
if (!JS_GetProperty(cx, &dataObject, "data", &temp)) {
return false;
}
if (!temp.isObject()) {
return xpc_qsThrow(cx, NS_ERROR_DOM_TYPE_MISMATCH_ERR);
}
array->set(&temp.toObject());
return true; return true;
} }

View File

@ -1240,7 +1240,8 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(WebGLContext)
NS_INTERFACE_MAP_ENTRY(nsITimerCallback) NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
// If the exact way we cast to nsISupports here ever changes, fix our // If the exact way we cast to nsISupports here ever changes, fix our
// PreCreate hook! // PreCreate hook!
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMWebGLRenderingContext) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports,
nsICanvasRenderingContextInternal)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(WebGLRenderingContext) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(WebGLRenderingContext)
NS_INTERFACE_MAP_END NS_INTERFACE_MAP_END

View File

@ -482,10 +482,6 @@ public:
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(WebGLContext, NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(WebGLContext,
nsIDOMWebGLRenderingContext) nsIDOMWebGLRenderingContext)
nsINode* GetParentObject() {
return mCanvasElement;
}
virtual JSObject* WrapObject(JSContext *cx, JSObject *scope, virtual JSObject* WrapObject(JSContext *cx, JSObject *scope,
bool *triedToWrap); bool *triedToWrap);

View File

@ -595,9 +595,8 @@ protected:
* Gets the pres shell from either the canvas element or the doc shell * Gets the pres shell from either the canvas element or the doc shell
*/ */
nsIPresShell *GetPresShell() { nsIPresShell *GetPresShell() {
nsCOMPtr<nsIContent> content = do_QueryObject(mCanvasElement); if (mCanvasElement) {
if (content) { return mCanvasElement->OwnerDoc()->GetShell();
return content->OwnerDoc()->GetShell();
} }
if (mDocShell) { if (mDocShell) {
nsCOMPtr<nsIPresShell> shell; nsCOMPtr<nsIPresShell> shell;
@ -772,7 +771,8 @@ DOMCI_DATA(CanvasRenderingContext2D, nsCanvasRenderingContext2D)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsCanvasRenderingContext2D) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsCanvasRenderingContext2D)
NS_INTERFACE_MAP_ENTRY(nsIDOMCanvasRenderingContext2D) NS_INTERFACE_MAP_ENTRY(nsIDOMCanvasRenderingContext2D)
NS_INTERFACE_MAP_ENTRY(nsICanvasRenderingContextInternal) NS_INTERFACE_MAP_ENTRY(nsICanvasRenderingContextInternal)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMCanvasRenderingContext2D) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports,
nsICanvasRenderingContextInternal)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CanvasRenderingContext2D) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CanvasRenderingContext2D)
NS_INTERFACE_MAP_END NS_INTERFACE_MAP_END
@ -1177,10 +1177,9 @@ nsCanvasRenderingContext2D::EnsureSurface()
gfxASurface::gfxImageFormat format = GetImageFormat(); gfxASurface::gfxImageFormat format = GetImageFormat();
if (!PR_GetEnv("MOZ_CANVAS_IMAGE_SURFACE")) { if (!PR_GetEnv("MOZ_CANVAS_IMAGE_SURFACE")) {
nsCOMPtr<nsIContent> content = do_QueryObject(mCanvasElement);
nsIDocument* ownerDoc = nsnull; nsIDocument* ownerDoc = nsnull;
if (content) if (mCanvasElement)
ownerDoc = content->OwnerDoc(); ownerDoc = mCanvasElement->OwnerDoc();
nsRefPtr<LayerManager> layerManager = nsnull; nsRefPtr<LayerManager> layerManager = nsnull;
if (ownerDoc) if (ownerDoc)

View File

@ -89,6 +89,8 @@
#include "mozilla/ipc/PDocumentRendererParent.h" #include "mozilla/ipc/PDocumentRendererParent.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/unused.h" #include "mozilla/unused.h"
#include "nsCCUncollectableMarker.h"
#include "nsWrapperCacheInlines.h"
#ifdef XP_WIN #ifdef XP_WIN
#include "gfxWindowsPlatform.h" #include "gfxWindowsPlatform.h"
@ -364,7 +366,8 @@ static const Float SIGMA_MAX = 100;
**/ **/
class nsCanvasRenderingContext2DAzure : class nsCanvasRenderingContext2DAzure :
public nsIDOMCanvasRenderingContext2D, public nsIDOMCanvasRenderingContext2D,
public nsICanvasRenderingContextInternal public nsICanvasRenderingContextInternal,
public nsWrapperCache
{ {
public: public:
nsCanvasRenderingContext2DAzure(); nsCanvasRenderingContext2DAzure();
@ -405,7 +408,8 @@ public:
// nsISupports interface + CC // nsISupports interface + CC
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsCanvasRenderingContext2DAzure, nsIDOMCanvasRenderingContext2D) NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(
nsCanvasRenderingContext2DAzure, nsIDOMCanvasRenderingContext2D)
// nsIDOMCanvasRenderingContext2D interface // nsIDOMCanvasRenderingContext2D interface
NS_DECL_NSIDOMCANVASRENDERINGCONTEXT2D NS_DECL_NSIDOMCANVASRENDERINGCONTEXT2D
@ -586,9 +590,8 @@ protected:
* Gets the pres shell from either the canvas element or the doc shell * Gets the pres shell from either the canvas element or the doc shell
*/ */
nsIPresShell *GetPresShell() { nsIPresShell *GetPresShell() {
nsCOMPtr<nsIContent> content = do_QueryObject(mCanvasElement); if (mCanvasElement) {
if (content) { return mCanvasElement->OwnerDoc()->GetShell();
return content->OwnerDoc()->GetShell();
} }
if (mDocShell) { if (mDocShell) {
nsCOMPtr<nsIPresShell> shell; nsCOMPtr<nsIPresShell> shell;
@ -938,18 +941,46 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(nsCanvasRenderingContext2DAzure)
NS_IMPL_CYCLE_COLLECTION_CLASS(nsCanvasRenderingContext2DAzure) NS_IMPL_CYCLE_COLLECTION_CLASS(nsCanvasRenderingContext2DAzure)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsCanvasRenderingContext2DAzure) NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsCanvasRenderingContext2DAzure)
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mCanvasElement) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mCanvasElement)
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsCanvasRenderingContext2DAzure)
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsCanvasRenderingContext2DAzure) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsCanvasRenderingContext2DAzure)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mCanvasElement, nsINode) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mCanvasElement, nsINode)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsCanvasRenderingContext2DAzure)
if (nsCCUncollectableMarker::sGeneration && tmp->IsBlack()) {
nsGenericElement* canvasElement = tmp->mCanvasElement;
if (canvasElement) {
if (canvasElement->IsPurple()) {
canvasElement->RemovePurple();
}
nsGenericElement::MarkNodeChildren(canvasElement);
}
return true;
}
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(nsCanvasRenderingContext2DAzure)
return nsCCUncollectableMarker::sGeneration && tmp->IsBlack();
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(nsCanvasRenderingContext2DAzure)
return nsCCUncollectableMarker::sGeneration && tmp->IsBlack();
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
// XXX // XXX
// DOMCI_DATA(CanvasRenderingContext2D, nsCanvasRenderingContext2DAzure) // DOMCI_DATA(CanvasRenderingContext2D, nsCanvasRenderingContext2DAzure)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsCanvasRenderingContext2DAzure) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsCanvasRenderingContext2DAzure)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsIDOMCanvasRenderingContext2D) NS_INTERFACE_MAP_ENTRY(nsIDOMCanvasRenderingContext2D)
NS_INTERFACE_MAP_ENTRY(nsICanvasRenderingContextInternal) NS_INTERFACE_MAP_ENTRY(nsICanvasRenderingContextInternal)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMCanvasRenderingContext2D) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports,
nsICanvasRenderingContextInternal)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CanvasRenderingContext2D) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CanvasRenderingContext2D)
NS_INTERFACE_MAP_END NS_INTERFACE_MAP_END
@ -1241,10 +1272,9 @@ nsCanvasRenderingContext2DAzure::SetDimensions(PRInt32 width, PRInt32 height)
if (size.width <= 0xFFFF && size.height <= 0xFFFF && if (size.width <= 0xFFFF && size.height <= 0xFFFF &&
size.width >= 0 && size.height >= 0) { size.width >= 0 && size.height >= 0) {
SurfaceFormat format = GetSurfaceFormat(); SurfaceFormat format = GetSurfaceFormat();
nsCOMPtr<nsIContent> content = do_QueryObject(mCanvasElement);
nsIDocument* ownerDoc = nsnull; nsIDocument* ownerDoc = nsnull;
if (content) { if (mCanvasElement) {
ownerDoc = content->OwnerDoc(); ownerDoc = mCanvasElement->OwnerDoc();
} }
nsRefPtr<LayerManager> layerManager = nsnull; nsRefPtr<LayerManager> layerManager = nsnull;

View File

@ -32,18 +32,8 @@ try {
threw = true; threw = true;
} }
is(threw, false, "Should be able to pass in custom imagedata objects with array data"); ok(threw,
"Should not be able to pass in custom imagedata objects with array data");
threw = false;
try {
c.putImageData({ width: 1, height: 1, data: null }, 0, 0);
threw = false;
} catch(e) {
threw = e.name;
}
is(threw, "TypeMismatchError",
"Should throw TypeMismatchError when data is not an array");
</script> </script>
</pre> </pre>

View File

@ -3521,7 +3521,7 @@ var ctx = canvas.getContext('2d');
var _thrown = undefined; try { var _thrown = undefined; try {
ctx.drawImage(null, 0, 0); ctx.drawImage(null, 0, 0);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "TypeMismatchError" && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TypeMismatchError"); } catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "TypeError", "should throw TypeError");
} }
@ -3693,23 +3693,21 @@ isPixel(ctx, 50,25, 0,255,0,255, 2);
function test_2d_drawImage_wrongtype() { function test_2d_drawImage_wrongtype() {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var canvas = document.getElementById('c127'); var canvas = document.getElementById('c127');
var ctx = canvas.getContext('2d'); var ctx = canvas.getContext('2d');
var _thrown = undefined; try { var _thrown = undefined; try {
ctx.drawImage(undefined, 0, 0); ctx.drawImage(undefined, 0, 0);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "TypeMismatchError" && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TypeMismatchError"); } catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "TypeError", "should throw TypeError");
var _thrown = undefined; try { var _thrown = undefined; try {
ctx.drawImage(0, 0, 0); ctx.drawImage(0, 0, 0);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.result == Components.results.NS_ERROR_XPC_BAD_CONVERT_JS_ZERO_ISNOT_NULL, "should throw NS_ERROR_XPC_BAD_CONVERT_JS_ZERO_ISNOT_NULL"); } catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "TypeError", "should throw TypeError");
var _thrown = undefined; try { var _thrown = undefined; try {
ctx.drawImage("", 0, 0); ctx.drawImage("", 0, 0);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.result == Components.results.NS_ERROR_XPC_BAD_CONVERT_JS, "should throw NS_ERROR_XPC_BAD_CONVERT_JS"); } catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "TypeError", "should throw TypeError");
var _thrown = undefined; try { var _thrown = undefined; try {
ctx.drawImage(document.createElement('p'), 0, 0); ctx.drawImage(document.createElement('p'), 0, 0);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "TypeMismatchError" && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TypeMismatchError"); } catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "TypeError", "should throw TypeError");
} }
@ -9192,7 +9190,7 @@ var ctx = canvas.getContext('2d');
var _thrown = undefined; try { var _thrown = undefined; try {
ctx.putImageData(null, 0, 0); ctx.putImageData(null, 0, 0);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "TypeMismatchError" && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TypeMismatchError"); } catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "TypeError", "should throw TypeError");
} }
@ -9304,13 +9302,13 @@ var ctx = canvas.getContext('2d');
var imgdata = { width: 1, height: 1, data: [255, 0, 0, 255] }; var imgdata = { width: 1, height: 1, data: [255, 0, 0, 255] };
var _thrown = undefined; try { var _thrown = undefined; try {
ctx.putImageData(imgdata, 0, 0); ctx.putImageData(imgdata, 0, 0);
} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "TypeMismatchError" && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TypeMismatchError"); } catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "TypeError", "should throw TypeError");
var _thrown = undefined; try { var _thrown = undefined; try {
ctx.putImageData("cheese", 0, 0); ctx.putImageData("cheese", 0, 0);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "TypeMismatchError" && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TypeMismatchError"); } catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "TypeError", "should throw TypeError");
var _thrown = undefined; try { var _thrown = undefined; try {
ctx.putImageData(42, 0, 0); ctx.putImageData(42, 0, 0);
} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "TypeMismatchError" && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TypeMismatchError"); } catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "TypeError", "should throw TypeError");
} }
@ -15097,7 +15095,7 @@ var ctx = canvas.getContext('2d');
var _thrown = undefined; try { var _thrown = undefined; try {
ctx.createPattern(null, 'repeat'); ctx.createPattern(null, 'repeat');
} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "TypeMismatchError" && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TypeMismatchError"); } catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "TypeError", "should throw TypeError");
} }
@ -15116,7 +15114,7 @@ var ctx = canvas.getContext('2d');
var _thrown = undefined; try { var _thrown = undefined; try {
ctx.createPattern('image_red.png', 'repeat'); ctx.createPattern('image_red.png', 'repeat');
} catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "TypeMismatchError" && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TypeMismatchError"); } catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "TypeError", "should throw TypeError");
} }
@ -15135,7 +15133,7 @@ var ctx = canvas.getContext('2d');
var _thrown = undefined; try { var _thrown = undefined; try {
ctx.createPattern(undefined, 'repeat'); ctx.createPattern(undefined, 'repeat');
} catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "TypeMismatchError" && _thrown.code == DOMException.TYPE_MISMATCH_ERR, "should throw TypeMismatchError"); } catch (e) { _thrown = e }; todo(_thrown && _thrown.name == "TypeError", "should throw TypeError");
} }
@ -15977,17 +15975,9 @@ function test_2d_pattern_repeat_null() {
var canvas = document.getElementById('c494'); var canvas = document.getElementById('c494');
var ctx = canvas.getContext('2d'); var ctx = canvas.getContext('2d');
ctx.fillStyle = '#f00'; var _thrown = undefined; try {
ctx.fillRect(0, 0, 100, 50); ctx.createPattern(canvas, null);
var img = document.getElementById('green-1x1_2.png'); } catch (e) { _thrown = e }; ok(_thrown && _thrown.name == "SyntaxError" && _thrown.code == DOMException.SYNTAX_ERR, "should throw SyntaxError");
var pattern = ctx.createPattern(img, null);
ctx.fillStyle = pattern;
ctx.fillRect(0, 0, 100, 50);
isPixel(ctx, 1,1, 0,255,0,255, 0);
isPixel(ctx, 98,1, 0,255,0,255, 0);
isPixel(ctx, 1,48, 0,255,0,255, 0);
isPixel(ctx, 98,48, 0,255,0,255, 0);
} }
@ -19548,6 +19538,7 @@ function test_2d_type_prototype() {
var canvas = document.getElementById('c611'); var canvas = document.getElementById('c611');
var ctx = canvas.getContext('2d'); var ctx = canvas.getContext('2d');
var fill = window.CanvasRenderingContext2D.prototype.fill;
ok(window.CanvasRenderingContext2D.prototype, "window.CanvasRenderingContext2D.prototype"); ok(window.CanvasRenderingContext2D.prototype, "window.CanvasRenderingContext2D.prototype");
ok(window.CanvasRenderingContext2D.prototype.fill, "window.CanvasRenderingContext2D.prototype.fill"); ok(window.CanvasRenderingContext2D.prototype.fill, "window.CanvasRenderingContext2D.prototype.fill");
window.CanvasRenderingContext2D.prototype = null; window.CanvasRenderingContext2D.prototype = null;
@ -19559,7 +19550,8 @@ ok(window.CanvasRenderingContext2D.prototype.fill === 1, "window.CanvasRendering
delete window.CanvasRenderingContext2D.prototype.fill; delete window.CanvasRenderingContext2D.prototype.fill;
todo(window.CanvasRenderingContext2D.prototype.fill === undefined, "window.CanvasRenderingContext2D.prototype.fill === undefined"); todo(window.CanvasRenderingContext2D.prototype.fill === undefined, "window.CanvasRenderingContext2D.prototype.fill === undefined");
//restore the original method to ensure that other tests can run successfully
window.CanvasRenderingContext2D.prototype.fill = fill;
} }
</script> </script>

View File

@ -18,6 +18,7 @@
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
#include "nsIFile.h" #include "nsIFile.h"
#include "nsDOMFile.h" #include "nsDOMFile.h"
#include "mozilla/Attributes.h"
class nsITransferable; class nsITransferable;
@ -34,7 +35,7 @@ struct TransferItem {
nsCOMPtr<nsIVariant> mData; nsCOMPtr<nsIVariant> mData;
}; };
class nsDOMDataTransfer : public nsIDOMDataTransfer class nsDOMDataTransfer MOZ_FINAL : public nsIDOMDataTransfer
{ {
public: public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS

View File

@ -7,8 +7,9 @@
#include "nsIDOMDeviceMotionEvent.h" #include "nsIDOMDeviceMotionEvent.h"
#include "nsDOMEvent.h" #include "nsDOMEvent.h"
#include "mozilla/Attributes.h"
class nsDOMDeviceRotationRate : public nsIDOMDeviceRotationRate class nsDOMDeviceRotationRate MOZ_FINAL : public nsIDOMDeviceRotationRate
{ {
public: public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS
@ -23,7 +24,7 @@ protected:
double mAlpha, mBeta, mGamma; double mAlpha, mBeta, mGamma;
}; };
class nsDOMDeviceAcceleration : public nsIDOMDeviceAcceleration class nsDOMDeviceAcceleration MOZ_FINAL : public nsIDOMDeviceAcceleration
{ {
public: public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS
@ -38,8 +39,8 @@ protected:
double mX, mY, mZ; double mX, mY, mZ;
}; };
class nsDOMDeviceMotionEvent : public nsDOMEvent, class nsDOMDeviceMotionEvent MOZ_FINAL : public nsDOMEvent,
public nsIDOMDeviceMotionEvent public nsIDOMDeviceMotionEvent
{ {
public: public:

View File

@ -17,8 +17,9 @@
#include "nsIScriptContext.h" #include "nsIScriptContext.h"
#include "nsWrapperCache.h" #include "nsWrapperCache.h"
#include "mozilla/ErrorResult.h" #include "mozilla/ErrorResult.h"
#include "mozilla/Attributes.h"
class nsDOMEventListenerWrapper : public nsIDOMEventListener class nsDOMEventListenerWrapper MOZ_FINAL : public nsIDOMEventListener
{ {
public: public:
nsDOMEventListenerWrapper(nsIDOMEventListener* aListener) nsDOMEventListenerWrapper(nsIDOMEventListener* aListener)

View File

@ -11,8 +11,9 @@
#include "nsTArray.h" #include "nsTArray.h"
#include "nsIDocument.h" #include "nsIDocument.h"
#include "dombindings.h" #include "dombindings.h"
#include "mozilla/Attributes.h"
class nsDOMTouch : public nsIDOMTouch class nsDOMTouch MOZ_FINAL : public nsIDOMTouch
{ {
public: public:
nsDOMTouch(nsIDOMEventTarget* aTarget, nsDOMTouch(nsIDOMEventTarget* aTarget,

View File

@ -12,6 +12,7 @@
#include "nsString.h" #include "nsString.h"
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
#include "jsapi.h" #include "jsapi.h"
#include "mozilla/Attributes.h"
class nsEventListenerInfo : public nsIEventListenerInfo class nsEventListenerInfo : public nsIEventListenerInfo
@ -38,7 +39,7 @@ protected:
bool mInSystemEventGroup; bool mInSystemEventGroup;
}; };
class nsEventListenerService : public nsIEventListenerService class nsEventListenerService MOZ_FINAL : public nsIEventListenerService
{ {
public: public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS

View File

@ -96,6 +96,7 @@
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/LookAndFeel.h" #include "mozilla/LookAndFeel.h"
#include "mozilla/Attributes.h"
#include "sampler.h" #include "sampler.h"
#include "nsIDOMClientRect.h" #include "nsIDOMClientRect.h"
@ -217,7 +218,7 @@ PrintDocTreeAll(nsIDocShellTreeItem* aItem)
} }
#endif #endif
class nsUITimerCallback : public nsITimerCallback class nsUITimerCallback MOZ_FINAL : public nsITimerCallback
{ {
public: public:
nsUITimerCallback() : mPreviousCount(0) {} nsUITimerCallback() : mPreviousCount(0) {}

View File

@ -34,6 +34,7 @@
#include "nsIFormControl.h" #include "nsIFormControl.h"
#include "nsIForm.h" #include "nsIForm.h"
#include "nsHTMLFormElement.h" #include "nsHTMLFormElement.h"
#include "mozilla/Attributes.h"
using namespace mozilla::widget; using namespace mozilla::widget;
@ -386,8 +387,8 @@ nsIMEStateManager::GetWidget(nsPresContext* aPresContext)
// sTextStateObserver points to the currently active nsTextStateManager // sTextStateObserver points to the currently active nsTextStateManager
// sTextStateObserver is null if there is no focused editor // sTextStateObserver is null if there is no focused editor
class nsTextStateManager : public nsISelectionListener, class nsTextStateManager MOZ_FINAL : public nsISelectionListener,
public nsStubMutationObserver public nsStubMutationObserver
{ {
public: public:
nsTextStateManager(); nsTextStateManager();

View File

@ -11,8 +11,9 @@
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsIDOMEvent.h" #include "nsIDOMEvent.h"
#include "dombindings.h" #include "dombindings.h"
#include "mozilla/Attributes.h"
class nsPaintRequest : public nsIDOMPaintRequest class nsPaintRequest MOZ_FINAL : public nsIDOMPaintRequest
{ {
public: public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS

View File

@ -9,8 +9,9 @@
#include "nsIPrivateTextRange.h" #include "nsIPrivateTextRange.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
#include "mozilla/Attributes.h"
class nsPrivateTextRange : public nsIPrivateTextRange class nsPrivateTextRange MOZ_FINAL : public nsIPrivateTextRange
{ {
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS
public: public:
@ -31,7 +32,7 @@ protected:
nsTextRangeStyle mRangeStyle; nsTextRangeStyle mRangeStyle;
}; };
class nsPrivateTextRangeList: public nsIPrivateTextRangeList class nsPrivateTextRangeList MOZ_FINAL : public nsIPrivateTextRangeList
{ {
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS
public: public:

View File

@ -14,13 +14,14 @@
#include "nsInterfaceHashtable.h" #include "nsInterfaceHashtable.h"
#include "nsIAtom.h" #include "nsIAtom.h"
#include "nsStubDocumentObserver.h" #include "nsStubDocumentObserver.h"
#include "mozilla/Attributes.h"
/* /*
* The implementation of the XML Events Basic profile * The implementation of the XML Events Basic profile
*/ */
class nsXMLEventsManager; class nsXMLEventsManager;
class nsXMLEventsListener : public nsIDOMEventListener { class nsXMLEventsListener MOZ_FINAL : public nsIDOMEventListener {
public: public:
static bool InitXMLEventsListener(nsIDocument * aDocument, static bool InitXMLEventsListener(nsIDocument * aDocument,
nsXMLEventsManager * aManager, nsXMLEventsManager * aManager,
@ -57,7 +58,7 @@ private:
}; };
class nsXMLEventsManager : public nsStubDocumentObserver { class nsXMLEventsManager MOZ_FINAL : public nsStubDocumentObserver {
public: public:
nsXMLEventsManager(); nsXMLEventsManager();
~nsXMLEventsManager(); ~nsXMLEventsManager();

View File

@ -15,6 +15,7 @@
#include "nsIChannelEventSink.h" #include "nsIChannelEventSink.h"
#include "nsIInterfaceRequestor.h" #include "nsIInterfaceRequestor.h"
#include "nsMediaCache.h" #include "nsMediaCache.h"
#include "mozilla/Attributes.h"
// For HTTP seeking, if number of bytes needing to be // For HTTP seeking, if number of bytes needing to be
// seeked forward is less than this value then a read is // seeked forward is less than this value then a read is
@ -390,9 +391,9 @@ public:
virtual bool IsSuspendedByCache(MediaResource** aActiveResource); virtual bool IsSuspendedByCache(MediaResource** aActiveResource);
virtual bool IsSuspended(); virtual bool IsSuspended();
class Listener : public nsIStreamListener, class Listener MOZ_FINAL : public nsIStreamListener,
public nsIInterfaceRequestor, public nsIInterfaceRequestor,
public nsIChannelEventSink public nsIChannelEventSink
{ {
public: public:
Listener(ChannelMediaResource* aResource) : mResource(aResource) {} Listener(ChannelMediaResource* aResource) : mResource(aResource) {}

View File

@ -17,6 +17,7 @@
#include "nsXPCOMCIDInternal.h" #include "nsXPCOMCIDInternal.h"
#include "prlog.h" #include "prlog.h"
#include "VideoUtils.h" #include "VideoUtils.h"
#include "mozilla/Attributes.h"
using namespace mozilla::layers; using namespace mozilla::layers;
@ -1469,7 +1470,7 @@ public:
} }
}; };
class MediaStreamGraphShutdownObserver : public nsIObserver class MediaStreamGraphShutdownObserver MOZ_FINAL : public nsIObserver
{ {
public: public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS

View File

@ -20,6 +20,7 @@
#include "prlog.h" #include "prlog.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "FileBlockCache.h" #include "FileBlockCache.h"
#include "mozilla/Attributes.h"
using namespace mozilla; using namespace mozilla;
@ -59,8 +60,8 @@ static const PRUint32 FREE_BLOCK_SCAN_LIMIT = 16;
// size limits). // size limits).
static nsMediaCache* gMediaCache; static nsMediaCache* gMediaCache;
class nsMediaCacheFlusher : public nsIObserver, class nsMediaCacheFlusher MOZ_FINAL : public nsIObserver,
public nsSupportsWeakReference { public nsSupportsWeakReference {
nsMediaCacheFlusher() {} nsMediaCacheFlusher() {}
~nsMediaCacheFlusher(); ~nsMediaCacheFlusher();
public: public:

View File

@ -11,6 +11,7 @@
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
#include "nsIDOMSVGAnimatedLengthList.h" #include "nsIDOMSVGAnimatedLengthList.h"
#include "nsSVGElement.h" #include "nsSVGElement.h"
#include "mozilla/Attributes.h"
namespace mozilla { namespace mozilla {
@ -103,7 +104,7 @@ class DOMSVGLengthList;
* One drawback of this design is that objects must look up their parent * One drawback of this design is that objects must look up their parent
* chain to find their element, but that overhead is relatively small. * chain to find their element, but that overhead is relatively small.
*/ */
class DOMSVGAnimatedLengthList : public nsIDOMSVGAnimatedLengthList class DOMSVGAnimatedLengthList MOZ_FINAL : public nsIDOMSVGAnimatedLengthList
{ {
friend class DOMSVGLengthList; friend class DOMSVGLengthList;

View File

@ -11,6 +11,7 @@
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
#include "nsIDOMSVGAnimatedNumberList.h" #include "nsIDOMSVGAnimatedNumberList.h"
#include "nsSVGElement.h" #include "nsSVGElement.h"
#include "mozilla/Attributes.h"
namespace mozilla { namespace mozilla {
@ -33,7 +34,7 @@ class SVGNumberList;
* out our pointers to them when they die (making our pointers to them true * out our pointers to them when they die (making our pointers to them true
* weak refs). * weak refs).
*/ */
class DOMSVGAnimatedNumberList : public nsIDOMSVGAnimatedNumberList class DOMSVGAnimatedNumberList MOZ_FINAL : public nsIDOMSVGAnimatedNumberList
{ {
friend class DOMSVGNumberList; friend class DOMSVGNumberList;

View File

@ -12,6 +12,7 @@
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
#include "nsIDOMSVGAnimTransformList.h" #include "nsIDOMSVGAnimTransformList.h"
#include "nsSVGElement.h" #include "nsSVGElement.h"
#include "mozilla/Attributes.h"
namespace mozilla { namespace mozilla {
@ -34,7 +35,7 @@ class SVGAnimatedTransformList;
* nulling out our pointers to them when they die (making our pointers to them * nulling out our pointers to them when they die (making our pointers to them
* true weak refs). * true weak refs).
*/ */
class DOMSVGAnimatedTransformList : public nsIDOMSVGAnimatedTransformList class DOMSVGAnimatedTransformList MOZ_FINAL : public nsIDOMSVGAnimatedTransformList
{ {
friend class DOMSVGTransformList; friend class DOMSVGTransformList;

View File

@ -13,6 +13,7 @@
#include "nsIDOMSVGLength.h" #include "nsIDOMSVGLength.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "SVGLength.h" #include "SVGLength.h"
#include "mozilla/Attributes.h"
class nsSVGElement; class nsSVGElement;
@ -65,7 +66,7 @@ namespace mozilla {
* if-else as appropriate. The bug for doing that work is: * if-else as appropriate. The bug for doing that work is:
* https://bugzilla.mozilla.org/show_bug.cgi?id=571734 * https://bugzilla.mozilla.org/show_bug.cgi?id=571734
*/ */
class DOMSVGLength : public nsIDOMSVGLength class DOMSVGLength MOZ_FINAL : public nsIDOMSVGLength
{ {
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGLENGTH_IID) NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGLENGTH_IID)

View File

@ -13,6 +13,7 @@
#include "nsIDOMSVGLengthList.h" #include "nsIDOMSVGLengthList.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "SVGLengthList.h" #include "SVGLengthList.h"
#include "mozilla/Attributes.h"
class nsIDOMSVGLength; class nsIDOMSVGLength;
class nsSVGElement; class nsSVGElement;
@ -38,8 +39,8 @@ class DOMSVGLength;
* *
* Our DOM items are created lazily on demand as and when script requests them. * Our DOM items are created lazily on demand as and when script requests them.
*/ */
class DOMSVGLengthList : public nsIDOMSVGLengthList, class DOMSVGLengthList MOZ_FINAL : public nsIDOMSVGLengthList,
public nsWrapperCache public nsWrapperCache
{ {
friend class DOMSVGLength; friend class DOMSVGLength;

View File

@ -42,6 +42,7 @@
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
#include "nsIDOMSVGMatrix.h" #include "nsIDOMSVGMatrix.h"
#include "mozilla/Attributes.h"
// We make DOMSVGMatrix a pseudo-interface to allow us to QI to it in order // We make DOMSVGMatrix a pseudo-interface to allow us to QI to it in order
// to check that the objects that scripts pass in are our *native* matrix // to check that the objects that scripts pass in are our *native* matrix
@ -57,7 +58,7 @@ namespace mozilla {
/** /**
* DOM wrapper for an SVG matrix. * DOM wrapper for an SVG matrix.
*/ */
class DOMSVGMatrix : public nsIDOMSVGMatrix class DOMSVGMatrix MOZ_FINAL : public nsIDOMSVGMatrix
{ {
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGMATRIX_IID) NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGMATRIX_IID)

View File

@ -11,6 +11,7 @@
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
#include "nsIDOMSVGNumber.h" #include "nsIDOMSVGNumber.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "mozilla/Attributes.h"
class nsSVGElement; class nsSVGElement;
@ -40,7 +41,7 @@ namespace mozilla {
* *
* See the comment in DOMSVGLength.h (yes, LENGTH), which applies here too. * See the comment in DOMSVGLength.h (yes, LENGTH), which applies here too.
*/ */
class DOMSVGNumber : public nsIDOMSVGNumber class DOMSVGNumber MOZ_FINAL : public nsIDOMSVGNumber
{ {
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGNUMBER_IID) NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGNUMBER_IID)

View File

@ -13,6 +13,7 @@
#include "nsIDOMSVGNumberList.h" #include "nsIDOMSVGNumberList.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "SVGNumberList.h" #include "SVGNumberList.h"
#include "mozilla/Attributes.h"
class nsSVGElement; class nsSVGElement;
@ -37,8 +38,8 @@ class DOMSVGNumber;
* *
* Our DOM items are created lazily on demand as and when script requests them. * Our DOM items are created lazily on demand as and when script requests them.
*/ */
class DOMSVGNumberList : public nsIDOMSVGNumberList, class DOMSVGNumberList MOZ_FINAL : public nsIDOMSVGNumberList,
public nsWrapperCache public nsWrapperCache
{ {
friend class DOMSVGNumber; friend class DOMSVGNumber;

View File

@ -14,6 +14,7 @@
#include "nsSVGElement.h" #include "nsSVGElement.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "SVGPathData.h" // IWYU pragma: keep #include "SVGPathData.h" // IWYU pragma: keep
#include "mozilla/Attributes.h"
class nsIDOMSVGPathSeg; class nsIDOMSVGPathSeg;
@ -47,8 +48,8 @@ class SVGAnimatedPathSegList;
* *
* Our DOM items are created lazily on demand as and when script requests them. * Our DOM items are created lazily on demand as and when script requests them.
*/ */
class DOMSVGPathSegList : public nsIDOMSVGPathSegList, class DOMSVGPathSegList MOZ_FINAL : public nsIDOMSVGPathSegList,
public nsWrapperCache public nsWrapperCache
{ {
friend class DOMSVGPathSeg; friend class DOMSVGPathSeg;

View File

@ -14,6 +14,7 @@
#include "nsIDOMSVGPoint.h" #include "nsIDOMSVGPoint.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "SVGPoint.h" #include "SVGPoint.h"
#include "mozilla/Attributes.h"
class nsSVGElement; class nsSVGElement;
@ -44,7 +45,7 @@ namespace mozilla {
* See the architecture comment in DOMSVGLength.h (yes, LENGTH) for an overview * See the architecture comment in DOMSVGLength.h (yes, LENGTH) for an overview
* of the important points regarding how this specific class works. * of the important points regarding how this specific class works.
*/ */
class DOMSVGPoint : public nsIDOMSVGPoint class DOMSVGPoint MOZ_FINAL : public nsIDOMSVGPoint
{ {
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGPOINT_IID) NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGPOINT_IID)

View File

@ -14,6 +14,7 @@
#include "nsSVGElement.h" #include "nsSVGElement.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "SVGPointList.h" // IWYU pragma: keep #include "SVGPointList.h" // IWYU pragma: keep
#include "mozilla/Attributes.h"
class nsIDOMSVGPoint; class nsIDOMSVGPoint;
@ -47,8 +48,8 @@ class SVGAnimatedPointList;
* *
* Our DOM items are created lazily on demand as and when script requests them. * Our DOM items are created lazily on demand as and when script requests them.
*/ */
class DOMSVGPointList : public nsIDOMSVGPointList, class DOMSVGPointList MOZ_FINAL : public nsIDOMSVGPointList,
public nsWrapperCache public nsWrapperCache
{ {
friend class DOMSVGPoint; friend class DOMSVGPoint;

View File

@ -11,6 +11,7 @@
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
#include "nsIDOMSVGStringList.h" #include "nsIDOMSVGStringList.h"
#include "nsSVGElement.h" #include "nsSVGElement.h"
#include "mozilla/Attributes.h"
namespace mozilla { namespace mozilla {
@ -42,7 +43,7 @@ class SVGStringList;
* them so it can return the same objects each time. It simply returns a new * them so it can return the same objects each time. It simply returns a new
* string each time any given item is requested. * string each time any given item is requested.
*/ */
class DOMSVGStringList : public nsIDOMSVGStringList class DOMSVGStringList MOZ_FINAL : public nsIDOMSVGStringList
{ {
public: public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS

View File

@ -24,6 +24,8 @@ public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS
NS_DECL_NSIDOMSVGTESTS NS_DECL_NSIDOMSVGTESTS
virtual ~DOMSVGTests() {}
friend class mozilla::DOMSVGStringList; friend class mozilla::DOMSVGStringList;
typedef mozilla::SVGStringList SVGStringList; typedef mozilla::SVGStringList SVGStringList;

View File

@ -15,6 +15,7 @@
#include "nsIDOMSVGTransform.h" #include "nsIDOMSVGTransform.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "SVGTransform.h" #include "SVGTransform.h"
#include "mozilla/Attributes.h"
class nsSVGElement; class nsSVGElement;
@ -38,7 +39,7 @@ class DOMSVGMatrix;
/** /**
* DOM wrapper for an SVG transform. See DOMSVGLength.h. * DOM wrapper for an SVG transform. See DOMSVGLength.h.
*/ */
class DOMSVGTransform : public nsIDOMSVGTransform class DOMSVGTransform MOZ_FINAL : public nsIDOMSVGTransform
{ {
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGTRANSFORM_IID) NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGTRANSFORM_IID)

View File

@ -14,6 +14,7 @@
#include "nsIDOMSVGTransformList.h" #include "nsIDOMSVGTransformList.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "SVGTransformList.h" #include "SVGTransformList.h"
#include "mozilla/Attributes.h"
class nsIDOMSVGTransform; class nsIDOMSVGTransform;
class nsSVGElement; class nsSVGElement;
@ -30,8 +31,8 @@ class DOMSVGTransform;
* *
* See the architecture comment in DOMSVGAnimatedTransformList.h. * See the architecture comment in DOMSVGAnimatedTransformList.h.
*/ */
class DOMSVGTransformList : public nsIDOMSVGTransformList, class DOMSVGTransformList MOZ_FINAL : public nsIDOMSVGTransformList,
public nsWrapperCache public nsWrapperCache
{ {
friend class DOMSVGTransform; friend class DOMSVGTransform;

View File

@ -14,6 +14,7 @@
#include "nsIDOMSVGPresAspectRatio.h" #include "nsIDOMSVGPresAspectRatio.h"
#include "nsISMILAttr.h" #include "nsISMILAttr.h"
#include "nsSVGElement.h" #include "nsSVGElement.h"
#include "mozilla/Attributes.h"
class nsISMILAnimationElement; class nsISMILAnimationElement;
class nsSMILValue; class nsSMILValue;
@ -147,7 +148,7 @@ private:
nsSVGElement* aSVGElement); nsSVGElement* aSVGElement);
public: public:
struct DOMBaseVal : public nsIDOMSVGPreserveAspectRatio struct DOMBaseVal MOZ_FINAL : public nsIDOMSVGPreserveAspectRatio
{ {
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(DOMBaseVal) NS_DECL_CYCLE_COLLECTION_CLASS(DOMBaseVal)
@ -169,7 +170,7 @@ public:
{ return mVal->SetBaseMeetOrSlice(aMeetOrSlice, mSVGElement); } { return mVal->SetBaseMeetOrSlice(aMeetOrSlice, mSVGElement); }
}; };
struct DOMAnimVal : public nsIDOMSVGPreserveAspectRatio struct DOMAnimVal MOZ_FINAL : public nsIDOMSVGPreserveAspectRatio
{ {
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimVal) NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimVal)
@ -201,7 +202,7 @@ public:
{ return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; } { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; }
}; };
struct DOMAnimPAspectRatio : public nsIDOMSVGAnimatedPreserveAspectRatio struct DOMAnimPAspectRatio MOZ_FINAL : public nsIDOMSVGAnimatedPreserveAspectRatio
{ {
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimPAspectRatio) NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimPAspectRatio)
@ -222,7 +223,7 @@ public:
{ return mVal->ToDOMAnimVal(aAnimVal, mSVGElement); } { return mVal->ToDOMAnimVal(aAnimVal, mSVGElement); }
}; };
struct SMILPreserveAspectRatio : public nsISMILAttr struct SMILPreserveAspectRatio MOZ_FINAL : public nsISMILAttr
{ {
public: public:
SMILPreserveAspectRatio(SVGAnimatedPreserveAspectRatio* aVal, SMILPreserveAspectRatio(SVGAnimatedPreserveAspectRatio* aVal,

View File

@ -14,6 +14,7 @@
#include "nsContentUtils.h" // NS_ENSURE_FINITE #include "nsContentUtils.h" // NS_ENSURE_FINITE
#include "nsSMILValue.h" #include "nsSMILValue.h"
#include "SVGOrientSMILType.h" #include "SVGOrientSMILType.h"
#include "mozilla/Attributes.h"
using namespace mozilla; using namespace mozilla;
@ -25,7 +26,7 @@ using namespace mozilla;
* any DOMSVGAngle passed in. Perhaps this is wrong and inconsistent with * any DOMSVGAngle passed in. Perhaps this is wrong and inconsistent with
* other parts of SVG, but it's how the code works for now. * other parts of SVG, but it's how the code works for now.
*/ */
class DOMSVGAngle : public nsIDOMSVGAngle class DOMSVGAngle MOZ_FINAL : public nsIDOMSVGAngle
{ {
public: public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS

View File

@ -14,6 +14,7 @@
#include "nsIDOMSVGAnimatedAngle.h" #include "nsIDOMSVGAnimatedAngle.h"
#include "nsISMILAttr.h" #include "nsISMILAttr.h"
#include "nsSVGElement.h" #include "nsSVGElement.h"
#include "mozilla/Attributes.h"
class nsISMILAnimationElement; class nsISMILAnimationElement;
class nsSMILValue; class nsSMILValue;
@ -77,7 +78,7 @@ private:
nsresult ToDOMAnimVal(nsIDOMSVGAngle **aResult, nsSVGElement* aSVGElement); nsresult ToDOMAnimVal(nsIDOMSVGAngle **aResult, nsSVGElement* aSVGElement);
public: public:
struct DOMBaseVal : public nsIDOMSVGAngle struct DOMBaseVal MOZ_FINAL : public nsIDOMSVGAngle
{ {
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(DOMBaseVal) NS_DECL_CYCLE_COLLECTION_CLASS(DOMBaseVal)
@ -116,7 +117,7 @@ public:
{ return mVal->ConvertToSpecifiedUnits(unitType, mSVGElement); } { return mVal->ConvertToSpecifiedUnits(unitType, mSVGElement); }
}; };
struct DOMAnimVal : public nsIDOMSVGAngle struct DOMAnimVal MOZ_FINAL : public nsIDOMSVGAngle
{ {
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimVal) NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimVal)
@ -153,7 +154,7 @@ public:
{ return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; } { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; }
}; };
struct DOMAnimatedAngle : public nsIDOMSVGAnimatedAngle struct DOMAnimatedAngle MOZ_FINAL : public nsIDOMSVGAnimatedAngle
{ {
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedAngle) NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedAngle)
@ -176,7 +177,7 @@ public:
// 'marker' element, and 'orient' must be special cased since it can also // 'marker' element, and 'orient' must be special cased since it can also
// take the value 'auto', making it a more complex type. // take the value 'auto', making it a more complex type.
struct SMILOrient : public nsISMILAttr struct SMILOrient MOZ_FINAL : public nsISMILAttr
{ {
public: public:
SMILOrient(nsSVGOrientType* aOrientType, SMILOrient(nsSVGOrientType* aOrientType,

View File

@ -13,6 +13,7 @@
#include "nsISMILAttr.h" #include "nsISMILAttr.h"
#include "nsISupportsImpl.h" #include "nsISupportsImpl.h"
#include "nsSVGElement.h" #include "nsSVGElement.h"
#include "mozilla/Attributes.h"
class nsISMILAnimationElement; class nsISMILAnimationElement;
class nsSMILValue; class nsSMILValue;
@ -51,7 +52,7 @@ private:
PRUint8 mAttrEnum; // element specified tracking for attribute PRUint8 mAttrEnum; // element specified tracking for attribute
public: public:
struct DOMAnimatedBoolean : public nsIDOMSVGAnimatedBoolean struct DOMAnimatedBoolean MOZ_FINAL : public nsIDOMSVGAnimatedBoolean
{ {
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedBoolean) NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedBoolean)

View File

@ -12,6 +12,7 @@
#include "nsIDOMSVGAnimatedString.h" #include "nsIDOMSVGAnimatedString.h"
#include "nsISMILAttr.h" #include "nsISMILAttr.h"
#include "nsString.h" #include "nsString.h"
#include "mozilla/Attributes.h"
class nsSVGStylableElement; class nsSVGStylableElement;
@ -43,7 +44,7 @@ private:
nsAutoPtr<nsString> mAnimVal; nsAutoPtr<nsString> mAnimVal;
public: public:
struct DOMAnimatedString : public nsIDOMSVGAnimatedString struct DOMAnimatedString MOZ_FINAL : public nsIDOMSVGAnimatedString
{ {
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedString) NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedString)

View File

@ -12,6 +12,7 @@
#include "nsIDOMSVGAnimatedEnum.h" #include "nsIDOMSVGAnimatedEnum.h"
#include "nsISMILAttr.h" #include "nsISMILAttr.h"
#include "nsSVGElement.h" #include "nsSVGElement.h"
#include "mozilla/Attributes.h"
class nsIAtom; class nsIAtom;
class nsISMILAnimationElement; class nsISMILAnimationElement;
@ -62,7 +63,7 @@ private:
nsSVGEnumMapping *GetMapping(nsSVGElement *aSVGElement); nsSVGEnumMapping *GetMapping(nsSVGElement *aSVGElement);
public: public:
struct DOMAnimatedEnum : public nsIDOMSVGAnimatedEnumeration struct DOMAnimatedEnum MOZ_FINAL : public nsIDOMSVGAnimatedEnumeration
{ {
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedEnum) NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedEnum)

View File

@ -12,6 +12,7 @@
#include "nsIDOMSVGAnimatedInteger.h" #include "nsIDOMSVGAnimatedInteger.h"
#include "nsISMILAttr.h" #include "nsISMILAttr.h"
#include "nsSVGElement.h" #include "nsSVGElement.h"
#include "mozilla/Attributes.h"
class nsISMILAnimationElement; class nsISMILAnimationElement;
class nsSMILValue; class nsSMILValue;
@ -61,7 +62,7 @@ private:
bool mIsBaseSet; bool mIsBaseSet;
public: public:
struct DOMAnimatedInteger : public nsIDOMSVGAnimatedInteger struct DOMAnimatedInteger MOZ_FINAL : public nsIDOMSVGAnimatedInteger
{ {
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedInteger) NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedInteger)

View File

@ -12,6 +12,7 @@
#include "nsIDOMSVGAnimatedInteger.h" #include "nsIDOMSVGAnimatedInteger.h"
#include "nsISMILAttr.h" #include "nsISMILAttr.h"
#include "nsSVGElement.h" #include "nsSVGElement.h"
#include "mozilla/Attributes.h"
class nsISMILAnimationElement; class nsISMILAnimationElement;
class nsSMILValue; class nsSMILValue;
@ -68,7 +69,7 @@ private:
bool mIsBaseSet; bool mIsBaseSet;
public: public:
struct DOMAnimatedInteger : public nsIDOMSVGAnimatedInteger struct DOMAnimatedInteger MOZ_FINAL : public nsIDOMSVGAnimatedInteger
{ {
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedInteger) NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedInteger)

View File

@ -177,13 +177,14 @@ nsSVGLength2::GetAxisLength(nsSVGSVGElement *aCtx) const
float float
nsSVGLength2::GetAxisLength(nsIFrame *aNonSVGFrame) const nsSVGLength2::GetAxisLength(nsIFrame *aNonSVGFrame) const
{ {
gfxRect rect = nsSVGIntegrationUtils::GetSVGRectForNonSVGFrame(aNonSVGFrame); gfxSize size =
nsSVGIntegrationUtils::GetSVGCoordContextForNonSVGFrame(aNonSVGFrame);
float length; float length;
switch (mCtxType) { switch (mCtxType) {
case nsSVGUtils::X: length = rect.Width(); break; case nsSVGUtils::X: length = size.width; break;
case nsSVGUtils::Y: length = rect.Height(); break; case nsSVGUtils::Y: length = size.height; break;
case nsSVGUtils::XY: case nsSVGUtils::XY:
length = nsSVGUtils::ComputeNormalizedHypotenuse(rect.Width(), rect.Height()); length = nsSVGUtils::ComputeNormalizedHypotenuse(size.width, size.height);
break; break;
default: default:
NS_NOTREACHED("Unknown axis type"); NS_NOTREACHED("Unknown axis type");

View File

@ -15,6 +15,7 @@
#include "nsSVGLength2.h" #include "nsSVGLength2.h"
#include "nsSVGViewBox.h" #include "nsSVGViewBox.h"
#include "SVGAnimatedPreserveAspectRatio.h" #include "SVGAnimatedPreserveAspectRatio.h"
#include "mozilla/Attributes.h"
class nsSVGOrientType class nsSVGOrientType
{ {
@ -46,7 +47,7 @@ private:
nsSVGEnumValue mAnimVal; nsSVGEnumValue mAnimVal;
nsSVGEnumValue mBaseVal; nsSVGEnumValue mBaseVal;
struct DOMAnimatedEnum : public nsIDOMSVGAnimatedEnumeration struct DOMAnimatedEnum MOZ_FINAL : public nsIDOMSVGAnimatedEnumeration
{ {
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedEnum) NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedEnum)

View File

@ -12,8 +12,9 @@
#include "nsSMILValue.h" #include "nsSMILValue.h"
#include "nsSMILFloatType.h" #include "nsSMILFloatType.h"
#include "nsIDOMSVGNumber.h" #include "nsIDOMSVGNumber.h"
#include "mozilla/Attributes.h"
class DOMSVGNumber : public nsIDOMSVGNumber class DOMSVGNumber MOZ_FINAL : public nsIDOMSVGNumber
{ {
public: public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS

View File

@ -13,6 +13,7 @@
#include "nsISMILAttr.h" #include "nsISMILAttr.h"
#include "nsMathUtils.h" #include "nsMathUtils.h"
#include "nsSVGElement.h" #include "nsSVGElement.h"
#include "mozilla/Attributes.h"
class nsISMILAnimationElement; class nsISMILAnimationElement;
class nsSMILValue; class nsSMILValue;
@ -61,7 +62,7 @@ private:
bool mIsBaseSet; bool mIsBaseSet;
public: public:
struct DOMAnimatedNumber : public nsIDOMSVGAnimatedNumber struct DOMAnimatedNumber MOZ_FINAL : public nsIDOMSVGAnimatedNumber
{ {
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedNumber) NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedNumber)

View File

@ -13,6 +13,7 @@
#include "nsISMILAttr.h" #include "nsISMILAttr.h"
#include "nsMathUtils.h" #include "nsMathUtils.h"
#include "nsSVGElement.h" #include "nsSVGElement.h"
#include "mozilla/Attributes.h"
class nsISMILAnimationElement; class nsISMILAnimationElement;
class nsSMILValue; class nsSMILValue;
@ -69,7 +70,7 @@ private:
bool mIsBaseSet; bool mIsBaseSet;
public: public:
struct DOMAnimatedNumber : public nsIDOMSVGAnimatedNumber struct DOMAnimatedNumber MOZ_FINAL : public nsIDOMSVGAnimatedNumber
{ {
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedNumber) NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedNumber)

View File

@ -8,6 +8,7 @@
#include "gfxRect.h" #include "gfxRect.h"
#include "nsIDOMSVGRect.h" #include "nsIDOMSVGRect.h"
#include "mozilla/Attributes.h"
nsresult nsresult
NS_NewSVGRect(nsIDOMSVGRect** result, NS_NewSVGRect(nsIDOMSVGRect** result,
@ -20,7 +21,7 @@ NS_NewSVGRect(nsIDOMSVGRect** result, const gfxRect& rect);
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// nsSVGRect class // nsSVGRect class
class nsSVGRect : public nsIDOMSVGRect class nsSVGRect MOZ_FINAL : public nsIDOMSVGRect
{ {
public: public:
nsSVGRect(float x=0.0f, float y=0.0f, float w=0.0f, float h=0.0f); nsSVGRect(float x=0.0f, float y=0.0f, float w=0.0f, float h=0.0f);

View File

@ -1145,16 +1145,6 @@ nsSVGSVGElement::GetLength(PRUint8 aCtxType)
return 0; return 0;
} }
void
nsSVGSVGElement::SyncWidthOrHeight(nsIAtom* aName, nsSVGElement *aTarget) const
{
NS_ASSERTION(aName == nsGkAtoms::width || aName == nsGkAtoms::height,
"The clue is in the function name");
PRUint32 index = *sLengthInfo[WIDTH].mName == aName ? WIDTH : HEIGHT;
aTarget->SetLength(aName, mLengthAttributes[index]);
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// nsSVGElement methods // nsSVGElement methods

View File

@ -18,6 +18,7 @@
#include "nsSVGStylableElement.h" #include "nsSVGStylableElement.h"
#include "nsSVGViewBox.h" #include "nsSVGViewBox.h"
#include "SVGAnimatedPreserveAspectRatio.h" #include "SVGAnimatedPreserveAspectRatio.h"
#include "mozilla/Attributes.h"
class nsIDOMSVGMatrix; class nsIDOMSVGMatrix;
class nsSMILTimeContainer; class nsSMILTimeContainer;
@ -59,7 +60,7 @@ public:
private: private:
struct DOMVal : public nsIDOMSVGPoint { struct DOMVal MOZ_FINAL : public nsIDOMSVGPoint {
NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(DOMVal) NS_DECL_CYCLE_COLLECTION_CLASS(DOMVal)
@ -173,8 +174,6 @@ public:
// nsSVGSVGElement methods: // nsSVGSVGElement methods:
float GetLength(PRUint8 mCtxType); float GetLength(PRUint8 mCtxType);
// Copy our width or height to the target
void SyncWidthOrHeight(nsIAtom* aName, nsSVGElement *aTarget) const;
// public helpers: // public helpers:

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