2017-10-27 20:33:53 +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: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
2001-12-12 10:59:31 +03:00
|
|
|
|
2012-03-26 15:58:59 +04:00
|
|
|
// Main header first:
|
2020-06-27 08:39:42 +03:00
|
|
|
#include "SVGGFrame.h"
|
2012-03-26 15:58:59 +04:00
|
|
|
|
|
|
|
// Keep others in (case-insensitive) order:
|
2019-04-16 10:24:49 +03:00
|
|
|
#include "mozilla/PresShell.h"
|
2007-01-30 03:06:41 +03:00
|
|
|
#include "nsGkAtoms.h"
|
2012-03-26 15:58:59 +04:00
|
|
|
#include "nsIFrame.h"
|
2001-12-12 10:59:31 +03:00
|
|
|
|
2013-01-03 10:17:03 +04:00
|
|
|
using namespace mozilla::dom;
|
|
|
|
|
2001-12-12 10:59:31 +03:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// Implementation
|
|
|
|
|
2020-06-27 08:39:42 +03:00
|
|
|
nsIFrame* NS_NewSVGGFrame(mozilla::PresShell* aPresShell,
|
|
|
|
mozilla::ComputedStyle* aStyle) {
|
|
|
|
return new (aPresShell)
|
|
|
|
mozilla::SVGGFrame(aStyle, aPresShell->GetPresContext());
|
2009-01-19 21:31:34 +03:00
|
|
|
}
|
|
|
|
|
2020-06-27 08:39:42 +03:00
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
NS_IMPL_FRAMEARENA_HELPERS(SVGGFrame)
|
2009-09-12 20:49:24 +04:00
|
|
|
|
2009-01-19 21:31:34 +03:00
|
|
|
#ifdef DEBUG
|
2020-06-27 08:39:42 +03:00
|
|
|
void SVGGFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow) {
|
2015-03-03 14:08:59 +03:00
|
|
|
NS_ASSERTION(aContent->IsSVGElement() &&
|
2018-12-21 11:58:14 +03:00
|
|
|
static_cast<SVGElement*>(aContent)->IsTransformable(),
|
2020-06-27 08:39:42 +03:00
|
|
|
"The element is not transformable");
|
2001-12-12 10:59:31 +03:00
|
|
|
|
2020-07-09 04:33:33 +03:00
|
|
|
SVGDisplayContainerFrame::Init(aContent, aParent, aPrevInFlow);
|
2001-12-12 10:59:31 +03:00
|
|
|
}
|
2009-01-19 21:31:34 +03:00
|
|
|
#endif /* DEBUG */
|
2001-12-12 10:59:31 +03:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2020-07-09 21:34:54 +03:00
|
|
|
// ISVGDisplayableFrame methods
|
2001-12-12 10:59:31 +03:00
|
|
|
|
2020-06-27 08:39:42 +03:00
|
|
|
nsresult SVGGFrame::AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
|
|
|
|
int32_t aModType) {
|
2006-06-01 19:31:15 +04:00
|
|
|
if (aNameSpaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::transform) {
|
2013-05-23 11:04:21 +04:00
|
|
|
// We don't invalidate for transform changes (the layers code does that).
|
|
|
|
// Also note that SVGTransformableElement::GetAttributeChangeHint will
|
|
|
|
// return nsChangeHint_UpdateOverflow for "transform" attribute changes
|
|
|
|
// and cause DoApplyRenderingChangeToTree to make the SchedulePaint call.
|
2012-01-28 17:58:17 +04:00
|
|
|
NotifySVGChanged(TRANSFORM_CHANGED);
|
2006-06-01 19:31:15 +04:00
|
|
|
}
|
2016-04-18 10:08:01 +03:00
|
|
|
|
2006-06-01 19:31:15 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2020-06-27 08:39:42 +03:00
|
|
|
|
|
|
|
} // namespace mozilla
|