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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 // if the image is available, use its width | 414 // if the image is available, use its width |
415 if (imageLoader().image()) | 415 if (imageLoader().image()) |
416 return imageLoader().image()->imageSizeForRenderer(renderer(), 1.0f)
.width(); | 416 return imageLoader().image()->imageSizeForRenderer(renderer(), 1.0f)
.width(); |
417 } | 417 } |
418 | 418 |
419 if (ignorePendingStylesheets) | 419 if (ignorePendingStylesheets) |
420 document().updateLayoutIgnorePendingStylesheets(); | 420 document().updateLayoutIgnorePendingStylesheets(); |
421 else | 421 else |
422 document().updateLayout(); | 422 document().updateLayout(); |
423 | 423 |
424 RenderBox* box = renderBox(); | 424 LayoutBox* box = layoutBox(); |
425 return box ? adjustForAbsoluteZoom(box->contentBoxRect().pixelSnappedWidth()
, box) : 0; | 425 return box ? adjustForAbsoluteZoom(box->contentBoxRect().pixelSnappedWidth()
, box) : 0; |
426 } | 426 } |
427 | 427 |
428 int HTMLImageElement::height(bool ignorePendingStylesheets) | 428 int HTMLImageElement::height(bool ignorePendingStylesheets) |
429 { | 429 { |
430 if (!renderer()) { | 430 if (!renderer()) { |
431 // check the attribute first for an explicit pixel value | 431 // check the attribute first for an explicit pixel value |
432 bool ok; | 432 bool ok; |
433 int height = getAttribute(heightAttr).toInt(&ok); | 433 int height = getAttribute(heightAttr).toInt(&ok); |
434 if (ok) | 434 if (ok) |
435 return height; | 435 return height; |
436 | 436 |
437 // if the image is available, use its height | 437 // if the image is available, use its height |
438 if (imageLoader().image()) | 438 if (imageLoader().image()) |
439 return imageLoader().image()->imageSizeForRenderer(renderer(), 1.0f)
.height(); | 439 return imageLoader().image()->imageSizeForRenderer(renderer(), 1.0f)
.height(); |
440 } | 440 } |
441 | 441 |
442 if (ignorePendingStylesheets) | 442 if (ignorePendingStylesheets) |
443 document().updateLayoutIgnorePendingStylesheets(); | 443 document().updateLayoutIgnorePendingStylesheets(); |
444 else | 444 else |
445 document().updateLayout(); | 445 document().updateLayout(); |
446 | 446 |
447 RenderBox* box = renderBox(); | 447 LayoutBox* box = layoutBox(); |
448 return box ? adjustForAbsoluteZoom(box->contentBoxRect().pixelSnappedHeight(
), box) : 0; | 448 return box ? adjustForAbsoluteZoom(box->contentBoxRect().pixelSnappedHeight(
), box) : 0; |
449 } | 449 } |
450 | 450 |
451 int HTMLImageElement::naturalWidth() const | 451 int HTMLImageElement::naturalWidth() const |
452 { | 452 { |
453 if (!imageLoader().image()) | 453 if (!imageLoader().image()) |
454 return 0; | 454 return 0; |
455 | 455 |
456 return imageLoader().image()->imageSizeForRenderer(renderer(), 1.0f, ImageRe
source::IntrinsicSize).width(); | 456 return imageLoader().image()->imageSizeForRenderer(renderer(), 1.0f, ImageRe
source::IntrinsicSize).width(); |
457 } | 457 } |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 ensureClosedShadowRoot(); | 726 ensureClosedShadowRoot(); |
727 } | 727 } |
728 | 728 |
729 bool HTMLImageElement::isOpaque() const | 729 bool HTMLImageElement::isOpaque() const |
730 { | 730 { |
731 Image* image = const_cast<HTMLImageElement*>(this)->imageContents(); | 731 Image* image = const_cast<HTMLImageElement*>(this)->imageContents(); |
732 return image && image->currentFrameKnownToBeOpaque(); | 732 return image && image->currentFrameKnownToBeOpaque(); |
733 } | 733 } |
734 | 734 |
735 } | 735 } |
OLD | NEW |