Changeset 152218 in webkit
- Timestamp:
- Jul 1, 2013 3:43:48 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r152217 r152218 1 2013-07-01 Kangil Han <kangil.han@samsung.com> 2 3 Adopt toHTMLTextAreaElement for code cleanup 4 https://bugs.webkit.org/show_bug.cgi?id=118226 5 6 Reviewed by Andreas Kling. 7 8 To enhance readability, this patch adopts toHTMLTextAreaElement. 9 This also helps out to reduce duplicated use of static_cast. 10 11 * accessibility/AccessibilityNodeObject.cpp: 12 (WebCore::AccessibilityNodeObject::determineAccessibilityRole): 13 (WebCore::AccessibilityNodeObject::isNativeTextControl): 14 (WebCore::AccessibilityNodeObject::isReadOnly): 15 (WebCore::AccessibilityNodeObject::text): 16 * accessibility/AccessibilityRenderObject.cpp: 17 (WebCore::AccessibilityRenderObject::setValue): 18 * css/StyleResolver.cpp: 19 (WebCore::StyleResolver::adjustRenderStyle): 20 * editing/markup.cpp: 21 (WebCore::StyledMarkupAccumulator::appendText): 22 * html/HTMLFormControlElement.cpp: 23 (WebCore::shouldAutofocus): 24 * html/HTMLTextAreaElement.h: 25 (WebCore::toHTMLTextAreaElement): 26 * page/FocusController.cpp: 27 (WebCore::clearSelectionIfNeeded): 28 * rendering/HitTestResult.cpp: 29 (WebCore::HitTestResult::isContentEditable): 30 * rendering/RenderBox.cpp: 31 (WebCore::RenderBox::sizesLogicalWidthToFitContent): 32 * rendering/RenderTextControlMultiLine.cpp: 33 (WebCore::RenderTextControlMultiLine::~RenderTextControlMultiLine): 34 (WebCore::RenderTextControlMultiLine::preferredContentLogicalWidth): 35 (WebCore::RenderTextControlMultiLine::computeControlLogicalHeight): 36 * testing/Internals.cpp: 37 (WebCore::Internals::wasLastChangeUserEdit): 38 1 39 2013-07-01 Kwang Yul Seo <skyul@company100.net> 2 40 -
trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp
r152203 r152218 306 306 return selectElement->multiple() ? ListBoxRole : PopUpButtonRole; 307 307 } 308 if ( node()->hasTagName(textareaTag))308 if (isHTMLTextAreaElement(node())) 309 309 return TextAreaRole; 310 310 if (headingLevel()) … … 442 442 return false; 443 443 444 if ( node->hasTagName(textareaTag))444 if (isHTMLTextAreaElement(node)) 445 445 return true; 446 446 … … 695 695 return true; 696 696 697 if ( node->hasTagName(textareaTag))697 if (isHTMLTextAreaElement(node)) 698 698 return toHTMLFormControlElement(node)->isReadOnly(); 699 699 … … 1644 1644 return String(); 1645 1645 1646 if (isNativeTextControl() && ( node->hasTagName(textareaTag) || isHTMLInputElement(node)))1646 if (isNativeTextControl() && (isHTMLTextAreaElement(node) || isHTMLInputElement(node))) 1647 1647 return toHTMLTextFormControlElement(node)->value(); 1648 1648 -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r152208 r152218 1645 1645 } else if (renderer->isTextArea()) { 1646 1646 // FIXME: This is not safe! Other elements could have a TextArea renderer. 1647 static_cast<HTMLTextAreaElement*>(element)->setValue(string);1647 toHTMLTextAreaElement(element)->setValue(string); 1648 1648 } 1649 1649 } -
trunk/Source/WebCore/css/StyleResolver.cpp
r152211 r152218 1482 1482 1483 1483 // Textarea considers overflow visible as auto. 1484 if (e && e->hasTagName(textareaTag)) {1484 if (e && isHTMLTextAreaElement(e)) { 1485 1485 style->setOverflowX(style->overflowX() == OVISIBLE ? OAUTO : style->overflowX()); 1486 1486 style->setOverflowY(style->overflowY() == OVISIBLE ? OAUTO : style->overflowY()); -
trunk/Source/WebCore/editing/markup.cpp
r151947 r152218 48 48 #include "HTMLElement.h" 49 49 #include "HTMLNames.h" 50 #include "HTMLTextAreaElement.h" 50 51 #include "HTMLTextFormControlElement.h" 51 52 #include "KURL.h" … … 216 217 void StyledMarkupAccumulator::appendText(StringBuilder& out, Text* text) 217 218 { 218 const bool parentIsTextarea = text->parentElement() && text->parentElement()->tagQName() == textareaTag;219 const bool parentIsTextarea = text->parentElement() && isHTMLTextAreaElement(text->parentElement()); 219 220 const bool wrappingSpan = shouldApplyWrappingStyle(text) && !parentIsTextarea; 220 221 if (wrappingSpan) { -
trunk/Source/WebCore/html/HTMLFormControlElement.cpp
r152149 r152218 37 37 #include "HTMLInputElement.h" 38 38 #include "HTMLLegendElement.h" 39 #include "HTMLTextAreaElement.h" 39 40 #include "RenderBox.h" 40 41 #include "RenderTheme.h" … … 197 198 if (element->hasTagName(buttonTag)) 198 199 return true; 199 if ( element->hasTagName(textareaTag))200 if (isHTMLTextAreaElement(element)) 200 201 return true; 201 202 -
trunk/Source/WebCore/html/HTMLTextAreaElement.h
r151572 r152218 133 133 } 134 134 135 inline HTMLTextAreaElement* toHTMLTextAreaElement(Node* node) 136 { 137 ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLTextAreaElement(node)); 138 return static_cast<HTMLTextAreaElement*>(node); 139 } 140 135 141 } //namespace 136 142 -
trunk/Source/WebCore/page/FocusController.cpp
r152149 r152218 47 47 #include "HTMLInputElement.h" 48 48 #include "HTMLNames.h" 49 #include "HTMLTextAreaElement.h" 49 50 #include "HitTestResult.h" 50 51 #include "KeyboardEvent.h" … … 585 586 586 587 if (Node* shadowAncestorNode = root->deprecatedShadowAncestorNode()) { 587 if (!isHTMLInputElement(shadowAncestorNode) && ! shadowAncestorNode->hasTagName(textareaTag))588 if (!isHTMLInputElement(shadowAncestorNode) && !isHTMLTextAreaElement(shadowAncestorNode)) 588 589 return; 589 590 } -
trunk/Source/WebCore/rendering/HitTestResult.cpp
r152203 r152218 38 38 #include "HTMLParserIdioms.h" 39 39 #include "HTMLPlugInImageElement.h" 40 #include "HTMLTextAreaElement.h" 40 41 #include "HTMLVideoElement.h" 41 42 #include "HitTestLocation.h" … … 569 570 return false; 570 571 571 if ( m_innerNonSharedNode->hasTagName(textareaTag))572 if (isHTMLTextAreaElement(m_innerNonSharedNode.get())) 572 573 return true; 573 574 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r152212 r152218 29 29 #include "ChromeClient.h" 30 30 #include "Document.h" 31 #include "FloatQuad.h" 32 #include "Frame.h" 31 33 #include "FrameView.h" 32 34 #include "GraphicsContext.h" 33 #include "HitTestResult.h"34 #include "htmlediting.h"35 35 #include "HTMLElement.h" 36 36 #include "HTMLFrameOwnerElement.h" 37 37 #include "HTMLInputElement.h" 38 38 #include "HTMLNames.h" 39 #include " FloatQuad.h"40 #include " Frame.h"39 #include "HTMLTextAreaElement.h" 40 #include "HitTestResult.h" 41 41 #include "Page.h" 42 42 #include "PaintInfo.h" … … 53 53 #include "RenderView.h" 54 54 #include "TransformState.h" 55 #include "htmlediting.h" 55 56 #include <algorithm> 56 57 #include <math.h> … … 2306 2307 // FIXME: Think about block-flow here. 2307 2308 // https://bugs.webkit.org/show_bug.cgi?id=46473 2308 if (logicalWidth.type() == Auto && !isStretchingColumnFlexItem(this) && node() && (isHTMLInputElement(node()) || node()->hasTagName(selectTag) || node()->hasTagName(buttonTag) || node()->hasTagName(textareaTag) || node()->hasTagName(legendTag)))2309 if (logicalWidth.type() == Auto && !isStretchingColumnFlexItem(this) && node() && (isHTMLInputElement(node()) || node()->hasTagName(selectTag) || node()->hasTagName(buttonTag) || isHTMLTextAreaElement(node()) || node()->hasTagName(legendTag))) 2309 2310 return true; 2310 2311 -
trunk/Source/WebCore/rendering/RenderTextControlMultiLine.cpp
r145391 r152218 41 41 { 42 42 if (node() && node()->inDocument()) 43 static_cast<HTMLTextAreaElement*>(node())->rendererWillBeDestroyed();43 toHTMLTextAreaElement(node())->rendererWillBeDestroyed(); 44 44 } 45 45 … … 68 68 LayoutUnit RenderTextControlMultiLine::preferredContentLogicalWidth(float charWidth) const 69 69 { 70 int factor = static_cast<HTMLTextAreaElement*>(node())->cols();70 int factor = toHTMLTextAreaElement(node())->cols(); 71 71 return static_cast<LayoutUnit>(ceilf(charWidth * factor)) + scrollbarThickness(); 72 72 } … … 74 74 LayoutUnit RenderTextControlMultiLine::computeControlLogicalHeight(LayoutUnit lineHeight, LayoutUnit nonContentHeight) const 75 75 { 76 return lineHeight * static_cast<HTMLTextAreaElement*>(node())->rows() + nonContentHeight;76 return lineHeight * toHTMLTextAreaElement(node())->rows() + nonContentHeight; 77 77 } 78 78 -
trunk/Source/WebCore/testing/Internals.cpp
r152149 r152218 935 935 // FIXME: We should be using hasTagName instead but Windows port doesn't link QualifiedNames properly. 936 936 if (textField->tagName() == "TEXTAREA") 937 return static_cast<HTMLTextAreaElement*>(textField)->lastChangeWasUserEdit();937 return toHTMLTextAreaElement(textField)->lastChangeWasUserEdit(); 938 938 939 939 ec = INVALID_NODE_TYPE_ERR; -
trunk/Source/WebKit/blackberry/Api/WebPage.cpp
r152203 r152218 69 69 #include "HTMLNames.h" 70 70 #include "HTMLParserIdioms.h" 71 #include "HTMLTextAreaElement.h" 71 72 #include "HTTPParsers.h" 72 73 #include "HistoryItem.h" … … 2832 2833 double blockExpansionRatio = 5.0 * blockToPageRatio * blockToPageRatio; 2833 2834 2834 if (!isHTMLImageElement(tnode) && !isHTMLInputElement(tnode) && ! tnode->hasTagName(HTMLNames::textareaTag)) {2835 if (!isHTMLImageElement(tnode) && !isHTMLInputElement(tnode) && !isHTMLTextAreaElement(tnode)) { 2835 2836 while ((tnode = tnode->parentNode())) { 2836 2837 ASSERT(tnode); -
trunk/Source/WebKit/blackberry/ChangeLog
r152211 r152218 1 2013-07-01 Kangil Han <kangil.han@samsung.com> 2 3 Adopt toHTMLTextAreaElement for code cleanup 4 https://bugs.webkit.org/show_bug.cgi?id=118226 5 6 Reviewed by Andreas Kling. 7 8 To enhance readability, this patch adopts toHTMLTextAreaElement. 9 This also helps out to reduce duplicated use of static_cast. 10 11 * Api/WebPage.cpp: 12 (BlackBerry::WebKit::WebPagePrivate::blockZoomRectForNode): 13 * WebKitSupport/DOMSupport.cpp: 14 (BlackBerry::WebKit::DOMSupport::isTextInputElement): 15 (BlackBerry::WebKit::DOMSupport::inputElementText): 16 * WebKitSupport/InputHandler.cpp: 17 (BlackBerry::WebKit::InputHandler::elementType): 18 (BlackBerry::WebKit::InputHandler::boundingBoxForInputField): 19 1 20 2013-06-29 Kangil Han <kangil.han@samsung.com> 2 21 -
trunk/Source/WebKit/blackberry/WebKitSupport/DOMSupport.cpp
r152149 r152218 104 104 { 105 105 return element->isTextFormControl() 106 || element->hasTagName(HTMLNames::textareaTag)106 || isHTMLTextAreaElement(element) 107 107 || element->isContentEditable(); 108 108 } … … 123 123 const HTMLInputElement* inputElement = toHTMLInputElement(element); 124 124 elementText = inputElement->value(); 125 } else if ( element->hasTagName(HTMLNames::textareaTag)) {126 const HTMLTextAreaElement* inputElement = static_cast<const HTMLTextAreaElement*>(element);125 } else if (isHTMLTextAreaElement(element)) { 126 const HTMLTextAreaElement* inputElement = toHTMLTextAreaElement(element); 127 127 elementText = inputElement->value(); 128 128 } else if (element->isContentEditable()) { -
trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
r152211 r152218 414 414 return convertInputType(inputElement); 415 415 416 if ( element->hasTagName(HTMLNames::textareaTag))416 if (isHTMLTextAreaElement(element)) 417 417 return InputTypeTextArea; 418 418 … … 1355 1355 } 1356 1356 1357 if ( m_currentFocusElement->hasTagName(HTMLNames::textareaTag))1357 if (isHTMLTextAreaElement(m_currentFocusElement)) 1358 1358 return m_currentFocusElement->renderer()->absoluteBoundingBoxRect(); 1359 1359 -
trunk/Source/WebKit/mac/ChangeLog
r152149 r152218 1 2013-07-01 Kangil Han <kangil.han@samsung.com> 2 3 Adopt toHTMLTextAreaElement for code cleanup 4 https://bugs.webkit.org/show_bug.cgi?id=118226 5 6 Reviewed by Andreas Kling. 7 8 To enhance readability, this patch adopts toHTMLTextAreaElement. 9 This also helps out to reduce duplicated use of static_cast. 10 11 * WebCoreSupport/WebEditorClient.mm: 12 (WebEditorClient::textDidChangeInTextArea): 13 1 14 2013-06-27 Kangil Han <kangil.han@samsung.com> 2 15 -
trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm
r152149 r152218 712 712 void WebEditorClient::textDidChangeInTextArea(Element* element) 713 713 { 714 if (! element->hasTagName(textareaTag))714 if (!isHTMLTextAreaElement(element)) 715 715 return; 716 716 717 DOMHTMLTextAreaElement* textAreaElement = kit( static_cast<HTMLTextAreaElement*>(element));717 DOMHTMLTextAreaElement* textAreaElement = kit(toHTMLTextAreaElement(element)); 718 718 FormDelegateLog(textAreaElement); 719 719 CallFormDelegate(m_webView, @selector(textDidChangeInTextArea:inFrame:), textAreaElement, kit(element->document()->frame())); -
trunk/Source/WebKit/win/ChangeLog
r152208 r152218 1 2013-07-01 Kangil Han <kangil.han@samsung.com> 2 3 Adopt toHTMLTextAreaElement for code cleanup 4 https://bugs.webkit.org/show_bug.cgi?id=118226 5 6 Reviewed by Andreas Kling. 7 8 To enhance readability, this patch adopts toHTMLTextAreaElement. 9 This also helps out to reduce duplicated use of static_cast. 10 11 * DOMCoreClasses.cpp: 12 (DOMElement::createInstance): 13 * DOMHTMLClasses.cpp: 14 (DOMHTMLTextAreaElement::form): 15 (DOMHTMLTextAreaElement::value): 16 (DOMHTMLTextAreaElement::setValue): 17 (DOMHTMLTextAreaElement::select): 18 (DOMHTMLTextAreaElement::isUserEdited): 19 1 20 2013-06-29 Kangil Han <kangil.han@samsung.com> 2 21 -
trunk/Source/WebKit/win/DOMCoreClasses.cpp
r152208 r152218 1510 1510 DOMHTMLSelectElement* newElement = new DOMHTMLSelectElement(e); 1511 1511 hr = newElement->QueryInterface(IID_IDOMElement, (void**)&domElement); 1512 } else if ( e->hasTagName(textareaTag)) {1512 } else if (isHTMLTextAreaElement(e)) { 1513 1513 DOMHTMLTextAreaElement* newElement = new DOMHTMLTextAreaElement(e); 1514 1514 hr = newElement->QueryInterface(IID_IDOMElement, (void**)&domElement); -
trunk/Source/WebKit/win/DOMHTMLClasses.cpp
r152208 r152218 1431 1431 return E_POINTER; 1432 1432 *result = 0; 1433 ASSERT(m_element && m_element->hasTagName(textareaTag));1434 HTMLTextAreaElement* textareaElement = static_cast<HTMLTextAreaElement*>(m_element);1433 ASSERT(m_element && isHTMLTextAreaElement(m_element)); 1434 HTMLTextAreaElement* textareaElement = toHTMLTextAreaElement(m_element); 1435 1435 COMPtr<IDOMElement> domElement; 1436 1436 domElement.adoptRef(DOMHTMLElement::createInstance(textareaElement->form())); … … 1548 1548 /* [retval][out] */ BSTR* result) 1549 1549 { 1550 ASSERT(m_element && m_element->hasTagName(textareaTag));1551 HTMLTextAreaElement* textareaElement = static_cast<HTMLTextAreaElement*>(m_element);1550 ASSERT(m_element && isHTMLTextAreaElement(m_element)); 1551 HTMLTextAreaElement* textareaElement = toHTMLTextAreaElement(m_element); 1552 1552 WTF::String valueString = textareaElement->value(); 1553 1553 *result = BString(valueString.characters(), valueString.length()).release(); … … 1560 1560 /* [in] */ BSTR value) 1561 1561 { 1562 ASSERT(m_element && m_element->hasTagName(textareaTag));1563 HTMLTextAreaElement* textareaElement = static_cast<HTMLTextAreaElement*>(m_element);1562 ASSERT(m_element && isHTMLTextAreaElement(m_element)); 1563 HTMLTextAreaElement* textareaElement = toHTMLTextAreaElement(m_element); 1564 1564 textareaElement->setValue(String((UChar*) value, SysStringLen(value))); 1565 1565 return S_OK; … … 1568 1568 HRESULT STDMETHODCALLTYPE DOMHTMLTextAreaElement::select( void) 1569 1569 { 1570 ASSERT(m_element && m_element->hasTagName(textareaTag));1571 HTMLTextAreaElement* textareaElement = static_cast<HTMLTextAreaElement*>(m_element);1570 ASSERT(m_element && isHTMLTextAreaElement(m_element)); 1571 HTMLTextAreaElement* textareaElement = toHTMLTextAreaElement(m_element); 1572 1572 textareaElement->select(); 1573 1573 return S_OK; … … 1583 1583 1584 1584 *result = FALSE; 1585 ASSERT(m_element && m_element->hasTagName(textareaTag));1586 if ( static_cast<HTMLTextAreaElement*>(m_element)->lastChangeWasUserEdit())1585 ASSERT(m_element && isHTMLTextAreaElement(m_element)); 1586 if (toHTMLTextAreaElement(m_element)->lastChangeWasUserEdit()) 1587 1587 *result = TRUE; 1588 1588 return S_OK; -
trunk/Source/WebKit2/ChangeLog
r152205 r152218 1 2013-07-01 Kangil Han <kangil.han@samsung.com> 2 3 Adopt toHTMLTextAreaElement for code cleanup 4 https://bugs.webkit.org/show_bug.cgi?id=118226 5 6 Reviewed by Andreas Kling. 7 8 To enhance readability, this patch adopts toHTMLTextAreaElement. 9 This also helps out to reduce duplicated use of static_cast. 10 11 * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: 12 (WebKit::InjectedBundleNodeHandle::htmlTextAreaElementLastChangeWasUserEdit): 13 * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: 14 (WebKit::PDFPluginTextAnnotation::createAnnotationElement): 15 * WebProcess/WebCoreSupport/WebEditorClient.cpp: 16 (WebKit::WebEditorClient::textDidChangeInTextArea): 17 * WebProcess/WebPage/WebFrame.cpp: 18 (WebKit::WebFrame::containsAnyFormControls): 19 1 20 2013-06-28 Andreas Kling <akling@apple.com> 2 21 -
trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
r152149 r152218 213 213 bool InjectedBundleNodeHandle::htmlTextAreaElementLastChangeWasUserEdit() 214 214 { 215 if (! m_node->hasTagName(textareaTag))215 if (!isHTMLTextAreaElement(m_node.get())) 216 216 return false; 217 217 218 return static_cast<HTMLTextAreaElement*>(m_node.get())->lastChangeWasUserEdit();218 return toHTMLTextAreaElement(m_node.get())->lastChangeWasUserEdit(); 219 219 } 220 220 -
trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm
r152149 r152218 106 106 107 107 if (isMultiline) 108 static_cast<HTMLTextAreaElement*>(styledElement)->setValue(textAnnotation.stringValue);108 toHTMLTextAreaElement(styledElement)->setValue(textAnnotation.stringValue); 109 109 else 110 110 toHTMLInputElement(styledElement)->setValue(textAnnotation.stringValue); -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
r152149 r152218 356 356 void WebEditorClient::textDidChangeInTextArea(Element* element) 357 357 { 358 if (! element->hasTagName(textareaTag))358 if (!isHTMLTextAreaElement(element)) 359 359 return; 360 360 … … 363 363 ASSERT(webFrame); 364 364 365 m_page->injectedBundleFormClient().textDidChangeInTextArea(m_page, static_cast<HTMLTextAreaElement*>(element), webFrame);365 m_page->injectedBundleFormClient().textDidChangeInTextArea(m_page, toHTMLTextAreaElement(element), webFrame); 366 366 } 367 367 -
trunk/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
r152149 r152218 53 53 #include <WebCore/HTMLInputElement.h> 54 54 #include <WebCore/HTMLNames.h> 55 #include <WebCore/HTMLTextAreaElement.h> 55 56 #include <WebCore/JSCSSStyleDeclaration.h> 56 57 #include <WebCore/JSElement.h> … … 618 619 if (!node->isElementNode()) 619 620 continue; 620 if (isHTMLInputElement(node) || toElement(node)->hasTagName(HTMLNames::selectTag) || toElement(node)->hasTagName(HTMLNames::textareaTag))621 if (isHTMLInputElement(node) || toElement(node)->hasTagName(HTMLNames::selectTag) || isHTMLTextAreaElement(node)) 621 622 return true; 622 623 }
Note: See TracChangeset
for help on using the changeset viewer.