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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLImageElement.cpp

Issue 2869733004: Fix ImageResourceContent::Create()'s GetContentStatus() (Closed)
Patch Set: Rebase Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 void HTMLImageElement::AttachLayoutTree(const AttachContext& context) { 365 void HTMLImageElement::AttachLayoutTree(const AttachContext& context) {
366 HTMLElement::AttachLayoutTree(context); 366 HTMLElement::AttachLayoutTree(context);
367 if (GetLayoutObject() && GetLayoutObject()->IsImage()) { 367 if (GetLayoutObject() && GetLayoutObject()->IsImage()) {
368 LayoutImage* layout_image = ToLayoutImage(GetLayoutObject()); 368 LayoutImage* layout_image = ToLayoutImage(GetLayoutObject());
369 LayoutImageResource* layout_image_resource = layout_image->ImageResource(); 369 LayoutImageResource* layout_image_resource = layout_image->ImageResource();
370 if (is_fallback_image_) { 370 if (is_fallback_image_) {
371 float device_scale_factor = 371 float device_scale_factor =
372 blink::DeviceScaleFactorDeprecated(layout_image->GetFrame()); 372 blink::DeviceScaleFactorDeprecated(layout_image->GetFrame());
373 std::pair<Image*, float> broken_image_and_image_scale_factor = 373 std::pair<Image*, float> broken_image_and_image_scale_factor =
374 ImageResourceContent::BrokenImage(device_scale_factor); 374 ImageResourceContent::BrokenImage(device_scale_factor);
375 ImageResourceContent* new_image_resource = ImageResourceContent::Create( 375 ImageResourceContent* new_image_resource =
376 broken_image_and_image_scale_factor.first); 376 ImageResourceContent::CreateLoaded(
377 broken_image_and_image_scale_factor.first);
377 layout_image->ImageResource()->SetImageResource(new_image_resource); 378 layout_image->ImageResource()->SetImageResource(new_image_resource);
378 } 379 }
379 if (layout_image_resource->HasImage()) 380 if (layout_image_resource->HasImage())
380 return; 381 return;
381 382
382 if (!GetImageLoader().GetImage() && !layout_image_resource->CachedImage()) 383 if (!GetImageLoader().GetImage() && !layout_image_resource->CachedImage())
383 return; 384 return;
384 layout_image_resource->SetImageResource(GetImageLoader().GetImage()); 385 layout_image_resource->SetImageResource(GetImageLoader().GetImage());
385 } 386 }
386 } 387 }
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 form_->Associate(*this); 819 form_->Associate(*this);
819 form_->DidAssociateByParser(); 820 form_->DidAssociateByParser();
820 } 821 }
821 }; 822 };
822 823
823 FloatSize HTMLImageElement::SourceDefaultObjectSize() { 824 FloatSize HTMLImageElement::SourceDefaultObjectSize() {
824 return FloatSize(width(), height()); 825 return FloatSize(width(), height());
825 } 826 }
826 827
827 } // namespace blink 828 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698