[Webkit-unassigned] [Bug 65542] Need support for dirname attribute

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 17 03:51:14 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=65542


Kent Tamura <tkent at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #111237|review?                     |review-
               Flag|                            |




--- Comment #3 from Kent Tamura <tkent at chromium.org>  2011-10-17 03:51:13 PST ---
(From update of attachment 111237)
View in context: https://bugs.webkit.org/attachment.cgi?id=111237&action=review

> Source/WebCore/ChangeLog:24
> +        * html/HTMLAttributeNames.in:
> +        * html/HTMLInputElement.cpp:
> +        (WebCore::HTMLInputElement::parseMappedAttribute):
> +        (WebCore::HTMLInputElement::appendFormData):
> +        * html/HTMLInputElement.idl:
> +        * html/HTMLTextAreaElement.cpp:
> +        (WebCore::HTMLTextAreaElement::appendFormData):
> +        * html/HTMLTextAreaElement.idl:
> +        * html/HTMLTextFormControlElement.cpp:
> +        (WebCore::HTMLTextFormControlElement::parseMappedAttribute):
> +        (WebCore::enclosingTextFormControl):
> +        (WebCore::HTMLTextFormControlElement::appendFormData):
> +        * html/HTMLTextFormControlElement.h:

Please write what you changed for each of files/functions.

> Source/WebCore/html/HTMLInputElement.cpp:825
> +    } else if (attr->name() == dirnameAttr) {
> +        HTMLTextFormControlElement::parseMappedAttribute(attr);

This should be removed.
We call HTMLTextFormControlElement::parseMappedAttribute(attr) at the bottom of the function.

> Source/WebCore/html/HTMLInputElement.cpp:941
> +    if (result && fastHasAttribute(dirnameAttr) && (isTextField() || isSearchField()))
> +        result = HTMLTextFormControlElement::appendFormData(encoding, multipart);
> +    return result;

* isSearchField() is redundant because isTextField() is always true if isSearchField() is true.
* This code should be in TextFieldInputType::appendFormData().
  Having dirname processing in HTMLTextFormControlElement::appendFormData() is very strange.
  So, I think we had better add a public helper function to HTMLTextFormControlElement, and it is called from TextFieldInputType::appendFormData() and HTMLTextAreaElemet::appendFormData().

> Source/WebCore/html/HTMLTextFormControlElement.cpp:434
> +    else if (attr->name() == dirnameAttr)
> +        m_dirName = attr->value();

m_dirName is not needed.

> Source/WebCore/html/HTMLTextFormControlElement.cpp:585
> +    else if (hasAttribute(dirAttr))
> +        dir = getAttribute(dirAttr).string();

Should use fastHasAttribute() and fastGetAttribute().

> Source/WebCore/html/HTMLTextFormControlElement.cpp:589
> +    list.appendData(m_dirName.string(), dir);

We can use fastGetAttribute(dirnameAttr)

> LayoutTests/fast/forms/form-dirname-attribute.html:18
> +var input = document.createElement('input');
> +input.setAttribute('dirName', "Hello");
> +shouldBeEqualToString('input.dirName', "Hello");
> +
> +var textArea = document.createElement('textarea');
> +textArea.setAttribute('dirName', "Hello");
> +shouldBeEqualToString('textArea.dirName', "Hello");

Need tests of form submission with dirname attribute.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list