Author: ptw
Date: 2008-01-04 13:20:18 -0800 (Fri, 04 Jan 2008)
New Revision: 7731
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
openlaszlo/trunk/test/lztest/lztest-class-impl.lzx
Log:
Change 20080104-ptw-o by [EMAIL PROTECTED] on 2008-01-04 15:21:02 EST
in /Users/ptw/OpenLaszlo/ringding-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Make lztest work again
Bugs Fixed:
LPP-5317 'DHTML error w/ safari_avoid_clip_position_input_text when running in
Rhino'
Technical Reviewer: max (pending)
QA Reviewer: [EMAIL PROTECTED] (pending)
Details:
LzSprite: Jumbled indentation appears to have caused Max to include his code
in the wrong scope which caused the 'undefined' error.
lztest-class-impl: This was failing in the face of the recent
change to use JS2 class syntax, so I brought it up to date.
Tests:
ant runlztest
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2008-01-04
20:58:33 UTC (rev 7730)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2008-01-04
21:20:18 UTC (rev 7731)
@@ -1,3 +1,5 @@
+/* -*- mode: JavaScript; c-basic-offset: 4; -*- */
+
/**
* LzSprite.js
*
@@ -242,7 +244,7 @@
,advancedfonts: false
}
-LzSprite.prototype.__updateQuirks = function(){
+LzSprite.prototype.__updateQuirks = function () {
if (window['Lz'] && Lz.__BrowserDetect) {
Lz.__BrowserDetect.init();
var quirks = this.quirks;
@@ -319,31 +321,32 @@
quirks['canvas_div_cannot_be_clipped'] = true;
quirks['document_size_use_offsetheight'] = true;
} else if (Lz.__BrowserDetect.isFirefox && Lz.__BrowserDetect.version
< 2) {
- // see
http://groups.google.ca/group/netscape.public.mozilla.dom/browse_thread/thread/821271ca11a1bdbf/46c87b49c026246f?lnk=st&q=+focus+nsIAutoCompletePopup+selectedIndex&rnum=1
- quirks['firefox_autocomplete_bug'] = true;
- }
+ // see
http://groups.google.ca/group/netscape.public.mozilla.dom/browse_thread/thread/821271ca11a1bdbf/46c87b49c026246f?lnk=st&q=+focus+nsIAutoCompletePopup+selectedIndex&rnum=1
+ quirks['firefox_autocomplete_bug'] = true;
}
- if (quirks['safari_avoid_clip_position_input_text']) {
- LzSprite.prototype.__defaultStyles.lzswfinputtext.marginTop = '-2px';
- LzSprite.prototype.__defaultStyles.lzswfinputtext.marginLeft = '-2px';
- LzSprite.prototype.__defaultStyles.lzswfinputtextmultiline.marginTop =
'-2px';
- LzSprite.prototype.__defaultStyles.lzswfinputtextmultiline.marginLeft
= '-2px';
- }
+ if (quirks['safari_avoid_clip_position_input_text']) {
+ LzSprite.prototype.__defaultStyles.lzswfinputtext.marginTop =
'-2px';
+ LzSprite.prototype.__defaultStyles.lzswfinputtext.marginLeft =
'-2px';
+
LzSprite.prototype.__defaultStyles.lzswfinputtextmultiline.marginTop = '-2px';
+
LzSprite.prototype.__defaultStyles.lzswfinputtextmultiline.marginLeft = '-2px';
+ }
- if (quirks['css_hide_canvas_during_init']) {
- if (quirks['safari_visibility_instead_of_display']) {
- LzSprite.prototype.__defaultStyles.lzcanvasdiv.visibility =
'hidden';
- } else {
- LzSprite.prototype.__defaultStyles.lzcanvasdiv.display = 'none';
+ if (quirks['css_hide_canvas_during_init']) {
+ if (quirks['safari_visibility_instead_of_display']) {
+ LzSprite.prototype.__defaultStyles.lzcanvasdiv.visibility =
'hidden';
+ } else {
+ LzSprite.prototype.__defaultStyles.lzcanvasdiv.display =
'none';
+ }
+ LzSprite.prototype.__defaultStyles.lzcanvasclickdiv.display =
'none';
}
- LzSprite.prototype.__defaultStyles.lzcanvasclickdiv.display = 'none';
+
+ if (quirks['hand_pointer_for_clickable']) {
+ LzSprite.prototype.__defaultStyles.lzclickdiv.cursor = 'pointer';
+ }
}
+};
- if (quirks['hand_pointer_for_clickable']) {
- LzSprite.prototype.__defaultStyles.lzclickdiv.cursor = 'pointer';
- }
-}
LzSprite.prototype.__updateQuirks();
LzSprite.prototype.__defaultStyles.writeCSS();
Modified: openlaszlo/trunk/test/lztest/lztest-class-impl.lzx
===================================================================
--- openlaszlo/trunk/test/lztest/lztest-class-impl.lzx 2008-01-04 20:58:33 UTC
(rev 7730)
+++ openlaszlo/trunk/test/lztest/lztest-class-impl.lzx 2008-01-04 21:20:18 UTC
(rev 7731)
@@ -6,22 +6,50 @@
-->
<script when="immediate"><![CDATA[
+ // Test basic classes
+ class LzSub {
+ var testAttr;
+ var accum;
-// Test mixin overrides and super calls.
+ function LzSub () {
+ super();
+ this.testAttr = true;
+ this.accum = "";
+ };
+
+ function testMethod (a) {
+ this.accum += a;
+ }
+ }
+
+ class LzSubSub extends LzSub {
+ function LzSubSub () {
+ super();
+ };
+
+ function testMethod (a) {
+ super.testMethod(a);
+ }
+ }
+
+ // Test subclassing node
+ class LzNodeSub extends LzNode {};
+
+ // Test mixin overrides and super calls.
class Vanilla {
var initorder = "";
- function initialize() {
- super.initialize.apply(this, arguments);
+ function Vanilla () {
+ super();
this.initorder += "/vanilla";
}
- function test() {
+ function test () {
return 'vanilla';
}
}
trait Banana {
- function initialize() {
- super.initialize.apply(this, arguments);
+ function Banana () {
+ super();
this.initorder += "/banana";
}
function test() {
@@ -29,9 +57,9 @@
}
}
- class Sundae extends Vanilla inherits Banana {
- function initialize() {
- super.initialize.apply(this, arguments);
+ class Sundae extends Vanilla with Banana {
+ function Sundae () {
+ super();
this.initorder += "/sundae"
}
function test() {
@@ -46,19 +74,13 @@
var suiteSubclasses = new LzTestSuite("Subclasses");
-
suiteSubclasses.testSub = function() {
- var LzSub = Class.make( "LzSub", null,
- ['initialize', function (){this.testAttr = true;
this.accum = ""; }] );
+ // We can't easily support this in swf9, do we need to?
+ LzSub.addProperty('testAttr2', "foo");
- LzSub.addProperty('testAttr2', "foo");
- LzSub.addProperty('testMethod', function (a) { this.accum = this.accum +
a; });
-
LzTestManager.assertEquals("LzSub", LzSub.classname);
-
-
var subInst = new LzSub();
LzTestManager.assertTrue( subInst instanceof LzSub );
@@ -71,17 +93,8 @@
subInst.testMethod("baz");
LzTestManager.assertEquals( "barbaz", subInst.accum );
-
- var LzSubSub = Class.make( "LzSubSub", LzSub,
- ['initialize', function () {
- super.initialize();
- }] );
- LzSubSub.addProperty('testMethod', function (a) {
- #pragma "methodName=testMethod"
- super.testMethod(a); });
+ LzTestManager.assertEquals("LzSubSub", LzSubSub.classname);
- LzTestManager.assertEquals("LzSubSub", LzSubSub.classname);
-
var sub2Inst = new LzSubSub();
LzTestManager.assertTrue( sub2Inst instanceof LzSub);
@@ -100,12 +113,10 @@
}
suiteSubclasses.testClassNodeSub = function () {
- var LzNodeSub = Class.make( "LzNodeSub", LzNode );
LzTestManager.assertEquals("LzNodeSub", LzNodeSub.classname);
var nodeSubInst = new LzNodeSub();
LzTestManager.assertTrue( nodeSubInst instanceof LzNodeSub );
-
}
suiteSubclasses.testUserClass = function () {
@@ -174,7 +185,7 @@
</canvas>
<!--
/* X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2006-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2006-2008 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ******************************************************/
-->
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins