Bug 145490 - Make RangeInputType into a three-part flexible box, replacing crufty layout code
Summary: Make RangeInputType into a three-part flexible box, replacing crufty layout code
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords:
Depends on:
Blocks: 145491
  Show dependency treegraph
 
Reported: 2015-05-30 00:37 PDT by Jer Noble
Modified: 2015-06-01 16:43 PDT (History)
6 users (show)

See Also:


Attachments
Patch (41.77 KB, patch)
2015-05-30 00:45 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews105 for mac-mavericks-wk2 (709.55 KB, application/zip)
2015-05-30 01:23 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews100 for mac-mavericks (677.82 KB, application/zip)
2015-05-30 01:36 PDT, Build Bot
no flags Details
Patch (44.47 KB, patch)
2015-06-01 09:32 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (44.47 KB, patch)
2015-06-01 10:24 PDT, Jer Noble
darin: review+
Details | Formatted Diff | Diff
Patch for landing (49.58 KB, patch)
2015-06-01 16:26 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (51.14 KB, patch)
2015-06-01 16:43 PDT, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2015-05-30 00:37:54 PDT
Make RangeInputType into a three-part flexible box, replacing crufty layout code
Comment 1 Jer Noble 2015-05-30 00:45:40 PDT
Created attachment 253952 [details]
Patch
Comment 2 Jer Noble 2015-05-30 00:54:37 PDT
Will fix up the efl-wk2 error in a subsequent patch.
Comment 3 Build Bot 2015-05-30 01:23:20 PDT
Comment on attachment 253952 [details]
Patch

Attachment 253952 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/4720096303906816

New failing tests:
fast/forms/box-shadow-override.html
fast/forms/input-appearance-height.html
fast/forms/range/range-change-min-max.html
Comment 4 Build Bot 2015-05-30 01:23:22 PDT
Created attachment 253954 [details]
Archive of layout-test-results from ews105 for mac-mavericks-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-mavericks-wk2  Platform: Mac OS X 10.9.5
Comment 5 Build Bot 2015-05-30 01:36:35 PDT
Comment on attachment 253952 [details]
Patch

Attachment 253952 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5103627219763200

New failing tests:
fast/forms/box-shadow-override.html
fast/forms/input-appearance-height.html
fast/forms/range/range-change-min-max.html
Comment 6 Build Bot 2015-05-30 01:36:37 PDT
Created attachment 253957 [details]
Archive of layout-test-results from ews100 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 7 Jer Noble 2015-06-01 09:32:39 PDT
Created attachment 254003 [details]
Patch
Comment 8 Jer Noble 2015-06-01 09:33:31 PDT
Added a couple of mac-mavericks rebaselines, and fixed an issue where the tracks children weren't being marked as needing layout.
Comment 9 Jer Noble 2015-06-01 10:24:37 PDT
Created attachment 254007 [details]
Patch
Comment 10 Darin Adler 2015-06-01 12:00:02 PDT
Comment on attachment 254007 [details]
Patch

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

> Source/WebCore/html/HTMLInputElement.h:154
>      HTMLElement* sliderThumbElement() const;
>      HTMLElement* sliderTrackElement() const;
> +    HTMLElement* sliderMinTrackElement() const;
> +    HTMLElement* sliderMaxTrackElement() const;

Exposing all of these elements in public functions seems like a particularly bad way to create a relationship between type-specific renderer classes and HTMLInputElement. I see that you are participating in a grand tradition of questionable design here, but I still don’t like it.

> Source/WebCore/rendering/RenderSlider.cpp:121
> +    HTMLElement* sliderTrackElement = element().sliderTrackElement();
> +    HTMLElement* minTrackElement = element().sliderMinTrackElement();
> +    HTMLElement* maxTrackElement = element().sliderMaxTrackElement();
> +
> +    ASSERT(sliderTrackElement);
> +    ASSERT(minTrackElement);
> +    ASSERT(maxTrackElement);

Can we get at these some other way than making them public functions on HTMLInputElement? Let me put this another way. This function clearly only needs to make style changes to these elements. So could we expose functions that return RenderStyle& instead of functions that return HTMLElement? Or we could add functions that expose the renderers. And could we make RenderSlider a friend of HTMLInputElement so these could be private functions?

If we were going to keep the ones that return elements I would use a return type of HTMLElement& and have the assertion inside the function rather than at the call site.
Comment 11 Jer Noble 2015-06-01 13:38:19 PDT
(In reply to comment #10)
> Comment on attachment 254007 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=254007&action=review
> 
> > Source/WebCore/html/HTMLInputElement.h:154
> >      HTMLElement* sliderThumbElement() const;
> >      HTMLElement* sliderTrackElement() const;
> > +    HTMLElement* sliderMinTrackElement() const;
> > +    HTMLElement* sliderMaxTrackElement() const;
> 
> Exposing all of these elements in public functions seems like a particularly
> bad way to create a relationship between type-specific renderer classes and
> HTMLInputElement. I see that you are participating in a grand tradition of
> questionable design here, but I still don’t like it.

Yes, but I'm trying to make it less questionable, so this would be in the new tradition of less questionable design. :)

Another option would be to put these methods on RangeInputType, and make RangeInput downcast-able from InputType.

> > Source/WebCore/rendering/RenderSlider.cpp:121
> > +    HTMLElement* sliderTrackElement = element().sliderTrackElement();
> > +    HTMLElement* minTrackElement = element().sliderMinTrackElement();
> > +    HTMLElement* maxTrackElement = element().sliderMaxTrackElement();
> > +
> > +    ASSERT(sliderTrackElement);
> > +    ASSERT(minTrackElement);
> > +    ASSERT(maxTrackElement);
> 
> Can we get at these some other way than making them public functions on
> HTMLInputElement?

Yes, let me try the option I mention above.

> Let me put this another way. This function clearly only
> needs to make style changes to these elements. So could we expose functions
> that return RenderStyle& instead of functions that return HTMLElement? Or we
> could add functions that expose the renderers. And could we make
> RenderSlider a friend of HTMLInputElement so these could be private
> functions?

I'll keep that in mind if I can't move these methods to RangeInputType.

> If we were going to keep the ones that return elements I would use a return
> type of HTMLElement& and have the assertion inside the function rather than
> at the call site.

I think this is a great idea regardless.
Comment 12 Jer Noble 2015-06-01 16:26:47 PDT
Created attachment 254022 [details]
Patch for landing
Comment 13 Jer Noble 2015-06-01 16:43:30 PDT
Created attachment 254025 [details]
Patch for landing