Chromium Code Reviews| 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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 631 } | 631 } |
| 632 | 632 |
| 633 float HTMLImageElement::sourceSize(Element& element) | 633 float HTMLImageElement::sourceSize(Element& element) |
| 634 { | 634 { |
| 635 String sizes = element.fastGetAttribute(sizesAttr); | 635 String sizes = element.fastGetAttribute(sizesAttr); |
| 636 if (!sizes.isNull()) | 636 if (!sizes.isNull()) |
| 637 UseCounter::count(document(), UseCounter::Sizes); | 637 UseCounter::count(document(), UseCounter::Sizes); |
| 638 return SizesAttributeParser(MediaValuesDynamic::create(document()), sizes).l ength(); | 638 return SizesAttributeParser(MediaValuesDynamic::create(document()), sizes).l ength(); |
| 639 } | 639 } |
| 640 | 640 |
| 641 void HTMLImageElement::forceReload() const | |
| 642 { | |
| 643 imageLoader().updateFromElement(ImageLoader::UpdateForcedReload); | |
| 644 } | |
| 645 | |
| 646 const ResourceResponse& HTMLImageElement::getResponse() const | |
| 647 { | |
| 648 if (imageLoader().image()) | |
| 649 return imageLoader().image()->response(); | |
| 650 return 0; | |
|
Nate Chapin
2015/05/05 22:03:49
Nit: ResourceResponse()
megjablon
2015/05/06 18:33:01
This can't be done because it's a local temporary
| |
| 651 } | |
| 652 | |
| 641 void HTMLImageElement::selectSourceURL(ImageLoader::UpdateFromElementBehavior be havior) | 653 void HTMLImageElement::selectSourceURL(ImageLoader::UpdateFromElementBehavior be havior) |
| 642 { | 654 { |
| 643 if (!document().isActive()) | 655 if (!document().isActive()) |
| 644 return; | 656 return; |
| 645 | 657 |
| 646 bool foundURL = false; | 658 bool foundURL = false; |
| 647 if (RuntimeEnabledFeatures::pictureEnabled()) { | 659 if (RuntimeEnabledFeatures::pictureEnabled()) { |
| 648 ImageCandidate candidate = findBestFitImageFromPictureParent(); | 660 ImageCandidate candidate = findBestFitImageFromPictureParent(); |
| 649 if (!candidate.isEmpty()) { | 661 if (!candidate.isEmpty()) { |
| 650 setBestFitURLAndDPRFromImageCandidate(candidate); | 662 setBestFitURLAndDPRFromImageCandidate(candidate); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 724 ensureUserAgentShadowRoot(); | 736 ensureUserAgentShadowRoot(); |
| 725 } | 737 } |
| 726 | 738 |
| 727 bool HTMLImageElement::isOpaque() const | 739 bool HTMLImageElement::isOpaque() const |
| 728 { | 740 { |
| 729 Image* image = const_cast<HTMLImageElement*>(this)->imageContents(); | 741 Image* image = const_cast<HTMLImageElement*>(this)->imageContents(); |
| 730 return image && image->currentFrameKnownToBeOpaque(); | 742 return image && image->currentFrameKnownToBeOpaque(); |
| 731 } | 743 } |
| 732 | 744 |
| 733 } | 745 } |
| OLD | NEW |