Bug 89544

Summary: Redraw slider tick marks when datalist changes.
Product: WebKit Reporter: Keishi Hattori <keishi>
Component: FormsAssignee: Keishi Hattori <keishi>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov, gustavo, mifenton, philn, rakuco, tkent, webkit.review.bot, xan.lopez
Priority: P2 Keywords: WebExposed
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 87844    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Archive of layout-test-results from ec2-cr-linux-01
none
Patch
none
Patch
none
Patch
none
Patch
none
Patch
none
Archive of layout-test-results from gce-cq-03
none
Patch none

Keishi Hattori
Reported 2012-06-19 19:11:20 PDT
We need to redraw the slider tick marks when the datalist changes.
Attachments
Patch (32.88 KB, patch)
2012-06-19 20:37 PDT, Keishi Hattori
no flags
Patch (40.74 KB, patch)
2012-06-21 05:03 PDT, Keishi Hattori
no flags
Patch (40.77 KB, patch)
2012-06-21 06:48 PDT, Keishi Hattori
no flags
Patch (42.66 KB, patch)
2012-06-22 02:48 PDT, Keishi Hattori
no flags
Archive of layout-test-results from ec2-cr-linux-01 (892.29 KB, application/zip)
2012-06-22 05:03 PDT, WebKit Review Bot
no flags
Patch (55.15 KB, patch)
2012-07-17 05:58 PDT, Keishi Hattori
no flags
Patch (22.03 KB, patch)
2012-07-18 04:14 PDT, Keishi Hattori
no flags
Patch (22.15 KB, patch)
2012-07-18 19:19 PDT, Keishi Hattori
no flags
Patch (22.25 KB, patch)
2012-07-18 20:19 PDT, Keishi Hattori
no flags
Patch (22.24 KB, patch)
2012-07-18 22:53 PDT, Keishi Hattori
no flags
Archive of layout-test-results from gce-cq-03 (398.11 KB, application/zip)
2012-07-19 00:10 PDT, WebKit Review Bot
no flags
Patch (22.24 KB, patch)
2012-07-19 00:56 PDT, Keishi Hattori
no flags
Keishi Hattori
Comment 1 2012-06-19 20:37:01 PDT
Keishi Hattori
Comment 2 2012-06-19 20:39:23 PDT
Here is the performance test results for setting id. The variance between runs is too high to tell a difference. https://docs.google.com/spreadsheet/ccc?key=0AoaiM9jljUy8dDZfT3d6YzJ1UFFES2RmbHQ0Skw2bFE
Kent Tamura
Comment 3 2012-06-20 05:23:05 PDT
Please upload an EWS-cookable patch. Can you use dom/WebKitMutationObserver.* ?
Keishi Hattori
Comment 4 2012-06-21 05:03:39 PDT
Early Warning System Bot
Comment 5 2012-06-21 05:51:43 PDT
Early Warning System Bot
Comment 6 2012-06-21 06:12:15 PDT
Keishi Hattori
Comment 7 2012-06-21 06:48:34 PDT
Early Warning System Bot
Comment 8 2012-06-21 07:19:18 PDT
Early Warning System Bot
Comment 9 2012-06-21 07:31:32 PDT
WebKit Review Bot
Comment 10 2012-06-21 08:11:20 PDT
Comment on attachment 148788 [details] Patch Attachment 148788 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13037121
Keishi Hattori
Comment 11 2012-06-22 02:48:53 PDT
WebKit Review Bot
Comment 12 2012-06-22 05:03:27 PDT
Comment on attachment 148986 [details] Patch Attachment 148986 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13071011 New failing tests: fast/forms/datalist/update-range-with-datalist.html
WebKit Review Bot
Comment 13 2012-06-22 05:03:33 PDT
Created attachment 149000 [details] Archive of layout-test-results from ec2-cr-linux-01 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: ec2-cr-linux-01 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Keishi Hattori
Comment 14 2012-07-17 05:58:04 PDT
Gustavo Noronha (kov)
Comment 15 2012-07-17 06:08:10 PDT
Build Bot
Comment 16 2012-07-17 06:19:19 PDT
Gyuyoung Kim
Comment 17 2012-07-17 06:23:05 PDT
Build Bot
Comment 18 2012-07-17 06:26:22 PDT
Early Warning System Bot
Comment 19 2012-07-17 06:44:24 PDT
Early Warning System Bot
Comment 20 2012-07-17 06:53:58 PDT
Kent Tamura
Comment 21 2012-07-18 01:23:41 PDT
Comment on attachment 152747 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152747&action=review > Source/WebCore/html/HTMLInputElement.cpp:693 > - } > #if ENABLE(DATALIST) > - else if (attribute.name() == listAttr) > + } else if (attribute.name() == listAttr) { I recommend not to change '}' position. > Source/WebCore/html/HTMLInputElement.cpp:701 > #endif > #if ENABLE(INPUT_SPEECH) > - else if (attribute.name() == webkitspeechAttr) { > + } else if (attribute.name() == webkitspeechAttr) { I recommend move '}' before #endif. > Source/WebCore/html/HTMLInputElement.cpp:1517 > + m_listAttributeTargetObserver = ListAttributeTargetObserver::create(fastGetAttribute(listAttr), this); Do we need to create LIstAttributeTargetObserver when the input element is !inDocument()? > Source/WebCore/html/HTMLInputElement.cpp:1523 > + if (isRangeControl()) > + setNeedsStyleRecalc(); Should introduce new virtual member function in InputType, or call setNeedsStyleRecalc() unconditionally. > Source/WebCore/html/HTMLOptionElement.cpp:282 > + ContainerNode* dataList = parentNode(); > + while (dataList && !dataList->hasTagName(datalistTag)) > + dataList = dataList->parentNode(); > + > + if (!dataList) > + return 0; > + > + return static_cast<HTMLDataListElement*>(dataList); Readability of this code isn't good. - Not following an idiom of parent traversal - static_cast<> is far from its requirement (hasTagName(datalistTag)) How about the following? for (ContainerNode parent = parentNode(); parent ; parent = parent->parentNode()) { if (parent->hasTagName(datalistTag)) return static_cast<HTMLDataListElement*>(dataList); } return 0; > LayoutTests/ChangeLog:12 > + * fast/forms/datalist/update-range-with-datalist-expected.txt: Added. > + * fast/forms/datalist/update-range-with-datalist.html: Added. > + * platform/chromium-mac/fast/forms/datalist/update-range-with-datalist-expected.png: Added. This can be a ref-test.
Keishi Hattori
Comment 22 2012-07-18 04:14:15 PDT
Keishi Hattori
Comment 23 2012-07-18 04:14:27 PDT
Comment on attachment 152747 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152747&action=review >> Source/WebCore/html/HTMLInputElement.cpp:693 >> + } else if (attribute.name() == listAttr) { > > I recommend not to change '}' position. Done. >> Source/WebCore/html/HTMLInputElement.cpp:701 >> + } else if (attribute.name() == webkitspeechAttr) { > > I recommend move '}' before #endif. Done. >> Source/WebCore/html/HTMLInputElement.cpp:1517 >> + m_listAttributeTargetObserver = ListAttributeTargetObserver::create(fastGetAttribute(listAttr), this); > > Do we need to create LIstAttributeTargetObserver when the input element is !inDocument()? No. Added check. >> Source/WebCore/html/HTMLInputElement.cpp:1523 >> + setNeedsStyleRecalc(); > > Should introduce new virtual member function in InputType, or call setNeedsStyleRecalc() unconditionally. We will be doing different things for input type text and color so I added a new virtual member function to InputType. >> Source/WebCore/html/HTMLOptionElement.cpp:282 >> + return static_cast<HTMLDataListElement*>(dataList); > > Readability of this code isn't good. > - Not following an idiom of parent traversal > - static_cast<> is far from its requirement (hasTagName(datalistTag)) > > How about the following? > > for (ContainerNode parent = parentNode(); parent ; parent = parent->parentNode()) { > if (parent->hasTagName(datalistTag)) > return static_cast<HTMLDataListElement*>(dataList); > } > return 0; Done. >> LayoutTests/ChangeLog:12 >> + * platform/chromium-mac/fast/forms/datalist/update-range-with-datalist-expected.png: Added. > > This can be a ref-test. Done.
Build Bot
Comment 24 2012-07-18 04:37:52 PDT
Build Bot
Comment 25 2012-07-18 05:20:35 PDT
Kent Tamura
Comment 26 2012-07-18 06:45:00 PDT
Comment on attachment 152984 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=152984&action=review > Source/WebCore/html/HTMLInputElement.cpp:90 > +class ListAttributeTargetObserver : IdTargetObserver { > +public: > + static PassOwnPtr<ListAttributeTargetObserver> create(const AtomicString& id, HTMLInputElement*); > + virtual void idTargetChanged() OVERRIDE; > + > +private: > + ListAttributeTargetObserver(const AtomicString& id, HTMLInputElement*); > + > + HTMLInputElement* m_element; > +}; should be enclosed with #if ENABLE(DATALIST) > Source/WebCore/html/HTMLInputElement.cpp:1522 > +{ > + if (!inDocument()) > + return; > + m_listAttributeTargetObserver = ListAttributeTargetObserver::create(fastGetAttribute(listAttr), this); > +} I know this works well. However this code might make a reader nervous because of possibility of leak of a wrong ListAttributeTargetObserver object. I recommend clearing m_listAttributeTargetObserver if !inDocument(), and use resetListAttributeTargetObserver() in removedFrom() too. > Source/WebCore/html/HTMLInputElement.cpp:1811 > +PassOwnPtr<ListAttributeTargetObserver> ListAttributeTargetObserver::create(const AtomicString& id, HTMLInputElement* element) > +{ > + return adoptPtr(new ListAttributeTargetObserver(id, element)); > +} > + > +ListAttributeTargetObserver::ListAttributeTargetObserver(const AtomicString& id, HTMLInputElement* element) > + : IdTargetObserver(element->treeScope()->idTargetObserverRegistry(), id) > + , m_element(element) > +{ > +} > + > +void ListAttributeTargetObserver::idTargetChanged() > +{ > + m_element->listAttributeTargetChanged(); > +} should be enclosed with #if ENABLE(DATALIST) > Source/WebCore/html/HTMLInputElement.h:398 > + OwnPtr<ListAttributeTargetObserver> m_listAttributeTargetObserver; should be enclosed with #if ENABLE(DATALIST)
Keishi Hattori
Comment 27 2012-07-18 19:19:24 PDT
Kent Tamura
Comment 28 2012-07-18 19:23:15 PDT
Comment on attachment 153160 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=153160&action=review > Source/WebCore/html/HTMLInputElement.cpp:1446 > +#if ENABLE(DATALIST) > + resetListAttributeTargetObserver(); > +#endif > HTMLTextFormControlElement::removedFrom(insertionPoint); Node::removedFrom() clears inDocument flag. So this should be HTMLTextFormControlElement::removedFrom(insertionPoint); ASSERT(!inDocument()); #if ENABLE(DATALIST) resetListAttributeTargetObserver(); #endif
Keishi Hattori
Comment 29 2012-07-18 20:19:12 PDT
Kent Tamura
Comment 30 2012-07-18 21:10:57 PDT
Comment on attachment 153168 [details] Patch ok
Keishi Hattori
Comment 31 2012-07-18 22:53:49 PDT
WebKit Review Bot
Comment 32 2012-07-19 00:10:20 PDT
Comment on attachment 153181 [details] Patch Rejecting attachment 153181 [details] from commit-queue. New failing tests: fast/forms/datalist/update-range-with-datalist.html Full output: http://queues.webkit.org/results/13273776
WebKit Review Bot
Comment 33 2012-07-19 00:10:26 PDT
Created attachment 153192 [details] Archive of layout-test-results from gce-cq-03 The attached test failures were seen while running run-webkit-tests on the commit-queue. Bot: gce-cq-03 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid
Keishi Hattori
Comment 34 2012-07-19 00:56:39 PDT
WebKit Review Bot
Comment 35 2012-07-19 01:55:21 PDT
Comment on attachment 153200 [details] Patch Clearing flags on attachment: 153200 Committed r123081: <http://trac.webkit.org/changeset/123081>
WebKit Review Bot
Comment 36 2012-07-19 01:55:29 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.