| 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 | 373 |
| 374 bool imageWasModified = false; | 374 bool imageWasModified = false; |
| 375 if (RuntimeEnabledFeatures::pictureEnabled() && document().isActive()) { | 375 if (RuntimeEnabledFeatures::pictureEnabled() && document().isActive()) { |
| 376 ImageCandidate candidate = findBestFitImageFromPictureParent(); | 376 ImageCandidate candidate = findBestFitImageFromPictureParent(); |
| 377 if (!candidate.isEmpty()) { | 377 if (!candidate.isEmpty()) { |
| 378 setBestFitURLAndDPRFromImageCandidate(candidate); | 378 setBestFitURLAndDPRFromImageCandidate(candidate); |
| 379 imageWasModified = true; | 379 imageWasModified = true; |
| 380 } | 380 } |
| 381 } | 381 } |
| 382 | 382 |
| 383 // If we have been inserted from a renderer-less document, | 383 // If we have been inserted from a layoutObject-less document, |
| 384 // our loader may have not fetched the image, so do it now. | 384 // our loader may have not fetched the image, so do it now. |
| 385 if ((insertionPoint->inDocument() && !imageLoader().image()) || imageWasModi
fied) | 385 if ((insertionPoint->inDocument() && !imageLoader().image()) || imageWasModi
fied) |
| 386 imageLoader().updateFromElement(ImageLoader::UpdateNormal); | 386 imageLoader().updateFromElement(ImageLoader::UpdateNormal); |
| 387 | 387 |
| 388 return HTMLElement::insertedInto(insertionPoint); | 388 return HTMLElement::insertedInto(insertionPoint); |
| 389 } | 389 } |
| 390 | 390 |
| 391 void HTMLImageElement::removedFrom(ContainerNode* insertionPoint) | 391 void HTMLImageElement::removedFrom(ContainerNode* insertionPoint) |
| 392 { | 392 { |
| 393 if (!m_form || NodeTraversal::highestAncestorOrSelf(*m_form.get()) != NodeTr
aversal::highestAncestorOrSelf(*this)) | 393 if (!m_form || NodeTraversal::highestAncestorOrSelf(*m_form.get()) != NodeTr
aversal::highestAncestorOrSelf(*this)) |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 return nullptr; | 586 return nullptr; |
| 587 } | 587 } |
| 588 | 588 |
| 589 if (cachedImage()->errorOccurred()) { | 589 if (cachedImage()->errorOccurred()) { |
| 590 *status = UndecodableSourceImageStatus; | 590 *status = UndecodableSourceImageStatus; |
| 591 return nullptr; | 591 return nullptr; |
| 592 } | 592 } |
| 593 | 593 |
| 594 RefPtr<Image> sourceImage = cachedImage()->imageForLayoutObject(layoutObject
()); | 594 RefPtr<Image> sourceImage = cachedImage()->imageForLayoutObject(layoutObject
()); |
| 595 | 595 |
| 596 // We need to synthesize a container size if a renderer is not available to
provide one. | 596 // We need to synthesize a container size if a layoutObject is not available
to provide one. |
| 597 if (!layoutObject() && sourceImage->usesContainerSize()) | 597 if (!layoutObject() && sourceImage->usesContainerSize()) |
| 598 sourceImage->setContainerSize(sourceImage->size()); | 598 sourceImage->setContainerSize(sourceImage->size()); |
| 599 | 599 |
| 600 *status = NormalSourceImageStatus; | 600 *status = NormalSourceImageStatus; |
| 601 return sourceImage->imageForDefaultFrame(); | 601 return sourceImage->imageForDefaultFrame(); |
| 602 } | 602 } |
| 603 | 603 |
| 604 bool HTMLImageElement::wouldTaintOrigin(SecurityOrigin* destinationSecurityOrigi
n) const | 604 bool HTMLImageElement::wouldTaintOrigin(SecurityOrigin* destinationSecurityOrigi
n) const |
| 605 { | 605 { |
| 606 ImageResource* image = cachedImage(); | 606 ImageResource* image = cachedImage(); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 ensureUserAgentShadowRoot(); | 724 ensureUserAgentShadowRoot(); |
| 725 } | 725 } |
| 726 | 726 |
| 727 bool HTMLImageElement::isOpaque() const | 727 bool HTMLImageElement::isOpaque() const |
| 728 { | 728 { |
| 729 Image* image = const_cast<HTMLImageElement*>(this)->imageContents(); | 729 Image* image = const_cast<HTMLImageElement*>(this)->imageContents(); |
| 730 return image && image->currentFrameKnownToBeOpaque(); | 730 return image && image->currentFrameKnownToBeOpaque(); |
| 731 } | 731 } |
| 732 | 732 |
| 733 } | 733 } |
| OLD | NEW |