I saw a lot of talk about how to get the current zoom ratio in the browser, but I did not understand why this snippet works in Firefox and not in Chrome.
public class MyComposite extends Composite { public MyComposite() { HTMLPanel panel = new HTMLPanel("<applet>...</applet>"); panel.addDomHandler(new MouseWheelHandler() { @Override public void onMouseWheel(MouseWheelEvent event) { event.stopPropagation(); event.preventDefault(); } }, MouseWheelEvent.getType()); initWidget(panel); } }
In both browsers, when I scroll inside the div containing the applet, the scroll does not extend to the parent (this is normal). And when I go beyond the div, the window scrolls (which is also good).
But when I do Ctrl + MouseWheel, in Firefox the zoom event is captured by the handler and not propagated, while in Chrome the handler does not seem to be called, and the event then propagates. I would also like to stop the distribution in Chrome.
Is there a bug in Chrome or am I something wrong?
source share