Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/layout/svg/nsSVGGFrame.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
// Main header first:
8
#include "nsSVGGFrame.h"
9
10
// Keep others in (case-insensitive) order:
11
#include "nsGkAtoms.h"
12
#include "SVGTransformableElement.h"
13
#include "nsIFrame.h"
14
#include "SVGGraphicsElement.h"
15
#include "nsSVGIntegrationUtils.h"
16
#include "nsSVGUtils.h"
17
18
using namespace mozilla::dom;
19
20
//----------------------------------------------------------------------
21
// Implementation
22
23
nsIFrame*
24
NS_NewSVGGFrame(nsIPresShell* aPresShell, ComputedStyle* aStyle)
25
0
{
26
0
  return new (aPresShell) nsSVGGFrame(aStyle);
27
0
}
28
29
NS_IMPL_FRAMEARENA_HELPERS(nsSVGGFrame)
30
31
#ifdef DEBUG
32
void
33
nsSVGGFrame::Init(nsIContent*       aContent,
34
                  nsContainerFrame* aParent,
35
                  nsIFrame*         aPrevInFlow)
36
{
37
  NS_ASSERTION(aContent->IsSVGElement() &&
38
               static_cast<nsSVGElement*>(aContent)->IsTransformable(),
39
               "The element doesn't support nsIDOMSVGTransformable");
40
41
  nsSVGDisplayContainerFrame::Init(aContent, aParent, aPrevInFlow);
42
}
43
#endif /* DEBUG */
44
45
//----------------------------------------------------------------------
46
// nsSVGDisplayableFrame methods
47
48
nsresult
49
nsSVGGFrame::AttributeChanged(int32_t         aNameSpaceID,
50
                              nsAtom*        aAttribute,
51
                              int32_t         aModType)
52
0
{
53
0
  if (aNameSpaceID == kNameSpaceID_None &&
54
0
      aAttribute == nsGkAtoms::transform) {
55
0
    // We don't invalidate for transform changes (the layers code does that).
56
0
    // Also note that SVGTransformableElement::GetAttributeChangeHint will
57
0
    // return nsChangeHint_UpdateOverflow for "transform" attribute changes
58
0
    // and cause DoApplyRenderingChangeToTree to make the SchedulePaint call.
59
0
    NotifySVGChanged(TRANSFORM_CHANGED);
60
0
  }
61
0
62
0
  return NS_OK;
63
0
}