зеркало из https://github.com/mozilla/pjs.git
Expose DocumentViewerImpl::CallChildren with an API that fills an array. (Bug 747231, patch 3) r=roc
--HG-- extra : transplant_source : %FFc%40%AE%D6%22%40%1D%7F%F7%A8%BC%1A%ECG%98G%DCFf
This commit is contained in:
Родитель
5c766cb3f7
Коммит
f266722bf9
|
@ -37,10 +37,6 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/**
|
||||
* The nsIContentViewerEdit
|
||||
*/
|
||||
|
||||
/**
|
||||
* The nsIMarkupDocumentViewer
|
||||
* This interface describes the properties of a content viewer
|
||||
|
@ -51,8 +47,16 @@
|
|||
|
||||
interface nsIDOMNode;
|
||||
|
||||
%{C++
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsTArray.h"
|
||||
%}
|
||||
|
||||
[scriptable, uuid(79286cd6-8293-4def-ba26-76422efc3d2a)]
|
||||
interface nsIMarkupDocumentViewer;
|
||||
|
||||
[ref] native nsIMarkupDocumentViewerTArray(nsTArray<nsCOMPtr<nsIMarkupDocumentViewer> >);
|
||||
|
||||
[scriptable, uuid(1016d5e8-690f-4d97-8ac5-d50ffa341c46)]
|
||||
interface nsIMarkupDocumentViewer : nsISupports
|
||||
{
|
||||
|
||||
|
@ -147,7 +151,13 @@ interface nsIMarkupDocumentViewer : nsISupports
|
|||
*/
|
||||
attribute PRUint32 bidiOptions;
|
||||
|
||||
/** The minimum font size */
|
||||
attribute long minFontSize;
|
||||
/** The minimum font size */
|
||||
attribute long minFontSize;
|
||||
|
||||
/**
|
||||
* Append |this| and all of its descendants to the given array,
|
||||
* in depth-first pre-order traversal.
|
||||
*/
|
||||
[noscript] void appendSubtree(in nsIMarkupDocumentViewerTArray array);
|
||||
|
||||
};
|
||||
|
|
|
@ -3253,6 +3253,21 @@ NS_IMETHODIMP DocumentViewerImpl::GetBidiOptions(PRUint32* aBidiOptions)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
static void
|
||||
AppendChildSubtree(nsIMarkupDocumentViewer* aChild, void* aClosure)
|
||||
{
|
||||
nsTArray<nsCOMPtr<nsIMarkupDocumentViewer> >& array =
|
||||
*static_cast<nsTArray<nsCOMPtr<nsIMarkupDocumentViewer> >*>(aClosure);
|
||||
aChild->AppendSubtree(array);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP DocumentViewerImpl::AppendSubtree(nsTArray<nsCOMPtr<nsIMarkupDocumentViewer> >& aArray)
|
||||
{
|
||||
aArray.AppendElement(this);
|
||||
CallChildren(AppendChildSubtree, &aArray);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP DocumentViewerImpl::SizeToContent()
|
||||
{
|
||||
NS_ENSURE_TRUE(mDocument, NS_ERROR_NOT_AVAILABLE);
|
||||
|
|
Загрузка…
Ссылка в новой задаче