Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/base/GeneratedImageContent.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/GeneratedImageContent.h"
8
9
#include "nsContentCreatorFunctions.h"
10
#include "nsGkAtoms.h"
11
#include "nsIDocument.h"
12
#include "nsNodeInfoManager.h"
13
#include "mozilla/dom/HTMLElementBinding.h"
14
#include "mozilla/dom/NameSpaceConstants.h"
15
16
namespace mozilla {
17
namespace dom {
18
19
NS_IMPL_ELEMENT_CLONE(GeneratedImageContent);
20
21
already_AddRefed<GeneratedImageContent>
22
GeneratedImageContent::Create(nsIDocument& aDocument, uint32_t aContentIndex)
23
0
{
24
0
  RefPtr<dom::NodeInfo> nodeInfo =
25
0
    aDocument.NodeInfoManager()->
26
0
      GetNodeInfo(nsGkAtoms::mozgeneratedcontentimage,
27
0
                  nullptr,
28
0
                  kNameSpaceID_XHTML,
29
0
                  nsINode::ELEMENT_NODE);
30
0
31
0
  auto image = MakeRefPtr<GeneratedImageContent>(nodeInfo.forget());
32
0
  image->mIndex = aContentIndex;
33
0
  return image.forget();
34
0
}
35
36
JSObject*
37
GeneratedImageContent::WrapNode(JSContext* aCx,
38
                                JS::Handle<JSObject*> aGivenProto)
39
0
{
40
0
  return dom::HTMLElement_Binding::Wrap(aCx, this, aGivenProto);
41
0
}
42
43
} // namespace dom
44
} // namespace mozilla
45