Crash in RenderTableCell::borderTop() due to custom scrollbars after r124168
https://bugs.webkit.org/show_bug.cgi?id=93903

Reviewed by Tony Chang.

Source/WebCore:

r124168 changed when we create scrollbars so that it happens (rightly) at style change time.
However the RenderScrollbar code assumes that any overflow: scroll RenderScrollbar would be
created at layout time as it directly tries to layout to scrollbar parts. The big issues with
the move is that the first style change operates on a detached renderer which means that we
could crash in some situation.

Test: scrollbars/custom-scrollbar-table-cell.html

* rendering/RenderScrollbarPart.cpp:
(WebCore::RenderScrollbarPart::computeScrollbarWidth):
(WebCore::RenderScrollbarPart::computeScrollbarHeight):
Fixed the crash by using style information instead of calling the renderer. This is guaranteed
to be safe but it also means that custom scrollbars sizing is not right on table cells with
collapsing borders. The existing logic was querying layout information at style change so I
wouldn't bet on it working properly anyway.

LayoutTests:

* scrollbars/custom-scrollbar-table-cell-expected.png: Added.
* scrollbars/custom-scrollbar-table-cell-expected.txt: Added.
* scrollbars/custom-scrollbar-table-cell.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
6 files changed