Bug 155962 - [OS X] [RTL Scrollbars] Overlay RTL scrollbars animate in from the wrong side
Summary: [OS X] [RTL Scrollbars] Overlay RTL scrollbars animate in from the wrong side
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords: InRadar
Depends on: 155999
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-28 19:29 PDT by Myles C. Maxfield
Modified: 2016-04-05 11:14 PDT (History)
13 users (show)

See Also:


Attachments
Patch (8.52 KB, patch)
2016-03-28 19:35 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (8.53 KB, patch)
2016-03-28 19:43 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Needs to disable Settings::setMockScrollbarsEnabled (10.30 KB, patch)
2016-03-29 19:46 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (15.50 KB, patch)
2016-03-29 21:27 PDT, Myles C. Maxfield
darin: review+
Details | Formatted Diff | Diff
Patch for committing (15.46 KB, patch)
2016-03-30 10:49 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2016-03-28 19:29:16 PDT
[OS X] [RTL Scrollbars] Overlay RTL scrollbars animate in from the wrong side
Comment 1 Myles C. Maxfield 2016-03-28 19:35:57 PDT
Created attachment 275077 [details]
Patch
Comment 2 Myles C. Maxfield 2016-03-28 19:43:56 PDT
Created attachment 275078 [details]
Patch
Comment 3 Simon Fraser (smfr) 2016-03-28 21:46:13 PDT
Comment on attachment 275078 [details]
Patch

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

> Source/WebCore/platform/mac/ScrollAnimatorMac.mm:1307
> +        m_scrollableArea.setScrollbarDirection(newVerticalPainter);

Can we rename the "painter"s please? Very confusing to pass a "painter" to something that apparently takes a scrollbar.

> Source/WebCore/platform/mac/ScrollableAreaMac.mm:57
> +void ScrollableArea::setScrollbarDirection(NSScrollerImp *scroller) const

Not sure I like the term "direction" here. I would prefer setScrollbarLayoutDirection().
Comment 4 Myles C. Maxfield 2016-03-29 10:14:03 PDT
Comment on attachment 275078 [details]
Patch

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

>> Source/WebCore/platform/mac/ScrollAnimatorMac.mm:1307
>> +        m_scrollableArea.setScrollbarDirection(newVerticalPainter);
> 
> Can we rename the "painter"s please? Very confusing to pass a "painter" to something that apparently takes a scrollbar.

Yeah, good idea. However, doing this rename is pretty big, so I'll do it in a follow-up patch.
Comment 5 Myles C. Maxfield 2016-03-29 10:16:25 PDT
Committed r198784: <http://trac.webkit.org/changeset/198784>
Comment 6 Myles C. Maxfield 2016-03-29 17:38:07 PDT
Rolled out in https://bugs.webkit.org/show_bug.cgi?id=155999
Comment 7 Myles C. Maxfield 2016-03-29 19:46:02 PDT
Created attachment 275166 [details]
Needs to disable Settings::setMockScrollbarsEnabled
Comment 8 Myles C. Maxfield 2016-03-29 21:27:27 PDT
Created attachment 275178 [details]
Patch
Comment 9 Simon Fraser (smfr) 2016-03-29 21:44:34 PDT
Comment on attachment 275178 [details]
Patch

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

> Source/WebCore/platform/mac/ScrollbarThemeMac.h:69
> +    bool scrollbarPainterIsRTL(Scrollbar&);

Didn't we decide to get rid of the "painter" terminology?

> Source/WebCore/rendering/RenderTreeAsText.cpp:633
> +                ts << " RTL";

I think this is a bit confusing. To me this would imply "scrollbars on the left", rather than "scrollbar has RTL layout direction".

> LayoutTests/fast/scrolling/rtl-scrollbars-animation-property.html:1
> +<!DOCTYPE html><!-- webkit-test-runner [ dontMockScrollbars=true ] -->

Why the [ dontMockScrollbars=true ] as well as setMockScrollbarsEnabled(false) ?
Comment 10 Darin Adler 2016-03-30 09:09:54 PDT
Comment on attachment 275178 [details]
Patch

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

Despite the concerns from both Simon and me, I am going to mark this review+ but you should probably fix the things he asked about.

> Source/WebCore/platform/mac/ScrollbarThemeMac.h:67
> +    void didCreateScrollerImp(Scrollbar&);

This should be a static member function.

>> Source/WebCore/platform/mac/ScrollbarThemeMac.h:69
>> +    bool scrollbarPainterIsRTL(Scrollbar&);
> 
> Didn't we decide to get rid of the "painter" terminology?

How about just calling this isLayoutDirectionRTL?

This should be a static member function.

Annoying to have this here just for logging purposes.

Would be better to paragraph this with the other ScrollerImp function just above, I think. Omit the blank line.
Comment 11 Myles C. Maxfield 2016-03-30 10:44:14 PDT
Comment on attachment 275178 [details]
Patch

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

>> Source/WebCore/platform/mac/ScrollbarThemeMac.h:67
>> +    void didCreateScrollerImp(Scrollbar&);
> 
> This should be a static member function.

I don't think it can be static because the implementation calls painterForScrollbar().

>>> Source/WebCore/platform/mac/ScrollbarThemeMac.h:69
>>> +    bool scrollbarPainterIsRTL(Scrollbar&);
>> 
>> Didn't we decide to get rid of the "painter" terminology?
> 
> How about just calling this isLayoutDirectionRTL?
> 
> This should be a static member function.
> 
> Annoying to have this here just for logging purposes.
> 
> Would be better to paragraph this with the other ScrollerImp function just above, I think. Omit the blank line.

Same comment about painterForScrollbar().

>> LayoutTests/fast/scrolling/rtl-scrollbars-animation-property.html:1
>> +<!DOCTYPE html><!-- webkit-test-runner [ dontMockScrollbars=true ] -->
> 
> Why the [ dontMockScrollbars=true ] as well as setMockScrollbarsEnabled(false) ?

Whoops, this is left over from an older version of this patch.
Comment 12 Myles C. Maxfield 2016-03-30 10:49:09 PDT
Created attachment 275201 [details]
Patch for committing
Comment 13 Darin Adler 2016-03-30 11:34:09 PDT
Comment on attachment 275201 [details]
Patch for committing

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

> Source/WebCore/platform/mac/ScrollbarThemeMac.h:67
> +    static void didCreateScrollerImp(Scrollbar&);

Oops, you said this wouldn’t work!
Comment 14 Myles C. Maxfield 2016-03-30 11:53:48 PDT
(In reply to comment #13)
> Comment on attachment 275201 [details]
> Patch for committing
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=275201&action=review
> 
> > Source/WebCore/platform/mac/ScrollbarThemeMac.h:67
> > +    static void didCreateScrollerImp(Scrollbar&);
> 
> Oops, you said this wouldn’t work!

:(

Whoops.

I only compiled this on El Capitan.... where it doesn't call the non-static function. (This is why I posted the patch so I can do more investigation today)
Comment 15 Myles C. Maxfield 2016-03-30 15:19:06 PDT
Committed r198859: <http://trac.webkit.org/changeset/198859>
Comment 16 David Kilzer (:ddkilzer) 2016-04-03 02:57:50 PDT
(In reply to comment #15)
> Committed r198859: <http://trac.webkit.org/changeset/198859>

Follow-up gardening fixes:

EFL: r198944  <http://trac.webkit.org/changeset/198944>
GTK/iOS-Simulator/Windows: r198982  <http://trac.webkit.org/changeset/198982>
Comment 18 Myles C. Maxfield 2016-04-04 19:50:38 PDT
<rdar://problem/25118321>
Comment 19 Antonio Gomes 2016-04-04 22:16:04 PDT
Comment on attachment 275201 [details]
Patch for committing

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

> LayoutTests/platform/mac/fast/scrolling/rtl-scrollbars-animation-property-expected.txt:8
> +layer at (0,0) size 785x2000
> +  RenderView at (0,0) size 785x600
> +layer at (0,0) size 785x216
> +  RenderBlock {HTML} at (0,0) size 785x216
> +    RenderBody {BODY} at (8,8) size 769x200
> +layer at (8,8) size 200x200 clip at (8,8) size 185x185 scrollHeight 2000
> +  RenderBlock (relative positioned) {DIV} at (0,0) size 200x200
> +layer at (8,8) size 1x2000 backgroundClip at (8,8) size 185x185 clip at (8,8) size 185x185

Hi Myles. Post-land question:

Could you help me to understand how this test result ensures RTL animation correctness?
Comment 20 Myles C. Maxfield 2016-04-05 11:14:35 PDT
(In reply to comment #19)
> Comment on attachment 275201 [details]
> Patch for committing
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=275201&action=review
> 
> > LayoutTests/platform/mac/fast/scrolling/rtl-scrollbars-animation-property-expected.txt:8
> > +layer at (0,0) size 785x2000
> > +  RenderView at (0,0) size 785x600
> > +layer at (0,0) size 785x216
> > +  RenderBlock {HTML} at (0,0) size 785x216
> > +    RenderBody {BODY} at (8,8) size 769x200
> > +layer at (8,8) size 200x200 clip at (8,8) size 185x185 scrollHeight 2000
> > +  RenderBlock (relative positioned) {DIV} at (0,0) size 200x200
> > +layer at (8,8) size 1x2000 backgroundClip at (8,8) size 185x185 clip at (8,8) size 185x185
> 
> Hi Myles. Post-land question:
> 
> Could you help me to understand how this test result ensures RTL animation
> correctness?

RTL scrollbars are only supported on certain operating systems, and this file is not used on those operating systems. (On those operating systems, the -expected.txt has a line that says "layer at (8,8) size 200x200 clip at (23,8) size 185x185 scrollHeight 2000 scrollbarHasRTLLayoutDirection")

On OS X, we don't have any infrastructure to actually test the animation itself (because the animation is implemented by another framework on OS X). Instead, this test just makes sure that we set the appropriate state to tell the other framework to do the correct animation.