Chromium Code Reviews| Index: Source/core/dom/DOMQuad.h |
| diff --git a/Source/core/dom/DOMQuad.h b/Source/core/dom/DOMQuad.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ef75d08ea725b4dda2a70c96932524d8b3e80e9d |
| --- /dev/null |
| +++ b/Source/core/dom/DOMQuad.h |
| @@ -0,0 +1,64 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef DOMQuad_h |
| +#define DOMQuad_h |
| + |
| +#include "core/dom/DOMPoint.h" |
| +#include "core/dom/DOMRect.h" |
| + |
| +namespace WebCore { |
| + |
| +typedef const Dictionary DOMPointInit; |
| +typedef const Dictionary DOMRectInit; |
| + |
| +class DOMQuad; |
| + |
| +class DOMQuadPoint : public DOMPoint { |
| +public: |
| + static DOMQuadPoint* create(DOMPointInit&, Member<DOMQuad>); |
| + static DOMQuadPoint* create(double x, double y, Member<DOMQuad>); |
| + |
| + virtual void setX(double) OVERRIDE; |
| + virtual void setY(double) OVERRIDE; |
| + |
| + virtual void trace(Visitor*) OVERRIDE; |
| + |
| +private: |
| + DOMQuadPoint(double x, double y, Member<DOMQuad>); |
| + |
| + Member<DOMQuad> m_quad; |
| +}; |
| + |
| +class DOMQuad : public GarbageCollected<DOMQuad> { |
| +public: |
| + static DOMQuad* create(DOMRectInit& = DOMRectInit()); |
| + static DOMQuad* create(DOMPointInit&, DOMPointInit&, |
| + DOMPointInit& = DOMPointInit(), DOMPointInit& = DOMPointInit()); |
| + |
| + DOMPoint* p1() const { return m_p1.get(); } |
| + DOMPoint* p2() const { return m_p2.get(); } |
| + DOMPoint* p3() const { return m_p3.get(); } |
| + DOMPoint* p4() const { return m_p4.get(); } |
| + DOMRectReadOnly* bounds() const; |
| + |
| + void updateHorizontalBounds(); |
| + void updateVerticalBounds(); |
| + |
| + void trace(Visitor*); |
| + |
| +protected: |
| + DOMQuad(double x, double y, double width, double height); |
| + DOMQuad(DOMPointInit&, DOMPointInit&, DOMPointInit&, DOMPointInit&); |
| + |
| + Member<DOMPoint> m_p1; |
| + Member<DOMPoint> m_p2; |
| + Member<DOMPoint> m_p3; |
| + Member<DOMPoint> m_p4; |
| + Member<DOMRect> m_bounds; |
|
Rik
2014/07/29 03:31:39
I think this is wrong. m_bounds' lifetime should n
|
| +}; |
| + |
| +} // namespace WebCore |
| + |
| +#endif |