diff --git a/build/os2/test_os2.cmd b/build/os2/test_os2.cmd old mode 100644 new mode 100755 diff --git a/content/base/src/nsContentList.cpp b/content/base/src/nsContentList.cpp index 6902c2ffbcc..01579c52da6 100644 --- a/content/base/src/nsContentList.cpp +++ b/content/base/src/nsContentList.cpp @@ -615,19 +615,9 @@ nsContentList::GetNodeAt(PRUint32 aIndex) return Item(aIndex, PR_TRUE); } -nsIContent* -nsContentList::GetNodeAt(PRUint32 aIndex, nsresult* aResult) -{ - *aResult = NS_OK; - return Item(aIndex, PR_TRUE); -} - nsISupports* -nsContentList::GetNamedItem(const nsAString& aName, nsWrapperCache **aCache, - nsresult* aResult) +nsContentList::GetNamedItem(const nsAString& aName, nsWrapperCache **aCache) { - *aResult = NS_OK; - nsIContent *item; *aCache = item = NamedItem(aName, PR_TRUE); return item; diff --git a/content/base/src/nsContentList.h b/content/base/src/nsContentList.h index 24d10435551..877b9aba7c1 100644 --- a/content/base/src/nsContentList.h +++ b/content/base/src/nsContentList.h @@ -260,10 +260,9 @@ public: virtual PRInt32 IndexOf(nsIContent* aContent); // nsIHTMLCollection - virtual nsIContent* GetNodeAt(PRUint32 aIndex, nsresult* aResult); + // GetNodeAt already declared as part of nsINodeList virtual nsISupports* GetNamedItem(const nsAString& aName, - nsWrapperCache** aCache, - nsresult* aResult); + nsWrapperCache** aCache); // nsContentList public methods NS_HIDDEN_(nsINode*) GetParentObject() { return mRootNode; } diff --git a/content/html/content/public/nsIHTMLCollection.h b/content/html/content/public/nsIHTMLCollection.h index 13166a46a38..aa6dca0f82b 100644 --- a/content/html/content/public/nsIHTMLCollection.h +++ b/content/html/content/public/nsIHTMLCollection.h @@ -45,8 +45,8 @@ class nsWrapperCache; // IID for the nsIHTMLCollection interface #define NS_IHTMLCOLLECTION_IID \ -{ 0xf38b43dc, 0x74d4, 0x4b11, \ - { 0xa6, 0xc9, 0xf8, 0xf4, 0xb5, 0xd3, 0x84, 0xe3 } } +{ 0x84a68396, 0x518d, 0x4fa8, \ + { 0x8f, 0x7f, 0xa0, 0x60, 0x55, 0xff, 0xef, 0xba } } /** * An internal interface that allows QI-less getting of nodes from HTML @@ -60,14 +60,13 @@ public: /** * Get the node at the index. Returns null if the index is out of bounds. */ - virtual nsIContent* GetNodeAt(PRUint32 aIndex, nsresult* aResult) = 0; + virtual nsIContent* GetNodeAt(PRUint32 aIndex) = 0; /** * Get the node for the name. Returns null if no node exists for the name. */ virtual nsISupports* GetNamedItem(const nsAString& aName, - nsWrapperCache** aCache, - nsresult* aResult) = 0; + nsWrapperCache** aCache) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIHTMLCollection, NS_IHTMLCOLLECTION_IID) diff --git a/content/html/content/src/nsHTMLFormElement.cpp b/content/html/content/src/nsHTMLFormElement.cpp index 5dea2725982..ea90386c6a5 100644 --- a/content/html/content/src/nsHTMLFormElement.cpp +++ b/content/html/content/src/nsHTMLFormElement.cpp @@ -121,20 +121,15 @@ public: // nsIDOMHTMLCollection interface NS_DECL_NSIDOMHTMLCOLLECTION - virtual nsIContent* GetNodeAt(PRUint32 aIndex, nsresult* aResult) + virtual nsIContent* GetNodeAt(PRUint32 aIndex) { FlushPendingNotifications(); - *aResult = NS_OK; - return mElements.SafeElementAt(aIndex, nsnull); } virtual nsISupports* GetNamedItem(const nsAString& aName, - nsWrapperCache **aCache, - nsresult* aResult) + nsWrapperCache **aCache) { - *aResult = NS_OK; - nsISupports *item = NamedItemInternal(aName, PR_TRUE); *aCache = nsnull; return item; @@ -2306,7 +2301,7 @@ NS_IMETHODIMP nsFormControlList::Item(PRUint32 aIndex, nsIDOMNode** aReturn) { nsresult rv; - nsISupports* item = GetNodeAt(aIndex, &rv); + nsISupports* item = GetNodeAt(aIndex); if (!item) { *aReturn = nsnull; diff --git a/content/html/content/src/nsHTMLSelectElement.cpp b/content/html/content/src/nsHTMLSelectElement.cpp index eb885e90edb..f5adee34b6e 100644 --- a/content/html/content/src/nsHTMLSelectElement.cpp +++ b/content/html/content/src/nsHTMLSelectElement.cpp @@ -2169,22 +2169,19 @@ nsHTMLOptionCollection::SetSelectedIndex(PRInt32 aSelectedIndex) NS_IMETHODIMP nsHTMLOptionCollection::Item(PRUint32 aIndex, nsIDOMNode** aReturn) { - nsresult rv; - nsISupports* item = GetNodeAt(aIndex, &rv); + nsISupports* item = GetNodeAt(aIndex); if (!item) { *aReturn = nsnull; - return rv; + return NS_OK; } return CallQueryInterface(item, aReturn); } nsIContent* -nsHTMLOptionCollection::GetNodeAt(PRUint32 aIndex, nsresult* aResult) +nsHTMLOptionCollection::GetNodeAt(PRUint32 aIndex) { - *aResult = NS_OK; - return static_cast(ItemAsOption(aIndex)); } @@ -2209,11 +2206,8 @@ GetNamedItemHelper(nsTArray > &aElements, nsISupports* nsHTMLOptionCollection::GetNamedItem(const nsAString& aName, - nsWrapperCache **aCache, - nsresult* aResult) + nsWrapperCache **aCache) { - *aResult = NS_OK; - nsINode *item = GetNamedItemHelper(mElements, aName); *aCache = item; return item; diff --git a/content/html/content/src/nsHTMLSelectElement.h b/content/html/content/src/nsHTMLSelectElement.h index f8653f7ea72..44cc86c0e79 100644 --- a/content/html/content/src/nsHTMLSelectElement.h +++ b/content/html/content/src/nsHTMLSelectElement.h @@ -87,10 +87,9 @@ public: // nsIDOMHTMLCollection interface, all its methods are defined in // nsIDOMHTMLOptionsCollection - virtual nsIContent* GetNodeAt(PRUint32 aIndex, nsresult* aResult); + virtual nsIContent* GetNodeAt(PRUint32 aIndex); virtual nsISupports* GetNamedItem(const nsAString& aName, - nsWrapperCache** aCache, - nsresult* aResult); + nsWrapperCache** aCache); NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsHTMLOptionCollection, nsIHTMLCollection) diff --git a/content/html/content/src/nsHTMLTableElement.cpp b/content/html/content/src/nsHTMLTableElement.cpp index 6068e045b98..cd159605d5b 100644 --- a/content/html/content/src/nsHTMLTableElement.cpp +++ b/content/html/content/src/nsHTMLTableElement.cpp @@ -95,6 +95,13 @@ public: NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(nsHTMLTableElement, nsGenericHTMLElement) + already_AddRefed GetTHead() { + return GetSection(nsGkAtoms::thead); + } + already_AddRefed GetTFoot() { + return GetSection(nsGkAtoms::tfoot); + } + nsContentList* TBodies(); protected: already_AddRefed GetSection(nsIAtom *aTag); @@ -119,10 +126,9 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_NSIDOMHTMLCOLLECTION - virtual nsIContent* GetNodeAt(PRUint32 aIndex, nsresult* aResult); + virtual nsIContent* GetNodeAt(PRUint32 aIndex); virtual nsISupports* GetNamedItem(const nsAString& aName, - nsWrapperCache **aCache, - nsresult* aResult); + nsWrapperCache **aCache); NS_IMETHOD ParentDestroyed(); @@ -186,10 +192,7 @@ TableRowsCollection::Init() if (mParent) { \ /* THead */ \ nsCOMPtr rowGroup; \ - rv = mParent->GetTHead(getter_AddRefs(rowGroup)); \ - if (NS_FAILED(rv)) { \ - break; \ - } \ + rowGroup = mParent->GetTHead(); \ nsCOMPtr rows; \ if (rowGroup) { \ rowGroup->GetRows(getter_AddRefs(rows)); \ @@ -197,35 +200,20 @@ TableRowsCollection::Init() _code \ } while (0); \ } \ - nsCOMPtr _tbodies; \ /* TBodies */ \ - rv = mParent->GetTBodies(getter_AddRefs(_tbodies)); \ - if (NS_FAILED(rv)) { \ - break; \ - } \ - if (_tbodies) { \ - nsCOMPtr _node; \ - PRUint32 _tbodyIndex = 0; \ - rv = _tbodies->Item(_tbodyIndex, getter_AddRefs(_node)); \ - if (NS_FAILED(rv)) { \ - break; \ - } \ - while (_node) { \ - rowGroup = do_QueryInterface(_node); \ - if (rowGroup) { \ - rowGroup->GetRows(getter_AddRefs(rows)); \ - do { /* gives scoping */ \ - _code \ - } while (0); \ - } \ - rv = _tbodies->Item(++_tbodyIndex, getter_AddRefs(_node)); \ - if (NS_FAILED(rv)) { \ - break; \ - } \ - } \ - if (NS_FAILED(rv)) { \ - break; \ + nsContentList *_tbodies = mParent->TBodies(); \ + nsINode * _node; \ + PRUint32 _tbodyIndex = 0; \ + _node = _tbodies->GetNodeAt(_tbodyIndex); \ + while (_node) { \ + rowGroup = do_QueryInterface(_node); \ + if (rowGroup) { \ + rowGroup->GetRows(getter_AddRefs(rows)); \ + do { /* gives scoping */ \ + _code \ + } while (0); \ } \ + _node = _tbodies->GetNodeAt(++_tbodyIndex); \ } \ /* orphan rows */ \ rows = mOrphanRows; \ @@ -233,10 +221,7 @@ TableRowsCollection::Init() _code \ } while (0); \ /* TFoot */ \ - rv = mParent->GetTFoot(getter_AddRefs(rowGroup)); \ - if (NS_FAILED(rv)) { \ - break; \ - } \ + rowGroup = mParent->GetTFoot(); \ rows = nsnull; \ if (rowGroup) { \ rowGroup->GetRows(getter_AddRefs(rows)); \ @@ -266,13 +251,12 @@ NS_IMETHODIMP TableRowsCollection::GetLength(PRUint32* aLength) { *aLength=0; - nsresult rv = NS_OK; DO_FOR_EACH_ROWGROUP( *aLength += CountRowsInRowGroup(rows); ); - return rv; + return NS_OK; } // Returns the item at index aIndex if available. If null is returned, @@ -296,9 +280,8 @@ GetItemOrCountInRowGroup(nsIDOMHTMLCollection* rows, } nsIContent* -TableRowsCollection::GetNodeAt(PRUint32 aIndex, nsresult *aResult) +TableRowsCollection::GetNodeAt(PRUint32 aIndex) { - nsresult rv = NS_OK; DO_FOR_EACH_ROWGROUP( PRUint32 count; nsIContent* node = GetItemOrCountInRowGroup(rows, aIndex, &count); @@ -310,21 +293,17 @@ TableRowsCollection::GetNodeAt(PRUint32 aIndex, nsresult *aResult) aIndex -= count; ); - *aResult = rv; - return nsnull; } NS_IMETHODIMP TableRowsCollection::Item(PRUint32 aIndex, nsIDOMNode** aReturn) { - nsresult rv; - - nsISupports* node = GetNodeAt(aIndex, &rv); + nsISupports* node = GetNodeAt(aIndex); if (!node) { *aReturn = nsnull; - return rv; + return NS_OK; } return CallQueryInterface(node, aReturn); @@ -332,31 +311,27 @@ TableRowsCollection::Item(PRUint32 aIndex, nsIDOMNode** aReturn) static nsISupports* GetNamedItemInRowGroup(nsIDOMHTMLCollection* aRows, const nsAString& aName, - nsWrapperCache** aCache, nsresult* aResult) + nsWrapperCache** aCache) { nsCOMPtr rows = do_QueryInterface(aRows); if (rows) { - return rows->GetNamedItem(aName, aCache, aResult); + return rows->GetNamedItem(aName, aCache); } - *aResult = NS_OK; return nsnull; } nsISupports* TableRowsCollection::GetNamedItem(const nsAString& aName, - nsWrapperCache** aCache, - nsresult* aResult) + nsWrapperCache** aCache) { - nsresult rv = NS_OK; DO_FOR_EACH_ROWGROUP( - nsISupports* item = GetNamedItemInRowGroup(rows, aName, aCache, aResult); - if (NS_FAILED(*aResult) || item) { + nsISupports* item = GetNamedItemInRowGroup(rows, aName, aCache); + if (item) { return item; } ); *aCache = nsnull; - *aResult = rv; return nsnull; } @@ -364,13 +339,12 @@ NS_IMETHODIMP TableRowsCollection::NamedItem(const nsAString& aName, nsIDOMNode** aReturn) { - nsresult rv; nsWrapperCache *cache; - nsISupports* item = GetNamedItem(aName, &cache, &rv); + nsISupports* item = GetNamedItem(aName, &cache); if (!item) { *aReturn = nsnull; - return rv; + return NS_OK; } return CallQueryInterface(item, aReturn); @@ -510,7 +484,7 @@ nsHTMLTableElement::GetSection(nsIAtom *aTag) NS_IMETHODIMP nsHTMLTableElement::GetTHead(nsIDOMHTMLTableSectionElement** aValue) { - *aValue = GetSection(nsGkAtoms::thead).get(); + *aValue = GetTHead().get(); return NS_OK; } @@ -547,7 +521,7 @@ nsHTMLTableElement::SetTHead(nsIDOMHTMLTableSectionElement* aValue) NS_IMETHODIMP nsHTMLTableElement::GetTFoot(nsIDOMHTMLTableSectionElement** aValue) { - *aValue = GetSection(nsGkAtoms::tfoot).get(); + *aValue = GetTFoot().get(); return NS_OK; } @@ -596,6 +570,13 @@ nsHTMLTableElement::GetRows(nsIDOMHTMLCollection** aValue) NS_IMETHODIMP nsHTMLTableElement::GetTBodies(nsIDOMHTMLCollection** aValue) +{ + NS_ADDREF(*aValue = TBodies()); + return NS_OK; +} + +nsContentList* +nsHTMLTableElement::TBodies() { if (!mTBodies) { // Not using NS_GetContentList because this should not be cached @@ -606,8 +587,7 @@ nsHTMLTableElement::GetTBodies(nsIDOMHTMLCollection** aValue) PR_FALSE); } - NS_ADDREF(*aValue = mTBodies); - return NS_OK; + return mTBodies; } NS_IMETHODIMP diff --git a/content/svg/content/test/Makefile.in b/content/svg/content/test/Makefile.in index 8d2d129619a..b05978acbe7 100644 --- a/content/svg/content/test/Makefile.in +++ b/content/svg/content/test/Makefile.in @@ -60,6 +60,7 @@ _TEST_FILES = \ test_animLengthRelativeUnits.xhtml \ test_animLengthUnits.xhtml \ test_bbox.xhtml \ + test_bbox-with-invalid-viewBox.xhtml \ bbox-helper.svg \ bounds-helper.svg \ test_dataTypes.html \ diff --git a/content/svg/content/test/test_bbox-with-invalid-viewBox.xhtml b/content/svg/content/test/test_bbox-with-invalid-viewBox.xhtml new file mode 100644 index 00000000000..cd73345cbb8 --- /dev/null +++ b/content/svg/content/test/test_bbox-with-invalid-viewBox.xhtml @@ -0,0 +1,40 @@ + + + + + Test for getBBox when the viewBox is invalid + + + + + + +

+ + + + + + +
+
+
+ + diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index 1044b69ba39..d8a32e3c172 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -8351,7 +8351,7 @@ nsHTMLCollectionSH::GetItemAt(nsISupports *aNative, PRUint32 aIndex, #endif nsINode *item; - *aCache = item = collection->GetNodeAt(aIndex, aResult); + *aCache = item = collection->GetNodeAt(aIndex); return item; } @@ -8373,7 +8373,7 @@ nsHTMLCollectionSH::GetNamedItem(nsISupports *aNative, } #endif - return collection->GetNamedItem(aName, aCache, aResult); + return collection->GetNamedItem(aName, aCache); } @@ -8413,7 +8413,7 @@ nsContentListSH::GetItemAt(nsISupports *aNative, PRUint32 aIndex, nsContentList *list = nsContentList::FromSupports(aNative); nsIContent *item; - *aCache = item = list->GetNodeAt(aIndex, aResult); + *aCache = item = list->GetNodeAt(aIndex); return item; } @@ -8423,7 +8423,7 @@ nsContentListSH::GetNamedItem(nsISupports *aNative, const nsAString& aName, { nsContentList *list = nsContentList::FromSupports(aNative); - return list->GetNamedItem(aName, aCache, aResult); + return list->GetNamedItem(aName, aCache); } NS_IMETHODIMP @@ -9491,8 +9491,7 @@ nsHTMLSelectElementSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext nsHTMLOptionCollection *options = s->GetOptions(); if (options) { - nsresult rv; - nsISupports *node = options->GetNodeAt(n, &rv); + nsISupports *node = options->GetNodeAt(n); if (node) { *objp = obj; *_retval = JS_DefineElement(cx, obj, n, JSVAL_VOID, nsnull, nsnull, @@ -9521,7 +9520,7 @@ nsHTMLSelectElementSH::GetProperty(nsIXPConnectWrappedNative *wrapper, nsHTMLOptionCollection *options = s->GetOptions(); if (options) { - nsISupports *node = options->GetNodeAt(n, &rv); + nsISupports *node = options->GetNodeAt(n); rv = WrapNative(cx, JS_GetGlobalForScopeChain(cx), node, &NS_GET_IID(nsIDOMNode), PR_TRUE, vp); diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index a4912c349b1..6c0547a8418 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -8808,14 +8808,14 @@ nsGlobalWindow::SetTimeoutOrInterval(nsIScriptTimeoutHandler *aHandler, interval = NS_MAX(aIsInterval ? 1 : 0, interval); // Make sure we don't proceed with an interval larger than our timer - // code can handle. - if (interval > PR_IntervalToMilliseconds(DOM_MAX_TIMEOUT_VALUE)) { - interval = PR_IntervalToMilliseconds(DOM_MAX_TIMEOUT_VALUE); + // code can handle. (Note: we already forced |interval| to be non-negative, + // so the PRUint32 cast (to avoid compiler warnings) is ok.) + PRUint32 maxTimeoutMs = PR_IntervalToMilliseconds(DOM_MAX_TIMEOUT_VALUE); + if (static_cast(interval) > maxTimeoutMs) { + interval = maxTimeoutMs; } nsTimeout *timeout = new nsTimeout(); - if (!timeout) - return NS_ERROR_OUT_OF_MEMORY; // Increment the timeout's reference count to represent this function's hold // on the timeout. diff --git a/embedding/android/GeckoApp.java b/embedding/android/GeckoApp.java index bea7ec76f37..3ac1eac676f 100644 --- a/embedding/android/GeckoApp.java +++ b/embedding/android/GeckoApp.java @@ -265,7 +265,7 @@ abstract public class GeckoApp } boolean IsUnsupportedDevice() { - // We don't currently support devices with less than 256Mb of RAM, warn on first run + // We don't currently support devices with less than 512Mb of RAM, warn on first run File meminfo = new File("/proc/meminfo"); try { BufferedReader br = new BufferedReader(new FileReader(meminfo)); @@ -277,7 +277,7 @@ abstract public class GeckoApp totalMem = st.nextToken(); Log.i("GeckoMemory", "MemTotal: " + Integer.parseInt(totalMem)); - return Integer.parseInt(totalMem) <= 262144L; + return Integer.parseInt(totalMem) <= 524288L; } catch (Exception ex) { // Will catch NullPointerException if totalMem isn't found, // a NumberFormatException if the token isn't parsible diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index 44903f596b6..52cac400964 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -224,6 +224,7 @@ using mozilla::DefaultXDisplay; #define INCL_PM #define INCL_GPI #include +#include "gfxOS2Surface.h" #endif #ifdef CreateEvent // Thank you MS. @@ -1663,7 +1664,7 @@ nsObjectFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, #ifdef XP_OS2 static void * -GetPSFromRC(nsRenderingContext& aRC) +GetPSFromRC(nsRenderingContext& aRenderingContext) { nsRefPtr surf = aRenderingContext.ThebesContext()->CurrentSurface();