Attachment #807615: Part 2: Implement constructors for DOMRect and DOMQuad for bug #918189

View | Details | Raw Unified | Return to bug 918189
Collapse All | Expand All

(-)a/content/base/src/DOMPoint.cpp (-2 / +2 lines)
Line     Link Here 
 Lines 14-33   using namespace mozilla::dom; Link Here 
14
14
15
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(DOMPoint, mParent)
15
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(DOMPoint, mParent)
16
16
17
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMPoint, AddRef)
17
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMPoint, AddRef)
18
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMPoint, Release)
18
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMPoint, Release)
19
19
20
already_AddRefed<DOMPoint>
20
already_AddRefed<DOMPoint>
21
DOMPoint::Constructor(const GlobalObject& aGlobal, double aX, double aY,
21
DOMPoint::Constructor(const GlobalObject& aGlobal, double aX, double aY,
22
                      double aW, double aZ, ErrorResult& aRV)
22
                      double aZ, double aW, ErrorResult& aRV)
23
{
23
{
24
  nsRefPtr<DOMPoint> obj =
24
  nsRefPtr<DOMPoint> obj =
25
    new DOMPoint(aGlobal.GetAsSupports(), aX, aY, aW, aZ);
25
    new DOMPoint(aGlobal.GetAsSupports(), aX, aY, aZ, aW);
26
  return obj.forget();
26
  return obj.forget();
27
}
27
}
28
28
29
JSObject*
29
JSObject*
30
DOMPoint::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
30
DOMPoint::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
31
{
31
{
32
  return DOMPointBinding::Wrap(aCx, aScope, this);
32
  return DOMPointBinding::Wrap(aCx, aScope, this);
33
}
33
}
(-)a/content/base/src/DOMPoint.h (-1 / +8 lines)
Line     Link Here 
 Lines 7-22    Link Here 
7
#define MOZILLA_DOMPOINT_H_
7
#define MOZILLA_DOMPOINT_H_
8
8
9
#include "nsWrapperCache.h"
9
#include "nsWrapperCache.h"
10
#include "nsISupports.h"
10
#include "nsISupports.h"
11
#include "nsCycleCollectionParticipant.h"
11
#include "nsCycleCollectionParticipant.h"
12
#include "mozilla/Attributes.h"
12
#include "mozilla/Attributes.h"
13
#include "mozilla/ErrorResult.h"
13
#include "mozilla/ErrorResult.h"
14
#include "nsCOMPtr.h"
14
#include "nsCOMPtr.h"
15
#include "gfxPoint.h"
15
16
16
namespace mozilla {
17
namespace mozilla {
17
namespace dom {
18
namespace dom {
18
19
19
class GlobalObject;
20
class GlobalObject;
20
21
21
class DOMPoint MOZ_FINAL : public nsWrapperCache
22
class DOMPoint MOZ_FINAL : public nsWrapperCache
22
{
23
{
 Lines 32-58   public: Link Here 
32
    SetIsDOMBinding();
33
    SetIsDOMBinding();
33
  }
34
  }
34
35
35
  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMPoint)
36
  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMPoint)
36
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMPoint)
37
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMPoint)
37
38
38
  static already_AddRefed<DOMPoint>
39
  static already_AddRefed<DOMPoint>
39
  Constructor(const GlobalObject& aGlobal, double aX, double aY,
40
  Constructor(const GlobalObject& aGlobal, double aX, double aY,
40
              double aW, double aZ, ErrorResult& aRV);
41
              double aZ, double aW, ErrorResult& aRV);
41
42
42
  nsISupports* GetParentObject() const { return mParent; }
43
  nsISupports* GetParentObject() const { return mParent; }
43
  virtual JSObject* WrapObject(JSContext* aCx,
44
  virtual JSObject* WrapObject(JSContext* aCx,
44
                               JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
45
                               JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
45
46
46
  double X() const { return mX; }
47
  double X() const { return mX; }
47
  double Y() const { return mY; }
48
  double Y() const { return mY; }
48
  double Z() const { return mZ; }
49
  double Z() const { return mZ; }
49
  double W() const { return mW; }
50
  double W() const { return mW; }
50
51
52
  gfxPoint ToGfxPoint() const
53
  {
54
    NS_ASSERTION(mW == 1.0 && mZ == 0.0, "3D points not supported");
55
    return gfxPoint(mX, mY);
56
  }
57
51
protected:
58
protected:
52
  nsCOMPtr<nsISupports> mParent;
59
  nsCOMPtr<nsISupports> mParent;
53
  double mX, mY, mZ, mW;
60
  double mX, mY, mZ, mW;
54
};
61
};
55
62
56
}
63
}
57
}
64
}
58
65
(-)a/content/base/src/DOMQuad.cpp (+28 lines)
Line     Link Here 
 Lines 3-18    Link Here 
3
 * License, v. 2.0. If a copy of the MPL was not distributed with this
3
 * License, v. 2.0. If a copy of the MPL was not distributed with this
4
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
5
6
#include "mozilla/dom/DOMQuad.h"
6
#include "mozilla/dom/DOMQuad.h"
7
7
8
#include "mozilla/dom/DOMQuadBinding.h"
8
#include "mozilla/dom/DOMQuadBinding.h"
9
#include "mozilla/dom/DOMPoint.h"
9
#include "mozilla/dom/DOMPoint.h"
10
#include "mozilla/dom/DOMRect.h"
10
#include "mozilla/dom/DOMRect.h"
11
#include "mozilla/dom/BindingDeclarations.h"
11
#include "gfxPoint.h"
12
#include "gfxPoint.h"
12
#include <algorithm>
13
#include <algorithm>
13
14
14
using namespace mozilla;
15
using namespace mozilla;
15
using namespace mozilla::dom;
16
using namespace mozilla::dom;
16
17
17
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_6(DOMQuad, mParent, mBounds, mPoints[0],
18
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_6(DOMQuad, mParent, mBounds, mPoints[0],
18
                                        mPoints[1], mPoints[2], mPoints[3])
19
                                        mPoints[1], mPoints[2], mPoints[3])
 Lines 34-49   DOMQuad::~DOMQuad() Link Here 
34
}
35
}
35
36
36
JSObject*
37
JSObject*
37
DOMQuad::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
38
DOMQuad::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
38
{
39
{
39
  return DOMQuadBinding::Wrap(aCx, aScope, this);
40
  return DOMQuadBinding::Wrap(aCx, aScope, this);
40
}
41
}
41
42
43
already_AddRefed<DOMQuad>
44
DOMQuad::Constructor(const GlobalObject& aGlobal, DOMRect& aRect, ErrorResult& aRV)
45
{
46
  gfxPoint points[4] = {
47
    gfxPoint(aRect.Left(), aRect.Top()),
48
    gfxPoint(aRect.Right(), aRect.Top()),
49
    gfxPoint(aRect.Right(), aRect.Bottom()),
50
    gfxPoint(aRect.Left(), aRect.Bottom())
51
  };
52
  nsRefPtr<DOMQuad> obj = new DOMQuad(aGlobal.GetAsSupports(), points);
53
  return obj.forget();
54
}
55
56
already_AddRefed<DOMQuad>
57
DOMQuad::Constructor(const GlobalObject& aGlobal, DOMPoint& aPoint1, DOMPoint& aPoint2,
58
                     DOMPoint& aPoint3, DOMPoint& aPoint4, ErrorResult& aRV)
59
{
60
  gfxPoint points[4] = {
61
    aPoint1.ToGfxPoint(),
62
    aPoint2.ToGfxPoint(),
63
    aPoint3.ToGfxPoint(),
64
    aPoint4.ToGfxPoint()
65
  };
66
  nsRefPtr<DOMQuad> obj = new DOMQuad(aGlobal.GetAsSupports(), points);
67
  return obj.forget();
68
}
69
42
DOMRect*
70
DOMRect*
43
DOMQuad::Bounds() const
71
DOMQuad::Bounds() const
44
{
72
{
45
  if (!mBounds) {
73
  if (!mBounds) {
46
    double minX = mPoints[0]->X();
74
    double minX = mPoints[0]->X();
47
    double minY = mPoints[0]->Y();
75
    double minY = mPoints[0]->Y();
48
    double maxX = minX;
76
    double maxX = minX;
49
    double maxY = minY;
77
    double maxY = minY;
(-)a/content/base/src/DOMQuad.h (+8 lines)
Line     Link Here 
 Lines 5-44    Link Here 
5
5
6
#ifndef MOZILLA_DOMQUAD_H_
6
#ifndef MOZILLA_DOMQUAD_H_
7
#define MOZILLA_DOMQUAD_H_
7
#define MOZILLA_DOMQUAD_H_
8
8
9
#include "nsWrapperCache.h"
9
#include "nsWrapperCache.h"
10
#include "nsISupports.h"
10
#include "nsISupports.h"
11
#include "nsCycleCollectionParticipant.h"
11
#include "nsCycleCollectionParticipant.h"
12
#include "mozilla/Attributes.h"
12
#include "mozilla/Attributes.h"
13
#include "mozilla/ErrorResult.h"
13
#include "nsCOMPtr.h"
14
#include "nsCOMPtr.h"
14
#include "nsAutoPtr.h"
15
#include "nsAutoPtr.h"
15
16
16
class gfxPoint;
17
class gfxPoint;
17
18
18
namespace mozilla {
19
namespace mozilla {
19
namespace dom {
20
namespace dom {
20
21
21
class DOMRect;
22
class DOMRect;
22
class DOMPoint;
23
class DOMPoint;
24
class GlobalObject;
23
25
24
class DOMQuad MOZ_FINAL : public nsWrapperCache
26
class DOMQuad MOZ_FINAL : public nsWrapperCache
25
{
27
{
26
public:
28
public:
27
  DOMQuad(nsISupports* aParent, gfxPoint aPoints[4]);
29
  DOMQuad(nsISupports* aParent, gfxPoint aPoints[4]);
28
  ~DOMQuad();
30
  ~DOMQuad();
29
31
30
  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMQuad)
32
  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMQuad)
31
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMQuad)
33
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMQuad)
32
34
33
  nsISupports* GetParentObject() const { return mParent; }
35
  nsISupports* GetParentObject() const { return mParent; }
34
  virtual JSObject* WrapObject(JSContext* aCx,
36
  virtual JSObject* WrapObject(JSContext* aCx,
35
                               JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
37
                               JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
36
38
39
  static already_AddRefed<DOMQuad>
40
  Constructor(const GlobalObject& aGlobal, DOMRect& aRect, ErrorResult& aRV);
41
  static already_AddRefed<DOMQuad>
42
  Constructor(const GlobalObject& aGlobal, DOMPoint& aPoint1, DOMPoint& aPoint2,
43
              DOMPoint& aPoint3, DOMPoint& aPoint4, ErrorResult& aRV);
44
37
  DOMRect* Bounds() const;
45
  DOMRect* Bounds() const;
38
  DOMPoint* P1() const { return mPoints[0]; }
46
  DOMPoint* P1() const { return mPoints[0]; }
39
  DOMPoint* P2() const { return mPoints[1]; }
47
  DOMPoint* P2() const { return mPoints[1]; }
40
  DOMPoint* P3() const { return mPoints[2]; }
48
  DOMPoint* P3() const { return mPoints[2]; }
41
  DOMPoint* P4() const { return mPoints[3]; }
49
  DOMPoint* P4() const { return mPoints[3]; }
42
50
43
protected:
51
protected:
44
  nsCOMPtr<nsISupports> mParent;
52
  nsCOMPtr<nsISupports> mParent;
(-)a/content/base/src/DOMRect.cpp (+11 lines)
Line     Link Here 
 Lines 3-18    Link Here 
3
 * License, v. 2.0. If a copy of the MPL was not distributed with this
3
 * License, v. 2.0. If a copy of the MPL was not distributed with this
4
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
5
6
#include "mozilla/dom/DOMRect.h"
6
#include "mozilla/dom/DOMRect.h"
7
7
8
#include "nsPresContext.h"
8
#include "nsPresContext.h"
9
#include "mozilla/dom/DOMRectListBinding.h"
9
#include "mozilla/dom/DOMRectListBinding.h"
10
#include "mozilla/dom/DOMRectBinding.h"
10
#include "mozilla/dom/DOMRectBinding.h"
11
#include "mozilla/dom/DOMPoint.h"
12
#include "mozilla/dom/BindingDeclarations.h"
11
13
12
using namespace mozilla;
14
using namespace mozilla;
13
using namespace mozilla::dom;
15
using namespace mozilla::dom;
14
16
15
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(DOMRect, mParent)
17
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(DOMRect, mParent)
16
NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMRect)
18
NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMRect)
17
NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMRect)
19
NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMRect)
18
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMRect)
20
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMRect)
 Lines 72-87   DOMRectList::Item(uint32_t aIndex, nsIDO Link Here 
72
}
74
}
73
75
74
JSObject*
76
JSObject*
75
DOMRectList::WrapObject(JSContext *cx, JS::Handle<JSObject*> scope)
77
DOMRectList::WrapObject(JSContext *cx, JS::Handle<JSObject*> scope)
76
{
78
{
77
  return mozilla::dom::DOMRectListBinding::Wrap(cx, scope, this);
79
  return mozilla::dom::DOMRectListBinding::Wrap(cx, scope, this);
78
}
80
}
79
81
82
already_AddRefed<DOMRect>
83
DOMRect::Constructor(const GlobalObject& aGlobal, double aX, double aY,
84
                     double aW, double aH, ErrorResult& aRV)
85
{
86
  nsRefPtr<DOMRect> obj =
87
    new DOMRect(aGlobal.GetAsSupports(), aX, aY, aW, aH);
88
  return obj.forget();
89
}
90
80
static double
91
static double
81
RoundFloat(double aValue)
92
RoundFloat(double aValue)
82
{
93
{
83
  return floor(aValue + 0.5);
94
  return floor(aValue + 0.5);
84
}
95
}
85
96
86
void
97
void
87
DOMRect::SetLayoutRect(const nsRect& aLayoutRect)
98
DOMRect::SetLayoutRect(const nsRect& aLayoutRect)
(-)a/content/base/src/DOMRect.h (+7 lines)
Line     Link Here 
 Lines 9-30    Link Here 
9
#include "nsIDOMClientRect.h"
9
#include "nsIDOMClientRect.h"
10
#include "nsIDOMClientRectList.h"
10
#include "nsIDOMClientRectList.h"
11
#include "nsTArray.h"
11
#include "nsTArray.h"
12
#include "nsCOMPtr.h"
12
#include "nsCOMPtr.h"
13
#include "nsAutoPtr.h"
13
#include "nsAutoPtr.h"
14
#include "nsWrapperCache.h"
14
#include "nsWrapperCache.h"
15
#include "nsCycleCollectionParticipant.h"
15
#include "nsCycleCollectionParticipant.h"
16
#include "mozilla/Attributes.h"
16
#include "mozilla/Attributes.h"
17
#include "mozilla/ErrorResult.h"
17
18
18
struct nsRect;
19
struct nsRect;
19
20
20
namespace mozilla {
21
namespace mozilla {
21
namespace dom {
22
namespace dom {
22
23
24
class GlobalObject;
25
23
class DOMRect MOZ_FINAL : public nsIDOMClientRect
26
class DOMRect MOZ_FINAL : public nsIDOMClientRect
24
                        , public nsWrapperCache
27
                        , public nsWrapperCache
25
{
28
{
26
public:
29
public:
27
  DOMRect(nsISupports* aParent)
30
  DOMRect(nsISupports* aParent)
28
    : mParent(aParent), mX(0.0), mY(0.0), mWidth(0.0), mHeight(0.0)
31
    : mParent(aParent), mX(0.0), mY(0.0), mWidth(0.0), mHeight(0.0)
29
  {
32
  {
30
    SetIsDOMBinding();
33
    SetIsDOMBinding();
 Lines 55-70   public: Link Here 
55
  {
58
  {
56
    MOZ_ASSERT(mParent);
59
    MOZ_ASSERT(mParent);
57
    return mParent;
60
    return mParent;
58
  }
61
  }
59
  virtual JSObject* WrapObject(JSContext* aCx,
62
  virtual JSObject* WrapObject(JSContext* aCx,
60
                               JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
63
                               JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
61
64
62
65
66
  static already_AddRefed<DOMRect>
67
  Constructor(const GlobalObject& aGlobal, double aX, double aY,
68
              double aW, double aH, ErrorResult& aRV);
69
63
  float Left() const
70
  float Left() const
64
  {
71
  {
65
    return mX;
72
    return mX;
66
  }
73
  }
67
74
68
  float Top() const
75
  float Top() const
69
  {
76
  {
70
    return mY;
77
    return mY;
(-)a/content/base/src/nsINode.cpp (-11 / +4 lines)
Line     Link Here 
 Lines 2580-2610   nsINode::ConvertRectFromNode(const DOMRe Link Here 
2580
    gfxPoint(aRect.Right(), aRect.Bottom()),
2580
    gfxPoint(aRect.Right(), aRect.Bottom()),
2581
    gfxPoint(aRect.Left(), aRect.Bottom())
2581
    gfxPoint(aRect.Left(), aRect.Bottom())
2582
  };
2582
  };
2583
  TransformCSSPoints(this, &aFrom, 4, pts, aOptions, aRv);
2583
  TransformCSSPoints(this, &aFrom, 4, pts, aOptions, aRv);
2584
  nsRefPtr<DOMQuad> result = new DOMQuad(OwnerDoc(), pts);
2584
  nsRefPtr<DOMQuad> result = new DOMQuad(OwnerDoc(), pts);
2585
  return result.forget();
2585
  return result.forget();
2586
}
2586
}
2587
2587
2588
static gfxPoint
2589
DOMPointToGfxPoint(DOMPoint* aPoint)
2590
{
2591
  MOZ_ASSERT(aPoint->W() == 0.0, "W not supported");
2592
  return gfxPoint(aPoint->X(), aPoint->Y());
2593
}
2594
2595
already_AddRefed<DOMQuad>
2588
already_AddRefed<DOMQuad>
2596
nsINode::ConvertQuadFromNode(const DOMQuad& aQuad,
2589
nsINode::ConvertQuadFromNode(const DOMQuad& aQuad,
2597
                             nsINode& aFrom,
2590
                             nsINode& aFrom,
2598
                             const ConvertPointOptions& aOptions,
2591
                             const ConvertPointOptions& aOptions,
2599
                             ErrorResult& aRv)
2592
                             ErrorResult& aRv)
2600
{
2593
{
2601
  gfxPoint pts[4] = {
2594
  gfxPoint pts[4] = {
2602
    DOMPointToGfxPoint(aQuad.P1()),
2595
    aQuad.P1()->ToGfxPoint(),
2603
    DOMPointToGfxPoint(aQuad.P2()),
2596
    aQuad.P2()->ToGfxPoint(),
2604
    DOMPointToGfxPoint(aQuad.P3()),
2597
    aQuad.P3()->ToGfxPoint(),
2605
    DOMPointToGfxPoint(aQuad.P4())
2598
    aQuad.P4()->ToGfxPoint(),
2606
  };
2599
  };
2607
  TransformCSSPoints(this, &aFrom, 4, pts, aOptions, aRv);
2600
  TransformCSSPoints(this, &aFrom, 4, pts, aOptions, aRv);
2608
  nsRefPtr<DOMQuad> result = new DOMQuad(OwnerDoc(), pts);
2601
  nsRefPtr<DOMQuad> result = new DOMQuad(OwnerDoc(), pts);
2609
  return result.forget();
2602
  return result.forget();
2610
}
2603
}
(-)a/dom/webidl/DOMQuad.webidl (+2 lines)
Line     Link Here 
 Lines 1-13    Link Here 
1
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
1
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* This Source Code Form is subject to the terms of the Mozilla Public
2
/* This Source Code Form is subject to the terms of the Mozilla Public
3
 * License, v. 2.0. If a copy of the MPL was not distributed with this
3
 * License, v. 2.0. If a copy of the MPL was not distributed with this
4
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
5
6
[Constructor(DOMRect rect),
7
 Constructor(DOMPoint p1, DOMPoint p2, DOMPoint p3, DOMPoint p4)]
6
interface DOMQuad
8
interface DOMQuad
7
{
9
{
8
  readonly attribute DOMPoint p1;
10
  readonly attribute DOMPoint p1;
9
  readonly attribute DOMPoint p2;
11
  readonly attribute DOMPoint p2;
10
  readonly attribute DOMPoint p3;
12
  readonly attribute DOMPoint p3;
11
  readonly attribute DOMPoint p4;
13
  readonly attribute DOMPoint p4;
12
  readonly attribute DOMRect bounds;
14
  readonly attribute DOMRect bounds;
13
};
15
};
(-)a/dom/webidl/DOMRect.webidl (+1 lines)
Line     Link Here 
 Lines 1-13    Link Here 
1
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
1
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* This Source Code Form is subject to the terms of the Mozilla Public
2
/* This Source Code Form is subject to the terms of the Mozilla Public
3
 * License, v. 2.0. If a copy of the MPL was not distributed with this
3
 * License, v. 2.0. If a copy of the MPL was not distributed with this
4
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
5
6
[Constructor(double left, double top, double width, double height)]
6
interface DOMRect
7
interface DOMRect
7
{
8
{
8
  readonly attribute float left;
9
  readonly attribute float left;
9
  readonly attribute float top;
10
  readonly attribute float top;
10
  readonly attribute float right;
11
  readonly attribute float right;
11
  readonly attribute float bottom;
12
  readonly attribute float bottom;
12
  readonly attribute float width;
13
  readonly attribute float width;
13
  readonly attribute float height;
14
  readonly attribute float height;

Return to bug 918189