Backed out changeset 629ace67da3b (bug 1252211)

This commit is contained in:
Carsten "Tomcat" Book 2017-06-13 12:20:14 +02:00
Родитель bd7620cf36
Коммит dc97c12485
9 изменённых файлов: 290 добавлений и 610 удалений

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

@ -73,6 +73,10 @@
#include "nsMemory.h"
// includes needed for the prototype chain interfaces
#ifdef MOZ_XUL
#include "nsITreeContentView.h"
#include "nsITreeView.h"
#endif
#include "nsIEventListenerService.h"
#include "nsIMessageManager.h"
@ -170,6 +174,12 @@ static nsDOMClassInfoData sClassInfoData[] = {
// Misc Core related classes
// XUL classes
#ifdef MOZ_XUL
NS_DEFINE_CHROME_XBL_CLASSINFO_DATA(TreeContentView, nsDOMGenericSH,
DEFAULT_SCRIPTABLE_FLAGS)
#endif
NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(ContentFrameMessageManager,
nsMessageManagerSH<nsEventTargetSH>,
DOM_DEFAULT_SCRIPTABLE_FLAGS |
@ -438,6 +448,13 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDOMConstructor)
DOM_CLASSINFO_MAP_END
#ifdef MOZ_XUL
DOM_CLASSINFO_MAP_BEGIN(TreeContentView, nsITreeContentView)
DOM_CLASSINFO_MAP_ENTRY(nsITreeContentView)
DOM_CLASSINFO_MAP_ENTRY(nsITreeView)
DOM_CLASSINFO_MAP_END
#endif
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ContentFrameMessageManager, nsISupports)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
DOM_CLASSINFO_MAP_ENTRY(nsIMessageListenerManager)

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

@ -19,6 +19,11 @@ enum nsDOMClassInfoID
eDOMClassInfo_DOMPrototype_id,
eDOMClassInfo_DOMConstructor_id,
// XUL classes
#ifdef MOZ_XUL
eDOMClassInfo_TreeContentView_id,
#endif
eDOMClassInfo_ContentFrameMessageManager_id,
eDOMClassInfo_ContentProcessMessageManager_id,
eDOMClassInfo_ChromeMessageBroadcaster_id,

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

@ -1090,10 +1090,6 @@ DOMInterfaces = {
'nativeType': 'nsTreeColumns',
},
'TreeContentView': {
'nativeType': 'nsTreeContentView',
},
'TreeWalker': {
'wrapperCache': False,
},

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

@ -82,7 +82,6 @@ Text implements LegacyQueryInterface;
Touch implements LegacyQueryInterface;
TouchList implements LegacyQueryInterface;
TreeColumns implements LegacyQueryInterface;
TreeContentView implements LegacyQueryInterface;
TreeWalker implements LegacyQueryInterface;
ValidityState implements LegacyQueryInterface;
WebSocket implements LegacyQueryInterface;

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

@ -1,20 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
[Func="IsChromeOrXBL"]
interface TreeContentView
{
/**
* Retrieve the content item associated with the specified row.
*/
[Throws]
Element? getItemAtIndex(long row);
/**
* Retrieve the index associated with the specified content item.
*/
long getIndexOfItem(Element? item);
};
TreeContentView implements TreeView;

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

@ -926,7 +926,6 @@ WEBIDL_FILES = [
'TreeBoxObject.webidl',
'TreeColumn.webidl',
'TreeColumns.webidl',
'TreeContentView.webidl',
'TreeView.webidl',
'TreeWalker.webidl',
'U2F.webidl',

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

@ -90,7 +90,7 @@ load 508927-1.xul
load 508927-2.xul
load 514300-1.xul
asserts-if(stylo,2) load 536931-1.xhtml # bug 1370830
load 538308-1.xul
asserts(1) load 538308-1.xul
load 557174-1.xml
load 564705-1.xul
asserts-if(stylo,2) load 583957-1.html # bug 1370830

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -10,6 +10,7 @@
#include "nsTArray.h"
#include "nsStubDocumentObserver.h"
#include "nsITreeBoxObject.h"
#include "nsITreeColumns.h"
#include "nsITreeView.h"
#include "nsITreeContentView.h"
#include "nsITreeSelection.h"
@ -17,105 +18,20 @@
#include "mozilla/UniquePtr.h"
class nsIDocument;
class nsSelection;
class nsTreeColumn;
class Row;
namespace mozilla {
namespace dom {
class DataTransfer;
class TreeBoxObject;
} // namespace dom
} // namespace mozilla
nsresult NS_NewTreeContentView(nsITreeView** aResult);
class nsTreeContentView final : public nsINativeTreeView,
public nsITreeContentView,
public nsStubDocumentObserver,
public nsWrapperCache
public nsStubDocumentObserver
{
public:
nsTreeContentView(void);
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsTreeContentView,
nsINativeTreeView)
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
nsISupports* GetParentObject();
int32_t RowCount()
{
return mRows.Length();
}
nsITreeSelection* GetSelection()
{
return mSelection;
}
void SetSelection(nsITreeSelection* aSelection,
mozilla::ErrorResult& aError);
void GetRowProperties(int32_t aRow, nsAString& aProperties,
mozilla::ErrorResult& aError);
void GetCellProperties(int32_t aRow, nsTreeColumn& aColumn,
nsAString& aProperies, mozilla::ErrorResult& aError);
void GetColumnProperties(nsTreeColumn& aColumn, nsAString& aProperies);
bool IsContainer(int32_t aRow, mozilla::ErrorResult& aError);
bool IsContainerOpen(int32_t aRow, mozilla::ErrorResult& aError);
bool IsContainerEmpty(int32_t aRow, mozilla::ErrorResult& aError);
bool IsSeparator(int32_t aRow, mozilla::ErrorResult& aError);
bool IsSorted()
{
return false;
}
bool CanDrop(int32_t aRow, int32_t aOrientation,
mozilla::dom::DataTransfer* aDataTransfer,
mozilla::ErrorResult& aError);
void Drop(int32_t aRow, int32_t aOrientation,
mozilla::dom::DataTransfer* aDataTransfer,
mozilla::ErrorResult& aError);
int32_t GetParentIndex(int32_t aRow, mozilla::ErrorResult& aError);
bool HasNextSibling(int32_t aRow, int32_t aAfterIndex,
mozilla::ErrorResult& aError);
int32_t GetLevel(int32_t aRow, mozilla::ErrorResult& aError);
void GetImageSrc(int32_t aRow, nsTreeColumn& aColumn, nsAString& aSrc,
mozilla::ErrorResult& aError);
int32_t GetProgressMode(int32_t aRow, nsTreeColumn& aColumn,
mozilla::ErrorResult& aError);
void GetCellValue(int32_t aRow, nsTreeColumn& aColumn, nsAString& aValue,
mozilla::ErrorResult& aError);
void GetCellText(int32_t aRow, nsTreeColumn& aColumn, nsAString& aText,
mozilla::ErrorResult& aError);
void SetTree(mozilla::dom::TreeBoxObject* aTree,
mozilla::ErrorResult& aError);
void ToggleOpenState(int32_t aRow, mozilla::ErrorResult& aError);
void CycleHeader(nsTreeColumn& aColumn, mozilla::ErrorResult& aError);
// XPCOM SelectionChanged() is OK
void CycleCell(int32_t aRow, nsTreeColumn& aColumn)
{
}
bool IsEditable(int32_t aRow, nsTreeColumn& aColumn,
mozilla::ErrorResult& aError);
bool IsSelectable(int32_t aRow, nsTreeColumn& aColumn,
mozilla::ErrorResult& aError);
void SetCellValue(int32_t aRow, nsTreeColumn& aColumn,
const nsAString& aValue, mozilla::ErrorResult& aError);
void SetCellText(int32_t aRow, nsTreeColumn& aColumn,
const nsAString& aText, mozilla::ErrorResult& aError);
void PerformAction(const nsAString& aAction)
{
}
void PerformActionOnRow(const nsAString& aAction, int32_t aRow)
{
}
void PerformActionOnCell(const nsAString& aAction, int32_t aRow,
nsTreeColumn& aColumn)
{
}
mozilla::dom::Element* GetItemAtIndex(int32_t aRow,
mozilla::ErrorResult& aError);
int32_t GetIndexOfItem(mozilla::dom::Element* aItem);
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsTreeContentView,
nsINativeTreeView)
NS_DECL_NSITREEVIEW
// nsINativeTreeView: Untrusted code can use us
@ -139,10 +55,10 @@ class nsTreeContentView final : public nsINativeTreeView,
void Serialize(nsIContent* aContent, int32_t aParentIndex, int32_t* aIndex,
nsTArray<mozilla::UniquePtr<Row>>& aRows);
void SerializeItem(Element* aContent, int32_t aParentIndex,
void SerializeItem(nsIContent* aContent, int32_t aParentIndex,
int32_t* aIndex, nsTArray<mozilla::UniquePtr<Row>>& aRows);
void SerializeSeparator(Element* aContent, int32_t aParentIndex,
void SerializeSeparator(nsIContent* aContent, int32_t aParentIndex,
int32_t* aIndex, nsTArray<mozilla::UniquePtr<Row>>& aRows);
void GetIndexInSubtree(nsIContent* aContainer, nsIContent* aContent, int32_t* aResult);
@ -171,11 +87,9 @@ class nsTreeContentView final : public nsINativeTreeView,
void UpdateParentIndexes(int32_t aIndex, int32_t aSkip, int32_t aCount);
// Content helpers.
nsIContent* GetCell(nsIContent* aContainer, nsTreeColumn& aCol);
nsIContent* GetCell(nsIContent* aContainer, nsITreeColumn* aCol);
private:
bool IsValidRowIndex(int32_t aRowIndex);
nsCOMPtr<nsITreeBoxObject> mBoxObject;
nsCOMPtr<nsITreeSelection> mSelection;
nsCOMPtr<nsIContent> mRoot;