| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv
ed. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv
ed. |
| 5 * Copyright (C) 2010 Google Inc. All rights reserved. | 5 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 if (imageLoader().image()) | 243 if (imageLoader().image()) |
| 244 return imageLoader().image()->imageSizeForRenderer(renderer(), 1.0f)
.width(); | 244 return imageLoader().image()->imageSizeForRenderer(renderer(), 1.0f)
.width(); |
| 245 } | 245 } |
| 246 | 246 |
| 247 if (ignorePendingStylesheets) | 247 if (ignorePendingStylesheets) |
| 248 document().updateLayoutIgnorePendingStylesheets(); | 248 document().updateLayoutIgnorePendingStylesheets(); |
| 249 else | 249 else |
| 250 document().updateLayout(); | 250 document().updateLayout(); |
| 251 | 251 |
| 252 RenderBox* box = renderBox(); | 252 RenderBox* box = renderBox(); |
| 253 return box ? adjustForAbsoluteZoom(box->contentBoxRect().pixelSnappedWidth()
, box) : 0; | 253 return box ? box->contentBoxRect().pixelSnappedWidth() : 0; |
| 254 } | 254 } |
| 255 | 255 |
| 256 int HTMLImageElement::height(bool ignorePendingStylesheets) | 256 int HTMLImageElement::height(bool ignorePendingStylesheets) |
| 257 { | 257 { |
| 258 if (!renderer()) { | 258 if (!renderer()) { |
| 259 // check the attribute first for an explicit pixel value | 259 // check the attribute first for an explicit pixel value |
| 260 bool ok; | 260 bool ok; |
| 261 int height = getAttribute(HTMLNames::heightAttr).toInt(&ok); | 261 int height = getAttribute(HTMLNames::heightAttr).toInt(&ok); |
| 262 if (ok) | 262 if (ok) |
| 263 return height; | 263 return height; |
| 264 | 264 |
| 265 // if the image is available, use its height | 265 // if the image is available, use its height |
| 266 if (imageLoader().image()) | 266 if (imageLoader().image()) |
| 267 return imageLoader().image()->imageSizeForRenderer(renderer(), 1.0f)
.height(); | 267 return imageLoader().image()->imageSizeForRenderer(renderer(), 1.0f)
.height(); |
| 268 } | 268 } |
| 269 | 269 |
| 270 if (ignorePendingStylesheets) | 270 if (ignorePendingStylesheets) |
| 271 document().updateLayoutIgnorePendingStylesheets(); | 271 document().updateLayoutIgnorePendingStylesheets(); |
| 272 else | 272 else |
| 273 document().updateLayout(); | 273 document().updateLayout(); |
| 274 | 274 |
| 275 RenderBox* box = renderBox(); | 275 RenderBox* box = renderBox(); |
| 276 return box ? adjustForAbsoluteZoom(box->contentBoxRect().pixelSnappedHeight(
), box) : 0; | 276 return box ? box->contentBoxRect().pixelSnappedHeight() : 0; |
| 277 } | 277 } |
| 278 | 278 |
| 279 int HTMLImageElement::naturalWidth() const | 279 int HTMLImageElement::naturalWidth() const |
| 280 { | 280 { |
| 281 if (!imageLoader().image()) | 281 if (!imageLoader().image()) |
| 282 return 0; | 282 return 0; |
| 283 | 283 |
| 284 return imageLoader().image()->imageSizeForRenderer(renderer(), 1.0f, ImageRe
source::IntrinsicSize).width(); | 284 return imageLoader().image()->imageSizeForRenderer(renderer(), 1.0f, ImageRe
source::IntrinsicSize).width(); |
| 285 } | 285 } |
| 286 | 286 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 } | 439 } |
| 440 imageLoader().updateFromElement(behavior); | 440 imageLoader().updateFromElement(behavior); |
| 441 } | 441 } |
| 442 | 442 |
| 443 const KURL& HTMLImageElement::sourceURL() const | 443 const KURL& HTMLImageElement::sourceURL() const |
| 444 { | 444 { |
| 445 return cachedImage()->response().url(); | 445 return cachedImage()->response().url(); |
| 446 } | 446 } |
| 447 | 447 |
| 448 } | 448 } |
| OLD | NEW |