Changeset 152149 in webkit
- Timestamp:
- Jun 27, 2013 7:26:41 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 58 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r152148 r152149 1 2013-06-27 Kangil Han <kangil.han@samsung.com> 2 3 Adopt is/toHTMLInputElement for code cleanup 4 https://bugs.webkit.org/show_bug.cgi?id=118130 5 6 Reviewed by Antti Koivisto. 7 8 To enhance readability, this patch adopts is/toHTMLInputElement. 9 This also helps out to reduce duplicated use of static_cast. 10 11 * accessibility/AccessibilityMediaControls.cpp: 12 (WebCore::AccessibilityMediaTimeline::valueDescription): 13 * accessibility/AccessibilityNodeObject.cpp: 14 (WebCore::AccessibilityNodeObject::determineAccessibilityRole): 15 (WebCore::AccessibilityNodeObject::isNativeTextControl): 16 (WebCore::AccessibilityNodeObject::isNativeImage): 17 (WebCore::AccessibilityNodeObject::isInputImage): 18 (WebCore::AccessibilityNodeObject::isReadOnly): 19 (WebCore::AccessibilityNodeObject::valueForRange): 20 (WebCore::AccessibilityNodeObject::maxValueForRange): 21 (WebCore::AccessibilityNodeObject::minValueForRange): 22 (WebCore::AccessibilityNodeObject::actionElement): 23 (WebCore::AccessibilityNodeObject::titleElementText): 24 (WebCore::AccessibilityNodeObject::visibleText): 25 (WebCore::AccessibilityNodeObject::title): 26 (WebCore::AccessibilityNodeObject::text): 27 (WebCore::AccessibilityNodeObject::colorValue): 28 (WebCore::accessibleNameForNode): 29 * accessibility/AccessibilityRenderObject.cpp: 30 (WebCore::AccessibilityRenderObject::isFileUploadButton): 31 (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers): 32 (WebCore::AccessibilityRenderObject::url): 33 (WebCore::AccessibilityRenderObject::setValue): 34 (WebCore::AccessibilityRenderObject::determineAccessibilityRole): 35 (WebCore::AccessibilityRenderObject::addTextFieldChildren): 36 * accessibility/AccessibilitySlider.cpp: 37 (WebCore::AccessibilitySlider::element): 38 * accessibility/ios/AccessibilityObjectIOS.mm: 39 (WebCore::AccessibilityObject::accessibilityPasswordFieldLength): 40 * bindings/js/JSHTMLInputElementCustom.cpp: 41 (WebCore::JSHTMLInputElement::selectionStart): 42 (WebCore::JSHTMLInputElement::setSelectionStart): 43 (WebCore::JSHTMLInputElement::selectionEnd): 44 (WebCore::JSHTMLInputElement::setSelectionEnd): 45 (WebCore::JSHTMLInputElement::selectionDirection): 46 (WebCore::JSHTMLInputElement::setSelectionDirection): 47 (WebCore::JSHTMLInputElement::setSelectionRange): 48 * css/StyleResolver.cpp: 49 (WebCore::StyleResolver::adjustRenderStyle): 50 * editing/FrameSelection.cpp: 51 (WebCore::FrameSelection::isInPasswordField): 52 * editing/ReplaceSelectionCommand.cpp: 53 (WebCore::ReplaceSelectionCommand::shouldPerformSmartReplace): 54 * html/HTMLFormControlElement.cpp: 55 (WebCore::shouldAutofocus): 56 * html/HTMLFormElement.cpp: 57 (WebCore::HTMLFormElement::getTextFieldValues): 58 * html/HTMLInputElement.h: 59 (WebCore::isHTMLInputElement): 60 (WebCore::toHTMLInputElement): 61 * html/RadioInputType.cpp: 62 (WebCore::RadioInputType::handleKeydownEvent): 63 (WebCore::RadioInputType::isKeyboardFocusable): 64 * html/shadow/MediaControlElementTypes.cpp: 65 (WebCore::mediaControlElementType): 66 * html/shadow/TextControlInnerElements.cpp: 67 (WebCore::SearchFieldResultsButtonElement::defaultEventHandler): 68 (WebCore::SearchFieldCancelButtonElement::defaultEventHandler): 69 (WebCore::SearchFieldCancelButtonElement::willRespondToMouseClickEvents): 70 (WebCore::InputFieldSpeechButtonElement::defaultEventHandler): 71 (WebCore::InputFieldSpeechButtonElement::willRespondToMouseClickEvents): 72 (WebCore::InputFieldSpeechButtonElement::setRecognitionResult): 73 (WebCore::InputFieldSpeechButtonElement::startSpeechInput): 74 * loader/FormSubmission.cpp: 75 (WebCore::FormSubmission::create): 76 * page/Chrome.cpp: 77 (WebCore::Chrome::setToolTip): 78 * page/EventHandler.cpp: 79 (WebCore::isSubmitImage): 80 (WebCore::EventHandler::handleMousePressEvent): 81 * page/FocusController.cpp: 82 (WebCore::clearSelectionIfNeeded): 83 * platform/gtk/PasteboardGtk.cpp: 84 (WebCore::getURLForImageNode): 85 * platform/qt/RenderThemeQt.cpp: 86 (WebCore::RenderThemeQt::paintMediaVolumeSliderTrack): 87 * platform/qt/RenderThemeQtMobile.cpp: 88 (WebCore::RenderThemeQtMobile::paintSliderTrack): 89 * rendering/HitTestResult.cpp: 90 (WebCore::HitTestResult::altDisplayString): 91 (WebCore::HitTestResult::absoluteImageURL): 92 (WebCore::HitTestResult::isContentEditable): 93 * rendering/RenderBlock.cpp: 94 (WebCore::RenderBlock::hasLineIfEmpty): 95 * rendering/RenderBox.cpp: 96 (WebCore::RenderBox::sizesLogicalWidthToFitContent): 97 * rendering/RenderButton.cpp: 98 (WebCore::RenderButton::updateFromElement): 99 (WebCore::RenderButton::canHaveGeneratedChildren): 100 * rendering/RenderDetailsMarker.cpp: 101 (WebCore::RenderDetailsMarker::isOpen): 102 * rendering/RenderFileUploadControl.cpp: 103 (WebCore::RenderFileUploadControl::updateFromElement): 104 (WebCore::RenderFileUploadControl::maxFilenameWidth): 105 (WebCore::RenderFileUploadControl::paintObject): 106 (WebCore::RenderFileUploadControl::uploadButton): 107 (WebCore::RenderFileUploadControl::fileTextValue): 108 * rendering/RenderImage.cpp: 109 (WebCore::RenderImage::updateAltText): 110 * testing/Internals.cpp: 111 (WebCore::Internals::selectColorInColorChooser): 112 1 113 2013-06-27 Antti Koivisto <antti@apple.com> 2 114 -
trunk/Source/WebCore/accessibility/AccessibilityMediaControls.cpp
r145988 r152149 278 278 { 279 279 Node* node = m_renderer->node(); 280 if (! node->hasTagName(inputTag))280 if (!isHTMLInputElement(node)) 281 281 return String(); 282 282 283 float time = static_cast<HTMLInputElement*>(node)->value().toFloat();283 float time = toHTMLInputElement(node)->value().toFloat(); 284 284 return localizedMediaTimeDescription(time); 285 285 } -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
r152088 r152149 283 283 if (node()->hasTagName(buttonTag)) 284 284 return buttonRoleType(); 285 if ( node()->hasTagName(inputTag)) {286 HTMLInputElement* input = static_cast<HTMLInputElement*>(node());285 if (isHTMLInputElement(node())) { 286 HTMLInputElement* input = toHTMLInputElement(node()); 287 287 if (input->isCheckbox()) 288 288 return CheckBoxRole; … … 445 445 return true; 446 446 447 if ( node->hasTagName(inputTag)) {448 HTMLInputElement* input = static_cast<HTMLInputElement*>(node);447 if (isHTMLInputElement(node)) { 448 HTMLInputElement* input = toHTMLInputElement(node); 449 449 return input->isText() || input->isNumberField(); 450 450 } … … 495 495 return true; 496 496 497 if ( node->hasTagName(inputTag)) {498 HTMLInputElement* input = static_cast<HTMLInputElement*>(node);497 if (isHTMLInputElement(node)) { 498 HTMLInputElement* input = toHTMLInputElement(node); 499 499 return input->isImageButton(); 500 500 } … … 530 530 return false; 531 531 532 if (roleValue() == ButtonRole && node->hasTagName(inputTag)) {533 HTMLInputElement* input = static_cast<HTMLInputElement*>(node);532 if (roleValue() == ButtonRole && isHTMLInputElement(node)) { 533 HTMLInputElement* input = toHTMLInputElement(node); 534 534 return input->isImageButton(); 535 535 } … … 698 698 return toHTMLFormControlElement(node)->isReadOnly(); 699 699 700 if ( node->hasTagName(inputTag)) {701 HTMLInputElement* input = static_cast<HTMLInputElement*>(node);700 if (isHTMLInputElement(node)) { 701 HTMLInputElement* input = toHTMLInputElement(node); 702 702 if (input->isTextField()) 703 703 return input->isReadOnly(); … … 787 787 float AccessibilityNodeObject::valueForRange() const 788 788 { 789 if (node() && node()->hasTagName(inputTag)) {790 HTMLInputElement* input = static_cast<HTMLInputElement*>(node());789 if (node() && isHTMLInputElement(node())) { 790 HTMLInputElement* input = toHTMLInputElement(node()); 791 791 if (input->isRangeControl()) 792 792 return input->valueAsNumber(); … … 801 801 float AccessibilityNodeObject::maxValueForRange() const 802 802 { 803 if (node() && node()->hasTagName(inputTag)) {804 HTMLInputElement* input = static_cast<HTMLInputElement*>(node());803 if (node() && isHTMLInputElement(node())) { 804 HTMLInputElement* input = toHTMLInputElement(node()); 805 805 if (input->isRangeControl()) 806 806 return input->maximum(); … … 815 815 float AccessibilityNodeObject::minValueForRange() const 816 816 { 817 if (node() && node()->hasTagName(inputTag)) {818 HTMLInputElement* input = static_cast<HTMLInputElement*>(node());817 if (node() && isHTMLInputElement(node())) { 818 HTMLInputElement* input = toHTMLInputElement(node()); 819 819 if (input->isRangeControl()) 820 820 return input->minimum(); … … 934 934 return 0; 935 935 936 if ( node->hasTagName(inputTag)) {937 HTMLInputElement* input = static_cast<HTMLInputElement*>(node);936 if (isHTMLInputElement(node)) { 937 HTMLInputElement* input = toHTMLInputElement(node); 938 938 if (!input->isDisabledFormControl() && (isCheckboxOrRadio() || input->isTextButton())) 939 939 return input; … … 1178 1178 return; 1179 1179 1180 bool isInputTag = node->hasTagName(inputTag);1180 bool isInputTag = isHTMLInputElement(node); 1181 1181 if (isInputTag || AccessibilityObject::isARIAInput(ariaRoleAttribute()) || isControl()) { 1182 1182 HTMLLabelElement* label = labelForElement(toElement(node)); … … 1238 1238 return; 1239 1239 1240 bool isInputTag = node->hasTagName(inputTag);1240 bool isInputTag = isHTMLInputElement(node); 1241 1241 if (isInputTag) { 1242 HTMLInputElement* input = static_cast<HTMLInputElement*>(node);1242 HTMLInputElement* input = toHTMLInputElement(node); 1243 1243 if (input->isTextButton()) { 1244 1244 textOrder.append(AccessibilityText(input->valueWithDefault(), VisibleText)); … … 1581 1581 return String(); 1582 1582 1583 bool isInputTag = node->hasTagName(inputTag);1583 bool isInputTag = isHTMLInputElement(node); 1584 1584 if (isInputTag) { 1585 HTMLInputElement* input = static_cast<HTMLInputElement*>(node);1585 HTMLInputElement* input = toHTMLInputElement(node); 1586 1586 if (input->isTextButton()) 1587 1587 return input->valueWithDefault(); … … 1644 1644 return String(); 1645 1645 1646 if (isNativeTextControl() && (node->hasTagName(textareaTag) || node->hasTagName(inputTag)))1646 if (isNativeTextControl() && (node->hasTagName(textareaTag) || isHTMLInputElement(node))) 1647 1647 return toHTMLTextFormControlElement(node)->value(); 1648 1648 … … 1702 1702 return; 1703 1703 1704 if (!node() || ! node()->hasTagName(inputTag))1704 if (!node() || !isHTMLInputElement(node())) 1705 1705 return; 1706 1706 1707 HTMLInputElement* input = static_cast<HTMLInputElement*>(node());1707 HTMLInputElement* input = toHTMLInputElement(node()); 1708 1708 const AtomicString& type = input->getAttribute(typeAttr); 1709 1709 if (!equalIgnoringCase(type, "color")) … … 1724 1724 return toText(node)->data(); 1725 1725 1726 if ( node->hasTagName(inputTag))1727 return static_cast<HTMLInputElement*>(node)->value();1726 if (isHTMLInputElement(node)) 1727 return toHTMLInputElement(node)->value(); 1728 1728 1729 1729 if (node->isHTMLElement()) { -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r152105 r152149 518 518 bool AccessibilityRenderObject::isFileUploadButton() const 519 519 { 520 if (m_renderer && m_renderer->node() && m_renderer->node()->hasTagName(inputTag)) {521 HTMLInputElement* input = static_cast<HTMLInputElement*>(m_renderer->node());520 if (m_renderer && m_renderer->node() && isHTMLInputElement(m_renderer->node())) { 521 HTMLInputElement* input = toHTMLInputElement(m_renderer->node()); 522 522 return input->isFileUpload(); 523 523 } … … 925 925 926 926 Node* node = m_renderer->node(); 927 if (!node || ! node->hasTagName(inputTag))927 if (!node || !isHTMLInputElement(node)) 928 928 return; 929 929 930 HTMLInputElement* input = static_cast<HTMLInputElement*>(node);930 HTMLInputElement* input = toHTMLInputElement(node); 931 931 // if there's a form, then this is easy 932 932 if (input->form()) { … … 944 944 unsigned len = list->length(); 945 945 for (unsigned i = 0; i < len; ++i) { 946 if ( list->item(i)->hasTagName(inputTag)) {947 HTMLInputElement* associateElement = static_cast<HTMLInputElement*>(list->item(i));946 if (isHTMLInputElement(list->item(i))) { 947 HTMLInputElement* associateElement = toHTMLInputElement(list->item(i)); 948 948 if (associateElement->isRadioButton() && associateElement->name() == input->name()) { 949 949 if (AccessibilityObject* object = axObjectCache()->getOrCreate(associateElement)) … … 1472 1472 1473 1473 if (isInputImage()) 1474 return static_cast<HTMLInputElement*>(m_renderer->node())->src();1474 return toHTMLInputElement(m_renderer->node())->src(); 1475 1475 1476 1476 return KURL(); … … 1642 1642 if (renderer->isTextField()) { 1643 1643 // FIXME: This is not safe! Other elements could have a TextField renderer. 1644 static_cast<HTMLInputElement*>(element)->setValue(string);1644 toHTMLInputElement(element)->setValue(string); 1645 1645 } else if (renderer->isTextArea()) { 1646 1646 // FIXME: This is not safe! Other elements could have a TextArea renderer. … … 2449 2449 return StaticTextRole; 2450 2450 if (cssBox && cssBox->isImage()) { 2451 if (node && node->hasTagName(inputTag))2451 if (node && isHTMLInputElement(node)) 2452 2452 return ariaHasPopup() ? PopUpButtonRole : ButtonRole; 2453 2453 if (isSVGImage()) … … 2472 2472 return TextAreaRole; 2473 2473 2474 if (node && node->hasTagName(inputTag)) {2475 HTMLInputElement* input = static_cast<HTMLInputElement*>(node);2474 if (node && isHTMLInputElement(node)) { 2475 HTMLInputElement* input = toHTMLInputElement(node); 2476 2476 if (input->isCheckbox()) 2477 2477 return CheckBoxRole; … … 2771 2771 { 2772 2772 Node* node = this->node(); 2773 if (!node || ! node->hasTagName(inputTag))2773 if (!node || !isHTMLInputElement(node)) 2774 2774 return; 2775 2775 2776 HTMLInputElement* input = static_cast<HTMLInputElement*>(node);2776 HTMLInputElement* input = toHTMLInputElement(node); 2777 2777 HTMLElement* spinButtonElement = input->innerSpinButtonElement(); 2778 2778 if (!spinButtonElement || !spinButtonElement->isSpinButtonElement()) -
trunk/Source/WebCore/accessibility/AccessibilitySlider.cpp
r145988 r152149 144 144 HTMLInputElement* AccessibilitySlider::element() const 145 145 { 146 return static_cast<HTMLInputElement*>(m_renderer->node());146 return toHTMLInputElement(m_renderer->node()); 147 147 } 148 148 -
trunk/Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm
r143263 r152149 68 68 return false; 69 69 70 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(renderObject->node());70 HTMLInputElement* inputElement = toHTMLInputElement(renderObject->node()); 71 71 if (!inputElement) 72 72 return false; -
trunk/Source/WebCore/bindings/js/JSHTMLInputElementCustom.cpp
r127191 r152149 36 36 JSValue JSHTMLInputElement::selectionStart(ExecState* exec) const 37 37 { 38 HTMLInputElement* input = static_cast<HTMLInputElement*>(impl());38 HTMLInputElement* input = toHTMLInputElement(impl()); 39 39 if (!input->canHaveSelection()) 40 40 return throwTypeError(exec); … … 45 45 void JSHTMLInputElement::setSelectionStart(ExecState* exec, JSValue value) 46 46 { 47 HTMLInputElement* input = static_cast<HTMLInputElement*>(impl());47 HTMLInputElement* input = toHTMLInputElement(impl()); 48 48 if (!input->canHaveSelection()) 49 49 throwTypeError(exec); … … 54 54 JSValue JSHTMLInputElement::selectionEnd(ExecState* exec) const 55 55 { 56 HTMLInputElement* input = static_cast<HTMLInputElement*>(impl());56 HTMLInputElement* input = toHTMLInputElement(impl()); 57 57 if (!input->canHaveSelection()) 58 58 return throwTypeError(exec); … … 63 63 void JSHTMLInputElement::setSelectionEnd(ExecState* exec, JSValue value) 64 64 { 65 HTMLInputElement* input = static_cast<HTMLInputElement*>(impl());65 HTMLInputElement* input = toHTMLInputElement(impl()); 66 66 if (!input->canHaveSelection()) 67 67 throwTypeError(exec); … … 72 72 JSValue JSHTMLInputElement::selectionDirection(ExecState* exec) const 73 73 { 74 HTMLInputElement* input = static_cast<HTMLInputElement*>(impl());74 HTMLInputElement* input = toHTMLInputElement(impl()); 75 75 if (!input->canHaveSelection()) 76 76 return throwTypeError(exec); … … 81 81 void JSHTMLInputElement::setSelectionDirection(ExecState* exec, JSValue value) 82 82 { 83 HTMLInputElement* input = static_cast<HTMLInputElement*>(impl());83 HTMLInputElement* input = toHTMLInputElement(impl()); 84 84 if (!input->canHaveSelection()) { 85 85 throwTypeError(exec); … … 92 92 JSValue JSHTMLInputElement::setSelectionRange(ExecState* exec) 93 93 { 94 HTMLInputElement* input = static_cast<HTMLInputElement*>(impl());94 HTMLInputElement* input = toHTMLInputElement(impl()); 95 95 if (!input->canHaveSelection()) 96 96 return throwTypeError(exec); -
trunk/Source/WebCore/css/StyleResolver.cpp
r152006 r152149 1539 1539 // Don't apply intrinsic margins to image buttons. The designer knows how big the images are, 1540 1540 // so we have to treat all image buttons as though they were explicitly sized. 1541 if (! e->hasTagName(inputTag) || !static_cast<HTMLInputElement*>(e)->isImageButton())1541 if (!isHTMLInputElement(e) || !toHTMLInputElement(e)->isImageButton()) 1542 1542 addIntrinsicMargins(style); 1543 1543 } -
trunk/Source/WebCore/editing/FrameSelection.cpp
r151949 r152149 1698 1698 { 1699 1699 HTMLTextFormControlElement* textControl = enclosingTextFormControl(start()); 1700 return textControl && textControl->hasTagName(inputTag) && static_cast<HTMLInputElement*>(textControl)->isPasswordField();1700 return textControl && isHTMLInputElement(textControl) && toHTMLInputElement(textControl)->isPasswordField(); 1701 1701 } 1702 1702 -
trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp
r151698 r152149 1250 1250 1251 1251 Element* textControl = enclosingTextFormControl(positionAtStartOfInsertedContent().deepEquivalent()); 1252 if (textControl && textControl->hasTagName(inputTag) && static_cast<HTMLInputElement*>(textControl)->isPasswordField())1252 if (textControl && isHTMLInputElement(textControl) && toHTMLInputElement(textControl)->isPasswordField()) 1253 1253 return false; // Disable smart replace for password fields. 1254 1254 -
trunk/Source/WebCore/html/HTMLFormControlElement.cpp
r151282 r152149 189 189 // FIXME: Should this set of hasTagName checks be replaced by a 190 190 // virtual member function? 191 if ( element->hasTagName(inputTag))192 return ! static_cast<HTMLInputElement*>(element)->isInputTypeHidden();191 if (isHTMLInputElement(element)) 192 return !toHTMLInputElement(element)->isInputTypeHidden(); 193 193 if (element->hasTagName(selectTag)) 194 194 return true; -
trunk/Source/WebCore/html/HTMLFormElement.cpp
r151947 r152149 301 301 FormAssociatedElement* control = m_associatedElements[i]; 302 302 HTMLElement* element = toHTMLElement(control); 303 if (! element->hasLocalName(inputTag))303 if (!isHTMLInputElement(element)) 304 304 continue; 305 305 306 HTMLInputElement* input = static_cast<HTMLInputElement*>(control);306 HTMLInputElement* input = toHTMLInputElement(element); 307 307 if (!input->isTextField()) 308 308 continue; -
trunk/Source/WebCore/html/HTMLInputElement.h
r151572 r152149 440 440 }; 441 441 442 inline bool isHTMLInputElement(Node* node) 443 { 444 return node->hasTagName(HTMLNames::inputTag); 445 } 446 447 inline HTMLInputElement* toHTMLInputElement(Node* node) 448 { 449 ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLInputElement(node)); 450 return static_cast<HTMLInputElement*>(node); 451 } 452 442 453 } //namespace 443 454 #endif -
trunk/Source/WebCore/html/RadioInputType.cpp
r151986 r152149 92 92 break; 93 93 // Look for more radio buttons. 94 if (! node->hasTagName(inputTag))94 if (!isHTMLInputElement(node)) 95 95 continue; 96 RefPtr<HTMLInputElement> inputElement = static_cast<HTMLInputElement*>(node);96 RefPtr<HTMLInputElement> inputElement = toHTMLInputElement(node); 97 97 if (inputElement->form() != element()->form()) 98 98 break; … … 130 130 // skip any other elements in the group. 131 131 Element* currentFocusedNode = element()->document()->focusedElement(); 132 if (currentFocusedNode && currentFocusedNode->hasTagName(inputTag)) {133 HTMLInputElement* focusedInput = static_cast<HTMLInputElement*>(currentFocusedNode);132 if (currentFocusedNode && isHTMLInputElement(currentFocusedNode)) { 133 HTMLInputElement* focusedInput = toHTMLInputElement(currentFocusedNode); 134 134 if (focusedInput->isRadioButton() && focusedInput->form() == element()->form() && focusedInput->name() == element()->name()) 135 135 return false; -
trunk/Source/WebCore/html/shadow/MediaControlElementTypes.cpp
r148131 r152149 70 70 ASSERT_WITH_SECURITY_IMPLICATION(node->isMediaControlElement()); 71 71 HTMLElement* element = toHTMLElement(node); 72 if ( element->hasTagName(inputTag))72 if (isHTMLInputElement(element)) 73 73 return static_cast<MediaControlInputElement*>(element)->displayType(); 74 74 return static_cast<MediaControlDivElement*>(element)->displayType(); -
trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp
r151947 r152149 156 156 { 157 157 // On mousedown, bring up a menu, if needed 158 HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowHost());158 HTMLInputElement* input = toHTMLInputElement(shadowHost()); 159 159 if (input && event->type() == eventNames().mousedownEvent && event->isMouseEvent() && static_cast<MouseEvent*>(event)->button() == LeftButton) { 160 160 input->focus(); … … 209 209 { 210 210 // If the element is visible, on mouseup, clear the value, and set selection 211 RefPtr<HTMLInputElement> input( static_cast<HTMLInputElement*>(shadowHost()));211 RefPtr<HTMLInputElement> input(toHTMLInputElement(shadowHost())); 212 212 if (!input || input->isDisabledOrReadOnly()) { 213 213 if (!event->defaultHandled()) … … 248 248 bool SearchFieldCancelButtonElement::willRespondToMouseClickEvents() 249 249 { 250 const HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowHost());250 const HTMLInputElement* input = toHTMLInputElement(shadowHost()); 251 251 if (input && !input->isDisabledOrReadOnly()) 252 252 return true; … … 293 293 // remove the input element from DOM. To make sure it remains valid until we finish our work 294 294 // here, we take a temporary reference. 295 RefPtr<HTMLInputElement> input( static_cast<HTMLInputElement*>(shadowHost()));295 RefPtr<HTMLInputElement> input(toHTMLInputElement(shadowHost())); 296 296 297 297 if (!input || input->isDisabledOrReadOnly()) { … … 345 345 bool InputFieldSpeechButtonElement::willRespondToMouseClickEvents() 346 346 { 347 const HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowHost());347 const HTMLInputElement* input = toHTMLInputElement(shadowHost()); 348 348 if (input && !input->isDisabledOrReadOnly()) 349 349 return true; … … 382 382 // remove the input element from DOM. To make sure it remains valid until we finish our work 383 383 // here, we take a temporary reference. 384 RefPtr<HTMLInputElement> input( static_cast<HTMLInputElement*>(shadowHost()));384 RefPtr<HTMLInputElement> input(toHTMLInputElement(shadowHost())); 385 385 if (!input || input->isDisabledOrReadOnly()) 386 386 return; … … 435 435 return; 436 436 437 RefPtr<HTMLInputElement> input = static_cast<HTMLInputElement*>(shadowHost());437 RefPtr<HTMLInputElement> input = toHTMLInputElement(shadowHost()); 438 438 AtomicString language = input->computeInheritedLanguage(); 439 439 String grammar = input->getAttribute(webkitgrammarAttr); -
trunk/Source/WebCore/loader/FormSubmission.cpp
r147135 r152149 190 190 if (!element->isDisabledFormControl()) 191 191 control->appendFormData(*domFormData, isMultiPartForm); 192 if ( element->hasLocalName(inputTag)) {193 HTMLInputElement* input = static_cast<HTMLInputElement*>(control);192 if (isHTMLInputElement(element)) { 193 HTMLInputElement* input = toHTMLInputElement(element); 194 194 if (input->isTextField()) { 195 195 formValues.append(pair<String, String>(input->name().string(), input->value())); -
trunk/Source/WebCore/page/Chrome.cpp
r151926 r152149 408 408 if (Node* node = result.innerNonSharedNode()) { 409 409 // Get tooltip representing form action, if relevant 410 if ( node->hasTagName(inputTag)) {411 HTMLInputElement* input = static_cast<HTMLInputElement*>(node);410 if (isHTMLInputElement(node)) { 411 HTMLInputElement* input = toHTMLInputElement(node); 412 412 if (input->isSubmitButton()) 413 413 if (HTMLFormElement* form = input->form()) { … … 440 440 if (toolTip.isEmpty()) { 441 441 if (Node* node = result.innerNonSharedNode()) { 442 if ( node->hasTagName(inputTag)) {443 HTMLInputElement* input = static_cast<HTMLInputElement*>(node);442 if (isHTMLInputElement(node)) { 443 HTMLInputElement* input = toHTMLInputElement(node); 444 444 toolTip = input->defaultToolTip(); 445 445 -
trunk/Source/WebCore/page/EventHandler.cpp
r151840 r152149 1198 1198 static bool isSubmitImage(Node* node) 1199 1199 { 1200 return node && node->hasTagName(inputTag) && static_cast<HTMLInputElement*>(node)->isImageButton();1200 return node && isHTMLInputElement(node) && toHTMLInputElement(node)->isImageButton(); 1201 1201 } 1202 1202 … … 1623 1623 // we'd like to EventHandler::handleMousePressEvent to pass the event to the widget and thus the 1624 1624 // event target node can't still be the shadow node. 1625 if (mev.targetNode()->isShadowRoot() && toShadowRoot(mev.targetNode())->host()->hasTagName(inputTag)) {1625 if (mev.targetNode()->isShadowRoot() && isHTMLInputElement(toShadowRoot(mev.targetNode())->host())) { 1626 1626 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent); 1627 1627 mev = m_frame->document()->prepareMouseEvent(request, documentPoint, mouseEvent); -
trunk/Source/WebCore/page/FocusController.cpp
r151996 r152149 45 45 #include "HTMLAreaElement.h" 46 46 #include "HTMLImageElement.h" 47 #include "HTMLInputElement.h" 47 48 #include "HTMLNames.h" 48 49 #include "HitTestResult.h" … … 584 585 585 586 if (Node* shadowAncestorNode = root->deprecatedShadowAncestorNode()) { 586 if (! shadowAncestorNode->hasTagName(inputTag) && !shadowAncestorNode->hasTagName(textareaTag))587 if (!isHTMLInputElement(shadowAncestorNode) && !shadowAncestorNode->hasTagName(textareaTag)) 587 588 return; 588 589 } -
trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp
r150334 r152149 26 26 #include "Editor.h" 27 27 #include "Frame.h" 28 #include "HTMLInputElement.h" 28 29 #include "HTMLNames.h" 29 30 #include "HTMLParserIdioms.h" … … 199 200 // FIXME: Later this code should be shared with Chromium somehow. Chances are all platforms want it. 200 201 AtomicString urlString; 201 if (node->hasTagName(HTMLNames::imgTag) || node->hasTagName(HTMLNames::inputTag))202 if (node->hasTagName(HTMLNames::imgTag) || isHTMLInputElement(node)) 202 203 urlString = toElement(node)->getAttribute(HTMLNames::srcAttr); 203 204 #if ENABLE(SVG) -
trunk/Source/WebCore/platform/qt/RenderThemeQt.cpp
r151783 r152149 742 742 p->painter->drawRect(left, top, width, height); 743 743 744 if (!o->node() || ! o->node()->hasTagName(inputTag))745 return false; 746 747 HTMLInputElement* slider = static_cast<HTMLInputElement*>(o->node());744 if (!o->node() || !isHTMLInputElement(o->node())) 745 return false; 746 747 HTMLInputElement* slider = toHTMLInputElement(o->node()); 748 748 749 749 // Position the inner rectangle -
trunk/Source/WebCore/platform/qt/RenderThemeQtMobile.cpp
r145596 r152149 867 867 return true; 868 868 869 HTMLInputElement* slider = static_cast<HTMLInputElement*>(o->node());869 HTMLInputElement* slider = toHTMLInputElement(o->node()); 870 870 871 871 const double min = slider->minimum(); -
trunk/Source/WebCore/rendering/HitTestResult.cpp
r151996 r152149 277 277 } 278 278 279 if ( m_innerNonSharedNode->hasTagName(inputTag)) {280 HTMLInputElement* input = static_cast<HTMLInputElement*>(m_innerNonSharedNode.get());279 if (isHTMLInputElement(m_innerNonSharedNode.get())) { 280 HTMLInputElement* input = toHTMLInputElement(m_innerNonSharedNode.get()); 281 281 return displayString(input->alt(), m_innerNonSharedNode.get()); 282 282 } … … 318 318 if (m_innerNonSharedNode->hasTagName(embedTag) 319 319 || m_innerNonSharedNode->hasTagName(imgTag) 320 || m_innerNonSharedNode->hasTagName(inputTag)321 || m_innerNonSharedNode->hasTagName(objectTag) 320 || isHTMLInputElement(m_innerNonSharedNode.get()) 321 || m_innerNonSharedNode->hasTagName(objectTag) 322 322 #if ENABLE(SVG) 323 323 || m_innerNonSharedNode->hasTagName(SVGNames::imageTag) … … 572 572 return true; 573 573 574 if ( m_innerNonSharedNode->hasTagName(inputTag))575 return static_cast<HTMLInputElement*>(m_innerNonSharedNode.get())->isTextField();574 if (isHTMLInputElement(m_innerNonSharedNode.get())) 575 return toHTMLInputElement(m_innerNonSharedNode.get())->isTextField(); 576 576 577 577 return m_innerNonSharedNode->rendererIsEditable(); -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r152122 r152149 35 35 #include "FrameView.h" 36 36 #include "GraphicsContext.h" 37 #include "HTMLInputElement.h" 37 38 #include "HTMLNames.h" 38 39 #include "HitTestLocation.h" … … 6483 6484 return true; 6484 6485 6485 if (node()->isShadowRoot() && toShadowRoot(node())->host()->hasTagName(inputTag))6486 if (node()->isShadowRoot() && isHTMLInputElement(toShadowRoot(node())->host())) 6486 6487 return true; 6487 6488 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r152122 r152149 35 35 #include "HTMLElement.h" 36 36 #include "HTMLFrameOwnerElement.h" 37 #include "HTMLInputElement.h" 37 38 #include "HTMLNames.h" 38 39 #include "FloatQuad.h" … … 2303 2304 // FIXME: Think about block-flow here. 2304 2305 // https://bugs.webkit.org/show_bug.cgi?id=46473 2305 if (logicalWidth.type() == Auto && !isStretchingColumnFlexItem(this) && node() && ( node()->hasTagName(inputTag) || node()->hasTagName(selectTag) || node()->hasTagName(buttonTag) || node()->hasTagName(textareaTag) || node()->hasTagName(legendTag)))2306 if (logicalWidth.type() == Auto && !isStretchingColumnFlexItem(this) && node() && (isHTMLInputElement(node()) || node()->hasTagName(selectTag) || node()->hasTagName(buttonTag) || node()->hasTagName(textareaTag) || node()->hasTagName(legendTag))) 2306 2307 return true; 2307 2308 -
trunk/Source/WebCore/rendering/RenderButton.cpp
r147261 r152149 123 123 { 124 124 // If we're an input element, we may need to change our button text. 125 if ( node()->hasTagName(inputTag)) {126 HTMLInputElement* input = static_cast<HTMLInputElement*>(node());125 if (isHTMLInputElement(node())) { 126 HTMLInputElement* input = toHTMLInputElement(node()); 127 127 String value = input->valueWithDefault(); 128 128 setText(value); … … 158 158 // write the code assuming any other button types that might emerge in the future 159 159 // can also have children. 160 return ! node()->hasTagName(inputTag);160 return !isHTMLInputElement(node()); 161 161 } 162 162 -
trunk/Source/WebCore/rendering/RenderDetailsMarker.cpp
r150876 r152149 25 25 #include "Element.h" 26 26 #include "GraphicsContext.h" 27 #include "HTMLInputElement.h" 27 28 #include "HTMLNames.h" 28 29 #include "PaintInfo.h" … … 145 146 if (renderer->node()->hasTagName(detailsTag)) 146 147 return !toElement(renderer->node())->getAttribute(openAttr).isNull(); 147 if ( renderer->node()->hasTagName(inputTag))148 if (isHTMLInputElement(renderer->node())) 148 149 return true; 149 150 } -
trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp
r149549 r152149 69 69 void RenderFileUploadControl::updateFromElement() 70 70 { 71 HTMLInputElement* input = static_cast<HTMLInputElement*>(node());71 HTMLInputElement* input = toHTMLInputElement(node()); 72 72 ASSERT(input->isFileUpload()); 73 73 … … 95 95 int RenderFileUploadControl::maxFilenameWidth() const 96 96 { 97 HTMLInputElement* input = static_cast<HTMLInputElement*>(node());97 HTMLInputElement* input = toHTMLInputElement(node()); 98 98 return max(0, contentBoxRect().pixelSnappedWidth() - nodeWidth(uploadButton()) - afterButtonSpacing 99 99 - (input->icon() ? iconWidth + iconFilenameSpacing : 0)); … … 128 128 return; 129 129 130 HTMLInputElement* input = static_cast<HTMLInputElement*>(node());130 HTMLInputElement* input = toHTMLInputElement(node()); 131 131 LayoutUnit buttonWidth = nodeWidth(button); 132 132 LayoutUnit buttonAndIconWidth = buttonWidth + afterButtonSpacing … … 227 227 HTMLInputElement* RenderFileUploadControl::uploadButton() const 228 228 { 229 HTMLInputElement* input = static_cast<HTMLInputElement*>(node());229 HTMLInputElement* input = toHTMLInputElement(node()); 230 230 231 231 ASSERT(input->shadow()); 232 232 233 233 Node* buttonNode = input->shadow()->shadowRoot()->firstChild(); 234 return buttonNode && buttonNode->isHTMLElement() && buttonNode->hasTagName(inputTag) ? static_cast<HTMLInputElement*>(buttonNode) : 0;234 return buttonNode && buttonNode->isHTMLElement() && isHTMLInputElement(buttonNode) ? toHTMLInputElement(buttonNode) : 0; 235 235 } 236 236 … … 245 245 String RenderFileUploadControl::fileTextValue() const 246 246 { 247 HTMLInputElement* input = static_cast<HTMLInputElement*>(node());247 HTMLInputElement* input = toHTMLInputElement(node()); 248 248 ASSERT(input->files()); 249 249 return theme()->fileListNameForWidth(input->files(), style()->font(), maxFilenameWidth(), input->multiple()); -
trunk/Source/WebCore/rendering/RenderImage.cpp
r151996 r152149 558 558 return; 559 559 560 if ( node()->hasTagName(inputTag))561 m_altText = static_cast<HTMLInputElement*>(node())->altText();560 if (isHTMLInputElement(node())) 561 m_altText = toHTMLInputElement(node())->altText(); 562 562 else if (node()->hasTagName(imgTag)) 563 563 m_altText = static_cast<HTMLImageElement*>(node())->altText(); -
trunk/Source/WebCore/testing/Internals.cpp
r151727 r152149 704 704 void Internals::selectColorInColorChooser(Element* element, const String& colorValue) 705 705 { 706 if (! element->hasTagName(inputTag))706 if (!isHTMLInputElement(element)) 707 707 return; 708 708 HTMLInputElement* inputElement = element->toInputElement(); -
trunk/Source/WebKit/blackberry/Api/WebPage.cpp
r151996 r152149 2230 2230 } 2231 2231 context.setFlag(Platform::WebContext::IsInput); 2232 if ( element->hasTagName(HTMLNames::inputTag))2232 if (isHTMLInputElement(element)) 2233 2233 context.setFlag(Platform::WebContext::IsSingleLine); 2234 2234 if (DOMSupport::isPasswordElement(element)) … … 2832 2832 double blockExpansionRatio = 5.0 * blockToPageRatio * blockToPageRatio; 2833 2833 2834 if (!tnode->hasTagName(HTMLNames::imgTag) && ! tnode->hasTagName(HTMLNames::inputTag) && !tnode->hasTagName(HTMLNames::textareaTag)) {2834 if (!tnode->hasTagName(HTMLNames::imgTag) && !isHTMLInputElement(tnode) && !tnode->hasTagName(HTMLNames::textareaTag)) { 2835 2835 while ((tnode = tnode->parentNode())) { 2836 2836 ASSERT(tnode); -
trunk/Source/WebKit/blackberry/ChangeLog
r152102 r152149 1 2013-06-27 Kangil Han <kangil.han@samsung.com> 2 3 Adopt is/toHTMLInputElement for code cleanup 4 https://bugs.webkit.org/show_bug.cgi?id=118130 5 6 Reviewed by Antti Koivisto. 7 8 To enhance readability, this patch adopts is/toHTMLInputElement. 9 This also helps out to reduce duplicated use of static_cast. 10 11 * Api/WebPage.cpp: 12 (BlackBerry::WebKit::WebPagePrivate::webContext): 13 (BlackBerry::WebKit::WebPagePrivate::blockZoomRectForNode): 14 * WebCoreSupport/CredentialTransformData.cpp: 15 (WebCore::CredentialTransformData::findPasswordFormFields): 16 * WebCoreSupport/EditorClientBlackBerry.cpp: 17 (WebCore::EditorClientBlackBerry::shouldSpellCheckFocusedField): 18 * WebKitSupport/DOMSupport.cpp: 19 (BlackBerry::WebKit::DOMSupport::isPasswordElement): 20 (BlackBerry::WebKit::DOMSupport::inputElementText): 21 (BlackBerry::WebKit::DOMSupport::isDateTimeInputField): 22 (BlackBerry::WebKit::DOMSupport::isColorInputField): 23 (BlackBerry::WebKit::DOMSupport::elementIdOrNameIndicatesNoAutocomplete): 24 * WebKitSupport/InputHandler.cpp: 25 (BlackBerry::WebKit::InputHandler::elementType): 26 (BlackBerry::WebKit::InputHandler::setInputValue): 27 (BlackBerry::WebKit::InputHandler::extractedTextRequest): 28 (BlackBerry::WebKit::InputHandler::showTextInputTypeSuggestionBox): 29 1 30 2013-06-27 Nima Ghanavatian <nghanavatian@blackberry.com> 2 31 -
trunk/Source/WebKit/blackberry/WebCoreSupport/CredentialTransformData.cpp
r151514 r152149 145 145 continue; 146 146 HTMLFormControlElement* formElement = static_cast<HTMLFormControlElement*>(formElements[i]); 147 if (! formElement->hasTagName(HTMLNames::inputTag))147 if (!isHTMLInputElement(formElement)) 148 148 continue; 149 149 … … 167 167 continue; 168 168 HTMLFormControlElement* formElement = static_cast<HTMLFormControlElement*>(formElements[i]); 169 if (! formElement->hasTagName(HTMLNames::inputTag))169 if (!isHTMLInputElement(formElement)) 170 170 continue; 171 171 -
trunk/Source/WebKit/blackberry/WebCoreSupport/EditorClientBlackBerry.cpp
r152102 r152149 111 111 if (node->isElementNode()) { 112 112 const Element* element = toElement(node); 113 if ( element->hasTagName(HTMLNames::inputTag) && !DOMSupport::elementSupportsAutocomplete(element))113 if (isHTMLInputElement(element) && !DOMSupport::elementSupportsAutocomplete(element)) 114 114 return false; 115 115 } -
trunk/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp
r150140 r152149 110 110 bool isPasswordElement(const Element* element) 111 111 { 112 return element && element->hasTagName(HTMLNames::inputTag)113 && static_cast<const HTMLInputElement*>(element)->isPasswordField();112 return element && isHTMLInputElement(element) 113 && toHTMLInputElement(element)->isPasswordField(); 114 114 } 115 115 … … 120 120 121 121 WTF::String elementText; 122 if ( element->hasTagName(HTMLNames::inputTag)) {123 const HTMLInputElement* inputElement = static_cast<const HTMLInputElement*>(element);122 if (isHTMLInputElement(element)) { 123 const HTMLInputElement* inputElement = toHTMLInputElement(element); 124 124 elementText = inputElement->value(); 125 125 } else if (element->hasTagName(HTMLNames::textareaTag)) { … … 181 181 bool isDateTimeInputField(const Element* element) 182 182 { 183 if (! element->hasTagName(HTMLNames::inputTag))184 return false; 185 186 const HTMLInputElement* inputElement = static_cast<const HTMLInputElement*>(element);183 if (!isHTMLInputElement(element)) 184 return false; 185 186 const HTMLInputElement* inputElement = toHTMLInputElement(element); 187 187 188 188 // The following types have popup's. … … 199 199 bool isColorInputField(const Element* element) 200 200 { 201 if (! element->hasTagName(HTMLNames::inputTag))202 return false; 203 204 const HTMLInputElement* inputElement = static_cast<const HTMLInputElement*>(element);201 if (!isHTMLInputElement(element)) 202 return false; 203 204 const HTMLInputElement* inputElement = toHTMLInputElement(element); 205 205 206 206 #if ENABLE(INPUT_TYPE_COLOR) … … 395 395 bool elementIdOrNameIndicatesNoAutocomplete(const Element* element) 396 396 { 397 if (! element->hasTagName(HTMLNames::inputTag))397 if (!isHTMLInputElement(element)) 398 398 return false; 399 399 -
trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
r151809 r152149 411 411 BlackBerryInputType InputHandler::elementType(Element* element) const 412 412 { 413 if (const HTMLInputElement* inputElement = static_cast<const HTMLInputElement*>(element->toInputElement()))413 if (const HTMLInputElement* inputElement = toHTMLInputElement(element)) 414 414 return convertInputType(inputElement); 415 415 … … 1321 1321 return; 1322 1322 1323 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_currentFocusElement.get());1323 HTMLInputElement* inputElement = toHTMLInputElement(m_currentFocusElement.get()); 1324 1324 inputElement->setValue(value); 1325 1325 clearCurrentFocusElement(); … … 2340 2340 // selectionActive is not limited to inside the extracted text. 2341 2341 bool selectionActive = extractedText->selection_start != extractedText->selection_end; 2342 bool singleLine = m_currentFocusElement->hasTagName(HTMLNames::inputTag);2342 bool singleLine = isHTMLInputElement(m_currentFocusElement); 2343 2343 2344 2344 // FIXME flags has two values in doc, enum not in header yet. … … 2702 2702 return; 2703 2703 2704 HTMLInputElement* focusedInputElement = static_cast<HTMLInputElement*>(m_currentFocusElement->toInputElement());2704 HTMLInputElement* focusedInputElement = toHTMLInputElement(m_currentFocusElement->toInputElement()); 2705 2705 if (!focusedInputElement) 2706 2706 return; -
trunk/Source/WebKit/efl/ChangeLog
r152071 r152149 1 2013-06-27 Kangil Han <kangil.han@samsung.com> 2 3 Adopt is/toHTMLInputElement for code cleanup 4 https://bugs.webkit.org/show_bug.cgi?id=118130 5 6 Reviewed by Antti Koivisto. 7 8 To enhance readability, this patch adopts is/toHTMLInputElement. 9 This also helps out to reduce duplicated use of static_cast. 10 11 * ewk/ewk_view.cpp: 12 (ewk_view_input_method_state_set): 13 1 14 2013-06-26 Ryuan Choi <ryuan.choi@samsung.com> 2 15 -
trunk/Source/WebKit/efl/ewk/ewk_view.cpp
r152071 r152149 2963 2963 && focusedFrame->document() 2964 2964 && focusedFrame->document()->focusedElement() 2965 && focusedFrame->document()->focusedElement()->hasTagName(WebCore::HTMLNames::inputTag)) {2965 && isHTMLInputElement(focusedFrame->document()->focusedElement())) { 2966 2966 WebCore::HTMLInputElement* inputElement; 2967 2967 -
trunk/Source/WebKit/mac/ChangeLog
r151981 r152149 1 2013-06-27 Kangil Han <kangil.han@samsung.com> 2 3 Adopt is/toHTMLInputElement for code cleanup 4 https://bugs.webkit.org/show_bug.cgi?id=118130 5 6 Reviewed by Antti Koivisto. 7 8 To enhance readability, this patch adopts is/toHTMLInputElement. 9 This also helps out to reduce duplicated use of static_cast. 10 11 * DOM/WebDOMOperations.mm: 12 (-[DOMHTMLInputElement _setAutofilled:]): 13 * WebCoreSupport/WebChromeClient.mm: 14 (WebChromeClient::focusedNodeChanged): 15 * WebCoreSupport/WebEditorClient.mm: 16 (WebEditorClient::textFieldDidBeginEditing): 17 (WebEditorClient::textFieldDidEndEditing): 18 (WebEditorClient::textDidChangeInTextField): 19 (WebEditorClient::doTextFieldCommandFromEvent): 20 (WebEditorClient::textWillBeDeletedInTextField): 21 * WebView/WebHTMLRepresentation.mm: 22 (inputElementFromDOMElement): 23 1 24 2013-06-26 Kangil Han <kangil.han@samsung.com> 2 25 -
trunk/Source/WebKit/mac/DOM/WebDOMOperations.mm
r151070 r152149 200 200 - (void)_setAutofilled:(BOOL)autofilled 201 201 { 202 static_cast<HTMLInputElement*>(core((DOMElement *)self))->setAutofilled(autofilled);202 toHTMLInputElement(core((DOMElement *)self))->setAutofilled(autofilled); 203 203 } 204 204 -
trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
r151804 r152149 201 201 if (!node) 202 202 return; 203 if (! node->hasTagName(inputTag))203 if (!isHTMLInputElement(node)) 204 204 return; 205 205 206 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(node);206 HTMLInputElement* inputElement = toHTMLInputElement(node); 207 207 if (!inputElement->isText()) 208 208 return; -
trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm
r150230 r152149 633 633 void WebEditorClient::textFieldDidBeginEditing(Element* element) 634 634 { 635 if (! element->hasTagName(inputTag))635 if (!isHTMLInputElement(element)) 636 636 return; 637 637 638 DOMHTMLInputElement* inputElement = kit( static_cast<HTMLInputElement*>(element));638 DOMHTMLInputElement* inputElement = kit(toHTMLInputElement(element)); 639 639 FormDelegateLog(inputElement); 640 640 CallFormDelegate(m_webView, @selector(textFieldDidBeginEditing:inFrame:), inputElement, kit(element->document()->frame())); … … 643 643 void WebEditorClient::textFieldDidEndEditing(Element* element) 644 644 { 645 if (! element->hasTagName(inputTag))645 if (!isHTMLInputElement(element)) 646 646 return; 647 647 648 DOMHTMLInputElement* inputElement = kit( static_cast<HTMLInputElement*>(element));648 DOMHTMLInputElement* inputElement = kit(toHTMLInputElement(element)); 649 649 FormDelegateLog(inputElement); 650 650 CallFormDelegate(m_webView, @selector(textFieldDidEndEditing:inFrame:), inputElement, kit(element->document()->frame())); … … 653 653 void WebEditorClient::textDidChangeInTextField(Element* element) 654 654 { 655 if (! element->hasTagName(inputTag))655 if (!isHTMLInputElement(element)) 656 656 return; 657 657 … … 659 659 return; 660 660 661 DOMHTMLInputElement* inputElement = kit( static_cast<HTMLInputElement*>(element));661 DOMHTMLInputElement* inputElement = kit(toHTMLInputElement(element)); 662 662 FormDelegateLog(inputElement); 663 663 CallFormDelegate(m_webView, @selector(textDidChangeInTextField:inFrame:), inputElement, kit(element->document()->frame())); … … 689 689 bool WebEditorClient::doTextFieldCommandFromEvent(Element* element, KeyboardEvent* event) 690 690 { 691 if (! element->hasTagName(inputTag))691 if (!isHTMLInputElement(element)) 692 692 return NO; 693 693 694 DOMHTMLInputElement* inputElement = kit( static_cast<HTMLInputElement*>(element));694 DOMHTMLInputElement* inputElement = kit(toHTMLInputElement(element)); 695 695 FormDelegateLog(inputElement); 696 696 if (SEL commandSelector = selectorForKeyEvent(event)) … … 701 701 void WebEditorClient::textWillBeDeletedInTextField(Element* element) 702 702 { 703 if (! element->hasTagName(inputTag))703 if (!isHTMLInputElement(element)) 704 704 return; 705 705 706 DOMHTMLInputElement* inputElement = kit( static_cast<HTMLInputElement*>(element));706 DOMHTMLInputElement* inputElement = kit(toHTMLInputElement(element)); 707 707 FormDelegateLog(inputElement); 708 708 // We're using the deleteBackward selector for all deletion operations since the autofill code treats all deletions the same way. -
trunk/Source/WebKit/mac/WebView/WebHTMLRepresentation.mm
r150140 r152149 304 304 { 305 305 Element* node = core(element); 306 return node && node->hasTagName(inputTag) ? static_cast<HTMLInputElement*>(node) : 0;306 return node && isHTMLInputElement(node) ? toHTMLInputElement(node) : 0; 307 307 } 308 308 -
trunk/Source/WebKit/qt/ChangeLog
r152080 r152149 1 2013-06-27 Kangil Han <kangil.han@samsung.com> 2 3 Adopt is/toHTMLInputElement for code cleanup 4 https://bugs.webkit.org/show_bug.cgi?id=118130 5 6 Reviewed by Antti Koivisto. 7 8 To enhance readability, this patch adopts is/toHTMLInputElement. 9 This also helps out to reduce duplicated use of static_cast. 10 11 * WebCoreSupport/EditorClientQt.cpp: 12 (WebCore::EditorClientQt::setInputMethodState): 13 * WebCoreSupport/QWebPageAdapter.cpp: 14 (QWebPageAdapter::inputMethodQuery): 15 1 16 2013-06-26 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 17 -
trunk/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
r150796 r152149 620 620 Frame* frame = m_page->page->focusController()->focusedOrMainFrame(); 621 621 if (frame && frame->document() && frame->document()->focusedElement()) 622 if ( frame->document()->focusedElement()->hasTagName(HTMLNames::inputTag))623 inputElement = static_cast<HTMLInputElement*>(frame->document()->focusedElement());622 if (isHTMLInputElement(frame->document()->focusedElement())) 623 inputElement = toHTMLInputElement(frame->document()->focusedElement()); 624 624 625 625 if (inputElement) { -
trunk/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
r150796 r152149 711 711 if (frame->selection()->isContentEditable()) { 712 712 if (frame->document() && frame->document()->focusedElement()) { 713 if ( frame->document()->focusedElement()->hasTagName(HTMLNames::inputTag)) {714 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(frame->document()->focusedElement());713 if (isHTMLInputElement(frame->document()->focusedElement())) { 714 HTMLInputElement* inputElement = toHTMLInputElement(frame->document()->focusedElement()); 715 715 return QVariant(inputElement->maxLength()); 716 716 } -
trunk/Source/WebKit/win/ChangeLog
r152143 r152149 1 2013-06-27 Kangil Han <kangil.han@samsung.com> 2 3 Adopt is/toHTMLInputElement for code cleanup 4 https://bugs.webkit.org/show_bug.cgi?id=118130 5 6 Reviewed by Antti Koivisto. 7 8 To enhance readability, this patch adopts is/toHTMLInputElement. 9 This also helps out to reduce duplicated use of static_cast. 10 11 * DOMCoreClasses.cpp: 12 (DOMElement::createInstance): 13 * DOMHTMLClasses.cpp: 14 (DOMHTMLInputElement::form): 15 (DOMHTMLInputElement::disabled): 16 (DOMHTMLInputElement::readOnly): 17 (DOMHTMLInputElement::setType): 18 (DOMHTMLInputElement::value): 19 (DOMHTMLInputElement::setValue): 20 (DOMHTMLInputElement::setValueForUser): 21 (DOMHTMLInputElement::select): 22 (DOMHTMLInputElement::setSelectionStart): 23 (DOMHTMLInputElement::selectionStart): 24 (DOMHTMLInputElement::setSelectionEnd): 25 (DOMHTMLInputElement::selectionEnd): 26 (DOMHTMLInputElement::isTextField): 27 (DOMHTMLInputElement::rectOnScreen): 28 (DOMHTMLInputElement::replaceCharactersInRange): 29 (DOMHTMLInputElement::selectedRange): 30 (DOMHTMLInputElement::setAutofilled): 31 (DOMHTMLInputElement::isAutofilled): 32 (DOMHTMLInputElement::isUserEdited): 33 * WebFrame.cpp: 34 (inputElementFromDOMElement): 35 1 36 2013-06-27 Anders Carlsson <andersca@apple.com> 2 37 -
trunk/Source/WebKit/win/DOMCoreClasses.cpp
r151949 r152149 1501 1501 DOMHTMLIFrameElement* newElement = new DOMHTMLIFrameElement(e); 1502 1502 hr = newElement->QueryInterface(IID_IDOMElement, (void**)&domElement); 1503 } else if ( e->hasTagName(inputTag)) {1503 } else if (isHTMLInputElement(e)) { 1504 1504 DOMHTMLInputElement* newElement = new DOMHTMLInputElement(e); 1505 1505 hr = newElement->QueryInterface(IID_IDOMElement, (void**)&domElement); -
trunk/Source/WebKit/win/DOMHTMLClasses.cpp
r151949 r152149 996 996 return E_POINTER; 997 997 *result = 0; 998 ASSERT(m_element && m_element->hasTagName(inputTag));999 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);998 ASSERT(m_element && isHTMLInputElement(m_element)); 999 HTMLInputElement* inputElement = toHTMLInputElement(m_element); 1000 1000 COMPtr<IDOMElement> domElement; 1001 1001 domElement.adoptRef(DOMHTMLElement::createInstance(inputElement->form())); … … 1078 1078 /* [retval][out] */ BOOL* result) 1079 1079 { 1080 ASSERT(m_element && m_element->hasTagName(inputTag));1081 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);1080 ASSERT(m_element && isHTMLInputElement(m_element)); 1081 HTMLInputElement* inputElement = toHTMLInputElement(m_element); 1082 1082 *result = inputElement->isDisabledFormControl() ? TRUE : FALSE; 1083 1083 return S_OK; … … 1122 1122 /* [retval][out] */ BOOL* result) 1123 1123 { 1124 ASSERT(m_element && m_element->hasTagName(inputTag));1125 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);1124 ASSERT(m_element && isHTMLInputElement(m_element)); 1125 HTMLInputElement* inputElement = toHTMLInputElement(m_element); 1126 1126 *result = inputElement->isReadOnly() ? TRUE : FALSE; 1127 1127 return S_OK; … … 1187 1187 /* [in] */ BSTR type) 1188 1188 { 1189 ASSERT(m_element && m_element->hasTagName(inputTag));1190 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);1189 ASSERT(m_element && isHTMLInputElement(m_element)); 1190 HTMLInputElement* inputElement = toHTMLInputElement(m_element); 1191 1191 WTF::String typeString(type, SysStringLen(type)); 1192 1192 inputElement->setType(typeString); … … 1211 1211 /* [retval][out] */ BSTR* result) 1212 1212 { 1213 ASSERT(m_element && m_element->hasTagName(inputTag));1214 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);1213 ASSERT(m_element && isHTMLInputElement(m_element)); 1214 HTMLInputElement* inputElement = toHTMLInputElement(m_element); 1215 1215 WTF::String valueString = inputElement->value(); 1216 1216 *result = BString(valueString.characters(), valueString.length()).release(); … … 1223 1223 /* [in] */ BSTR value) 1224 1224 { 1225 ASSERT(m_element && m_element->hasTagName(inputTag));1226 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);1225 ASSERT(m_element && isHTMLInputElement(m_element)); 1226 HTMLInputElement* inputElement = toHTMLInputElement(m_element); 1227 1227 inputElement->setValue(String((UChar*) value, SysStringLen(value))); 1228 1228 return S_OK; … … 1233 1233 { 1234 1234 ASSERT(m_element); 1235 ASSERT( m_element->hasTagName(inputTag));1236 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);1235 ASSERT(isHTMLInputElement(m_element)); 1236 HTMLInputElement* inputElement = toHTMLInputElement(m_element); 1237 1237 inputElement->setValueForUser(String(static_cast<UChar*>(value), SysStringLen(value))); 1238 1238 return S_OK; … … 1241 1241 HRESULT STDMETHODCALLTYPE DOMHTMLInputElement::select( void) 1242 1242 { 1243 ASSERT(m_element && m_element->hasTagName(inputTag));1244 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);1243 ASSERT(m_element && isHTMLInputElement(m_element)); 1244 HTMLInputElement* inputElement = toHTMLInputElement(m_element); 1245 1245 inputElement->select(); 1246 1246 return S_OK; … … 1256 1256 /* [in] */ long start) 1257 1257 { 1258 ASSERT(m_element && m_element->hasTagName(inputTag));1259 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);1258 ASSERT(m_element && isHTMLInputElement(m_element)); 1259 HTMLInputElement* inputElement = toHTMLInputElement(m_element); 1260 1260 inputElement->setSelectionStart(start); 1261 1261 return S_OK; … … 1265 1265 /* [retval][out] */ long *start) 1266 1266 { 1267 ASSERT(m_element && m_element->hasTagName(inputTag));1268 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);1267 ASSERT(m_element && isHTMLInputElement(m_element)); 1268 HTMLInputElement* inputElement = toHTMLInputElement(m_element); 1269 1269 *start = inputElement->selectionStart(); 1270 1270 return S_OK; … … 1274 1274 /* [in] */ long end) 1275 1275 { 1276 ASSERT(m_element && m_element->hasTagName(inputTag));1277 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);1276 ASSERT(m_element && isHTMLInputElement(m_element)); 1277 HTMLInputElement* inputElement = toHTMLInputElement(m_element); 1278 1278 inputElement->setSelectionEnd(end); 1279 1279 return S_OK; … … 1283 1283 /* [retval][out] */ long *end) 1284 1284 { 1285 ASSERT(m_element && m_element->hasTagName(inputTag));1286 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);1285 ASSERT(m_element && isHTMLInputElement(m_element)); 1286 HTMLInputElement* inputElement = toHTMLInputElement(m_element); 1287 1287 *end = inputElement->selectionEnd(); 1288 1288 return S_OK; … … 1295 1295 { 1296 1296 ASSERT(m_element); 1297 ASSERT( m_element->hasTagName(inputTag));1298 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);1297 ASSERT(isHTMLInputElement(m_element)); 1298 HTMLInputElement* inputElement = toHTMLInputElement(m_element); 1299 1299 *result = inputElement->isTextField() ? TRUE : FALSE; 1300 1300 return S_OK; … … 1305 1305 { 1306 1306 ASSERT(m_element); 1307 ASSERT( m_element->hasTagName(inputTag));1307 ASSERT(isHTMLInputElement(m_element)); 1308 1308 rect->left = rect->top = rect->right = rect->bottom = 0; 1309 1309 RenderObject* renderer = m_element->renderer(); … … 1331 1331 1332 1332 ASSERT(m_element); 1333 ASSERT( m_element->hasTagName(inputTag));1334 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);1333 ASSERT(isHTMLInputElement(m_element)); 1334 HTMLInputElement* inputElement = toHTMLInputElement(m_element); 1335 1335 1336 1336 String newValue = inputElement->value(); … … 1348 1348 { 1349 1349 ASSERT(m_element); 1350 ASSERT( m_element->hasTagName(inputTag));1351 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);1350 ASSERT(isHTMLInputElement(m_element)); 1351 HTMLInputElement* inputElement = toHTMLInputElement(m_element); 1352 1352 *start = inputElement->selectionStart(); 1353 1353 *end = inputElement->selectionEnd(); … … 1359 1359 { 1360 1360 ASSERT(m_element); 1361 ASSERT( m_element->hasTagName(inputTag));1362 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);1361 ASSERT(isHTMLInputElement(m_element)); 1362 HTMLInputElement* inputElement = toHTMLInputElement(m_element); 1363 1363 inputElement->setAutofilled(!!filled); 1364 1364 return S_OK; … … 1369 1369 { 1370 1370 ASSERT(m_element); 1371 ASSERT( m_element->hasTagName(inputTag));1372 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(m_element);1371 ASSERT(isHTMLInputElement(m_element)); 1372 HTMLInputElement* inputElement = toHTMLInputElement(m_element); 1373 1373 *result = inputElement->isAutofilled() ? TRUE : FALSE; 1374 1374 return S_OK; … … 1384 1384 1385 1385 *result = FALSE; 1386 ASSERT(m_element && m_element->hasTagName(inputTag));1386 ASSERT(m_element && isHTMLInputElement(m_element)); 1387 1387 BOOL textField = FALSE; 1388 1388 if (FAILED(isTextField(&textField)) || !textField) 1389 1389 return S_OK; 1390 if ( static_cast<HTMLInputElement*>(m_element)->lastChangeWasUserEdit())1390 if (toHTMLInputElement(m_element)->lastChangeWasUserEdit()) 1391 1391 *result = TRUE; 1392 1392 return S_OK; -
trunk/Source/WebKit/win/WebFrame.cpp
r151949 r152149 222 222 hr = elePriv->coreElement((void**)&ele); 223 223 elePriv->Release(); 224 if (SUCCEEDED(hr) && ele && ele->hasTagName(inputTag))225 return static_cast<HTMLInputElement*>(ele);224 if (SUCCEEDED(hr) && ele && isHTMLInputElement(ele)) 225 return toHTMLInputElement(ele); 226 226 } 227 227 return 0; -
trunk/Source/WebKit2/ChangeLog
r152147 r152149 1 2013-06-27 Kangil Han <kangil.han@samsung.com> 2 3 Adopt is/toHTMLInputElement for code cleanup 4 https://bugs.webkit.org/show_bug.cgi?id=118130 5 6 Reviewed by Antti Koivisto. 7 8 To enhance readability, this patch adopts is/toHTMLInputElement. 9 This also helps out to reduce duplicated use of static_cast. 10 11 * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: 12 (WebKit::InjectedBundleNodeHandle::setHTMLInputElementValueForUser): 13 (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutofilled): 14 (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutofilled): 15 (WebKit::InjectedBundleNodeHandle::htmlInputElementLastChangeWasUserEdit): 16 * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: 17 (WebKit::PDFPluginTextAnnotation::createAnnotationElement): 18 * WebProcess/WebCoreSupport/WebChromeClient.cpp: 19 (WebKit::WebChromeClient::focusedNodeChanged): 20 * WebProcess/WebCoreSupport/WebEditorClient.cpp: 21 (WebKit::WebEditorClient::textFieldDidBeginEditing): 22 (WebKit::WebEditorClient::textFieldDidEndEditing): 23 (WebKit::WebEditorClient::textDidChangeInTextField): 24 (WebKit::WebEditorClient::doTextFieldCommandFromEvent): 25 (WebKit::WebEditorClient::textWillBeDeletedInTextField): 26 * WebProcess/WebPage/WebFrame.cpp: 27 (WebKit::WebFrame::containsAnyFormControls): 28 * WebProcess/WebPage/WebPage.cpp: 29 (WebKit::WebPage::editorState): 30 1 31 2013-06-27 Eunmi Lee <eunmi15.lee@samsung.com> 2 32 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
r150282 r152149 181 181 void InjectedBundleNodeHandle::setHTMLInputElementValueForUser(const String& value) 182 182 { 183 if (! m_node->hasTagName(inputTag))183 if (!isHTMLInputElement(m_node.get())) 184 184 return; 185 185 186 static_cast<HTMLInputElement*>(m_node.get())->setValueForUser(value);186 toHTMLInputElement(m_node.get())->setValueForUser(value); 187 187 } 188 188 189 189 bool InjectedBundleNodeHandle::isHTMLInputElementAutofilled() const 190 190 { 191 if (! m_node->hasTagName(inputTag))191 if (!isHTMLInputElement(m_node.get())) 192 192 return false; 193 193 194 return static_cast<HTMLInputElement*>(m_node.get())->isAutofilled();194 return toHTMLInputElement(m_node.get())->isAutofilled(); 195 195 } 196 196 197 197 void InjectedBundleNodeHandle::setHTMLInputElementAutofilled(bool filled) 198 198 { 199 if (! m_node->hasTagName(inputTag))199 if (!isHTMLInputElement(m_node.get())) 200 200 return; 201 201 202 static_cast<HTMLInputElement*>(m_node.get())->setAutofilled(filled);202 toHTMLInputElement(m_node.get())->setAutofilled(filled); 203 203 } 204 204 205 205 bool InjectedBundleNodeHandle::htmlInputElementLastChangeWasUserEdit() 206 206 { 207 if (! m_node->hasTagName(inputTag))207 if (!isHTMLInputElement(m_node.get())) 208 208 return false; 209 209 210 return static_cast<HTMLInputElement*>(m_node.get())->lastChangeWasUserEdit();210 return toHTMLInputElement(m_node.get())->lastChangeWasUserEdit(); 211 211 } 212 212 -
trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm
r148912 r152149 108 108 static_cast<HTMLTextAreaElement*>(styledElement)->setValue(textAnnotation.stringValue); 109 109 else 110 static_cast<HTMLInputElement*>(styledElement)->setValue(textAnnotation.stringValue);110 toHTMLInputElement(styledElement)->setValue(textAnnotation.stringValue); 111 111 112 112 return element; -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
r151530 r152149 165 165 if (!node) 166 166 return; 167 if (! node->hasTagName(inputTag))167 if (!isHTMLInputElement(node)) 168 168 return; 169 169 170 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(node);170 HTMLInputElement* inputElement = toHTMLInputElement(node); 171 171 if (!inputElement->isText()) 172 172 return; -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
r150289 r152149 317 317 void WebEditorClient::textFieldDidBeginEditing(Element* element) 318 318 { 319 if (! element->hasTagName(inputTag))319 if (!isHTMLInputElement(element)) 320 320 return; 321 321 … … 324 324 ASSERT(webFrame); 325 325 326 m_page->injectedBundleFormClient().textFieldDidBeginEditing(m_page, static_cast<HTMLInputElement*>(element), webFrame);326 m_page->injectedBundleFormClient().textFieldDidBeginEditing(m_page, toHTMLInputElement(element), webFrame); 327 327 } 328 328 329 329 void WebEditorClient::textFieldDidEndEditing(Element* element) 330 330 { 331 if (! element->hasTagName(inputTag))331 if (!isHTMLInputElement(element)) 332 332 return; 333 333 … … 336 336 ASSERT(webFrame); 337 337 338 m_page->injectedBundleFormClient().textFieldDidEndEditing(m_page, static_cast<HTMLInputElement*>(element), webFrame);338 m_page->injectedBundleFormClient().textFieldDidEndEditing(m_page, toHTMLInputElement(element), webFrame); 339 339 } 340 340 341 341 void WebEditorClient::textDidChangeInTextField(Element* element) 342 342 { 343 if (! element->hasTagName(inputTag))343 if (!isHTMLInputElement(element)) 344 344 return; 345 345 … … 351 351 ASSERT(webFrame); 352 352 353 m_page->injectedBundleFormClient().textDidChangeInTextField(m_page, static_cast<HTMLInputElement*>(element), webFrame);353 m_page->injectedBundleFormClient().textDidChangeInTextField(m_page, toHTMLInputElement(element), webFrame); 354 354 } 355 355 … … 390 390 bool WebEditorClient::doTextFieldCommandFromEvent(Element* element, KeyboardEvent* event) 391 391 { 392 if (! element->hasTagName(inputTag))392 if (!isHTMLInputElement(element)) 393 393 return false; 394 394 … … 401 401 ASSERT(webFrame); 402 402 403 return m_page->injectedBundleFormClient().shouldPerformActionInTextField(m_page, static_cast<HTMLInputElement*>(element), actionType, webFrame);403 return m_page->injectedBundleFormClient().shouldPerformActionInTextField(m_page, toHTMLInputElement(element), actionType, webFrame); 404 404 } 405 405 406 406 void WebEditorClient::textWillBeDeletedInTextField(Element* element) 407 407 { 408 if (! element->hasTagName(inputTag))408 if (!isHTMLInputElement(element)) 409 409 return; 410 410 … … 413 413 ASSERT(webFrame); 414 414 415 m_page->injectedBundleFormClient().shouldPerformActionInTextField(m_page, static_cast<HTMLInputElement*>(element), WKInputFieldActionTypeInsertDelete, webFrame);415 m_page->injectedBundleFormClient().shouldPerformActionInTextField(m_page, toHTMLInputElement(element), WKInputFieldActionTypeInsertDelete, webFrame); 416 416 } 417 417 -
trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
r151949 r152149 51 51 #include <WebCore/HTMLFormElement.h> 52 52 #include <WebCore/HTMLFrameOwnerElement.h> 53 #include <WebCore/HTMLInputElement.h> 53 54 #include <WebCore/HTMLNames.h> 54 55 #include <WebCore/JSCSSStyleDeclaration.h> … … 617 618 if (!node->isElementNode()) 618 619 continue; 619 if ( toElement(node)->hasTagName(HTMLNames::inputTag) || toElement(node)->hasTagName(HTMLNames::selectTag) || toElement(node)->hasTagName(HTMLNames::textareaTag))620 if (isHTMLInputElement(node) || toElement(node)->hasTagName(HTMLNames::selectTag) || toElement(node)->hasTagName(HTMLNames::textareaTag)) 620 621 return true; 621 622 } -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r151926 r152149 613 613 return result; 614 614 615 if ( scope->hasTagName(HTMLNames::inputTag)) {616 HTMLInputElement* input = static_cast<HTMLInputElement*>(scope);615 if (isHTMLInputElement(scope)) { 616 HTMLInputElement* input = toHTMLInputElement(scope); 617 617 if (input->isTelephoneField()) 618 618 result.inputMethodHints |= Qt::ImhDialableCharactersOnly;
Note: See TracChangeset
for help on using the changeset viewer.