mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 04:45:45 +00:00
Bug 587021 - drop HTMLImageElement.x/.y; r=sicking sr=jst
This commit is contained in:
parent
ead101366c
commit
b6dd9d3e21
@ -152,7 +152,6 @@ public:
|
||||
void MaybeLoadImage();
|
||||
virtual nsXPCClassInfo* GetClassInfo();
|
||||
protected:
|
||||
nsPoint GetXY();
|
||||
nsSize GetWidthHeight();
|
||||
};
|
||||
|
||||
@ -252,42 +251,6 @@ nsHTMLImageElement::GetComplete(PRBool* aComplete)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsPoint
|
||||
nsHTMLImageElement::GetXY()
|
||||
{
|
||||
nsPoint point(0, 0);
|
||||
|
||||
nsIFrame* frame = GetPrimaryFrame(Flush_Layout);
|
||||
|
||||
if (!frame) {
|
||||
return point;
|
||||
}
|
||||
|
||||
nsIFrame* layer = nsLayoutUtils::GetClosestLayer(frame->GetParent());
|
||||
nsPoint origin(frame->GetOffsetTo(layer));
|
||||
// Convert to pixels using that scale
|
||||
point.x = nsPresContext::AppUnitsToIntCSSPixels(origin.x);
|
||||
point.y = nsPresContext::AppUnitsToIntCSSPixels(origin.y);
|
||||
|
||||
return point;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLImageElement::GetX(PRInt32* aX)
|
||||
{
|
||||
*aX = GetXY().x;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLImageElement::GetY(PRInt32* aY)
|
||||
{
|
||||
*aY = GetXY().y;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsSize
|
||||
nsHTMLImageElement::GetWidthHeight()
|
||||
{
|
||||
|
@ -50,7 +50,7 @@
|
||||
* http://www.whatwg.org/specs/web-apps/current-work/
|
||||
*/
|
||||
|
||||
[scriptable, uuid(c4ef8a40-dd56-4b95-a007-630a0ac04341)]
|
||||
[scriptable, uuid(cf8a8744-ec3b-474e-8f2b-8def3da2344a)]
|
||||
interface nsIDOMHTMLImageElement : nsIDOMHTMLElement
|
||||
{
|
||||
attribute DOMString alt;
|
||||
@ -71,9 +71,4 @@ interface nsIDOMHTMLImageElement : nsIDOMHTMLElement
|
||||
attribute DOMString longDesc;
|
||||
attribute long vspace;
|
||||
attribute DOMString lowsrc;
|
||||
|
||||
// These attributes are offsets from the closest view (to mimic
|
||||
// NS4's "offset-from-layer" behavior).
|
||||
readonly attribute long x;
|
||||
readonly attribute long y;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user