| Summary: | Text with border and size (1,1) crashes IE | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Matthias Kempka <mkempka> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P2 | CC: | tbuschto |
| Version: | 1.4 | ||
| Target Milestone: | 2.0 M3 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | sr152 | ||
|
Description
Matthias Kempka
Since [1,1] would be a valid size at least from a client p.o.v., it should not crash. We whould check this is the case for 1.5.1 and 2.0M2. This bug might have been fixed for 2.0M1 with Bug 386815 - [Text] JavaScript test failes in Chrome 21. In that case we only need to backport this to 1.5.2. I did some investigation, and it seems this error occours on different RAP versions for different reasons.
First of all, i did all tests in IE9(32bit) in IE8-Quirksmode. To make things simple, i hacked Text#computeSize to always return 1,1. Not sure how to make this happen without this hack, but obviously its possible.
In RAP 1.4 the problem is in TextField.js, specifically the line:
this._inputElement.style.height = (this.getInnerHeight() - 2) + "px";
For some reason this only crashes on "MULTI" Text fields. The height does not seem to have the same problem, at least not with a 1x1 pixel widget.
In RAP 1.5/2.0M2 the line (now in BasicText.js) has been fixed already:
this._inputElement.style.height = Math.max( 0, this.getInnerHeight() - 2 ) + "px";
However, if the message text of Text has been set, the client still crashes. The problematic code is in Text.js:
style.width = ( this.getBoxWidth()
- this._cachedBorderLeft
- this._cachedBorderRight
- styleMap.paddingLeft
- styleMap.paddingRight ) + "px";
Fixed with commit 0e6b1e4b2aa00c99d30cc29424ac1d02aa011522. +1 to backport this fix to 1.5.2 Backported to 1.5-maintenance branch with commit 154c353ea82b7b9dd8899c2f14a9ceaaea176107. |