Bug 1444847 - part 1: Create `mozilla::dom::AbstractRange` r=smaug
This patch is based on the patch created by Makoto Kato-san.
`Range` and `StaticRange` have common base interface, `AbstractRange`.
https://dom.spec.whatwg.org/#abstractrange
This interface has simply returns `startContainer`, `endContainer`,
`startOffset`, `endOffset` and `collapsed`.
Different from the original patch's approach, this patch moves related
members in `nsRange` to `AbstractRange` since this approach avoids
virtual call cost. Additionally, this patch makes them not throw as
declared by the spec. As far as I know, the destruction cost of
`ErrorResult` may appear in profile so that we should avoid creating
the instance if we can avoid it.
Unfortunately, the instance size of `nsRange` becomes larger with this
patch. The size is changed from 176 to 184. I.e., now, `nsRange`
requires bigger chunk.
Differential Revision: https://phabricator.services.mozilla.com/D35140
--HG--
extra : moz-landing-system : lando
2019-06-28 10:46:35 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_AbstractRange_h
|
|
|
|
#define mozilla_dom_AbstractRange_h
|
|
|
|
|
2020-11-23 19:07:43 +03:00
|
|
|
#include <cstdint>
|
|
|
|
#include "ErrorList.h"
|
|
|
|
#include "js/RootingAPI.h"
|
|
|
|
#include "mozilla/Assertions.h"
|
|
|
|
#include "mozilla/Maybe.h"
|
Bug 1444847 - part 1: Create `mozilla::dom::AbstractRange` r=smaug
This patch is based on the patch created by Makoto Kato-san.
`Range` and `StaticRange` have common base interface, `AbstractRange`.
https://dom.spec.whatwg.org/#abstractrange
This interface has simply returns `startContainer`, `endContainer`,
`startOffset`, `endOffset` and `collapsed`.
Different from the original patch's approach, this patch moves related
members in `nsRange` to `AbstractRange` since this approach avoids
virtual call cost. Additionally, this patch makes them not throw as
declared by the spec. As far as I know, the destruction cost of
`ErrorResult` may appear in profile so that we should avoid creating
the instance if we can avoid it.
Unfortunately, the instance size of `nsRange` becomes larger with this
patch. The size is changed from 176 to 184. I.e., now, `nsRange`
requires bigger chunk.
Differential Revision: https://phabricator.services.mozilla.com/D35140
--HG--
extra : moz-landing-system : lando
2019-06-28 10:46:35 +03:00
|
|
|
#include "mozilla/RangeBoundary.h"
|
2020-11-23 19:07:43 +03:00
|
|
|
#include "mozilla/RefPtr.h"
|
|
|
|
#include "nsCycleCollectionParticipant.h"
|
|
|
|
#include "nsISupports.h"
|
Bug 1444847 - part 1: Create `mozilla::dom::AbstractRange` r=smaug
This patch is based on the patch created by Makoto Kato-san.
`Range` and `StaticRange` have common base interface, `AbstractRange`.
https://dom.spec.whatwg.org/#abstractrange
This interface has simply returns `startContainer`, `endContainer`,
`startOffset`, `endOffset` and `collapsed`.
Different from the original patch's approach, this patch moves related
members in `nsRange` to `AbstractRange` since this approach avoids
virtual call cost. Additionally, this patch makes them not throw as
declared by the spec. As far as I know, the destruction cost of
`ErrorResult` may appear in profile so that we should avoid creating
the instance if we can avoid it.
Unfortunately, the instance size of `nsRange` becomes larger with this
patch. The size is changed from 176 to 184. I.e., now, `nsRange`
requires bigger chunk.
Differential Revision: https://phabricator.services.mozilla.com/D35140
--HG--
extra : moz-landing-system : lando
2019-06-28 10:46:35 +03:00
|
|
|
#include "nsWrapperCache.h"
|
|
|
|
|
2020-11-23 19:07:43 +03:00
|
|
|
class JSObject;
|
|
|
|
class nsIContent;
|
|
|
|
class nsINode;
|
|
|
|
struct JSContext;
|
|
|
|
|
Bug 1444847 - part 1: Create `mozilla::dom::AbstractRange` r=smaug
This patch is based on the patch created by Makoto Kato-san.
`Range` and `StaticRange` have common base interface, `AbstractRange`.
https://dom.spec.whatwg.org/#abstractrange
This interface has simply returns `startContainer`, `endContainer`,
`startOffset`, `endOffset` and `collapsed`.
Different from the original patch's approach, this patch moves related
members in `nsRange` to `AbstractRange` since this approach avoids
virtual call cost. Additionally, this patch makes them not throw as
declared by the spec. As far as I know, the destruction cost of
`ErrorResult` may appear in profile so that we should avoid creating
the instance if we can avoid it.
Unfortunately, the instance size of `nsRange` becomes larger with this
patch. The size is changed from 176 to 184. I.e., now, `nsRange`
requires bigger chunk.
Differential Revision: https://phabricator.services.mozilla.com/D35140
--HG--
extra : moz-landing-system : lando
2019-06-28 10:46:35 +03:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2020-11-23 19:07:43 +03:00
|
|
|
class Document;
|
|
|
|
|
Bug 1444847 - part 1: Create `mozilla::dom::AbstractRange` r=smaug
This patch is based on the patch created by Makoto Kato-san.
`Range` and `StaticRange` have common base interface, `AbstractRange`.
https://dom.spec.whatwg.org/#abstractrange
This interface has simply returns `startContainer`, `endContainer`,
`startOffset`, `endOffset` and `collapsed`.
Different from the original patch's approach, this patch moves related
members in `nsRange` to `AbstractRange` since this approach avoids
virtual call cost. Additionally, this patch makes them not throw as
declared by the spec. As far as I know, the destruction cost of
`ErrorResult` may appear in profile so that we should avoid creating
the instance if we can avoid it.
Unfortunately, the instance size of `nsRange` becomes larger with this
patch. The size is changed from 176 to 184. I.e., now, `nsRange`
requires bigger chunk.
Differential Revision: https://phabricator.services.mozilla.com/D35140
--HG--
extra : moz-landing-system : lando
2019-06-28 10:46:35 +03:00
|
|
|
class AbstractRange : public nsISupports, public nsWrapperCache {
|
|
|
|
protected:
|
|
|
|
explicit AbstractRange(nsINode* aNode);
|
2020-11-23 19:07:43 +03:00
|
|
|
virtual ~AbstractRange();
|
Bug 1444847 - part 1: Create `mozilla::dom::AbstractRange` r=smaug
This patch is based on the patch created by Makoto Kato-san.
`Range` and `StaticRange` have common base interface, `AbstractRange`.
https://dom.spec.whatwg.org/#abstractrange
This interface has simply returns `startContainer`, `endContainer`,
`startOffset`, `endOffset` and `collapsed`.
Different from the original patch's approach, this patch moves related
members in `nsRange` to `AbstractRange` since this approach avoids
virtual call cost. Additionally, this patch makes them not throw as
declared by the spec. As far as I know, the destruction cost of
`ErrorResult` may appear in profile so that we should avoid creating
the instance if we can avoid it.
Unfortunately, the instance size of `nsRange` becomes larger with this
patch. The size is changed from 176 to 184. I.e., now, `nsRange`
requires bigger chunk.
Differential Revision: https://phabricator.services.mozilla.com/D35140
--HG--
extra : moz-landing-system : lando
2019-06-28 10:46:35 +03:00
|
|
|
|
|
|
|
public:
|
|
|
|
AbstractRange() = delete;
|
|
|
|
explicit AbstractRange(const AbstractRange& aOther) = delete;
|
|
|
|
|
2020-02-14 18:02:43 +03:00
|
|
|
/**
|
|
|
|
* Called when the process is shutting down.
|
|
|
|
*/
|
|
|
|
static void Shutdown();
|
|
|
|
|
Bug 1444847 - part 1: Create `mozilla::dom::AbstractRange` r=smaug
This patch is based on the patch created by Makoto Kato-san.
`Range` and `StaticRange` have common base interface, `AbstractRange`.
https://dom.spec.whatwg.org/#abstractrange
This interface has simply returns `startContainer`, `endContainer`,
`startOffset`, `endOffset` and `collapsed`.
Different from the original patch's approach, this patch moves related
members in `nsRange` to `AbstractRange` since this approach avoids
virtual call cost. Additionally, this patch makes them not throw as
declared by the spec. As far as I know, the destruction cost of
`ErrorResult` may appear in profile so that we should avoid creating
the instance if we can avoid it.
Unfortunately, the instance size of `nsRange` becomes larger with this
patch. The size is changed from 176 to 184. I.e., now, `nsRange`
requires bigger chunk.
Differential Revision: https://phabricator.services.mozilla.com/D35140
--HG--
extra : moz-landing-system : lando
2019-06-28 10:46:35 +03:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AbstractRange)
|
|
|
|
|
|
|
|
const RangeBoundary& StartRef() const { return mStart; }
|
|
|
|
const RangeBoundary& EndRef() const { return mEnd; }
|
|
|
|
|
|
|
|
nsIContent* GetChildAtStartOffset() const {
|
|
|
|
return mStart.GetChildAtOffset();
|
|
|
|
}
|
|
|
|
nsIContent* GetChildAtEndOffset() const { return mEnd.GetChildAtOffset(); }
|
|
|
|
bool IsPositioned() const { return mIsPositioned; }
|
2020-01-13 13:29:44 +03:00
|
|
|
/**
|
|
|
|
* https://dom.spec.whatwg.org/#concept-tree-inclusive-ancestor
|
|
|
|
*/
|
|
|
|
nsINode* GetClosestCommonInclusiveAncestor() const;
|
Bug 1444847 - part 1: Create `mozilla::dom::AbstractRange` r=smaug
This patch is based on the patch created by Makoto Kato-san.
`Range` and `StaticRange` have common base interface, `AbstractRange`.
https://dom.spec.whatwg.org/#abstractrange
This interface has simply returns `startContainer`, `endContainer`,
`startOffset`, `endOffset` and `collapsed`.
Different from the original patch's approach, this patch moves related
members in `nsRange` to `AbstractRange` since this approach avoids
virtual call cost. Additionally, this patch makes them not throw as
declared by the spec. As far as I know, the destruction cost of
`ErrorResult` may appear in profile so that we should avoid creating
the instance if we can avoid it.
Unfortunately, the instance size of `nsRange` becomes larger with this
patch. The size is changed from 176 to 184. I.e., now, `nsRange`
requires bigger chunk.
Differential Revision: https://phabricator.services.mozilla.com/D35140
--HG--
extra : moz-landing-system : lando
2019-06-28 10:46:35 +03:00
|
|
|
|
|
|
|
// WebIDL
|
|
|
|
|
|
|
|
// If Range is created from JS, it's initialized with Document.createRange()
|
|
|
|
// and it collaps the range to start of the Document. Therefore, the
|
|
|
|
// following WebIDL methods are called only when `mIsPositioned` is true.
|
|
|
|
// So, it does not make sense to take `ErrorResult` as their parameter
|
|
|
|
// since its destruction cost may appear in profile. If you create range
|
|
|
|
// object from C++ and needs to check whether it's positioned, should call
|
|
|
|
// `IsPositioned()` directly.
|
|
|
|
|
|
|
|
nsINode* GetStartContainer() const { return mStart.Container(); }
|
|
|
|
nsINode* GetEndContainer() const { return mEnd.Container(); }
|
2019-12-16 14:31:30 +03:00
|
|
|
|
|
|
|
// FYI: Returns 0 if it's not positioned.
|
Bug 1444847 - part 1: Create `mozilla::dom::AbstractRange` r=smaug
This patch is based on the patch created by Makoto Kato-san.
`Range` and `StaticRange` have common base interface, `AbstractRange`.
https://dom.spec.whatwg.org/#abstractrange
This interface has simply returns `startContainer`, `endContainer`,
`startOffset`, `endOffset` and `collapsed`.
Different from the original patch's approach, this patch moves related
members in `nsRange` to `AbstractRange` since this approach avoids
virtual call cost. Additionally, this patch makes them not throw as
declared by the spec. As far as I know, the destruction cost of
`ErrorResult` may appear in profile so that we should avoid creating
the instance if we can avoid it.
Unfortunately, the instance size of `nsRange` becomes larger with this
patch. The size is changed from 176 to 184. I.e., now, `nsRange`
requires bigger chunk.
Differential Revision: https://phabricator.services.mozilla.com/D35140
--HG--
extra : moz-landing-system : lando
2019-06-28 10:46:35 +03:00
|
|
|
uint32_t StartOffset() const {
|
2019-12-16 14:31:30 +03:00
|
|
|
return static_cast<uint32_t>(
|
|
|
|
*mStart.Offset(RangeBoundary::OffsetFilter::kValidOrInvalidOffsets));
|
Bug 1444847 - part 1: Create `mozilla::dom::AbstractRange` r=smaug
This patch is based on the patch created by Makoto Kato-san.
`Range` and `StaticRange` have common base interface, `AbstractRange`.
https://dom.spec.whatwg.org/#abstractrange
This interface has simply returns `startContainer`, `endContainer`,
`startOffset`, `endOffset` and `collapsed`.
Different from the original patch's approach, this patch moves related
members in `nsRange` to `AbstractRange` since this approach avoids
virtual call cost. Additionally, this patch makes them not throw as
declared by the spec. As far as I know, the destruction cost of
`ErrorResult` may appear in profile so that we should avoid creating
the instance if we can avoid it.
Unfortunately, the instance size of `nsRange` becomes larger with this
patch. The size is changed from 176 to 184. I.e., now, `nsRange`
requires bigger chunk.
Differential Revision: https://phabricator.services.mozilla.com/D35140
--HG--
extra : moz-landing-system : lando
2019-06-28 10:46:35 +03:00
|
|
|
}
|
2019-12-16 14:31:30 +03:00
|
|
|
|
|
|
|
// FYI: Returns 0 if it's not positioned.
|
Bug 1444847 - part 1: Create `mozilla::dom::AbstractRange` r=smaug
This patch is based on the patch created by Makoto Kato-san.
`Range` and `StaticRange` have common base interface, `AbstractRange`.
https://dom.spec.whatwg.org/#abstractrange
This interface has simply returns `startContainer`, `endContainer`,
`startOffset`, `endOffset` and `collapsed`.
Different from the original patch's approach, this patch moves related
members in `nsRange` to `AbstractRange` since this approach avoids
virtual call cost. Additionally, this patch makes them not throw as
declared by the spec. As far as I know, the destruction cost of
`ErrorResult` may appear in profile so that we should avoid creating
the instance if we can avoid it.
Unfortunately, the instance size of `nsRange` becomes larger with this
patch. The size is changed from 176 to 184. I.e., now, `nsRange`
requires bigger chunk.
Differential Revision: https://phabricator.services.mozilla.com/D35140
--HG--
extra : moz-landing-system : lando
2019-06-28 10:46:35 +03:00
|
|
|
uint32_t EndOffset() const {
|
2019-12-16 14:31:30 +03:00
|
|
|
return static_cast<uint32_t>(
|
|
|
|
*mEnd.Offset(RangeBoundary::OffsetFilter::kValidOrInvalidOffsets));
|
Bug 1444847 - part 1: Create `mozilla::dom::AbstractRange` r=smaug
This patch is based on the patch created by Makoto Kato-san.
`Range` and `StaticRange` have common base interface, `AbstractRange`.
https://dom.spec.whatwg.org/#abstractrange
This interface has simply returns `startContainer`, `endContainer`,
`startOffset`, `endOffset` and `collapsed`.
Different from the original patch's approach, this patch moves related
members in `nsRange` to `AbstractRange` since this approach avoids
virtual call cost. Additionally, this patch makes them not throw as
declared by the spec. As far as I know, the destruction cost of
`ErrorResult` may appear in profile so that we should avoid creating
the instance if we can avoid it.
Unfortunately, the instance size of `nsRange` becomes larger with this
patch. The size is changed from 176 to 184. I.e., now, `nsRange`
requires bigger chunk.
Differential Revision: https://phabricator.services.mozilla.com/D35140
--HG--
extra : moz-landing-system : lando
2019-06-28 10:46:35 +03:00
|
|
|
}
|
|
|
|
bool Collapsed() const {
|
|
|
|
return !mIsPositioned || (mStart.Container() == mEnd.Container() &&
|
2019-12-16 14:31:30 +03:00
|
|
|
StartOffset() == EndOffset());
|
Bug 1444847 - part 1: Create `mozilla::dom::AbstractRange` r=smaug
This patch is based on the patch created by Makoto Kato-san.
`Range` and `StaticRange` have common base interface, `AbstractRange`.
https://dom.spec.whatwg.org/#abstractrange
This interface has simply returns `startContainer`, `endContainer`,
`startOffset`, `endOffset` and `collapsed`.
Different from the original patch's approach, this patch moves related
members in `nsRange` to `AbstractRange` since this approach avoids
virtual call cost. Additionally, this patch makes them not throw as
declared by the spec. As far as I know, the destruction cost of
`ErrorResult` may appear in profile so that we should avoid creating
the instance if we can avoid it.
Unfortunately, the instance size of `nsRange` becomes larger with this
patch. The size is changed from 176 to 184. I.e., now, `nsRange`
requires bigger chunk.
Differential Revision: https://phabricator.services.mozilla.com/D35140
--HG--
extra : moz-landing-system : lando
2019-06-28 10:46:35 +03:00
|
|
|
}
|
|
|
|
|
2020-11-23 19:07:43 +03:00
|
|
|
nsINode* GetParentObject() const;
|
Bug 1444847 - part 1: Create `mozilla::dom::AbstractRange` r=smaug
This patch is based on the patch created by Makoto Kato-san.
`Range` and `StaticRange` have common base interface, `AbstractRange`.
https://dom.spec.whatwg.org/#abstractrange
This interface has simply returns `startContainer`, `endContainer`,
`startOffset`, `endOffset` and `collapsed`.
Different from the original patch's approach, this patch moves related
members in `nsRange` to `AbstractRange` since this approach avoids
virtual call cost. Additionally, this patch makes them not throw as
declared by the spec. As far as I know, the destruction cost of
`ErrorResult` may appear in profile so that we should avoid creating
the instance if we can avoid it.
Unfortunately, the instance size of `nsRange` becomes larger with this
patch. The size is changed from 176 to 184. I.e., now, `nsRange`
requires bigger chunk.
Differential Revision: https://phabricator.services.mozilla.com/D35140
--HG--
extra : moz-landing-system : lando
2019-06-28 10:46:35 +03:00
|
|
|
virtual JSObject* WrapObject(JSContext* aCx,
|
|
|
|
JS::Handle<JSObject*> aGivenProto) override;
|
|
|
|
|
2020-01-24 17:40:35 +03:00
|
|
|
bool HasEqualBoundaries(const AbstractRange& aOther) const {
|
|
|
|
return (mStart == aOther.mStart) && (mEnd == aOther.mEnd);
|
|
|
|
}
|
|
|
|
|
Bug 1444847 - part 1: Create `mozilla::dom::AbstractRange` r=smaug
This patch is based on the patch created by Makoto Kato-san.
`Range` and `StaticRange` have common base interface, `AbstractRange`.
https://dom.spec.whatwg.org/#abstractrange
This interface has simply returns `startContainer`, `endContainer`,
`startOffset`, `endOffset` and `collapsed`.
Different from the original patch's approach, this patch moves related
members in `nsRange` to `AbstractRange` since this approach avoids
virtual call cost. Additionally, this patch makes them not throw as
declared by the spec. As far as I know, the destruction cost of
`ErrorResult` may appear in profile so that we should avoid creating
the instance if we can avoid it.
Unfortunately, the instance size of `nsRange` becomes larger with this
patch. The size is changed from 176 to 184. I.e., now, `nsRange`
requires bigger chunk.
Differential Revision: https://phabricator.services.mozilla.com/D35140
--HG--
extra : moz-landing-system : lando
2019-06-28 10:46:35 +03:00
|
|
|
protected:
|
2019-06-28 10:48:52 +03:00
|
|
|
template <typename SPT, typename SRT, typename EPT, typename ERT,
|
|
|
|
typename RangeType>
|
|
|
|
static nsresult SetStartAndEndInternal(
|
|
|
|
const RangeBoundaryBase<SPT, SRT>& aStartBoundary,
|
|
|
|
const RangeBoundaryBase<EPT, ERT>& aEndBoundary, RangeType* aRange);
|
|
|
|
|
2020-02-14 18:02:43 +03:00
|
|
|
template <class RangeType>
|
|
|
|
static bool MaybeCacheToReuse(RangeType& aInstance);
|
|
|
|
|
|
|
|
void Init(nsINode* aNode);
|
|
|
|
|
|
|
|
private:
|
2020-11-23 19:07:43 +03:00
|
|
|
void ClearForReuse();
|
2020-01-30 20:10:59 +03:00
|
|
|
|
2020-02-14 18:02:43 +03:00
|
|
|
protected:
|
Bug 1444847 - part 1: Create `mozilla::dom::AbstractRange` r=smaug
This patch is based on the patch created by Makoto Kato-san.
`Range` and `StaticRange` have common base interface, `AbstractRange`.
https://dom.spec.whatwg.org/#abstractrange
This interface has simply returns `startContainer`, `endContainer`,
`startOffset`, `endOffset` and `collapsed`.
Different from the original patch's approach, this patch moves related
members in `nsRange` to `AbstractRange` since this approach avoids
virtual call cost. Additionally, this patch makes them not throw as
declared by the spec. As far as I know, the destruction cost of
`ErrorResult` may appear in profile so that we should avoid creating
the instance if we can avoid it.
Unfortunately, the instance size of `nsRange` becomes larger with this
patch. The size is changed from 176 to 184. I.e., now, `nsRange`
requires bigger chunk.
Differential Revision: https://phabricator.services.mozilla.com/D35140
--HG--
extra : moz-landing-system : lando
2019-06-28 10:46:35 +03:00
|
|
|
RefPtr<Document> mOwner;
|
|
|
|
RangeBoundary mStart;
|
|
|
|
RangeBoundary mEnd;
|
2019-12-16 14:31:39 +03:00
|
|
|
// `true` if `mStart` and `mEnd` are set for StaticRange or set and valid
|
|
|
|
// for nsRange.
|
Bug 1444847 - part 1: Create `mozilla::dom::AbstractRange` r=smaug
This patch is based on the patch created by Makoto Kato-san.
`Range` and `StaticRange` have common base interface, `AbstractRange`.
https://dom.spec.whatwg.org/#abstractrange
This interface has simply returns `startContainer`, `endContainer`,
`startOffset`, `endOffset` and `collapsed`.
Different from the original patch's approach, this patch moves related
members in `nsRange` to `AbstractRange` since this approach avoids
virtual call cost. Additionally, this patch makes them not throw as
declared by the spec. As far as I know, the destruction cost of
`ErrorResult` may appear in profile so that we should avoid creating
the instance if we can avoid it.
Unfortunately, the instance size of `nsRange` becomes larger with this
patch. The size is changed from 176 to 184. I.e., now, `nsRange`
requires bigger chunk.
Differential Revision: https://phabricator.services.mozilla.com/D35140
--HG--
extra : moz-landing-system : lando
2019-06-28 10:46:35 +03:00
|
|
|
bool mIsPositioned;
|
|
|
|
|
|
|
|
// Used by nsRange, but this should have this for minimizing the size.
|
|
|
|
bool mIsGenerated;
|
|
|
|
// Used by nsRange, but this should have this for minimizing the size.
|
|
|
|
bool mCalledByJS;
|
2020-02-14 18:02:43 +03:00
|
|
|
|
|
|
|
static bool sHasShutDown;
|
Bug 1444847 - part 1: Create `mozilla::dom::AbstractRange` r=smaug
This patch is based on the patch created by Makoto Kato-san.
`Range` and `StaticRange` have common base interface, `AbstractRange`.
https://dom.spec.whatwg.org/#abstractrange
This interface has simply returns `startContainer`, `endContainer`,
`startOffset`, `endOffset` and `collapsed`.
Different from the original patch's approach, this patch moves related
members in `nsRange` to `AbstractRange` since this approach avoids
virtual call cost. Additionally, this patch makes them not throw as
declared by the spec. As far as I know, the destruction cost of
`ErrorResult` may appear in profile so that we should avoid creating
the instance if we can avoid it.
Unfortunately, the instance size of `nsRange` becomes larger with this
patch. The size is changed from 176 to 184. I.e., now, `nsRange`
requires bigger chunk.
Differential Revision: https://phabricator.services.mozilla.com/D35140
--HG--
extra : moz-landing-system : lando
2019-06-28 10:46:35 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // #ifndef mozilla_dom_AbstractRange_h
|