| 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 | 342 |
| 343 if (m_useFallbackContent) | 343 if (m_useFallbackContent) |
| 344 return new LayoutBlockFlow(this); | 344 return new LayoutBlockFlow(this); |
| 345 | 345 |
| 346 LayoutImage* image = new LayoutImage(this); | 346 LayoutImage* image = new LayoutImage(this); |
| 347 image->setImageResource(LayoutImageResource::create()); | 347 image->setImageResource(LayoutImageResource::create()); |
| 348 image->setImageDevicePixelRatio(m_imageDevicePixelRatio); | 348 image->setImageDevicePixelRatio(m_imageDevicePixelRatio); |
| 349 return image; | 349 return image; |
| 350 } | 350 } |
| 351 | 351 |
| 352 void HTMLImageElement::attach(const AttachContext& context) | 352 void HTMLImageElement::attachLayoutTree(const AttachContext& context) |
| 353 { | 353 { |
| 354 HTMLElement::attach(context); | 354 HTMLElement::attachLayoutTree(context); |
| 355 | 355 |
| 356 if (layoutObject() && layoutObject()->isImage()) { | 356 if (layoutObject() && layoutObject()->isImage()) { |
| 357 LayoutImage* layoutImage = toLayoutImage(layoutObject()); | 357 LayoutImage* layoutImage = toLayoutImage(layoutObject()); |
| 358 LayoutImageResource* layoutImageResource = layoutImage->imageResource(); | 358 LayoutImageResource* layoutImageResource = layoutImage->imageResource(); |
| 359 if (m_isFallbackImage) { | 359 if (m_isFallbackImage) { |
| 360 float deviceScaleFactor = blink::deviceScaleFactor(layoutImage->fram
e()); | 360 float deviceScaleFactor = blink::deviceScaleFactor(layoutImage->fram
e()); |
| 361 std::pair<Image*, float> brokenImageAndImageScaleFactor = ImageResou
rce::brokenImage(deviceScaleFactor); | 361 std::pair<Image*, float> brokenImageAndImageScaleFactor = ImageResou
rce::brokenImage(deviceScaleFactor); |
| 362 ImageResource* newImageResource = ImageResource::create(brokenImageA
ndImageScaleFactor.first); | 362 ImageResource* newImageResource = ImageResource::create(brokenImageA
ndImageScaleFactor.first); |
| 363 layoutImage->imageResource()->setImageResource(newImageResource); | 363 layoutImage->imageResource()->setImageResource(newImageResource); |
| 364 } | 364 } |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 { | 827 { |
| 828 ImageResource* image = cachedImage(); | 828 ImageResource* image = cachedImage(); |
| 829 if (!image) | 829 if (!image) |
| 830 return IntSize(); | 830 return IntSize(); |
| 831 LayoutSize lSize = image->imageSize(LayoutObject::shouldRespectImageOrientat
ion(layoutObject()), 1.0f); | 831 LayoutSize lSize = image->imageSize(LayoutObject::shouldRespectImageOrientat
ion(layoutObject()), 1.0f); |
| 832 ASSERT(lSize.fraction().isZero()); | 832 ASSERT(lSize.fraction().isZero()); |
| 833 return IntSize(lSize.width(), lSize.height()); | 833 return IntSize(lSize.width(), lSize.height()); |
| 834 } | 834 } |
| 835 | 835 |
| 836 } // namespace blink | 836 } // namespace blink |
| OLD | NEW |