+    var el = document.elementFromPoint(x,y);

- Which browsers do we support, older Safari and Opera browsers need pageX/Y instead of clientX/Y [1], this has changed recently [2]. - There is a special if-condition for Opera at [1] ("if (nodeType == 3)"), have you tested this? - I don't think this works for <drawview> in IE, because of excanvas resp. because of the inserted VML elements
- Have you tested scrolling?
- What if the application isn't placed at the top-left corner?


+            if (! (sprite instanceof LzSprite)) {
+                // TextField.parent is the LzTextSprite
+                // Bitmap.parent is the LzSprite
+                sprite = sprite.parent;
+            }
- Not sufficient, for example consider the hierarchy of runtime loaded images: LzSprite -> Loader -> Bitmap. In that case, sprite.parent is the Loader instead of the LzSprite.
- Have you tested (runtime loaded) AVM2 movieclips resources?
- Add tests with movieclips: AVM1 and AVM2, <resource> and runtime loaded

Bonus points:
- Convert test case to proper lzunit test case


[1] http://www.quirksmode.org/dom/w3c_cssom.html#documentview
[2] http://www.quirksmode.org/blog/archives/2010/06/more_ie9_goodne.html#link2


On 7/21/2010 9:56 PM, Max Carlson wrote:
Change 20100424-maxcarlson-D by maxcarl...@friendly on 2010-04-24 01:31:10 PDT
     in /Users/maxcarlson/openlaszlo/trunk-clean
     for http://svn.openlaszlo.org/openlaszlo/trunk

Summary:  Add API to find views by coordinate

New Features: canvas.viewFromPoint(x,y) returns the view found at a specified 
point.

Bugs Fixed: LPP-8935 -  Add API to find views by coordinate

Technical Reviewer: hminsky
QA Reviewer: ptw

Details: LzSprite - Add viewfrompoint capability, set to true.  Add 
viewfrompoint(x,y) API.

LaszloCanvas - Add viewFromPoint() API, warn if capabilities.viewfrompoint is 
false.

Tests: canvas.viewFromPoint(x,y) returns the topmost view found at a specified 
point.  See LPP-8935 for a test that runs in DHTML and swf10

Files:
M       WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
M       WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
M       WEB-INF/lps/lfc/views/LaszloCanvas.lzs

Changeset: 
http://svn.openlaszlo.org/openlaszlo/patches/20100424-maxcarlson-D.tar


Reply via email to