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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 m_form = form->createWeakPtr(); | 65 m_form = form->createWeakPtr(); |
66 #endif | 66 #endif |
67 m_formWasSetByParser = true; | 67 m_formWasSetByParser = true; |
68 m_form->associate(*this); | 68 m_form->associate(*this); |
69 m_form->didAssociateByParser(); | 69 m_form->didAssociateByParser(); |
70 } | 70 } |
71 } | 71 } |
72 | 72 |
73 PassRefPtrWillBeRawPtr<HTMLImageElement> HTMLImageElement::create(Document& docu
ment) | 73 PassRefPtrWillBeRawPtr<HTMLImageElement> HTMLImageElement::create(Document& docu
ment) |
74 { | 74 { |
75 return adoptRefWillBeRefCountedGarbageCollected(new HTMLImageElement(documen
t)); | 75 return adoptRefWillBeNoop(new HTMLImageElement(document)); |
76 } | 76 } |
77 | 77 |
78 PassRefPtrWillBeRawPtr<HTMLImageElement> HTMLImageElement::create(Document& docu
ment, HTMLFormElement* form, bool createdByParser) | 78 PassRefPtrWillBeRawPtr<HTMLImageElement> HTMLImageElement::create(Document& docu
ment, HTMLFormElement* form, bool createdByParser) |
79 { | 79 { |
80 return adoptRefWillBeRefCountedGarbageCollected(new HTMLImageElement(documen
t, form, createdByParser)); | 80 return adoptRefWillBeNoop(new HTMLImageElement(document, form, createdByPars
er)); |
81 } | 81 } |
82 | 82 |
83 HTMLImageElement::~HTMLImageElement() | 83 HTMLImageElement::~HTMLImageElement() |
84 { | 84 { |
85 #if !ENABLE(OILPAN) | 85 #if !ENABLE(OILPAN) |
86 if (m_form) | 86 if (m_form) |
87 m_form->disassociate(*this); | 87 m_form->disassociate(*this); |
88 #endif | 88 #endif |
89 } | 89 } |
90 | 90 |
91 void HTMLImageElement::trace(Visitor* visitor) | 91 void HTMLImageElement::trace(Visitor* visitor) |
92 { | 92 { |
93 visitor->trace(m_imageLoader); | 93 visitor->trace(m_imageLoader); |
94 visitor->trace(m_form); | 94 visitor->trace(m_form); |
95 HTMLElement::trace(visitor); | 95 HTMLElement::trace(visitor); |
96 } | 96 } |
97 | 97 |
98 PassRefPtrWillBeRawPtr<HTMLImageElement> HTMLImageElement::createForJSConstructo
r(Document& document, int width, int height) | 98 PassRefPtrWillBeRawPtr<HTMLImageElement> HTMLImageElement::createForJSConstructo
r(Document& document, int width, int height) |
99 { | 99 { |
100 RefPtrWillBeRawPtr<HTMLImageElement> image = adoptRefWillBeRefCountedGarbage
Collected(new HTMLImageElement(document)); | 100 RefPtrWillBeRawPtr<HTMLImageElement> image = adoptRefWillBeNoop(new HTMLImag
eElement(document)); |
101 if (width) | 101 if (width) |
102 image->setWidth(width); | 102 image->setWidth(width); |
103 if (height) | 103 if (height) |
104 image->setHeight(height); | 104 image->setHeight(height); |
105 image->m_elementCreatedByParser = false; | 105 image->m_elementCreatedByParser = false; |
106 return image.release(); | 106 return image.release(); |
107 } | 107 } |
108 | 108 |
109 bool HTMLImageElement::isPresentationAttribute(const QualifiedName& name) const | 109 bool HTMLImageElement::isPresentationAttribute(const QualifiedName& name) const |
110 { | 110 { |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 else | 587 else |
588 imageLoader().updateFromElement(); | 588 imageLoader().updateFromElement(); |
589 } | 589 } |
590 | 590 |
591 const KURL& HTMLImageElement::sourceURL() const | 591 const KURL& HTMLImageElement::sourceURL() const |
592 { | 592 { |
593 return cachedImage()->response().url(); | 593 return cachedImage()->response().url(); |
594 } | 594 } |
595 | 595 |
596 } | 596 } |
OLD | NEW |