mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Remove the x,y,width,height methods from HTMLImageElement.
They've already been removed from the idl. R=eseidel@chromium.org Review URL: https://codereview.chromium.org/1055323002
This commit is contained in:
parent
8c084e1db9
commit
4fb43c315a
@ -15,9 +15,7 @@ href
|
||||
|
||||
# <img>
|
||||
crossorigin
|
||||
height
|
||||
src
|
||||
width
|
||||
|
||||
# <import>
|
||||
as
|
||||
|
||||
@ -178,46 +178,6 @@ void HTMLImageElement::removedFrom(ContainerNode* insertionPoint)
|
||||
HTMLElement::removedFrom(insertionPoint);
|
||||
}
|
||||
|
||||
int HTMLImageElement::width()
|
||||
{
|
||||
if (!renderer()) {
|
||||
// check the attribute first for an explicit pixel value
|
||||
bool ok;
|
||||
int width = getAttribute(HTMLNames::widthAttr).toInt(&ok);
|
||||
if (ok)
|
||||
return width;
|
||||
|
||||
// if the image is available, use its width
|
||||
if (imageLoader().image())
|
||||
return imageLoader().image()->imageSizeForRenderer(renderer()).width();
|
||||
}
|
||||
|
||||
document().updateLayout();
|
||||
|
||||
RenderBox* box = renderBox();
|
||||
return box ? box->contentBoxRect().pixelSnappedWidth() : 0;
|
||||
}
|
||||
|
||||
int HTMLImageElement::height()
|
||||
{
|
||||
if (!renderer()) {
|
||||
// check the attribute first for an explicit pixel value
|
||||
bool ok;
|
||||
int height = getAttribute(HTMLNames::heightAttr).toInt(&ok);
|
||||
if (ok)
|
||||
return height;
|
||||
|
||||
// if the image is available, use its height
|
||||
if (imageLoader().image())
|
||||
return imageLoader().image()->imageSizeForRenderer(renderer()).height();
|
||||
}
|
||||
|
||||
document().updateLayout();
|
||||
|
||||
RenderBox* box = renderBox();
|
||||
return box ? box->contentBoxRect().pixelSnappedHeight() : 0;
|
||||
}
|
||||
|
||||
int HTMLImageElement::naturalWidth() const
|
||||
{
|
||||
if (!imageLoader().image())
|
||||
@ -252,11 +212,6 @@ bool HTMLImageElement::isURLAttribute(const Attribute& attribute) const
|
||||
|| HTMLElement::isURLAttribute(attribute);
|
||||
}
|
||||
|
||||
void HTMLImageElement::setHeight(int value)
|
||||
{
|
||||
setIntegralAttribute(HTMLNames::heightAttr, value);
|
||||
}
|
||||
|
||||
KURL HTMLImageElement::src() const
|
||||
{
|
||||
return document().completeURL(getAttribute(HTMLNames::srcAttr));
|
||||
@ -267,35 +222,6 @@ void HTMLImageElement::setSrc(const String& value)
|
||||
setAttribute(HTMLNames::srcAttr, AtomicString(value));
|
||||
}
|
||||
|
||||
void HTMLImageElement::setWidth(int value)
|
||||
{
|
||||
setIntegralAttribute(HTMLNames::widthAttr, value);
|
||||
}
|
||||
|
||||
int HTMLImageElement::x() const
|
||||
{
|
||||
document().updateLayout();
|
||||
RenderObject* r = renderer();
|
||||
if (!r)
|
||||
return 0;
|
||||
|
||||
// FIXME: This doesn't work correctly with transforms.
|
||||
FloatPoint absPos = r->localToAbsolute();
|
||||
return absPos.x();
|
||||
}
|
||||
|
||||
int HTMLImageElement::y() const
|
||||
{
|
||||
document().updateLayout();
|
||||
RenderObject* r = renderer();
|
||||
if (!r)
|
||||
return 0;
|
||||
|
||||
// FIXME: This doesn't work correctly with transforms.
|
||||
FloatPoint absPos = r->localToAbsolute();
|
||||
return absPos.y();
|
||||
}
|
||||
|
||||
bool HTMLImageElement::complete() const
|
||||
{
|
||||
return imageLoader().imageComplete();
|
||||
|
||||
@ -45,9 +45,6 @@ public:
|
||||
|
||||
virtual ~HTMLImageElement();
|
||||
|
||||
int width();
|
||||
int height();
|
||||
|
||||
int naturalWidth() const;
|
||||
int naturalHeight() const;
|
||||
const String& currentSrc() const;
|
||||
@ -55,16 +52,9 @@ public:
|
||||
ImageResource* cachedImage() const { return imageLoader().image(); }
|
||||
void setImageResource(ImageResource* i) { imageLoader().setImage(i); };
|
||||
|
||||
void setHeight(int);
|
||||
|
||||
KURL src() const;
|
||||
void setSrc(const String&);
|
||||
|
||||
void setWidth(int);
|
||||
|
||||
int x() const;
|
||||
int y() const;
|
||||
|
||||
bool complete() const;
|
||||
|
||||
bool hasPendingActivity() const { return imageLoader().hasPendingActivity(); }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user