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 | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights |
5 * reserved. | 5 * reserved. |
6 * Copyright (C) 2010 Google Inc. All rights reserved. | 6 * Copyright (C) 2010 Google Inc. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 #include "bindings/core/v8/ScriptEventListener.h" | 26 #include "bindings/core/v8/ScriptEventListener.h" |
27 #include "core/CSSPropertyNames.h" | 27 #include "core/CSSPropertyNames.h" |
28 #include "core/HTMLNames.h" | 28 #include "core/HTMLNames.h" |
29 #include "core/MediaTypeNames.h" | 29 #include "core/MediaTypeNames.h" |
30 #include "core/css/MediaQueryMatcher.h" | 30 #include "core/css/MediaQueryMatcher.h" |
31 #include "core/css/MediaValuesDynamic.h" | 31 #include "core/css/MediaValuesDynamic.h" |
32 #include "core/css/parser/SizesAttributeParser.h" | 32 #include "core/css/parser/SizesAttributeParser.h" |
33 #include "core/dom/Attribute.h" | 33 #include "core/dom/Attribute.h" |
34 #include "core/dom/NodeTraversal.h" | 34 #include "core/dom/NodeTraversal.h" |
| 35 #include "core/dom/TaskRunnerHelper.h" |
35 #include "core/dom/shadow/ShadowRoot.h" | 36 #include "core/dom/shadow/ShadowRoot.h" |
36 #include "core/frame/Deprecation.h" | 37 #include "core/frame/Deprecation.h" |
37 #include "core/frame/ImageBitmap.h" | 38 #include "core/frame/ImageBitmap.h" |
38 #include "core/frame/LocalDOMWindow.h" | 39 #include "core/frame/LocalDOMWindow.h" |
39 #include "core/html/FormAssociated.h" | 40 #include "core/html/FormAssociated.h" |
40 #include "core/html/HTMLAnchorElement.h" | 41 #include "core/html/HTMLAnchorElement.h" |
41 #include "core/html/HTMLCanvasElement.h" | 42 #include "core/html/HTMLCanvasElement.h" |
42 #include "core/html/HTMLFormElement.h" | 43 #include "core/html/HTMLFormElement.h" |
43 #include "core/html/HTMLImageFallbackHelper.h" | 44 #include "core/html/HTMLImageFallbackHelper.h" |
44 #include "core/html/HTMLPictureElement.h" | 45 #include "core/html/HTMLPictureElement.h" |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 void HTMLImageElement::AttachLayoutTree(const AttachContext& context) { | 366 void HTMLImageElement::AttachLayoutTree(const AttachContext& context) { |
366 HTMLElement::AttachLayoutTree(context); | 367 HTMLElement::AttachLayoutTree(context); |
367 if (GetLayoutObject() && GetLayoutObject()->IsImage()) { | 368 if (GetLayoutObject() && GetLayoutObject()->IsImage()) { |
368 LayoutImage* layout_image = ToLayoutImage(GetLayoutObject()); | 369 LayoutImage* layout_image = ToLayoutImage(GetLayoutObject()); |
369 LayoutImageResource* layout_image_resource = layout_image->ImageResource(); | 370 LayoutImageResource* layout_image_resource = layout_image->ImageResource(); |
370 if (is_fallback_image_) { | 371 if (is_fallback_image_) { |
371 float device_scale_factor = | 372 float device_scale_factor = |
372 blink::DeviceScaleFactorDeprecated(layout_image->GetFrame()); | 373 blink::DeviceScaleFactorDeprecated(layout_image->GetFrame()); |
373 std::pair<Image*, float> broken_image_and_image_scale_factor = | 374 std::pair<Image*, float> broken_image_and_image_scale_factor = |
374 ImageResourceContent::BrokenImage(device_scale_factor); | 375 ImageResourceContent::BrokenImage(device_scale_factor); |
| 376 RefPtr<WebTaskRunner> task_runner = TaskRunnerHelper::Get( |
| 377 TaskType::kAnimationTimer, &this->GetDocument()); |
375 ImageResourceContent* new_image_resource = ImageResourceContent::Create( | 378 ImageResourceContent* new_image_resource = ImageResourceContent::Create( |
376 broken_image_and_image_scale_factor.first); | 379 task_runner, broken_image_and_image_scale_factor.first); |
377 layout_image->ImageResource()->SetImageResource(new_image_resource); | 380 layout_image->ImageResource()->SetImageResource(new_image_resource); |
378 } | 381 } |
379 if (layout_image_resource->HasImage()) | 382 if (layout_image_resource->HasImage()) |
380 return; | 383 return; |
381 | 384 |
382 if (!GetImageLoader().GetImage() && !layout_image_resource->CachedImage()) | 385 if (!GetImageLoader().GetImage() && !layout_image_resource->CachedImage()) |
383 return; | 386 return; |
384 layout_image_resource->SetImageResource(GetImageLoader().GetImage()); | 387 layout_image_resource->SetImageResource(GetImageLoader().GetImage()); |
385 } | 388 } |
386 } | 389 } |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 form_->Associate(*this); | 821 form_->Associate(*this); |
819 form_->DidAssociateByParser(); | 822 form_->DidAssociateByParser(); |
820 } | 823 } |
821 }; | 824 }; |
822 | 825 |
823 FloatSize HTMLImageElement::SourceDefaultObjectSize() { | 826 FloatSize HTMLImageElement::SourceDefaultObjectSize() { |
824 return FloatSize(width(), height()); | 827 return FloatSize(width(), height()); |
825 } | 828 } |
826 | 829 |
827 } // namespace blink | 830 } // namespace blink |
OLD | NEW |