Changeset 94142 in webkit
- Timestamp:
- Aug 30, 2011 6:20:24 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r94138 r94142 1 2011-08-30 Ryosuke Niwa <rniwa@webkit.org> 2 3 Get rid of toInputElement() 4 https://bugs.webkit.org/show_bug.cgi?id=67175 5 6 Reviewed by Darin Adler. 7 8 Got rid of Node::toInputElement and HTMLInputElement::toInputElement and replaced them by 9 a global toHTMLInputElement. 10 11 * WebCore.order: 12 * accessibility/AXObjectCache.cpp: 13 (WebCore::AXObjectCache::textMarkerDataForVisiblePosition): 14 * accessibility/AccessibilityRenderObject.cpp: 15 (WebCore::AccessibilityRenderObject::isPasswordField): 16 (WebCore::AccessibilityRenderObject::isIndeterminate): 17 (WebCore::AccessibilityRenderObject::isNativeCheckboxOrRadio): 18 (WebCore::AccessibilityRenderObject::isChecked): 19 * css/CSSStyleSelector.cpp: 20 (WebCore::CSSStyleSelector::canShareStyleWithControl): 21 (WebCore::CSSStyleSelector::adjustRenderStyle): 22 (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector): 23 (WebCore::CSSStyleSelector::applyProperty): 24 * dom/CheckedRadioButtons.cpp: 25 (WebCore::CheckedRadioButtons::addButton): 26 (WebCore::CheckedRadioButtons::removeButton): 27 * dom/Node.cpp: 28 * dom/Node.h: 29 * editing/FrameSelection.cpp: 30 (WebCore::FrameSelection::isInPasswordField): 31 * html/HTMLInputElement.h: 32 (WebCore::toHTMLInputElement): 33 * html/shadow/SliderThumbElement.cpp: 34 (WebCore::sliderThumbElementOf): 35 (WebCore::RenderSliderThumb::layout): 36 (WebCore::RenderSliderContainer::layout): 37 (WebCore::SliderThumbElement::hostInput): 38 (WebCore::trackLimiterElementOf): 39 * html/shadow/TextControlInnerElements.cpp: 40 (WebCore::SearchFieldResultsButtonElement::shadowPseudoId): 41 (WebCore::SearchFieldResultsButtonElement::defaultEventHandler): 42 (WebCore::SearchFieldCancelButtonElement::defaultEventHandler): 43 (WebCore::SpinButtonElement::defaultEventHandler): 44 (WebCore::SpinButtonElement::repeatingTimerFired): 45 (WebCore::InputFieldSpeechButtonElement::defaultEventHandler): 46 (WebCore::InputFieldSpeechButtonElement::setRecognitionResult): 47 * page/DragController.cpp: 48 (WebCore::asFileInput): 49 * platform/efl/RenderThemeEfl.cpp: 50 (WebCore::RenderThemeEfl::paintThemePart): 51 * rendering/RenderTextControlSingleLine.cpp: 52 (WebCore::RenderTextControlSingleLine::RenderTextControlSingleLine): 53 (WebCore::RenderTextControlSingleLine::inputElement): 54 * rendering/RenderTheme.cpp: 55 (WebCore::RenderTheme::isChecked): 56 (WebCore::RenderTheme::isIndeterminate): 57 1 58 2011-08-30 Ryosuke Niwa <rniwa@webkit.org> 2 59 -
trunk/Source/WebCore/WebCore.order
r92284 r94142 3224 3224 __ZN7WebCore11CSSSelector8pseudoIdENS0_10PseudoTypeE 3225 3225 __ZNK7WebCore22HTMLFormControlElement20isFormControlElementEv 3226 __ZN7WebCore16HTMLInputElement14toInputElementEv3227 3226 __ZNK7WebCore22HTMLFormControlElement20isEnabledFormControlEv 3228 3227 __ZNK7WebCore22HTMLFormControlElement8disabledEv … … 4243 4242 __ZN3WTF9HashTableINS_6StringESt4pairIS1_N7WebCore17AccessibilityRoleEENS_18PairFirstExtractorIS5_EENS_15CaseFoldingHashENS_14PairHashTraitsINS_10HashTraitsIS1_EENSA_IS4_EEEESB_E6lookupIS1_NS_22IdentityHashTranslatorIS1_S5_S8_EEEEPS5_RKT_ 4244 4243 __ZN3WTF9HashTableINS_6StringESt4pairIS1_N7WebCore17AccessibilityRoleEENS_18PairFirstExtractorIS5_EENS_15CaseFoldingHashENS_14PairHashTraitsINS_10HashTraitsIS1_EENSA_IS4_EEEESB_E6rehashEi 4245 __ZN7WebCore4Node14toInputElementEv4246 4244 __ZNK7WebCore13RootInlineBox19lineBreakBidiStatusEv 4247 4245 __ZNK7WebCore13InlineFlowBox13lastLeafChildEv -
trunk/Source/WebCore/accessibility/AXObjectCache.cpp
r89609 r94142 616 616 return; 617 617 618 if (domNode->isHTMLElement()) { 619 HTMLInputElement* inputElement = domNode->toInputElement(); 620 if (inputElement && inputElement->isPasswordField()) 621 return; 622 } 618 if (domNode->isHTMLElement() && domNode->hasTagName(inputTag) && toHTMLInputElement(domNode)->isPasswordField()) 619 return; 623 620 624 621 // locate the renderer, which must exist for a visible dom node -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r94134 r94142 495 495 { 496 496 ASSERT(m_renderer); 497 if (!m_renderer->node() || !m_renderer->node()-> isHTMLElement())497 if (!m_renderer->node() || !m_renderer->node()->hasTagName(inputTag)) 498 498 return false; 499 499 if (ariaRoleAttribute() != UnknownRole) 500 500 return false; 501 501 502 HTMLInputElement* inputElement = m_renderer->node()->toInputElement(); 503 if (!inputElement) 504 return false; 505 506 return inputElement->isPasswordField(); 502 return toHTMLInputElement(m_renderer->node())->isPasswordField(); 507 503 } 508 504 … … 590 586 { 591 587 ASSERT(m_renderer); 592 if (!m_renderer->node()) 593 return false; 594 595 HTMLInputElement* inputElement = m_renderer->node()->toInputElement(); 596 if (!inputElement) 597 return false; 598 599 return inputElement->isIndeterminate(); 588 if (!m_renderer->node() || !m_renderer->node()->hasTagName(inputTag)) 589 return false; 590 591 return toHTMLInputElement(m_renderer->node())->isIndeterminate(); 600 592 } 601 593 602 594 bool AccessibilityRenderObject::isNativeCheckboxOrRadio() const 603 595 { 604 Node* elementNode = node(); 605 if (elementNode) { 606 HTMLInputElement* input = elementNode->toInputElement(); 607 if (input) 608 return input->isCheckbox() || input->isRadioButton(); 609 } 610 611 return false; 596 ASSERT(m_renderer); 597 if (!m_renderer->node() || !m_renderer->node()->hasTagName(inputTag)) 598 return false; 599 600 HTMLInputElement* input = toHTMLInputElement(m_renderer->node()); 601 return input->isCheckbox() || input->isRadioButton(); 612 602 } 613 603 … … 619 609 620 610 // First test for native checkedness semantics 621 HTMLInputElement* inputElement = m_renderer->node()->toInputElement(); 622 if (inputElement) 623 return inputElement->shouldAppearChecked(); 611 if (m_renderer->node()->hasTagName(inputTag)) 612 return toHTMLInputElement(m_renderer->node())->shouldAppearChecked(); 624 613 625 614 // Else, if this is an ARIA checkbox or radio, respect the aria-checked attribute -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r94104 r94142 960 960 } 961 961 #endif 962 963 HTMLInputElement* thisInputElement = element->toInputElement(); 964 HTMLInputElement* otherInputElement = m_element->toInputElement(); 965 966 if (!thisInputElement || !otherInputElement) 962 963 ASSERT(element); 964 ASSERT(m_element); 965 if (!element->hasTagName(inputTag) || !m_element->hasTagName(inputTag)) 967 966 return false; 967 968 HTMLInputElement* thisInputElement = toHTMLInputElement(element); 969 HTMLInputElement* otherInputElement = toHTMLInputElement(m_element); 968 970 969 971 if (thisInputElement->isAutofilled() != otherInputElement->isAutofilled()) … … 1894 1896 // Don't apply intrinsic margins to image buttons. The designer knows how big the images are, 1895 1897 // so we have to treat all image buttons as though they were explicitly sized. 1896 if (!e->hasTagName(inputTag) || ! static_cast<HTMLInputElement*>(e)->isImageButton())1898 if (!e->hasTagName(inputTag) || !toHTMLInputElement(e)->isImageButton()) 1897 1899 addIntrinsicMargins(style); 1898 1900 } … … 2758 2760 break; 2759 2761 case CSSSelector::PseudoAutofill: { 2760 if (!e || !e->isFormControlElement() )2762 if (!e || !e->isFormControlElement() || !e->hasTagName(inputTag)) 2761 2763 break; 2762 if (HTMLInputElement* inputElement = e->toInputElement()) 2763 return inputElement->isAutofilled(); 2764 return toHTMLInputElement(e)->isAutofilled(); 2764 2765 break; 2765 2766 } … … 2848 2849 return (e->willValidate() && !e->isValidFormControlElement()) || e->hasUnacceptableValue(); 2849 2850 } case CSSSelector::PseudoChecked: { 2850 if (!e || !e->isFormControlElement() )2851 if (!e || !e->isFormControlElement() || !e->hasTagName(inputTag)) 2851 2852 break; 2852 2853 // Even though WinIE allows checked and indeterminate to co-exist, the CSS selector spec says that 2853 2854 // you can't be both checked and indeterminate. We will behave like WinIE behind the scenes and just 2854 2855 // obey the CSS spec here in the test for matching the pseudo. 2855 HTMLInputElement* inputElement = e->toInputElement();2856 if (inputElement && inputElement->shouldAppearChecked() && !inputElement->isIndeterminate())2856 HTMLInputElement* inputElement = toHTMLInputElement(e); 2857 if (inputElement->shouldAppearChecked() && !inputElement->isIndeterminate()) 2857 2858 return true; 2858 2859 break; … … 2861 2862 if (!e || !e->isFormControlElement()) 2862 2863 break; 2863 2864 2864 2865 #if ENABLE(PROGRESS_TAG) 2865 2866 if (e->hasTagName(progressTag)) { … … 2870 2871 } 2871 2872 #endif 2872 2873 HTMLInputElement* inputElement = e->toInputElement(); 2874 if (inputElement && inputElement->isIndeterminate()) 2873 2874 if (e->hasTagName(inputTag) && toHTMLInputElement(e)->isIndeterminate()) 2875 2875 return true; 2876 2876 break; … … 4845 4845 if (primitiveValue && m_element->hasTagName(WebCore::inputTag)) { 4846 4846 String mask = primitiveValue->getStringValue(); 4847 static_cast<HTMLInputElement*>(m_element)->setWapInputFormat(mask);4847 toHTMLInputElement(m_element)->setWapInputFormat(mask); 4848 4848 } 4849 4849 return; -
trunk/Source/WebCore/dom/CheckedRadioButtons.cpp
r91049 r94142 36 36 return; 37 37 38 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(element);38 HTMLInputElement* inputElement = toHTMLInputElement(element); 39 39 40 40 // We only track checked buttons. … … 78 78 return; 79 79 80 HTMLInputElement* inputElement = element->toInputElement();80 HTMLInputElement* inputElement = toHTMLInputElement(element); 81 81 ASSERT_UNUSED(inputElement, inputElement); 82 82 ASSERT(inputElement->shouldAppearChecked()); -
trunk/Source/WebCore/dom/Node.cpp
r94089 r94142 578 578 } 579 579 580 HTMLInputElement* Node::toInputElement()581 {582 // If one of the below ASSERTs trigger, you are calling this function583 // directly or indirectly from a constructor or destructor of this object.584 // Don't do this!585 ASSERT(!(isHTMLElement() && hasTagName(inputTag)));586 return 0;587 }588 589 580 short Node::tabIndex() const 590 581 { -
trunk/Source/WebCore/dom/Node.h
r93481 r94142 534 534 virtual Node* toNode() { return this; } 535 535 536 virtual HTMLInputElement* toInputElement();537 538 536 virtual ScriptExecutionContext* scriptExecutionContext() const; 539 537 -
trunk/Source/WebCore/editing/FrameSelection.cpp
r93531 r94142 1523 1523 { 1524 1524 HTMLTextFormControlElement* textControl = enclosingTextFormControl(start()); 1525 return textControl && textControl->hasTagName(inputTag) && static_cast<HTMLInputElement*>(textControl)->isPasswordField();1525 return textControl && textControl->hasTagName(inputTag) && toHTMLInputElement(textControl)->isPasswordField(); 1526 1526 } 1527 1527 -
trunk/Source/WebCore/html/HTMLInputElement.h
r94047 r94142 25 25 #define HTMLInputElement_h 26 26 27 #include "HTMLNames.h" 27 28 #include "HTMLTextFormControlElement.h" 28 29 … … 42 43 43 44 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitspeechchange); 44 45 virtual HTMLInputElement* toInputElement() { return this; }46 45 47 46 virtual bool shouldAutocomplete() const; … … 358 357 }; 359 358 359 inline HTMLInputElement* toHTMLInputElement(Node* node) 360 { 361 ASSERT(!node || node->hasTagName(HTMLNames::inputTag)); 362 return static_cast<HTMLInputElement*>(node); 363 } 364 360 365 } //namespace 361 366 -
trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp
r93279 r94142 38 38 #include "Frame.h" 39 39 #include "HTMLInputElement.h" 40 #include "HTMLNames.h" 40 41 #include "HTMLParserIdioms.h" 41 42 #include "MouseEvent.h" … … 67 68 { 68 69 ASSERT(node); 69 ShadowRoot* shadow = node->toInputElement()->shadowRoot(); 70 ASSERT(node->hasTagName(HTMLNames::inputTag)); 71 ShadowRoot* shadow = toHTMLInputElement(node)->shadowRoot(); 70 72 ASSERT(shadow); 71 73 Node* thumb = shadow->firstChild()->firstChild()->firstChild(); … … 104 106 // Do not cast node() to SliderThumbElement. This renderer is used for 105 107 // TrackLimitElement too. 106 HTMLInputElement* input = node()->shadowAncestorNode()->toInputElement(); 108 ASSERT(node()->shadowAncestorNode()->hasTagName(HTMLNames::inputTag)); 109 HTMLInputElement* input = toHTMLInputElement(node()->shadowAncestorNode()); 107 110 bool isVertical = style()->appearance() == SliderThumbVerticalPart || style()->appearance() == MediaVolumeSliderThumbPart; 108 111 … … 133 136 void RenderSliderContainer::layout() 134 137 { 135 HTMLInputElement* input = node()->shadowAncestorNode()->toInputElement(); 138 ASSERT(node()->shadowAncestorNode()->hasTagName(HTMLNames::inputTag)); 139 HTMLInputElement* input = toHTMLInputElement(node()->shadowAncestorNode()); 136 140 bool isVertical = hasVerticalAppearance(input); 137 141 style()->setBoxOrient(isVertical ? VERTICAL : HORIZONTAL); … … 314 318 // Only HTMLInputElement creates SliderThumbElement instances as its shadow nodes. 315 319 // So, shadowAncestorNode() must be an HTMLInputElement. 316 return shadowAncestorNode()->toInputElement(); 320 ASSERT(shadowAncestorNode()->hasTagName(HTMLNames::inputTag)); 321 return toHTMLInputElement(shadowAncestorNode()); 317 322 } 318 323 … … 352 357 { 353 358 ASSERT(node); 354 ShadowRoot* shadow = node->toInputElement()->shadowRoot(); 359 ASSERT(node->hasTagName(HTMLNames::inputTag)); 360 ShadowRoot* shadow = toHTMLInputElement(node)->shadowRoot(); 355 361 ASSERT(shadow); 356 362 Node* limiter = shadow->firstChild()->lastChild(); -
trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp
r91988 r94142 129 129 DEFINE_STATIC_LOCAL(AtomicString, decorationId, ("-webkit-search-decoration")); 130 130 Node* host = shadowAncestorNode(); 131 if (!host )131 if (!host || !host->hasTagName(inputTag)) 132 132 return resultsId; 133 if (HTMLInputElement* input = host->toInputElement()) { 134 if (input->maxResults() < 0) 135 return decorationId; 136 if (input->maxResults() > 0) 137 return resultsId; 138 return resultsDecorationId; 139 } 140 return resultsId; 133 134 int maxResults = toHTMLInputElement(host)->maxResults(); 135 if (maxResults < 0) 136 return decorationId; 137 if (maxResults > 0) 138 return resultsId; 139 return resultsDecorationId; 141 140 } 142 141 … … 144 143 { 145 144 // On mousedown, bring up a menu, if needed 146 HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());145 HTMLInputElement* input = toHTMLInputElement(shadowAncestorNode()); 147 146 if (event->type() == eventNames().mousedownEvent && event->isMouseEvent() && static_cast<MouseEvent*>(event)->button() == LeftButton) { 148 147 input->focus(); … … 192 191 { 193 192 // If the element is visible, on mouseup, clear the value, and set selection 194 RefPtr<HTMLInputElement> input( static_cast<HTMLInputElement*>(shadowAncestorNode()));193 RefPtr<HTMLInputElement> input(toHTMLInputElement(shadowAncestorNode())); 195 194 if (input->disabled() || input->isReadOnlyFormControl()) { 196 195 if (!event->defaultHandled()) … … 272 271 } 273 272 274 RefPtr<HTMLInputElement> input( static_cast<HTMLInputElement*>(shadowAncestorNode()));273 RefPtr<HTMLInputElement> input(toHTMLInputElement(shadowAncestorNode())); 275 274 if (input->disabled() || input->isReadOnlyFormControl()) { 276 275 if (!event->defaultHandled()) … … 343 342 void SpinButtonElement::repeatingTimerFired(Timer<SpinButtonElement>*) 344 343 { 345 HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());344 HTMLInputElement* input = toHTMLInputElement(shadowAncestorNode()); 346 345 if (input->disabled() || input->isReadOnlyFormControl()) 347 346 return; … … 402 401 // remove the input element from DOM. To make sure it remains valid until we finish our work 403 402 // here, we take a temporary reference. 404 RefPtr<HTMLInputElement> input( static_cast<HTMLInputElement*>(shadowAncestorNode()));403 RefPtr<HTMLInputElement> input(toHTMLInputElement(shadowAncestorNode())); 405 404 406 405 if (input->disabled() || input->isReadOnlyFormControl()) { … … 487 486 // remove the input element from DOM. To make sure it remains valid until we finish our work 488 487 // here, we take a temporary reference. 489 RefPtr<HTMLInputElement> input( static_cast<HTMLInputElement*>(shadowAncestorNode()));488 RefPtr<HTMLInputElement> input(toHTMLInputElement(shadowAncestorNode())); 490 489 if (input->disabled() || input->isReadOnlyFormControl()) 491 490 return; -
trunk/Source/WebCore/page/DragController.cpp
r91222 r94142 255 255 { 256 256 ASSERT(node); 257 258 HTMLInputElement* inputElement = node->toInputElement(); 257 258 if (!node->hasTagName(HTMLNames::inputTag)) 259 return 0; 260 261 HTMLInputElement* inputElement = toHTMLInputElement(node); 259 262 260 263 // If this is a button inside of the a file input, move up to the file input. 261 if (inputElement && inputElement->isTextButton() && inputElement->treeScope()->isShadowRoot()) 262 inputElement = inputElement->treeScope()->shadowHost()->toInputElement(); 263 264 return inputElement && inputElement->isFileUpload() ? inputElement : 0; 264 if (inputElement->isTextButton() && inputElement->treeScope()->isShadowRoot()) { 265 node = inputElement->treeScope()->shadowHost(); 266 if (!node->hasTagName(HTMLNames::inputTag)) 267 return 0; 268 inputElement = toHTMLInputElement(node); 269 } 270 271 return inputElement->isFileUpload() ? inputElement : 0; 265 272 } 266 273 -
trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp
r92347 r94142 33 33 #include "GraphicsContext.h" 34 34 #include "HTMLInputElement.h" 35 #include "HTMLNames.h" 35 36 #include "NotImplemented.h" 36 37 #include "Page.h" … … 311 312 if (type == SliderVertical || type == SliderHorizontal) { 312 313 RenderSlider* renderSlider = toRenderSlider(object); 313 HTMLInputElement* input = renderSlider->node()-> toInputElement();314 HTMLInputElement* input = renderSlider->node()->hasTagName(HTMLNames::inputTag) ? toHTMLInputElement(renderSlider->node()) : 0; 314 315 Edje_Message_Float_Set* msg; 315 316 double valueRange = input->maximum() - input->minimum(); -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
r94047 r94142 76 76 { 77 77 ASSERT(node->isHTMLElement()); 78 ASSERT(node-> toInputElement());78 ASSERT(node->hasTagName(inputTag)); 79 79 } 80 80 … … 789 789 HTMLInputElement* RenderTextControlSingleLine::inputElement() const 790 790 { 791 return node()->toInputElement();792 } 793 794 } 791 return toHTMLInputElement(node()); 792 } 793 794 } -
trunk/Source/WebCore/rendering/RenderTheme.cpp
r91049 r94142 739 739 bool RenderTheme::isChecked(const RenderObject* o) const 740 740 { 741 if (!o->node()) 742 return false; 743 744 HTMLInputElement* inputElement = o->node()->toInputElement(); 745 if (!inputElement) 746 return false; 747 748 return inputElement->shouldAppearChecked(); 741 if (!o->node() || !o->node()->hasTagName(inputTag)) 742 return false; 743 744 return toHTMLInputElement(o->node())->shouldAppearChecked(); 749 745 } 750 746 751 747 bool RenderTheme::isIndeterminate(const RenderObject* o) const 752 748 { 753 if (!o->node()) 754 return false; 755 756 HTMLInputElement* inputElement = o->node()->toInputElement(); 757 if (!inputElement) 758 return false; 759 760 return inputElement->isIndeterminate(); 749 if (!o->node() || !o->node()->hasTagName(inputTag)) 750 return false; 751 752 return toHTMLInputElement(o->node())->isIndeterminate(); 761 753 } 762 754 -
trunk/Source/WebKit/chromium/ChangeLog
r94133 r94142 1 2011-08-30 Ryosuke Niwa <rniwa@webkit.org> 2 3 Get rid of toInputElement() 4 https://bugs.webkit.org/show_bug.cgi?id=67175 5 6 Reviewed by Darin Adler. 7 8 * src/WebInputElement.cpp: 9 (WebKit::toWebInputElement): 10 1 11 2011-08-30 Nat Duca <nduca@chromium.org> 2 12 -
trunk/Source/WebKit/chromium/src/WebInputElement.cpp
r91004 r94142 174 174 WebInputElement* toWebInputElement(WebElement* webElement) 175 175 { 176 HTMLInputElement* inputElement = webElement->unwrap<Element>()->toInputElement();177 if (! inputElement)176 Element* element = webElement->unwrap<Element>(); 177 if (!element->hasTagName(HTMLNames::inputTag)) 178 178 return 0; 179 179 -
trunk/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
r89682 r94142 38 38 #include "GraphicsContext.h" 39 39 #include "HTMLInputElement.h" 40 #include "HTMLNames.h" 40 41 #include "JSDOMWindow.h" 41 42 #include "JSDocument.h" … … 756 757 JSC::ExecState* exec = toJS(context); 757 758 Element* element = toElement(toJS(exec, nodeObject)); 758 if (!element) 759 return; 760 HTMLInputElement* inputElement = element->toInputElement(); 761 if (!inputElement) 762 return; 763 764 inputElement->setAutofilled(autofilled); 759 if (!element || !element->hasTagName(HTMLNames::inputTag)) 760 return; 761 762 toHTMLInputElement(inputElement)->setAutofilled(autofilled); 765 763 } 766 764 … … 769 767 JSC::ExecState* exec = toJS(context); 770 768 Element* element = toElement(toJS(exec, nodeObject)); 771 if (!element) 772 return; 773 HTMLInputElement* inputElement = element->toInputElement(); 774 if (!inputElement) 769 if (!element || !element->hasTagName(HTMLNames::inputTag)) 775 770 return; 776 771 … … 778 773 GOwnPtr<gchar> valueBuffer(static_cast<gchar*>(g_malloc(bufferSize))); 779 774 JSStringGetUTF8CString(value, valueBuffer.get(), bufferSize); 780 inputElement->setValueForUser(String::fromUTF8(valueBuffer.get()));775 toHTMLInputElement(inputElement)->setValueForUser(String::fromUTF8(valueBuffer.get())); 781 776 } 782 777 -
trunk/Source/WebKit/qt/ChangeLog
r94105 r94142 1 2011-08-30 Ryosuke Niwa <rniwa@webkit.org> 2 3 Get rid of toInputElement() 4 https://bugs.webkit.org/show_bug.cgi?id=67175 5 6 Reviewed by Darin Adler. 7 8 * WebCoreSupport/DumpRenderTreeSupportQt.cpp: 9 (DumpRenderTreeSupportQt::setAutofilled): 10 (DumpRenderTreeSupportQt::setValueForUser): 11 (DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId): 12 1 13 2011-08-30 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> 2 14 -
trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
r94105 r94142 57 57 #include "HistoryItem.h" 58 58 #include "HTMLInputElement.h" 59 #include "HTMLNames.h" 59 60 #include "InspectorController.h" 60 61 #include "NodeList.h" … … 233 234 { 234 235 WebCore::Element* webElement = element.m_element; 235 if (!webElement) 236 return; 237 HTMLInputElement* inputElement = webElement->toInputElement(); 238 if (!inputElement) 239 return; 240 241 inputElement->setAutofilled(isAutofilled); 236 if (!webElement || !webElement->hasTagName(HTMLNames::inputTag)) 237 return; 238 239 toHTMLInputElement(webElement)->setAutofilled(isAutofilled); 242 240 } 243 241 … … 259 257 { 260 258 WebCore::Element* webElement = element.m_element; 261 if (!webElement) 262 return; 263 HTMLInputElement* inputElement = webElement->toInputElement(); 264 if (!inputElement) 265 return; 266 267 inputElement->setValueForUser(value); 259 if (!webElement || !webElement->hasTagName(HTMLNames::inputTag)) 260 return; 261 262 toHTMLInputElement(webElement)->setValueForUser(value); 268 263 } 269 264 … … 642 637 return false; 643 638 644 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(coreNode);639 HTMLInputElement* inputElement = toHTMLInputElement(coreNode); 645 640 646 641 return inputElement->isTextField() && !inputElement->isPasswordField() && inputElement->shouldAutocomplete();
Note: See TracChangeset
for help on using the changeset viewer.