[Webkit-unassigned] [Bug 27756] [HTML5][Forms] Part 2 of datalist&list: Support for HTMLInputElement::list and HTMLInputElement::selectedOption

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 31 02:10:08 PDT 2009


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





--- Comment #6 from TAMURA, Kent <tkent at chromium.org>  2009-07-31 02:10:07 PDT ---
Thank you for the review.

(In reply to comment #5)
> (From update of attachment 33694 [details])
> You can just check here for dataListTag and cast directly to an
> HTMLDataListElement:

done.

> isEmpty() checks null:
>  697         m_hasNonEmptyList = !attr->isNull() && !attr->isEmpty();

done.

> This sseems like the long way around:
>       bool hadNonEmptyList = m_hasNonEmptyList;
>  697         m_hasNonEmptyList = !attr->isNull() && !attr->isEmpty();
>  698         if (hadNonEmptyList != m_hasNonEmptyList && attached()) {
>  699             // Re-create a renderer because m_hasNonEmptyList affects UI.
>  700             detach();
>  701             attach();
>  702         }
> 
> Do you really need to attach/detach every time?  Can't you do a layout or a
> style recalc?  What does the list do to the renderer?

The list attribute will creates a shadow child of the input element.  I just
followed the code for resultsAttr above in this method. 
RenderTextControlSingleLine doesn't have a feature to remove a shadow child and
re-layout.  So detach()&attach() was a simple solution.
Anyway, I have removed this code because we don't have the list UI for now. 
I'll re-implement another way in another patch.

> list() clearly should return a HTMLDataListElement*, or?  Otherwise you
> certainly shouldn't be blindly casting to one in callers of list()

HTML5 defines that `list' returns HTMLElement.  According to Hixie, we might
add other list source elements in the future.

-- 
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