Fabian Lange [Thu, 28 Aug 2014 16:23:15 +0000 (19:23 +0300)]
fixes incorrect JSONArray/String usage in ServerRpcHandler (#14471)
As described by Johannes, the RPCRequest constructor first takes whole
JSON as string and builds its attribute json from it (by parsing).
Then it reads from this parsed JSON the array called "rpc".
However it previously did a .toString on it only to re-parse it.
Newer json versions complain that "rpc" is not a string, but an array.
Bogdan Udrescu [Mon, 11 Aug 2014 10:08:39 +0000 (13:08 +0300)]
Prevent browser to scroll when space it pressed on a TabSheet (#14320)
Browser page scroll by default when space key is pressed.
The TabSheet uses the space key (32) to select the tab
when navigating using left/right keys. So when the space
is pressed the default browser page scroll behavior is
now prevented.
Artur Signell [Mon, 4 Aug 2014 11:12:59 +0000 (14:12 +0300)]
Do not call requestStart/end multiple times when using push (#14228)
All HTTP request based push request invoke onRequestStart/End in the servlet.
We need to trigger start/end separately in push handler only for websocket messages
Correctly display an item which is too long for the textfield. (#13477)
As setSelectionRange is not working correctly in IE the current approach
sets the direction before setting the text and resets it to the original
immediately after that.
Change-Id: I33f40f9ae436122092d995fa17c35a9cbe38aedb
Markus Koivisto [Wed, 4 Jun 2014 09:49:43 +0000 (12:49 +0300)]
Fixed regression with changing widths when stylenames have changed (#13444, #8801):
Changing the name of a style should not cause the width of the textbox
to change. If there is a width set for the wrapper, the width for the
wrapper should not change if the styles changes.
To reconcile these two demands, we have removed the width for the
wrapper and only manipulate the width of the textbox itself. This
solves both issues neatly.
Markus Koivisto [Wed, 30 Jul 2014 14:28:41 +0000 (17:28 +0300)]
Fix typo that caused spanned cells to be removed in Gridlayout (#14335)
Gridlayout removes columns and rows with no content. Gridlayout is
supposed to check for spanned cells and not remove otherwise empty rows
or columns if they are covered by a span.
TextArea size get reset when css resize is set (#14080)
Listen to MouseUp event on the <textarea> and notify the state with the width and height if changed.
Add com.vaadin.client.Util.Size to manipulates the css width/height.
Bottom component click scroll up the parent panel in a window (#12943)
Due to old fix for (#11994) the v-scrollable div of the window would
expand to 110% of its size then immediately back to the original size.
The first action, expanding the v-scrollable to 110% would decrease
the scrollTop value of our panel, while increasing its height. When
the revert back action would set the v-scrollable to its own size,
the panel's scrollTop would remain decreased, causing the scroll bar
to move up, hiding the ~10% at the bottom.
Fixed by calling Util.runWebkitOverflowAutoFix(); instead of changing
the height.
With this patch, the theme-and-default-widgetset target finishes in 50
seconds, whereas it takes about 80 seconds without the patch. This
happens at the cost of peak memory usage rising from ~750mb to ~850mb.
Fabian Lange [Fri, 11 Jul 2014 22:00:41 +0000 (00:00 +0200)]
Improves performance of VaadinService.requestEnd(). (#14218)
Doing two times session.accessSynchronously is unnecessary effort in
multiple aspects:
* The session will be locked twice.
* CurrentInstances are set twice.
* CurrentInstances are restored twice.
* VaadinSession being checked for being the current via
VaadinService.verifyNoOtherSessionLocked(this);
When we leave requestEnd we unset all CurrentInstances. There is no need
to just restore them before doing so.
When we are in requestEnd, VaadinSession is set to "current" by
PushHandler.callWithUi() or VaadinService.handleRequest().
Also, the cleanupSession code does not need any of these thread locals,
so not having them set would also not hurt.
having an extra accessSynchronously call for just setting the duration
does not make a lot of sense. While it somehow wants to make the previous
accessSynchronously call to be counted completely into the duration it
invests an the same time that would have been left out additionally.
VaadinService removeClosedUIs is a cleanup which also locks and sets
CurrentInstances just to figure out that the UI it is checking is not
closing. This change moves that check out of ui.accessSynchronously.
In the end, the resulting code is a tiny bit less robust, however it
eliminates over 50% response time on trivial push request/responses.
Fabian Lange [Sat, 12 Jul 2014 19:44:09 +0000 (21:44 +0200)]
Optimizes initial sizes of frequently used Collections. (#14223)
There are a few places in frequently used core classes which could
initialize collection classes with the correct (or slightly oversized)
length.
Maps are initialized with 2x the size due to its load factor.
Fabian Lange [Sat, 12 Jul 2014 19:09:32 +0000 (21:09 +0200)]
Optimize CurrentInstance.set(UI) and .set(VaadinSession). (#14220)
This change reduces the amount of intermediate steps taken to initialize
the thread locals for a given ui or vaadin session.
It mainly takes advantage of reusing the old values from the map in set()
instead of creating new ones to put into the "old" map which is returned.
Fabian Lange [Fri, 11 Jul 2014 21:43:03 +0000 (23:43 +0200)]
removes extra VaadinSession.setCurrent() from PushHandler. (#14222)
The setCurrent call on VaadinSession is not needed. the one extra call
can be saved because service.findVaadinSession will already set it.
Added a comment like it is done for UI (service.findUI will also set the
UI).
Fabian Lange [Wed, 9 Jul 2014 14:23:43 +0000 (16:23 +0200)]
Fix overwrite mechanism for web.xml atmosphere init params (#14196).
Non obvious problem before. "config" is a property of AtmosphereFramework
which also has getInitParameter(String) method. So it compiles but does
not do what is intended: to check against the user defined web.xml
servlet init-prams.
(the variableName servletConfig has the same problem :-))
Box and unbox long values in state fields (#14176)
We actually want to pass around the primitive long values emulated by
GWT even though JavaScript code can't do anything with the values.
Skipping the unboxing caused long fields to always be 0 since that's how
JavaScript converts an object into a number.
This patch also makes the test assert that the expected state values are
received and updates those values to actually make sense in some
situations.
Return a value on __gwtStatsEvent in Profiler (#11709)
Calling GWT RPC throw an exception when __gwtStatsEvent doesn't return
a boolean. This was in the Profiler.ensureNoLogger where the function
assigned was empty.
Henri Sara [Mon, 24 Mar 2014 14:32:20 +0000 (16:32 +0200)]
Fix tooltip test problems caused by #12458
Tooltips are no longer removed but moved outside the viewport,
which broke several tests.
Rewrite related tests using TB4 to be stable across all
browsers. There are differences between browsers (e.g.
position -999 or -1000, gwt-uid-* varied between browsers
etc.) so TB2 tests kept failing on some or all browsers.
Some tests have been renamed to better indicate what they
do.
Fabian Lange [Mon, 23 Jun 2014 13:15:47 +0000 (15:15 +0200)]
Reading properties of components should not set state to dirty (#14060).
Added Automatic Testcase. The testcase needs a default constructor,
which has been added.
The test also found an edge case in Form.java which has been corrected,
as well as one missing getState(false) in AbstractMedia.
Fabian Lange [Fri, 20 Jun 2014 08:49:50 +0000 (10:49 +0200)]
Reading properties of components should not set state to dirty (#14060).
Many core vaadin components did incorrectly mark the state as dirty when
reading from them. This patch fixes the problem, which should reduce the
amount of server->client state updates significantly.