Last Comment Bug 727942 - Windows app can't read Firefox setting for "zoom level"
: Windows app can't read Firefox setting for "zoom level"
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Disability Access APIs (show other bugs)
: unspecified
: x86_64 Windows 7
: -- normal (vote)
: mozilla19
Assigned To: alexander :surkov
:
Mentors:
Depends on: 650241
Blocks: 659589
  Show dependency treegraph
 
Reported: 2012-02-16 11:50 PST by Jost Eckhardt, Ai Squared
Modified: 2012-10-22 19:07 PDT (History)
7 users (show)
ryanvm: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch1:getChildAt v1 (7.70 KB, patch)
2012-02-22 09:54 PST, alexander :surkov
mzehe: review+
Details | Diff | Review
part2:imagemap bounds (9.57 KB, patch)
2012-03-23 04:06 PDT, alexander :surkov
mzehe: review+
Details | Diff | Review
part3:XULtree_childAtPoint (14.30 KB, patch)
2012-03-23 09:15 PDT, alexander :surkov
mzehe: review+
Details | Diff | Review
part3:XULtree childAtPoint:v2 (19.30 KB, patch)
2012-03-23 11:14 PDT, alexander :surkov
mzehe: review+
Details | Diff | Review
part4: scrollToPoint and origin conversions (14.89 KB, patch)
2012-10-13 08:55 PDT, alexander :surkov
tbsaunde+mozbugs: review+
roc: feedback+
Details | Diff | Review
part5: ISimpleDOMText::GetCharacterExtents (2.43 KB, patch)
2012-10-13 09:16 PDT, alexander :surkov
tbsaunde+mozbugs: review+
roc: feedback+
Details | Diff | Review
part6: getOffsetAtPoint (6.61 KB, patch)
2012-10-14 23:05 PDT, alexander :surkov
tbsaunde+mozbugs: review+
Details | Diff | Review
part7: getRangeExtents (7.11 KB, patch)
2012-10-15 03:49 PDT, alexander :surkov
tbsaunde+mozbugs: review+
Details | Diff | Review
part8: scrollSubstringToPoint (11.39 KB, patch)
2012-10-15 08:57 PDT, alexander :surkov
tbsaunde+mozbugs: review+
Details | Diff | Review

Description Jost Eckhardt, Ai Squared 2012-02-16 11:50:14 PST
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0
Build ID: 20120208012847

Steps to reproduce:

I'm trying to determine from a Windows app what the zoom level in Firefox is



Actual results:

I can't find documentation about an available interface


Expected results:

I need an interface to read the current "zoom level" setting
Comment 1 David Bolter [:davidb] 2012-02-16 11:58:06 PST
Filing this in accessibility for initial triage.
Comment 2 Jost Eckhardt, Ai Squared 2012-02-16 12:21:59 PST
Actually what I need is to translate between coordinates given by IAccessible2 and coordinates rendered by Firefox.

With the IE DOM you can use IHTMLScreen2 and then calculate the offset using logical and device dpi.
Comment 3 James Teh [:Jamie] 2012-02-16 16:28:45 PST
(In reply to Jost Eckhardt, Ai Squared from comment #2)
> Actually what I need is to translate between coordinates given by
> IAccessible2 and coordinates rendered by Firefox.
Imo, the coordinates returned from accessibility APIs should always reflect the on-screen rendering. That is, when zoom level changes, the coordinates should change too. This is covered by bug 650241.
Comment 4 alexander :surkov 2012-02-16 20:25:09 PST
(In reply to James Teh [:Jamie] from comment #3)
> (In reply to Jost Eckhardt, Ai Squared from comment #2)
> > Actually what I need is to translate between coordinates given by
> > IAccessible2 and coordinates rendered by Firefox.
> Imo, the coordinates returned from accessibility APIs should always reflect
> the on-screen rendering. That is, when zoom level changes, the coordinates
> should change too. This is covered by bug 650241.

Jost, does it cover your problem?
Comment 5 Jost Eckhardt, Ai Squared 2012-02-17 05:13:27 PST
yes 650241 covers it. Please consider all MSAA and IA2 interfaces, in and out coordinates.
Comment 6 alexander :surkov 2012-02-22 06:28:45 PST
(In reply to Jost Eckhardt, Ai Squared from comment #5)
> yes 650241 covers it. Please consider all MSAA and IA2 interfaces, in and
> out coordinates.

right, I see that we have other issues
Comment 7 alexander :surkov 2012-02-22 09:54:58 PST
Created attachment 599667 [details] [diff] [review]
patch1:getChildAt v1
Comment 8 alexander :surkov 2012-02-22 19:42:56 PST
patch1: getChildAt https://hg.mozilla.org/integration/mozilla-inbound/rev/796d3b448a94
Comment 9 Ed Morley [:emorley] 2012-02-23 13:08:56 PST
https://hg.mozilla.org/mozilla-central/rev/796d3b448a94
Comment 10 alexander :surkov 2012-03-23 04:06:53 PDT
Created attachment 608656 [details] [diff] [review]
part2:imagemap bounds
Comment 11 Marco Zehe (:MarcoZ) 2012-03-23 04:40:46 PDT
Comment on attachment 608656 [details] [diff] [review]
part2:imagemap bounds

r=me. Thanks for the cleanup and the better use of the APIs available!
Comment 12 alexander :surkov 2012-03-23 09:15:19 PDT
Created attachment 608731 [details] [diff] [review]
part3:XULtree_childAtPoint
Comment 13 Marco Zehe (:MarcoZ) 2012-03-23 09:31:48 PDT
Comment on attachment 608731 [details] [diff] [review]
part3:XULtree_childAtPoint

r=me.
Comment 14 alexander :surkov 2012-03-23 10:09:11 PDT
(In reply to alexander :surkov from comment #10)
> Created attachment 608656 [details] [diff] [review]
> part2:imagemap bounds

https://hg.mozilla.org/integration/mozilla-inbound/rev/a5f39c72791d
Comment 15 alexander :surkov 2012-03-23 11:14:09 PDT
Created attachment 608785 [details] [diff] [review]
part3:XULtree childAtPoint:v2
Comment 16 Ed Morley [:emorley] 2012-03-24 14:04:21 PDT
(In reply to alexander :surkov from comment #14)
> (In reply to alexander :surkov from comment #10)
> > Created attachment 608656 [details] [diff] [review]
> > part2:imagemap bounds
> 
> https://hg.mozilla.org/integration/mozilla-inbound/rev/a5f39c72791d

https://hg.mozilla.org/mozilla-central/rev/a5f39c72791d
Comment 17 Marco Zehe (:MarcoZ) 2012-03-26 00:50:17 PDT
Comment on attachment 608785 [details] [diff] [review]
part3:XULtree childAtPoint:v2

r=me
Comment 18 alexander :surkov 2012-03-26 05:21:35 PDT
(In reply to alexander :surkov from comment #15)
> Created attachment 608785 [details] [diff] [review]
> part3:XULtree childAtPoint:v2

https://hg.mozilla.org/integration/mozilla-inbound/rev/5a0fa83685d7
Comment 19 Matt Brubeck (:mbrubeck) 2012-03-26 11:31:17 PDT
https://hg.mozilla.org/mozilla-central/rev/5a0fa83685d7
Comment 20 alexander :surkov 2012-10-13 08:55:22 PDT
Created attachment 671099 [details] [diff] [review]
part4: scrollToPoint and origin conversions
Comment 21 alexander :surkov 2012-10-13 09:16:02 PDT
Created attachment 671105 [details] [diff] [review]
part5: ISimpleDOMText::GetCharacterExtents
Comment 22 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2012-10-14 14:57:07 PDT
Comment on attachment 671099 [details] [diff] [review]
part4: scrollToPoint and origin conversions

Review of attachment 671099 [details] [diff] [review]:
-----------------------------------------------------------------

Looks OK, but do you care about Mac in HiDPI mode? On Mac in HiDPI mode, apps tend to use not device pixels but "Cocoa points", which in HiDPI mode are 2 device pixels each.
Comment 23 alexander :surkov 2012-10-14 23:05:45 PDT
Created attachment 671322 [details] [diff] [review]
part6: getOffsetAtPoint
Comment 24 alexander :surkov 2012-10-15 00:51:26 PDT
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #22)

> Looks OK, but do you care about Mac in HiDPI mode? On Mac in HiDPI mode,
> apps tend to use not device pixels but "Cocoa points", which in HiDPI mode
> are 2 device pixels each.

I don't know, maybe Hub knows. Are there any conversion function to use or should I just multiply at 2 (in case if need it)?
Comment 25 alexander :surkov 2012-10-15 03:49:36 PDT
Created attachment 671379 [details] [diff] [review]
part7: getRangeExtents
Comment 26 alexander :surkov 2012-10-15 08:57:43 PDT
Created attachment 671461 [details] [diff] [review]
part8: scrollSubstringToPoint
Comment 27 Trevor Saunders (:tbsaunde) 2012-10-18 12:19:39 PDT
Comment on attachment 671099 [details] [diff] [review]
part4: scrollToPoint and origin conversions

>+      // scrollToPoint relative screen
>+      var anchor = getAccessible("bottom1");
>+      var [x, y] = getPos(anchor);
>+      var [docX, docY] = getPos(document);
>+
>+      anchor.scrollToPoint(COORDTYPE_SCREEN_RELATIVE, docX, docY);
>+      testPos(anchor, [x, docY]);

I'm not  sure I completely understand why this is [x, docY] not docX, docY

I don't think I'm a particularly good person to review this stuff, but it seems fine, so r=me assuming the tests are all happy with you
Comment 28 Trevor Saunders (:tbsaunde) 2012-10-18 12:46:41 PDT
Comment on attachment 671322 [details] [diff] [review]
part6: getOffsetAtPoint

is the scrolling in part 4, and the zoom() you use in a bunch of these test really sync?  If not we need to add stuff to make sure the test waits until the action is complete before running.

Otherwise this seems fine.
Comment 29 Trevor Saunders (:tbsaunde) 2012-10-18 13:24:15 PDT
Comment on attachment 671379 [details] [diff] [review]
part7: getRangeExtents

I think this patch depends on a file you add in the next patch unless it just got lost completely, so please fold these patches together when you land so we don't have a commit in the tree that doesn't build
Comment 30 alexander :surkov 2012-10-18 21:41:55 PDT
(In reply to Trevor Saunders (:tbsaunde) from comment #27)
> Comment on attachment 671099 [details] [diff] [review]
> part4: scrollToPoint and origin conversions
> 
> >+      // scrollToPoint relative screen
> >+      var anchor = getAccessible("bottom1");
> >+      var [x, y] = getPos(anchor);
> >+      var [docX, docY] = getPos(document);
> >+
> >+      anchor.scrollToPoint(COORDTYPE_SCREEN_RELATIVE, docX, docY);
> >+      testPos(anchor, [x, docY]);
> 
> I'm not  sure I completely understand why this is [x, docY] not docX, docY

there's no horizontal scrollbar so scrolling doesn't happen in horizontal direction and thus x isn't changed
Comment 31 alexander :surkov 2012-10-18 21:58:57 PDT
(In reply to Trevor Saunders (:tbsaunde) from comment #28)
> Comment on attachment 671322 [details] [diff] [review]
> part6: getOffsetAtPoint
> 
> is the scrolling in part 4, and the zoom() you use in a bunch of these test
> really sync?  If not we need to add stuff to make sure the test waits until
> the action is complete before running.

yes, they seems to be sync
Comment 32 alexander :surkov 2012-10-18 22:00:09 PDT
(In reply to Trevor Saunders (:tbsaunde) from comment #29)
> Comment on attachment 671379 [details] [diff] [review]
> part7: getRangeExtents
> 
> I think this patch depends on a file you add in the next patch unless it
> just got lost completely, so please fold these patches together when you
> land so we don't have a commit in the tree that doesn't build

I forgot to hg add on new test file
Comment 33 alexander :surkov 2012-10-19 08:08:18 PDT
Comment on attachment 671099 [details] [diff] [review]
part4: scrollToPoint and origin conversions

http://hg.mozilla.org/integration/mozilla-inbound/rev/9394d94ea2b9
Comment 34 alexander :surkov 2012-10-19 18:54:08 PDT
Comment on attachment 671105 [details] [diff] [review]
part5: ISimpleDOMText::GetCharacterExtents

https://hg.mozilla.org/integration/mozilla-inbound/rev/cb0b143de3ae
Comment 35 Ryan VanderMeulen [:RyanVM] 2012-10-19 19:07:30 PDT
https://hg.mozilla.org/mozilla-central/rev/9394d94ea2b9
Comment 36 alexander :surkov 2012-10-20 02:00:56 PDT
Comment on attachment 671322 [details] [diff] [review]
part6: getOffsetAtPoint

https://hg.mozilla.org/integration/mozilla-inbound/rev/a48b0c4084ba
Comment 37 alexander :surkov 2012-10-20 04:01:33 PDT
Comment on attachment 671379 [details] [diff] [review]
part7: getRangeExtents

https://hg.mozilla.org/integration/mozilla-inbound/rev/0cdf460897ea
Comment 39 alexander :surkov 2012-10-20 18:35:43 PDT
Comment on attachment 671461 [details] [diff] [review]
part8: scrollSubstringToPoint

http://hg.mozilla.org/integration/mozilla-inbound/rev/6a24636cd4a2
Comment 40 Ryan VanderMeulen [:RyanVM] 2012-10-22 19:07:59 PDT
https://hg.mozilla.org/mozilla-central/rev/6a24636cd4a2

Note You need to log in before you can comment on or make changes to this bug.