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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 392 if ((insertionPoint->isConnected() && !imageLoader().image()) || imageWasMod ified) | 392 if ((insertionPoint->isConnected() && !imageLoader().image()) || imageWasMod ified) |
| 393 imageLoader().updateFromElement(ImageLoader::UpdateNormal, m_referrerPol icy); | 393 imageLoader().updateFromElement(ImageLoader::UpdateNormal, m_referrerPol icy); |
| 394 | 394 |
| 395 return HTMLElement::insertedInto(insertionPoint); | 395 return HTMLElement::insertedInto(insertionPoint); |
| 396 } | 396 } |
| 397 | 397 |
| 398 void HTMLImageElement::removedFrom(ContainerNode* insertionPoint) | 398 void HTMLImageElement::removedFrom(ContainerNode* insertionPoint) |
| 399 { | 399 { |
| 400 if (!m_form || NodeTraversal::highestAncestorOrSelf(*m_form.get()) != NodeTr aversal::highestAncestorOrSelf(*this)) | 400 if (!m_form || NodeTraversal::highestAncestorOrSelf(*m_form.get()) != NodeTr aversal::highestAncestorOrSelf(*this)) |
| 401 resetFormOwner(); | 401 resetFormOwner(); |
| 402 if (m_listener) | 402 if (m_listener) { |
| 403 document().mediaQueryMatcher().removeViewportListener(m_listener); | 403 document().mediaQueryMatcher().removeViewportListener(m_listener); |
| 404 if (m_source) | |
| 405 m_source->notifyImgSiblingRemoved(); | |
|
cbiesinger
2016/08/17 19:32:05
What about the <source> elements that were not cho
Yoav Weiss
2016/08/30 07:37:07
Good call. I'll add that.
| |
| 406 } | |
| 404 HTMLElement::removedFrom(insertionPoint); | 407 HTMLElement::removedFrom(insertionPoint); |
| 405 } | 408 } |
| 406 | 409 |
| 407 int HTMLImageElement::width() | 410 int HTMLImageElement::width() |
| 408 { | 411 { |
| 409 if (inActiveDocument()) | 412 if (inActiveDocument()) |
| 410 document().updateStyleAndLayoutIgnorePendingStylesheets(); | 413 document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| 411 | 414 |
| 412 if (!layoutObject()) { | 415 if (!layoutObject()) { |
| 413 // check the attribute first for an explicit pixel value | 416 // check the attribute first for an explicit pixel value |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 827 { | 830 { |
| 828 ImageResource* image = cachedImage(); | 831 ImageResource* image = cachedImage(); |
| 829 if (!image) | 832 if (!image) |
| 830 return IntSize(); | 833 return IntSize(); |
| 831 LayoutSize lSize = image->imageSize(LayoutObject::shouldRespectImageOrientat ion(layoutObject()), 1.0f); | 834 LayoutSize lSize = image->imageSize(LayoutObject::shouldRespectImageOrientat ion(layoutObject()), 1.0f); |
| 832 ASSERT(lSize.fraction().isZero()); | 835 ASSERT(lSize.fraction().isZero()); |
| 833 return IntSize(lSize.width(), lSize.height()); | 836 return IntSize(lSize.width(), lSize.height()); |
| 834 } | 837 } |
| 835 | 838 |
| 836 } // namespace blink | 839 } // namespace blink |
| OLD | NEW |