layout/style/nsDOMCSSRect.cpp

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 /* DOM object representing rectangle values in DOM computed style */
michael@0 7
michael@0 8 #include "mozilla/dom/RectBinding.h"
michael@0 9 #include "nsROCSSPrimitiveValue.h"
michael@0 10 #include "nsDOMCSSRect.h"
michael@0 11
michael@0 12 using namespace mozilla;
michael@0 13
michael@0 14 nsDOMCSSRect::nsDOMCSSRect(nsROCSSPrimitiveValue* aTop,
michael@0 15 nsROCSSPrimitiveValue* aRight,
michael@0 16 nsROCSSPrimitiveValue* aBottom,
michael@0 17 nsROCSSPrimitiveValue* aLeft)
michael@0 18 : mTop(aTop), mRight(aRight), mBottom(aBottom), mLeft(aLeft)
michael@0 19 {
michael@0 20 SetIsDOMBinding();
michael@0 21 }
michael@0 22
michael@0 23 nsDOMCSSRect::~nsDOMCSSRect(void)
michael@0 24 {
michael@0 25 }
michael@0 26
michael@0 27 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMCSSRect)
michael@0 28 NS_INTERFACE_MAP_ENTRY(nsIDOMRect)
michael@0 29 NS_INTERFACE_MAP_ENTRY(nsISupports)
michael@0 30 NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
michael@0 31 NS_INTERFACE_MAP_END
michael@0 32
michael@0 33 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMCSSRect)
michael@0 34 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMCSSRect)
michael@0 35
michael@0 36 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_4(nsDOMCSSRect, mTop, mBottom, mLeft, mRight)
michael@0 37
michael@0 38 JSObject*
michael@0 39 nsDOMCSSRect::WrapObject(JSContext* cx)
michael@0 40 {
michael@0 41 return dom::RectBinding::Wrap(cx, this);
michael@0 42 }
michael@0 43
michael@0 44 NS_IMETHODIMP
michael@0 45 nsDOMCSSRect::GetTop(nsIDOMCSSPrimitiveValue** aTop)
michael@0 46 {
michael@0 47 NS_ENSURE_TRUE(mTop, NS_ERROR_NOT_INITIALIZED);
michael@0 48 *aTop = mTop;
michael@0 49 NS_ADDREF(*aTop);
michael@0 50 return NS_OK;
michael@0 51 }
michael@0 52
michael@0 53 NS_IMETHODIMP
michael@0 54 nsDOMCSSRect::GetRight(nsIDOMCSSPrimitiveValue** aRight)
michael@0 55 {
michael@0 56 NS_ENSURE_TRUE(mRight, NS_ERROR_NOT_INITIALIZED);
michael@0 57 *aRight = mRight;
michael@0 58 NS_ADDREF(*aRight);
michael@0 59 return NS_OK;
michael@0 60 }
michael@0 61
michael@0 62 NS_IMETHODIMP
michael@0 63 nsDOMCSSRect::GetBottom(nsIDOMCSSPrimitiveValue** aBottom)
michael@0 64 {
michael@0 65 NS_ENSURE_TRUE(mBottom, NS_ERROR_NOT_INITIALIZED);
michael@0 66 *aBottom = mBottom;
michael@0 67 NS_ADDREF(*aBottom);
michael@0 68 return NS_OK;
michael@0 69 }
michael@0 70
michael@0 71 NS_IMETHODIMP
michael@0 72 nsDOMCSSRect::GetLeft(nsIDOMCSSPrimitiveValue** aLeft)
michael@0 73 {
michael@0 74 NS_ENSURE_TRUE(mLeft, NS_ERROR_NOT_INITIALIZED);
michael@0 75 *aLeft = mLeft;
michael@0 76 NS_ADDREF(*aLeft);
michael@0 77 return NS_OK;
michael@0 78 }

mercurial