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 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. |
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) | 7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) |
8 * Copyright (C) 2010 Google Inc. All rights reserved. | 8 * Copyright (C) 2010 Google Inc. All rights reserved. |
9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 9 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
10 * Copyright (C) 2012 Samsung Electronics. All rights reserved. | 10 * Copyright (C) 2012 Samsung Electronics. All rights reserved. |
(...skipping 29 matching lines...) Expand all Loading... |
40 #include "ExceptionCode.h" | 40 #include "ExceptionCode.h" |
41 #include "FeatureObserver.h" | 41 #include "FeatureObserver.h" |
42 #include "FileInputType.h" | 42 #include "FileInputType.h" |
43 #include "FileList.h" | 43 #include "FileList.h" |
44 #include "FormController.h" | 44 #include "FormController.h" |
45 #include "Frame.h" | 45 #include "Frame.h" |
46 #include "FrameView.h" | 46 #include "FrameView.h" |
47 #include "HTMLCollection.h" | 47 #include "HTMLCollection.h" |
48 #include "HTMLDataListElement.h" | 48 #include "HTMLDataListElement.h" |
49 #include "HTMLFormElement.h" | 49 #include "HTMLFormElement.h" |
| 50 #include "HTMLImageLoader.h" |
50 #include "HTMLNames.h" | 51 #include "HTMLNames.h" |
51 #include "HTMLOptionElement.h" | 52 #include "HTMLOptionElement.h" |
52 #include "HTMLParserIdioms.h" | 53 #include "HTMLParserIdioms.h" |
53 #include "IdTargetObserver.h" | 54 #include "IdTargetObserver.h" |
54 #include "InputType.h" | 55 #include "InputType.h" |
55 #include "InsertionPoint.h" | 56 #include "InsertionPoint.h" |
56 #include "KeyboardEvent.h" | 57 #include "KeyboardEvent.h" |
57 #include "Language.h" | 58 #include "Language.h" |
58 #include "LocalizedStrings.h" | 59 #include "LocalizedStrings.h" |
59 #include "MouseEvent.h" | 60 #include "MouseEvent.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 #endif | 141 #endif |
141 } | 142 } |
142 | 143 |
143 PassRefPtr<HTMLInputElement> HTMLInputElement::create(const QualifiedName& tagNa
me, Document* document, HTMLFormElement* form, bool createdByParser) | 144 PassRefPtr<HTMLInputElement> HTMLInputElement::create(const QualifiedName& tagNa
me, Document* document, HTMLFormElement* form, bool createdByParser) |
144 { | 145 { |
145 RefPtr<HTMLInputElement> inputElement = adoptRef(new HTMLInputElement(tagNam
e, document, form, createdByParser)); | 146 RefPtr<HTMLInputElement> inputElement = adoptRef(new HTMLInputElement(tagNam
e, document, form, createdByParser)); |
146 inputElement->ensureUserAgentShadowRoot(); | 147 inputElement->ensureUserAgentShadowRoot(); |
147 return inputElement.release(); | 148 return inputElement.release(); |
148 } | 149 } |
149 | 150 |
| 151 HTMLImageLoader* HTMLInputElement::imageLoader() |
| 152 { |
| 153 if (!m_imageLoader) |
| 154 m_imageLoader = adoptPtr(new HTMLImageLoader(this)); |
| 155 return m_imageLoader.get(); |
| 156 } |
| 157 |
150 void HTMLInputElement::didAddUserAgentShadowRoot(ShadowRoot*) | 158 void HTMLInputElement::didAddUserAgentShadowRoot(ShadowRoot*) |
151 { | 159 { |
152 m_inputType->createShadowSubtree(); | 160 m_inputType->createShadowSubtree(); |
153 } | 161 } |
154 | 162 |
155 HTMLInputElement::~HTMLInputElement() | 163 HTMLInputElement::~HTMLInputElement() |
156 { | 164 { |
157 if (needsSuspensionCallback()) | 165 if (needsSuspensionCallback()) |
158 document()->unregisterForPageCacheSuspensionCallbacks(this); | 166 document()->unregisterForPageCacheSuspensionCallbacks(this); |
159 | 167 |
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1507 removeFromRadioButtonGroup(); | 1515 removeFromRadioButtonGroup(); |
1508 HTMLTextFormControlElement::removedFrom(insertionPoint); | 1516 HTMLTextFormControlElement::removedFrom(insertionPoint); |
1509 ASSERT(!inDocument()); | 1517 ASSERT(!inDocument()); |
1510 #if ENABLE(DATALIST_ELEMENT) | 1518 #if ENABLE(DATALIST_ELEMENT) |
1511 resetListAttributeTargetObserver(); | 1519 resetListAttributeTargetObserver(); |
1512 #endif | 1520 #endif |
1513 } | 1521 } |
1514 | 1522 |
1515 void HTMLInputElement::didMoveToNewDocument(Document* oldDocument) | 1523 void HTMLInputElement::didMoveToNewDocument(Document* oldDocument) |
1516 { | 1524 { |
1517 m_inputType->willMoveToNewOwnerDocument(); | 1525 if (hasImageLoader()) |
| 1526 imageLoader()->elementDidMoveToNewDocument(); |
| 1527 |
1518 bool needsSuspensionCallback = this->needsSuspensionCallback(); | 1528 bool needsSuspensionCallback = this->needsSuspensionCallback(); |
1519 if (oldDocument) { | 1529 if (oldDocument) { |
1520 // Always unregister for cache callbacks when leaving a document, even i
f we would otherwise like to be registered | 1530 // Always unregister for cache callbacks when leaving a document, even i
f we would otherwise like to be registered |
1521 if (needsSuspensionCallback) | 1531 if (needsSuspensionCallback) |
1522 oldDocument->unregisterForPageCacheSuspensionCallbacks(this); | 1532 oldDocument->unregisterForPageCacheSuspensionCallbacks(this); |
1523 if (isRadioButton()) | 1533 if (isRadioButton()) |
1524 oldDocument->formController()->checkedRadioButtons().removeButton(th
is); | 1534 oldDocument->formController()->checkedRadioButtons().removeButton(th
is); |
1525 #if ENABLE(TOUCH_EVENTS) | 1535 #if ENABLE(TOUCH_EVENTS) |
1526 if (m_hasTouchEventHandler) | 1536 if (m_hasTouchEventHandler) |
1527 oldDocument->didRemoveEventTargetNode(this); | 1537 oldDocument->didRemoveEventTargetNode(this); |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1967 } | 1977 } |
1968 | 1978 |
1969 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) | 1979 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) |
1970 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() | 1980 PassRefPtr<RenderStyle> HTMLInputElement::customStyleForRenderer() |
1971 { | 1981 { |
1972 return m_inputType->customStyleForRenderer(document()->styleResolver()->styl
eForElement(this)); | 1982 return m_inputType->customStyleForRenderer(document()->styleResolver()->styl
eForElement(this)); |
1973 } | 1983 } |
1974 #endif | 1984 #endif |
1975 | 1985 |
1976 } // namespace | 1986 } // namespace |
OLD | NEW |