Bug 93941 - [Forms] Set SpinButtonElement free from HTMLInputElement
Summary: [Forms] Set SpinButtonElement free from HTMLInputElement
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: yosin
URL:
Keywords:
Depends on: 94311
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-14 01:20 PDT by yosin
Modified: 2012-08-19 22:11 PDT (History)
7 users (show)

See Also:


Attachments
Patch 1 (55.93 KB, patch)
2012-08-16 01:44 PDT, yosin
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from gce-cr-linux-04 (313.47 KB, application/zip)
2012-08-16 02:26 PDT, WebKit Review Bot
no flags Details
Patch 2 (55.95 KB, patch)
2012-08-16 03:42 PDT, yosin
no flags Details | Formatted Diff | Diff
Patch 3 (12.90 KB, patch)
2012-08-17 02:55 PDT, yosin
no flags Details | Formatted Diff | Diff
Patch 4 (13.55 KB, patch)
2012-08-19 22:10 PDT, yosin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description yosin 2012-08-14 01:20:37 PDT
I would like to set SpinButtonElement free from HTMLInputELement, because:
  1. Concept and functionality of spin button is independent from the "input" element.
  2. ease of mountainous: HTMLInputElement.{cpp,h} changes don't affect to SpinButtonElement
  3. faster build time when HTMLInputElement.h changed. Frequency of HTMLInputElement.h changes is more often than SpinButtonElement.h, because HTMLInputElement has lot of methods for various input types.
Comment 1 yosin 2012-08-14 01:25:39 PDT
I also move code of SpinButtonElement to separate file. Since multiple fields time input UI, SpinButtonElement is not only text field inner element but also inner element of multiple fields time input UI.
Comment 2 yosin 2012-08-16 01:44:50 PDT
Created attachment 158749 [details]
Patch 1
Comment 3 WebKit Review Bot 2012-08-16 02:26:16 PDT
Comment on attachment 158749 [details]
Patch 1

Attachment 158749 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13517286

New failing tests:
fast/forms/number/number-change-type-on-focus.html
Comment 4 WebKit Review Bot 2012-08-16 02:26:21 PDT
Created attachment 158757 [details]
Archive of layout-test-results from gce-cr-linux-04

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: gce-cr-linux-04  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid
Comment 5 yosin 2012-08-16 03:42:09 PDT
Created attachment 158768 [details]
Patch 2
Comment 6 Kent Tamura 2012-08-16 18:04:35 PDT
Comment on attachment 158768 [details]
Patch 2

The patch doesn't have r? flag, but I have a comment.

I recommend to split the patch into three pieces.
1. Add SpinButtonElement.{cpp.h} to build files, and remove unnecessary code
2. Rename StepActionHandler to SpinButtonOwner
3. Remaining

Reviewers can set r+ for 1 and 2 easily because they are mechanical changes.
Reviewers need to review 3 and it should be smaller in order to concentrate on it easily. Actually, your first patch had use-after-free.
Comment 7 Kent Tamura 2012-08-16 18:05:42 PDT
(In reply to comment #6)
> Reviewers need to review 3

need to review 3 carefully
Comment 8 yosin 2012-08-16 19:02:16 PDT
Comment on attachment 158768 [details]
Patch 2

Could you review this patch?
Thanks in advance.
Comment 9 Kent Tamura 2012-08-16 19:08:06 PDT
Comment on attachment 158768 [details]
Patch 2

r- because of comment #6
Comment 10 yosin 2012-08-17 02:55:03 PDT
Created attachment 159064 [details]
Patch 3
Comment 11 yosin 2012-08-19 19:30:05 PDT
Comment on attachment 159064 [details]
Patch 3

Could you review this patch?
Thanks in advance.
Comment 12 Kent Tamura 2012-08-19 20:51:51 PDT
Comment on attachment 159064 [details]
Patch 3

View in context: https://bugs.webkit.org/attachment.cgi?id=159064&action=review

> Source/WebCore/ChangeLog:40
> +        * html/TextFieldInputType.cpp:
> +        (WebCore::TextFieldInputType::focusAndSelectSpinButtonOwner):
> +        (WebCore::TextFieldInputType::shouldSpinButtonRespondToMouseEvents):
> +        (WebCore::TextFieldInputType::shouldSpinButtonRespondToWheelEvents):
> +        * html/TextFieldInputType.h:
> +        (TextFieldInputType):
> +        * html/TimeInputType.cpp:
> +        (WebCore::TimeInputType::DateTimeEditControlOwnerImpl::focusAndSelectEditControlOwner):
> +        (WebCore::TimeInputType::DateTimeEditControlOwnerImpl::isEditControlOwnerFocused):
> +        * html/TimeInputType.h:
> +        (DateTimeEditControlOwnerImpl):
> +        * html/shadow/DateTimeEditElement.cpp:
> +        (WebCore::DateTimeEditElement::focusAndSelectSpinButtonOwner):
> +        (WebCore::DateTimeEditElement::shouldSpinButtonRespondToMouseEvents):
> +        (WebCore::DateTimeEditElement::shouldSpinButtonRespondToWheelEvents):
> +        * html/shadow/DateTimeEditElement.h:
> +        (EditControlOwner):
> +        (DateTimeEditElement):
> +        * html/shadow/SpinButtonElement.cpp:
> +        (WebCore::SpinButtonElement::defaultEventHandler):
> +        (WebCore::SpinButtonElement::forwardEvent):
> +        (WebCore::SpinButtonElement::willRespondToMouseMoveEvents):
> +        (WebCore::SpinButtonElement::willRespondToMouseClickEvents):
> +        (WebCore::SpinButtonElement::step):
> +        (WebCore::SpinButtonElement::shouldRespondToMouseEvents):
> +        * html/shadow/SpinButtonElement.h:
> +        (SpinButtonOwner):
> +        (SpinButtonElement):

You had better add per-function comments, especially to existing functions.
Comment 13 yosin 2012-08-19 22:10:02 PDT
Created attachment 159330 [details]
Patch 4
Comment 14 yosin 2012-08-19 22:11:18 PDT
Comment on attachment 159330 [details]
Patch 4

Clearing flags on attachment: 159330

Committed r125997: <http://trac.webkit.org/changeset/125997>
Comment 15 yosin 2012-08-19 22:11:29 PDT
All reviewed patches have been landed.  Closing bug.