Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/events/TextClause.cpp
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
 * License, v. 2.0. If a copy of the MPL was not distributed with this
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#include "mozilla/dom/TextClause.h"
8
#include "mozilla/dom/TextClauseBinding.h"
9
#include "mozilla/TextEvents.h"
10
11
namespace mozilla {
12
namespace dom {
13
14
// Only needed for refcounted objects.
15
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(TextClause)
16
NS_IMPL_CYCLE_COLLECTING_ADDREF(TextClause)
17
NS_IMPL_CYCLE_COLLECTING_RELEASE(TextClause)
18
0
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TextClause)
19
0
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
20
0
NS_INTERFACE_MAP_ENTRY(nsISupports)
21
0
NS_INTERFACE_MAP_END
22
23
TextClause::TextClause(nsPIDOMWindowInner* aOwner, const TextRange& aRange,
24
                       const TextRange* aTargetRange)
25
  : mOwner(aOwner)
26
  , mIsTargetClause(false)
27
0
{
28
0
  MOZ_ASSERT(aOwner);
29
0
  mStartOffset = aRange.mStartOffset;
30
0
  mEndOffset = aRange.mEndOffset;
31
0
  if (aRange.IsClause()) {
32
0
    mIsCaret = false;
33
0
    if (aTargetRange && aTargetRange->mStartOffset == mStartOffset) {
34
0
      mIsTargetClause = true;
35
0
    }
36
0
  } else {
37
0
    mIsCaret = true;
38
0
  }
39
0
}
40
41
JSObject*
42
TextClause::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
43
0
{
44
0
  return TextClause_Binding::Wrap(aCx, this, aGivenProto);
45
0
}
46
47
0
TextClause::~TextClause() {}
48
49
} // namespace dom
50
} // namespace mozilla