diff -r 4272317a42ad modules/javafx.web/src/main/java/com/sun/javafx/webkit/drt/DumpRenderTree.java --- a/modules/javafx.web/src/main/java/com/sun/javafx/webkit/drt/DumpRenderTree.java Mon Dec 12 16:25:29 2016 -0800 +++ b/modules/javafx.web/src/main/java/com/sun/javafx/webkit/drt/DumpRenderTree.java Tue Dec 20 13:48:31 2016 +0000 @@ -129,27 +129,27 @@ } @Override - protected int hitTest(int w, int h, int orientation, int value, int visibleSize, int totalSize, int x, int y) { + protected int hitTest(long id, int x, int y) { return 0; } @Override - protected int getThumbPosition(int w, int h, int orientation, int value, int visibleSize, int totalSize) { + protected int getThumbPosition(long id) { return 0; } @Override - protected int getThumbLength(int w, int h, int orientation, int value, int visibleSize, int totalSize) { + protected int getThumbLength(long id) { return 0; } @Override - protected int getTrackPosition(int w, int h, int orientation) { + protected int getTrackPosition(long id) { return 0; } @Override - protected int getTrackLength(int w, int h, int orientation) { + protected int getTrackLength(long id) { return 0; } diff -r 4272317a42ad modules/javafx.web/src/main/java/com/sun/javafx/webkit/theme/ScrollBarThemeImpl.java --- a/modules/javafx.web/src/main/java/com/sun/javafx/webkit/theme/ScrollBarThemeImpl.java Mon Dec 12 16:25:29 2016 -0800 +++ b/modules/javafx.web/src/main/java/com/sun/javafx/webkit/theme/ScrollBarThemeImpl.java Tue Dec 20 13:48:31 2016 +0000 @@ -192,17 +192,13 @@ return new WCSize(0, 0); } - @Override protected int hitTest(int w, int h, int orientation, int value, - int visibleSize, int totalSize, - int x, int y) + @Override protected int hitTest(long id, int x, int y) { if (log.isLoggable(Level.FINEST)) { - log.log(Level.FINEST, "[{0}, {1} {2}x{3}], {4}", - new Object[] {x, y, w, h, orientation == VERTICAL_SCROLLBAR ? - "VERTICAL" : "HORIZONTAL"}); + log.log(Level.FINEST, "[{0}, {1}x{2}]", new Object[] {id, x, y}); } - ScrollBar testSB = testSBRef.get(); + ScrollBar testSB = pool.get(id); if (testSB == null) { return NO_PART; } @@ -211,8 +207,6 @@ Node decButton = getDecButton(testSB); Node incButton = getIncButton(testSB); - adjustScrollBar(testSB, w, h, orientation, value, visibleSize, totalSize); - int trackX; int trackY; int incBtnX; @@ -220,15 +214,17 @@ int thumbX; int thumbY; - if (orientation == VERTICAL_SCROLLBAR) { + int orientation = (testSB.getOrientation() == Orientation.HORIZONTAL ? + HORIZONTAL_SCROLLBAR : VERTICAL_SCROLLBAR); + if (testSB.getOrientation() == Orientation.VERTICAL) { trackX = incBtnX = thumbX = x; trackY = y - (int)decButton.getLayoutBounds().getHeight(); - thumbY = trackY - thumbPosition(); + thumbY = trackY - thumbPosition(testSB); incBtnY = trackY - (int)track.getLayoutBounds().getHeight(); } else { trackY = incBtnY = thumbY = y; trackX = x - (int)decButton.getLayoutBounds().getWidth(); - thumbX = trackX - thumbPosition(); + thumbX = trackX - thumbPosition(testSB); incBtnX = trackX - (int)track.getLayoutBounds().getWidth(); } @@ -238,14 +234,14 @@ } else if (track != null && track.isVisible() && track.contains(trackX, trackY)) { - if ((orientation == VERTICAL_SCROLLBAR && thumbPosition() >= trackY) || - (orientation == HORIZONTAL_SCROLLBAR && thumbPosition() >= trackX)) + if ((orientation == VERTICAL_SCROLLBAR && thumbPosition(testSB) >= trackY) || + (orientation == HORIZONTAL_SCROLLBAR && thumbPosition(testSB) >= trackX)) { log.finer("back track"); return BACK_TRACK_PART; - } else if ((orientation == VERTICAL_SCROLLBAR && thumbPosition() < trackY) || - (orientation == HORIZONTAL_SCROLLBAR && thumbPosition() < trackX)) + } else if ((orientation == VERTICAL_SCROLLBAR && thumbPosition(testSB) < trackY) || + (orientation == HORIZONTAL_SCROLLBAR && thumbPosition(testSB) < trackX)) { log.finer("forward track"); return FORWARD_TRACK_PART; @@ -263,8 +259,8 @@ return NO_PART; } - private int thumbPosition() { - ScrollBar testSB = testSBRef.get(); + private int thumbPosition(ScrollBar sb) { + ScrollBar testSB = sb; if (testSB == null) { return 0; } @@ -289,11 +285,9 @@ : 0); } - @Override protected int getThumbLength(int w, int h, int orientation, - int value, - int visibleSize, int totalSize) + @Override protected int getThumbLength(long id) { - ScrollBar testSB = testSBRef.get(); + ScrollBar testSB = pool.get(id); if (testSB == null) { return 0; } @@ -301,8 +295,9 @@ if (thumb == null) { return 0; } - adjustScrollBar(testSB, w, h, orientation, value, visibleSize, totalSize); + int orientation = (testSB.getOrientation() == Orientation.HORIZONTAL ? + HORIZONTAL_SCROLLBAR : VERTICAL_SCROLLBAR); double len = 0; if (orientation == VERTICAL_SCROLLBAR) { len = thumb.getLayoutBounds().getHeight(); @@ -313,8 +308,8 @@ return (int)len; } - @Override protected int getTrackPosition(int w, int h, int orientation) { - ScrollBar testSB = testSBRef.get(); + @Override protected int getTrackPosition(long id) { + ScrollBar testSB = pool.get(id); if (testSB == null) { return 0; } @@ -322,9 +317,10 @@ if (decButton == null) { return 0; } - adjustScrollBar(testSB, w, h, orientation); double pos = 0; + int orientation = (testSB.getOrientation() == Orientation.HORIZONTAL ? + HORIZONTAL_SCROLLBAR : VERTICAL_SCROLLBAR); if (orientation == VERTICAL_SCROLLBAR) { pos = decButton.getLayoutBounds().getHeight(); } else { @@ -334,8 +330,8 @@ return (int)pos; } - @Override protected int getTrackLength(int w, int h, int orientation) { - ScrollBar testSB = testSBRef.get(); + @Override protected int getTrackLength(long id) { + ScrollBar testSB = pool.get(id); if (testSB == null) { return 0; } @@ -343,9 +339,10 @@ if (track == null) { return 0; } - adjustScrollBar(testSB, w, h, orientation); double len = 0; + int orientation = (testSB.getOrientation() == Orientation.HORIZONTAL ? + HORIZONTAL_SCROLLBAR : VERTICAL_SCROLLBAR); if (orientation == VERTICAL_SCROLLBAR) { len = track.getLayoutBounds().getHeight(); } else { @@ -355,17 +352,14 @@ return (int)len; } - @Override protected int getThumbPosition(int w, int h, int orientation, - int value, - int visibleSize, int totalSize) + @Override protected int getThumbPosition(long id) { - ScrollBar testSB = testSBRef.get(); + ScrollBar testSB = pool.get(id); if (testSB == null) { return 0; } - adjustScrollBar(testSB, w, h, orientation, value, visibleSize, totalSize); - int pos = thumbPosition(); + int pos = thumbPosition(testSB); log.log(Level.FINEST, "thumb position: {0}", pos); return pos; } diff -r 4272317a42ad modules/javafx.web/src/main/java/com/sun/webkit/graphics/ScrollBarTheme.java --- a/modules/javafx.web/src/main/java/com/sun/webkit/graphics/ScrollBarTheme.java Mon Dec 12 16:25:29 2016 -0800 +++ b/modules/javafx.web/src/main/java/com/sun/webkit/graphics/ScrollBarTheme.java Tue Dec 20 13:48:31 2016 +0000 @@ -56,15 +56,15 @@ public abstract void paint(WCGraphicsContext g, Ref sbRef, int x, int y, int pressedPart, int hoveredPart); - protected abstract int hitTest(int w, int h, int orientation, int value, int visibleSize, int totalSize, int x, int y); + protected abstract int hitTest(long id, int x, int y); - protected abstract int getThumbPosition(int w, int h, int orientation, int value, int visibleSize, int totalSize); + protected abstract int getThumbPosition(long id); - protected abstract int getThumbLength(int w, int h, int orientation, int value, int visibleSize, int totalSize); + protected abstract int getThumbLength(long id); - protected abstract int getTrackPosition(int w, int h, int orientation); + protected abstract int getTrackPosition(long id); - protected abstract int getTrackLength(int w, int h, int orientation); + protected abstract int getTrackLength(long id); public abstract WCSize getWidgetSize(Ref widget); } diff -r 4272317a42ad modules/javafx.web/src/main/native/Source/WebCore/platform/java/ScrollbarThemeJava.cpp --- a/modules/javafx.web/src/main/native/Source/WebCore/platform/java/ScrollbarThemeJava.cpp Mon Dec 12 16:25:29 2016 -0800 +++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/java/ScrollbarThemeJava.cpp Tue Dec 20 13:48:31 2016 +0000 @@ -21,6 +21,14 @@ #include "com_sun_webkit_graphics_ScrollBarTheme.h" #include "com_sun_webkit_graphics_GraphicsDecoder.h" +#undef ASSERT +#define ASSERT(con) do { \ + if (!(con)) {\ + fprintf(stderr, "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ FAILED at %s %d %s\n", __FILE__, __LINE__, #con);\ + fflush(stderr);\ + }\ + } while (0) + namespace WebCore { @@ -119,19 +127,14 @@ static jmethodID mid = env->GetMethodID( getJScrollBarThemeClass(), "hitTest", - "(IIIIIIII)I"); + "(JII)I"); ASSERT(mid); IntPoint p = scrollbar.convertFromContainingWindow(pos); int part = env->CallIntMethod( jtheme, mid, - (jint)scrollbar.width(), - (jint)scrollbar.height(), - (jint)scrollbar.orientation(), - (jint)scrollbar.value(), - (jint)scrollbar.visibleSize(), - (jint)scrollbar.totalSize(), + ptr_to_jlong(&scrollbar), (jint)p.x(), (jint)p.y()); CheckAndClearException(env); @@ -156,18 +159,13 @@ static jmethodID mid = env->GetMethodID( getJScrollBarThemeClass(), "getThumbPosition", - "(IIIIII)I"); + "(J)I"); ASSERT(mid); int pos = env->CallIntMethod( jtheme, mid, - (jint)scrollbar.width(), - (jint)scrollbar.height(), - (jint)scrollbar.orientation(), - (jint)scrollbar.value(), - (jint)scrollbar.visibleSize(), - (jint)scrollbar.totalSize()); + ptr_to_jlong(&scrollbar)); CheckAndClearException(env); return pos; @@ -184,18 +182,13 @@ static jmethodID mid = env->GetMethodID( getJScrollBarThemeClass(), "getThumbLength", - "(IIIIII)I"); + "(J)I"); ASSERT(mid); int len = env->CallIntMethod( jtheme, mid, - (jint)scrollbar.width(), - (jint)scrollbar.height(), - (jint)scrollbar.orientation(), - (jint)scrollbar.value(), - (jint)scrollbar.visibleSize(), - (jint)scrollbar.totalSize()); + ptr_to_jlong(&scrollbar)); CheckAndClearException(env); return len; @@ -212,15 +205,13 @@ static jmethodID mid = env->GetMethodID( getJScrollBarThemeClass(), "getTrackPosition", - "(III)I"); + "(J)I"); ASSERT(mid); int pos = env->CallIntMethod( jtheme, mid, - (jint)scrollbar.width(), - (jint)scrollbar.height(), - (jint)scrollbar.orientation()); + ptr_to_jlong(&scrollbar)); CheckAndClearException(env); return pos; @@ -237,15 +228,13 @@ static jmethodID mid = env->GetMethodID( getJScrollBarThemeClass(), "getTrackLength", - "(III)I"); + "(J)I"); ASSERT(mid); int len = env->CallIntMethod( jtheme, mid, - (jint)scrollbar.width(), - (jint)scrollbar.height(), - (jint)scrollbar.orientation()); + ptr_to_jlong(&scrollbar)); CheckAndClearException(env); return len;