Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: sky/engine/core/html/HTMLImageElement.cpp

Issue 1055323002: Remove the x,y,width,height methods from HTMLImageElement. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: remove attrs Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/html/HTMLImageElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/html/HTMLImageElement.cpp
diff --git a/sky/engine/core/html/HTMLImageElement.cpp b/sky/engine/core/html/HTMLImageElement.cpp
index 30a0ea1d3ed9a358bc5c90893a845b934354c0a1..bd19fe384eeff46b982aaef0cff52b44a95acb4e 100644
--- a/sky/engine/core/html/HTMLImageElement.cpp
+++ b/sky/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();
« no previous file with comments | « sky/engine/core/html/HTMLImageElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698