final int sliderWidth = this.getOffsetWidth();
final int sliderHeight = this.getOffsetHeight();
final Widget handle = this.getHandle();
final Element handleElement = handle.getElement();
final InlineStyle handleInlineStyle = InlineStyle.getInlineStyle(handleElement );
final int handleWidth = handle.getOffsetWidth();
final int handleHeight = handle.getOffsetHeight();
// make mouse coordinates relative to top/left of slider.
int mouseX = event.getPageX() - widgetX;
mouseX = Math.max(0, Math.min(mouseX, sliderWidth - handleWidth / 2));
final int newX = this.updateSliderValue(mouseX, this.getMaximumXValue(), sliderWidth, handleWidth);
this.setXValue(newX);
int left = mouseX - handleWidth / 2;
handleInlineStyle.setInteger(Css.LEFT, left, CssUnit.PX);
int mouseY = event.getPageY() - widgetY;
mouseY = Math.max(0, Math.min(mouseY, sliderHeight - handleHeight / 2));
final int newY = this.updateSliderValue(mouseY, this.getMaximumYValue(), sliderHeight, handleHeight);
this.setYValue(newY);
final int top = mouseY - handleHeight / 2;
handleInlineStyle.setInteger(Css.TOP, top, CssUnit.PX);
event.cancelBubble(true);
event.stop();// stops text selection in Opera
}