diff --git a/engine/core/html/HTMLAttributeNames.in b/engine/core/html/HTMLAttributeNames.in index 5ef314627a3..2949c3d04fd 100644 --- a/engine/core/html/HTMLAttributeNames.in +++ b/engine/core/html/HTMLAttributeNames.in @@ -15,9 +15,7 @@ href # crossorigin -height src -width # as diff --git a/engine/core/html/HTMLImageElement.cpp b/engine/core/html/HTMLImageElement.cpp index 30a0ea1d3ed..bd19fe384ee 100644 --- a/engine/core/html/HTMLImageElement.cpp +++ b/engine/core/html/HTMLImageElement.cpp @@ -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(); diff --git a/engine/core/html/HTMLImageElement.h b/engine/core/html/HTMLImageElement.h index d7d62ef9e24..6167d04006c 100644 --- a/engine/core/html/HTMLImageElement.h +++ b/engine/core/html/HTMLImageElement.h @@ -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(); }