Commit fa92d361 authored by rniwa@webkit.org's avatar rniwa@webkit.org

Unreviewed, rolling out r94142, r94144, r94145, and r94148.

http://trac.webkit.org/changeset/94142
http://trac.webkit.org/changeset/94144
http://trac.webkit.org/changeset/94145
http://trac.webkit.org/changeset/94148
https://bugs.webkit.org/show_bug.cgi?id=67262

Broke isindex element (Requested by rniwa on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2011-08-30

Source/WebCore: 

* WebCore.order:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isPasswordField):
(WebCore::AccessibilityRenderObject::isIndeterminate):
(WebCore::AccessibilityRenderObject::isNativeCheckboxOrRadio):
(WebCore::AccessibilityRenderObject::isChecked):
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::canShareStyleWithControl):
(WebCore::CSSStyleSelector::adjustRenderStyle):
(WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
(WebCore::CSSStyleSelector::applyProperty):
* dom/CheckedRadioButtons.cpp:
(WebCore::CheckedRadioButtons::addButton):
(WebCore::CheckedRadioButtons::removeButton):
* dom/Node.cpp:
(WebCore::Node::toInputElement):
* dom/Node.h:
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::isInPasswordField):
* html/HTMLInputElement.h:
(WebCore::HTMLInputElement::toInputElement):
* html/shadow/SliderThumbElement.cpp:
(WebCore::sliderThumbElementOf):
(WebCore::RenderSliderThumb::layout):
(WebCore::RenderSliderContainer::layout):
(WebCore::SliderThumbElement::hostInput):
(WebCore::trackLimiterElementOf):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::SearchFieldResultsButtonElement::shadowPseudoId):
(WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
(WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
(WebCore::SpinButtonElement::defaultEventHandler):
(WebCore::SpinButtonElement::repeatingTimerFired):
(WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
(WebCore::InputFieldSpeechButtonElement::setRecognitionResult):
* page/DragController.cpp:
(WebCore::asFileInput):
* platform/efl/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::paintThemePart):
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine):
(WebCore::RenderTextControlSingleLine::inputElement):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::isChecked):
(WebCore::RenderTheme::isIndeterminate):

Source/WebKit/chromium: 

* src/EditorClientImpl.cpp:
(WebKit::EditorClientImpl::textFieldDidEndEditing):
(WebKit::EditorClientImpl::doTextFieldCommandFromEvent):
* src/WebInputElement.cpp:
(WebKit::toWebInputElement):
* src/WebPasswordFormUtils.cpp:
(WebKit::findPasswordFormFields):

Source/WebKit/gtk: 

* WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
(DumpRenderTreeSupportGtk::setAutofilled):
(DumpRenderTreeSupportGtk::setValueForUser):

Source/WebKit/qt: 

* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::setAutofilled):
(DumpRenderTreeSupportQt::setValueForUser):
(DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent af0a0b07
2011-08-30 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r94142, r94144, r94145, and r94148.
http://trac.webkit.org/changeset/94142
http://trac.webkit.org/changeset/94144
http://trac.webkit.org/changeset/94145
http://trac.webkit.org/changeset/94148
https://bugs.webkit.org/show_bug.cgi?id=67262
Broke isindex element (Requested by rniwa on #webkit).
* WebCore.order:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isPasswordField):
(WebCore::AccessibilityRenderObject::isIndeterminate):
(WebCore::AccessibilityRenderObject::isNativeCheckboxOrRadio):
(WebCore::AccessibilityRenderObject::isChecked):
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::canShareStyleWithControl):
(WebCore::CSSStyleSelector::adjustRenderStyle):
(WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector):
(WebCore::CSSStyleSelector::applyProperty):
* dom/CheckedRadioButtons.cpp:
(WebCore::CheckedRadioButtons::addButton):
(WebCore::CheckedRadioButtons::removeButton):
* dom/Node.cpp:
(WebCore::Node::toInputElement):
* dom/Node.h:
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::isInPasswordField):
* html/HTMLInputElement.h:
(WebCore::HTMLInputElement::toInputElement):
* html/shadow/SliderThumbElement.cpp:
(WebCore::sliderThumbElementOf):
(WebCore::RenderSliderThumb::layout):
(WebCore::RenderSliderContainer::layout):
(WebCore::SliderThumbElement::hostInput):
(WebCore::trackLimiterElementOf):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::SearchFieldResultsButtonElement::shadowPseudoId):
(WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
(WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
(WebCore::SpinButtonElement::defaultEventHandler):
(WebCore::SpinButtonElement::repeatingTimerFired):
(WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
(WebCore::InputFieldSpeechButtonElement::setRecognitionResult):
* page/DragController.cpp:
(WebCore::asFileInput):
* platform/efl/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::paintThemePart):
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine):
(WebCore::RenderTextControlSingleLine::inputElement):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::isChecked):
(WebCore::RenderTheme::isIndeterminate):
2011-08-30 David Levin <levin@chromium.org>
Quick fix for crashing tests caused by r94142.
......@@ -3223,6 +3223,7 @@ __ZN3WTF9HashTableIPNS_16AtomicStringImplES2_NS_17IdentityExtractorIS2_EENS_7Ptr
__ZN3WTF9HashTableIPNS_16AtomicStringImplES2_NS_17IdentityExtractorIS2_EENS_7PtrHashIS2_EENS_10HashTraitsIS2_EES8_E4findIS2_NS_22IdentityHashTranslatorIS2_S2_S6_EEEENS_17HashTableIteratorIS2_S2_S4_S6_S8_S8_EERKT_
__ZN7WebCore11CSSSelector8pseudoIdENS0_10PseudoTypeE
__ZNK7WebCore22HTMLFormControlElement20isFormControlElementEv
__ZN7WebCore16HTMLInputElement14toInputElementEv
__ZNK7WebCore22HTMLFormControlElement20isEnabledFormControlEv
__ZNK7WebCore22HTMLFormControlElement8disabledEv
__ZNK7WebCore4Node15rareDataFocusedEv
......@@ -4241,6 +4242,7 @@ __ZN3WTF9HashTableINS_6StringESt4pairIS1_N7WebCore17AccessibilityRoleEENS_18Pair
__ZN3WTF9HashTableINS_6StringESt4pairIS1_N7WebCore17AccessibilityRoleEENS_18PairFirstExtractorIS5_EENS_15CaseFoldingHashENS_14PairHashTraitsINS_10HashTraitsIS1_EENSA_IS4_EEEESB_E3addIS1_S4_NS_17HashMapTranslatorIS5_SD_S8_EEEES2_INS_17HashTableIteratorIS1_S5_S7_S8_SD_SB_EEbERKT_RKT0_
__ZN3WTF9HashTableINS_6StringESt4pairIS1_N7WebCore17AccessibilityRoleEENS_18PairFirstExtractorIS5_EENS_15CaseFoldingHashENS_14PairHashTraitsINS_10HashTraitsIS1_EENSA_IS4_EEEESB_E6lookupIS1_NS_22IdentityHashTranslatorIS1_S5_S8_EEEEPS5_RKT_
__ZN3WTF9HashTableINS_6StringESt4pairIS1_N7WebCore17AccessibilityRoleEENS_18PairFirstExtractorIS5_EENS_15CaseFoldingHashENS_14PairHashTraitsINS_10HashTraitsIS1_EENSA_IS4_EEEESB_E6rehashEi
__ZN7WebCore4Node14toInputElementEv
__ZNK7WebCore13RootInlineBox19lineBreakBidiStatusEv
__ZNK7WebCore13InlineFlowBox13lastLeafChildEv
__ZNK7WebCore9InlineBox6isLeafEv
......@@ -615,8 +615,11 @@ void AXObjectCache::textMarkerDataForVisiblePosition(TextMarkerData& textMarkerD
if (!domNode)
return;
if (domNode->isHTMLElement() && domNode->hasTagName(inputTag) && toHTMLInputElement(domNode)->isPasswordField())
return;
if (domNode->isHTMLElement()) {
HTMLInputElement* inputElement = domNode->toInputElement();
if (inputElement && inputElement->isPasswordField())
return;
}
// locate the renderer, which must exist for a visible dom node
RenderObject* renderer = domNode->renderer();
......
......@@ -494,12 +494,16 @@ bool AccessibilityRenderObject::isAttachment() const
bool AccessibilityRenderObject::isPasswordField() const
{
ASSERT(m_renderer);
if (!m_renderer->node() || !m_renderer->node()->hasTagName(inputTag))
if (!m_renderer->node() || !m_renderer->node()->isHTMLElement())
return false;
if (ariaRoleAttribute() != UnknownRole)
return false;
return toHTMLInputElement(m_renderer->node())->isPasswordField();
HTMLInputElement* inputElement = m_renderer->node()->toInputElement();
if (!inputElement)
return false;
return inputElement->isPasswordField();
}
bool AccessibilityRenderObject::isFileUploadButton() const
......@@ -585,20 +589,26 @@ bool AccessibilityRenderObject::isPressed() const
bool AccessibilityRenderObject::isIndeterminate() const
{
ASSERT(m_renderer);
if (!m_renderer->node() || !m_renderer->node()->hasTagName(inputTag))
if (!m_renderer->node())
return false;
return toHTMLInputElement(m_renderer->node())->isIndeterminate();
HTMLInputElement* inputElement = m_renderer->node()->toInputElement();
if (!inputElement)
return false;
return inputElement->isIndeterminate();
}
bool AccessibilityRenderObject::isNativeCheckboxOrRadio() const
{
ASSERT(m_renderer);
if (!m_renderer->node() || !m_renderer->node()->hasTagName(inputTag))
return false;
HTMLInputElement* input = toHTMLInputElement(m_renderer->node());
return input->isCheckbox() || input->isRadioButton();
Node* elementNode = node();
if (elementNode) {
HTMLInputElement* input = elementNode->toInputElement();
if (input)
return input->isCheckbox() || input->isRadioButton();
}
return false;
}
bool AccessibilityRenderObject::isChecked() const
......@@ -608,8 +618,9 @@ bool AccessibilityRenderObject::isChecked() const
return false;
// First test for native checkedness semantics
if (m_renderer->node()->hasTagName(inputTag))
return toHTMLInputElement(m_renderer->node())->shouldAppearChecked();
HTMLInputElement* inputElement = m_renderer->node()->toInputElement();
if (inputElement)
return inputElement->shouldAppearChecked();
// Else, if this is an ARIA checkbox or radio, respect the aria-checked attribute
AccessibilityRole ariaRole = ariaRoleAttribute();
......
......@@ -959,14 +959,12 @@ bool CSSStyleSelector::canShareStyleWithControl(StyledElement* element) const
return true;
}
#endif
ASSERT(element);
ASSERT(m_element);
if (!element->hasTagName(inputTag) || !m_element->hasTagName(inputTag))
return false;
HTMLInputElement* thisInputElement = toHTMLInputElement(element);
HTMLInputElement* otherInputElement = toHTMLInputElement(m_element);
HTMLInputElement* thisInputElement = element->toInputElement();
HTMLInputElement* otherInputElement = m_element->toInputElement();
if (!thisInputElement || !otherInputElement)
return false;
if (thisInputElement->isAutofilled() != otherInputElement->isAutofilled())
return false;
......@@ -1895,7 +1893,7 @@ void CSSStyleSelector::adjustRenderStyle(RenderStyle* style, RenderStyle* parent
if (e && e->isFormControlElement() && style->fontSize() >= 11) {
// Don't apply intrinsic margins to image buttons. The designer knows how big the images are,
// so we have to treat all image buttons as though they were explicitly sized.
if (!e->hasTagName(inputTag) || !toHTMLInputElement(e)->isImageButton())
if (!e->hasTagName(inputTag) || !static_cast<HTMLInputElement*>(e)->isImageButton())
addIntrinsicMargins(style);
}
......@@ -2759,9 +2757,10 @@ bool CSSStyleSelector::SelectorChecker::checkOneSelector(CSSSelector* sel, Eleme
return true;
break;
case CSSSelector::PseudoAutofill: {
if (!e || !e->isFormControlElement() || !e->hasTagName(inputTag))
if (!e || !e->isFormControlElement())
break;
return toHTMLInputElement(e)->isAutofilled();
if (HTMLInputElement* inputElement = e->toInputElement())
return inputElement->isAutofilled();
break;
}
case CSSSelector::PseudoLink:
......@@ -2848,20 +2847,20 @@ bool CSSStyleSelector::SelectorChecker::checkOneSelector(CSSSelector* sel, Eleme
e->document()->setContainsValidityStyleRules();
return (e->willValidate() && !e->isValidFormControlElement()) || e->hasUnacceptableValue();
} case CSSSelector::PseudoChecked: {
if (!e || !e->isFormControlElement() || !e->hasTagName(inputTag))
if (!e || !e->isFormControlElement())
break;
// Even though WinIE allows checked and indeterminate to co-exist, the CSS selector spec says that
// you can't be both checked and indeterminate. We will behave like WinIE behind the scenes and just
// obey the CSS spec here in the test for matching the pseudo.
HTMLInputElement* inputElement = toHTMLInputElement(e);
if (inputElement->shouldAppearChecked() && !inputElement->isIndeterminate())
HTMLInputElement* inputElement = e->toInputElement();
if (inputElement && inputElement->shouldAppearChecked() && !inputElement->isIndeterminate())
return true;
break;
}
case CSSSelector::PseudoIndeterminate: {
if (!e || !e->isFormControlElement())
break;
#if ENABLE(PROGRESS_TAG)
if (e->hasTagName(progressTag)) {
HTMLProgressElement* progress = static_cast<HTMLProgressElement*>(e);
......@@ -2870,8 +2869,9 @@ bool CSSStyleSelector::SelectorChecker::checkOneSelector(CSSSelector* sel, Eleme
break;
}
#endif
if (e->hasTagName(inputTag) && toHTMLInputElement(e)->isIndeterminate())
HTMLInputElement* inputElement = e->toInputElement();
if (inputElement && inputElement->isIndeterminate())
return true;
break;
}
......@@ -4844,7 +4844,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
case CSSPropertyWapInputFormat:
if (primitiveValue && m_element->hasTagName(WebCore::inputTag)) {
String mask = primitiveValue->getStringValue();
toHTMLInputElement(m_element)->setWapInputFormat(mask);
static_cast<HTMLInputElement*>(m_element)->setWapInputFormat(mask);
}
return;
......
......@@ -35,7 +35,7 @@ void CheckedRadioButtons::addButton(HTMLFormControlElement* element)
if (element->name().isEmpty())
return;
HTMLInputElement* inputElement = toHTMLInputElement(element);
HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(element);
// We only track checked buttons.
if (!inputElement->checked())
......@@ -77,7 +77,7 @@ void CheckedRadioButtons::removeButton(HTMLFormControlElement* element)
if (it == m_nameToCheckedRadioButtonMap->end() || it->second != element)
return;
HTMLInputElement* inputElement = toHTMLInputElement(element);
HTMLInputElement* inputElement = element->toInputElement();
ASSERT_UNUSED(inputElement, inputElement);
ASSERT(inputElement->shouldAppearChecked());
ASSERT(element->isRadioButton());
......
......@@ -577,6 +577,15 @@ void Node::setShadowHost(Element* host)
setParent(host);
}
HTMLInputElement* Node::toInputElement()
{
// If one of the below ASSERTs trigger, you are calling this function
// directly or indirectly from a constructor or destructor of this object.
// Don't do this!
ASSERT(!(isHTMLElement() && hasTagName(inputTag)));
return 0;
}
short Node::tabIndex() const
{
return hasRareData() ? rareData()->tabIndex() : 0;
......
......@@ -533,6 +533,8 @@ public:
virtual Node* toNode() { return this; }
virtual HTMLInputElement* toInputElement();
virtual ScriptExecutionContext* scriptExecutionContext() const;
virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<EventListener>, bool useCapture);
......
......@@ -1522,7 +1522,7 @@ bool FrameSelection::setSelectedRange(Range* range, EAffinity affinity, bool clo
bool FrameSelection::isInPasswordField() const
{
HTMLTextFormControlElement* textControl = enclosingTextFormControl(start());
return textControl && textControl->hasTagName(inputTag) && toHTMLInputElement(textControl)->isPasswordField();
return textControl && textControl->hasTagName(inputTag) && static_cast<HTMLInputElement*>(textControl)->isPasswordField();
}
void FrameSelection::focusedOrActiveStateChanged()
......
......@@ -24,7 +24,6 @@
#ifndef HTMLInputElement_h
#define HTMLInputElement_h
#include "HTMLNames.h"
#include "HTMLTextFormControlElement.h"
namespace WebCore {
......@@ -43,6 +42,8 @@ public:
DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitspeechchange);
virtual HTMLInputElement* toInputElement() { return this; }
virtual bool shouldAutocomplete() const;
// For ValidityState
......@@ -356,12 +357,6 @@ private:
OwnPtr<InputType> m_inputType;
};
inline HTMLInputElement* toHTMLInputElement(Node* node)
{
ASSERT(!node || node->hasTagName(HTMLNames::inputTag));
return static_cast<HTMLInputElement*>(node);
}
} //namespace
#endif
......@@ -37,7 +37,6 @@
#include "Event.h"
#include "Frame.h"
#include "HTMLInputElement.h"
#include "HTMLNames.h"
#include "HTMLParserIdioms.h"
#include "MouseEvent.h"
#include "RenderDeprecatedFlexibleBox.h"
......@@ -67,8 +66,7 @@ inline static bool hasVerticalAppearance(HTMLInputElement* input)
SliderThumbElement* sliderThumbElementOf(Node* node)
{
ASSERT(node);
ASSERT(node->hasTagName(HTMLNames::inputTag));
ShadowRoot* shadow = toHTMLInputElement(node)->shadowRoot();
ShadowRoot* shadow = node->toInputElement()->shadowRoot();
ASSERT(shadow);
Node* thumb = shadow->firstChild()->firstChild()->firstChild();
ASSERT(thumb);
......@@ -105,8 +103,7 @@ void RenderSliderThumb::layout()
{
// Do not cast node() to SliderThumbElement. This renderer is used for
// TrackLimitElement too.
ASSERT(node()->shadowAncestorNode()->hasTagName(HTMLNames::inputTag));
HTMLInputElement* input = toHTMLInputElement(node()->shadowAncestorNode());
HTMLInputElement* input = node()->shadowAncestorNode()->toInputElement();
bool isVertical = style()->appearance() == SliderThumbVerticalPart || style()->appearance() == MediaVolumeSliderThumbPart;
double fraction = sliderPosition(input) * 100;
......@@ -135,8 +132,7 @@ private:
void RenderSliderContainer::layout()
{
ASSERT(node()->shadowAncestorNode()->hasTagName(HTMLNames::inputTag));
HTMLInputElement* input = toHTMLInputElement(node()->shadowAncestorNode());
HTMLInputElement* input = node()->shadowAncestorNode()->toInputElement();
bool isVertical = hasVerticalAppearance(input);
style()->setBoxOrient(isVertical ? VERTICAL : HORIZONTAL);
// Sets the concrete height if the height of the <input> is not fixed or a
......@@ -317,8 +313,7 @@ HTMLInputElement* SliderThumbElement::hostInput() const
{
// Only HTMLInputElement creates SliderThumbElement instances as its shadow nodes.
// So, shadowAncestorNode() must be an HTMLInputElement.
ASSERT(shadowAncestorNode()->hasTagName(HTMLNames::inputTag));
return toHTMLInputElement(shadowAncestorNode());
return shadowAncestorNode()->toInputElement();
}
const AtomicString& SliderThumbElement::shadowPseudoId() const
......@@ -356,8 +351,7 @@ const AtomicString& TrackLimiterElement::shadowPseudoId() const
TrackLimiterElement* trackLimiterElementOf(Node* node)
{
ASSERT(node);
ASSERT(node->hasTagName(HTMLNames::inputTag));
ShadowRoot* shadow = toHTMLInputElement(node)->shadowRoot();
ShadowRoot* shadow = node->toInputElement()->shadowRoot();
ASSERT(shadow);
Node* limiter = shadow->firstChild()->lastChild();
ASSERT(limiter);
......
......@@ -128,21 +128,22 @@ const AtomicString& SearchFieldResultsButtonElement::shadowPseudoId() const
DEFINE_STATIC_LOCAL(AtomicString, resultsDecorationId, ("-webkit-search-results-decoration"));
DEFINE_STATIC_LOCAL(AtomicString, decorationId, ("-webkit-search-decoration"));
Node* host = shadowAncestorNode();
if (!host || !host->hasTagName(inputTag))
if (!host)
return resultsId;
int maxResults = toHTMLInputElement(host)->maxResults();
if (maxResults < 0)
return decorationId;
if (maxResults > 0)
return resultsId;
return resultsDecorationId;
if (HTMLInputElement* input = host->toInputElement()) {
if (input->maxResults() < 0)
return decorationId;
if (input->maxResults() > 0)
return resultsId;
return resultsDecorationId;
}
return resultsId;
}
void SearchFieldResultsButtonElement::defaultEventHandler(Event* event)
{
// On mousedown, bring up a menu, if needed
HTMLInputElement* input = toHTMLInputElement(shadowAncestorNode());
HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());
if (event->type() == eventNames().mousedownEvent && event->isMouseEvent() && static_cast<MouseEvent*>(event)->button() == LeftButton) {
input->focus();
input->select();
......@@ -190,7 +191,7 @@ void SearchFieldCancelButtonElement::detach()
void SearchFieldCancelButtonElement::defaultEventHandler(Event* event)
{
// If the element is visible, on mouseup, clear the value, and set selection
RefPtr<HTMLInputElement> input(toHTMLInputElement(shadowAncestorNode()));
RefPtr<HTMLInputElement> input(static_cast<HTMLInputElement*>(shadowAncestorNode()));
if (input->disabled() || input->isReadOnlyFormControl()) {
if (!event->defaultHandled())
HTMLDivElement::defaultEventHandler(event);
......@@ -270,7 +271,7 @@ void SpinButtonElement::defaultEventHandler(Event* event)
return;
}
RefPtr<HTMLInputElement> input(toHTMLInputElement(shadowAncestorNode()));
RefPtr<HTMLInputElement> input(static_cast<HTMLInputElement*>(shadowAncestorNode()));
if (input->disabled() || input->isReadOnlyFormControl()) {
if (!event->defaultHandled())
HTMLDivElement::defaultEventHandler(event);
......@@ -341,7 +342,7 @@ void SpinButtonElement::stopRepeatingTimer()
void SpinButtonElement::repeatingTimerFired(Timer<SpinButtonElement>*)
{
HTMLInputElement* input = toHTMLInputElement(shadowAncestorNode());
HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());
if (input->disabled() || input->isReadOnlyFormControl())
return;
// On Mac OS, NSStepper updates the value for the button under the mouse
......@@ -400,7 +401,7 @@ void InputFieldSpeechButtonElement::defaultEventHandler(Event* event)
// The call to focus() below dispatches a focus event, and an event handler in the page might
// remove the input element from DOM. To make sure it remains valid until we finish our work
// here, we take a temporary reference.
RefPtr<HTMLInputElement> input(toHTMLInputElement(shadowAncestorNode()));
RefPtr<HTMLInputElement> input(static_cast<HTMLInputElement*>(shadowAncestorNode()));
if (input->disabled() || input->isReadOnlyFormControl()) {
if (!event->defaultHandled())
......@@ -485,7 +486,7 @@ void InputFieldSpeechButtonElement::setRecognitionResult(int, const SpeechInputR
// The call to setValue() below dispatches an event, and an event handler in the page might
// remove the input element from DOM. To make sure it remains valid until we finish our work
// here, we take a temporary reference.
RefPtr<HTMLInputElement> input(toHTMLInputElement(shadowAncestorNode()));
RefPtr<HTMLInputElement> input(static_cast<HTMLInputElement*>(shadowAncestorNode()));
if (input->disabled() || input->isReadOnlyFormControl())
return;
......
......@@ -254,21 +254,14 @@ DragOperation DragController::dragEnteredOrUpdated(DragData* dragData)
static HTMLInputElement* asFileInput(Node* node)
{
ASSERT(node);
if (!node->hasTagName(HTMLNames::inputTag))
return 0;
HTMLInputElement* inputElement = toHTMLInputElement(node);
HTMLInputElement* inputElement = node->toInputElement();
// If this is a button inside of the a file input, move up to the file input.
if (inputElement->isTextButton() && inputElement->treeScope()->isShadowRoot()) {
node = inputElement->treeScope()->shadowHost();
if (!node->hasTagName(HTMLNames::inputTag))
return 0;
inputElement = toHTMLInputElement(node);
}
if (inputElement && inputElement->isTextButton() && inputElement->treeScope()->isShadowRoot())
inputElement = inputElement->treeScope()->shadowHost()->toInputElement();
return inputElement->isFileUpload() ? inputElement : 0;
return inputElement && inputElement->isFileUpload() ? inputElement : 0;
}
// This can return null if an empty document is loaded.
......
......@@ -32,7 +32,6 @@
#include "FrameView.h"
#include "GraphicsContext.h"
#include "HTMLInputElement.h"
#include "HTMLNames.h"
#include "NotImplemented.h"
#include "Page.h"
#include "PaintInfo.h"
......@@ -311,7 +310,7 @@ bool RenderThemeEfl::paintThemePart(RenderObject* object, FormType type, const P
// treatment, move them to special functions.
if (type == SliderVertical || type == SliderHorizontal) {
RenderSlider* renderSlider = toRenderSlider(object);
HTMLInputElement* input = renderSlider->node()->hasTagName(HTMLNames::inputTag) ? toHTMLInputElement(renderSlider->node()) : 0;
HTMLInputElement* input = renderSlider->node()->toInputElement();
Edje_Message_Float_Set* msg;
double valueRange = input->maximum() - input->minimum();
......
......@@ -75,7 +75,7 @@ RenderTextControlSingleLine::RenderTextControlSingleLine(Node* node)
, m_searchPopup(0)
{
ASSERT(node->isHTMLElement());
ASSERT(node->hasTagName(inputTag) || node->hasTagName(isindexTag));
ASSERT(node->toInputElement());
}
RenderTextControlSingleLine::~RenderTextControlSingleLine()
......@@ -788,7 +788,7 @@ PassRefPtr<Scrollbar> RenderTextControlSingleLine::createScrollbar(ScrollableAre
HTMLInputElement* RenderTextControlSingleLine::inputElement() const
{
return toHTMLInputElement(node());
return node()->toInputElement();
}
}
......@@ -738,18 +738,26 @@ bool RenderTheme::isActive(const RenderObject* o) const
bool RenderTheme::isChecked(const RenderObject* o) const
{
if (!o->node() || !o->node()->hasTagName(inputTag))
if (!o->node())
return false;
HTMLInputElement* inputElement = o->node()->toInputElement();
if (!inputElement)
return false;
return toHTMLInputElement(o->node())->shouldAppearChecked();
return inputElement->shouldAppearChecked();
}
bool RenderTheme::isIndeterminate(const RenderObject* o) const
{
if (!o->node() || !o->node()->hasTagName(inputTag))
if (!o->node())
return false;
HTMLInputElement* inputElement = o->node()->toInputElement();
if (!inputElement)
return false;
return toHTMLInputElement(o->node())->isIndeterminate();
return inputElement->isIndeterminate();
}
bool RenderTheme::isEnabled(const RenderObject* o) const
......
2011-08-30 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r94142, r94144, r94145, and r94148.
http://trac.webkit.org/changeset/94142
http://trac.webkit.org/changeset/94144
http://trac.webkit.org/changeset/94145
http://trac.webkit.org/changeset/94148
https://bugs.webkit.org/show_bug.cgi?id=67262
Broke isindex element (Requested by rniwa on #webkit).
* src/EditorClientImpl.cpp:
(WebKit::EditorClientImpl::textFieldDidEndEditing):
(WebKit::EditorClientImpl::doTextFieldCommandFromEvent):
* src/WebInputElement.cpp:
(WebKit::toWebInputElement):
* src/WebPasswordFormUtils.cpp:
(WebKit::findPasswordFormFields):
2011-08-30 Ryosuke Niwa <rniwa@webkit.org>
Chromium build fix after r94142.
......
......@@ -654,7 +654,7 @@ void EditorClientImpl::textFieldDidBeginEditing(Element* element)
void EditorClientImpl::textFieldDidEndEditing(Element* element)
{
HTMLInputElement* inputElement = WebCore::toHTMLInputElement(element);
HTMLInputElement* inputElement = toHTMLInputElement(element);
if (m_webView->autofillClient() && inputElement)
m_webView->autofillClient()->textFieldDidEndEditing(WebInputElement(inputElement));
......@@ -676,7 +676,7 @@ void EditorClientImpl::textDidChangeInTextField(Element* element)
bool EditorClientImpl::doTextFieldCommandFromEvent(Element* element,
KeyboardEvent* event)
{
HTMLInputElement* inputElement = WebCore::toHTMLInputElement(element);
HTMLInputElement* inputElement = toHTMLInputElement(element);
if (m_webView->autofillClient() && inputElement) {
m_webView->autofillClient()->textFieldDidReceiveKeyDown(WebInputElement(inputElement),
WebKeyboardEventBuilder(*event));
......
......@@ -173,8 +173,8 @@ WebInputElement::operator PassRefPtr<HTMLInputElement>() const
WebInputElement* toWebInputElement(WebElement* webElement)
{
Element* element = webElement->unwrap<Element>();
if (!element->hasTagName(HTMLNames::inputTag))
HTMLInputElement* inputElement = webElement->unwrap<Element>()->toInputElement();
if (!inputElement)
return 0;
return static_cast<WebInputElement*>(webElement);
......
......@@ -76,7 +76,7 @@ void findPasswordFormFields(HTMLFormElement* form, PasswordFormFields* fields)
if (!formElement->hasLocalName(HTMLNames::inputTag))
continue;
HTMLInputElement* inputElement = WebCore::toHTMLInputElement(formElement);
HTMLInputElement* inputElement = toHTMLInputElement(formElement);
if (!inputElement->isEnabledFormControl())
continue;
......@@ -98,7 +98,7 @@ void findPasswordFormFields(HTMLFormElement* form, PasswordFormFields* fields)
if (!formElement->hasLocalName(HTMLNames::inputTag))
continue;
HTMLInputElement* inputElement = WebCore::toHTMLInputElement(formElement);
HTMLInputElement* inputElement = toHTMLInputElement(formElement);
if (!inputElement->isEnabledFormControl())
continue;
......
2011-08-30 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r94142, r94144, r94145, and r94148.
http://trac.webkit.org/changeset/94142
http://trac.webkit.org/changeset/94144
http://trac.webkit.org/changeset/94145
http://trac.webkit.org/changeset/94148
https://bugs.webkit.org/show_bug.cgi?id=67262
Broke isindex element (Requested by rniwa on #webkit).
* WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
(DumpRenderTreeSupportGtk::setAutofilled):
(DumpRenderTreeSupportGtk::setValueForUser):
2011-08-30 Ryosuke Niwa <rniwa@webkit.org>
GTK build fix after r94142.
......
......@@ -37,7 +37,6 @@
#include "GCController.h"
#include "GraphicsContext.h"
#include "HTMLInputElement.h"
#include "HTMLNames.h"
#include "JSDOMWindow.h"
#include "JSDocument.h"
#include "JSElement.h"
......@@ -756,23 +755,29 @@ void DumpRenderTreeSupportGtk::setAutofilled(JSContextRef context, JSValueRef no
{
JSC::ExecState* exec = toJS(context);