|
|
|
|
| 98 |
#include "HTMLLegendElement.h" |
98 |
#include "HTMLLegendElement.h" |
| 99 |
#include "nsWrapperCacheInlines.h" |
99 |
#include "nsWrapperCacheInlines.h" |
| 100 |
#include "WrapperFactory.h" |
100 |
#include "WrapperFactory.h" |
| 101 |
#include "DocumentType.h" |
101 |
#include "DocumentType.h" |
| 102 |
#include <algorithm> |
102 |
#include <algorithm> |
| 103 |
#include "nsDOMEvent.h" |
103 |
#include "nsDOMEvent.h" |
| 104 |
#include "nsGlobalWindow.h" |
104 |
#include "nsGlobalWindow.h" |
| 105 |
#include "nsDOMMutationObserver.h" |
105 |
#include "nsDOMMutationObserver.h" |
|
|
106 |
#include "mozilla/dom/DOMPoint.h" |
| 107 |
#include "mozilla/dom/DOMRect.h" |
| 106 |
#include "mozilla/dom/DOMQuad.h" |
108 |
#include "mozilla/dom/DOMQuad.h" |
| 107 |
#include "mozilla/CoordinateTransformations.h" |
109 |
#include "mozilla/CoordinateTransformations.h" |
| 108 |
|
110 |
|
| 109 |
using namespace mozilla; |
111 |
using namespace mozilla; |
| 110 |
using namespace mozilla::dom; |
112 |
using namespace mozilla::dom; |
| 111 |
|
113 |
|
| 112 |
nsINode::nsSlots::~nsSlots() |
114 |
nsINode::nsSlots::~nsSlots() |
| 113 |
{ |
115 |
{ |
|
Lines 2548-2555
nsINode::GetBoxQuads(const BoxQuadOption
|
Link Here
|
|---|
|
| 2548 |
ErrorResult& aRv) |
2550 |
ErrorResult& aRv) |
| 2549 |
{ |
2551 |
{ |
| 2550 |
nsAutoTArray<Quad2D,1> quads; |
2552 |
nsAutoTArray<Quad2D,1> quads; |
| 2551 |
mozilla::GetBoxQuads(this, aOptions, quads, aRv); |
2553 |
mozilla::GetBoxQuads(this, aOptions, quads, aRv); |
| 2552 |
for (uint32_t i = 0; i < quads.Length(); ++i) { |
2554 |
for (uint32_t i = 0; i < quads.Length(); ++i) { |
| 2553 |
aResult.AppendElement(new DOMQuad(OwnerDoc(), quads[i].mPoints)); |
2555 |
aResult.AppendElement(new DOMQuad(OwnerDoc(), quads[i].mPoints)); |
| 2554 |
} |
2556 |
} |
| 2555 |
} |
2557 |
} |
|
|
2558 |
|
| 2559 |
already_AddRefed<DOMPoint> |
| 2560 |
nsINode::ConvertPointFromNode(const DOMPoint& aPoint, |
| 2561 |
nsINode& aFrom, |
| 2562 |
const ConvertPointOptions& aOptions, |
| 2563 |
ErrorResult& aRv) |
| 2564 |
{ |
| 2565 |
gfxPoint pt(aPoint.X(), aPoint.Y()); |
| 2566 |
TransformCSSPoints(this, &aFrom, 1, &pt, aOptions, aRv); |
| 2567 |
nsRefPtr<DOMPoint> result = new DOMPoint(OwnerDoc(), pt.x, pt.y); |
| 2568 |
return result.forget(); |
| 2569 |
} |
| 2570 |
|
| 2571 |
already_AddRefed<DOMQuad> |
| 2572 |
nsINode::ConvertRectFromNode(const DOMRect& aRect, |
| 2573 |
nsINode& aFrom, |
| 2574 |
const ConvertPointOptions& aOptions, |
| 2575 |
ErrorResult& aRv) |
| 2576 |
{ |
| 2577 |
gfxPoint pts[4] = { |
| 2578 |
gfxPoint(aRect.Left(), aRect.Top()), |
| 2579 |
gfxPoint(aRect.Right(), aRect.Top()), |
| 2580 |
gfxPoint(aRect.Right(), aRect.Bottom()), |
| 2581 |
gfxPoint(aRect.Left(), aRect.Bottom()) |
| 2582 |
}; |
| 2583 |
TransformCSSPoints(this, &aFrom, 4, pts, aOptions, aRv); |
| 2584 |
nsRefPtr<DOMQuad> result = new DOMQuad(OwnerDoc(), pts); |
| 2585 |
return result.forget(); |
| 2586 |
} |
| 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> |
| 2596 |
nsINode::ConvertQuadFromNode(const DOMQuad& aQuad, |
| 2597 |
nsINode& aFrom, |
| 2598 |
const ConvertPointOptions& aOptions, |
| 2599 |
ErrorResult& aRv) |
| 2600 |
{ |
| 2601 |
gfxPoint pts[4] = { |
| 2602 |
DOMPointToGfxPoint(aQuad.P1()), |
| 2603 |
DOMPointToGfxPoint(aQuad.P2()), |
| 2604 |
DOMPointToGfxPoint(aQuad.P3()), |
| 2605 |
DOMPointToGfxPoint(aQuad.P4()) |
| 2606 |
}; |
| 2607 |
TransformCSSPoints(this, &aFrom, 4, pts, aOptions, aRv); |
| 2608 |
nsRefPtr<DOMQuad> result = new DOMQuad(OwnerDoc(), pts); |
| 2609 |
return result.forget(); |
| 2610 |
} |