google-code-export / rocket-gwt

Automatically exported from code.google.com/p/rocket-gwt
1 stars 1 forks source link

rocket.selection.test.selection fails on Mac #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Import rocket-gwt into Eclipse.  Run SelectionTest.  Following output is shown:

invokeNativeHandle(@rocket.selection.client.support.SafariSelectionSupport::getN
ativeSelection()):
JavaScript undefined; expected com.google.gwt.core.client.JavaScriptObject

Here's the stack trace:

com.google.gwt.dev.shell.HostedModeException:
invokeNativeHandle(@rocket.selection.client.support.SafariSelectionSupport::getN
ativeSelection()):
JavaScript undefined, expected com.google.gwt.core.client.JavaScriptObject
    at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:101)
    at
com.google.gwt.dev.shell.ModuleSpace.invokeNativeHandle(ModuleSpace.java:226)
    at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeHandle(JavaScriptHost.java:8
9)
    at
rocket.selection.client.support.SafariSelectionSupport.getNativeSelection(Safari
SelectionSupport.java:26)
    at
rocket.selection.client.support.SafariSelectionSupport.clear(SafariSelectionSupp
ort.java:31)
    at rocket.selection.client.SelectionHelper.clear(SelectionHelper.java:86)
    at rocket.selection.client.Selection.clear(Selection.java:60)
    at
rocket.selection.test.selection.client.SelectionTest.testIsTextSelectionEnabledW
ithinDisabledParent(SelectionTest.java:308)
    at
rocket.selection.test.selection.client.SelectionTest$4.execute(SelectionTest.jav
a:113)
    at rocket.testing.client.TestRunner.execute0(TestRunner.java:157)
    at rocket.testing.client.TestRunner$1.run(TestRunner.java:146)
    at com.google.gwt.user.client.Timer.fireImpl(Timer.java:164)
    at com.google.gwt.user.client.Timer.fireAndCatch(Timer.java:150)
    at com.google.gwt.user.client.Timer.fire(Timer.java:142)
    at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.google.gwt.dev.shell.mac.MethodDispatch.invoke(MethodDispatch.java:74)
    at org.eclipse.swt.internal.carbon.OS.ReceiveNextEvent(Native Method)
    at org.eclipse.swt.widgets.Display.sleep(Display.java:3801)
    at com.google.gwt.dev.GWTShell.pumpEventLoop(GWTShell.java:690)
    at com.google.gwt.dev.GWTShell.run(GWTShell.java:550)
    at com.google.gwt.dev.GWTShell.main(GWTShell.java:321)

Original issue reported on code.google.com by Chris.Teplovs@gmail.com on 5 Jul 2007 at 4:06

GoogleCodeExporter commented 9 years ago
Doh.

The doco i read for Safari must have been incorrect. If you want to fix the 
problem
yourself it should only require finding out where the safari selection is 
retrieved
from the DOM. I will grab Safari for Windows and check it out.

Original comment by miroslav...@gmail.com on 5 Jul 2007 at 9:38

GoogleCodeExporter commented 9 years ago
Quite a silly bug. Previously the getNativeSelection method of the
rocket.selection.client.support.SafariSelectionSupport class used $wnd.selection
property to fetch the selection object. The correct way to fetch the object is 
to
actually invoke the $wnd.getSelection() method.

.getNativeSelection()/*-{
  return $wnd.selection;
}-*/ 

I have re-run the tests with the fix and they all pass.

This fix will be included in the next release. For now you canr eplace the
rocket.selection.client.support.SafariSelectionSupport within Rocket.jar with 
the
file attached to this issue.

Fixed file may be fetched from svn, or simply replace the
rocket.selection.client.support.SafariSelectionSupport.class with the attached 
file

Original comment by miroslav...@gmail.com on 14 Jul 2007 at 5:39

Attachments: