Author: max
Date: 2008-01-03 18:35:13 -0800 (Thu, 03 Jan 2008)
New Revision: 7722
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzScreenKernel.js
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
Log:
Change 20080101-maxcarlson-f by [EMAIL PROTECTED] on 2008-01-01 23:31:02 PST
in /Users/maxcarlson/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: UPDATED: Fix resizing in Safari
New Features:
Bugs Fixed: LPP-5309 - Window Resize with Safari
Technical Reviewer: ptw
QA Reviewer: promanik
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: LzSprite.js - Add document_size_use_offsetheight and set to true in
Safari and Opera.
LzScreenKernel.js - Use offsetWidth/Height if document_size_use_offsetheight is
true. Clean up tests to use sc.
Tests: See LPP-5309. Tested in Firefox, Opera and Safari 3 on OS X and Safari,
IE 6 and 7 in windoze.
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzScreenKernel.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzScreenKernel.js
2008-01-04 02:32:28 UTC (rev 7721)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzScreenKernel.js
2008-01-04 02:35:13 UTC (rev 7722)
@@ -1,7 +1,7 @@
/**
* LzScreenKernel.js
*
- * @copyright Copyright 2007 Laszlo Systems, Inc. All Rights Reserved.
+ * @copyright Copyright 2007-2008 Laszlo Systems, Inc. All Rights Reserved.
* Use is subject to license terms.
*
* @topic Kernel
@@ -16,21 +16,25 @@
,__resizeEvent: function() {
// thanks quirksmode!
http://www.quirksmode.org/viewport/compatibility.html
- if (window.top.innerHeight) {
+ var sc = window.top.document.body;
+ if (LzSprite.prototype.quirks.document_size_use_offsetheight) {
+ sc = window.document.body;
+ LzScreenKernel.width = sc.offsetWidth;
+ LzScreenKernel.height = sc.offsetHeight;
+ } else if (window.top.innerHeight) {
// all except Explorer
- var sc = window.top.document.body;
- LzScreenKernel.width = sc.scrollWidth;
- LzScreenKernel.height = sc.scrollHeight;
+ sc = window;
+ LzScreenKernel.width = sc.innerWidth;
+ LzScreenKernel.height = sc.innerHeight;
} else if (window.top.document.documentElement &&
window.top.document.documentElement.clientHeight) {
// Explorer 6 Strict Mode
- var sc = window.top.document.documentElement;
+ sc = window.top.document.documentElement;
LzScreenKernel.width = sc.clientWidth;
LzScreenKernel.height = sc.clientHeight;
- } else if (window.top.document.body) {
+ } else if (sc) {
// other Explorers
- var sc = window.top.document.body;
- LzScreenKernel.width = window.top.document.body.clientWidth;
- LzScreenKernel.height = window.top.document.body.clientHeight;
+ LzScreenKernel.width = sc.clientWidth;
+ LzScreenKernel.height = sc.clientHeight;
}
/*
@@ -51,7 +55,7 @@
//Debug.write('LzScreenKernel event', {width: LzScreenKernel.width,
height: LzScreenKernel.height});
}
,__init: function() {
- Lz.attachEventHandler(window, 'resize', LzScreenKernel,
'__resizeEvent');
+ Lz.attachEventHandler(window.top, 'resize', LzScreenKernel,
'__resizeEvent');
}
,__callback: null
,__scope: null
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2008-01-04
02:32:28 UTC (rev 7721)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js 2008-01-04
02:35:13 UTC (rev 7722)
@@ -1,7 +1,7 @@
/**
* LzSprite.js
*
- * @copyright Copyright 2007 Laszlo Systems, Inc. All Rights Reserved.
+ * @copyright Copyright 2007-2008 Laszlo Systems, Inc. All Rights Reserved.
* Use is subject to license terms.
*
* @topic Kernel
@@ -226,6 +226,7 @@
,ie_opacity: false
,text_measurement_use_insertadjacenthtml: false
,text_selection_use_range: false
+ ,document_size_use_offsetheight: false
}
LzSprite.prototype.capabilities = {
@@ -306,6 +307,7 @@
quirks['safari_visibility_instead_of_display'] = true;
quirks['absolute_position_accounts_for_offset'] = true;
quirks['canvas_div_cannot_be_clipped'] = true;
+ quirks['document_size_use_offsetheight'] = true;
if (Lz.__BrowserDetect.version > 523.10) {
this.capabilities['rotation'] = true;
}
@@ -315,6 +317,7 @@
quirks['no_cursor_colresize'] = true;
quirks['absolute_position_accounts_for_offset'] = true;
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;
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins