r=peterv sr=bz
This commit is contained in:
sicking%bigfoot.com 2002-11-25 11:21:22 +00:00
Родитель 2133dbe645
Коммит 8d87d5e285
55 изменённых файлов: 267 добавлений и 112 удалений

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

@ -1,6 +1,7 @@
#
# This is a list of local files which get copied to the mozilla:dist:content directory
#
nsContentErrors.h
nsContentPolicyUtils.h
nsContentUtils.h
nsIAnonymousContent.h

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

@ -33,6 +33,7 @@ EXPORTS = \
nsIContent.h \
nsIAnonymousContent.h \
nsIContentIterator.h \
nsContentErrors.h \
nsContentPolicyUtils.h \
nsContentUtils.h \
nsIDocument.h \

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

@ -0,0 +1,76 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Jonas Sicking <jonas@sicking.cc> (original author)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsContentErrors_h___
#define nsContentErrors_h___
/** Error codes for nsICSSParser::ParseAndAppendDeclaration */
#define NS_CSS_PARSER_DROP_DECLARATION \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_CONTENT, 0)
/** Error codes for nsIContent::GetAttr */
// Returned if the attr exists and has a value
#define NS_CONTENT_ATTR_HAS_VALUE NS_OK
// Returned if the attr exists but has no value
#define NS_CONTENT_ATTR_NO_VALUE \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_CONTENT, 1)
// Returned if the attr does not exist
#define NS_CONTENT_ATTR_NOT_THERE \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_CONTENT, 2)
/** Error codes for nsIHTMLStyleSheet */
// XXX this is not really used
#define NS_HTML_STYLE_PROPERTY_NOT_THERE \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_CONTENT, 3)
/** Error codes for MaybeTriggerAutoLink */
#define NS_XML_AUTOLINK_EMBED \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_CONTENT, 4)
#define NS_XML_AUTOLINK_NEW \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_CONTENT, 5)
#define NS_XML_AUTOLINK_REPLACE \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_CONTENT, 6)
#define NS_XML_AUTOLINK_UNDEFINED \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_CONTENT, 7)
#endif // nsContentErrors_h___

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

@ -42,6 +42,7 @@
#include "nsISupports.h"
#include "nsEvent.h"
#include "nsAString.h"
#include "nsContentErrors.h"
// Forward declarations
class nsIAtom;
@ -546,16 +547,4 @@ public:
#endif
};
// nsresult codes for GetAttr
/** Returned if the attr exists and has a value */
#define NS_CONTENT_ATTR_HAS_VALUE NS_OK
/** Returned if the attr exists but has no value */
#define NS_CONTENT_ATTR_NO_VALUE \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT,0)
/** Returned if the attr does not exist */
#define NS_CONTENT_ATTR_NOT_THERE \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT,1)
#endif /* nsIContent_h___ */

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

@ -59,7 +59,7 @@ public:
NS_IMETHOD GetID(nsIAtom*& aResult) const = 0;
NS_IMETHOD GetClasses(nsVoidArray& aArray) const = 0;
NS_IMETHOD HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const = 0;
NS_IMETHOD_(PRBool) HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const = 0;
NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker) = 0;
NS_IMETHOD GetInlineStyleRule(nsIStyleRule** aStyleRule) = 0;

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

@ -2234,10 +2234,10 @@ nsGenericElement::GetClasses(nsVoidArray& aArray) const
return NS_OK;
}
NS_IMETHODIMP
NS_IMETHODIMP_(PRBool)
nsGenericElement::HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const
{
return NS_COMFALSE;
return PR_FALSE;
}
NS_IMETHODIMP

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

@ -415,7 +415,7 @@ public:
// nsIStyledContent interface methods
NS_IMETHOD GetID(nsIAtom*& aResult) const;
NS_IMETHOD GetClasses(nsVoidArray& aArray) const;
NS_IMETHOD HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const;
NS_IMETHOD_(PRBool) HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const;
NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker);
NS_IMETHOD GetInlineStyleRule(nsIStyleRule** aStyleRule);
NS_IMETHOD GetMappedAttributeImpact(const nsIAtom* aAttribute,

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

@ -4528,9 +4528,6 @@ nsSelection::GetHint(HINT *aHintRight)
/** DeleteFromDocument
* will return NS_OK if it handles the event or NS_COMFALSE if not.
*/
NS_IMETHODIMP
nsSelection::DeleteFromDocument()
{
@ -5017,7 +5014,7 @@ nsTypedSelection::RemoveItem(nsIDOMRange *aItem)
return NS_OK;
}
}
return NS_COMFALSE;
return NS_OK;
}

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

@ -2265,13 +2265,13 @@ nsGenericHTMLElement::GetClasses(nsVoidArray& aArray) const
return NS_OK;
}
nsresult
NS_IMETHODIMP_(PRBool)
nsGenericHTMLElement::HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const
{
if (nsnull != mAttributes) {
if (mAttributes) {
return mAttributes->HasClass(aClass, aCaseSensitive);
}
return NS_COMFALSE;
return PR_FALSE;
}
nsresult

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

@ -212,7 +212,7 @@ public:
NS_IMETHOD GetHTMLAttribute(nsIAtom* aAttribute, nsHTMLValue& aValue) const;
NS_IMETHOD GetID(nsIAtom*& aResult) const;
NS_IMETHOD GetClasses(nsVoidArray& aArray) const;
NS_IMETHOD HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const;
NS_IMETHOD_(PRBool) HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const;
NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker);
NS_IMETHOD GetInlineStyleRule(nsIStyleRule** aStyleRule);
NS_IMETHOD GetBaseURL(nsIURI*& aBaseURL) const;

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

@ -114,10 +114,6 @@ public:
#define NS_CSS_GETINFO_CSS2 ((PRUint32) 0x00000004L)
#define NS_CSS_GETINFO_CSS_FROSTING ((PRUint32) 0x00000008L)
// Success code that can be returned from ParseAndAppendDeclaration()
#define NS_CSS_PARSER_DROP_DECLARATION \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT,1)
extern NS_EXPORT nsresult
NS_NewCSSParser(nsICSSParser** aInstancePtrResult);

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

@ -68,6 +68,7 @@
#include "nsINameSpaceManager.h"
#include "nsINameSpace.h"
#include "nsThemeConstants.h"
#include "nsContentErrors.h"
#include "prprf.h"

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

@ -3952,7 +3952,7 @@ static PRBool SelectorMatches(RuleProcessorData &data,
if (result) {
nsAtomList* classList = aSelector->mClassList;
while (nsnull != classList) {
if (localTrue == (NS_COMFALSE == data.mStyledContent->HasClass(classList->mAtom, isCaseSensitive))) {
if (localTrue == (!data.mStyledContent->HasClass(classList->mAtom, isCaseSensitive))) {
result = PR_FALSE;
break;
}

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

@ -1433,7 +1433,7 @@ nsHTMLAttributes::GetClasses(nsVoidArray& aArray) const
return NS_OK;
}
NS_IMETHODIMP
NS_IMETHODIMP_(PRBool)
nsHTMLAttributes::HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const
{
NS_PRECONDITION(aClass, "unexpected null pointer");
@ -1442,7 +1442,7 @@ nsHTMLAttributes::HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const
if (aCaseSensitive) {
do {
if (classList->mAtom == aClass)
return NS_OK;
return PR_TRUE;
classList = classList->mNext;
} while (classList);
} else {
@ -1457,12 +1457,12 @@ nsHTMLAttributes::HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const
classList->mAtom->GetUnicode(&class2Buf);
nsDependentString class2(class2Buf);
if (class1.Equals(class2, nsCaseInsensitiveStringComparator()))
return NS_OK;
return PR_TRUE;
classList = classList->mNext;
} while (classList);
}
}
return NS_COMFALSE;
return PR_FALSE;
}
#ifdef UNIQUE_ATTR_SUPPORT

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

@ -231,7 +231,7 @@ public:
NS_METHOD GetID(nsIAtom*& aResult) const;
NS_METHOD GetClasses(nsVoidArray& aArray) const;
NS_METHOD HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const;
NS_METHOD_(PRBool) HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const;
NS_METHOD Clone(nsHTMLAttributes** aInstancePtrResult) const;

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

@ -83,16 +83,6 @@ public:
NS_IMETHOD GetXMLBaseURI(nsIURI **aURI) = 0;
};
// Some return values for MaybeTriggerAutoLink
#define NS_XML_AUTOLINK_EMBED \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 4)
#define NS_XML_AUTOLINK_NEW \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 5)
#define NS_XML_AUTOLINK_REPLACE \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 6)
#define NS_XML_AUTOLINK_UNDEFINED \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 7)
extern nsresult
NS_NewXMLElement(nsIContent** aResult, nsINodeInfo* aNodeInfo);

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

@ -737,10 +737,10 @@ nsXULAttributes::GetClasses(nsVoidArray& aArray) const
return nsClassList::GetClasses(mClassList, aArray);
}
nsresult
PRBool
nsXULAttributes::HasClass(nsIAtom* aClass) const
{
return nsClassList::HasClass(mClassList, aClass) ? NS_OK : NS_COMFALSE;
return nsClassList::HasClass(mClassList, aClass);
}
nsresult nsXULAttributes::SetClassList(nsClassList* aClassList)

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

@ -184,7 +184,7 @@ public:
// Style Helpers
nsresult GetClasses(nsVoidArray& aArray) const;
nsresult HasClass(nsIAtom* aClass) const;
PRBool HasClass(nsIAtom* aClass) const;
nsresult SetClassList(nsClassList* aClassList);
nsresult UpdateClassList(const nsAString& aValue);

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

@ -3784,7 +3784,7 @@ nsXULElement::GetClasses(nsVoidArray& aArray) const
return NS_ERROR_NULL_POINTER; // XXXwaterson kooky error code to return, but...
}
NS_IMETHODIMP
NS_IMETHODIMP_(PRBool)
nsXULElement::HasClass(nsIAtom* aClass, PRBool /*aCaseSensitive*/) const
{
// XXXwaterson if we decide to lazily fault the class list in
@ -3793,9 +3793,9 @@ nsXULElement::HasClass(nsIAtom* aClass, PRBool /*aCaseSensitive*/) const
return Attributes()->HasClass(aClass);
if (mPrototype)
return nsClassList::HasClass(mPrototype->mClassList, aClass) ? NS_OK : NS_COMFALSE;
return nsClassList::HasClass(mPrototype->mClassList, aClass);
return NS_COMFALSE;
return PR_FALSE;
}
NS_IMETHODIMP

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

@ -473,7 +473,7 @@ public:
// nsIStyledContent
NS_IMETHOD GetID(nsIAtom*& aResult) const;
NS_IMETHOD GetClasses(nsVoidArray& aArray) const;
NS_IMETHOD HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const;
NS_IMETHOD_(PRBool) HasClass(nsIAtom* aClass, PRBool aCaseSensitive) const;
NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker);
NS_IMETHOD GetInlineStyleRule(nsIStyleRule** aStyleRule);

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

@ -308,7 +308,7 @@ nsScriptNameSpaceManager::FillHashWithDOMInterfaces()
nsCOMPtr<nsIInterfaceInfo> if_info;
nsXPIDLCString if_name;
for ( ; domInterfaces->IsDone() == NS_COMFALSE; domInterfaces->Next()) {
for ( ; domInterfaces->IsDone() == NS_ENUMERATOR_FALSE; domInterfaces->Next()) {
rv = domInterfaces->CurrentItem(getter_AddRefs(entry));
NS_ENSURE_SUCCESS(rv, rv);

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

@ -308,7 +308,7 @@ nsScriptNameSpaceManager::FillHashWithDOMInterfaces()
nsCOMPtr<nsIInterfaceInfo> if_info;
nsXPIDLCString if_name;
for ( ; domInterfaces->IsDone() == NS_COMFALSE; domInterfaces->Next()) {
for ( ; domInterfaces->IsDone() == NS_ENUMERATOR_FALSE; domInterfaces->Next()) {
rv = domInterfaces->CurrentItem(getter_AddRefs(entry));
NS_ENSURE_SUCCESS(rv, rv);

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

@ -517,7 +517,7 @@ static nsresult do_dispatch(
method = PyObject_GetAttrString(real_ob, (char *)szMethodName);
if ( !method ) {
PyErr_Clear();
ret = NS_COMFALSE;
ret = NS_PYXPCOM_NO_SUCH_METHOD;
goto done;
}
// Make the call
@ -564,7 +564,7 @@ nsresult PyG_Base::InvokeNativeViaPolicy(
nsresult nr = InvokeNativeViaPolicyInternal(szMethodName, ppResult, szFormat, va);
va_end(va);
if (nr==NS_COMFALSE) {
if (nr == NS_PYXPCOM_NO_SUCH_METHOD) {
// Only problem was missing method.
PyErr_Format(PyExc_AttributeError, "The object does not have a '%s' function.", szMethodName);
}
@ -587,7 +587,7 @@ nsresult PyG_Base::InvokeNativeGetViaPolicy(
strncat(buf, szPropertyName, sizeof(buf)*sizeof(buf[0])-strlen(buf)-1);
buf[sizeof(buf)/sizeof(buf[0])-1] = '\0';
ret = InvokeNativeViaPolicyInternal(buf, ppResult, nsnull, nsnull);
if (ret == NS_COMFALSE) {
if (ret == NS_PYXPCOM_NO_SUCH_METHOD) {
// No method of that name - just try a property.
// Bit to a hack here to maintain the use of a policy.
// We actually get the policies underlying object
@ -637,7 +637,7 @@ nsresult PyG_Base::InvokeNativeSetViaPolicy(
va_start(va, szPropertyName);
ret = InvokeNativeViaPolicyInternal(buf, NULL, "O", va);
va_end(va);
if (ret == NS_COMFALSE) {
if (ret == NS_PYXPCOM_NO_SUCH_METHOD) {
// No method of that name - just try a property.
// Bit to a hack here to maintain the use of a policy.
// We actually get the policies underlying object

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

@ -60,6 +60,9 @@ extern nsIID Py_nsIID_NULL;
**************************************************************************
*************************************************************************/
#define NS_PYXPCOM_NO_SUCH_METHOD \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_PYXPCOM, 0)
// The exception object (loaded from the xpcom .py code)
extern PYXPCOM_EXPORT PyObject *PyXPCOM_Error;

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

@ -173,7 +173,7 @@ nsXPCComponents_Interfaces::NewEnumerate(nsIXPConnectWrappedNative *wrapper,
while(1)
{
if(NS_COMFALSE == e->IsDone() &&
if(NS_ENUMERATOR_FALSE == e->IsDone() &&
NS_SUCCEEDED(e->CurrentItem(getter_AddRefs(isup))) && isup)
{
e->Next();

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

@ -74,6 +74,7 @@
#include "nsUnicharUtils.h"
#include "nsPrintfCString.h"
#include "nsDummyLayoutRequest.h"
#include "nsLayoutErrors.h"
#ifdef DEBUG
//#define NOISY_DEBUG

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

@ -155,16 +155,14 @@ public:
*/
NS_IMETHOD ShutDown() = 0;
/** HandleKeyEvent will accept an event and frame and
* will return NS_OK if it handles the event or NS_COMFALSE if not.
/** HandleKeyEvent will accept an event.
* <P>DOES NOT ADDREF<P>
* @param aGuiEvent is the event that should be dealt with by aFocusFrame
* @param aFrame is the frame that MAY handle the event
*/
NS_IMETHOD HandleTextEvent(nsGUIEvent *aGuiEvent) = 0;
/** HandleKeyEvent will accept an event and frame and
* will return NS_OK if it handles the event or NS_COMFALSE if not.
/** HandleKeyEvent will accept an event and a PresContext.
* <P>DOES NOT ADDREF<P>
* @param aGuiEvent is the event that should be dealt with by aFocusFrame
* @param aFrame is the frame that MAY handle the event

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

@ -0,0 +1,59 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Jonas Sicking <jonas@sicking.cc> (original author)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsLayoutErrors_h___
#define nsLayoutErrors_h___
/** Error codes for nsITableLayout */
#define NS_TABLELAYOUT_CELL_NOT_FOUND \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 0)
/** Error codes for frame property functions */
#define NS_IFRAME_MGR_PROP_NOT_THERE \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 1)
#define NS_IFRAME_MGR_PROP_OVERWRITTEN \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 2)
/** Error codes for nsFrame::GetNextPrevLineFromeBlockFrame */
#define NS_POSITION_BEFORE_TABLE \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 3)
#endif // nsLayoutErrors_h___

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

@ -106,6 +106,7 @@
#include "nsIObserverService.h" // for reflow observation
#include "nsIDocShell.h" // for reflow observation
#include "nsIDOMRange.h"
#include "nsLayoutErrors.h"
#ifdef MOZ_PERF_METRICS
#include "nsITimeRecorder.h"
#endif
@ -3353,7 +3354,7 @@ PresShell::CompleteMove(PRBool aForward, PRBool aExtend)
0, //irrelavent since we set outsidelimit
outsideLimit
);
if (NS_COMFALSE == result) //NS_COMFALSE should ALSO break
if (NS_POSITION_BEFORE_TABLE == result) //NS_POSITION_BEFORE_TABLE should ALSO break
break;
if (NS_OK != result || !pos.mResultFrame )
return result?result:NS_ERROR_FAILURE;

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

@ -40,6 +40,7 @@ nsIStyleContext.h
nsIStyleFrameConstruction.h
nsIStyleSet.h
nsITextFrame.h
nsLayoutErrors.h
nsReflowType.h
nsStyleChangeList.h
nsStyleConsts.h

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

@ -66,6 +66,7 @@ nsIStatefulFrame.h \
nsIStyleContext.h \
nsIStyleFrameConstruction.h \
nsIStyleSet.h \
nsLayoutErrors.h \
nsReflowType.h \
nsStyleChangeList.h \
nsStyleConsts.h \

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

@ -68,13 +68,6 @@ typedef void
// Option flags for GetFrameProperty() member function
#define NS_IFRAME_MGR_REMOVE_PROP 0x0001
// nsresult error codes for frame property functions
#define NS_IFRAME_MGR_PROP_NOT_THERE \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 1)
#define NS_IFRAME_MGR_PROP_OVERWRITTEN \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 2)
/**
* Frame manager interface. The frame manager serves two purposes:
* <li>provides a service for mapping from content to frame and from out-of-flow

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

@ -155,16 +155,14 @@ public:
*/
NS_IMETHOD ShutDown() = 0;
/** HandleKeyEvent will accept an event and frame and
* will return NS_OK if it handles the event or NS_COMFALSE if not.
/** HandleKeyEvent will accept an event.
* <P>DOES NOT ADDREF<P>
* @param aGuiEvent is the event that should be dealt with by aFocusFrame
* @param aFrame is the frame that MAY handle the event
*/
NS_IMETHOD HandleTextEvent(nsGUIEvent *aGuiEvent) = 0;
/** HandleKeyEvent will accept an event and frame and
* will return NS_OK if it handles the event or NS_COMFALSE if not.
/** HandleKeyEvent will accept an event and a PresContext.
* <P>DOES NOT ADDREF<P>
* @param aGuiEvent is the event that should be dealt with by aFocusFrame
* @param aFrame is the frame that MAY handle the event

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

@ -0,0 +1,59 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Jonas Sicking <jonas@sicking.cc> (original author)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsLayoutErrors_h___
#define nsLayoutErrors_h___
/** Error codes for nsITableLayout */
#define NS_TABLELAYOUT_CELL_NOT_FOUND \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 0)
/** Error codes for frame property functions */
#define NS_IFRAME_MGR_PROP_NOT_THERE \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 1)
#define NS_IFRAME_MGR_PROP_OVERWRITTEN \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 2)
/** Error codes for nsFrame::GetNextPrevLineFromeBlockFrame */
#define NS_POSITION_BEFORE_TABLE \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 3)
#endif // nsLayoutErrors_h___

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

@ -75,6 +75,7 @@
#include "prenv.h"
#include "plstr.h"
#include "nsGUIEvent.h"
#include "nsLayoutErrors.h"
#ifdef IBMBIDI
#include "nsBidiPresUtils.h"
@ -6051,7 +6052,7 @@ nsBlockFrame::HandleEvent(nsIPresContext* aPresContext,
if (resultFrame)
{
if (NS_COMFALSE == result)
if (NS_POSITION_BEFORE_TABLE == result)
{
nsCOMPtr<nsISelectionController> selCon;
result = GetSelectionController(aPresContext, getter_AddRefs(selCon));

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

@ -62,6 +62,7 @@
#include "nsCSSRendering.h"
#include "nsTransform2D.h"
#include "nsRegion.h"
#include "nsLayoutErrors.h"
static NS_DEFINE_CID(kRegionCID, NS_REGION_CID);

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

@ -96,6 +96,7 @@
#include "nsILookAndFeel.h"
#include "nsLayoutCID.h"
#include "nsWidgetsCID.h" // for NS_LOOKANDFEEL_CID
#include "nsLayoutErrors.h"
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);//for triple click pref
static NS_DEFINE_CID(kSelectionImageService, NS_SELECTIONIMAGESERVICE_CID);
@ -3357,7 +3358,7 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsIPresContext* aPresContext,
aPos->mContentOffsetEnd = aPos->mContentOffset;
//result frame is the result frames parent.
resultFrame->GetParent(&aPos->mResultFrame);
return NS_COMFALSE;
return NS_POSITION_BEFORE_TABLE;
}
}
}

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

@ -4528,9 +4528,6 @@ nsSelection::GetHint(HINT *aHintRight)
/** DeleteFromDocument
* will return NS_OK if it handles the event or NS_COMFALSE if not.
*/
NS_IMETHODIMP
nsSelection::DeleteFromDocument()
{
@ -5017,7 +5014,7 @@ nsTypedSelection::RemoveItem(nsIDOMRange *aItem)
return NS_OK;
}
}
return NS_COMFALSE;
return NS_OK;
}

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

@ -75,6 +75,7 @@
#include "prenv.h"
#include "plstr.h"
#include "nsGUIEvent.h"
#include "nsLayoutErrors.h"
#ifdef IBMBIDI
#include "nsBidiPresUtils.h"
@ -6051,7 +6052,7 @@ nsBlockFrame::HandleEvent(nsIPresContext* aPresContext,
if (resultFrame)
{
if (NS_COMFALSE == result)
if (NS_POSITION_BEFORE_TABLE == result)
{
nsCOMPtr<nsISelectionController> selCon;
result = GetSelectionController(aPresContext, getter_AddRefs(selCon));

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

@ -62,6 +62,7 @@
#include "nsCSSRendering.h"
#include "nsTransform2D.h"
#include "nsRegion.h"
#include "nsLayoutErrors.h"
static NS_DEFINE_CID(kRegionCID, NS_REGION_CID);

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

@ -96,6 +96,7 @@
#include "nsILookAndFeel.h"
#include "nsLayoutCID.h"
#include "nsWidgetsCID.h" // for NS_LOOKANDFEEL_CID
#include "nsLayoutErrors.h"
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);//for triple click pref
static NS_DEFINE_CID(kSelectionImageService, NS_SELECTIONIMAGESERVICE_CID);
@ -3357,7 +3358,7 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsIPresContext* aPresContext,
aPos->mContentOffsetEnd = aPos->mContentOffset;
//result frame is the result frames parent.
resultFrame->GetParent(&aPos->mResultFrame);
return NS_COMFALSE;
return NS_POSITION_BEFORE_TABLE;
}
}
}

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

@ -74,6 +74,7 @@
#include "nsUnicharUtils.h"
#include "nsPrintfCString.h"
#include "nsDummyLayoutRequest.h"
#include "nsLayoutErrors.h"
#ifdef DEBUG
//#define NOISY_DEBUG

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

@ -106,6 +106,7 @@
#include "nsIObserverService.h" // for reflow observation
#include "nsIDocShell.h" // for reflow observation
#include "nsIDOMRange.h"
#include "nsLayoutErrors.h"
#ifdef MOZ_PERF_METRICS
#include "nsITimeRecorder.h"
#endif
@ -3353,7 +3354,7 @@ PresShell::CompleteMove(PRBool aForward, PRBool aExtend)
0, //irrelavent since we set outsidelimit
outsideLimit
);
if (NS_COMFALSE == result) //NS_COMFALSE should ALSO break
if (NS_POSITION_BEFORE_TABLE == result) //NS_POSITION_BEFORE_TABLE should ALSO break
break;
if (NS_OK != result || !pos.mResultFrame )
return result?result:NS_ERROR_FAILURE;

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

@ -79,7 +79,4 @@ extern NS_EXPORT nsresult
extern NS_EXPORT nsresult
NS_NewHTMLStyleSheet(nsIHTMLStyleSheet** aInstancePtrResult);
#define NS_HTML_STYLE_PROPERTY_NOT_THERE \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT,2)
#endif /* nsIHTMLStyleSheet_h___ */

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

@ -45,11 +45,6 @@ class nsIDOMElement;
#define NS_ITABLELAYOUT_IID \
{ 0xa9222e6b, 0x437e, 0x11d3, { 0xb2, 0x27, 0x0, 0x40, 0x95, 0xe2, 0x7a, 0x10 }}
#define NS_TABLELAYOUT_CELL_NOT_FOUND \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 3)
/**
* nsITableLayout
* interface for layout objects that act like tables.

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

@ -75,6 +75,7 @@
#include "nsHTMLReflowCommand.h"
#include "nsIFrameManager.h"
#include "nsCSSRendering.h"
#include "nsLayoutErrors.h"

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

@ -68,6 +68,7 @@
#include "nsINameSpaceManager.h"
#include "nsINameSpace.h"
#include "nsThemeConstants.h"
#include "nsContentErrors.h"
#include "prprf.h"

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

@ -3952,7 +3952,7 @@ static PRBool SelectorMatches(RuleProcessorData &data,
if (result) {
nsAtomList* classList = aSelector->mClassList;
while (nsnull != classList) {
if (localTrue == (NS_COMFALSE == data.mStyledContent->HasClass(classList->mAtom, isCaseSensitive))) {
if (localTrue == (!data.mStyledContent->HasClass(classList->mAtom, isCaseSensitive))) {
result = PR_FALSE;
break;
}

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

@ -114,10 +114,6 @@ public:
#define NS_CSS_GETINFO_CSS2 ((PRUint32) 0x00000004L)
#define NS_CSS_GETINFO_CSS_FROSTING ((PRUint32) 0x00000008L)
// Success code that can be returned from ParseAndAppendDeclaration()
#define NS_CSS_PARSER_DROP_DECLARATION \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT,1)
extern NS_EXPORT nsresult
NS_NewCSSParser(nsICSSParser** aInstancePtrResult);

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

@ -45,11 +45,6 @@ class nsIDOMElement;
#define NS_ITABLELAYOUT_IID \
{ 0xa9222e6b, 0x437e, 0x11d3, { 0xb2, 0x27, 0x0, 0x40, 0x95, 0xe2, 0x7a, 0x10 }}
#define NS_TABLELAYOUT_CELL_NOT_FOUND \
NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_LAYOUT, 3)
/**
* nsITableLayout
* interface for layout objects that act like tables.

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

@ -75,6 +75,7 @@
#include "nsHTMLReflowCommand.h"
#include "nsIFrameManager.h"
#include "nsCSSRendering.h"
#include "nsLayoutErrors.h"

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

@ -2419,7 +2419,7 @@ nsresult nsMsgDBEnumerator::PrefetchNext()
else
flags = 0;
}
while (mFilter && mFilter(mResultHdr, mClosure) != NS_OK && !(flags & MSG_FLAG_EXPUNGED));
while (mFilter && NS_FAILED(mFilter(mResultHdr, mClosure)) && !(flags & MSG_FLAG_EXPUNGED));
if (mResultHdr)
{
@ -2601,7 +2601,7 @@ nsresult nsMsgDBThreadEnumerator::PrefetchNext()
if (numChildren == 0)
continue;
}
if (mFilter && mFilter(mResultThread) != NS_OK)
if (mFilter && NS_FAILED(mFilter(mResultThread)))
continue;
else
break;
@ -2642,7 +2642,7 @@ nsMsgFlagSetFilter(nsIMsgDBHdr *msg, void *closure)
PRUint32 msgFlags, desiredFlags;
desiredFlags = * (PRUint32 *) closure;
msg->GetFlags(&msgFlags);
return (msgFlags & desiredFlags) ? NS_OK : NS_COMFALSE;
return (msgFlags & desiredFlags) ? NS_OK : NS_ERROR_FAILURE;
}
static nsresult
@ -2653,7 +2653,7 @@ nsMsgUnreadFilter(nsIMsgDBHdr* msg, void* closure)
nsresult rv = db->IsHeaderRead(msg, &wasRead);
if (NS_FAILED(rv))
return rv;
return !wasRead ? NS_OK : NS_COMFALSE;
return !wasRead ? NS_OK : NS_ERROR_FAILURE;
}
nsresult
@ -2686,7 +2686,7 @@ nsMsgReadFilter(nsIMsgDBHdr* msg, void* closure)
nsresult rv = db->IsHeaderRead(msg, &wasRead);
if (NS_FAILED(rv))
return rv;
return wasRead ? NS_OK : NS_COMFALSE;
return wasRead ? NS_OK : NS_ERROR_FAILURE;
}
// note that we can't just use EnumerateMessagesWithFlag(MSG_FLAG_READ) because we need

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

@ -802,7 +802,7 @@ nsresult nsMsgThreadEnumerator::Prefetch()
nsMsgKey parentKey;
nsMsgKey curKey;
if (mFilter && mFilter(mResultHdr, mClosure) != NS_OK) {
if (mFilter && NS_FAILED(mFilter(mResultHdr, mClosure))) {
mResultHdr = nsnull;
continue;
}
@ -867,7 +867,7 @@ nsMsgThreadUnreadFilter(nsIMsgDBHdr* msg, void* closure)
nsresult rv = db->IsHeaderRead(msg, &wasRead);
if (NS_FAILED(rv))
return rv;
return !wasRead ? NS_OK : NS_COMFALSE;
return !wasRead ? NS_OK : NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsMsgThread::EnumerateUnreadMessages(nsMsgKey parentKey, nsISimpleEnumerator* *result)

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

@ -89,6 +89,8 @@
#define NS_ERROR_MODULE_DOM_XPATH 22
#define NS_ERROR_MODULE_DOM_RANGE 23
#define NS_ERROR_MODULE_URILOADER 24
#define NS_ERROR_MODULE_CONTENT 25
#define NS_ERROR_MODULE_PYXPCOM 26
/* NS_ERROR_MODULE_GENERAL should be used by modules that do not
* care if return code values overlap. Callers of methods that
@ -150,9 +152,6 @@
/* Standard "it worked" return value */
#define NS_OK 0
/* The backwards COM false. This is deprecated, please do not use */
#define NS_COMFALSE 1
#define NS_ERROR_BASE ((nsresult) 0xC1F30000)
/* Returned when an instance is not initialized */

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

@ -593,7 +593,7 @@ PLDHashTableEnumeratorImpl::IsDone()
if (!mCount || (mCurrent == mCount))
return NS_OK;
return NS_COMFALSE;
return NS_ENUMERATOR_FALSE;
}
NS_IMETHODIMP