mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 684638 part 2. Make it simpler to set up a range. r=smaug
This commit is contained in:
parent
c58747aa09
commit
cba75ef2b0
@ -5020,14 +5020,12 @@ nsDocument::GetAnonymousNodes(nsIDOMElement* aElement,
|
||||
NS_IMETHODIMP
|
||||
nsDocument::CreateRange(nsIDOMRange** aReturn)
|
||||
{
|
||||
nsresult rv = NS_NewRange(aReturn);
|
||||
nsRefPtr<nsRange> range = new nsRange();
|
||||
nsresult rv = range->Set(this, 0, this, 0);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
(*aReturn)->SetStart(this, 0);
|
||||
(*aReturn)->SetEnd(this, 0);
|
||||
}
|
||||
|
||||
return rv;
|
||||
range.forget(aReturn);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -98,6 +98,17 @@ public:
|
||||
virtual nsresult SetEnd(nsINode* aParent, PRInt32 aOffset);
|
||||
virtual nsresult CloneRange(nsIRange** aNewRange) const;
|
||||
|
||||
nsresult Set(nsINode* aStartParent, PRInt32 aStartOffset,
|
||||
nsINode* aEndParent, PRInt32 aEndOffset)
|
||||
{
|
||||
// If this starts being hot, we may be able to optimize this a bit,
|
||||
// but for now just set start and end separately.
|
||||
nsresult rv = SetStart(aStartParent, aStartOffset);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return SetEnd(aEndParent, aEndOffset);
|
||||
}
|
||||
|
||||
NS_IMETHOD GetUsedFontFaces(nsIDOMFontFaceList** aResult);
|
||||
|
||||
// nsIMutationObserver methods
|
||||
|
Loading…
Reference in New Issue
Block a user