mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 1377980 part 4. Remove nsIDOMRange. r=mccr8
This commit is contained in:
parent
c4000f8b65
commit
6cecfe655d
@ -5,7 +5,7 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/*
|
||||
* Implementation of the DOM nsIDOMRange object.
|
||||
* Implementation of the DOM Range object.
|
||||
*/
|
||||
|
||||
#include "nscore.h"
|
||||
@ -326,31 +326,6 @@ nsRange::CreateRange(nsINode* aStartContainer, uint32_t aStartOffset,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* static */
|
||||
nsresult
|
||||
nsRange::CreateRange(nsIDOMNode* aStartContainer, uint32_t aStartOffset,
|
||||
nsIDOMNode* aEndParent, uint32_t aEndOffset,
|
||||
nsRange** aRange)
|
||||
{
|
||||
nsCOMPtr<nsINode> startContainer = do_QueryInterface(aStartContainer);
|
||||
nsCOMPtr<nsINode> endContainer = do_QueryInterface(aEndParent);
|
||||
return CreateRange(startContainer, aStartOffset,
|
||||
endContainer, aEndOffset, aRange);
|
||||
}
|
||||
|
||||
/* static */
|
||||
nsresult
|
||||
nsRange::CreateRange(nsIDOMNode* aStartContainer, uint32_t aStartOffset,
|
||||
nsIDOMNode* aEndParent, uint32_t aEndOffset,
|
||||
nsIDOMRange** aRange)
|
||||
{
|
||||
RefPtr<nsRange> range;
|
||||
nsresult rv = nsRange::CreateRange(aStartContainer, aStartOffset, aEndParent,
|
||||
aEndOffset, getter_AddRefs(range));
|
||||
range.forget(aRange);
|
||||
return rv;
|
||||
}
|
||||
|
||||
/* static */
|
||||
nsresult
|
||||
nsRange::CreateRange(const RawRangeBoundary& aStart,
|
||||
@ -377,9 +352,8 @@ NS_IMPL_MAIN_THREAD_ONLY_CYCLE_COLLECTING_RELEASE_WITH_LAST_RELEASE(
|
||||
// QueryInterface implementation for nsRange
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsRange)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMRange)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMRange)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CLASS(nsRange)
|
||||
@ -3156,8 +3130,7 @@ nsRange::GetClientRects(bool aClampToEdge, bool aFlushLayout)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<DOMRectList> rectList =
|
||||
new DOMRectList(static_cast<nsIDOMRange*>(this));
|
||||
RefPtr<DOMRectList> rectList = new DOMRectList(this);
|
||||
|
||||
nsLayoutUtils::RectListBuilder builder(rectList);
|
||||
|
||||
@ -3175,7 +3148,7 @@ nsRange::GetClientRectsAndTexts(
|
||||
return;
|
||||
}
|
||||
|
||||
aResult.mRectList = new DOMRectList(static_cast<nsIDOMRange*>(this));
|
||||
aResult.mRectList = new DOMRectList(this);
|
||||
|
||||
nsLayoutUtils::RectListBuilder builder(aResult.mRectList);
|
||||
|
||||
|
@ -5,13 +5,12 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/*
|
||||
* Implementation of the DOM nsIDOMRange object.
|
||||
* Implementation of the DOM Range object.
|
||||
*/
|
||||
|
||||
#ifndef nsRange_h___
|
||||
#define nsRange_h___
|
||||
|
||||
#include "nsIDOMRange.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsIDocument.h"
|
||||
@ -38,8 +37,7 @@ class Selection;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
class nsRange final : public nsIDOMRange,
|
||||
public nsStubMutationObserver,
|
||||
class nsRange final : public nsStubMutationObserver,
|
||||
public nsWrapperCache,
|
||||
// For linking together selection-associated ranges.
|
||||
public mozilla::LinkedListElement<nsRange>
|
||||
@ -56,16 +54,6 @@ class nsRange final : public nsIDOMRange,
|
||||
public:
|
||||
explicit nsRange(nsINode* aNode);
|
||||
|
||||
static nsresult CreateRange(nsIDOMNode* aStartContainer,
|
||||
uint32_t aStartOffset,
|
||||
nsIDOMNode* aEndContainer,
|
||||
uint32_t aEndOffset,
|
||||
nsRange** aRange);
|
||||
static nsresult CreateRange(nsIDOMNode* aStartContainer,
|
||||
uint32_t aStartOffset,
|
||||
nsIDOMNode* aEndContainer,
|
||||
uint32_t aEndOffset,
|
||||
nsIDOMRange** aRange);
|
||||
static nsresult CreateRange(nsINode* aStartContainer,
|
||||
uint32_t aStartOffset,
|
||||
nsINode* aEndContainer,
|
||||
@ -76,16 +64,13 @@ public:
|
||||
nsRange** aRange);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsRange, nsIDOMRange)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsRange)
|
||||
|
||||
nsrefcnt GetRefCount() const
|
||||
{
|
||||
return mRefCnt;
|
||||
}
|
||||
|
||||
// nsIDOMRange interface
|
||||
NS_DECL_NSIDOMRANGE
|
||||
|
||||
nsINode* GetRoot() const
|
||||
{
|
||||
return mRoot;
|
||||
@ -586,10 +571,4 @@ protected:
|
||||
bool mCalledByJS : 1;
|
||||
};
|
||||
|
||||
inline nsISupports*
|
||||
ToSupports(nsRange* aRange)
|
||||
{
|
||||
return static_cast<nsIDOMRange*>(aRange);
|
||||
}
|
||||
|
||||
#endif /* nsRange_h___ */
|
||||
|
@ -1,15 +0,0 @@
|
||||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# 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/.
|
||||
|
||||
with Files("**"):
|
||||
BUG_COMPONENT = ("Core", "DOM")
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIDOMRange.idl',
|
||||
]
|
||||
|
||||
XPIDL_MODULE = 'dom_range'
|
||||
|
@ -1,18 +0,0 @@
|
||||
/* -*- Mode: IDL; 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/. */
|
||||
|
||||
#include "domstubs.idl"
|
||||
|
||||
/**
|
||||
* The nsIDOMRange interface is an interface to a DOM range object.
|
||||
*
|
||||
* For more information on this interface please see
|
||||
* http://www.w3.org/TR/DOM-Level-2-Traversal-Range/
|
||||
*/
|
||||
|
||||
[shim(Range), uuid(1f94055c-42e7-4a30-96a1-6a804f1c2d1e)]
|
||||
interface nsIDOMRange : nsISupports
|
||||
{
|
||||
};
|
@ -19,7 +19,6 @@ interfaces = [
|
||||
'html',
|
||||
'events',
|
||||
'sidebar',
|
||||
'range',
|
||||
'xul',
|
||||
'security',
|
||||
'storage',
|
||||
|
Loading…
Reference in New Issue
Block a user