2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
8 * Copyright (C) 2009, 2010, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2012 Samsung Electronics. All rights reserved.
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
21 * You should have received a copy of the GNU Library General Public License
22 * along with this library; see the file COPYING.LIB. If not, write to
23 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 * Boston, MA 02110-1301, USA.
29 #include "core/html/forms/InputTypeView.h"
31 #include "core/dom/shadow/ShadowRoot.h"
32 #include "core/html/HTMLFormElement.h"
33 #include "core/html/HTMLInputElement.h"
34 #include "core/rendering/RenderObject.h"
38 PassRefPtr<InputTypeView> InputTypeView::create(HTMLInputElement& input)
40 return adoptRef(new InputTypeView(input));
43 InputTypeView::~InputTypeView()
47 bool InputTypeView::sizeShouldIncludeDecoration(int, int& preferredSize) const
49 preferredSize = element().size();
53 void InputTypeView::handleClickEvent(MouseEvent*)
57 void InputTypeView::handleMouseDownEvent(MouseEvent*)
61 void InputTypeView::handleKeydownEvent(KeyboardEvent*)
65 void InputTypeView::handleKeypressEvent(KeyboardEvent*)
69 void InputTypeView::handleKeyupEvent(KeyboardEvent*)
73 void InputTypeView::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*)
77 void InputTypeView::handleTouchEvent(TouchEvent*)
81 void InputTypeView::forwardEvent(Event*)
85 bool InputTypeView::shouldSubmitImplicitly(Event* event)
90 PassRefPtr<HTMLFormElement> InputTypeView::formForSubmission() const
92 return element().form();
95 RenderObject* InputTypeView::createRenderer(RenderStyle* style) const
97 return RenderObject::createObject(&element(), style);
100 PassRefPtr<RenderStyle> InputTypeView::customStyleForRenderer(PassRefPtr<RenderStyle> originalStyle)
102 return originalStyle;
105 void InputTypeView::blur()
107 element().defaultBlur();
110 bool InputTypeView::hasCustomFocusLogic() const
115 void InputTypeView::handleFocusEvent(Element*, FocusType)
119 void InputTypeView::handleBlurEvent()
123 void InputTypeView::startResourceLoading()
127 void InputTypeView::closePopupView()
131 void InputTypeView::createShadowSubtree()
135 void InputTypeView::destroyShadowSubtree()
137 if (ShadowRoot* root = element().userAgentShadowRoot())
138 root->removeChildren();
141 void InputTypeView::altAttributeChanged()
145 void InputTypeView::srcAttributeChanged()
149 void InputTypeView::minOrMaxAttributeChanged()
153 void InputTypeView::stepAttributeChanged()
157 PassOwnPtr<ClickHandlingState> InputTypeView::willDispatchClick()
162 void InputTypeView::didDispatchClick(Event*, const ClickHandlingState&)
166 void InputTypeView::updateView()
170 void InputTypeView::attributeChanged()
174 void InputTypeView::multipleAttributeChanged()
178 void InputTypeView::disabledAttributeChanged()
182 void InputTypeView::readonlyAttributeChanged()
186 void InputTypeView::requiredAttributeChanged()
190 void InputTypeView::valueAttributeChanged()
194 void InputTypeView::subtreeHasChanged()
196 ASSERT_NOT_REACHED();
199 bool InputTypeView::hasTouchEventHandler() const
204 void InputTypeView::listAttributeTargetChanged()
208 void InputTypeView::updateClearButtonVisibility()
212 void InputTypeView::updatePlaceholderText()
216 } // namespace WebCore