2015-05-03 22:32:37 +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/. */
|
2005-01-25 06:55:03 +03:00
|
|
|
|
2013-12-09 06:52:54 +04:00
|
|
|
#include "mozilla/ArrayUtils.h"
|
2011-10-11 09:50:08 +04:00
|
|
|
|
2013-01-18 23:52:40 +04:00
|
|
|
#include "mozilla/dom/SVGClipPathElement.h"
|
2013-01-18 23:53:08 +04:00
|
|
|
#include "mozilla/dom/SVGClipPathElementBinding.h"
|
2018-02-18 18:53:13 +03:00
|
|
|
#include "mozilla/dom/SVGUnitTypesBinding.h"
|
2006-12-26 20:47:52 +03:00
|
|
|
#include "nsGkAtoms.h"
|
2007-08-28 03:11:14 +04:00
|
|
|
|
2013-01-18 23:52:40 +04:00
|
|
|
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(ClipPath)
|
2011-10-11 09:50:08 +04:00
|
|
|
|
2013-01-18 23:52:40 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2018-06-26 00:20:54 +03:00
|
|
|
using namespace SVGUnitTypes_Binding;
|
2018-02-18 18:53:13 +03:00
|
|
|
|
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The
rest of this diff was generated by running the following commands:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 17:13:33 +03:00
|
|
|
JSObject* SVGClipPathElement::WrapNode(JSContext* aCx,
|
|
|
|
JS::Handle<JSObject*> aGivenProto) {
|
2018-06-26 00:20:54 +03:00
|
|
|
return SVGClipPathElement_Binding::Wrap(aCx, this, aGivenProto);
|
2013-01-18 23:53:08 +04:00
|
|
|
}
|
|
|
|
|
2018-12-21 11:58:14 +03:00
|
|
|
SVGElement::EnumInfo SVGClipPathElement::sEnumInfo[1] = {
|
2013-02-18 06:14:02 +04:00
|
|
|
{nsGkAtoms::clipPathUnits, sSVGUnitTypesMap, SVG_UNIT_TYPE_USERSPACEONUSE}};
|
2005-01-25 06:55:03 +03:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// Implementation
|
|
|
|
|
2018-09-21 23:45:49 +03:00
|
|
|
SVGClipPathElement::SVGClipPathElement(
|
|
|
|
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
|
|
|
|
: SVGClipPathElementBase(std::move(aNodeInfo)) {}
|
2005-01-25 06:55:03 +03:00
|
|
|
|
2013-07-01 11:02:46 +04:00
|
|
|
already_AddRefed<SVGAnimatedEnumeration> SVGClipPathElement::ClipPathUnits() {
|
|
|
|
return mEnumAttributes[CLIPPATHUNITS].ToDOMAnimatedEnum(this);
|
2005-01-25 06:55:03 +03:00
|
|
|
}
|
|
|
|
|
2018-12-21 11:58:14 +03:00
|
|
|
SVGElement::EnumAttributesInfo SVGClipPathElement::GetEnumInfo() {
|
2007-08-28 03:11:14 +04:00
|
|
|
return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo));
|
|
|
|
}
|
2005-01-25 06:55:03 +03:00
|
|
|
|
2018-03-10 01:26:24 +03:00
|
|
|
bool SVGClipPathElement::IsUnitsObjectBoundingBox() const {
|
|
|
|
return mEnumAttributes[CLIPPATHUNITS].GetAnimValue() ==
|
|
|
|
SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
|
|
|
|
}
|
|
|
|
|
2005-01-25 06:55:03 +03:00
|
|
|
//----------------------------------------------------------------------
|
2018-05-30 05:58:49 +03:00
|
|
|
// nsINode methods
|
2005-01-25 06:55:03 +03:00
|
|
|
|
2013-01-18 23:52:40 +04:00
|
|
|
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGClipPathElement)
|
2005-01-25 06:55:03 +03:00
|
|
|
|
2013-01-18 23:52:40 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|