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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 120 } | 120 } |
| 121 | 121 |
| 122 void HTMLImageElement::parseAttribute(const QualifiedName& name, const AtomicStr ing& value) | 122 void HTMLImageElement::parseAttribute(const QualifiedName& name, const AtomicStr ing& value) |
| 123 { | 123 { |
| 124 if (name == altAttr) { | 124 if (name == altAttr) { |
| 125 if (renderer() && renderer()->isImage()) | 125 if (renderer() && renderer()->isImage()) |
| 126 toRenderImage(renderer())->updateAltText(); | 126 toRenderImage(renderer())->updateAltText(); |
| 127 } else if (name == srcAttr || name == srcsetAttr) { | 127 } else if (name == srcAttr || name == srcsetAttr) { |
| 128 if (RuntimeEnabledFeatures::srcsetEnabled()) { | 128 if (RuntimeEnabledFeatures::srcsetEnabled()) { |
| 129 ImageCandidate candidate = bestFitSourceForImageAttributes(document( ).devicePixelRatio(), fastGetAttribute(srcAttr), fastGetAttribute(srcsetAttr)); | 129 ImageCandidate candidate = bestFitSourceForImageAttributes(document( ).devicePixelRatio(), fastGetAttribute(srcAttr), fastGetAttribute(srcsetAttr)); |
| 130 m_bestFitImageURL = candidate.toString(); | 130 m_bestFitImageURL = AtomicString(candidate.toString()); |
|
eseidel
2013/12/31 23:22:35
toAtomicSTring?
| |
| 131 float candidateScaleFactor = candidate.scaleFactor(); | 131 float candidateScaleFactor = candidate.scaleFactor(); |
| 132 if (candidateScaleFactor > 0) | 132 if (candidateScaleFactor > 0) |
| 133 m_imageDevicePixelRatio = 1 / candidateScaleFactor; | 133 m_imageDevicePixelRatio = 1 / candidateScaleFactor; |
| 134 if (renderer() && renderer()->isImage()) | 134 if (renderer() && renderer()->isImage()) |
| 135 toRenderImage(renderer())->setImageDevicePixelRatio(m_imageDevic ePixelRatio); | 135 toRenderImage(renderer())->setImageDevicePixelRatio(m_imageDevic ePixelRatio); |
| 136 } | 136 } |
| 137 m_imageLoader.updateFromElementIgnoringPreviousError(); | 137 m_imageLoader.updateFromElementIgnoringPreviousError(); |
| 138 } | 138 } |
| 139 else if (name == usemapAttr) | 139 else if (name == usemapAttr) |
| 140 setIsLink(!value.isNull()); | 140 setIsLink(!value.isNull()); |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 385 | 385 |
| 386 return m_imageLoader.image()->image(); | 386 return m_imageLoader.image()->image(); |
| 387 } | 387 } |
| 388 | 388 |
| 389 bool HTMLImageElement::isInteractiveContent() const | 389 bool HTMLImageElement::isInteractiveContent() const |
| 390 { | 390 { |
| 391 return fastHasAttribute(usemapAttr); | 391 return fastHasAttribute(usemapAttr); |
| 392 } | 392 } |
| 393 | 393 |
| 394 } | 394 } |
| OLD | NEW |