|
|
|
Simple testcase:
[code] <canvas debug="true" > <edittext text="Click Me!" /> <button x="100" text="clear focus" onclick="LzFocus.clearFocus()" /> <handler name="onfocus" args="v" reference="LzFocus" > Debug.write("focus-view=%w", v); </handler> </canvas> [/code] In 4.0.3 and 3.3.3 setTarget method is different. There is no enable() and disable() calls.
I did not test the code, but I believe it fixes the problem Which version is this code integrated to? "Which version is this code integrated to?"
> This is just a proposal how to fix this issue, so until now, it isn't integrated in any version. I have just tested on 4.0.3 and confirm that it fixes the issue.
Actually the whole tracking for width/height was broken in basefocusview.
As I neither can svn-review the patch to the svn (authorization failed - warning) nor change this task in any manner (no permission granted), I'll just upload the patch. Testcase to show broken tracking:
Steps to reproduce: 1. click on the left button 2. wait a sec -> the left button will resize itself 3. now press tab to focus the right button 4. you can see that the "focusoverlay" still has got the old bounds of the left button, which is wrong, it should have resized itself to the new bounds [code] <canvas debug="true" > <button text="foobar" > <handler name="onfocus" > LzTimer.addTimer(new LzDelegate(this, "changeBounds"), 1000); </handler> <method name="changeBounds" > this.setWidth(200); this.setHeight(400); </method> </button> <button x="300" text="blah" /> </canvas> [/code] I suspected this. That's why I've asked a question if width/height should be handled in a similar way as x/y.
It looks like the answer is yes. So here is code that does that and it fixes both test cases: [code] <method name="setTarget" args="newtarget"> <![CDATA[ this.target = newtarget; if ( !this._xydelegate ) { this._xydelegate = new LzDelegate(this, "followXY"); } else { this._xydelegate.unregisterAll(); } if ( !this._widthdel ) { this._widthdel = new LzDelegate(this, "followWidth"); } else { this._widthdel.unregisterAll(); } if ( !this._heightdel ) { this._heightdel = new LzDelegate(this, "followHeight"); } else { this._heightdel.unregisterAll(); } if ( this.target == null ) return; // make sure that this focusoverlay is aware // when the target or any of its parents move. var p = newtarget; var i = 0; while ( p != canvas ) { this._xydelegate.register(p, 'onx'); this._xydelegate.register(p, 'ony'); this._widthdel.register(p, 'onwidth'); this._heightdel.register(p, 'onheight'); p = p.immediateparent; i++; } followXY(); followWidth(); followHeight(); ]]> </method> [/code] Sorry, I did not noticed your patch that does almost the same.
One question: why do you register width/height for newtarget only, but xy delegate is registered to each of its parents? Forget it. I have found answer on my question.
Your fix is correct. Sorry for so much noise. Regards, Dmitry r6270 | bargull | 2007-08-28 23:36:15 +0200 (Tue, 28 Aug 2007) | 28 lines
Ge?\195?\164nderte Pfade: M /openlaszlo/branches/wafflecone/lps/components/base/basefocusview.lzx Change 20070825-bargull-6 by bargull@dell--p4--2-53 on 2007-08-25 16:48:55 in /home/Admin/src/svn/openlaszlo/branches/wafflecone for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone Summary: Fixed tracking in basefocusview New Features: Bugs Fixed: Technical Reviewer: max QA Reviewer: ben Doc Reviewer: (pending) Documentation: The whole width/height tracking was broken for basefocusview, this is now fixed. Release Notes: Details: Tests: Two testcases can be found at the bugreport ( This first group of notes is for text lpp-4553. In this group of notes, please see that both Macintosh DHTML compilations failed. The windows compilations returned errors and/or warnings, but ran and seemed to produce expected results.
DHTML FF W XP SP2 , compiled and returned this warning: ERROR@http://localhost:8080/405/lps/includes/embed-compressed.js#943: dojo.flash.comm has no properties Notes: Got expected behavior ----- DHTML IE7 XP SP2, compiled and returned this warning: DEBUG: Source warnings enabledWARNING: testing:0: Test source warning Notes: Got expected behavior ----- DHTML Safari 2.0.4 OS X 10.4.10, never completed compilation as far as I could tell. I was stuck at the window that says "Powered by OpenLaszlo." for over 6 minutes by my watch. ----- DHTML FF 2.0.0.7 OS X 10.4.10, compiled and returned Warnings or Errors: DEBUG: Source warnings enabledWARNING: testing:0: Test source warning ERROR @http://localhost:8080/405/lps/includes/embed-compressed.js#943: dojo.flash.comm has no properties Notes: Left button expands, but there is no focus indicator generated on the screen. Test FAILED. This next group of notes is for test lpp-4553a. DHTML FF W XP SP2, compiled and returned Warnings or Errors: DEBUG: Source warnings enabledWARNING: testing:0: Test source warning ERROR @http://localhost:8080/405/lps/includes/embed-compressed.js#943: dojo.flash.comm has no properties Notes: Text in field is top aligned as opposed to center aligned in other tests. Other than that, I got expected behavior. ----- DHTML IE7 XP SP2, compiled and returned Warnings or Errors: DEBUG: Source warnings enabledWARNING: testing:0: Test source warning Notes: Text in field is top aligned as opposed to center aligned in other tests. Once I click on the text field the first time and it writes to the debug window, no later clicks are registered by the field. All later clicks to the button DO register and write to the debug window. ----- DHTML Safari 2.0.4 OS X 10.4.10, App never completes compiling. I am stuck at the window that says "Powered by OpenLaszlo." 6 minutes and counting. ----- DHTML FF 2.0.0.7 OS X 10.4.10, compiled with these warnings and errors: DEBUG: Source warnings enabledWARNING: testing:0: Test source warning ERROR @http://localhost:8080/405/lps/includes/embed-compressed.js#943: dojo.flash.comm has no properties Notes: Text in field is top aligned as opposed to center aligned in other tests. Other than that, I got expected behavior. I haven't got a Mac, so I cannot reproduce any issues under this environment, but as far as I can tell by looking at my submitted patch, compilation shouldn't be influenced in any manner.
Regarding "lpp-4553" - "DHTML FF 2.0.0.7 OS X 10.4.10": Can you make sure tabbing does change focus by inserting the following handler, because I needed to press two times "tab" to change focus in DHTML Firefox2 XP (DHTML IE6 XP needed only one "tab"-press!). The handler will print a status message every time focus changes. [code] <handler name="onfocus" args="v" reference="LzFocus" > Debug.write("focus-view=%w", v); </handler> [/code] So when focus changes, the focus-rect should appear on screen. (Should we file a bug for the denoted focus problem in Firefox2?) Regarding "lpp-4553a" - "DHTML IE7 XP SP2": The handler-code prints a status message when focus changes, so pressing multiple times in a row on the editfield won't print every time a message. Clicking on the editfield, then on the button and finally a last time on the editfield, should give the following output: [debug] focus-view=.field focus-view=«lz.button» focus-view=null focus-view=.field [/debug] This works for me in DHTML Firefox2, IE6 and Opera9. If this does not work in IE7, it could an indicator that focusing is partially broken for IE7 (at least for LzInputtext). Steve, please verify and if it is necessary, file a bug. Steve, any news for me concerning my last comment?
debug now works in Safari.. Didn't test swf8 again...
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(If LPP-4390 was implemented, we could simply call "LzDelegate#register(..)" without reviving
LPP-2895.)"basefocusview#setTarget(..)":
[code]
<!--- @keywords private -->
<method name="setTarget" args="newtarget"> <![CDATA[
this.target = newtarget;
if ( !this._xydelegate ) {
this._xydelegate = new LzDelegate(this, "followXY");
} else {
this._xydelegate.unregisterAll();
}
if (this.target == null) {
if (this._heightdel) {
this._heightdel.disable();
}
if (this._widthdel) {
this._widthdel.disable();
}
return;
}
// make sure that this focusoverlay is aware
// when the target or any of its parents move.
var p = newtarget;
var i = 0;
while ( p != canvas ) {
this._xydelegate.register(p, 'onx');
this._xydelegate.register(p, 'ony');
p = p.immediateparent;
i++;
}
if ( !this._widthdel ) {
this._widthdel = new LzDelegate(this, "followWidth", canvas,'onwidth');
} else {
this._widthdel.enable();
}
if ( !this._heightdel ) {
this._heightdel = new LzDelegate(this, "followHeight", canvas,'onheight');
} else {
this._heightdel.enable();
}
followXY();
followWidth();
followHeight();
]]> </method>
[/code]