Compare commits

..

911 Commits

Author SHA1 Message Date
sspitzer%netscape.com
1931567100 when doing new card or new list, and a list is selected, we need to reflight
the pickers with the directory that contains the list.
also, remove the xul changes that are for sorting the items in the pickers.
this is not ready for primetime yet, we'll leave them in the same order
as the directory pane.


git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@110103 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-09 00:57:47 +00:00
sspitzer%netscape.com
267763bb9c fix the problem where your screen name doesn't get saved when creating a new card.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@110101 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-08 23:34:26 +00:00
sspitzer%netscape.com
220fb6fcdd comments. show remote directory icon in the directory pane
when directory is remote (like LDAP).


git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@110086 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-08 17:57:48 +00:00
sspitzer%netscape.com
86e6e30916 clear card pane if selecting a directory with no cards,
compose not working if you select a directory with now cards
I thought this was a problem with nsOutlinerSelection,
but it was really a problem with my js,
selecting the first card even when there wasn't one.


git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@110027 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-07 21:31:58 +00:00
sspitzer%netscape.com
c72a86432b code cleanup. show "remote directory" icon in directory pane
if the directory is remote (like LDAP).


git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@110024 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-07 20:56:13 +00:00
sspitzer%netscape.com
4c2b7fbff2 fix it so that when you drop from directory 1 to mailing list A on directory 2
we first copy the card to directory 2 (and copy all the fields)
and then add the card to mailing list A.


git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@110019 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-07 19:52:28 +00:00
sspitzer%netscape.com
9618cdcea5 remove dumps.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109989 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-07 08:44:02 +00:00
sspitzer%netscape.com
4112b19b7a more dnd work. get the "edit" button working again in the select address dialog.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109988 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-07 08:24:26 +00:00
sspitzer%netscape.com
5b0260db11 more work. don't copy card
when drop card from one mailing list
on directory x to another mailing list on the same
directory.


git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109976 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-07 05:29:12 +00:00
sspitzer%netscape.com
3c0c87dc0b more changes for dnd.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109969 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-07 04:40:26 +00:00
sspitzer%netscape.com
9955d67702 more changes for ab card dnd.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109939 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-07 01:39:51 +00:00
sspitzer%netscape.com
4796fb81fd make so when you delete cards, they are properly removed
from the mailing lists that contain them.


git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109905 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-07 00:09:52 +00:00
sspitzer%netscape.com
fa8444419e fixes to allow dnd onto mailing lists to work.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109900 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-06 23:52:28 +00:00
sspitzer%netscape.com
d3cb277b96 switch to com ptrs.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109863 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-06 21:21:49 +00:00
sspitzer%netscape.com
1b43aa13e0 fixes for mailing lists problems.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109856 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-06 20:50:49 +00:00
sspitzer%netscape.com
1fdce2cb0b add comments.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109827 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-06 10:24:57 +00:00
sspitzer%netscape.com
5837f7e301 more dnd work.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109824 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-06 08:31:00 +00:00
sspitzer%netscape.com
d097e8742e some clean up, moving common code to abCommon.js
some work for dnd, and some work to properly center dialogs.


git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109822 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-06 06:59:08 +00:00
sspitzer%netscape.com
345f20ff29 make it so both edit and new mail list gets centered.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109779 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-06 00:59:14 +00:00
sspitzer%netscape.com
d2459f65ff changes to get moveToAlertPosition() to work, change for overlaying Sort By | ScreenName
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109754 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-05 21:22:30 +00:00
sspitzer%netscape.com
3dc0a99e0d some fixes, for some dnd / delete weirdness.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109700 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-05 01:53:48 +00:00
sspitzer%netscape.com
de05119601 more changes, remove listener when db is deleted.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109691 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-05 00:04:01 +00:00
sspitzer%netscape.com
3c437f50bb fix progress.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109689 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-04 23:52:13 +00:00
sspitzer%netscape.com
15ad7d2a45 there are no longer uris for cards.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109662 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-04 21:35:55 +00:00
sspitzer%netscape.com
35ea3d8b18 make it so we don't try to open the local database for ldap addressbooks
when sending mail.  code cleanup.  move th proxy code from mozilla/directory
to the place we create the listener.  (thanks to dmose for the tip.)


git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109659 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-04 21:20:25 +00:00
sspitzer%netscape.com
dc571d79d4 more changes, fix compile problems.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109647 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-04 19:31:00 +00:00
sspitzer%netscape.com
dff1d94d9f more changes for LDAP.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109615 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-04 05:24:29 +00:00
sspitzer%netscape.com
bc98a41047 get LDAP to work on the branch.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109606 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-04 03:58:35 +00:00
sspitzer%netscape.com
4b3bfd9eea more changes, cleanup. some perf changes.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109553 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-03 22:52:21 +00:00
sspitzer%netscape.com
509994bcf3 move the generateName code out of the nsIAbCard interface and into
the addrbooksession service.  format that generated name from the
format string in addressBook.properties file


git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109445 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-01 06:27:52 +00:00
sspitzer%netscape.com
89835075f7 fix the display name generation code.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109423 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-01 00:44:15 +00:00
sspitzer%netscape.com
07fb34379a more foo!
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109418 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-01 00:05:31 +00:00
sspitzer%netscape.com
15f2a78ae4 fix foobar stuff
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109416 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-01 00:03:16 +00:00
sspitzer%netscape.com
6c94867572 remove the foobar crap.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109411 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-30 23:38:24 +00:00
sspitzer%netscape.com
3ed566df91 fix some string foo.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109385 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-30 22:02:14 +00:00
sspitzer%netscape.com
b6250d1688 fix #112786
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109349 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-30 08:32:08 +00:00
sspitzer%netscape.com
03d5a8360d fix mailing list mailto link in preview pane.
now we properly escape and convert the email address for the mailing list,
so the mailto link will do the right thing.


git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109347 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-30 08:20:44 +00:00
sspitzer%netscape.com
c9dc4fafd1 clean / changes for ab sync
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109180 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-29 04:12:35 +00:00
sspitzer%netscape.com
70da706101 switch to generic getter for card from attribute.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109103 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-28 04:31:21 +00:00
sspitzer%netscape.com
0d580146b8 make the preview pane look pretty even when we can't generate
a valid name.  instead, we'll use the email address


git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109099 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-28 04:16:29 +00:00
sspitzer%netscape.com
250e40deb6 create generic ways to get card from name,value, and to get row from name,value.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109096 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-28 03:45:25 +00:00
sspitzer%netscape.com
ce2717b858 only show mailing list once in preview pane.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109095 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-28 03:41:40 +00:00
sspitzer%netscape.com
96688b26d7 fix some whitespace foo. Cellular should be Mobile.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109092 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-28 03:20:48 +00:00
sspitzer%netscape.com
c697bb6676 get "Create New Addressbook" to work.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@109060 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-27 23:49:48 +00:00
sspitzer%netscape.com
0c7ac6a290 cleanup.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108981 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-27 04:52:19 +00:00
sspitzer%netscape.com
f7c8007335 fix assertions on shutdown.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108978 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-27 04:25:08 +00:00
sspitzer%netscape.com
6e21db009f clean up. working on bug #76418, show contents as sorted in directory pane.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108975 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-27 04:08:43 +00:00
sspitzer%netscape.com
703fd6cf6b fix problem where the mailing list name doesn't update in the directory pane
unless the mailing list is selected.


git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108971 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-27 03:01:34 +00:00
sspitzer%netscape.com
86a81dcd8c always hide the "other" section when viewing mailing lists.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108952 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-27 00:57:00 +00:00
sspitzer%netscape.com
ee99090dca update comment.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108948 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-27 00:45:42 +00:00
sspitzer%netscape.com
75b62cdb6d update the preview pane, when the mailing list changes
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108947 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-27 00:45:24 +00:00
sspitzer%netscape.com
88dcbcb7a2 more changes, fix problem where cards where being duplicated.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108944 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-27 00:20:32 +00:00
sspitzer%netscape.com
6ace65cae5 add comment
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108912 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-26 20:06:48 +00:00
sspitzer%netscape.com
ce102834ca add comments.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108910 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-26 19:49:38 +00:00
sspitzer%netscape.com
d0823c38a8 do the colid -> column name (cstr) at a higher level.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108908 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-26 19:37:20 +00:00
sspitzer%netscape.com
4d4989e9d0 more changes, NULL -> nsnull, x == nsnull -> !x, don't assert and return failure if
generic column not available for row.


git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108905 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-26 18:54:34 +00:00
sspitzer%netscape.com
a782e83ecd removing the anonymous stuff. add ability to set and get generic string attributes to the addressbook.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108904 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-26 18:49:28 +00:00
sspitzer%netscape.com
0d9d3f2d5e silence assertions.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108707 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-21 17:32:47 +00:00
sspitzer%netscape.com
34017d6d80 initial work for some of the anonymous property stuff.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108668 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-21 04:27:49 +00:00
sspitzer%netscape.com
daf6b0d90d fix offline bug.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108644 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-20 23:51:31 +00:00
sspitzer%netscape.com
785d70af81 remove dumps.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108607 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-20 19:21:30 +00:00
sspitzer%netscape.com
9279a8670f get AB card drag and drop working again.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108605 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-20 19:14:51 +00:00
sspitzer%netscape.com
58c9062850 more work for dnd.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108587 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-20 17:00:26 +00:00
sspitzer%netscape.com
ee15827fc5 remove obsolete file
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108583 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-20 16:21:23 +00:00
sspitzer%netscape.com
0d1915e480 remove unused files
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108582 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-20 16:19:31 +00:00
sspitzer%netscape.com
7b32584a77 contine to work on ab dnd.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108581 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-20 16:11:52 +00:00
sspitzer%netscape.com
d4779bef7c fix assertion (from the trunk.)
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108554 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-20 04:41:58 +00:00
sspitzer%netscape.com
2fac729629 fix warning
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108431 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-18 06:57:42 +00:00
sspitzer%netscape.com
db4883cff0 fixes for linux.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108430 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-18 06:56:49 +00:00
sspitzer%netscape.com
52b6d0b86d fix warnings, clean up code.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108429 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-18 06:55:08 +00:00
sspitzer%netscape.com
d4f89947e9 fix this for linux. only need layout, not layout_xul
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108423 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-18 04:49:54 +00:00
sspitzer%netscape.com
b3f7f0a135 get this to build on linux.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108422 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-18 04:48:56 +00:00
sspitzer%netscape.com
ff41002fd7 changes to build when DEBUG_MIGRATOR is set
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108411 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-18 00:37:25 +00:00
sspitzer%netscape.com
a787b9a98e changes to get this code to build when DEBUG_profile_verbose is set.
r/sr=no one.


git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108408 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-17 23:58:58 +00:00
sspitzer%netscape.com
ad5f598ad9 fix duplicate access key
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108407 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-17 23:23:55 +00:00
sspitzer%netscape.com
b271d058c2 fixes to build on linux.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108406 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-17 23:19:24 +00:00
sspitzer%netscape.com
bc345906b6 changes for converting AB to outliner, bug fixes, and general ab cleanup.
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108403 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-17 23:05:10 +00:00
sspitzer%netscape.com
dcd486a050 pull the ab branch
git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108393 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-17 21:11:36 +00:00
(no author)
490851e559 This commit was manufactured by cvs2svn to create branch
'AB_OUTLINER_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/AB_OUTLINER_BRANCH@108325 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 20:51:55 +00:00
varada%netscape.com
95110e8725 [sspitzer checking in as varada]
fix for smoketest blocker #110478.  reply to local messages fails to quote the message.
calling SetSpec() on a spec with a query string causes problems.  see #110508
but to fix the blocker, I've rewritten the code to use SetQuery(), which is better anyways.

r=ducarroz


git-svn-id: svn://10.0.0.236/trunk@108324 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 20:51:54 +00:00
kestes%walrus.com
eaa7acdb9f leave the update function early if we have not updated anything.
git-svn-id: svn://10.0.0.236/trunk@108323 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 20:45:24 +00:00
kestes%walrus.com
960160100e remove comment which was left over from the original code copy. It refered
to some other code.


git-svn-id: svn://10.0.0.236/trunk@108322 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 20:44:54 +00:00
kestes%walrus.com
f62cec6b27 add support for the Req Ticketing system.
git-svn-id: svn://10.0.0.236/trunk@108321 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 20:43:30 +00:00
mcafee%netscape.com
138f283dd4 report min value to graph server, to match reported number.
git-svn-id: svn://10.0.0.236/trunk@108320 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 20:24:01 +00:00
ian.mcgreer%sun.com
bd587aacd3 some minor ckfw fixes
git-svn-id: svn://10.0.0.236/trunk@108319 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 19:41:49 +00:00
ian.mcgreer%sun.com
25af9bb35b fips fix for signtool
git-svn-id: svn://10.0.0.236/trunk@108318 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 19:39:37 +00:00
ian.mcgreer%sun.com
5a3e326b12 fix unneeded lock release in list iteration
git-svn-id: svn://10.0.0.236/trunk@108317 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 19:36:43 +00:00
mikep%oeone.com
de690d7698 Adding in words with no "s" on the end
git-svn-id: svn://10.0.0.236/trunk@108316 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 18:51:22 +00:00
mikep%oeone.com
fc3cf7275a Fix for image in unifinder stretching.
git-svn-id: svn://10.0.0.236/trunk@108315 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 18:50:44 +00:00
mikep%oeone.com
5af37380c6 XUL changes and alerts working for calendar events
git-svn-id: svn://10.0.0.236/trunk@108314 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 18:50:06 +00:00
mikep%oeone.com
ae5749062f Removing binary file.
git-svn-id: svn://10.0.0.236/trunk@108313 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 18:28:08 +00:00
relyea%netscape.com
be87626514 Remove redundant call to createHash Tables. bug 95537
git-svn-id: svn://10.0.0.236/trunk@108312 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 18:10:24 +00:00
mikep%oeone.com
7b47f7e7e3 Fixing alignment problem for timepicker.
git-svn-id: svn://10.0.0.236/trunk@108311 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 18:08:33 +00:00
mikep%oeone.com
5f8ae8420c Files added so that calendar can be called like ./mozilla -calendar
git-svn-id: svn://10.0.0.236/trunk@108310 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 18:07:40 +00:00
mikep%oeone.com
9c765b5b87 Removing title so that tooltip does not appear twice.
git-svn-id: svn://10.0.0.236/trunk@108309 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 18:02:24 +00:00
seawood%netscape.com
a7a1bc99b0 Oops. Only bump the opt level for gcc.
Fixing nebiros bustage.


git-svn-id: svn://10.0.0.236/trunk@108307 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 17:41:48 +00:00
despotdaemon%netscape.com
dd5f90648a Pseudo-automatic update of changes made by tingley@sundell.net.
git-svn-id: svn://10.0.0.236/trunk@108306 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 17:20:18 +00:00
morse%netscape.com
d82e69afa8 bug 104894, parsing p3p compact policies, r=harishd, sr=alecf
git-svn-id: svn://10.0.0.236/trunk@108304 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 15:05:53 +00:00
brade%netscape.com
ba68668ea3 ForceCompositionEnd when focus is lost (Blur); bug #81356; patch from Masaki Katakai (katakai@japan.sun.com); r=brade/ftang; sr=sfraser
git-svn-id: svn://10.0.0.236/trunk@108303 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 15:04:17 +00:00
ccarlen%netscape.com
1c7e2fb54a Bug 103384 - Move unicode conversion out of nsLocalFileCommon.cpp r=dougt/sr=alecf
git-svn-id: svn://10.0.0.236/trunk@108302 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 14:54:38 +00:00
karnaze%netscape.com
20df1e1ac0 bug 110369 - pedemont's patch to put child on pixel boundary when center aligning. r=karnaze.
git-svn-id: svn://10.0.0.236/trunk@108301 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 14:54:11 +00:00
ccarlen%netscape.com
a64c05a807 Adding new files for bug 103384 - move unicode conversion out of nsLocalFileCommon.cpp r=dougt/sr=alecf
git-svn-id: svn://10.0.0.236/trunk@108300 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 14:47:42 +00:00
realpeterv%mac.com
88938ea93f Fix for bug 83360 (improve LDAP datasource usefulness with XUL templates). r=dmose. Not part of the build.
git-svn-id: svn://10.0.0.236/trunk@108299 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 14:46:13 +00:00
realpeterv%mac.com
2bef1d2998 Fix for bug 83360 (improve LDAP datasource usefulness with XUL templates). r=dmose. Not part of the build.
git-svn-id: svn://10.0.0.236/trunk@108298 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 14:40:41 +00:00
neeti%netscape.com
4dc47433dd bug 106466 - Removed nsServiceEntry from ComponentManager, r=dougt, sr=brendan
git-svn-id: svn://10.0.0.236/trunk@108297 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 13:53:04 +00:00
rods%netscape.com
461f5b6b61 Temporary fix for problem with nsStrin.ReplaceSubString
We need to make sure the sure we are subst for isn't in the subst string.
Bug 110284 r=dcone sr=attinasi


git-svn-id: svn://10.0.0.236/trunk@108296 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 13:41:12 +00:00
locka%iol.ie
22ffd06071 NOT PART OF BUILD. Implement IAuthenticate to allow streams requiring username/password to be downloaded
git-svn-id: svn://10.0.0.236/trunk@108295 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 13:01:06 +00:00
locka%iol.ie
acf074d45d Fix for nsILocalFIle::GetURL returning malformed URLs on Unix. b=110299 r=blizzard@mozilla.org sr=waterson@netscape.com
git-svn-id: svn://10.0.0.236/trunk@108294 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 12:07:38 +00:00
peterv%netscape.com
efb0947a3c Fixing mac debug bustage. Patch suggested by jst, sr=jst.
git-svn-id: svn://10.0.0.236/trunk@108292 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 10:50:33 +00:00
ben%netscape.com
3aa9446cea bug 110435 - make consistent use of variable names in add bookmark dialog. Also prevent adding bookmarks without names. r=peterv, sr=jst
git-svn-id: svn://10.0.0.236/trunk@108291 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 10:42:55 +00:00
bstell%netscape.com
25458f74bb minor clean up from bug 107025
git-svn-id: svn://10.0.0.236/trunk@108290 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 09:19:11 +00:00
sspitzer%netscape.com
ee1086cdab more work on #73868. converting ab from tree to outliner.
addressbook sidebar channel persistence changes. NOT PART OF THE BUILD.


git-svn-id: svn://10.0.0.236/trunk@108289 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 09:05:24 +00:00
dbaron%fas.harvard.edu
5f96f091fa Call the root 'malloc' rather than '.root' since there's no leak root detection going on here.
git-svn-id: svn://10.0.0.236/trunk@108288 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 09:00:26 +00:00
bstell%netscape.com
e62b9a07ca bug 107018, add an assert to check for alignment issue
approved by brendan


git-svn-id: svn://10.0.0.236/trunk@108287 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 08:37:55 +00:00
bstell%netscape.com
95ad1daab5 minor clean up from bug 107025
remove debug line, add ifdef DEBUG to one prototype


git-svn-id: svn://10.0.0.236/trunk@108286 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 08:25:13 +00:00
jst%netscape.com
1a51f22f1a Fixing bug 109182. Don't allocate a string buffer every time NS_NewURI(nsIURI**, const nsAReadableString&) is called. r=dbaron@fas.harvard.edu, sr=darin@netscape.com
git-svn-id: svn://10.0.0.236/trunk@108285 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 08:23:28 +00:00
sspitzer%netscape.com
e445822a1c more work on #73868. converting ab from tree to outliner.
restore selection after sorting. NOT PART OF THE BUILD.


git-svn-id: svn://10.0.0.236/trunk@108284 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 07:53:43 +00:00
leaf%mozilla.org
f9207c08f4 Automated update
git-svn-id: svn://10.0.0.236/trunk@108283 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 07:43:32 +00:00
seawood%netscape.com
e31141ea5d Allow modules to override *default* optimization levels by setting MODULE_OPTIMIZE_FLAGS
Bug #110215 r=bryner


git-svn-id: svn://10.0.0.236/trunk@108282 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 07:42:48 +00:00
seawood%netscape.com
1a1f300cc1 Add concept of tiers (module groups) to toplevel Makefile.
Bug #107302 r=bryner


git-svn-id: svn://10.0.0.236/trunk@108280 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 07:40:42 +00:00
brendan%mozilla.org
3a5c14a623 Makefile should be ignored.
git-svn-id: svn://10.0.0.236/trunk@108279 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 06:43:02 +00:00
sspitzer%netscape.com
f988c8615d fix for #92393. get msgs toolbar button (and menu item) disabled until you select a folder
if you don't have it set to "check for new messages" on startup.  r/sr=bienvenu


git-svn-id: svn://10.0.0.236/trunk@108278 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 06:41:42 +00:00
danm%netscape.com
e2c4e40413 temporarily disabling lazy instantiation of mDocument and stuffing some 6K of bloattest leaks back into the box
git-svn-id: svn://10.0.0.236/trunk@108277 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 06:38:01 +00:00
ben%netscape.com
9398c4ecd7 Beginnings of supporting downloading of items, deleting download entries from the datasource.
NOT PART OF BUILD


git-svn-id: svn://10.0.0.236/trunk@108276 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 06:33:56 +00:00
mstoltz%netscape.com
f5760e7eb3 Bug 109113, second half of fix. r=jst, sr=brendan. Adding new CheckObjectAccess
callback to enforce the same-origin policy on function.caller.


git-svn-id: svn://10.0.0.236/trunk@108275 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 06:17:24 +00:00
naving%netscape.com
3c70dd7ca8 110208 r=stephend sr=bienvenu. Remove printfs from release build. Should make pop3 downloading msgs and biff
a bit faster.


git-svn-id: svn://10.0.0.236/trunk@108273 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 05:22:45 +00:00
blakeross%telocity.com
1ecbc9e7fd 110145 - Using the mouse wheel crashes when there's no target content. Scroll the focused content when the cursor is outside the window. r=ben sr=hewitt
git-svn-id: svn://10.0.0.236/trunk@108272 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 04:52:16 +00:00
bzbarsky%mit.edu
c59df8124b Make SetInnerHTML use the right parser mode (ie strict for strict
documents instead of always quirks).  Bug 106565, r=harishd, sr=jst


git-svn-id: svn://10.0.0.236/trunk@108271 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 04:48:30 +00:00
dbaron%fas.harvard.edu
f0f1ff9e1f Fix HP bustage due to old-style for-loop scoping.
git-svn-id: svn://10.0.0.236/trunk@108269 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 04:02:07 +00:00
dbaron%fas.harvard.edu
2d6b5c1c2d Fix Mach-O/BeOS/OS/2 REQUIRES bustage.
git-svn-id: svn://10.0.0.236/trunk@108267 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 03:47:07 +00:00
dp%netscape.com
80c5991124 Satisfying compilers...
git-svn-id: svn://10.0.0.236/trunk@108266 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 03:37:15 +00:00
blizzard%redhat.com
727fab5071 bug #104576. Font sizes wrong when running under Xinerama. r=bstell,sr=tor
git-svn-id: svn://10.0.0.236/trunk@108264 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 03:18:18 +00:00
jst%netscape.com
09af6c1092 Disabling security check optimization since it exposes security problems. rs=jband@netscape.com
git-svn-id: svn://10.0.0.236/trunk@108263 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 03:14:05 +00:00
jst%netscape.com
07982becb6 Putting back security check optimization that was taken out a few weeks ago, will disable this check until the real fix comes along. rs=jband@netscape.com
git-svn-id: svn://10.0.0.236/trunk@108262 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 03:12:12 +00:00
smontagu%netscape.com
1dc588ab2f Fix crash when scrolling absolute positioned textarea by adding test to return value from |GetLine|. Bug 105004, r=rbs, sr=kin
git-svn-id: svn://10.0.0.236/trunk@108261 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 03:08:30 +00:00
jst%netscape.com
70829fcf48 Fixing bug 110242. Huge unsigned interger + another huge unsigned integer will wrap, and that caused a crash in this code. r=rayw@netscape.com, sr=vidur@netscape.com
git-svn-id: svn://10.0.0.236/trunk@108259 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 03:01:29 +00:00
brendan%mozilla.org
056cf28a63 Remove __call__ and add a callback used to check f.caller access for any function object f (109113, r=jst, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@108257 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:56:49 +00:00
mscott%netscape.com
1a8eb9b1f3 Try registering the smime chrome the right way.....chrome in mail.jst and the locale in
langenus.jst


git-svn-id: svn://10.0.0.236/trunk@108256 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:56:30 +00:00
beard%netscape.com
839ca42429 fix for bug #100151, r=peterl, sr=waterson
git-svn-id: svn://10.0.0.236/trunk@108254 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:52:22 +00:00
dbaron%fas.harvard.edu
d75cd553c0 Ignore the library/address part of the stack unless asked to use it.
git-svn-id: svn://10.0.0.236/trunk@108252 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:47:07 +00:00
jkeiser%iname.com
f0b531fc70 Fix to make radio buttons and checkbox show their values on Print (bug 109914). r=rods@netscape.com,sr=jst@netscape.com
git-svn-id: svn://10.0.0.236/trunk@108251 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:43:23 +00:00
dp%netscape.com
5a69dc4d07 bug 108071 Eliminate 4000 calls to malloc by using copy getters of
registry. r=dveditz, sr=sfraser


git-svn-id: svn://10.0.0.236/trunk@108250 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:38:23 +00:00
jkeiser%iname.com
d443ae56e1 Fix textboxes not showing up in Print and Print Preview (bug 109914). r=sicking@bigfoot.com;sr=jst@netscape.com
git-svn-id: svn://10.0.0.236/trunk@108249 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:38:10 +00:00
rangansen%netscape.com
b4a977db33 bug# 109084 ,patch=ssaux, r=rangansen , sr=hewitt
exception handling in device-manager window


git-svn-id: svn://10.0.0.236/trunk@108247 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:32:20 +00:00
bienvenu%netscape.com
c9a006a2f9 fix downloading of imap messages for offline use when reading if mime parts on demand is invoked r=naving, sr=mscott 11067
git-svn-id: svn://10.0.0.236/trunk@108246 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:32:05 +00:00
relyea%netscape.com
fc6b6ceee3 Cause NSS_init() to fail if it can't open the databases, rather than succeding and leaving the system half initialized.
git-svn-id: svn://10.0.0.236/trunk@108245 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:30:38 +00:00
ben%netscape.com
2d6da23758 Read previous downloads from profile RDF XML datasource.
NOT PART OF BUILD.


git-svn-id: svn://10.0.0.236/trunk@108244 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:25:29 +00:00
blythe%netscape.com
6d460e3f06 NOT in normal build.
Have the tools build on windows, wether or not they work yet is another
issue.


git-svn-id: svn://10.0.0.236/trunk@108242 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:19:14 +00:00
dbaron%fas.harvard.edu
4af8dcbc41 Reduce bloat by eliminating nsString member variable (size of nsString and double-on-fault growth). r=jag sr=hyatt b=109963
git-svn-id: svn://10.0.0.236/trunk@108240 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:17:04 +00:00
alecf%netscape.com
beb4a442c0 further preparations for fixing bug 71482 - not part of build
- don't use the app-startup mechanism. for now, just rely on global history to create the load listener


git-svn-id: svn://10.0.0.236/trunk@108239 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:15:43 +00:00
danm%netscape.com
e48388726b hook up CreateAboutBlankContentViewer. bug 88229 r=jst,rpotts
git-svn-id: svn://10.0.0.236/trunk@108238 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:15:31 +00:00
jband%netscape.com
4ef39dc620 fix bug 109893. If we fail to open a zip/jar for reading then just log that fact and continue on rather than failing. r=valeski sr=jst.
git-svn-id: svn://10.0.0.236/trunk@108237 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:14:59 +00:00
danm%netscape.com
e3ad075016 lazily instantiate mDocument. bug 88229 r=jst,rpotts
git-svn-id: svn://10.0.0.236/trunk@108236 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:14:53 +00:00
bzbarsky%mit.edu
569f8e6897 mouse pointer should be normal pointer, not hand, over throbber. Bug
67761, r=hwaara, sr=hewitt


git-svn-id: svn://10.0.0.236/trunk@108235 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:14:22 +00:00
danm%netscape.com
56b222775b GetInterface can now return an nsIDOMWindow (to its 'main content', or browser window, as expected for implementations of nsIWebBrowserChrome. bug 88229 r=jst,rpotts
git-svn-id: svn://10.0.0.236/trunk@108234 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:14:04 +00:00
danm%netscape.com
7d415546b0 get rid of nsPIWindowWatcher::CreateChromeWindow (no longer necessary) and get rid of alternate docshell about:blank initialization path which fired off an actual URL load. bug 88229 r=jst,rpotts
git-svn-id: svn://10.0.0.236/trunk@108233 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:12:07 +00:00
danm%netscape.com
9daf08941d get rid of nsPIWindowWatcher::CreateChromeWindow (no longer necessary). bug 88229 r=jst,rpotts
git-svn-id: svn://10.0.0.236/trunk@108232 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:10:57 +00:00
darin%netscape.com
8225bd1d9c landing standard url rewrite (bug 103916)
r=andreas.otte@debitel.net, sr=brendan,alecf


git-svn-id: svn://10.0.0.236/trunk@108231 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:09:13 +00:00
danm%netscape.com
b765835495 adding an nsILoadGroup parameter to nsIDocumentLoaderFactory::CreateBlankDocument and cleaning up its implementation. Should be good to go now. bug 88229 r=jst,rpotts
git-svn-id: svn://10.0.0.236/trunk@108230 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:08:09 +00:00
danm%netscape.com
20e05520b9 adding an nsILoadGroup parameter to nsIDocumentLoaderFactory::CreateBlankDocument. bug 88229 r=jst,rpotts
git-svn-id: svn://10.0.0.236/trunk@108229 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:06:56 +00:00
bstell%netscape.com
1d5b3ecf25 bug 107025 (part of bug 90813)
anti-aliased bitmap font code
r=shanjian@netscape.com, sr=blizzard@mozilla.org


git-svn-id: svn://10.0.0.236/trunk@108228 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:06:22 +00:00
danm%netscape.com
307b64f891 adding nsIDocument::ResetToURI and refactoring Reset. bug 88229 r=jst,rpotts
git-svn-id: svn://10.0.0.236/trunk@108226 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:03:50 +00:00
danm%netscape.com
a5c5cddf01 adding nsIDocument::ResetToURI. bug 88229 r=jst,rpotts
git-svn-id: svn://10.0.0.236/trunk@108225 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:03:19 +00:00
jaggernaut%netscape.com
c68b39647b Fix xlib bustage, use .get() where previously implicit conversion from nsCString to const char* was used. patch by gisburn, r=jag, rs=scc.
git-svn-id: svn://10.0.0.236/trunk@108224 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 02:02:04 +00:00
bstell%netscape.com
857ea2e252 bug 107025 (part of bug 90813)
anti-aliased scaled bitmap font object code
r=shanjian@netscape.com, sr=blizzard@mozilla.org


git-svn-id: svn://10.0.0.236/trunk@108223 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 01:59:23 +00:00
darin%netscape.com
6c188f6fe7 fixes bug 97958 "[CRASH] on :jar protocol" r=dbaron, sr=dougt
git-svn-id: svn://10.0.0.236/trunk@108222 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 01:58:20 +00:00
danm%netscape.com
44e67f7c7d better-behaved GetAttention method flashes owner of dependent windows and sets timer on topmost parent. necessary with rev 1.38 of commonDialog.js. bug 53345 r=hyatt,syd
git-svn-id: svn://10.0.0.236/trunk@108221 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 01:58:17 +00:00
kaie%netscape.com
cd6d0037c0 b=109770 Obtaining a certificate from Verisign does not work
r=javi sr=blizzard


git-svn-id: svn://10.0.0.236/trunk@108219 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 01:57:58 +00:00
danm%netscape.com
9ccd384fa4 focus and notify all common dialogs. somewhat experimental (people wanted to try it) fix for bug 53345, r=pinkerton,syd
git-svn-id: svn://10.0.0.236/trunk@108218 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 01:55:44 +00:00
kaie%netscape.com
965786aed2 b=108600 Avoid the risk of unexpected NSS shutdowns
r=javi sr=blizzard


git-svn-id: svn://10.0.0.236/trunk@108217 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 01:55:37 +00:00
jaggernaut%netscape.com
d928e4ddac Clean up REQUIRES lines. r/sr=alecf
git-svn-id: svn://10.0.0.236/trunk@108216 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 01:54:59 +00:00
sspitzer%netscape.com
83ab3bab23 more work on #73868. converting ab from tree to outliner. NOT PART OF THE BUILD.
git-svn-id: svn://10.0.0.236/trunk@108215 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 01:41:13 +00:00
sspitzer%netscape.com
223f8e91c6 more work on #73868. converting ab from tree to outliner.
get sort indicators to work, make it so even if we persist some old or illegal
value for "sortedColumn", we do the right thing.

NOT PART OF THE BUILD.


git-svn-id: svn://10.0.0.236/trunk@108214 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 01:40:22 +00:00
relyea%netscape.com
72ff06ee26 The new DB stuff was not supposed to be turned on!
git-svn-id: svn://10.0.0.236/trunk@108213 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 01:18:21 +00:00
cltbld%netscape.com
ab89cdfecc switching to report minimum time of the entire run. r=mcafee,dp
git-svn-id: svn://10.0.0.236/trunk@108212 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 01:13:34 +00:00
ben%netscape.com
ab67aae96c Serialize Download Datasource -> XML in profile directory, some initial command support (launch, reveal, download file) in the UI & at datasource level.
NOT PART OF BUILD.


git-svn-id: svn://10.0.0.236/trunk@108211 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 00:23:01 +00:00
mscott%netscape.com
ec759acd03 attemp to fix mailnews compose window perf regression: Bug #110355
backout my packaging change from last night.

a=loan


git-svn-id: svn://10.0.0.236/trunk@108210 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-16 00:20:37 +00:00
yokoyama%netscape.com
b34d76db57 bug 110170
IME COMPOSITION string was off by one
and not to use compStrLen in NS_IMM_GETCOMPOSITIONSTRING()
/r=ftang, /sr=alecf


git-svn-id: svn://10.0.0.236/trunk@108207 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 23:42:00 +00:00
ssu%netscape.com
ac7233c2f6 fixing blocker bug 108530 - Setup.exe error on install, mozilla launches with full screen empty page
git-svn-id: svn://10.0.0.236/trunk@108206 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 23:27:55 +00:00
sonja.mirtitsch%sun.com
78f6f229de modernized... changed servers, clients, mastebuild, 10 minutes wait now
git-svn-id: svn://10.0.0.236/trunk@108205 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 23:27:20 +00:00
sonja.mirtitsch%sun.com
71dab61202 put fips test before the stress test (in case of a copied db the fips test interferes)
git-svn-id: svn://10.0.0.236/trunk@108204 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 23:26:21 +00:00
relyea%netscape.com
315e1fffc2 Add Issuer/SN to the trust objects for faster lookup.
git-svn-id: svn://10.0.0.236/trunk@108203 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 23:07:39 +00:00
relyea%netscape.com
9927580782 Add issuer/SN to the search criteria
git-svn-id: svn://10.0.0.236/trunk@108202 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 23:06:10 +00:00
relyea%netscape.com
b6e70a0487 performance optimizations:
1) add serial number index to trust lookups.
2) add code for replacing key db indexing (coded but not turned on -- causes a keydb upgrade, but can run with older key db's as well).


git-svn-id: svn://10.0.0.236/trunk@108201 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 23:04:41 +00:00
rayw%netscape.com
ce658d512b Not part of default build.
Fixed casing of included file so that it compiles
on Linux.  Schema is not part of build.

rs=rayw


git-svn-id: svn://10.0.0.236/trunk@108197 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 22:44:06 +00:00
blythe%netscape.com
44e5d93d15 Fix bug 108103, new tool SpaceTrace
SR,RS=brendan, SR=waterson, R=dbaron


git-svn-id: svn://10.0.0.236/trunk@108196 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 22:40:53 +00:00
sspitzer%netscape.com
4d83de169d fix how we do sorting in ab view. collation keys are raw data, not PRUnichar *.
NOT PART OF THE BUILD.


git-svn-id: svn://10.0.0.236/trunk@108195 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 22:16:49 +00:00
alecf%netscape.com
d348a4e9ab better fixes to make bloatblame work on windows
git-svn-id: svn://10.0.0.236/trunk@108193 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 22:08:03 +00:00
despotdaemon%netscape.com
e08268685d Pseudo-automatic update of changes made by blythe@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@108190 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 21:44:01 +00:00
despotdaemon%netscape.com
74c0691738 Pseudo-automatic update of changes made by knous@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@108189 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 21:25:48 +00:00
nelsonb%netscape.com
b83e00bb67 Add one more missing declaration of environ;
git-svn-id: svn://10.0.0.236/trunk@108188 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 20:40:44 +00:00
nelsonb%netscape.com
c968df5114 Go back to declaring "extern char ** environ".
git-svn-id: svn://10.0.0.236/trunk@108186 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 20:35:31 +00:00
alecf%netscape.com
10dba00731 some changes required to get bloatblame building on windows
git-svn-id: svn://10.0.0.236/trunk@108185 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 20:29:28 +00:00
mikep%oeone.com
9b413cab0b Adding in libical source.
git-svn-id: svn://10.0.0.236/trunk@108183 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 19:28:01 +00:00
despotdaemon%netscape.com
5bd55575ce Pseudo-automatic update of changes made by blythe@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@108182 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 19:25:02 +00:00
sonja.mirtitsch%sun.com
85d9ea119a added a hyperlink in the header
git-svn-id: svn://10.0.0.236/trunk@108180 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 19:01:42 +00:00
sonja.mirtitsch%sun.com
a1f486ef9a added sendmail, fixed sendmailbug
git-svn-id: svn://10.0.0.236/trunk@108179 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 19:01:16 +00:00
alecf%netscape.com
8752f42736 fix for bug 110290 - empty cells are considered non-existent when trying to see if a history cell is hidden or not. r/a=brade
git-svn-id: svn://10.0.0.236/trunk@108178 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 18:38:50 +00:00
gerv%gerv.net
52ebafa034 Bug 6419 - command-line query tools by Andreas Franke <afranke@ags.uni-sb.de>.
git-svn-id: svn://10.0.0.236/trunk@108177 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 17:04:58 +00:00
cmanske%netscape.com
46aec36943 Fixed case of 'publishprefs.js' where used in editor files
git-svn-id: svn://10.0.0.236/trunk@108176 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 16:44:48 +00:00
cmanske%netscape.com
de2267bac0 Fixing UNIX built bustage: wrong case for file in jar.mn
git-svn-id: svn://10.0.0.236/trunk@108175 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 16:39:59 +00:00
mcafee%netscape.com
9e747ddf19 Use TinderboxPrint mechanism for startup test.
git-svn-id: svn://10.0.0.236/trunk@108174 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 16:11:47 +00:00
cmanske%netscape.com
9931abe651 Mail Overlay xul for Composer relating to publishing ui, b=88208, r=brade, sr=hewitt
git-svn-id: svn://10.0.0.236/trunk@108173 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 16:03:14 +00:00
cmanske%netscape.com
26d26952e3 Composer CSS relating to new publishing ui, b=88208, r=brade, sr=hewitt
git-svn-id: svn://10.0.0.236/trunk@108172 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 16:00:03 +00:00
pinkerton%netscape.com
a02a863295 enable scrollbars when told [not part of build]
git-svn-id: svn://10.0.0.236/trunk@108171 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 15:31:34 +00:00
cmanske%netscape.com
af7e0a06cc Editor JS utilities reorg (b=106374, r=kin, sr=hewitt) and first draft of new Publishing UI (b=88208, r=brade, sr=hewitt)
git-svn-id: svn://10.0.0.236/trunk@108170 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 15:28:24 +00:00
karnaze%netscape.com
cb584f37c6 bug 80966 - calc row desired size when printing based on split height of cells. sr=attinasi, r=alexsavulov
git-svn-id: svn://10.0.0.236/trunk@108169 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 14:58:27 +00:00
rods%netscape.com
8011a838ab Added an assert and an if to protect from crashing and help discover what is happening
during print preview (it's ok the shell is null, but why do we get a focus event?)
Bug 109567 r=dcone sr=attinasi


git-svn-id: svn://10.0.0.236/trunk@108166 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 13:15:54 +00:00
locka%iol.ie
acf6b49a48 Remove sample chrome embed.jar from unix browser package and rename to avoid confusion with the real embed.jar used in the embedding dist. b=87622 r=blizzard@mozilla.org sr=dveditz@netscape.com
git-svn-id: svn://10.0.0.236/trunk@108165 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 12:23:57 +00:00
seawood%netscape.com
70e9350002 Tweak calendar for the static build.
git-svn-id: svn://10.0.0.236/trunk@108164 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 08:23:53 +00:00
dbaron%fas.harvard.edu
5d903ccb5f Avoid pointless nsAutoString construction and extra copy. b=109250 r=jag sr=jst
git-svn-id: svn://10.0.0.236/trunk@108163 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 07:47:39 +00:00
dbaron%fas.harvard.edu
f11ce5ca4c Oops, meant to remove that incorrect comment.
git-svn-id: svn://10.0.0.236/trunk@108162 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 07:44:59 +00:00
dbaron%fas.harvard.edu
c4d6c73aeb New, more portable (i.e., works for me, unlike the old code) Linux nsGetTypeName using dladdr. r=jag sr=waterson b=109829
git-svn-id: svn://10.0.0.236/trunk@108161 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 07:44:26 +00:00
hyatt%netscape.com
71bedef261 MIssed a spot in 109261. same reviewers apply as for previous checkin of bug fix.
git-svn-id: svn://10.0.0.236/trunk@108160 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 07:31:13 +00:00
dbaron%fas.harvard.edu
51696fc40a Fix overly long lines. r=kin sr=waterson b=106658
git-svn-id: svn://10.0.0.236/trunk@108159 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 07:30:09 +00:00
dbaron%fas.harvard.edu
6d6d615a63 Fix floater state recovery to descend into blocks (which might contain floaters). b=106658 r=kin sr=waterson
git-svn-id: svn://10.0.0.236/trunk@108158 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 07:28:46 +00:00
blizzard%redhat.com
553e8e8f5e Checkpointing changes. Not part of the build.
git-svn-id: svn://10.0.0.236/trunk@108157 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 07:27:22 +00:00
blizzard%redhat.com
405febe992 Bug #95833. Use gtk routines for nsWindow::SetTitle(). r=bryner,sr=alecf
git-svn-id: svn://10.0.0.236/trunk@108156 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 07:02:39 +00:00
bstell%netscape.com
92ad50f04d bug 107018; alpha blending routines for anti-aliased scaled X bitmap fonts
add nsX11AlphaBlend.cpp to list of file to compile
r=pavlov, sr=waterson


git-svn-id: svn://10.0.0.236/trunk@108155 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 06:51:13 +00:00
bstell%netscape.com
b75e0ddbfb bug 107018, alpha blending routines for anti-aliased scaled X bitmap fonts
(part of bug 90813), r=pavlov, sr=waterson


git-svn-id: svn://10.0.0.236/trunk@108154 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 06:45:16 +00:00
alecf%netscape.com
9d8651e6b1 aug, I give up. stupid SMIME
git-svn-id: svn://10.0.0.236/trunk@108153 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 05:58:14 +00:00
bryner%netscape.com
9851232df6 Make sure the state of the ok button is correct even if the window does not get initial focus (bug 98480). r=jag, sr=ben.
git-svn-id: svn://10.0.0.236/trunk@108152 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 05:37:32 +00:00
cmanske%netscape.com
e5ad45b5bd Fixed misspelled 'default' case in imagemap dialog, fix by premstaller, b=84111, r=cmanske, sr=kin
git-svn-id: svn://10.0.0.236/trunk@108151 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 05:32:43 +00:00
cmanske%netscape.com
d291b28865 Fixed Insert Character radio button initialization, b=107767, r=brade, sr=kin
git-svn-id: svn://10.0.0.236/trunk@108150 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 05:30:29 +00:00
cmanske%netscape.com
7010ba00cf Fixed error checking and reporting when loading page in Composer and removed commented-out code, b=105561, r=akkana, sr=kin
git-svn-id: svn://10.0.0.236/trunk@108149 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 05:26:25 +00:00
alecf%netscape.com
e8f3e2729d better fix - conditional REQUIRES based on BUILD_SMIME (but thanks anyway dbaron)
git-svn-id: svn://10.0.0.236/trunk@108148 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 05:12:38 +00:00
hewitt%netscape.com
01d79b4190 DOM Inspector update - tons of crash fixes, js error fixes, performance and usability improvements, r=jag, sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@108147 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 05:09:26 +00:00
despotdaemon%netscape.com
2b735a1b27 Pseudo-automatic update of changes made by arougthopher@lizardland.net.
git-svn-id: svn://10.0.0.236/trunk@108145 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 04:33:56 +00:00
nelsonb%netscape.com
b9c0acc0a2 Now that the implementations of all the RNG_ functions have been moved
from lib/util to lib/freebl, move the RNG header file there, too.
Eliminate secrngt.h, which has been empty (except for the license
boilerplate) for many releases.


git-svn-id: svn://10.0.0.236/trunk@108144 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 04:29:27 +00:00
dbaron%fas.harvard.edu
3da2bb0c9f Fix bustage. windowwatcher still needed in REQUIRES (ifdef BUILD_SMIME).
git-svn-id: svn://10.0.0.236/trunk@108143 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 04:27:27 +00:00
hewitt%netscape.com
826eabf6d9 108543 - urlbar autocomplete isn't showing search, r=jag, sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@108141 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 04:19:32 +00:00
hewitt%netscape.com
e0f51d7027 DOM Inspector update - tons of crash fixes, js error fixes, performance and usability improvements, r=jag, sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@108140 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 04:09:41 +00:00
alecf%netscape.com
0c847ee212 win32 REQUIRES cleanup
git-svn-id: svn://10.0.0.236/trunk@108139 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 03:49:13 +00:00
waterson%netscape.com
be4f98c3bc Bug 101982. Fix onbroadcast handler. r=cmanske, sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@108138 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 02:46:29 +00:00
sgehani%netscape.com
66343ffcee Fixing regression: adding languages is possible again.
b=109629; r=bryner; sr=blake


git-svn-id: svn://10.0.0.236/trunk@108137 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 02:43:32 +00:00
nelsonb%netscape.com
38c49051cb Use data from /dev/urandom to initialize PRNG, when possible.
and related changes.  Bug 96626.


git-svn-id: svn://10.0.0.236/trunk@108136 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 02:41:20 +00:00
relyea%netscape.com
ee79a0f5dd Fix AIX 64 bit build breakage when in debug mode.
git-svn-id: svn://10.0.0.236/trunk@108135 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 02:23:31 +00:00
sgehani%netscape.com
17328c4012 Make preview tab window content have a scrollbar when it needs one.
b=79651; r=morse; sr=alecf


git-svn-id: svn://10.0.0.236/trunk@108134 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 02:20:57 +00:00
sgehani%netscape.com
6f00a7baf1 Don't build search results when search panel isn't open and
auto open search panel isn't set.
b=91168; r=morse,jruderman; sr=alecf


git-svn-id: svn://10.0.0.236/trunk@108130 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 02:01:10 +00:00
nhotta%netscape.com
48815cee09 Changed to use char* for charset instead of nsString& for i18n functions, bug 108932, r=ducarroz,sr=sspitzer.
git-svn-id: svn://10.0.0.236/trunk@108129 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 02:00:32 +00:00
mscott%netscape.com
b307afe4cc Register smime chrome.
git-svn-id: svn://10.0.0.236/trunk@108125 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 01:29:33 +00:00
varada%netscape.com
ab8362e632 adding mail smoketest files -NOT PART OF BUILD
git-svn-id: svn://10.0.0.236/trunk@108118 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 01:18:39 +00:00
rangansen%netscape.com
4b7e789269 bug# 109792 ; s=kaie ; sr=hewitt Fixing the blank cert details tab problem
git-svn-id: svn://10.0.0.236/trunk@108116 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 01:16:02 +00:00
alecf%netscape.com
2c306b3de9 add hidePage() API to nsIBrowserHistory, to allow hiding 302 redirected URLs from the UI, for bug 102043 r=blake, sr=sspitzer (parity with 4.x and IE behavior)
git-svn-id: svn://10.0.0.236/trunk@108114 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 00:48:18 +00:00
alecf%netscape.com
b47d6fc10d further fixes for bug 102043 - add support for the hidePage() api when a redirected page is encountered
git-svn-id: svn://10.0.0.236/trunk@108113 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 00:46:26 +00:00
sspitzer%netscape.com
5a11950d35 repairing...(I hope)
git-svn-id: svn://10.0.0.236/trunk@108112 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 00:40:01 +00:00
sspitzer%netscape.com
6e78417c0e trying to repair mime.mcp.
git-svn-id: svn://10.0.0.236/trunk@108111 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 00:38:25 +00:00
sspitzer%netscape.com
0d1b31e4d1 more work on #73868. converting ab from tree to outliner. NOT PART OF THE BUILD.
git-svn-id: svn://10.0.0.236/trunk@108110 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 00:28:12 +00:00
sgehani%netscape.com
e0b1ce6a6b Replace strtok() with nsCRT::strok().
(Checking in for drepper@cygnus.com)
b=81590; r=sgehani; sr=alecf


git-svn-id: svn://10.0.0.236/trunk@108109 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 00:09:40 +00:00
cavin%netscape.com
5819e4979a Bug #107369: Check nNewSize=0 in AllocateSpace() and add current size to AllocateSpace() calls. r=bienvenu,sr=sspitzer.
git-svn-id: svn://10.0.0.236/trunk@108108 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 00:06:37 +00:00
akkana%netscape.com
b0c5a7f34a 104195: fix some problems with rewrap. r=brade sr=kin
git-svn-id: svn://10.0.0.236/trunk@108107 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 00:04:26 +00:00
kin%netscape.com
de04b31a56 Fix for bug 108666: No context menu when right clicking on form text widgets
getAttribute() now returns a null object instead of an empty string
  when an attribute does not exist, so expand shortcuts like
  getAttribute().toUpperCase() to the longer form to prevent errors.

r=blakeross@telocity.com  sr=jst@netscape.com


git-svn-id: svn://10.0.0.236/trunk@108106 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 23:56:42 +00:00
kin%netscape.com
c853bf4c4b Fix for bug 96455: hr has duplicate lineboxes in frame tree
- Move code in HaveFirstLetter*() methods to a more generic method
    HasPseudoStyle() to expand it's use, and make those methods call it.

  - Added static method RemoveGeneratedContentFrameSiblings(), which
    is now called from ContentRemoved(), to remove any sibling :before
    and :after frames for a given frame.

r=attinasi@netscape.com (also looked at by rbs@maths.uq.edu.au)
sr=waterson@netscape.com


git-svn-id: svn://10.0.0.236/trunk@108105 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 23:55:44 +00:00
nhotta%netscape.com
2c2e9d314d Changed location.href to force escape 8 bit if the href contains 8 bit, bug 40469, r=ftang, sr=jst.
git-svn-id: svn://10.0.0.236/trunk@108102 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 23:45:23 +00:00
bryner%netscape.com
8089a9b1a9 Adding $(MOZ_COMPONENT_LIBS) for platforms that resolve symbols at link time. Not part of the build.
git-svn-id: svn://10.0.0.236/trunk@108101 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 23:38:25 +00:00
ian.mcgreer%sun.com
c9b297cd2e merge 3.3 branch checkin; rsa double check and key consistency functions (see bug 74226)
git-svn-id: svn://10.0.0.236/trunk@108100 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 23:03:20 +00:00
andreww%netscape.com
2f4c821a8c bugzilla 93866 r=shliang sr=blake Fields not sized properly under preferences for Appearance:Themes
git-svn-id: svn://10.0.0.236/trunk@108098 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 22:50:42 +00:00
andreww%netscape.com
73df04eec4 bugzilla 108789 r=shliang sr=hewitt a=blizzard (for branch checkin) inset border in trees
git-svn-id: svn://10.0.0.236/trunk@108097 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 22:47:52 +00:00
rbs%maths.uq.edu.au
81e93a759c transliterate &ApplyFunction; b=106780 r=shanjian sr=waterson
git-svn-id: svn://10.0.0.236/trunk@108096 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 22:44:19 +00:00
leaf%mozilla.org
c8e97fa48a Automated update
git-svn-id: svn://10.0.0.236/trunk@108095 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 22:43:03 +00:00
bstell%netscape.com
dbb5792627 bug 102515: fix assertion from previous patch
checkin for mailto:andreas.otte@debitel.net,
r=bstell@netscape.com, sr=blizzard@mozilla.org


git-svn-id: svn://10.0.0.236/trunk@108094 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 22:40:47 +00:00
seawood%netscape.com
891f71eee4 Use dummy statement to override default adding of ical to LIBS (since we don't want it there).
git-svn-id: svn://10.0.0.236/trunk@108093 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 22:30:39 +00:00
pinkerton%netscape.com
dcd32d5c70 Add scrollbars, fix window resize issues, make scrolling work [not part of build]
git-svn-id: svn://10.0.0.236/trunk@108092 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 22:29:25 +00:00
pinkerton%netscape.com
958cf38835 fix overzealous ifdef causing some keys to not go into gecko. r=saari/sr=sfraser. bug#108722
git-svn-id: svn://10.0.0.236/trunk@108091 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 22:28:04 +00:00
cmanske%netscape.com
886cace519 Use 1000 as limit for HR size, b=102051, r=brade, sr=jst
git-svn-id: svn://10.0.0.236/trunk@108090 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 22:27:58 +00:00
cmanske%netscape.com
02b45c471c Fixed join cells table bug 103360, r=akkana, sr=kin
git-svn-id: svn://10.0.0.236/trunk@108089 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 22:22:17 +00:00
seawood%netscape.com
58c6f22581 Fixing AIX bustage. Resolve symbols at link time. r=bryner
git-svn-id: svn://10.0.0.236/trunk@108088 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 22:00:16 +00:00
kestes%walrus.com
be8493b366 turn apostrophe into accute accent to work arround netscape bug.
git-svn-id: svn://10.0.0.236/trunk@108087 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 21:59:55 +00:00
dbaron%fas.harvard.edu
4c020bcc00 Oops. Backing that out.
git-svn-id: svn://10.0.0.236/trunk@108085 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 21:44:45 +00:00
despotdaemon%netscape.com
793dede43a Pseudo-automatic update of changes made by dmose@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@108084 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 21:43:28 +00:00
dbaron%fas.harvard.edu
9677901489 Add script to diff the output of two files created by NS_TraceMallocDumpAllocations.
git-svn-id: svn://10.0.0.236/trunk@108083 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 21:42:54 +00:00
sspitzer%netscape.com
16acdc5e3f more work on #73868. converting ab from tree to outliner. NOT PART OF THE BUILD.
git-svn-id: svn://10.0.0.236/trunk@108082 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 21:38:32 +00:00
kestes%walrus.com
9a2c8179f1 document most important change.
git-svn-id: svn://10.0.0.236/trunk@108081 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 21:25:49 +00:00
kestes%walrus.com
866a37470f admin scripts I use.
git-svn-id: svn://10.0.0.236/trunk@108080 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 21:24:36 +00:00
kestes%walrus.com
9434b0aefc my echo statements had leading '$', how did they get there?
I added to the test command so that you can see exactly how it was called.
change the example to show how --tree now works.


git-svn-id: svn://10.0.0.236/trunk@108079 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 21:23:40 +00:00
kestes%walrus.com
4a849ad3eb make the checkouts of -D be in sync with the tinderbox boxes by ensuring
-D is really the start time.


git-svn-id: svn://10.0.0.236/trunk@108078 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 21:22:13 +00:00
kestes%walrus.com
9d6e1eed77 allow for alternating builds using a single build process.
git-svn-id: svn://10.0.0.236/trunk@108077 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 21:21:02 +00:00
shrutiv%netscape.com
51e6d7da25 Fix for bug 96732: Hide DOS windows when building installer (r=tao)
git-svn-id: svn://10.0.0.236/trunk@108070 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 19:05:48 +00:00
bzbarsky%mit.edu
01108728c5 msvc barfs on functions taking nsAString& with default initializers from
an NS_LITERAL_STRING.  Remove the default initializer, which is not
being used.  r=jag, a=leaf to get tests building again.


git-svn-id: svn://10.0.0.236/trunk@108065 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 17:27:11 +00:00
brade%netscape.com
1682133637 fix bug #106022; disable unicode input for OS < 9.0 (r=ftang; sr=sfraser)
git-svn-id: svn://10.0.0.236/trunk@108064 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 16:00:17 +00:00
blizzard%redhat.com
aeb7b28295 Bug #75372. Get dragging messages to the compose window working again on Linux. Fix incorrect case in drag flavour. r=jag,rginda sr=sspitzer, a=dbaron
git-svn-id: svn://10.0.0.236/trunk@108062 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 15:40:03 +00:00
bbaetz%cs.mcgill.ca
9ca8a3c375 Bug 107718 pt 2 - use subtraction instead of the ~ operator, which older
mysql versions don't support. Remove the checksetup.pl restriction, too.

r=jake x2


git-svn-id: svn://10.0.0.236/trunk@108061 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 15:12:23 +00:00
rods%netscape.com
3d51ca2366 trying again to fix the bustage on the ports
git-svn-id: svn://10.0.0.236/trunk@108060 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 14:44:34 +00:00
mkaply%us.ibm.com
b6110d2c3c #36163
r=mkaply, r/sr=attinasi
Don't show Bidi control characters in the browser


git-svn-id: svn://10.0.0.236/trunk@108059 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 14:21:52 +00:00
rods%netscape.com
bdd0f4956c Added image animation mode constants to imgIContainer.IDL,
Changed the animation mode enum to PRUint16 (removed the enum) in nsIPresContext so we could use the constants
from imgIContainer. (changes from dcone's review comments)
Bug 2586 r=dcone sr=attinasi


git-svn-id: svn://10.0.0.236/trunk@108058 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 14:03:09 +00:00
rods%netscape.com
4b3f973350 Added image animation mode constants to imgIContainer.IDL,
Changed the animation mode enum to PRUint16 (removed the enum) in nsIPresContext so we could use the constants
from imgIContainer. (change from dcone's review comments)
Bug 2586 r=dcone sr=attinasi


git-svn-id: svn://10.0.0.236/trunk@108057 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 13:59:08 +00:00
peterv%netscape.com
ed0166f1db Clean up project (put files in subfolders where they belong).
git-svn-id: svn://10.0.0.236/trunk@108056 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 13:50:15 +00:00
peterv%netscape.com
bd1e7483fb Fix for bug 105452 (Annoying assert when outputing DOM to HTML source). r=cmanske, sr=kin.
git-svn-id: svn://10.0.0.236/trunk@108055 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 13:47:49 +00:00
karnaze%netscape.com
2478679da6 bug 109043 - made percent tables without a computed height initiate a special 3rd pass reflow only when a table related frame up the chain has a fixed or percent height. Made row groups not allocate additional vertical space to percent rows in excess of the table height. sr=attinasi,r=alexsavulov
git-svn-id: svn://10.0.0.236/trunk@108054 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 13:44:38 +00:00
karnaze%netscape.com
65fe290a5b bug 103925 (2nd patch) - flag pixel rounding errors in display reflow debugging. sr=attinasi, r=bernd
git-svn-id: svn://10.0.0.236/trunk@108053 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 13:40:03 +00:00
locka%iol.ie
04d0dcd1ae Add error message when user tries to load a malformed url instead of silently ignoring it. b=89118 r=ccarlen@netscape.com sr=rpotts@netscape.com
git-svn-id: svn://10.0.0.236/trunk@108052 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 13:26:43 +00:00
jfrancis%netscape.com
86581dbcfa fix for Bug#:107494, when editting in IME mode, you cannot delete last uncommitted character. r=smfr; sr=kin; a=drivers
git-svn-id: svn://10.0.0.236/trunk@108051 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 12:58:57 +00:00
rods%netscape.com
2c256afb90 Fix breakage on SunOS and IRIX
git-svn-id: svn://10.0.0.236/trunk@108049 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 12:43:53 +00:00
jaggernaut%netscape.com
d22bec017c Bug 98213: Make data members of nsStr protected and clean up code. r=dbaron, sr=alecf
git-svn-id: svn://10.0.0.236/trunk@108048 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 12:35:52 +00:00
bernd.mielke%snafu.de
dbb80ab0d1 style change reflows should be send down to the childrens, bug 108340, r=karnaze
sr=attinasi


git-svn-id: svn://10.0.0.236/trunk@108047 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 11:40:03 +00:00
rods%netscape.com
04987fe8c2 Rename some bools, there is now one for when PP is being created and one for when it is in PP mode.
It now can turn on/off animated gifs and calling PP toggles it on and then call it again toggles it off
Bug 2586 r=dcone sr=attinasi


git-svn-id: svn://10.0.0.236/trunk@108046 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 11:24:03 +00:00
rods%netscape.com
598f28dd63 The PresContext must walk the content tree and find all the images and turn them back "on" for animation
It must also walk it's own list that contains the background images
Bug 2586 r=dcone sr=attinasi


git-svn-id: svn://10.0.0.236/trunk@108045 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 11:21:54 +00:00
sspitzer%netscape.com
d1358e97fd more work on #73868. converting ab from tree to outliner. NOT PART OF THE BUILD.
git-svn-id: svn://10.0.0.236/trunk@108044 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 10:25:19 +00:00
hewitt%netscape.com
6dc045c3a2 108757 - dispatch DOM events for mouse wheel scrolling, r=?, sr=?
git-svn-id: svn://10.0.0.236/trunk@108043 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 10:06:21 +00:00
sspitzer%netscape.com
ff39b3820a more work on #73868. converting ab from tree to outliner. NOT PART OF THE BUILD.
git-svn-id: svn://10.0.0.236/trunk@108042 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 09:59:11 +00:00
sspitzer%netscape.com
357edc322c more work on #73868. converting ab from tree to outliner. NOT PART OF THE BUILD.
git-svn-id: svn://10.0.0.236/trunk@108041 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 09:36:30 +00:00
bryner%netscape.com
6f14faee25 Fixing win32 bustage
git-svn-id: svn://10.0.0.236/trunk@108040 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 08:46:46 +00:00
hyatt%netscape.com
898c319da9 put a comment in the stylecontext header.
git-svn-id: svn://10.0.0.236/trunk@108039 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 08:37:58 +00:00
hyatt%netscape.com
cb07ac61ff Inline PeekStyleData for 109261.
git-svn-id: svn://10.0.0.236/trunk@108038 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 08:29:11 +00:00
bryner%netscape.com
b81f5400ae Adding libfileview.so and filepicker.xpt, for bug 82854.
git-svn-id: svn://10.0.0.236/trunk@108037 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 08:25:03 +00:00
bryner%netscape.com
01f9c809ba Turning on new C++ filepicker code (bug 82854). r=jag, sr=ben.
git-svn-id: svn://10.0.0.236/trunk@108036 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 08:19:23 +00:00
hyatt%netscape.com
c0d0283f4f Perf and footprint opt. Make style re-resolution cheaper. r=glazou, sr=hewitt, bug 109261
git-svn-id: svn://10.0.0.236/trunk@108035 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 08:19:13 +00:00
dbaron%fas.harvard.edu
0bed06a100 Fix assertions that I caused with my previous checkin. sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@108034 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 08:17:19 +00:00
darin%netscape.com
0d5c69b3dc fixing mac bustage
git-svn-id: svn://10.0.0.236/trunk@108033 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 07:38:05 +00:00
stephend%netscape.com
1e7eaf9f8d Bug 109677. 'Empty Trash Can' in context menu to 'Empty Trash'. r=jglick@netscape.com, sr=brendan@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@108032 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 07:22:16 +00:00
hewitt%netscape.com
3e3f843750 108579 - hiding first column causes empty outliner, r=jag, sr=sspitzer
git-svn-id: svn://10.0.0.236/trunk@108031 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 07:02:06 +00:00
mscott%netscape.com
7d19a62068 Bug #109979 --> only construct the view for the view mode we are in. Then when we toggle the
view mode, build the new view. This improves message display performance.
r=bienvenu
sr=sspitzer


git-svn-id: svn://10.0.0.236/trunk@108030 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 06:59:45 +00:00
hewitt%netscape.com
f5f329d919 108543 - urlbar autocomplete isn't showing search, r=blake, sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@108029 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 06:52:32 +00:00
hewitt%netscape.com
fcb78f0695 109169 - dialog should support custom dialog buttons, r=ben, sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@108028 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 06:48:44 +00:00
hewitt%netscape.com
2abff317c3 109190 - Editable menulists no longer show dropmarker, r=ben, sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@108027 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 06:46:03 +00:00
darin%netscape.com
424a7bd5f9 patch for bug 107789 "deprecate nsIRandomAccessStore (superceded by nsISeekableStream)"
r=dougt, sr=rpotts


git-svn-id: svn://10.0.0.236/trunk@108026 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 06:45:27 +00:00
morse%netscape.com
44b4767079 bug 109360, image blocking blocks wrong server, r=andre, sr=alecf
git-svn-id: svn://10.0.0.236/trunk@108025 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 06:37:45 +00:00
mscott%netscape.com
df1295094c Bug #109923 --> register chrome in the installer for messenger-smime
git-svn-id: svn://10.0.0.236/trunk@108024 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 06:17:18 +00:00
seawood%netscape.com
e72b14ebec Only allow XP_AssertAtLine/XP_ASSERT to print to console in debug builds.
Bug #78647 r=bryner


git-svn-id: svn://10.0.0.236/trunk@108023 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 05:43:59 +00:00
dbaron%fas.harvard.edu
f9e51525af Add code for trace-malloc based leak/bloat test (but no option to enable yet). b=84831 r=mcafee
git-svn-id: svn://10.0.0.236/trunk@108021 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 05:35:25 +00:00
leaf%mozilla.org
9a86a07b1b Automated update
git-svn-id: svn://10.0.0.236/trunk@108019 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 05:13:03 +00:00
seawood%netscape.com
63fdb0b574 Attempt to compile simple X11 program to verify that X11 headers exist.
Bug #83822


git-svn-id: svn://10.0.0.236/trunk@108018 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 05:11:00 +00:00
naving%netscape.com
da4c44e528 108774. r/sr=bienvenu. Make copying multiple messages work for 2nd pop3 acct.
git-svn-id: svn://10.0.0.236/trunk@108017 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 05:06:02 +00:00
seawood%netscape.com
3ad38bcf0b Update standalone xpconnect to handle js/xpconnect split.
Bug #104307 sr=jband


git-svn-id: svn://10.0.0.236/trunk@108016 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 04:54:14 +00:00
seawood%netscape.com
54111460c9 Build libmozjs during the install phase.
Bug #104307 sr=jband


git-svn-id: svn://10.0.0.236/trunk@108015 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 04:52:55 +00:00
cmanske%netscape.com
12889f5b49 Added 'Edit Link in New Composer' menuitem to Composer context menu, b=97425, r=hewitt, sr=kin
git-svn-id: svn://10.0.0.236/trunk@108014 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 04:33:42 +00:00
seawood%netscape.com
f922174b1f Removing obsolete files from tree.
Bug #102787 r=pierre


git-svn-id: svn://10.0.0.236/trunk@108013 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 04:13:46 +00:00
seawood%netscape.com
fe85f33fbb Removing obsolete xpcom/remote files.
Bug #102787 r=igor.kushnirskiy@sun.com


git-svn-id: svn://10.0.0.236/trunk@108012 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 04:10:51 +00:00
seawood%netscape.com
977f1f7fe7 Use -no-cpp-precomp instead of -traditional-cpp for darwin
Bug #106617


git-svn-id: svn://10.0.0.236/trunk@108011 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 04:01:43 +00:00
seawood%netscape.com
60d7c851aa Generate staticmod makefile when building meta components too.
git-svn-id: svn://10.0.0.236/trunk@108009 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 03:50:32 +00:00
jake%acutex.net
ff3e46489b We don't really need to look for fragments that are pulled in by [% INCLUDE %] or [% PROCESS %]. While removing this code bit doesn't allow us to seperatly check that those fragments exist and compile, they'll be checked atomatically when the the template that wants them is run through the process() routine by the 004template.t test. This issue was raised because bug 98707 introduced a [% BLOCK %] element and the syntax for using that is the same as for including a template fragment.
git-svn-id: svn://10.0.0.236/trunk@108008 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 03:44:07 +00:00
pete%alphanumerica.com
7b12a0334d b=108925, r=shaver, sr=jst
patch to remove symlinked dirs when recursive flag is set to false

--pete


git-svn-id: svn://10.0.0.236/trunk@108007 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 03:42:59 +00:00
dbaron%fas.harvard.edu
d11d813ea8 Add unicharutils static library.
git-svn-id: svn://10.0.0.236/trunk@108006 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 03:08:55 +00:00
bzbarsky%mit.edu
d29525429f Fix bustage -- add unicharutil to REQUIRES
git-svn-id: svn://10.0.0.236/trunk@108005 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 02:46:58 +00:00
seawood%netscape.com
17a9830da0 Removing unused unix-jar.mn
Bug #106375 r=lordpixel


git-svn-id: svn://10.0.0.236/trunk@108004 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 02:42:07 +00:00
dbaron%fas.harvard.edu
6dad459f6f Fix xmlterm bustage, and make it faster too. r=bzbarsky b=104159
git-svn-id: svn://10.0.0.236/trunk@108003 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 02:41:03 +00:00
serge%netscape.com
8d0828d01d bug#99080 using plugger, makes the temp file huge; r=peterl; sr=dougt
git-svn-id: svn://10.0.0.236/trunk@108002 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 02:15:57 +00:00
mscott%netscape.com
fb6e98659b Bug #109931 --> delay construction of the long email address view
until the user actually puts us in expanded email addresses mode.
r=bienvenu
sr=sspitzer


git-svn-id: svn://10.0.0.236/trunk@108001 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 02:07:39 +00:00
attinasi%netscape.com
c4a9b2e2c7 Fixing image that was added non-binary
git-svn-id: svn://10.0.0.236/trunk@108000 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:56:39 +00:00
av%netscape.com
feeeb9c6e5 109973 -- passing plugin creation parameters to the plugin instance, not part of the build
git-svn-id: svn://10.0.0.236/trunk@107999 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:54:11 +00:00
dbaron%fas.harvard.edu
d3a1b4c5f8 FizillaMach: Make the Quit menu item work by checking the command attribute in nsMenuBarX::ExecuteCommand as in nsMenuItemX::DoCommand. b=107212 r=pinkerton sr=sfraser
git-svn-id: svn://10.0.0.236/trunk@107998 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:53:33 +00:00
dbaron%fas.harvard.edu
09e9d89450 FizillaMach: Further refine the XP_MACOSX / MOZ_WIDGET_TOOLKIT=mac ifdefs. b=109165 r=pinkerton sr=sfraser
git-svn-id: svn://10.0.0.236/trunk@107997 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:48:17 +00:00
av%netscape.com
899918a8be 109973 -- SDK sample code, passing plugin creation parameters to the plugin instance, not part of the build
git-svn-id: svn://10.0.0.236/trunk@107996 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:47:28 +00:00
dbaron%fas.harvard.edu
4d7fae424c FizillaMach: Create MozillaDebug.app for DEBUG builds rather than Mozilla.app. b=109939 r=pinkerton sr=sfraser
git-svn-id: svn://10.0.0.236/trunk@107995 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:45:03 +00:00
leaf%mozilla.org
a4018d9ea9 Automated update
git-svn-id: svn://10.0.0.236/trunk@107994 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:43:06 +00:00
seawood%netscape.com
0186c61d8d Add hooks for building calendar. r=bryner
git-svn-id: svn://10.0.0.236/trunk@107993 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:40:53 +00:00
dbaron%fas.harvard.edu
d1c83fa406 Reduce string copying by using |operator+| to form dependent concatenations. b=106153 r=jag sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@107992 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:38:55 +00:00
dbaron%fas.harvard.edu
27085c8d89 Reduce allocations by using the buffering in nsXMLContentSink. b=106153 r=jag sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@107991 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:37:43 +00:00
wtc%netscape.com
390af0f971 Bugzilla bug 109389: changed the PLEvent event receiver window class
name to say "XPCOM" instead of "NSPR".  r=dougt.  sr=alecf.


git-svn-id: svn://10.0.0.236/trunk@107990 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:37:41 +00:00
timeless%mac.com
e33abfe1ce Bugzilla Bug 87792 Fix accesskeys based on new flexibility
patch by slate@gwu.edu r=aaronl sr=ben


git-svn-id: svn://10.0.0.236/trunk@107989 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:37:35 +00:00
sspitzer%netscape.com
2bde81b92b fix for #108264, problems with autosubscribe dialog on linux.
fix for #68303 and #109537. problems with auto-subscribe / auto-unsubscribe when newsgroup has non-ASCII chars in the name.

patches by hwaara.  r/sr=sspitzer,alecf


git-svn-id: svn://10.0.0.236/trunk@107988 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:37:28 +00:00
bzbarsky%mit.edu
068756d821 Use NS_LITERAL_STRING instead of NS_ConvertASCIItoUCS2 where possible
(i.e. where the string is a literal).  Bug 104159, r=jag, sr=alecf


git-svn-id: svn://10.0.0.236/trunk@107987 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:33:42 +00:00
rangansen%netscape.com
56b339685e bug# 109072 ; s-kaie ; sr=hewitt Fixing the blank cert details tab problem
git-svn-id: svn://10.0.0.236/trunk@107986 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:32:21 +00:00
wtc%netscape.com
a3600d2ad1 Bugzilla bug 104645: Fixed compiler warnings. Improved compiler warning
fixes.  r=mcafee.
Modified files: src/h_page.c src/hash.c tests/lots.c


git-svn-id: svn://10.0.0.236/trunk@107984 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:31:11 +00:00
alecf%netscape.com
6c7c586272 REQUIRES cleanup
git-svn-id: svn://10.0.0.236/trunk@107983 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:28:24 +00:00
leaf%mozilla.org
6aea6acbdd Automated update
git-svn-id: svn://10.0.0.236/trunk@107982 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:28:01 +00:00
smontagu%netscape.com
7b6125768b Change the definition of IS_ARABIC_ALPHABETIC to correct the display of Persian and Urdu numerals. Bug 82347, r=mkaply, sr=kin
git-svn-id: svn://10.0.0.236/trunk@107981 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:26:21 +00:00
seawood%netscape.com
869f09ca92 Remove reference to defunct libIDL homepage.
Bug #109901


git-svn-id: svn://10.0.0.236/trunk@107979 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:24:19 +00:00
seawood%netscape.com
f206ab690e Generate proper tarball name for cross-compile builds. Use target name instead of build name.
git-svn-id: svn://10.0.0.236/trunk@107978 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:22:10 +00:00
sfraser%netscape.com
2f9cc4b128 Fix for blocker bug 109893. Comment out line that adds the plugins folder to the XPT search paths, to avoid errors when trying to look in MRJPlugin.jar for .xpt files on Mac. r=jband/a=sleestack
git-svn-id: svn://10.0.0.236/trunk@107977 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 01:14:08 +00:00
smeredith%netscape.com
15b788703c Merged SeamonkeyCCK_6_2_BRANCH with trunk.
git-svn-id: svn://10.0.0.236/trunk@107973 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-14 00:23:13 +00:00
bryner%netscape.com
12a77bd184 Fixing smoketest blocker 109870 - crashes when favicon doesn't exist. r=dbaron ,sr=hyatt.
git-svn-id: svn://10.0.0.236/trunk@107972 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 23:35:12 +00:00
jpierre%netscape.com
e21447d1e0 Fix OS/2 build
git-svn-id: svn://10.0.0.236/trunk@107970 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 21:38:54 +00:00
sfraser%netscape.com
47bff0a065 Fix for blocker bug 109893; update packages-mac after I changed gfx/widget to be component DLLs. r=pink, sr=alecf
git-svn-id: svn://10.0.0.236/trunk@107967 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 19:47:31 +00:00
pschwartau%netscape.com
f0a1c21adf Adding another case to test.
git-svn-id: svn://10.0.0.236/trunk@107966 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 19:46:27 +00:00
mikep%oeone.com
4b15498292 Fixed bug 109262, alarms resetting their unit values.
git-svn-id: svn://10.0.0.236/trunk@107965 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 19:45:11 +00:00
dinglis%qnx.com
ed80e9ad92 -not part of build -
fixed crash when creating a scriptable Region


git-svn-id: svn://10.0.0.236/trunk@107964 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 19:25:32 +00:00
gerv%gerv.net
8891347238 Fix license headers and make attachment changed page look like bug changed page. Bug 99518 and 98110. r-myk, no second review.
git-svn-id: svn://10.0.0.236/trunk@107963 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 17:24:24 +00:00
mikep%oeone.com
9affe1d153 Changes made to get the calendar working under the nightlies because of XUL changes.
git-svn-id: svn://10.0.0.236/trunk@107962 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 16:39:15 +00:00
dinglis%qnx.com
b5c475787c - not part of build -
fix up bustage.


git-svn-id: svn://10.0.0.236/trunk@107960 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 15:49:51 +00:00
jaggernaut%netscape.com
4cfd160b80 Bug 15050, bug 109650: if user starts typing after page load kicks off, but before it replaces the url, don't overwrite what the user just typed, but do update the rest of the UI, doh!, and make sure switching tabs does replace what the user typed. r=ben, sr=hewitt.
git-svn-id: svn://10.0.0.236/trunk@107956 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 09:00:22 +00:00
hyatt%netscape.com
0d5d8dd51e Turn on favicons in Mozilla. r=glazou, bryner, sr=ben,hewitt, bug 109843
git-svn-id: svn://10.0.0.236/trunk@107955 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 08:55:23 +00:00
seawood%netscape.com
5966f2478a Use separate shell process for cvs pulls so that 'make -n -f client.mk' doesn't attempt to pull from cvs.
Bug #71200


git-svn-id: svn://10.0.0.236/trunk@107954 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 08:38:56 +00:00
dbaron%fas.harvard.edu
f6e15b701a Adding newline to end of file to fix HP bustage.
git-svn-id: svn://10.0.0.236/trunk@107953 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 07:59:24 +00:00
bryner%netscape.com
c9ba9c64dc Adding support for building calendar by having MOZ_CALENDAR=1 set. r=cls.
git-svn-id: svn://10.0.0.236/trunk@107952 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 07:57:31 +00:00
seawood%netscape.com
8f720e0943 Update mail meta modules list to handle smime.
Bug #109432 r=bryner


git-svn-id: svn://10.0.0.236/trunk@107951 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 07:48:26 +00:00
rpotts%netscape.com
168c3705c6 bug #106558 (r=darin) again! make sure that all initial stream errors prevent the creation of a content viewer!
git-svn-id: svn://10.0.0.236/trunk@107950 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 07:47:22 +00:00
bstell%netscape.com
ee96d98681 follow up for bug 102113, per Brendan's request
change the name from dummy to align, no other change


git-svn-id: svn://10.0.0.236/trunk@107949 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 07:36:38 +00:00
hyatt%netscape.com
a9b4cb7515 Fix handledomevent to work with custom eventts in XUL. r=jag, sr=hewitt, bug 109831
git-svn-id: svn://10.0.0.236/trunk@107947 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 07:00:21 +00:00
alecf%netscape.com
30649c62ba remove some DEBUG_alecf's - no bug, not affecting anything...
git-svn-id: svn://10.0.0.236/trunk@107946 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 05:46:51 +00:00
dbaron%fas.harvard.edu
0aa3ce9bc2 Adding / removing files for hyatt. b=106153
git-svn-id: svn://10.0.0.236/trunk@107945 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 04:19:47 +00:00
hyatt%netscape.com
b4e87bafad Fix for 106153, don't build a content model for XBL's implementation. r=bryner, sr=ben
git-svn-id: svn://10.0.0.236/trunk@107944 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 04:09:56 +00:00
hyatt%netscape.com
3a488100eb 106153. convert property to field in XBL. r=bryner, sr=ben
git-svn-id: svn://10.0.0.236/trunk@107943 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 04:08:55 +00:00
sonja.mirtitsch%sun.com
40e8999e40 made cronsafe (I hope)
git-svn-id: svn://10.0.0.236/trunk@107942 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 03:28:52 +00:00
sspitzer%netscape.com
914e467a98 more work on #73868. converting ab from tree to outliner. NOT PART OF THE BUILD.
git-svn-id: svn://10.0.0.236/trunk@107941 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 02:13:58 +00:00
kirk.erickson%sun.com
072424c974 Resolves 107777 - selfserv needs log stats mode
git-svn-id: svn://10.0.0.236/trunk@107940 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 02:13:19 +00:00
seawood%netscape.com
a19730ed38 Link against xinerama libs in static build if xinerama is enabled.
Bug #109245 r=lidl@pix.net


git-svn-id: svn://10.0.0.236/trunk@107939 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 01:48:29 +00:00
sonja.mirtitsch%sun.com
d35e81719f attempt to copy the qa results to mozilla.
this version untars with a script on mozilla, last one filled up my homedirectory
umask 000
cd /home/ftp/pub/security/nss
gunzip all.tar.gz
tar xf all.tar
rm  all.tar.gz all.tar
ls -l


git-svn-id: svn://10.0.0.236/trunk@107938 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 01:30:21 +00:00
shanjian%netscape.com
805f57c60f #108012 text measurment on win xp have problem with unicode while word-spacing and letter-spacing is present
r= smontagu sr=attinasi


git-svn-id: svn://10.0.0.236/trunk@107934 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 00:51:22 +00:00
av%netscape.com
04e70594d1 Bug 109041 -- adding call to NPP_SetWindow for windowless plugins on paint event, patch by dbrittain@superscape.com, r=av, sr=beard
git-svn-id: svn://10.0.0.236/trunk@107933 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 00:30:44 +00:00
sspitzer%netscape.com
53271138d8 more work on #73868. converting ab from tree to outliner.
NOT PART OF THE BUILD


git-svn-id: svn://10.0.0.236/trunk@107932 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 00:16:18 +00:00
sspitzer%netscape.com
e8b3e5a4d2 fix for #109278. can't edit existing addressbook cards.
r/sr=bienvenu


git-svn-id: svn://10.0.0.236/trunk@107931 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-13 00:13:15 +00:00
smontagu%netscape.com
9d803d9084 Recheckin of fix to bug 104792, which was killed by checkin on bug 104874. r=rods, sr=attinasi
git-svn-id: svn://10.0.0.236/trunk@107930 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 22:31:32 +00:00
seawood%netscape.com
1a286497ca Since we automatically generate the toplevel configure, make RUN_AUTOCONF_LOCALLY *always* remove all of the configure files before pulling and regenerate them after pulling.
Bug #47989 r=mkaply


git-svn-id: svn://10.0.0.236/trunk@107929 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 21:57:55 +00:00
smontagu%netscape.com
df20575389 To fix Mac bustage
git-svn-id: svn://10.0.0.236/trunk@107928 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 21:40:03 +00:00
sspitzer%netscape.com
50fef1cc5e partial fix for #108751.
the SearchDialog no longer includes dialogOverlay.xul, so this function is not defined.

r/sr=bienvenu


git-svn-id: svn://10.0.0.236/trunk@107927 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 21:03:10 +00:00
smontagu%netscape.com
5005056c08 Fix for bug 81773: Bidi XUL text (e.g. bookmarks, tab titles) was flipping to and fro on systems without native Bidi support. r=mkaply, r/sr=hyatt, sr=attinasi
git-svn-id: svn://10.0.0.236/trunk@107926 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 20:51:48 +00:00
kaie%netscape.com
0ba5bc52ae b=108735 Fix large blank space in cert manager
r=kaie sr=hewitt


git-svn-id: svn://10.0.0.236/trunk@107925 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 20:29:31 +00:00
seawood%netscape.com
43d2254ded Use proper module name for smime & make local function static.
Fixing static build bustage
Bug #109575 r=bryner sr=waterson


git-svn-id: svn://10.0.0.236/trunk@107924 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 20:16:48 +00:00
relyea%netscape.com
b1be3f4016 1) bug 95135 - DSA key fails 1 out of 8 times, causing intermitant
test failures.

Fix: use the Signed attribute to store the key as well as look it up.

2) Fix code so that looking up a public key won't crash if it can't find the
corresponsing private key in the database (found by code inspection).


git-svn-id: svn://10.0.0.236/trunk@107923 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 17:59:45 +00:00
ccarlen%netscape.com
6105575789 Bug 108383 - no user prefs if starting mozilla with -p. r=bnesse/sr=alecf
git-svn-id: svn://10.0.0.236/trunk@107922 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 15:52:58 +00:00
jake%acutex.net
9b3a845780 Fix for bug 86300 - If a bug didn't exist and GetBugLink() tried to create a tooltip for it, you'd get uninitialized variables warnings in your error log. This path also introduces a cache so if the same bug # is mentioned more than once during the same running of the script, it only has to query the database once.
r= mattyt, gerv


git-svn-id: svn://10.0.0.236/trunk@107921 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 13:43:59 +00:00
sspitzer%netscape.com
b1ff4140ee more changes for converting addressbook results pane from tree to outliner.
NOT PART OF THE BUILD.


git-svn-id: svn://10.0.0.236/trunk@107920 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 12:28:38 +00:00
ben%netscape.com
70aa6dba85 Adding Download Manager component & initial interface, datasource, etc.
not part of build


git-svn-id: svn://10.0.0.236/trunk@107918 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 08:57:42 +00:00
hyatt%netscape.com
a686fc891b Fix to convert property to field. 106153. r=hixie, sr=hewitt
git-svn-id: svn://10.0.0.236/trunk@107917 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 07:28:30 +00:00
bbaetz%cs.mcgill.ca
58006fb10f Oops. Bug 109690 again, r=justdave, gerv
git-svn-id: svn://10.0.0.236/trunk@107916 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 05:47:24 +00:00
bbaetz%cs.mcgill.ca
c2a13c0ac1 Bug 109690: Check $bug before using it.
r=justdave,gerv


git-svn-id: svn://10.0.0.236/trunk@107915 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 05:39:14 +00:00
kaie%netscape.com
50d50d5f9c b=103198 Make sure master preferences panel fits.
r=kaie sr=blizzard


git-svn-id: svn://10.0.0.236/trunk@107913 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 05:07:23 +00:00
kaie%netscape.com
9a8dea60ee b=108625 Fix regression / XUL value attribute assignment
r=ddrinan sr=blizzard


git-svn-id: svn://10.0.0.236/trunk@107912 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 04:57:53 +00:00
rweltman%netscape.com
f244ffbdd6 Use explicit imports
git-svn-id: svn://10.0.0.236/trunk@107908 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 01:32:07 +00:00
rweltman%netscape.com
035ed46bb5 Use real javax.security.sasl package instead of Sun preview
git-svn-id: svn://10.0.0.236/trunk@107907 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 01:31:41 +00:00
rweltman%netscape.com
85b98e0160 Added sasl.jar and jnet.jar to the build CLASSPATH
git-svn-id: svn://10.0.0.236/trunk@107906 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 01:29:33 +00:00
peterv%netscape.com
39d48aedbb Fixing up users of implicit |CharT*| conversion operators for nsCString to use |.get()| instead. Not part of the build. r=jag, rs=scc.
git-svn-id: svn://10.0.0.236/trunk@107905 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 01:22:31 +00:00
rweltman%netscape.com
62a52afd0c November 11, 2001 implementation of javax.security.sasl
git-svn-id: svn://10.0.0.236/trunk@107904 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-12 00:58:53 +00:00
bzbarsky%mit.edu
8a3a1251d3 Fix pasting into password boxes with middle-mouse paste. Bug 109520,
r=fabian, sr=jst


git-svn-id: svn://10.0.0.236/trunk@107902 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 22:52:18 +00:00
seawood%netscape.com
c2069142e7 Add xpcom/glue
git-svn-id: svn://10.0.0.236/trunk@107901 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 22:46:29 +00:00
brendan%mozilla.org
589201c307 Avoid ClaimScope (lock-free to -full transition) in JS_GetClass and js_FinalizeObject called from the GC (109183, r=shaver, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@107900 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 21:25:13 +00:00
dbaron%fas.harvard.edu
3d164442b1 Attempt to fix HP runtime bustage. b=83836
git-svn-id: svn://10.0.0.236/trunk@107899 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 20:46:42 +00:00
peterv%netscape.com
46a634bc19 Adding namespaces and tbodies. Testcase, not part of the build. r=sicking.
git-svn-id: svn://10.0.0.236/trunk@107898 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 20:40:56 +00:00
dbaron%fas.harvard.edu
70936bf2ff Fix nsDependentString assertions when using history window, part 2. b=109172 r=jag sr=alecf
git-svn-id: svn://10.0.0.236/trunk@107897 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 20:37:53 +00:00
jband%netscape.com
aa380de8e9 fix bug 106122. build xpt file search path based on NS_XPCOM_COMPONENTS_DIR *and* NS_APP_PLUGINS_DIR_LIST. Also, correctly detect that search path has changed - even when the change is just appended items. r=ccarlen sr=jst.
git-svn-id: svn://10.0.0.236/trunk@107895 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 19:01:00 +00:00
sicking%bigfoot.com
b474cb8a97 [Not part of build]
Make standalone TransforMiiX build again. Fix merge-conflict resolved the wrong way.

No bug. r=hwaara.


git-svn-id: svn://10.0.0.236/trunk@107894 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 17:40:44 +00:00
ian%hixie.ch
2f70d2e668 Some very primitive default HTML output files for login.accessDenied and login.detailsSent.
git-svn-id: svn://10.0.0.236/trunk@107893 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 15:37:48 +00:00
ian%hixie.ch
b7cb0633c4 We should be able to access strings with uppercase letters -- oops. Changing regexp to include 'A-Z' as well as 'a-z'. Also adding a dump statement in the failure case to help when analysing the log looking for a bug.
git-svn-id: svn://10.0.0.236/trunk@107892 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 15:33:59 +00:00
ian%hixie.ch
cac8ba4310 Missed a return statement in the setupInstall method. This was causing setup to fail every time, because the function returned a defined value. Also took the opportunity to add a call to setupProgress.
git-svn-id: svn://10.0.0.236/trunk@107891 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 11:54:06 +00:00
ian%hixie.ch
87506d5097 Missed a return statement in the setupInstall method. This was causing setup to fail every time, because the function returned a defined value.
git-svn-id: svn://10.0.0.236/trunk@107890 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 11:48:14 +00:00
ian%hixie.ch
3176c0d2a4 Should have been checking for a defined value, not a true value -- there is nothing to stop a failure from being '0', for instance. (The important thing is to be consistent with the SelectingServiceList code, really, and it uses defined().)
git-svn-id: svn://10.0.0.236/trunk@107889 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 11:47:02 +00:00
seawood%netscape.com
0d2c3d6058 more beos bustage fixing
git-svn-id: svn://10.0.0.236/trunk@107888 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 09:43:48 +00:00
ian%hixie.ch
ba16dd127e Implement a module to give the main application the ability to add rights and do other configuration related stuff.
git-svn-id: svn://10.0.0.236/trunk@107887 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 09:36:02 +00:00
mcafee%netscape.com
90735d6f61 Switching to arg form of system call to avoid security hole (76109)
git-svn-id: svn://10.0.0.236/trunk@107886 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 09:08:56 +00:00
mcafee%netscape.com
943edc668f typo! fixes bug
git-svn-id: svn://10.0.0.236/trunk@107884 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 08:30:21 +00:00
morse%netscape.com
7b7937b807 bug 109411, prevent malloc of 0, c=pedemonte, r=morse, sr=alecf
git-svn-id: svn://10.0.0.236/trunk@107883 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 08:27:05 +00:00
seawood%netscape.com
572298288c Fixing beos bustage. who needs the lxr lesson?
git-svn-id: svn://10.0.0.236/trunk@107882 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 08:26:18 +00:00
ian%hixie.ch
e1e5a2a6f1 Mute the Net::AIM warnings and add some null-checking code to the close() method.
git-svn-id: svn://10.0.0.236/trunk@107881 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 08:08:26 +00:00
blakeross%telocity.com
0744b9ee00 changing timeout to 0, r/sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@107874 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 04:41:48 +00:00
blakeross%telocity.com
8c11ea56e0 73748 - Stop loading nsJSSupportsUtils.js and nsJSComponentManager.js on startup. r=hewitt sr=ben
git-svn-id: svn://10.0.0.236/trunk@107873 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 04:20:01 +00:00
ian%hixie.ch
7dc7a687d2 First stab at primitive AIM output support as an alternative to e-mail.
git-svn-id: svn://10.0.0.236/trunk@107872 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 04:18:09 +00:00
bzbarsky%mit.edu
0220720066 Fixing bogus indentation that I missed (checked in old version of
patch). bug 84599 reprise, r=glazou, sr=attinasi (still).


git-svn-id: svn://10.0.0.236/trunk@107871 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 03:56:49 +00:00
bryner%netscape.com
36c48a1f6a Fixing startup crash. sr=hyatt.
git-svn-id: svn://10.0.0.236/trunk@107869 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 02:48:05 +00:00
dbaron%fas.harvard.edu
cbbd6fb539 Bug 53057: Fixing up users of implicit |CharT*| conversion operators for nsCString to use |.get()| instead, rr=jag, rs=scc
git-svn-id: svn://10.0.0.236/trunk@107868 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 01:57:33 +00:00
dbaron%fas.harvard.edu
52148e4d9c Bug 53057: Fixing up users of implicit |CharT*| conversion operators for nsCString to use |.get()| instead, rr=jag, rs=scc
git-svn-id: svn://10.0.0.236/trunk@107867 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 01:52:04 +00:00
dbaron%fas.harvard.edu
67028224e2 Bug 53057: Fixing up users of implicit |CharT*| conversion operators for nsCString to use |.get()| instead, rr=jag, rs=scc
git-svn-id: svn://10.0.0.236/trunk@107866 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 01:42:10 +00:00
dbaron%fas.harvard.edu
01e7c5fab7 Avoid applying all default rendering of HTML's table element to anonymous table objects. b=72358 r=hixie sr=attinasi
git-svn-id: svn://10.0.0.236/trunk@107865 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 01:35:25 +00:00
dbaron%fas.harvard.edu
278dd22f03 Fix nsDependentString assertions when using history window. b=109172 r=jag rs=scc
git-svn-id: svn://10.0.0.236/trunk@107864 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 01:27:30 +00:00
bryner%netscape.com
b142df599a added files: mozilla/content/xbl/src/nsXBLPrototypeResources.cpp, mozilla/content/xbl/src/nsXBLResourceLoader.cpp
git-svn-id: svn://10.0.0.236/trunk@107863 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 01:21:33 +00:00
waterson%netscape.com
06395bc517 Bug 109143. Search datasource should return a valid result set from GetTargets now that we're suppressing re-entrant content builds. r=rjc, sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@107862 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 01:16:08 +00:00
hyatt%netscape.com
6ab421ca7c Fix for 106153, dont build a content model for XBL <resources>, r=bryner, sr=jst
git-svn-id: svn://10.0.0.236/trunk@107861 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 01:15:22 +00:00
ian%hixie.ch
79a6f20984 Fix typo (PLIFF->PLIF)
git-svn-id: svn://10.0.0.236/trunk@107860 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 00:58:48 +00:00
pete%alphanumerica.com
6ca4d43048 b=53596, r=dougt, sr=brendan
nsLocalFileUnix fix for ::GetLeafName not working on relative paths

--pete


git-svn-id: svn://10.0.0.236/trunk@107859 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 00:15:28 +00:00
ian%hixie.ch
52581f47aa Fix the DESTROY method to actually call the close() method like it was supposed to.
git-svn-id: svn://10.0.0.236/trunk@107858 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-11 00:14:07 +00:00
dbaron%fas.harvard.edu
9527b379c7 Fix bustage. b=109165
git-svn-id: svn://10.0.0.236/trunk@107857 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 23:55:36 +00:00
dbaron%fas.harvard.edu
e619d6fc7c Pull computation of loop invariants for rule matching out of outer loop (over rule processors) as well, from SelectorMatchesData in nsCSSStyleSheet to RuleProcessorData in nsStyleSet. Use the RuleProcessorData structure in nsHTMLStyleSheet as well. Simplify matching of :-moz-bound-element pseudo-class. b=83836 r=waterson, pierre sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@107856 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 23:51:45 +00:00
dbaron%fas.harvard.edu
7a3e6639d5 Tweak XP_MACOSX ifdefs to fix keyboard shortcuts (partly), context menus, and hidden window behavior and build the mac classic skin in the Mach-O build. b=109165 r=pinkerton sr=beard
git-svn-id: svn://10.0.0.236/trunk@107855 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 23:30:13 +00:00
jband%netscape.com
37eba2b798 not part of build. Now that null DOM strings are correctly supported we can fix the test case
git-svn-id: svn://10.0.0.236/trunk@107854 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 22:35:26 +00:00
jaggernaut%netscape.com
e377996066 Bug 53057: Fixing up users of implicit |CharT*| conversion operators for nsCString to use |.get()| instead, rr=dbaron, rs=scc
git-svn-id: svn://10.0.0.236/trunk@107853 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 22:20:21 +00:00
ian%hixie.ch
3a9a356b60 Change the order of the settings so as to match the order in which they are requested. This causes the error message to mention the setting that the user aborted on, instead of some random later setting.
git-svn-id: svn://10.0.0.236/trunk@107852 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 22:06:54 +00:00
ian%hixie.ch
30f7d9e23f Change createArgument so that we drop the default on the floor -- the default should only be used when explicitly requested (e.g. by the user in interactive mode), not in all cases. CommandLine.pm was in fact already assume that this was the case.
git-svn-id: svn://10.0.0.236/trunk@107851 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 22:04:34 +00:00
jaggernaut%netscape.com
85bf8c8fb4 Bug 53057: Removing implicit |CharT*| conversion operator for nsCString, r=dbaron, rs=scc
git-svn-id: svn://10.0.0.236/trunk@107850 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 22:00:31 +00:00
ian%hixie.ch
38d0af9333 Switching to batch mode involves changing the 'batch' argument, not the one being requested... ahem.
git-svn-id: svn://10.0.0.236/trunk@107849 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 21:59:13 +00:00
ian%hixie.ch
e7f0b0e6e4 Bracket shuffling to fix a warning in Perl 5.0.x.
git-svn-id: svn://10.0.0.236/trunk@107848 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 21:57:07 +00:00
ian%hixie.ch
d793a48053 Handle the case where the user hits Ctrl+D during input, and the case where the user piped a file into us and the file was too short.
git-svn-id: svn://10.0.0.236/trunk@107847 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 21:53:49 +00:00
ian%hixie.ch
c56420bdaf Correct an error in the default handler of the namespaced XML walker: we have to shift out the first argument otherwise weird things will naturally happen.
git-svn-id: svn://10.0.0.236/trunk@107846 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 21:44:28 +00:00
jaggernaut%netscape.com
edf1c61246 Bug 15050: page load shouldn't overwrite text typed into the url bar. r=hewitt, sr=ben
git-svn-id: svn://10.0.0.236/trunk@107845 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 21:38:28 +00:00
ian%hixie.ch
7d3015eda3 The User object was not saving anything if its userID started off as undef (i.e., new user) and the code never changed any properties (which is normal for a new user). Changed the code to automatically assume it is dirty if it starts with an undefined userID. Changed writeProperties to use the return value from the data source to save any changes to userID, so that when it is defined (by inserting a new record, probably) then we can remember it. Finally, changed propertySet so that when userID is changed from an undefined value to a defined value, the change is propagated to the fields and the groups are marked dirty, which will force them to be written out too.
git-svn-id: svn://10.0.0.236/trunk@107843 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 21:00:37 +00:00
ian%hixie.ch
85565622cc Fix the output template to support multiple authentication protocols now that the code is not lying about that.
git-svn-id: svn://10.0.0.236/trunk@107842 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 20:55:39 +00:00
ian%hixie.ch
6c7a644159 Changed a comment in UserField.pm to be more accurate: it is actually safe to change the userID on the fly from an undefined value to a defined value because the code only uses it at two points: creation, if it was defined (used by the caller) and destruction (at which point it is passed to the data source to save any changes).
git-svn-id: svn://10.0.0.236/trunk@107841 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 20:53:37 +00:00
ian%hixie.ch
1c45721015 s/smtp/email/go -- have to be consistent with the rest of the code\!
git-svn-id: svn://10.0.0.236/trunk@107840 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 20:46:29 +00:00
ian%hixie.ch
6738fc00b6 Return the user ID even when the user exists, so that there is no need for callers to check the return value.
git-svn-id: svn://10.0.0.236/trunk@107839 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 20:43:44 +00:00
ian%hixie.ch
b4a63e1b65 Fixing ill-formedness error.
git-svn-id: svn://10.0.0.236/trunk@107838 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 20:34:00 +00:00
mcafee%netscape.com
02e56d096c fixing perl error
git-svn-id: svn://10.0.0.236/trunk@107837 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 20:21:38 +00:00
mcafee%netscape.com
ec2a2ad12c Switching to proper log-header variable
git-svn-id: svn://10.0.0.236/trunk@107836 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 19:26:42 +00:00
gerv%gerv.net
114dd11eed Bug 108177 - change Henrik Gemal's email address to mozilla@gemal.dk . r=gerv, auto-sr=brendan. Comment changes only.
git-svn-id: svn://10.0.0.236/trunk@107835 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 19:10:40 +00:00
waterson%netscape.com
ca9282e17c Bug 109505. Dumb typo. Use iterator variable when looking for template builder.
git-svn-id: svn://10.0.0.236/trunk@107834 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 18:45:02 +00:00
loadrunner%betak.net
3c651c0153 bug 64146, Delay nsCharsetMenu initialization to avoid consuming ~2% of startup time, r=dp, sr=brendan,alecf (this file didn't make it into M096)
git-svn-id: svn://10.0.0.236/trunk@107833 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 17:39:50 +00:00
bzbarsky%mit.edu
7d6358f8fc Fix getComputedStyle() position/size calculations. Bug 84599 and bug
94855, r=glazou, sr=attinasi


git-svn-id: svn://10.0.0.236/trunk@107832 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 17:29:04 +00:00
alecf%netscape.com
4fda431336 NOT PART OF BUILD
for bug 102043 and bug 71482 - update nsHistoryLoadListener to support redirected URLs, and to update titles through nsIBrowserHistory


git-svn-id: svn://10.0.0.236/trunk@107831 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 16:37:19 +00:00
ian%hixie.ch
4b6476a5c9 implemented getFieldNamesByCategory() in the user data source, and used it to fill in the list of contact methods for the loginFailed output handler.
git-svn-id: svn://10.0.0.236/trunk@107830 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 10:55:33 +00:00
ian%hixie.ch
be63bbfcfc Made the phrase 'or to have your password sent to you,' appear regardless of the value of data.tried
git-svn-id: svn://10.0.0.236/trunk@107829 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 10:51:10 +00:00
dp%netscape.com
d13f63a9db fixed dup printing
git-svn-id: svn://10.0.0.236/trunk@107828 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 09:18:45 +00:00
dp%netscape.com
29e6249ac1 first version
git-svn-id: svn://10.0.0.236/trunk@107827 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 08:54:53 +00:00
jst%netscape.com
0936a7cef0 Checking in Jonas Sicking's <sicking@bigfoot.com> fix for bug 109154. Make this code not suck as much, don't use GetPrimaryFrame() when there's no need to. r=jkeiser@iname.com, sr=jst@netscape.com
git-svn-id: svn://10.0.0.236/trunk@107826 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 08:25:16 +00:00
jkeiser%iname.com
ecfc39a688 Null-safety checks (bug 108808). r=rods@netscape.com, sr=kin@netscape.com
git-svn-id: svn://10.0.0.236/trunk@107825 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 07:45:15 +00:00
jst%netscape.com
ad66f47ab5 Checking in Fabian's <hidday@geocities.com> patch for bug 105640. Add support for IE's document.compatMode property. r=sicking@bigfoot.com, sr=jst@netscape.com
git-svn-id: svn://10.0.0.236/trunk@107824 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 07:36:19 +00:00
stephend%netscape.com
a7e8288316 Bug 107188. Help tooltip not correct or localizable. r=oeschger@netscape.com, sr=hewitt@netscape.com
git-svn-id: svn://10.0.0.236/trunk@107823 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 06:34:16 +00:00
ian%hixie.ch
5c49903375 Fix a typo on the To: line which was resulting in a blank To: field, made the Subject: line be dynamically generated, and made the text actually be useful.
git-svn-id: svn://10.0.0.236/trunk@107822 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 06:26:28 +00:00
mcafee%netscape.com
b418eb136e proper checking for scrape_builds data
git-svn-id: svn://10.0.0.236/trunk@107821 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 06:01:35 +00:00
ian%hixie.ch
77fb90f83b Oops, syntax error.
git-svn-id: svn://10.0.0.236/trunk@107820 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 05:21:17 +00:00
ian%hixie.ch
ab2a33bd20 Use the actual From: address (now that the outputter tells us what it is...).
git-svn-id: svn://10.0.0.236/trunk@107819 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 05:12:06 +00:00
ian%hixie.ch
7ba9f2d1c5 Added another set of data to the data hash: the outputter hash. This will be useful for strings that have to embed things like the e-mail address of the application itself. Added hash methods to the Email and Stdout generic outputter modules to support this change. Renamed 'from' to 'address' in the Email outputter to make it easier to reuse the code (hehe). Also, in the same module, changed some of the comments, changed a double quote string literal to a single quote string literal, and added the word 'configure' where it was missing in one of the dump statements.
git-svn-id: svn://10.0.0.236/trunk@107818 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 05:00:14 +00:00
bstell%netscape.com
2aec1606d4 bug 107019: anti-aliased glyph code
r=yokoyama@netscape.com, sr=blizzard@mozilla.org


git-svn-id: svn://10.0.0.236/trunk@107817 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 04:41:18 +00:00
bstell%netscape.com
811171d8cb bug 107019 anti-aliased glyph C++ object code
r=yokoyama@netscape.com, sr=blizzard@mozilla.org


git-svn-id: svn://10.0.0.236/trunk@107816 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 04:39:57 +00:00
bstell%netscape.com
f607d9793e bug 102133: fix 64 bit solaris crash
r=shanjian@netscape.com, sr=brendan@mozilla.org


git-svn-id: svn://10.0.0.236/trunk@107815 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 04:20:55 +00:00
sfraser%netscape.com
931a22f26b Fix the carbon build.
git-svn-id: svn://10.0.0.236/trunk@107814 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 03:28:05 +00:00
pschwartau%netscape.com
388f6c3fbb Fixing a typo.
git-svn-id: svn://10.0.0.236/trunk@107813 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 02:47:52 +00:00
pschwartau%netscape.com
df7a557ec3 Adding another case to test.
git-svn-id: svn://10.0.0.236/trunk@107812 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 02:46:24 +00:00
law%netscape.com
e9cd5892c6 New tools for measuring startup with a minimalist 'Navigator'
git-svn-id: svn://10.0.0.236/trunk@107811 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 02:40:13 +00:00
blakeross%telocity.com
3ec8782659 109207 - stop loading brand.dtd three additional times on startup. r=ben sr=hewitt
git-svn-id: svn://10.0.0.236/trunk@107809 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 01:51:44 +00:00
mcafee%netscape.com
776256bb10 Fixing tab makefile bustage
git-svn-id: svn://10.0.0.236/trunk@107808 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 01:33:55 +00:00
naving%netscape.com
43405e0d52 104504 r/sr=darin. Null out the listeners once we are done with read requests. This fixes
nsImapCacheStreamListener and nsNntpCacheStreamListener leaks.


git-svn-id: svn://10.0.0.236/trunk@107807 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 01:13:06 +00:00
morse%netscape.com
d534e8ff3c bug 68136, full screen mode, r/sr=ben/alecf
git-svn-id: svn://10.0.0.236/trunk@107806 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 01:12:37 +00:00
rbs%maths.uq.edu.au
e929b26421 fix typo that caused font download to stop working. b=106633 r=yokoyama s=waterson
git-svn-id: svn://10.0.0.236/trunk@107805 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 01:10:39 +00:00
sfraser%netscape.com
4129548ff2 Change to convert Widget and Gfx into component DLLs on Mac, bug 94434. r=pchen, sr=beard/darin
git-svn-id: svn://10.0.0.236/trunk@107804 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 01:05:03 +00:00
morse%netscape.com
e37ddd0cda bug 109325, crash in cookie module, r=ccarlen, sr=alecf
git-svn-id: svn://10.0.0.236/trunk@107803 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 00:58:59 +00:00
curt%netscape.com
943b0a4c74 Moved upgradeClean ahead of file copy.
git-svn-id: svn://10.0.0.236/trunk@107801 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 00:41:16 +00:00
mscott%netscape.com
99bf7967f4 remove a define DEBUG_rhp from the makefile
git-svn-id: svn://10.0.0.236/trunk@107800 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 00:36:14 +00:00
mscott%netscape.com
16c2639a60 remove a define DEBUG_rhp from the make project.
git-svn-id: svn://10.0.0.236/trunk@107799 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 00:35:51 +00:00
pchen%netscape.com
cd45b13677 bug 107900, r=jag, sr=ben, add toolbarbutton and button to lazy elements
that don't have their contents built right away


git-svn-id: svn://10.0.0.236/trunk@107798 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 00:13:24 +00:00
mscott%netscape.com
96abba64cb fix mac build.
git-svn-id: svn://10.0.0.236/trunk@107797 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 00:13:19 +00:00
pchen%netscape.com
ecf432b21f bug 107900, r=jag, sr=ben, add toolbarbutton xul atom
git-svn-id: svn://10.0.0.236/trunk@107796 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 00:10:20 +00:00
pchen%netscape.com
aa3b124b3f bug 107900, r=jag, sr=ben, return true if we loaded bookmarks, otherwise
return false


git-svn-id: svn://10.0.0.236/trunk@107795 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 00:08:42 +00:00
pchen%netscape.com
1ab984a1af bug 107900, r=jag, sr=ben, return bool from ReadBookmarks()
git-svn-id: svn://10.0.0.236/trunk@107794 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 00:07:51 +00:00
waterson%netscape.com
807c7a00e9 Bug 106749. Make sure template builder only tries to build content if it's the _closest_ builder to the lazy node. r=rjc, sr=shaver
git-svn-id: svn://10.0.0.236/trunk@107793 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 00:06:08 +00:00
waterson%netscape.com
ed486643da Bug 105068. Oops, I mean to remove this.
git-svn-id: svn://10.0.0.236/trunk@107792 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 00:04:47 +00:00
waterson%netscape.com
f02192bdee Bug 108775. Don't broadcast |id|, |ref|, or |persist| attributes. Avoid re-entrancy when restoring persisted attributes. r=jag, sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@107791 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-10 00:03:53 +00:00
nhotta%netscape.com
c1c9f64869 Changed to use local stack for charset conversion util functions, bug 108914, r=ducarroz, sr=sspitzer.
git-svn-id: svn://10.0.0.236/trunk@107790 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 23:57:15 +00:00
nhotta%netscape.com
65516669cc Changed to use local stack for message body charset conversion, bug 108749, r=ducarroz, sr=sspitzer.
git-svn-id: svn://10.0.0.236/trunk@107789 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 23:56:19 +00:00
mscott%netscape.com
ef3625406f Bug #108960 --> get rid of some obsolete CSS rules to make this file load
faster and help message display.
rs=sspitzer


git-svn-id: svn://10.0.0.236/trunk@107788 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 23:54:34 +00:00
mscott%netscape.com
c4e2261977 Bug #108761 --> override globalEditMenuItems and selectEditMenuItems so
with our own custom event so we can reduce the amount of command updating
they were doing during message display.
r=bienvenu
sr=sspitzer


git-svn-id: svn://10.0.0.236/trunk@107787 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 23:53:16 +00:00
mscott%netscape.com
60cfbceeb2 Bug #109134 --> optimize our CSS by using .classname instead of tagname.class name
for a couple styles.
r=bienvenu
sr=sspitzer


git-svn-id: svn://10.0.0.236/trunk@107786 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 23:50:38 +00:00
sicking%bigfoot.com
33dadb9240 Bug 95779 - Key cached expressions and patterns on node they appear in rather then string.
r=Pike sr=jst


git-svn-id: svn://10.0.0.236/trunk@107785 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 23:46:36 +00:00
mscott%netscape.com
45d499f29b Bug #108635 --> disable session and global history for the message pane. This helps improve
message display time.
r=jag/mscott
sr=hewitt


git-svn-id: svn://10.0.0.236/trunk@107784 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 23:41:08 +00:00
mscott%netscape.com
a38b60f537 Bug #108635 --> add ability to disable global and session history.
r=jag/mscott
sr=hewitt


git-svn-id: svn://10.0.0.236/trunk@107783 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 23:39:56 +00:00
despotdaemon%netscape.com
e5b0c39cc0 Pseudo-automatic update of changes made by knous@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@107782 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 23:38:25 +00:00
sicking%bigfoot.com
09b20ef1df Bug 105979 - Cleanup NodeSetFunctionCall and Tokenizer classes
r=Pike,peterv sr=jst


git-svn-id: svn://10.0.0.236/trunk@107781 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 23:34:06 +00:00
mscott%netscape.com
3352b66874 Bug #22960 --> broadcast all the headers at once instead of individually.
if not in view all headers mode, only send out the headers we need. This helps
message display performance.
r=ducarroz
sr=sspitzer


git-svn-id: svn://10.0.0.236/trunk@107780 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 23:31:54 +00:00
tao%netscape.com
723fd0db48 report ui language and country code in test program (not part of client).
git-svn-id: svn://10.0.0.236/trunk@107779 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 22:57:30 +00:00
ian.mcgreer%sun.com
a508954d9b construct salt and password buffers for PBE correctly
git-svn-id: svn://10.0.0.236/trunk@107778 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 22:51:42 +00:00
shrutiv%netscape.com
c41f9aa079 Removing extra CR's
git-svn-id: svn://10.0.0.236/trunk@107777 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 22:12:00 +00:00
ian%hixie.ch
76152f2135 Implement some primitive error handling for sending mail.
git-svn-id: svn://10.0.0.236/trunk@107776 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 21:59:21 +00:00
relyea%netscape.com
376653238f Rewrite Ian's get cert by email address to use the standard cert searching code.
git-svn-id: svn://10.0.0.236/trunk@107775 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 21:43:18 +00:00
mcafee%netscape.com
bf8a257f80 Adding scrapebuilds.pl check
git-svn-id: svn://10.0.0.236/trunk@107774 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 21:37:02 +00:00
mcafee%netscape.com
34578d29a0 Adding scrape_builds
git-svn-id: svn://10.0.0.236/trunk@107773 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 21:35:25 +00:00
mcafee%netscape.com
b285a9e360 Adding scrapebuilds toggle ui
git-svn-id: svn://10.0.0.236/trunk@107772 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 21:32:41 +00:00
mcafee%netscape.com
ff7f60b684 Adding scrapebuilds.pl
git-svn-id: svn://10.0.0.236/trunk@107771 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 21:31:19 +00:00
ian%hixie.ch
8429169df5 Removing unnecessary spammy debug output (this code works now... honest\!)
git-svn-id: svn://10.0.0.236/trunk@107770 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 21:22:32 +00:00
ian%hixie.ch
3d2d5f544f Decode %XX-encoded strings.
git-svn-id: svn://10.0.0.236/trunk@107769 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 21:19:59 +00:00
javi%netscape.com
a6f1ecb450 Fixing typo
git-svn-id: svn://10.0.0.236/trunk@107766 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 21:14:07 +00:00
javi%netscape.com
529933e14f Bug 106507
Enable S/MIME for users that are already building PSM.


git-svn-id: svn://10.0.0.236/trunk@107765 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 20:45:47 +00:00
kaie%netscape.com
2c948ee683 build smime if MOZ_PSM is defined
a=leaf


git-svn-id: svn://10.0.0.236/trunk@107764 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 20:45:36 +00:00
mscott%netscape.com
e6bb9498ee build smime if psm2 is defined.
a=leaf


git-svn-id: svn://10.0.0.236/trunk@107763 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 20:26:40 +00:00
ian%hixie.ch
f6dff658e9 Added some more comments that might help people get this working on Apache.
git-svn-id: svn://10.0.0.236/trunk@107762 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 20:23:42 +00:00
ian%hixie.ch
0b383c1d78 Factored out the connect/disconnect code, added settings for the host and the from address and made them be handled by a setup.configure handler, wrapped the call to Net::SMTP->new() in a warning-free block.
git-svn-id: svn://10.0.0.236/trunk@107761 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 20:21:11 +00:00
ian%hixie.ch
3443dd9f0e Adding support for generic saving and retrieving of settings.
git-svn-id: svn://10.0.0.236/trunk@107760 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 20:13:21 +00:00
ian%hixie.ch
7b02c6d19e Adding a comment on the use of assert()
git-svn-id: svn://10.0.0.236/trunk@107759 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 20:09:22 +00:00
rweltman%netscape.com
391019dc2c Call Vector.removeAllElements() instead of Vector.clear() to allow compilation and execution with JDK 1.1.x (Bugzilla bug 107830)
git-svn-id: svn://10.0.0.236/trunk@107758 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 19:57:54 +00:00
dp%netscape.com
8a40115287 Better usage message. Ability to take args.
git-svn-id: svn://10.0.0.236/trunk@107757 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 19:16:04 +00:00
ian%hixie.ch
de07b8d410 Refactored the Database::DBI code. Added support for default values in the setup code. Added support to create the database and the user (although some of this may need refactoring into separate MySQL submodules).
git-svn-id: svn://10.0.0.236/trunk@107756 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 17:23:41 +00:00
ian%hixie.ch
a674a12422 Changing the order of loaded modules to make sure they are set up in the right order.
git-svn-id: svn://10.0.0.236/trunk@107755 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 17:16:50 +00:00
ian%hixie.ch
64d32bc1a9 Added a missing 'return' statement so that the user.fields setup routine doesn't appear to have failed when it hasn't (without a return statement, the value of the last statement is the return value).
git-svn-id: svn://10.0.0.236/trunk@107754 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 17:15:13 +00:00
ian%hixie.ch
ab6ec76c4d Changed the DESTROY method to make sure it calls its parent.
git-svn-id: svn://10.0.0.236/trunk@107753 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 17:13:27 +00:00
ian%hixie.ch
18252bc48b Added support for printing the default value for requests.
git-svn-id: svn://10.0.0.236/trunk@107752 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 17:12:18 +00:00
ian%hixie.ch
9ff7bb94ea Added the ability to find the length of an array (array.length to go with array.0, array.1, etc). Added assertions to handle the case of invalid order or sort attributes on <set>. Added two new sort types ('default' and 'reverse default').
git-svn-id: svn://10.0.0.236/trunk@107751 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 17:10:22 +00:00
ian%hixie.ch
e819a06972 Added two assertions to make sure the handle is defined before using it, and added a check that the handle is defined before releasing it. Also changed the DESTROY method to call its parent.
git-svn-id: svn://10.0.0.236/trunk@107750 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 17:07:18 +00:00
ian%hixie.ch
ca0cb58027 Removing excess trailing spaces on one line, and moving a warn from level 5 ('important events') to level 8 ('frequent important events').
git-svn-id: svn://10.0.0.236/trunk@107749 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 17:03:40 +00:00
ian%hixie.ch
7474ccc4a0 Fixed DESTROY method to make sure it calls its parent.
git-svn-id: svn://10.0.0.236/trunk@107748 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 17:00:28 +00:00
ian%hixie.ch
ba894a2d01 Removing the @arguments array from a dump statement, because if any of the elements in the array are undef then a runtime warning is printed (undef elements is not always a bug).
git-svn-id: svn://10.0.0.236/trunk@107747 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 16:58:38 +00:00
ian%hixie.ch
ad6449583d Added a level 5 dump indicating the completion of the PLIF program.
git-svn-id: svn://10.0.0.236/trunk@107746 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 16:56:49 +00:00
dp%netscape.com
6a47e8068a secs not ms
git-svn-id: svn://10.0.0.236/trunk@107745 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 16:54:22 +00:00
ian%hixie.ch
33359b80b5 Fixed DESTROY method to make sure it called it's parent.
git-svn-id: svn://10.0.0.236/trunk@107744 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 16:52:08 +00:00
ian%hixie.ch
7e3afcf26f Change default DEBUG level from 9 to 4, which is what it should be in production releases. Added comments explaining debug levels 6 (reserved for personal use) and 8. Added level 10 debug info to the DESTROY method (makes it easier to track down bugs during shutdown).
git-svn-id: svn://10.0.0.236/trunk@107743 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 16:50:47 +00:00
ian.mcgreer%sun.com
3a136e2217 Output validated cert text to stdout, otherwise the QA scripts think there is a failure.
git-svn-id: svn://10.0.0.236/trunk@107742 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 16:40:26 +00:00
ian.mcgreer%sun.com
d014371d2d disabling cert cache (temporarily)
git-svn-id: svn://10.0.0.236/trunk@107741 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 16:39:34 +00:00
ian%hixie.ch
1da5e9e25e Made it so the setupEnding event is sent out after the setup failure message is printed but before the setup success message is printed (reduces the number of error messages if you cancel during setup). Changed the semantics of the output.progress string's data.component data. It is now a dotted hierarchical string giving progressively more detail about what is being set up. e.g., 'database', 'database.default.settings', 'database.default.settings.connection.port'. If outputters are interpreting data.component then any trailing unknown levels of detail should be ignored. This allows the setup routines to potentially give much more useful output. Fixed the default stdout output string for setup (it has <text variable=""> instead of value="").
git-svn-id: svn://10.0.0.236/trunk@107740 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 16:39:29 +00:00
blizzard%redhat.com
88f0c76909 null check in stack trace code so we don't crash on some systems. r=bryner, dbaron no bug number.
git-svn-id: svn://10.0.0.236/trunk@107737 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 16:18:56 +00:00
ccarlen%netscape.com
bd1340dc29 Bug 104021 - Profile mgr needs to put necko offline when switching profile. r=dougt,kaie/rs=darin/a=asa
git-svn-id: svn://10.0.0.236/trunk@107736 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 15:32:49 +00:00
kin%netscape.com
d7e3258a81 Fix for bug 106383: regression: new composer doc behaves as if empty
mozilla/editor/libeditor/html/nsHTMLDataTransfer.cpp
  mozilla/editor/libeditor/html/nsHTMLEditRules.cpp
  mozilla/editor/libeditor/html/nsHTMLEditRules.h
  mozilla/editor/libeditor/html/nsHTMLEditor.h
  mozilla/editor/libeditor/text/nsTextEditRules.h

    - Added nsHTMLEditRules::WillLoadHTML() which removes any mBogusNode.
    - Modified nsHTMLEditor::LoadHTML() to call Will/DidDoAction().
    - Changed all references of kOpHTMLLoad to kOpLoadHTML to match
      function name, and added kLoadHTML.

r=jfrancis.netscape.com  sr=sfraser.netscape.com  a=asa@mozilla.org


git-svn-id: svn://10.0.0.236/trunk@107735 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 15:16:03 +00:00
ian.mcgreer%sun.com
eaed36d3e2 fixes pk12util import failure
git-svn-id: svn://10.0.0.236/trunk@107734 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 14:52:19 +00:00
sicking%bigfoot.com
bc75854c14 Make checkboxes without value attribute work.
b=109122 r=bz sr=jst a=asa (for drivers)


git-svn-id: svn://10.0.0.236/trunk@107732 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 06:14:52 +00:00
nelsonb%netscape.com
b4a47a9861 Added a new -o option, to override check on received client auth certs,
forcing those certs to be OK.  -v will now test the SSL_LocalCertificate()
function.  Bug 78959.


git-svn-id: svn://10.0.0.236/trunk@107731 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 05:45:21 +00:00
nelsonb%netscape.com
f14f3467c1 Add code to test new SSL_LocalCertificate() function on first connection,
or on every connection if -vv option is used.  Bug 78959.
Also, the nickname "none" can now be used to prevent performing client
authentication without having to use an invalid password.


git-svn-id: svn://10.0.0.236/trunk@107730 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 05:43:06 +00:00
nelsonb%netscape.com
7e4958958b Add localCert field to sid cache entry so SSL_LocalCertificate can
remember the certs it sent back when it established the SSL session.
Bug 78959.  Also, hold on the certs in the received cert chain until
the SSL connection is complete.  This makes it easier for applications
to look at the entire cert chain after the handshake is over without
having to write their own custom authCert callbacks.  It is backwards
compatible with older NSS SSL applications, but may use more memory.


git-svn-id: svn://10.0.0.236/trunk@107729 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 05:39:36 +00:00
timeless%mac.com
01aa33c91c Bugzilla Bug 109138 platform detection not working on macintosh
r=bbaetz,dkl


git-svn-id: svn://10.0.0.236/trunk@107728 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 05:32:43 +00:00
beard%netscape.com
f512f2bbc3 [not part of build] Bumped version to 1.0d6.
git-svn-id: svn://10.0.0.236/trunk@107727 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 04:48:35 +00:00
morse%netscape.com
739bdf33c1 bug 109163, form-manager fields are shrunken, r=jag,sr=blake,a=asa
git-svn-id: svn://10.0.0.236/trunk@107726 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 04:01:11 +00:00
leaf%mozilla.org
2988195a61 Automated update
git-svn-id: svn://10.0.0.236/trunk@107724 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 03:13:03 +00:00
colin%theblakes.com
b6b0b8afda Make OpenVMS use MKSHLIB_[UN]FORCE_ALL. Remove other cruft that is now
no longer needed. b=108862 r=cls a/driver=asa


git-svn-id: svn://10.0.0.236/trunk@107722 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 03:06:36 +00:00
rweltman%netscape.com
3262a36397 Initial introduction to org.ietf.ldap
git-svn-id: svn://10.0.0.236/trunk@107721 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 01:54:26 +00:00
rweltman%netscape.com
f3926530d5 Initial checkin of org.ietf.ldap classes
git-svn-id: svn://10.0.0.236/trunk@107720 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 01:36:04 +00:00
rweltman%netscape.com
3cc7c008cd ant Makefile for ietfldap
git-svn-id: svn://10.0.0.236/trunk@107719 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 01:26:37 +00:00
relyea%netscape.com
cf843bc9b2 Fix reporting of the label
git-svn-id: svn://10.0.0.236/trunk@107718 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 01:23:47 +00:00
relyea%netscape.com
2abd5c3157 Fix Solaris crash.. don't send more of the template than we need
git-svn-id: svn://10.0.0.236/trunk@107717 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 01:22:48 +00:00
myk%mozilla.org
94f803c2c3 Fix for bug 109048: fixes error when creating attachments without logging in.
Patch by Myk Melez <myk@mozilla.org>.
r=bbaetz,gerv


git-svn-id: svn://10.0.0.236/trunk@107716 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 01:11:09 +00:00
sonja.mirtitsch%sun.com
d1a4dd4f04 fixed email header and tinderbox hyperlink
git-svn-id: svn://10.0.0.236/trunk@107715 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 01:09:17 +00:00
timeless%mac.com
0ff9eafab4 Bugzilla Bug 92533 Region selection button is hidden in Profile Manager
patch by jg@cyberstorm.demon.co.uk r=hwaara sr=ben a=asa


git-svn-id: svn://10.0.0.236/trunk@107714 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 01:07:55 +00:00
peterlubczynski%netscape.com
46a8719065 Mac fix for HTML embed region being painted the default background color bug 83159 r=av sr=sfraser a=asa
git-svn-id: svn://10.0.0.236/trunk@107713 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 00:42:02 +00:00
relyea%netscape.com
2391301a89 Update Library name to match the current library.
git-svn-id: svn://10.0.0.236/trunk@107712 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 00:38:03 +00:00
relyea%netscape.com
cdde8c7dd3 Fix NT process command to something that will work in our environment without requiring new tools.
git-svn-id: svn://10.0.0.236/trunk@107711 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 00:37:12 +00:00
ian.mcgreer%sun.com
d16299751e fips changes. forces login for cert listing.
git-svn-id: svn://10.0.0.236/trunk@107710 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 00:37:03 +00:00
ian.mcgreer%sun.com
1f69c02407 changes to get fips working
git-svn-id: svn://10.0.0.236/trunk@107709 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 00:36:12 +00:00
jband%netscape.com
861f4c54ac fix bug 108915 to unbust XPCOM_STANDALONE. This #ifdef's out calls into code that is only available when i18n is part of the build. This has no impact on the browser or gecko embeddings. r=jst sr=alecf a=blizzard
git-svn-id: svn://10.0.0.236/trunk@107708 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 00:34:56 +00:00
cmanske%netscape.com
ec47fc497c Removed duplicate declaration to make Advanced Edit dialog work, b=109085, r=brade, sr=kin, a=asa-drivers@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@107707 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-09 00:17:59 +00:00
shrutiv%netscape.com
715d7e0780 *** empty log message ***
git-svn-id: svn://10.0.0.236/trunk@107706 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 23:58:42 +00:00
brendan%mozilla.org
57a2bb6907 For now (0.9.6), str_replace requires an independent replacement string (108832, r=shaver, sr=jband, a=asa).
git-svn-id: svn://10.0.0.236/trunk@107705 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 23:53:33 +00:00
racham%netscape.com
fddea1c06c Fixing bug 108912. Opening the accountmanager window panel for any activity is having adverse affect on the smtp server of the associated identity. Fixing the situation to use the smtp server of the identity only when the key is valid. In all other cases, default smtp server will be used to send messages. r=ducarroz, sr=sspitzer, a=asa@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@107704 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 23:40:34 +00:00
beard%netscape.com
e7900f1871 [not part of build] Fix for bug #108054, guard against NULL url parameter.
git-svn-id: svn://10.0.0.236/trunk@107703 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 23:28:47 +00:00
roc+%cs.cmu.edu
57363b125c Fix for bug 108940. r=kmcclusk,sr=attinasi. Initialize nsZPlaceholderView correctly.
git-svn-id: svn://10.0.0.236/trunk@107702 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 23:11:01 +00:00
yokoyama%netscape.com
e3dca6f594 Bug 108712
ISO-8859-16 and Korean (ISO-2022-KR) menu
appears in the wrong submenu.
/r=nhotta; /a=asa


git-svn-id: svn://10.0.0.236/trunk@107701 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 23:05:30 +00:00
cmanske%netscape.com
8c7afa2b65 Fix cutoff of buttons in Spell Check (r=kin, sr=hewitt) and Image Properties (r=brade, sr=ben) dialogs, bugscape b=10888
git-svn-id: svn://10.0.0.236/trunk@107699 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 22:59:58 +00:00
yokoyama%netscape.com
60a2ffd6a1 Bug 108712
ISO-8859-16 and Korean (ISO-2022-KR) menu
appears in the wrong submenu.
/r=nhotta; /a=asa


git-svn-id: svn://10.0.0.236/trunk@107698 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 22:57:29 +00:00
morse%netscape.com
0e128015ac bug 109058, text missing in p3p dialog, r=blake, sr=alecf, a=asa
git-svn-id: svn://10.0.0.236/trunk@107697 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 22:51:18 +00:00
pinkerton%netscape.com
e679e16997 processing UI timers. [not part of build]
git-svn-id: svn://10.0.0.236/trunk@107696 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 22:21:27 +00:00
ian.mcgreer%sun.com
4cf69b3ce3 fix pbe gen bugs
git-svn-id: svn://10.0.0.236/trunk@107695 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 22:11:07 +00:00
tao%netscape.com
0d6a80a4bb 107375: localeVersion update: 0.9.4 -> 0.9.6 in the trunk.
(r=jbetak,sr=dveditz,a=asa), fix smime and ldap parts.


git-svn-id: svn://10.0.0.236/trunk@107694 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 21:50:50 +00:00
jst%netscape.com
0dc194375f Fixing compiler warning, unused variable (debug only). This was pointed out by hidday@geocities.com
git-svn-id: svn://10.0.0.236/trunk@107693 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 21:50:47 +00:00
pinkerton%netscape.com
b144b93211 Fixed up view offsets. Now can pass native NSView as parent for nsChildView for embedding. [not part of build]
git-svn-id: svn://10.0.0.236/trunk@107692 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 21:47:44 +00:00
attinasi%netscape.com
f06a7c002e New image for loading and broken images icons. b=108799 r=kmcclusk sr=waterson a=blizzard/drivers
git-svn-id: svn://10.0.0.236/trunk@107691 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 21:43:54 +00:00
attinasi%netscape.com
3d224b0911 New image for broken images icon. b=108799 r=kmcclusk sr=waterson a=blizzard/drivers
git-svn-id: svn://10.0.0.236/trunk@107690 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 21:37:24 +00:00
attinasi%netscape.com
f288530ace New image for loading images icon. b=108799 r=kmcclusk sr=waterson a=blizzard/drivers
git-svn-id: svn://10.0.0.236/trunk@107689 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 21:36:50 +00:00
ian.mcgreer%sun.com
c63b98c7eb get signtool working
git-svn-id: svn://10.0.0.236/trunk@107688 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 21:23:35 +00:00
mikep%oeone.com
f20b08f057 Fixed bug with having to specify your home directory.
git-svn-id: svn://10.0.0.236/trunk@107687 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 21:05:44 +00:00
bryner%netscape.com
127f609447 Initial checkin of mozilla-style Makefile.in's for calendar. r/a=mikep@oeone.com. Not part of the build.
git-svn-id: svn://10.0.0.236/trunk@107686 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 21:00:34 +00:00
ian.mcgreer%sun.com
90f3968ca4 a plethora of changes for handling S/MIME certs
git-svn-id: svn://10.0.0.236/trunk@107685 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 20:46:11 +00:00
evaughan%netscape.com
2bfeba936c bug fixes #107707, 108771, 108773
-r jag -sr hyatt -a asa


git-svn-id: svn://10.0.0.236/trunk@107684 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 20:46:02 +00:00
mkaply%us.ibm.com
861f679532 No bug
r=mkaply, sr=blizzard, a=asa for drivers
OS/2 only - lower tile buffer height and width so we won't tile progressive images


git-svn-id: svn://10.0.0.236/trunk@107683 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 20:36:26 +00:00
timeless%mac.com
59208ea8e0 Fixing bustage:
XML Parsing Error: mismatched tag. Expected: </page>.
Location: file:///mozilla/extensions/wallet/editor/WalletUrlspecific.xul
Line Number 114, Column 3: </window>
--^


git-svn-id: svn://10.0.0.236/trunk@107682 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 19:55:36 +00:00
bzbarsky%mit.edu
89020f859e Fix crash for ftp:// and file:// urls that have no useful extension and
binary data.  r=bbaetz, sr=mscott, a=asa


git-svn-id: svn://10.0.0.236/trunk@107681 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 19:05:22 +00:00
despotdaemon%netscape.com
90a6dfd82c Pseudo-automatic update of changes made by rweltman@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@107680 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 18:11:44 +00:00
ian%hixie.ch
0e1edf614f Also send default values to output.
git-svn-id: svn://10.0.0.236/trunk@107679 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 17:27:07 +00:00
ian%hixie.ch
738e081f7c Implement default values for arguments. getArgument() and createArgument() now take two parameters like setArgument(). Changed the CommandLine module's createArgument() method so that if the user hits enter at the prompt, the default value is used. Added some comments to clarify what is going on with the 'batch' argument. Changed setArgument() and createArgument() in the Arguments module and createArgument() in the CommandLine module to be more efficient (less array copying).
git-svn-id: svn://10.0.0.236/trunk@107678 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 17:09:11 +00:00
ian.mcgreer%sun.com
daed5695b8 fix for windows build
git-svn-id: svn://10.0.0.236/trunk@107677 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 16:59:00 +00:00
ian%hixie.ch
5741b48cad Adding comments to clearly indicate that no dump()s, warn()s or error()s should have a level lower than 5 unless they are not expected to occur during normal operation. Also changing the default level at which the user is notified of problems from 3 to 1.
git-svn-id: svn://10.0.0.236/trunk@107676 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 16:47:25 +00:00
ian%hixie.ch
822aa05814 Added two new hooks into the setup code: a start notification and an end notification. Added the ability to disable the string datasource (causes it to only use the default strings and not the database). Made the string datasource automatically disable itself during configuration, using the two hooks added to the setup code. This removes the warning messages that are output during a clean setup ('could not get string from database', etc).
git-svn-id: svn://10.0.0.236/trunk@107675 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 16:42:42 +00:00
ian.mcgreer%sun.com
492833f7cc use nsinstall not copy on windows
git-svn-id: svn://10.0.0.236/trunk@107674 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 16:20:54 +00:00
ian%hixie.ch
9cc94f02cd Improved error handling for the case where the database configuration doesn't exist and therefore every output attempt raises database errors. Fatal database errors are now fatal, missing database configurations is not. This would be a lot cleaner if Perl exceptions were objects... Also improved some of the error messages.
git-svn-id: svn://10.0.0.236/trunk@107673 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 16:10:21 +00:00
relyea%netscape.com
10748492f6 HP ans Solaris are still down...
git-svn-id: svn://10.0.0.236/trunk@107672 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 15:27:56 +00:00
relyea%netscape.com
992f3ed148 OK, try this again. FreeBL needs Get_Noise in the freebl .so on solaris, so
move the random number stuff there where it belongs.


git-svn-id: svn://10.0.0.236/trunk@107671 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 15:02:25 +00:00
blakeross%telocity.com
a55eb44974 108841 - can't create new news account. r=racham,jmkg sr=hewitt
git-svn-id: svn://10.0.0.236/trunk@107670 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 12:41:55 +00:00
leaf%mozilla.org
63f6ee74d5 Automated update
git-svn-id: svn://10.0.0.236/trunk@107668 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 12:28:06 +00:00
jdunn%netscape.com
6e7fe92b09 Reverting back to the previous version of this file (1.3)
The patch submitted by IBM didn't take into account all the conditions
r=cls@seawood.org
a=blizzard@mozilla.org
# 24458


git-svn-id: svn://10.0.0.236/trunk@107667 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 12:18:37 +00:00
jdunn%netscape.com
6417df93ef Fixing the problem with AIX not passing floating point params thru xptinvoke
submitted by pkw@austin.ibm.com
r=cls@seawood.org
a=blizzard@mozilla.org
# 106118


git-svn-id: svn://10.0.0.236/trunk@107666 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 12:17:19 +00:00
jdunn%netscape.com
d982a0c526 setting up AIX to only export NSGetModule from all components
These are if'd AIX only!
r=cls@seawood.org
a=blizzard@mozilla.org
# 108864


git-svn-id: svn://10.0.0.236/trunk@107665 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 12:15:48 +00:00
dp%netscape.com
985d1d4f5d changed usage message
git-svn-id: svn://10.0.0.236/trunk@107660 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 07:45:32 +00:00
dp%netscape.com
b9eeff26ec adding more formatting of prints
git-svn-id: svn://10.0.0.236/trunk@107659 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 07:44:12 +00:00
endico%mozilla.org
4a0f6acf08 Text describing the purpose of this directory from Frank Hecker <hecker@mozilla.org>
git-svn-id: svn://10.0.0.236/trunk@107657 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 06:09:01 +00:00
relyea%netscape.com
8e5904ce24 Fixes to make pkcs12 work correctly:
1) Make pkcs12 pbe function.
   2) add code to allow setting and getting of the key nickname attribute.


git-svn-id: svn://10.0.0.236/trunk@107656 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 05:39:56 +00:00
dp%netscape.com
67f3df9ea1 renaming startup-quick.pl to measure-simple.pl
git-svn-id: svn://10.0.0.236/trunk@107655 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 05:30:16 +00:00
ian.mcgreer%sun.com
930d3a8376 add lookup by email function, try to fix softoken bugs for that (but cert->emailAddr doesn't seem to be set there)
git-svn-id: svn://10.0.0.236/trunk@107653 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 05:19:32 +00:00
ian%hixie.ch
f74c5a2421 Added a little more level 9 verbose debugging feedback to help track down where output is going wrong.
git-svn-id: svn://10.0.0.236/trunk@107651 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 05:07:42 +00:00
hyatt%netscape.com
4446eabbf3 Turn off favicon.ico and remove support for turning it on from the UI. r=hixie, sr=ben, a=asa
git-svn-id: svn://10.0.0.236/trunk@107650 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 05:06:48 +00:00
ian%hixie.ch
97db51b03d Stop complaining about the configuration file missing -- if it is not there then just assume there is nothing to worry about. This makes the output of the initial run with the 'setup' argument a lot quieter.
git-svn-id: svn://10.0.0.236/trunk@107649 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 05:06:27 +00:00
ian%hixie.ch
04036664cd Make the STDOUT generic outputter flush everything it outputs -- this fixes a bug whereby sometimes prompts wouldn't appear until after the user had replied to them.
git-svn-id: svn://10.0.0.236/trunk@107648 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 05:03:57 +00:00
sspitzer%netscape.com
a83c005751 more work for #73868. get sorting to work. NOT PART OF THE BUILD
git-svn-id: svn://10.0.0.236/trunk@107647 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 05:00:29 +00:00
ian.mcgreer%sun.com
e22141b43b fix cert and s/mime profile import issues
git-svn-id: svn://10.0.0.236/trunk@107646 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 04:12:26 +00:00
ian.mcgreer%sun.com
d7dcb593c7 this seems to be needed to get linux linking again. libnss3.so tries to access the C_GetFunctionList entry point to the libsoftokn3.so library directly, and linux complains that it can't find it.
git-svn-id: svn://10.0.0.236/trunk@107645 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 03:44:17 +00:00
justdave%syndicomm.com
e78b6416c2 Fix for bug 99519: timestamps were not being set correctly in the activity table in some situations, and the delta_ts on the
bug itself was not always being updated if dependencies or CCs changed.
Patch by Dave Miller <justdave@syndicomm.com>
r= bbaetz, jake


git-svn-id: svn://10.0.0.236/trunk@107644 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 03:38:12 +00:00
mkaply%us.ibm.com
00a1b58d21 No bug
r=jblanco, sr=blizzard, a=asa for drivers
OS/2 only - better fix for not printing on Lexmark printers


git-svn-id: svn://10.0.0.236/trunk@107643 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 03:28:49 +00:00
dp%netscape.com
873f65621c fixed unclosed html tag
git-svn-id: svn://10.0.0.236/trunk@107642 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 03:24:56 +00:00
dp%netscape.com
0c5c3f78ae first version
git-svn-id: svn://10.0.0.236/trunk@107641 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 03:24:26 +00:00
myk%mozilla.org
3b483d8209 Fix for bug 104652: Duplicate bugs in the dependency tree now get marked with the message "This bug appears elsewhere in this tree." so users know why the bug does not appear to have dependencies.
Patch by Gerv <gerv@mozilla.org>.
r=jake@acutex.net,myk@mozilla.org


git-svn-id: svn://10.0.0.236/trunk@107640 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 02:43:55 +00:00
dbaron%fas.harvard.edu
b941398e09 Add omitted NS_INIT_ISUPPORTS. b=108750 a=blizzard
git-svn-id: svn://10.0.0.236/trunk@107639 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 02:17:43 +00:00
nelsonb%netscape.com
076553af57 Implement new function SSL_LocalCertificate(). Bug 78959.
git-svn-id: svn://10.0.0.236/trunk@107638 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 02:15:38 +00:00
beard%netscape.com
b3bc2391fa [not part of build] Implemented vfprintf redirection using Carbon Event timers. Turned off for now. This means that low-level JVM messages still go to the global system console instead of the Java console.
git-svn-id: svn://10.0.0.236/trunk@107637 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 01:50:35 +00:00
beard%netscape.com
da81066722 [not part of build] Fix for bug #108519, to convert "file:" URLs between HFS+ and POSIX representations.
git-svn-id: svn://10.0.0.236/trunk@107636 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 01:49:05 +00:00
beard%netscape.com
9b11f1b0af [not part of any build] Broke out class declaration from MRJContext.cpp for use in MRJSession.cpp.
git-svn-id: svn://10.0.0.236/trunk@107635 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 01:14:28 +00:00
jaggernaut%netscape.com
eb5b6bfd08 Bug 108359: crash when opening subscribe dialog ( crash in grid code ). patch by evaughan, r=jag, sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@107634 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 01:14:21 +00:00
myk%mozilla.org
f128dfb46b Fix for bug 108822: Prevent any user from changing their own groupset.
Patch by Jake <jake@acutex.net>.
r=bbaetz,myk


git-svn-id: svn://10.0.0.236/trunk@107633 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 00:54:15 +00:00
myk%mozilla.org
37c1fa29af Fix for bug 108821: Prevent users with any blessgroupset privileges from blessing any group set.
Patch by Jake <jake@acutex.net> and Bradley <bbaetz@cs.mcgill.ca>.
r=jake,myk for Bradley's portion, r=bbaetz,myk for Jake's portion.


git-svn-id: svn://10.0.0.236/trunk@107632 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 00:52:13 +00:00
myk%mozilla.org
f0967cda10 Fix for bug 108812: Prevent users from running queries containing arbitrary SQL.
Patch by Jake <jake@acutex.net>
r=bbaetz,myk


git-svn-id: svn://10.0.0.236/trunk@107631 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 00:49:18 +00:00
relyea%netscape.com
162c530b16 Land BOB_WORK_BRANCH unto the tip.
remove lots of depricated files.
move some files to appropriate directories (pcertdb *_rand
associated headers to soft token, for instance)
rename several stan files which had the same name as other nss files.
remove depricated functions.


git-svn-id: svn://10.0.0.236/trunk@107628 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 00:15:51 +00:00
relyea%netscape.com
c587ffe998 Add -DXP_OS2 so that sysrand.c can pick it up...
git-svn-id: svn://10.0.0.236/trunk@107627 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-08 00:08:28 +00:00
pschwartau%netscape.com
47b893d895 Initial add. Regression test for bug 108440.
git-svn-id: svn://10.0.0.236/trunk@107626 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 23:20:48 +00:00
dp%netscape.com
991378ff5e first version
git-svn-id: svn://10.0.0.236/trunk@107625 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 23:19:53 +00:00
bbaetz%cs.mcgill.ca
8904a09db5 Require (temporarily) mysql >= 3.23.5 for the ~ operator, needed for the
fix to bug 107718. This should be removed when the group stuff lands (bug
60822).

r=justdave x 2


git-svn-id: svn://10.0.0.236/trunk@107624 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 22:42:32 +00:00
dbaron%fas.harvard.edu
19ac8a8d84 Fix |#ifdef TARGET_CARBON| assertions for bug 104651 to fix blocker bug 108911 (TARGET_CARBON changes only).
git-svn-id: svn://10.0.0.236/trunk@107623 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 22:08:31 +00:00
mikep%oeone.com
e395496a29 Fixing file names.
git-svn-id: svn://10.0.0.236/trunk@107622 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 20:59:04 +00:00
ian.mcgreer%sun.com
96eab15224 fix linux 2.1 also
git-svn-id: svn://10.0.0.236/trunk@107621 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 20:58:09 +00:00
ian.mcgreer%sun.com
6ebb09e576 get linux building again
git-svn-id: svn://10.0.0.236/trunk@107620 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 20:56:18 +00:00
mikep%oeone.com
3d37751e19 Moving files around.
git-svn-id: svn://10.0.0.236/trunk@107619 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 20:41:11 +00:00
dbaron%fas.harvard.edu
7ada03aefc Back out incorrect part of my fix from yesterday that was causing AIX tinderbox bustage. b=107052
git-svn-id: svn://10.0.0.236/trunk@107617 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 20:29:59 +00:00
mikep%oeone.com
c3178b792e Fixing all the license header files.
git-svn-id: svn://10.0.0.236/trunk@107616 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 20:29:04 +00:00
blizzard%redhat.com
e31fa995ed back out rpotts' checkin for bug #106558 since it caused blocker bug #108869. r=mscott
git-svn-id: svn://10.0.0.236/trunk@107614 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 19:56:27 +00:00
mikep%oeone.com
4f2d0a9dac Removing unused docs.
git-svn-id: svn://10.0.0.236/trunk@107612 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 19:50:51 +00:00
relyea%netscape.com
c4b6c5af00 Move map file processing definitions back into base .mk files.
setup up map files so the can be switched on simply by adding a directive to
manifest.mn.


git-svn-id: svn://10.0.0.236/trunk@107611 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 19:34:47 +00:00
mikep%oeone.com
531758dbb4 Adding in calendar files.
git-svn-id: svn://10.0.0.236/trunk@107610 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 19:28:41 +00:00
mikep%oeone.com
b4bb33dac3 Adding in the calendar code.
git-svn-id: svn://10.0.0.236/trunk@107609 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 19:18:46 +00:00
locka%iol.ie
f68e749c8b Workaround for problem in PromiseFlatString class. b=108880 r=adamlock@netscape.com sr=scc@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@107608 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 19:03:39 +00:00
ian.mcgreer%sun.com
8a2c7868fb fix handling of token options, specifically deletion
git-svn-id: svn://10.0.0.236/trunk@107606 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 16:15:29 +00:00
bbaetz%cs.mcgill.ca
9caaabcc10 Bug 101166 - users seeing a bug via _accessible bits should see that its
the group

r=justdave,jake


git-svn-id: svn://10.0.0.236/trunk@107605 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 16:11:33 +00:00
jake%acutex.net
7a6b9817cc Bug 108547 - Make the JavaScript use proper DOM
Patch by Christopher Aillon <caillon@returnzero.com>
r= timeless@bemail.org, kiko@async.com.br


git-svn-id: svn://10.0.0.236/trunk@107604 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 14:58:56 +00:00
nboyd%atg.com
9e9cb2fc7c Patch from Igor:
I suggest to move the code in ScriptableObject.get/put that deals with getter/setter
into separated methods so it would be easy to follow the code and the attached patch
does just that.


git-svn-id: svn://10.0.0.236/trunk@107603 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 14:15:48 +00:00
seawood%netscape.com
c29db87705 Oops. That wasn't supposed to go in yet. Fixing tinderbox bustage
git-svn-id: svn://10.0.0.236/trunk@107600 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 08:09:36 +00:00
jaggernaut%netscape.com
98e92c1ba9 Bug 53057: Fixing up users of implicit |CharT*| conversion operators for nsCString to use |.get()| instead, rr=dbaron, rs=scc
git-svn-id: svn://10.0.0.236/trunk@107597 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 07:52:48 +00:00
jst%netscape.com
246aea4410 Fixing bug 92071. Making sure DOM objects that don't have a class interface (such as <span> elements, there is no nsIDOMHTMLSpanElement) get their prototype chain properly set up. r=hidday@geocities.com, peterv@netscape.com, sr=jband@netscape.com
git-svn-id: svn://10.0.0.236/trunk@107596 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 07:52:41 +00:00
jaggernaut%netscape.com
47ed3411c3 Bug 108734: nsCString::Replace is broken. r=darin, sr=scc
git-svn-id: svn://10.0.0.236/trunk@107594 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 07:43:11 +00:00
ben%netscape.com
df9186e2bc 108816 - add back removed navigation bindings for Windows only. r=waterson, sr=hewitt
git-svn-id: svn://10.0.0.236/trunk@107593 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 07:38:49 +00:00
dbaron%fas.harvard.edu
e456dfae91 Add a comment explaining how to fix callers that trigger the null-termination assertion. r=jag rs=scc b=104651
git-svn-id: svn://10.0.0.236/trunk@107592 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 07:36:36 +00:00
dbaron%fas.harvard.edu
77c9718bde Move nsDOMCSSAttributeDeclaration into its own file to progress towards moving all of the style system code back into the layout library. r=jst sr=hyatt b=108750
git-svn-id: svn://10.0.0.236/trunk@107591 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 07:06:31 +00:00
waterson%netscape.com
48ee495f01 Bug 100952, round two. This time, maintain a stack of active resources that we're currently building content for. r=tingley@sundell.net, sr=brendan
git-svn-id: svn://10.0.0.236/trunk@107590 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 06:56:39 +00:00
seawood%netscape.com
35772f6f4c Where's the auto-update?
git-svn-id: svn://10.0.0.236/trunk@107589 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 06:41:26 +00:00
hyatt%netscape.com
2518cd7fad Fix for 32087, custom icon support in tabs and url bar. r=andreww, sr=hewitt
git-svn-id: svn://10.0.0.236/trunk@107588 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 06:40:04 +00:00
seawood%netscape.com
e20a9945a1 Don't even ask
git-svn-id: svn://10.0.0.236/trunk@107587 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 06:39:14 +00:00
brendan%mozilla.org
4566fb535b Fix Function.call(this, 'alert(42)')() so the anonymous function finds its nearest scripted caller's principals (90546, sr=shaver&jband).
git-svn-id: svn://10.0.0.236/trunk@107586 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 06:34:04 +00:00
joki%netscape.com
e4bbbe83de Fix for 71705, stop right click from triggering onclick handlers in base html content, though not in xml/xul/chrome. reviewed a while ago, lost in tree. r:saari,sr:hyatt
git-svn-id: svn://10.0.0.236/trunk@107585 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 06:29:29 +00:00
morse%netscape.com
ecb7927d80 bug 108762, select-user dialog (used in password manager) broken, r=cmankse+bryner,sr=brendan
git-svn-id: svn://10.0.0.236/trunk@107584 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 06:26:33 +00:00
dbaron%fas.harvard.edu
13b5500ba3 Ensure that string literals are used as |const char*| rather than |char*|. r=jag sr=brendan b=107052
git-svn-id: svn://10.0.0.236/trunk@107583 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 06:24:10 +00:00
seawood%netscape.com
c981ebf61c Move defines from config.mk into configure.in
git-svn-id: svn://10.0.0.236/trunk@107582 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 06:13:22 +00:00
seawood%netscape.com
ae8c42a6f4 Silence!
git-svn-id: svn://10.0.0.236/trunk@107581 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 06:06:02 +00:00
seawood%netscape.com
307b0d276b Clean up options
git-svn-id: svn://10.0.0.236/trunk@107580 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 05:52:21 +00:00
dbaron%fas.harvard.edu
ab4b9ed8e0 Fix nsDependentString users who were passing non-NULL terminated buffers. b=104651 rr=jag rs=scc
git-svn-id: svn://10.0.0.236/trunk@107579 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 05:51:27 +00:00
hewitt%netscape.com
307e398404 108778 - dialog should fire ondialogcancel when native window close button clicked, r=cmanske, sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@107578 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 05:43:03 +00:00
cmanske%netscape.com
e07b4c1b35 Fixed problems relating to new XUL 1.0 changes, b=108670, r=timeless, sr=hewitt
git-svn-id: svn://10.0.0.236/trunk@107577 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 05:42:41 +00:00
mkaply%us.ibm.com
b835c29c3e Temp fix to try to plug OS/2 only region leak
git-svn-id: svn://10.0.0.236/trunk@107576 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 05:36:32 +00:00
mkaply%us.ibm.com
81d93848f0 #91898
r=robinf
Fix some HTML mistakes in help file


git-svn-id: svn://10.0.0.236/trunk@107573 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 05:31:03 +00:00
mkaply%us.ibm.com
7bdb802715 #105476
r=os2team, sr=brendan@mozilla.org
Add ASM implementation of js_CompareAndSwap for OS/2 VACPP


git-svn-id: svn://10.0.0.236/trunk@107572 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 05:20:33 +00:00
dbaron%fas.harvard.edu
c8f7ebfe63 Fix nsDependentString users not to pass null buffers. b=104651 r=jag rs=scc
git-svn-id: svn://10.0.0.236/trunk@107571 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 05:11:46 +00:00
mkaply%us.ibm.com
6b3dd9d642 OS/2 only - let's be more like Windows
git-svn-id: svn://10.0.0.236/trunk@107570 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 05:11:34 +00:00
attinasi%netscape.com
2fffc35507 Default value for pref to override broken-image layout. b=102281 r=kmcclusk sr=waterson
git-svn-id: svn://10.0.0.236/trunk@107569 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 05:05:52 +00:00
attinasi%netscape.com
9e73b286fe Due to popular demand, broken images are now getting an icon and a sized-box if they have width and height and are in QuirksMode documents (see bug for pref to override). b=102281 r=kmcclusk sr=waterson
git-svn-id: svn://10.0.0.236/trunk@107568 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 05:02:42 +00:00
dbaron%fas.harvard.edu
ab5246a768 Really fix HPUX bustage. b=108597
git-svn-id: svn://10.0.0.236/trunk@107567 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 04:52:19 +00:00
rpotts%netscape.com
784b2dd57b bug #106558 (r=darin@netscape.com, sr=mscott@netscape.com) Do not call a consumers OnStartRequest() if an error has already occurred...
git-svn-id: svn://10.0.0.236/trunk@107566 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 04:50:35 +00:00
mkaply%us.ibm.com
858853ff87 #95106
r=pavlov, sr=waterson
Get 256 colors working again - step 3 - handle palette messages in nsWindow


git-svn-id: svn://10.0.0.236/trunk@107565 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 04:45:21 +00:00
mkaply%us.ibm.com
7cfa8e64c4 #95106
r=pavlov, sr=waterson
Get 256 colors working again - step 2 - add back palette stuff back to Windows GFX


git-svn-id: svn://10.0.0.236/trunk@107564 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 04:44:14 +00:00
mkaply%us.ibm.com
5f475d64f6 #95106
r=pavlov, sr=waterson
Get 256 colors working again - step 1 - add back palette API to nsDeviceContext


git-svn-id: svn://10.0.0.236/trunk@107563 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 04:36:47 +00:00
markh%activestate.com
f9f77e73de Update to Python XPCOM for recent breaking changes:
* Freeze/Modifications to nsIObserver and nsIServiceManager
* Header file re-organization.

Thanks to Christof Meerwald for the basis of this patch.

Not part of the build.


git-svn-id: svn://10.0.0.236/trunk@107562 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 04:32:37 +00:00
attinasi%netscape.com
0ed5164758 Export GetAltTextfor as static member fcn. b=102281 r=kmcclusk sr=waerson
git-svn-id: svn://10.0.0.236/trunk@107561 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 04:32:25 +00:00
ccarlen%netscape.com
ca270b69bf Bug 104020 - send out notification after SetOffline has completed, respond to profile change notifications. r=dougt/sr=darin
git-svn-id: svn://10.0.0.236/trunk@107560 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 04:26:19 +00:00
waterson%netscape.com
f0d9433954 Bug 108736. Lurn tuh speel. r=tingley@sundell.net, sr=shaver@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@107559 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 04:25:41 +00:00
waterson%netscape.com
840acb0db5 Bug 103959. Maintain nsTemplateMatch::mBindingDependencies so that we don't leave dangling references in the nsConflictSet::mBindingDependencies table. r=tingley@sundell.net, sr=shaver@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@107558 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 04:24:51 +00:00
dbaron%fas.harvard.edu
25428c5c64 Quiet annoying warning on HP by using the two-step NS_STATIC_CAST that is really meant here. r=jag sr=brendan b=107052
git-svn-id: svn://10.0.0.236/trunk@107557 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 04:12:24 +00:00
dbaron%fas.harvard.edu
52bea38360 Add assertions that users of nsDependentC?String meet the requirements of nsAFlatC?String. Add nsDependentSingleFragmentC?Substring for users that don't. Additional cleanup after bug 100214. b=104651 r=jag sr=scc
git-svn-id: svn://10.0.0.236/trunk@107556 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 04:12:20 +00:00
roc+%cs.cmu.edu
a38af362a7 Bug 73382. Let the view code work with nsView*/nsViewManager* internally and migrate some methods from public to private to the view module. Also deCOMify those methods for speed. r=kmmclusk,sr=attinasi
git-svn-id: svn://10.0.0.236/trunk@107555 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 04:05:38 +00:00
blakeross%telocity.com
689da41ca0 autocomplete dialog shouldn't be resizable. r/sr=hewitt
git-svn-id: svn://10.0.0.236/trunk@107554 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 04:05:20 +00:00
beard%netscape.com
9f6db5a709 [not part of build] Bumped version to 1.0d5.
git-svn-id: svn://10.0.0.236/trunk@107552 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 04:05:07 +00:00
beard%netscape.com
5e987d2489 [not part of build] First cut at proxied security for raw LiveConnect calls into Java. Doesn't switch threads any longer.
git-svn-id: svn://10.0.0.236/trunk@107551 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 04:00:35 +00:00
beard%netscape.com
f3cecbf649 [not part of build] Added JNIRunnable to support security proxying.
git-svn-id: svn://10.0.0.236/trunk@107550 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 03:58:47 +00:00
beard%netscape.com
dcb61be6c1 [not part of build] Implemented getApplet() for LiveConnect scripting of applets.
git-svn-id: svn://10.0.0.236/trunk@107549 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 03:58:00 +00:00
beard%netscape.com
de4545ac35 [not part of build] Simplest possible class to provide a security proxy for raw LiveConnect calls into Java.
git-svn-id: svn://10.0.0.236/trunk@107548 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 03:56:52 +00:00
beard%netscape.com
969e21496b [not part of build] Forked for MRJPluginCarbon, to provide class loader caching, and preloading of LiveConnectProxy.
git-svn-id: svn://10.0.0.236/trunk@107547 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 03:56:47 +00:00
beard%netscape.com
6191900cab [not part of build] Added LiveConnectProxy.java, rearranged some entries, added additional access paths to use some Caps classes.
git-svn-id: svn://10.0.0.236/trunk@107546 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 03:54:09 +00:00
sspitzer%netscape.com
67ee809929 more work for converting AB results pane to outliner.
bug #73868.  not part of the build


git-svn-id: svn://10.0.0.236/trunk@107545 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 03:46:17 +00:00
hyatt%netscape.com
db67978a0a Fix for 108318 make ICO decoder non-incremental. r=pav, sr=waterson
git-svn-id: svn://10.0.0.236/trunk@107544 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 03:28:51 +00:00
hyatt%netscape.com
79374b514b Fix for 108318 make ICO decoder non-incremental. r=pav, sr=waterson
git-svn-id: svn://10.0.0.236/trunk@107543 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 03:27:58 +00:00
peterlubczynski%netscape.com
ecf99805e4 Fix for NPN_PostURL not always working correctly [like with binary file data] bug 105417 r=av sr=darin
git-svn-id: svn://10.0.0.236/trunk@107542 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 03:03:04 +00:00
law%netscape.com
e7d529ebd1 Bug 102350; it's just a little disk; r=jag, sr=hewitt
git-svn-id: svn://10.0.0.236/trunk@107541 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 02:54:28 +00:00
law%netscape.com
1e545b2e81 Bug 100406 (patch submitted by Mike Kaply); size to content before centering; this is necessary because we change the content; r=law, sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@107540 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 02:50:43 +00:00
ian%hixie.ch
78c02b74a7 Disambiguate the names of the two methods 'hash' and 'sort'. They are now called 'genericHash' and 'genericSort' so as not to clash with the perl builtins 'CORE::hash' and 'CORE::sort'.
git-svn-id: svn://10.0.0.236/trunk@107539 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 02:49:21 +00:00
ian%hixie.ch
2923002831 Changing the shebang to point to a more likely location of the perl interpreter.
git-svn-id: svn://10.0.0.236/trunk@107538 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 02:46:38 +00:00
sgehani%netscape.com
e94a6acda8 Eliminate warnings.
b = 79336
r = sgehani (checking in sfraser's patch)
rs = alecf


git-svn-id: svn://10.0.0.236/trunk@107537 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 02:43:39 +00:00
sgehani%netscape.com
714b51280f Don't change window size on load.
b = 99725
r = matt
sr = blake


git-svn-id: svn://10.0.0.236/trunk@107536 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 02:41:53 +00:00
karnaze%netscape.com
7265213615 bug 105166 - additional patch to place rounding code in the right place. sr=attinasi.
git-svn-id: svn://10.0.0.236/trunk@107535 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 02:38:49 +00:00
loadrunner%betak.net
bfeea864ea bug 106536 Blank charset list in SaveAs charset of HTML composer, r=cmanske, sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@107534 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 02:32:58 +00:00
sgehani%netscape.com
5042bb2d30 Fix bustage from last checkin.
git-svn-id: svn://10.0.0.236/trunk@107533 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 02:30:18 +00:00
ian%hixie.ch
76d8c32a10 Initial checkin of the first PLIF test application.
git-svn-id: svn://10.0.0.236/trunk@107532 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 01:42:05 +00:00
dbaron%fas.harvard.edu
f4593f1a78 Let's not put crucial XP includes in |#ifdef XP_WIN|. Fixing bustage.
git-svn-id: svn://10.0.0.236/trunk@107530 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 01:32:44 +00:00
peterlubczynski%netscape.com
da662eeea7 Fix for when the browser calls "Destroy" twice for some XPCOM plugins bug 104038 r=av sr=attinasi
git-svn-id: svn://10.0.0.236/trunk@107529 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 01:12:14 +00:00
cls%seawood.org
8a19b66a7c make our 64-bit platforms happy and use the macro to cast from pointer to int.
git-svn-id: svn://10.0.0.236/trunk@107528 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 01:08:26 +00:00
kmcclusk%netscape.com
d0fb62d700 Fix leak of parser objects when page load is interrupted by calling nsParser::CancelParsingEvents inside nsParser::Terminate; bug 108049 (patch from aaronr@us.ibm.com) r=harishd sr=attinasi
git-svn-id: svn://10.0.0.236/trunk@107527 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 01:02:56 +00:00
peterlubczynski%netscape.com
c93017e863 Fix for using OS temp directory for plugin temporary files instead of profile bug 104859 r=av sr=darin
git-svn-id: svn://10.0.0.236/trunk@107526 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 01:00:24 +00:00
hewitt%netscape.com
28703b942c 108759 - nsDOMEvent::InitEvent is throwing away screen/client coordinates, r=hyatt, sr=jst
git-svn-id: svn://10.0.0.236/trunk@107525 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 00:54:02 +00:00
sspitzer%netscape.com
154d93971a new css file for switching ab over to outliner.
NOT PART OF THE BUILD. #73868


git-svn-id: svn://10.0.0.236/trunk@107524 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 00:27:09 +00:00
shliang%netscape.com
07ceb9e71c bug 61244. some classic skin files missing namespace. r=andreww, sr=hewitt.
git-svn-id: svn://10.0.0.236/trunk@107523 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 00:25:21 +00:00
brendan%mozilla.org
c1526a5251 Avoid recursive join/toString death (108440, r=shaver, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@107522 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 00:15:44 +00:00
loadrunner%betak.net
83478013af bug 102026 Charset menu misplacing (.), r=nhotta, rs=kin
git-svn-id: svn://10.0.0.236/trunk@107521 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 00:13:18 +00:00
jgaunt%netscape.com
3c4c93afa1 bug 108069 r=aaronl sr=hyatt
groundwork for XUL select accessibility work


git-svn-id: svn://10.0.0.236/trunk@107520 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 00:13:07 +00:00
jgaunt%netscape.com
daab4c1f4c bug 108069 r=aaronl sr=hyatt
groundwork for XUL select accessibility work
lots of suffling stuff around


git-svn-id: svn://10.0.0.236/trunk@107519 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 00:12:16 +00:00
jst%netscape.com
edf83c6cd6 Fixing bug 108651. Don't call nsIDocument::ContentAppended() if nothing was appended (when inserting an empty document fragment). r=harishd@netscape.com, rs=vidur@netscape.com
git-svn-id: svn://10.0.0.236/trunk@107518 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 00:11:36 +00:00
brendan%mozilla.org
d97c123a81 Move the oversized arena back-pointer to a well-aligned header extension lying just behind a->base (108013, sr=waterson&jband).
git-svn-id: svn://10.0.0.236/trunk@107517 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 00:11:22 +00:00
loadrunner%betak.net
ef7e4e3743 bug 97175 startup perf- remove the need of loading of charsetalias.properties files at startup, r=nhotta, sr=kin
git-svn-id: svn://10.0.0.236/trunk@107516 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 00:06:43 +00:00
sfraser%netscape.com
709635468a Clean up after my wonky fixing of the DefaultPlugin project yesterday, and CVS remove the checked in binary (bug 108223).
git-svn-id: svn://10.0.0.236/trunk@107515 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 00:02:42 +00:00
alecf%netscape.com
ff976d776d fix HPUX bustage
git-svn-id: svn://10.0.0.236/trunk@107514 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 00:02:07 +00:00
ddrinan%netscape.com
e6b9c1e197 Bug 108744 - mail compose does not get S/MIME settings. r=javi,sr=mscott
git-svn-id: svn://10.0.0.236/trunk@107513 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-07 00:00:44 +00:00
radha%netscape.com
9c70ff699d Fix for bug # 108041. Session history misbehaves when _top is replaced after a series of subframe navigations. r=adamlock sr=rpotts.
git-svn-id: svn://10.0.0.236/trunk@107512 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:56:45 +00:00
mscott%netscape.com
73de839dd7 *sigh* fix yet another xul syntax regression. text --> label
git-svn-id: svn://10.0.0.236/trunk@107511 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:47:42 +00:00
mscott%netscape.com
179c4c0111 Bug #107707 --> add a row element to the grid to make brief mode work again.
r=bienvenu
sr=sspitzer


git-svn-id: svn://10.0.0.236/trunk@107510 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:46:51 +00:00
peterlubczynski%netscape.com
46045b394a Fix for background color not being set on the widget for plugins bug 83159 r=av sr=attinasi
git-svn-id: svn://10.0.0.236/trunk@107509 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:46:13 +00:00
av%netscape.com
8c4c191580 Bug 106435 -- handling booleans passed in NPN_SetVariable in backward compatible way, r=peterl, sr=waterson
git-svn-id: svn://10.0.0.236/trunk@107508 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:45:01 +00:00
locka%iol.ie
dca063f714 Add flag to prevent saveURI from decompressing gzipped data as it is arriving b=108268 r=bryner@netscape.com sr=blizzard@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@107507 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:43:39 +00:00
srilatha%netscape.com
126a9b7f60 Fix for bug # 107558, added getServerList to make ldap prefs work again.
r=dmose,sr=alecf


git-svn-id: svn://10.0.0.236/trunk@107506 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:42:58 +00:00
peterlubczynski%netscape.com
0140ed3af2 Fix for loading Carbon plugins that also have a mainRD exported. Fixes load problems with Carbon Shockwave Director bug 106070 r=beard sr=sfraser
git-svn-id: svn://10.0.0.236/trunk@107505 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:42:35 +00:00
bryner%netscape.com
ed1fc72b3e Bug 108742 - cannot get a cert. patch from stephen walker, r=bryner, sr=blizzard.
git-svn-id: svn://10.0.0.236/trunk@107504 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:39:17 +00:00
blizzard%redhat.com
966e87d540 Bug #107651. Handle drop type text/uri-list. Patch is from James Henstridge <james@daa.com.au>. r=markh, sr=blizzard
git-svn-id: svn://10.0.0.236/trunk@107503 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:31:17 +00:00
javi%netscape.com
ef265319b8 This should be the last for Bug 106507.
Forgot to add mimecryp.cpp to the Mac Mime project file.


git-svn-id: svn://10.0.0.236/trunk@107502 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:30:24 +00:00
alecf%netscape.com
e769459750 kill DIST_DIRS, LAYOUT_DIRS, and CLIENT_DIRS r=cls
bug 105077


git-svn-id: svn://10.0.0.236/trunk@107501 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:16:37 +00:00
karnaze%netscape.com
bfb10c7fae new regression tests, not affecting the build.
git-svn-id: svn://10.0.0.236/trunk@107500 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:15:24 +00:00
alecf%netscape.com
b5cc350bd4 fix for minor leak bug 108640 r=jag, sr=sspitzer
git-svn-id: svn://10.0.0.236/trunk@107499 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:14:47 +00:00
darin%netscape.com
6136114f39 fixes bug 108267 "scale back NS_BINDING_REDIRECTED proliferation"
r=gagan, sr=rpotts


git-svn-id: svn://10.0.0.236/trunk@107498 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:09:44 +00:00
locka%iol.ie
3c07440a65 Fix duff indentation (tab instead of space). b=78810
git-svn-id: svn://10.0.0.236/trunk@107497 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:06:36 +00:00
ducarroz%netscape.com
d6b8386581 Fix for bug 105729. The string need to have at least the same amount of characters than the substring in order to compare them. R=varada, SR=alecf
git-svn-id: svn://10.0.0.236/trunk@107496 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:06:24 +00:00
blizzard%redhat.com
cc0b022772 Bug #99174. Limit the length of requests to XDrawString to 32K avoid causing X protocol errors. r=alecf, sr=brendan
git-svn-id: svn://10.0.0.236/trunk@107495 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:05:39 +00:00
karnaze%netscape.com
f410e9f281 bug 77982 - consider border/padding on a cell that goes from empty to non-empty during an incremental reflow. sr=attinasi, r=alexsavulov
git-svn-id: svn://10.0.0.236/trunk@107494 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:05:32 +00:00
timeless%mac.com
13298d275a Bug 83017 - Frame Info dialog has title 'View Page Info'
patch by db48x@yahoo.com r=fabian, sr=jst


git-svn-id: svn://10.0.0.236/trunk@107493 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:01:03 +00:00
karnaze%netscape.com
b87047f2a5 bug 57300 - treat the height attribute on a row similarly to a style height. sr=attinasi, r=alexsavulov
git-svn-id: svn://10.0.0.236/trunk@107492 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 23:00:10 +00:00
ben%netscape.com
778cb24ef4 108462 - Remove Vixen. r=bryner, sr=jst
git-svn-id: svn://10.0.0.236/trunk@107491 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 22:59:55 +00:00
karnaze%netscape.com
8e9ce2be93 bug 30692 - Have children of cell block use the computed width of the cell. sr=attinasi, r=alexsavulov
git-svn-id: svn://10.0.0.236/trunk@107490 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 22:57:17 +00:00
varada%netscape.com
f054d8ebe7 fix for bug #65761 and #108606 -polishing prefill filters;r/sr=sspitzer
git-svn-id: svn://10.0.0.236/trunk@107489 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 22:55:37 +00:00
locka%iol.ie
1151308cf0 Add fixup for view-source: URLs. b=78810 r=bzbarsky@mit.edu sr=blizzard@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@107488 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 22:55:30 +00:00
ben%netscape.com
a125c72d9b 90080 - no restart message appears when switching UI language.
r=jag, sr=hyatt


git-svn-id: svn://10.0.0.236/trunk@107487 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 22:55:05 +00:00
pinkerton%netscape.com
1a055590ab Now a .mm. Obsolete.
git-svn-id: svn://10.0.0.236/trunk@107486 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 22:54:39 +00:00
bryner%netscape.com
f51e958f3e Removing obsolete unused files. Not part of the build.
git-svn-id: svn://10.0.0.236/trunk@107485 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 22:54:29 +00:00
pinkerton%netscape.com
6b9b19e010 pulling over bryner's changes from widget/src/mac
git-svn-id: svn://10.0.0.236/trunk@107484 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 22:53:51 +00:00
pinkerton%netscape.com
ee51e87c47 removing timer, it's now in toolkit
git-svn-id: svn://10.0.0.236/trunk@107483 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 22:53:25 +00:00
karnaze%netscape.com
d4308b507a bug 107857 - add -moz-show-background value to empty-cells and make that the quirk default. sr=attinasi, r=pierre.
git-svn-id: svn://10.0.0.236/trunk@107482 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 22:52:59 +00:00
pinkerton%netscape.com
04c86d73f7 cocoa'ifying toolkit. moving PLEvent timer here.
git-svn-id: svn://10.0.0.236/trunk@107481 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 22:52:52 +00:00
wtc%netscape.com
71f6b17411 Removed the temporary #if 0.
git-svn-id: svn://10.0.0.236/trunk@107480 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 22:52:12 +00:00
alecf%netscape.com
618d9ec8d7 fix for bug 108684 - cache objects not included in bloat logs
r=gordon, sr=darin


git-svn-id: svn://10.0.0.236/trunk@107479 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 22:51:58 +00:00
alecf%netscape.com
71dee0899c fix for bug 108597 - move mOwnsBuffer and mCharSize into smaller variables to reduce nsStr's overall size
r=jag, sr=waterson


git-svn-id: svn://10.0.0.236/trunk@107478 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 22:50:13 +00:00
despotdaemon%netscape.com
0d2bde26d8 Pseudo-automatic update of changes made by wtc@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@107477 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 22:49:24 +00:00
wtc%netscape.com
c6fcf205bb Bugzilla bug 108708: commented out the "netstat -ni" command for
debugging.  This change will be backed out.


git-svn-id: svn://10.0.0.236/trunk@107475 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 21:34:09 +00:00
ian.mcgreer%sun.com
1d961328df fix for 95983, compiler warning revealed potential bug
git-svn-id: svn://10.0.0.236/trunk@107474 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 20:32:43 +00:00
ian.mcgreer%sun.com
6c8bd66a32 more trust handling stuff
git-svn-id: svn://10.0.0.236/trunk@107473 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 20:16:19 +00:00
rogerl%netscape.com
2fabd4ccad Added Function.call/apply. Fixed bug in exception handling clean-up of
activation stack.


git-svn-id: svn://10.0.0.236/trunk@107472 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 19:45:04 +00:00
pinkerton%netscape.com
ad253d37ca backing out last change to fix mach-o build
git-svn-id: svn://10.0.0.236/trunk@107471 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 18:50:18 +00:00
despotdaemon%netscape.com
7d27a0daad Pseudo-automatic update of changes made by shliang@netscape.com.
git-svn-id: svn://10.0.0.236/trunk@107470 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 18:42:39 +00:00
despotdaemon%netscape.com
97f686d78c Pseudo-automatic update of changes made by knous@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@107469 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 18:22:14 +00:00
jake%acutex.net
b4c2275ed0 Refixing bug 71840 - The name should be the 'name' should be the same as what the 'href' points it too...
r= justdave@syndicomm.com


git-svn-id: svn://10.0.0.236/trunk@107468 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 18:06:02 +00:00
blizzard%redhat.com
9b6794d44c back out darin's fix for bug #107789 since it caused blocker #108637.
git-svn-id: svn://10.0.0.236/trunk@107466 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 16:32:52 +00:00
pinkerton%netscape.com
4a6332a214 unix linefeeds this time
git-svn-id: svn://10.0.0.236/trunk@107464 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 16:03:52 +00:00
pinkerton%netscape.com
d5a312024f oops, backing out inclusion of nsIEventSink.idl
git-svn-id: svn://10.0.0.236/trunk@107463 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 16:03:02 +00:00
pinkerton%netscape.com
e13b47e743 New EventSink api. [not part of build]
git-svn-id: svn://10.0.0.236/trunk@107462 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 15:59:32 +00:00
mkaply%us.ibm.com
0b9f89f0d8 Oops overwriting wrong codepage
git-svn-id: svn://10.0.0.236/trunk@107461 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 15:54:54 +00:00
pinkerton%netscape.com
0503d1a3d0 First stab at cocoa. [not part of build]
git-svn-id: svn://10.0.0.236/trunk@107459 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 15:46:50 +00:00
pinkerton%netscape.com
ded9d238a5 Remove dependency on nsDynamicMDEF (it's very os9) and removing those
files altogether. [not part of build]


git-svn-id: svn://10.0.0.236/trunk@107458 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 15:46:26 +00:00
pinkerton%netscape.com
d4634aba3d Ifdefs for mach-o build. We do too have a splash screen. r=beard/rs=sfraser.
git-svn-id: svn://10.0.0.236/trunk@107457 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 15:39:06 +00:00
pinkerton%netscape.com
caf8397f30 Stub impl for cocoa [Not part of build]
git-svn-id: svn://10.0.0.236/trunk@107456 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 15:36:12 +00:00
mkaply%us.ibm.com
6009659a90 Forgot some return codes
git-svn-id: svn://10.0.0.236/trunk@107455 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 15:35:41 +00:00
pinkerton%netscape.com
8f7dd9c564 First stab at Cocoa impl of widget. Some code still carbon, copied from
widget/src/mac. [Not part of build].


git-svn-id: svn://10.0.0.236/trunk@107454 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 15:35:24 +00:00
rods%netscape.com
f5b747b20b Minor fix up to my PrintPreview Checkin
Bug 107562


git-svn-id: svn://10.0.0.236/trunk@107452 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 14:34:00 +00:00
despotdaemon%netscape.com
7d103e0331 Pseudo-automatic update of changes made by mikep@oeone.com.
git-svn-id: svn://10.0.0.236/trunk@107451 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 13:49:32 +00:00
dinglis%qnx.com
6eab060ba1 NTO PART OF BUILD
fixed photon bustage


git-svn-id: svn://10.0.0.236/trunk@107450 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 13:33:36 +00:00
jdunn%netscape.com
a6df12a0f6 fixing build bustage on HP's & AIX's new compilers
removing the static keyword from a couple templates
sr=jst@netscape.com
# 106167


git-svn-id: svn://10.0.0.236/trunk@107449 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 13:22:05 +00:00
rods%netscape.com
843ec68778 Initial check in for print preview work it is complied in for Windows and linix only
The bulk of print preview can be turned on/off with NS_PRINT_PREVIEW define
Bug 107562 r=kmcclusk sr=attinasi


git-svn-id: svn://10.0.0.236/trunk@107448 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 12:18:51 +00:00
seawood%netscape.com
e9d30f1ebc Whoops! The glue library is supposed to be static.
Bug #83544


git-svn-id: svn://10.0.0.236/trunk@107447 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 10:50:37 +00:00
pierre%netscape.com
0ef28aebb3 Checked in for fantasai@escape.com. Bug 43220 "author !important rules override user !important rules in user.css". Add User sheets. Rename Backstop sheets into UserAgent. Fix cascading order. r=pierre/sr=hyatt.
git-svn-id: svn://10.0.0.236/trunk@107446 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 10:04:05 +00:00
seawood%netscape.com
03f596acd6 Allow multiple toolkits to be installed in a build by marking the non-default toolkits as "inactive" and placing them in a separate components dir.
Bug #91829 r=jag


git-svn-id: svn://10.0.0.236/trunk@107445 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 09:45:23 +00:00
jst%netscape.com
ba5a80f5bd Fixing bug 108232. Don't flush like mad in the form code now that form state is kept in the content elements and not in the frames. r=jkeiser@iname.com, sr=waterson@netscape.com
git-svn-id: svn://10.0.0.236/trunk@107444 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 09:10:07 +00:00
hyatt%netscape.com
192c50dc19 103097, fire custom events when link elts are added/removed. Helping out the link toolbar folks. r=jag, sr=jst
git-svn-id: svn://10.0.0.236/trunk@107443 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 09:02:55 +00:00
seawood%netscape.com
e469132bc2 Attempt to fix OS/2 bustage by declaring callback function appropriate
git-svn-id: svn://10.0.0.236/trunk@107442 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 08:23:51 +00:00
rbs%maths.uq.edu.au
ec47d909ea Nail a sneaky memory leak in one of the 'A'-functions - initially detected during the comb of bug 103777, r=shanjian, sr=attinasi
git-svn-id: svn://10.0.0.236/trunk@107441 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 08:00:15 +00:00
dbaron%fas.harvard.edu
8c7cfc52d1 Fix inheritance of percentage values for 'line-height' by removing hacks to base percentage values for 'line-height' on the actual value rather than the computed value of 'font-size'. Fix various |const|-ness issues in nsRuleNode. b=97726 r=pierre sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@107440 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 07:48:02 +00:00
jkeiser%iname.com
5c1f007583 Fix from jst@netscape.com to URL-escape A NAME (bug 87996)
git-svn-id: svn://10.0.0.236/trunk@107439 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 07:14:40 +00:00
attinasi%netscape.com
f538e7840a Fix for memory leaks in nsRenderingContextImpl and nsrenderingContextWin (patch provided by Dainis Jonitis). b=107532 r=mkaply sr=attinasi
git-svn-id: svn://10.0.0.236/trunk@107438 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 07:11:30 +00:00
dbaron%fas.harvard.edu
e48117359d Take address before casting to avoid confusing the gcc optimizer with what perhaps shouldn't compile anyway. r=pinkerton sr=sfraser b=108585
git-svn-id: svn://10.0.0.236/trunk@107437 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 06:15:40 +00:00
cls%seawood.org
49044f9a3a Remove c++ comment
git-svn-id: svn://10.0.0.236/trunk@107436 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 06:01:59 +00:00
jkeiser%iname.com
e280789a88 Make only text/password/file/hidden elements reset when value attribute is
changed.  (bug 108526).  r=rpotts@netscape.com, sr=jst@netscape.com


git-svn-id: svn://10.0.0.236/trunk@107435 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 05:41:47 +00:00
naving%netscape.com
9849e524b7 104610 r=bienvenu sr=sspitzer Make sure that mSubFolders array does not have duplicates.
git-svn-id: svn://10.0.0.236/trunk@107434 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 05:35:42 +00:00
seawood%netscape.com
01ed6f94df Move generic implementations of mimexpcom & nsMimeContentTypeHandler classes into glue library. Modify vcard, calendar & smimestub handlers to use the generic implementations of the base classes. Remove old non-generic copies of mimexpcom & nsMimeContentTypeHandler .
Bug #83544 r=ducarroz sr=waterson


git-svn-id: svn://10.0.0.236/trunk@107433 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 05:12:09 +00:00
seawood%netscape.com
e448539c27 Use generic mimexpcom & nsMimeContentTypeHandler files from cthandlers/glue.
Bug #83544 r=ducarroz sr=waterson


git-svn-id: svn://10.0.0.236/trunk@107432 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 05:08:26 +00:00
mstoltz%netscape.com
aa1727f913 Bug 105705, temporary fix. Remove security check optmization
from global property access. sr=jst, r=harishd. We will find
a better fix that preserves the optimization, this fix is temporary.


git-svn-id: svn://10.0.0.236/trunk@107431 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 05:04:36 +00:00
seawood%netscape.com
fce1d10fb6 Allow nsinstall to install (copy) directories.
Thanks to pedemont@us.ibm.com (Javier Pedemonte) for the patch.
Bug #76900 r=cls sr=brendan


git-svn-id: svn://10.0.0.236/trunk@107430 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 04:51:47 +00:00
naving%netscape.com
77196885e6 108276. Open the mailbox in PR_RDONLY mode because only read operations are done using
this connection. should cut down closing mailbox (PR_Close()) time.


git-svn-id: svn://10.0.0.236/trunk@107429 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 04:25:28 +00:00
bryner%netscape.com
6ad05b9ea5 Clarifying log message. Not part of the build.
git-svn-id: svn://10.0.0.236/trunk@107428 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 04:23:16 +00:00
bryner%netscape.com
532ac12efb Fixing mac bustage. r=cls.
git-svn-id: svn://10.0.0.236/trunk@107427 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 04:15:05 +00:00
darin%netscape.com
0d51dc65ff fixes mac bustage
git-svn-id: svn://10.0.0.236/trunk@107426 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 03:56:00 +00:00
blakeross%telocity.com
ff478ef551 autocomplete dialog shouldn't be resizable. r/sr=hewitt
git-svn-id: svn://10.0.0.236/trunk@107425 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 03:40:13 +00:00
sspitzer%netscape.com
514732e6f4 fix build bustage
git-svn-id: svn://10.0.0.236/trunk@107424 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 03:29:02 +00:00
seawood%netscape.com
f30b49edcb silly line-endings
git-svn-id: svn://10.0.0.236/trunk@107423 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 03:20:41 +00:00
despotdaemon%netscape.com
9ff2328aa5 Pseudo-automatic update of changes made by jkeiser@iname.com.
git-svn-id: svn://10.0.0.236/trunk@107422 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 02:52:52 +00:00
darin%netscape.com
902546fa1d fixes bug 107789 "depracate nsIRandomAccessStore (superceded by nsISeekableStream)"
r=dougt, sr=rpotts


git-svn-id: svn://10.0.0.236/trunk@107421 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 02:50:42 +00:00
seawood%netscape.com
89efd0f65a Removed IGNORE_MANIFEST
git-svn-id: svn://10.0.0.236/trunk@107420 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 02:48:37 +00:00
nelsonb%netscape.com
4035d51f10 Attempt to move all the constant tables in secoid.c into the text segment
where they belong.


git-svn-id: svn://10.0.0.236/trunk@107419 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 02:46:37 +00:00
attinasi%netscape.com
dc30e5998c Oops - check for empty damageRect in nsFrame::Invalidate should be DEBUG only. b=103266 r=rbs sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@107418 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 02:44:35 +00:00
bryner%netscape.com
ebb951b148 Reorganize nsLookAndFeel so that all of the platform implementations
derive from nsXPLookAndFeel.  Implement a color cache for
nsXPLookAndFeel::GetColor calls.  bug 77941, r=akkana, rs=waterson.


git-svn-id: svn://10.0.0.236/trunk@107417 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 02:41:04 +00:00
despotdaemon%netscape.com
433d3af967 Pseudo-automatic update of changes made by peterb@oeone.com.
git-svn-id: svn://10.0.0.236/trunk@107416 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 02:37:42 +00:00
seawood%netscape.com
f9e4cb25aa Start building content handler glue library.
Bug #83544 r=ducarroz sr=waterson


git-svn-id: svn://10.0.0.236/trunk@107415 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 02:31:08 +00:00
despotdaemon%netscape.com
ba97acdc6d Pseudo-automatic update of changes made by colinp@oeone.com.
git-svn-id: svn://10.0.0.236/trunk@107414 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 02:30:54 +00:00
seawood%netscape.com
8a9fd9e580 Make mimexpcom & nsMimeContentTypeHandler generic enough to be used for any content handler.
Bug #83544 r=ducarroz sr=waterson


git-svn-id: svn://10.0.0.236/trunk@107413 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 02:29:16 +00:00
ddrinan%netscape.com
d0987df95f Missed this as part of landing of S/MIME. r=javi, sr=blizzard
git-svn-id: svn://10.0.0.236/trunk@107412 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 02:17:46 +00:00
stephend%netscape.com
78cfb1bb22 Bug 81041. 'New Account' -> 'Add Account'. r=jglick, sr=mscott
git-svn-id: svn://10.0.0.236/trunk@107411 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 02:14:08 +00:00
attinasi%netscape.com
8e3b74c6cf Reversed the order that width and height are checked in IsEmpty since it is more common to have a height of 0. b=103266 r=rbs sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@107410 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:48:36 +00:00
bbaetz%cs.mcgill.ca
74513dad3c Bug 38014 - show localised dates in html dir listing
Also fixes bug 99169 - display html dir listing file sizes in a nicer
format.

r=darin, sr=smfr


git-svn-id: svn://10.0.0.236/trunk@107409 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:46:18 +00:00
sfraser%netscape.com
05c5dfecdc Fix NullPlugin.mcp to build in a Carbon debug build; renaming it to DefaultPlugin.mcp and fixing prefix files. r=beard, sr=fm
git-svn-id: svn://10.0.0.236/trunk@107408 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:45:15 +00:00
attinasi%netscape.com
11481ea927 Elimiate calls to nsFrame::Invalidate when the dirtyRect is empty. Also, removed some invalid code from nsFrame::Invalidate and added DEBUG check to catch later offenders. b=103266 r=rbs sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@107407 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:44:20 +00:00
seawood%netscape.com
84b9551c2a Adding makefiles for cthandlers glue lib.
Bug #83544 r=ducarroz sr=waterson


git-svn-id: svn://10.0.0.236/trunk@107406 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:44:07 +00:00
pete%alphanumerica.com
3c8b2b33e3 b=92329, r=ccarlen, sr=brendan
Fix for nsLocalFileUnix ::GetTarget doesn't handle relative symlinks


--pete


git-svn-id: svn://10.0.0.236/trunk@107405 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:42:00 +00:00
ben%netscape.com
8f4806600a 108595 - Add a method for determining whether or not a context menu separator should be shown by determining if there are any items prior to the separator that are not hidden. r=kerz, sr=blake
git-svn-id: svn://10.0.0.236/trunk@107404 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:41:03 +00:00
ben%netscape.com
7c3257d6ab 108595 - prevent a duplicate load of contentAreaContextOverlay.xul which is causing problems for image blocking, and remove an unused script include. r=kerz, sr=blake
git-svn-id: svn://10.0.0.236/trunk@107403 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:40:09 +00:00
ben%netscape.com
074183292e 108595 - "Block Images for this server" menu item not showing up. Remove display:none style rule now that the overlay that includes this overlay (contentAreaContextOverlay.xul) is no longer being loaded twice by navigator. r=kerz, sr=blake
git-svn-id: svn://10.0.0.236/trunk@107402 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:39:36 +00:00
ben%netscape.com
bd62da3fb8 108595 - wallet context items inserted into the wrong position in navigator context menu. regardless of context. Reposition them after the clipboard items. r=kerz, sr=blake
git-svn-id: svn://10.0.0.236/trunk@107401 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:38:48 +00:00
ben%netscape.com
39826bfdaf 108595 - mail send page/link context menu items always showing in Navigator, regardless of context. Ensure that popupshowing event listener gets added. r=kerz, sr=blake
git-svn-id: svn://10.0.0.236/trunk@107400 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:38:03 +00:00
ben%netscape.com
2e2ef977f4 Bug 107842 - Missing menu items from message pane context menu & 107890 - js error loading standalone message window, popup has no properties
- ensure the correct menu items and separators are hidden using newer separator hide logic. r=blake, sr=sspitzer


git-svn-id: svn://10.0.0.236/trunk@107399 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:36:51 +00:00
karnaze%netscape.com
572c89cc71 new regression test, not affecting the build.
git-svn-id: svn://10.0.0.236/trunk@107398 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:35:06 +00:00
dinglis%qnx.com
89d08199b2 NOT PART OF BUILD
increased draw buffer


git-svn-id: svn://10.0.0.236/trunk@107397 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:32:44 +00:00
attinasi%netscape.com
841eb99d32 Fixed typo wrt width and height (patch provided by Dainis Jonitis) b=107530 r=mkaply sr=attinasi
git-svn-id: svn://10.0.0.236/trunk@107396 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:28:27 +00:00
dinglis%qnx.com
35f3674b05 NOT PART OF BUILD
small resize opt to use start/end flux when aRepaint not set


git-svn-id: svn://10.0.0.236/trunk@107395 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:27:50 +00:00
sspitzer%netscape.com
fc8f18ede8 work for converting ab results pane from tree to outliner. NOT PART OF THE BUILD.
bug #73868.


git-svn-id: svn://10.0.0.236/trunk@107394 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:27:07 +00:00
danm%netscape.com
17ff11d2db initial (disabled) cut at creating about:blank documents synchronously. part of bug 88229 r=hyatt,rpotts
git-svn-id: svn://10.0.0.236/trunk@107393 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:24:39 +00:00
waldemar%netscape.com
120229a1fc Added :wrap and extended :nowrap to apply as either a paragraph or an inline style
git-svn-id: svn://10.0.0.236/trunk@107392 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:24:13 +00:00
waldemar%netscape.com
eb97b81cf5 Added dump-units
git-svn-id: svn://10.0.0.236/trunk@107391 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:23:17 +00:00
danm%netscape.com
d908e2d3d8 don't show a new chrome window immediately upon creation, but after chrome has loaded. part of bug 88229 r=hyatt,rpotts
git-svn-id: svn://10.0.0.236/trunk@107390 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:22:58 +00:00
waldemar%netscape.com
18741a2d21 Added support for //, assert, and uninitialized vars
git-svn-id: svn://10.0.0.236/trunk@107389 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:22:57 +00:00
blakeross%telocity.com
f1a55693bd minor optimization in radio.xml. r/sr=hewitt
git-svn-id: svn://10.0.0.236/trunk@107388 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:22:48 +00:00
waldemar%netscape.com
dac5e56b37 Added dump-regexp
git-svn-id: svn://10.0.0.236/trunk@107387 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:22:45 +00:00
waldemar%netscape.com
cf5f13c0c6 Ensured that styled text doesn't contain non-keyword symbols as styles
git-svn-id: svn://10.0.0.236/trunk@107386 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:22:14 +00:00
danm%netscape.com
c0a163eddd consolidating nsIWebBrowserChrome::CreateBrowserWindow and nsIWindowCreator::CreateChromeWindow. part of bug 88229 r=hyatt,rpotts"
git-svn-id: svn://10.0.0.236/trunk@107384 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:21:03 +00:00
pchen%netscape.com
74029aa39f bug 108539, r=jag, sr=sfraser, need to call NS_IF_RELEASE(mInner) to prevent leak of datasource, also cleaned up create instance call
git-svn-id: svn://10.0.0.236/trunk@107383 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:20:12 +00:00
danm%netscape.com
9eb95d4aed consolidating nsIWebBrowserChrome::CreateBrowserWindow and nsIWindowCreator::CreateChromeWindow. part of bug 88229 r=hyatt,rpotts
git-svn-id: svn://10.0.0.236/trunk@107382 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:19:39 +00:00
blakeross%telocity.com
603326ad56 one brace too many in radio.xml. r/sr=hewitt
git-svn-id: svn://10.0.0.236/trunk@107381 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:16:28 +00:00
ducarroz%netscape.com
de4464b584 Fix for bug 108323. Fix regression introduced with my last checkin. For some reason I cannot initialize the LDAP service in one line like other services. R=varada, SR=sspitzer
git-svn-id: svn://10.0.0.236/trunk@107380 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:15:07 +00:00
andreww%netscape.com
81d29352bb bugzilla bug 84532 r=shliang sr=hewitt line break between subject and body of message.
git-svn-id: svn://10.0.0.236/trunk@107379 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:14:06 +00:00
jgaunt%netscape.com
92dd0623c0 bug 108219 fixing filenames so mac's don't choke and adding them to the mcp file
r=hewitt
rs=sfraser


git-svn-id: svn://10.0.0.236/trunk@107378 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:13:32 +00:00
andreww%netscape.com
2ae361eabe bugzilla 59887 mac classic focus ring matches system color - r=shliang sr=hewitt
git-svn-id: svn://10.0.0.236/trunk@107377 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:12:11 +00:00
jgaunt%netscape.com
d93f453d48 bug 108219 fixing filenames so Mac's can handle them
r=hewitt
rs=sfraser


git-svn-id: svn://10.0.0.236/trunk@107376 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:11:41 +00:00
cmanske%netscape.com
a46d07c43d Fixed 'New' Composer command, b=106728, r=rcassin, sr=kin
git-svn-id: svn://10.0.0.236/trunk@107375 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:07:45 +00:00
hewitt%netscape.com
f7e3c96729 107415 - navigation problems in randomly ordered wizards, r=kerz, sr=blake
git-svn-id: svn://10.0.0.236/trunk@107374 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:07:35 +00:00
ducarroz%netscape.com
0e52e9b97a Fix for bug 102536. Need to proceed up to the end of the buffer, we were missing the last byte!
Thanks to Geoffrey.R.Gustafson@intel.com & James.P.Gurganus@intel.com for the fix. R=ducarroz, SR=bienvenu


git-svn-id: svn://10.0.0.236/trunk@107373 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:06:57 +00:00
shanjian%netscape.com
492232ac44 #107869 Reply mail doesn't inherit the original charset
r=ducarroz sr=sspitzer


git-svn-id: svn://10.0.0.236/trunk@107372 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 01:02:25 +00:00
timeless%mac.com
f571b33b80 Bugzilla Bug 83017 Frame Info dialog has title 'View Page Info'
patch by db48x@yahoo.com r=fabian sr=jst


git-svn-id: svn://10.0.0.236/trunk@107371 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 00:54:15 +00:00
sspitzer%netscape.com
87b004006d fix for regression bug#108604 and few other ab bugs.
1)  collapse the card pane inner box initially so that it doesn't look like crap
before we select a card
2)  "Edit and "Card Properties" is now "Properties"
3)  if a mailing list has focus, "Properties" should bring up the edit mailing list dialog
4)  fix js warnings
r/sr=bienvenu


git-svn-id: svn://10.0.0.236/trunk@107370 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 00:54:04 +00:00
sspitzer%netscape.com
7c19329053 fix for #107639. fix broken select offline dialog. horked by recent
grid changes.  r/sr=sspitzer fix by blakeross.


git-svn-id: svn://10.0.0.236/trunk@107369 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 00:50:56 +00:00
sspitzer%netscape.com
ad2a8546b2 fix for #108346. check rv from do_GetService() to prevent crash.
r=ducarroz, sr=bienvenu


git-svn-id: svn://10.0.0.236/trunk@107368 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 00:49:17 +00:00
harishd%netscape.com
1bfa4fee99 106746 - DD/DT should not contain each other. r=heikki, sr=attinasi.
99388 - Avoid PR_GetEnv(). sr=attinasi.


git-svn-id: svn://10.0.0.236/trunk@107367 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 00:48:11 +00:00
bzbarsky%mit.edu
4edf8f2b0f Fix inheritance of frameborder in multiply nested framesets. Bug
108164, r=timeless, sr=attinasi


git-svn-id: svn://10.0.0.236/trunk@107366 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 00:44:25 +00:00
yokoyama%netscape.com
b9407d3971 Bug 108383
removing strtok() for parsing -P correctly
as it should be.  strtok() was added by mistake 10430
/r=ccarlen; /sr=alecf


git-svn-id: svn://10.0.0.236/trunk@107365 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 00:44:18 +00:00
jband%netscape.com
9501633b32 better error message when zero passed where object or null expected. bug 108284. r=dbradley sr=shaver. Also, fix uninitilized counter var in debug only code rs=jband
git-svn-id: svn://10.0.0.236/trunk@107364 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 00:40:54 +00:00
despotdaemon%netscape.com
90b9a8240a Pseudo-automatic update of changes made by endico@mozilla.org.
git-svn-id: svn://10.0.0.236/trunk@107363 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-06 00:34:24 +00:00
blakeross%telocity.com
9c6542ebad 108592 - js error in filepicker. r=ben sr=hewitt
git-svn-id: svn://10.0.0.236/trunk@107361 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-05 23:27:44 +00:00
blakeross%telocity.com
968987e0c4 108592 - js error in filepicker. r=ben sr=hewitt
git-svn-id: svn://10.0.0.236/trunk@107360 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-05 23:26:25 +00:00
jst%netscape.com
77961e0d07 Checking in workaround for blocker bug 108526. Don't force a reset of an input if there's no parent since this causes checkboxes and radio buttons to be reset before all their attributes are added. r=sicking@bigfoot.com, sr=blizzard@mozilla.org
git-svn-id: svn://10.0.0.236/trunk@107359 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-05 23:20:05 +00:00
blakeross%telocity.com
2cbfcac3d4 108592 - js error in filepicker. r=ben sr=hewitt
git-svn-id: svn://10.0.0.236/trunk@107358 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-05 23:07:20 +00:00
rginda%netscape.com
e94dc5a898 removing dead code, see mozilla/js2
git-svn-id: svn://10.0.0.236/trunk@107357 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-05 21:46:17 +00:00
rginda%netscape.com
b217ed22ea removing dead code, see mozilla/js2
git-svn-id: svn://10.0.0.236/trunk@107355 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-05 21:38:18 +00:00
23601 changed files with 4809355 additions and 100622 deletions

43
mozilla/LEGAL Normal file
View File

@@ -0,0 +1,43 @@
Please be apprised of the following Legal Notices:
A) The U.S. District Court for the Eastern District of Virginia has
ruled that the Netscape Navigator code does not infringe Wang's U.S.
Patent No. 4,751,669 ("the '669 Patent") because: 1) HTML is not
Videotex as defined by the '669 patent; 2) web servers are not central
suppliers; and 3) Navigator does not "connect," as defined by the '669
Patent, to web servers on the Internet. Wang may appeal this decision to
the Federal Circuit. Wang contended that its Patent disclosing a
"Videotext" system, is infringed by the following functionality in the
Netscape Navigator code: 1) the animated logo and status line indicators
--See Claims 1,8 and 9; 2) the "File Save As" function --See Claims
23-27; 3) Bookmarks and Rename Bookmarks in the Properties window --See
Claims 20-22; 4) storing HTML, GIF, and JPEG files and adding filename
extensions --See Claim 38
B) Intermind owns pending U.S. patent applications on communications
systems which employ metadata ("channel objects") to define a control
structure for information transfer. The Netscape code does not infringe
as released; however, modifications which utilize channel objects as
described by Intermind should be considered carefully. The following is
a statement from Intermind: "Intermind's claims fundamentally involve
the use of a control structure to automate communications. ...The
essence of Intermind's top claim is that two devices sender and
receiver have persistent storage, communicate over a network,
and exchange a control structure including metadata which describes: 1)
what information is to be updated, 2) when to update this information,
and 3) how to transfer the updated information. In addition, at least
the receiving device must be able to process the metadata in order to
perform the update determination and transfer. Any digital
communications system which incorporates all of these elements will be
covered by Intermind's patents." See Intermind.com.
C) Stac, Inc., and its licensing agent Hi/fn, own several patents which
disclose data compression methods implementing an LZS compression
algorithm, including U.S. Patent Nos. 4,701,745 and 5,016, 009 ("the
Stac Patents"). The Netscape Communicator code does not perform
compression. If you modify the Netscape source code to perform
compression, please take notice of the Stac Patents.
D) Netscape Communications Corporation ("Netscape") does not guarantee
that any source code or executable code available from the mozilla.org
domain is Year 2000 compliant.

567
mozilla/LICENSE Normal file
View File

@@ -0,0 +1,567 @@
MOZILLA PUBLIC LICENSE
Version 1.1
---------------
1. Definitions.
1.0.1. "Commercial Use" means distribution or otherwise making the
Covered Code available to a third party.
1.1. "Contributor" means each entity that creates or contributes to
the creation of Modifications.
1.2. "Contributor Version" means the combination of the Original
Code, prior Modifications used by a Contributor, and the Modifications
made by that particular Contributor.
1.3. "Covered Code" means the Original Code or Modifications or the
combination of the Original Code and Modifications, in each case
including portions thereof.
1.4. "Electronic Distribution Mechanism" means a mechanism generally
accepted in the software development community for the electronic
transfer of data.
1.5. "Executable" means Covered Code in any form other than Source
Code.
1.6. "Initial Developer" means the individual or entity identified
as the Initial Developer in the Source Code notice required by Exhibit
A.
1.7. "Larger Work" means a work which combines Covered Code or
portions thereof with code not governed by the terms of this License.
1.8. "License" means this document.
1.8.1. "Licensable" means having the right to grant, to the maximum
extent possible, whether at the time of the initial grant or
subsequently acquired, any and all of the rights conveyed herein.
1.9. "Modifications" means any addition to or deletion from the
substance or structure of either the Original Code or any previous
Modifications. When Covered Code is released as a series of files, a
Modification is:
A. Any addition to or deletion from the contents of a file
containing Original Code or previous Modifications.
B. Any new file that contains any part of the Original Code or
previous Modifications.
1.10. "Original Code" means Source Code of computer software code
which is described in the Source Code notice required by Exhibit A as
Original Code, and which, at the time of its release under this
License is not already Covered Code governed by this License.
1.10.1. "Patent Claims" means any patent claim(s), now owned or
hereafter acquired, including without limitation, method, process,
and apparatus claims, in any patent Licensable by grantor.
1.11. "Source Code" means the preferred form of the Covered Code for
making modifications to it, including all modules it contains, plus
any associated interface definition files, scripts used to control
compilation and installation of an Executable, or source code
differential comparisons against either the Original Code or another
well known, available Covered Code of the Contributor's choice. The
Source Code can be in a compressed or archival form, provided the
appropriate decompression or de-archiving software is widely available
for no charge.
1.12. "You" (or "Your") means an individual or a legal entity
exercising rights under, and complying with all of the terms of, this
License or a future version of this License issued under Section 6.1.
For legal entities, "You" includes any entity which controls, is
controlled by, or is under common control with You. For purposes of
this definition, "control" means (a) the power, direct or indirect,
to cause the direction or management of such entity, whether by
contract or otherwise, or (b) ownership of more than fifty percent
(50%) of the outstanding shares or beneficial ownership of such
entity.
2. Source Code License.
2.1. The Initial Developer Grant.
The Initial Developer hereby grants You a world-wide, royalty-free,
non-exclusive license, subject to third party intellectual property
claims:
(a) under intellectual property rights (other than patent or
trademark) Licensable by Initial Developer to use, reproduce,
modify, display, perform, sublicense and distribute the Original
Code (or portions thereof) with or without Modifications, and/or
as part of a Larger Work; and
(b) under Patents Claims infringed by the making, using or
selling of Original Code, to make, have made, use, practice,
sell, and offer for sale, and/or otherwise dispose of the
Original Code (or portions thereof).
(c) the licenses granted in this Section 2.1(a) and (b) are
effective on the date Initial Developer first distributes
Original Code under the terms of this License.
(d) Notwithstanding Section 2.1(b) above, no patent license is
granted: 1) for code that You delete from the Original Code; 2)
separate from the Original Code; or 3) for infringements caused
by: i) the modification of the Original Code or ii) the
combination of the Original Code with other software or devices.
2.2. Contributor Grant.
Subject to third party intellectual property claims, each Contributor
hereby grants You a world-wide, royalty-free, non-exclusive license
(a) under intellectual property rights (other than patent or
trademark) Licensable by Contributor, to use, reproduce, modify,
display, perform, sublicense and distribute the Modifications
created by such Contributor (or portions thereof) either on an
unmodified basis, with other Modifications, as Covered Code
and/or as part of a Larger Work; and
(b) under Patent Claims infringed by the making, using, or
selling of Modifications made by that Contributor either alone
and/or in combination with its Contributor Version (or portions
of such combination), to make, use, sell, offer for sale, have
made, and/or otherwise dispose of: 1) Modifications made by that
Contributor (or portions thereof); and 2) the combination of
Modifications made by that Contributor with its Contributor
Version (or portions of such combination).
(c) the licenses granted in Sections 2.2(a) and 2.2(b) are
effective on the date Contributor first makes Commercial Use of
the Covered Code.
(d) Notwithstanding Section 2.2(b) above, no patent license is
granted: 1) for any code that Contributor has deleted from the
Contributor Version; 2) separate from the Contributor Version;
3) for infringements caused by: i) third party modifications of
Contributor Version or ii) the combination of Modifications made
by that Contributor with other software (except as part of the
Contributor Version) or other devices; or 4) under Patent Claims
infringed by Covered Code in the absence of Modifications made by
that Contributor.
3. Distribution Obligations.
3.1. Application of License.
The Modifications which You create or to which You contribute are
governed by the terms of this License, including without limitation
Section 2.2. The Source Code version of Covered Code may be
distributed only under the terms of this License or a future version
of this License released under Section 6.1, and You must include a
copy of this License with every copy of the Source Code You
distribute. You may not offer or impose any terms on any Source Code
version that alters or restricts the applicable version of this
License or the recipients' rights hereunder. However, You may include
an additional document offering the additional rights described in
Section 3.5.
3.2. Availability of Source Code.
Any Modification which You create or to which You contribute must be
made available in Source Code form under the terms of this License
either on the same media as an Executable version or via an accepted
Electronic Distribution Mechanism to anyone to whom you made an
Executable version available; and if made available via Electronic
Distribution Mechanism, must remain available for at least twelve (12)
months after the date it initially became available, or at least six
(6) months after a subsequent version of that particular Modification
has been made available to such recipients. You are responsible for
ensuring that the Source Code version remains available even if the
Electronic Distribution Mechanism is maintained by a third party.
3.3. Description of Modifications.
You must cause all Covered Code to which You contribute to contain a
file documenting the changes You made to create that Covered Code and
the date of any change. You must include a prominent statement that
the Modification is derived, directly or indirectly, from Original
Code provided by the Initial Developer and including the name of the
Initial Developer in (a) the Source Code, and (b) in any notice in an
Executable version or related documentation in which You describe the
origin or ownership of the Covered Code.
3.4. Intellectual Property Matters
(a) Third Party Claims.
If Contributor has knowledge that a license under a third party's
intellectual property rights is required to exercise the rights
granted by such Contributor under Sections 2.1 or 2.2,
Contributor must include a text file with the Source Code
distribution titled "LEGAL" which describes the claim and the
party making the claim in sufficient detail that a recipient will
know whom to contact. If Contributor obtains such knowledge after
the Modification is made available as described in Section 3.2,
Contributor shall promptly modify the LEGAL file in all copies
Contributor makes available thereafter and shall take other steps
(such as notifying appropriate mailing lists or newsgroups)
reasonably calculated to inform those who received the Covered
Code that new knowledge has been obtained.
(b) Contributor APIs.
If Contributor's Modifications include an application programming
interface and Contributor has knowledge of patent licenses which
are reasonably necessary to implement that API, Contributor must
also include this information in the LEGAL file.
(c) Representations.
Contributor represents that, except as disclosed pursuant to
Section 3.4(a) above, Contributor believes that Contributor's
Modifications are Contributor's original creation(s) and/or
Contributor has sufficient rights to grant the rights conveyed by
this License.
3.5. Required Notices.
You must duplicate the notice in Exhibit A in each file of the Source
Code. If it is not possible to put such notice in a particular Source
Code file due to its structure, then You must include such notice in a
location (such as a relevant directory) where a user would be likely
to look for such a notice. If You created one or more Modification(s)
You may add your name as a Contributor to the notice described in
Exhibit A. You must also duplicate this License in any documentation
for the Source Code where You describe recipients' rights or ownership
rights relating to Covered Code. You may choose to offer, and to
charge a fee for, warranty, support, indemnity or liability
obligations to one or more recipients of Covered Code. However, You
may do so only on Your own behalf, and not on behalf of the Initial
Developer or any Contributor. You must make it absolutely clear than
any such warranty, support, indemnity or liability obligation is
offered by You alone, and You hereby agree to indemnify the Initial
Developer and every Contributor for any liability incurred by the
Initial Developer or such Contributor as a result of warranty,
support, indemnity or liability terms You offer.
3.6. Distribution of Executable Versions.
You may distribute Covered Code in Executable form only if the
requirements of Section 3.1-3.5 have been met for that Covered Code,
and if You include a notice stating that the Source Code version of
the Covered Code is available under the terms of this License,
including a description of how and where You have fulfilled the
obligations of Section 3.2. The notice must be conspicuously included
in any notice in an Executable version, related documentation or
collateral in which You describe recipients' rights relating to the
Covered Code. You may distribute the Executable version of Covered
Code or ownership rights under a license of Your choice, which may
contain terms different from this License, provided that You are in
compliance with the terms of this License and that the license for the
Executable version does not attempt to limit or alter the recipient's
rights in the Source Code version from the rights set forth in this
License. If You distribute the Executable version under a different
license You must make it absolutely clear that any terms which differ
from this License are offered by You alone, not by the Initial
Developer or any Contributor. You hereby agree to indemnify the
Initial Developer and every Contributor for any liability incurred by
the Initial Developer or such Contributor as a result of any such
terms You offer.
3.7. Larger Works.
You may create a Larger Work by combining Covered Code with other code
not governed by the terms of this License and distribute the Larger
Work as a single product. In such a case, You must make sure the
requirements of this License are fulfilled for the Covered Code.
4. Inability to Comply Due to Statute or Regulation.
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Code due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description
must be included in the LEGAL file described in Section 3.4 and must
be included with all distributions of the Source Code. Except to the
extent prohibited by statute or regulation, such description must be
sufficiently detailed for a recipient of ordinary skill to be able to
understand it.
5. Application of this License.
This License applies to code to which the Initial Developer has
attached the notice in Exhibit A and to related Covered Code.
6. Versions of the License.
6.1. New Versions.
Netscape Communications Corporation ("Netscape") may publish revised
and/or new versions of the License from time to time. Each version
will be given a distinguishing version number.
6.2. Effect of New Versions.
Once Covered Code has been published under a particular version of the
License, You may always continue to use it under the terms of that
version. You may also choose to use such Covered Code under the terms
of any subsequent version of the License published by Netscape. No one
other than Netscape has the right to modify the terms applicable to
Covered Code created under this License.
6.3. Derivative Works.
If You create or use a modified version of this License (which you may
only do in order to apply it to code which is not already Covered Code
governed by this License), You must (a) rename Your license so that
the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
"MPL", "NPL" or any confusingly similar phrase do not appear in your
license (except to note that your license differs from this License)
and (b) otherwise make it clear that Your version of the license
contains terms which differ from the Mozilla Public License and
Netscape Public License. (Filling in the name of the Initial
Developer, Original Code or Contributor in the notice described in
Exhibit A shall not of themselves be deemed to be modifications of
this License.)
7. DISCLAIMER OF WARRANTY.
COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
8. TERMINATION.
8.1. This License and the rights granted hereunder will terminate
automatically if You fail to comply with terms herein and fail to cure
such breach within 30 days of becoming aware of the breach. All
sublicenses to the Covered Code which are properly granted shall
survive any termination of this License. Provisions which, by their
nature, must remain in effect beyond the termination of this License
shall survive.
8.2. If You initiate litigation by asserting a patent infringement
claim (excluding declatory judgment actions) against Initial Developer
or a Contributor (the Initial Developer or Contributor against whom
You file such action is referred to as "Participant") alleging that:
(a) such Participant's Contributor Version directly or indirectly
infringes any patent, then any and all rights granted by such
Participant to You under Sections 2.1 and/or 2.2 of this License
shall, upon 60 days notice from Participant terminate prospectively,
unless if within 60 days after receipt of notice You either: (i)
agree in writing to pay Participant a mutually agreeable reasonable
royalty for Your past and future use of Modifications made by such
Participant, or (ii) withdraw Your litigation claim with respect to
the Contributor Version against such Participant. If within 60 days
of notice, a reasonable royalty and payment arrangement are not
mutually agreed upon in writing by the parties or the litigation claim
is not withdrawn, the rights granted by Participant to You under
Sections 2.1 and/or 2.2 automatically terminate at the expiration of
the 60 day notice period specified above.
(b) any software, hardware, or device, other than such Participant's
Contributor Version, directly or indirectly infringes any patent, then
any rights granted to You by such Participant under Sections 2.1(b)
and 2.2(b) are revoked effective as of the date You first made, used,
sold, distributed, or had made, Modifications made by that
Participant.
8.3. If You assert a patent infringement claim against Participant
alleging that such Participant's Contributor Version directly or
indirectly infringes any patent where such claim is resolved (such as
by license or settlement) prior to the initiation of patent
infringement litigation, then the reasonable value of the licenses
granted by such Participant under Sections 2.1 or 2.2 shall be taken
into account in determining the amount or value of any payment or
license.
8.4. In the event of termination under Sections 8.1 or 8.2 above,
all end user license agreements (excluding distributors and resellers)
which have been validly granted by You or any distributor hereunder
prior to termination shall survive termination.
9. LIMITATION OF LIABILITY.
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
10. U.S. GOVERNMENT END USERS.
The Covered Code is a "commercial item," as that term is defined in
48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
software" and "commercial computer software documentation," as such
terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
all U.S. Government End Users acquire Covered Code with only those
rights set forth herein.
11. MISCELLANEOUS.
This License represents the complete agreement concerning subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. This License shall be governed by
California law provisions (except to the extent applicable law, if
any, provides otherwise), excluding its conflict-of-law provisions.
With respect to disputes in which at least one party is a citizen of,
or an entity chartered or registered to do business in the United
States of America, any litigation relating to this License shall be
subject to the jurisdiction of the Federal Courts of the Northern
District of California, with venue lying in Santa Clara County,
California, with the losing party responsible for costs, including
without limitation, court costs and reasonable attorneys' fees and
expenses. The application of the United Nations Convention on
Contracts for the International Sale of Goods is expressly excluded.
Any law or regulation which provides that the language of a contract
shall be construed against the drafter shall not apply to this
License.
12. RESPONSIBILITY FOR CLAIMS.
As between Initial Developer and the Contributors, each party is
responsible for claims and damages arising, directly or indirectly,
out of its utilization of rights under this License and You agree to
work with Initial Developer and Contributors to distribute such
responsibility on an equitable basis. Nothing herein is intended or
shall be deemed to constitute any admission of liability.
13. MULTIPLE-LICENSED CODE.
Initial Developer may designate portions of the Covered Code as
"Multiple-Licensed". "Multiple-Licensed" means that the Initial
Developer permits you to utilize portions of the Covered Code under
Your choice of the NPL or the alternative licenses, if any, specified
by the Initial Developer in the file described in Exhibit A.
EXHIBIT A -Mozilla Public License.
``The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
The Original Code is ______________________________________.
The Initial Developer of the Original Code is ________________________.
Portions created by ______________________ are Copyright (C) ______
_______________________. All Rights Reserved.
Contributor(s): ______________________________________.
Alternatively, the contents of this file may be used under the terms
of the _____ license (the "[___] License"), in which case the
provisions of [______] License are applicable instead of those
above. If you wish to allow use of your version of this file only
under the terms of the [____] License and not to allow others to use
your version of this file under the MPL, indicate your decision by
deleting the provisions above and replace them with the notice and
other provisions required by the [___] License. If you do not delete
the provisions above, a recipient may use your version of this file
under either the MPL or the [___] License."
[NOTE: The text of this Exhibit A may differ slightly from the text of
the notices in the Source Code files of the Original Code. You should
use the text of this Exhibit A rather than the text found in the
Original Code Source Code for Your Modifications.]
----------------------------------------------------------------------
AMENDMENTS
The Netscape Public License Version 1.1 ("NPL") consists of the
Mozilla Public License Version 1.1 with the following Amendments,
including Exhibit A-Netscape Public License. Files identified with
"Exhibit A-Netscape Public License" are governed by the Netscape
Public License Version 1.1.
Additional Terms applicable to the Netscape Public License.
I. Effect.
These additional terms described in this Netscape Public
License -- Amendments shall apply to the Mozilla Communicator
client code and to all Covered Code under this License.
II. "Netscape's Branded Code" means Covered Code that Netscape
distributes and/or permits others to distribute under one or more
trademark(s) which are controlled by Netscape but which are not
licensed for use under this License.
III. Netscape and logo.
This License does not grant any rights to use the trademarks
"Netscape", the "Netscape N and horizon" logo or the "Netscape
lighthouse" logo, "Netcenter", "Gecko", "Java" or "JavaScript",
"Smart Browsing" even if such marks are included in the Original
Code or Modifications.
IV. Inability to Comply Due to Contractual Obligation.
Prior to licensing the Original Code under this License, Netscape
has licensed third party code for use in Netscape's Branded Code.
To the extent that Netscape is limited contractually from making
such third party code available under this License, Netscape may
choose to reintegrate such code into Covered Code without being
required to distribute such code in Source Code form, even if
such code would otherwise be considered "Modifications" under
this License.
V. Use of Modifications and Covered Code by Initial Developer.
V.1. In General.
The obligations of Section 3 apply to Netscape, except to
the extent specified in this Amendment, Section V.2 and V.3.
V.2. Other Products.
Netscape may include Covered Code in products other than the
Netscape's Branded Code which are released by Netscape
during the two (2) years following the release date of the
Original Code, without such additional products becoming
subject to the terms of this License, and may license such
additional products on different terms from those contained
in this License.
V.3. Alternative Licensing.
Netscape may license the Source Code of Netscape's Branded
Code, including Modifications incorporated therein, without
such Netscape Branded Code becoming subject to the terms of
this License, and may license such Netscape Branded Code on
different terms from those contained in this License.
VI. Litigation.
Notwithstanding the limitations of Section 11 above, the
provisions regarding litigation in Section 11(a), (b) and (c) of
the License shall apply to all disputes relating to this License.
EXHIBIT A-Netscape Public License.
"The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
Contributor(s): ______________________________________.
Alternatively, the contents of this file may be used under the
terms of the _____ license (the "[___] License"), in which case
the provisions of [______] License are applicable instead of
those above. If you wish to allow use of your version of this
file only under the terms of the [____] License and not to allow
others to use your version of this file under the NPL, indicate
your decision by deleting the provisions above and replace them
with the notice and other provisions required by the [___]
License. If you do not delete the provisions above, a recipient
may use your version of this file under either the NPL or the
[___] License."

258
mozilla/Makefile.in Normal file
View File

@@ -0,0 +1,258 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = .
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/build/unix/modules.mk
ifneq ($(BUILD_MODULES),all)
DIRS = $(BUILD_MODULE_DIRS)
EXPORT_DIRS = $(BUILD_MODULE_DEP_DIRS)
else
#
# And now for something completely different...
# Divide the default build into tiers.
# Tiers must be defined on module boundaries
#
default:
$(MAKE) nspr
$(MAKE) tier_0
$(MAKE) tier_1
$(MAKE) tier_9
# Make sure that the existing rulesets work
DIRS = $(NSPRPUB_DIR) $(tier_0_dirs) $(tier_1_dirs) $(tier_9_dirs)
#
# tier 0 - base build config dirs
#
tier_0_dirs = \
config \
build \
include \
$(NULL)
#
# tier 1 - base libraries
#
tier_1_dirs = js
# MacOSX needs to build lib for MoreFiles before xpcom
ifeq ($(MOZ_WIDGET_TOOLKIT),mac)
tier_1_dirs += lib/mac/MoreFiles
endif
# intl should not be in here - it's just temporary until
# xpconnect's dependency on intl is repaired - see bug 106130
tier_9_dirs += \
modules/libreg \
string \
xpcom \
intl \
$(NULL)
ifndef MOZ_NATIVE_ZLIB
tier_9_dirs += modules/zlib
endif
# Linux and Solaris installer needs standalone libjar, hence standalone zlib
ifneq (,$(filter Linux SunOS,$(OS_ARCH)))
tier_9_dirs += modules/zlib/standalone
endif
tier_9_dirs += \
modules/libjar \
$(NULL)
#
# tier 9 - mozilla application
#
ifdef MOZ_JAVA_SUPPLEMENT
tier_9_dirs += \
java/util \
java/webclient \
$(NULL)
endif
ifndef MOZ_NATIVE_JPEG
tier_9_dirs += jpeg
endif
tier_9_dirs += dbm js/src/xpconnect
ifdef MOZ_OJI
tier_9_dirs += js/src/liveconnect
endif
ifdef MOZ_JSDEBUGGER
tier_9_dirs += js/jsd
endif
ifdef MOZ_ENABLE_XLIB
tier_9_dirs += gfx/src/xlibrgb widget/src/xlibxtbin
endif
ifdef MOZ_ENABLE_GTK
tier_9_dirs += widget/src/gtksuperwin widget/src/gtkxtbin
endif
tier_9_dirs += \
widget/timer \
modules/libutil \
netwerk \
modules/mpfilelocprovider \
uriloader \
modules/libpref \
modules/libimg \
modules/oji \
caps \
rdf \
expat \
htmlparser \
gfx \
gfx2 \
modules/libpr0n \
modules/plugin \
dom \
view \
widget \
content \
layout \
db \
docshell \
webshell \
embedding \
editor \
sun-java \
profile \
themes \
$(NULL)
ifdef ACCESSIBILITY
tier_9_dirs += accessible
endif
# This must preceed xpfe
ifdef MOZ_JPROF
tier_9_dirs += tools/jprof
endif
tier_9_dirs += xpfe xpinstall
ifdef MOZ_PSM
tier_9_dirs += security/manager
endif
ifdef MOZ_LDAP_XPCOM
tier_9_dirs += directory/c-sdk/ldap directory/xpcom
endif
ifdef MOZ_EXTENSIONS
tier_9_dirs += extensions
endif
ifdef MOZ_MAIL_NEWS
tier_9_dirs += mailnews
endif
ifdef MOZ_CALENDAR
tier_9_dirs += calendar
endif
ifdef MOZ_LEAKY
tier_9_dirs += tools/leaky
endif
ifdef ENABLE_TESTS
tier_9_dirs += xpcom/tests
endif
ifdef NS_TRACE_MALLOC
tier_9_dirs += tools/trace-malloc
endif
tier_9_dirs += l10n
ifneq (,$(MOZ_STATIC_COMPONENTS)$(MOZ_META_COMPONENTS))
tier_9_dirs += modules/staticmod
endif
tier_9_dirs += xpfe/bootstrap
endif # BUILD_MODULES == all
STATIC_MAKEFILES := $(NSPRPUB_DIR) directory/c-sdk/ldap
ifdef MOZ_PSM
STATIC_MAKEFILES += security/nss
endif
GARBAGE_DIRS += dist
DIST_GARBAGE = config.cache config.log config.status config-defs.h \
dependencies.beos config/autoconf.mk config/myrules.mk config/myconfig.mk \
unallmakefiles \
$(topsrcdir)/.mozconfig.mk $(topsrcdir)/.mozconfig.out
include $(topsrcdir)/config/rules.mk
tier_%:
@echo "$@: $($@_dirs)"
@$(EXIT_ON_ERROR) \
for d in $($@_dirs); do $(UPDATE_TITLE) \
$(MAKE) -C $$d export; \
done ; \
$(PERL) $(MOZILLA_DIR)/config/purge-old-headers.pl $(DIST)/include ;\
for d in $($@_dirs); do $(UPDATE_TITLE) \
$(MAKE) -C $$d install; \
done
#
# Individual modules
#
boehm:
ifdef GC_LEAK_DETECTOR
$(MAKE) -C gc/boehm
endif
nspr: boehm
ifdef NSPRPUB_DIR
$(MAKE) -C $(NSPRPUB_DIR)
endif
# For modules.mk standalone build
export::
+$(LOOP_OVER_EXPORT_DIRS)
export::
@$(PERL) $(MOZILLA_DIR)/config/purge-old-headers.pl $(DIST)/include
distclean::
cat unallmakefiles | $(XARGS) rm -f
rm -f unallmakefiles $(DIST_GARBAGE)

View File

@@ -0,0 +1,2 @@
Pursuant to section 3.3 of the MPL, this file will contain a list of the files
that have been modified by IBM Corporation.

View File

@@ -0,0 +1,3 @@
For mozilla-the-client build instructions, please read:
http://www.mozilla.org/build/

View File

@@ -0,0 +1,32 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = public src build
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,190 @@
<html>
<head>
<title>
How the Accessible Module works
</title>
</head>
<body>
<h1>How the Accessible module (accessibility.dll) works</h1>
<ul>
<p>
See also:
<a href="http://www.mozilla.org/projects/ui/accessibility/vendors-win.html">Gecko Info for Windows Accessibility Vendors</a>, a primer for vendors of 3rd party accessibility software, on how to use our MSAA and other relevant API's.
</p>
<p>
The <a href="http://lxr.mozilla.org/seamonkey/source/accessible/">Accessible module</a> is where we implement support for the <a href="http://www.microsoft.com/enable/msaa/">Microsoft Active Accessibility (MSAA) API</a>
(<a href="http://bugzilla.mozilla.org/show_bug.cgi?id=12952">bug 12952</a>).
Support for Sun's <a href="http://www.sun.com/access/gnome/">Gnome Accessibility API</a> is part of our future plans as well.
</p>
</ul>
<h2>What is MSAA?</h2>
<ul>
<p>
A 3rd part accessibility aid, such as a screen reader, wants to track what's happening inside Mozilla. It needs to know about
focus changes and other events, and it needs to know whtat data nodes there are in the layout tree.
Using this information,
the screen reader will speak out loud important changes to the document or UI, and allow the user to track
where they navigate. Some screen readers also magnify text and images in the currently focused area, and others
show information on a <a href="http://www.audiodata.de/e/produkte/pc/lapbraille/">refreshable braille display</a>.
</p>
<p>
In Windows, accesibility aids acquires the necessary information to do this using hacks and MSAA. MSAA is supposed
to be the "right way" for accessibility aids to get information, but sometimes the hacks are more effective.
For example, screen readers look for screen draws of a vertical blinking line, to determine the location of the caret.
Without doing this, screen readers would not be able to let the user know where there caret has moved to in most programs,
because so many applications do not use the system caret (ours is an example). This is so commonly done, that
no one even bothers to support the MSAA caret, because the hack works.
</p>
<p>
MSAA provides information in two different ways:
<ol>
<li>a COM interface (IAccessible) that allows applications to expose the tree of data nodes that make up
each window in the user interface currently being interacted with and</li>
<li> a set of system messages
that confer accessibility-related events such as focus changes, changes to document content and alerts.</li>
</ol>
</p>
<p>
To really learn about MSAA, you need to download
the entire <a href="http://www.microsoft.com/enable/msaa/download.htm">MSAA SDK</a>.
Without downloading the SDK, you won't get the complete documentation.
The SDK also contains some very useful tools, such as the Accessible Event Watcher, which shows what accessible
events are being generated by a given piece of software. The Accessible Explorer and Inspect Object tools
show the tree of data nodes the Accessible object is exposing through COM.
</p>
</ul>
<h2>IAccessible Interface</h2>
<ul>
<p>
The IAccessible interface is used in a tree of IAccessible's, each one representing a data node, similar to a DOM.
</p>
<p>
Here are the methods supported in IAccessible:
<ul>
<li>get_accParent: Get the parent of an IAccessible.</li>
<li>get_accChildCount: Get the number of children of an IAccesible.</li>
<li>get_accChild: Get the child of an Iaccessible.</li>
<li>get_accName: Get the "name" of the IAccessible, for example the name of a button, checkbox or menuitem.</li>
<li>get_accValue: Get the "value" of the IAccessible, for example a number in a slider, a URL for a link, the text a user entered in a field.</li>
<li>get_accDescription: Get a long description of the current IAccessible. This is not really too useful.</li>
<li>get_accRole: Get an enumerated value representing what this IAccessible is used for, for example.</li>
is it a link, static text, editable text, a checkbox, or a table cell, etc.</li>
<li>get_accState: a 32 bit field representing possible on/off states, such as focused, fousable, selected, selectable, visible, protected (for passwords),
checked, etc. </li>
<li>get_accHelp: Get context sensitive help for the IAccessible.</li>
<li>get_accHelpTopic: We don't use this, it's only if the Windows help system is used.</li>
<li>get_accKeyboardShortcut: What is the keyboard shortcut for this IAccessible.</li>
<li>get_accFocus: Which child is focused?</li>
<li>get_accSelection: Which children of this item are selected?</li>
<li>get_accDefaultAction: Get a description or name of the default action for this component, such as "jump" for links.</li>
<li>accSelect: Select the item associated with this IAccessible.</li>
<li>accLocation: Get the x,y coordinates, and the height and width of this IAccessible node.</li>
<li>accNavigate: Navigate up, down, left or right from this IAccessible.</li>
<li>accHitTest: Find out what IAccessible exists and a specific coordinate.</li>
<li>accDoDefaultAction: Perform the action described by get_accDefaultAction.</li>
<li>put_accName: Change the name.</li>
<li>put_accValue: Change the value.</li>
</ul>
</p>
</ul>
<h2>The Basics</h2>
<ul>
<p>
Rather than directly implement IAccessible with an Accessible class, we have chosen to proxy to our own cross-platform interface,
called nsIAccessible, which is more robust. It has the capability of supporting other new accessibility API's such
as Sun's Gnome Accessiblity API. The nsIAccessible interface is implemented by a variety of classes for each of the
various objects in HTML. Each class is tailored to the specific abilities and properties of the HTML objects it applies to.
</p>
<p>
The first thing that happens when an accessibility aid wants to watch our application is calls the Windows API function
AccessibleObjectFromWindow(). This in turns sends the window in question
a <a href="http://lxr.mozilla.org/seamonkey/search?string=WM_GETOBJECT">WM_GETOBJECT</a> message requesting an IAccessible for the window.
In our case, this event is received in mozilla/widget/src/windows/nsWindow.cpp.
We send back an IAccessible interface that represents that root window. The accessibility aid will use
that first IAccessible to reach rest of the IAccessible hierarchy, by asking for it's children IAccessibles, asking the children for the
grandchildren IAccessibles, and so on. Until this WM_GETOBJECT message is processed, the accessibility.dll is not loaded,
so there is almost zero overhead for accessibility in Mozilla.
</p>
</ul>
<h2>How the IAccessible's are Created</h2>
<ul>
<p>
To create the root IAccessible for a window the first time it gets the <a href="http://lxr.mozilla.org/seamonkey/search?string=WM_GETOBJECT">WM_GETOBJECT</a> message in,
nsWindow.cpp first generates an internal event
called <a href="http://lxr.mozilla.org/seamonkey/search?string=NS_GETACCESSIBLE">NS_GETACCESSIBLE</a>,
which is handled in nsFrame.cpp via the creation of an nsRootAccessible implementation of the nsIAccessible interface.
The first IAccessible is then created by instantiating a RootAccessible class. This RootAccessible is also cached by
the nsWindow it's for, so that any additional WM_GETOBJECT messages use the same RootAccessible.
The RootAccessible class used to implement IAccessible here is slightly different from the normal Accessible class
that's used, in that it keeps track of event data.
RootAccessible and Accessible are both implemented
in <a href="http://lxr.mozilla.org/seamonkey/source/widget/source/windows/Accessible.cpp">
mozilla/widget/src/windows/Accessible.cpp</a>).
</P>
</ul>
<h2>The Real Power Behind IAccessible's</h2>
<ul>
<p>The implementations of IAccessible (Accessible and RootAccessible), don't know anything about Mozilla
objects. They merely proxy to our cross platform accessibility classes, which all have an nsIAccessible interface.
</h2>
<p>
The base implementation for nsIAccessible is called nsAccessible. It has default implementations for all the
nsIAccessible methods. It also knows how
to walk Mozilla's content DOM and frame tree, exposing only the objects that are needed for accessibility.
Essentially, nsAccessible knows what it needs to expose by asking each DOM node's primary frame for
an nsIAccessible, using the GetAccessible() method. If it gets one, it's considered an accessible object.
A frame that wishes to return
an nsIAccessible GetAccessible() is called, creates one of the correct type on the fly using
nsIAccessibilityService methods built for that purpose.
</p>
<p>
The specific implementations
of nsIAccessible for each widget or content type inherit from nsAccessible.
Each implementation then overrides those methods
it wishes to implement, and does nothing for those methods it wants the default behavior for.
For example, the default behavior for nsIAccessible::getAccFirstChild is to
instantial a nsDOMTreeWalker, and ask it for the first child. However, nsImageAccessible overrides getAccFirstChild,
returning the first area of an image map if there is one, otherwise nsnull.
</p>
</ul>
<h2>MSAA Events</h2>
<ul>
<p>
When an accessibility-related event occurs within an application such as Mozilla, it must use NotifyWinEvent from
the Win32 API. NotifyWinEvent is passed arguments for the window the event occured in, and the number of the child
within that window. Accessibility aids use the Win32 call SetWinEventHook() to register as a listener for these events.
</p>
<p>
The accessibility aid is choose which events it is interested in learning more about by using the Win32 API call
AccessibleObjectFromEvent, requesting the IAccessible to the node corresponding to the
child number that had been indicated from NotifyWinEvent(). This ends up asking our RootAccessible for the child
IAccessible that matches the window handle and child id we indicated through NotofyWinEvent().
</p>
<p>
In Mozilla, this creates a problem. We cannot
keep track of a child number for every important accessible node in a document. We deal with this by generating fake
child IDs for the most recent accessibile events that we have generated, in a circular array.
</p>
<p>
Since there is a RootAccessible for each top level window that might generate MSAA events, that's where we do the bookkeeping
for these events and their nsIAccessible's. Whenever NotifyWinEvent() is called, a new fake ID is generated (We use
negative numbers for the fake IDs). When the callback comes to request the IAccessible for that child number,
we check the circular array for that ID, and voila, we have the corresponding nsIAccessible to proxy.
</p>
<p>
Every RootAccessible has an nsRootAccessible which is an nsIAccessibleEventReceiver. The RootAccessible
uses this to register itself as an nsIAccessibleEventListener. In the end, nsRootAccessible registers itself as a listener
of Mozilla's internal and DOM events. It's HandleEvent routine translates these events into MSAA events, and passes them along to
with an nsIAccessible to the original RootAccessible::HandleEvent
which turns that nsIAccessible into a NotifyWinEvent call, complete with a fake child ID.
</p>
<p>
Most MSAA events aren't utilized by accessibility aids. Therefore we implement only the handful that matter.
The most important event is the focus event, followed by name, state and value change events.
</p>
</ul>
</body>
</html>

View File

@@ -0,0 +1,60 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = accessibility
LIBRARY_NAME = accessibility
EXPORT_LIBRARY = 1
SHORT_LIBNAME = access
IS_COMPONENT = 1
MODULE_NAME = nsAccessibilityModule
REQUIRES = xpcom \
string \
dom \
$(NULL)
CPPSRCS = nsAccessibilityFactory.cpp
LOCAL_INCLUDES = -I$(srcdir)/../src
SHARED_LIBRARY_LIBS = \
$(DIST)/lib/libaccessibility_s.$(LIB_SUFFIX) \
$(NULL)
EXTRA_DSO_LIBS = \
gkconshared_s \
$(NULL)
EXTRA_DSO_LDOPTS = \
$(MOZ_COMPONENT_LIBS) \
-L$(DIST)/lib \
$(EXTRA_DSO_LIBS) \
-lgkgfx \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,50 @@
#!gmake
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
DEPTH=..\..
MODULE=accessibility
REQUIRES = xpcom \
string \
dom \
$(NULL)
LIBRARY_NAME=accessibility
MODULE_NAME=nsAccessibilityModule
CPP_OBJS=\
.\$(OBJDIR)\nsAccessibilityFactory.obj \
$(NULL)
LINCS = $(LINCS) -I..\src # for implementation headers
SUB_LIBRARIES=\
$(DIST)\lib\accessibility_s.lib \
$(NULL)
LLIBS=\
$(DIST)\lib\xpcom.lib \
$(DIST)\lib\timer_s.lib \
$(DIST)\lib\gkgfx.lib \
$(DIST)\lib\contentshared_s.lib \
$(LIBNSPR) \
$(NULL)
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,76 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsCOMPtr.h"
#include "nsIModule.h"
#include "nsIGenericFactory.h"
#include "nsIServiceManager.h"
#include "nsIComponentManager.h"
#include "nsIAccessibilityService.h"
#include "nscore.h"
static NS_IMETHODIMP
NS_ConstructAccessibilityService(nsISupports *aOuter, REFNSIID aIID, void **aResult)
{
nsresult rv;
NS_ASSERTION(aOuter == nsnull, "no aggregation");
nsIAccessibilityService* accessibility;
rv = NS_NewAccessibilityService(&accessibility);
if (NS_FAILED(rv)) {
NS_ERROR("Unable to construct chrome registry");
return rv;
}
rv = accessibility->QueryInterface(aIID, aResult);
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to find correct interface");
NS_RELEASE(accessibility);
return rv;
}
// The list of components we register
static nsModuleComponentInfo components[] =
{
{ "AccessibilityService",
NS_ACCESSIBILITY_SERVICE_CID,
"@mozilla.org/accessibilityService;1",
NS_ConstructAccessibilityService
},
};
NS_IMPL_NSGETMODULE(nsAccessibilityModule, components);

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,26 @@
#!gmake
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
DEPTH=..
DIRS= public src build
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,2 @@
nsIAccessibilityService.idl
nsIAccessible.idl

View File

@@ -0,0 +1,46 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = accessibility
XPIDL_MODULE= accessibility
XPIDLSRCS = \
nsIAccessibilityService.idl \
nsIAccessible.idl \
nsIAccessibleDocument.idl \
nsIAccessibleEventReceiver.idl \
nsIAccessibleEventListener.idl \
nsIAccessibleSelectable.idl \
nsIAccessibleProvider.idl \
$(NULL)
EXPORTS = \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,39 @@
#!gmake
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
DEPTH=..\..
MODULE=accessibility
XPIDL_MODULE=accessibility
XPIDLSRCS = \
.\nsIAccessibilityService.idl \
.\nsIAccessible.idl \
.\nsIAccessibleDocument.idl \
.\nsIAccessibleEventReceiver.idl \
.\nsIAccessibleEventListener.idl \
.\nsIAccessibleSelectable.idl \
.\nsIAccessibleProvider.idl \
$(NULL)
EXPORTS = \
$(NULL)
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,71 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Original Author: Eric Vaughan (evaughan@netscape.com)
*
* Contributor(s):
*/
#include "nsISupports.idl"
#include "domstubs.idl"
#include "nsIAtom.idl"
#include "domstubs.idl"
#include "nsIAccessible.idl"
interface nsIWeakReference;
[scriptable, uuid(68D9720A-0984-42b6-A3F5-8237ED925727)]
interface nsIAccessibilityService : nsISupports
{
nsIAccessible createRootAccessible(in nsISupports aPresContext, in nsISupports aFrame);
nsIAccessible createHTMLComboboxAccessible(in nsIDOMNode aNode, in nsISupports aPresShell);
nsIAccessible createHTMLListboxAccessible(in nsIDOMNode aNode, in nsISupports aPresShell);
nsIAccessible createHTMLSelectOptionAccessible(in nsIDOMNode aNode, in nsIAccessible aAccParent, in nsISupports aPresShell);
nsIAccessible createHTMLCheckboxAccessible(in nsISupports aFrame);
nsIAccessible createHTMLRadioButtonAccessible(in nsISupports aFrame);
nsIAccessible createHTMLButtonAccessible(in nsISupports aFrame);
nsIAccessible createHTML4ButtonAccessible(in nsISupports aFrame);
nsIAccessible createHTMLTextAccessible(in nsISupports aFrame);
nsIAccessible createHTMLImageAccessible(in nsISupports aFrame);
nsIAccessible createHTMLAreaAccessible(in nsIWeakReference aPresShell, in nsIDOMNode aDOMNode, in nsIAccessible aAccParent);
nsIAccessible createHTMLTableAccessible(in nsISupports aFrame);
nsIAccessible createHTMLTableCellAccessible(in nsISupports aFrame);
nsIAccessible createHTMLTextFieldAccessible(in nsISupports aFrame);
nsIAccessible createHTMLIFrameAccessible(in nsIDOMNode aNode, in nsISupports aPresContext);
nsIAccessible createHTMLBlockAccessible(in nsIDOMNode aNode, in nsISupports aDocument);
nsIAccessible createXULButtonAccessible(in nsIDOMNode aNode);
nsIAccessible createXULCheckboxAccessible(in nsIDOMNode aNode);
nsIAccessible createXULImageAccessible(in nsIDOMNode aNode);
nsIAccessible createXULTextAccessible(in nsIDOMNode aNode);
nsIAccessible createAccessible(in nsIDOMNode aNode, in nsISupports aDocument);
nsIAccessible getAccessibleFor(in nsIDOMNode aNode);
};
%{ C++
// for component registration
// {DE401C37-9A7F-4278-A6F8-3DE2833989EF}
#define NS_ACCESSIBILITY_SERVICE_CID \
{ 0xde401c37, 0x9a7f, 0x4278, { 0xa6, 0xf8, 0x3d, 0xe2, 0x83, 0x39, 0x89, 0xef } }
extern nsresult
NS_NewAccessibilityService(nsIAccessibilityService** aResult);
%}

View File

@@ -0,0 +1,192 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Original Author: Eric D Vaughan (evaughan@netscape.com)
*
* Contributor(s):
* Aaron Leventhal
* John Gaunt
*/
#include "nsISupports.idl"
#include "nsIDOMNode.idl"
#include "domstubs.idl"
[scriptable, uuid(B26FBE47-9A5F-42a1-822B-082461AE4D6D)]
interface nsIAccessible : nsISupports
{
readonly attribute nsIAccessible accParent;
readonly attribute nsIAccessible accNextSibling;
readonly attribute nsIAccessible accPreviousSibling;
readonly attribute nsIAccessible accFirstChild;
readonly attribute nsIAccessible accLastChild;
readonly attribute long accChildCount;
attribute DOMString accName;
readonly attribute DOMString accValue;
readonly attribute DOMString accDescription;
readonly attribute unsigned long accRole;
readonly attribute unsigned long accState;
readonly attribute unsigned long accExtState;
readonly attribute DOMString accHelp;
readonly attribute nsIAccessible accFocused;
nsIAccessible accGetAt(in long x, in long y);
nsIAccessible accNavigateRight();
nsIAccessible accNavigateLeft();
nsIAccessible accNavigateUp();
nsIAccessible accNavigateDown();
void accGetBounds(out long x,
out long y,
out long width,
out long height);
void accAddSelection();
void accRemoveSelection();
void accExtendSelection();
void accTakeSelection();
void accTakeFocus();
readonly attribute PRUint8 accNumActions;
DOMString getAccActionName(in PRUint8 index);
void accDoAction(in PRUint8 index); // Action number 0 is the default action
nsIDOMNode accGetDOMNode();
// Used by Accessible implementation to save data and speed up accessibility tree walking
[noscript] void CacheOptimizations(in nsIAccessible aParent, in PRInt32 aSiblingIndex, in nsIDOMNodeList aSiblingList);
// MSAA State flags - used for bitfield. More than 1 allowed.
const unsigned long STATE_UNAVAILABLE = 0x00000001; // Disabled, maps to opposite of Java ENABLED, Gnome/ATK SENSITIVE?
const unsigned long STATE_SELECTED = 0x00000002;
const unsigned long STATE_FOCUSED = 0x00000004;
const unsigned long STATE_PRESSED = 0x00000008;
const unsigned long STATE_CHECKED = 0x00000010;
const unsigned long STATE_MIXED = 0x00000020; // 3-state checkbox or toolbar button
const unsigned long STATE_READONLY = 0x00000040; // Maps to opposite of Java/Gnome/ATK EDITABLE state
const unsigned long STATE_HOTTRACKED = 0x00000080;
const unsigned long STATE_DEFAULT = 0x00000100;
const unsigned long STATE_EXPANDED = 0x00000200;
const unsigned long STATE_COLLAPSED = 0x00000400;
const unsigned long STATE_BUSY = 0x00000800;
const unsigned long STATE_FLOATING = 0x00001000; // Children "owned" not "contained" by parent
const unsigned long STATE_MARQUEED = 0x00002000;
const unsigned long STATE_ANIMATED = 0x00004000;
const unsigned long STATE_INVISIBLE = 0x00008000;
const unsigned long STATE_OFFSCREEN = 0x00010000;
const unsigned long STATE_SIZEABLE = 0x00020000;
const unsigned long STATE_MOVEABLE = 0x00040000;
const unsigned long STATE_SELFVOICING = 0x00080000;
const unsigned long STATE_FOCUSABLE = 0x00100000;
const unsigned long STATE_SELECTABLE = 0x00200000;
const unsigned long STATE_LINKED = 0x00400000;
const unsigned long STATE_TRAVERSED = 0x00800000;
const unsigned long STATE_MULTISELECTABLE = 0x01000000; // Supports multiple selection
const unsigned long STATE_EXTSELECTABLE = 0x02000000; // Supports extended selection
const unsigned long STATE_ALERT_LOW = 0x04000000; // This information is of low priority
const unsigned long STATE_ALERT_MEDIUM = 0x08000000; // This information is of medium priority
const unsigned long STATE_ALERT_HIGH = 0x10000000; // This information is of high priority
const unsigned long STATE_PROTECTED = 0x20000000; // Maps to Gnome's *Role* ATK_ROLE_PASSWD_TEXT, nothing for Java?
const unsigned long STATE_HASPOPUP = 0x40000000; // New in MSAA 2.0
// Extended state flags (for now non-MSAA, for Java and Gnome/ATK support)
// This is only the states that there isn't already a mapping for in MSAA
// See www.accessmozilla.org/article.php?sid=11 for information on the mappings between accessibility API states
const unsigned long STATE_INVALID = 0x00200000; // No explanation given
const unsigned long STATE_ACTIVE = 0x00400000; // This window is currently the active window
const unsigned long STATE_EXPANDABLE = 0x00800000; // An item that can be expanded, such as a tree item with children
const unsigned long STATE_MODAL = 0x01000000; // Must do something with control before leaving it
const unsigned long STATE_MULTI_LINE = 0x02000000; // Edit control that can take multiple lines
const unsigned long STATE_SENSITIVE = 0x04000000; // No explanation given
const unsigned long STATE_RESIZABLE = 0x08000000; // Object can be resized
const unsigned long STATE_SHOWING = 0x10000000; // This object and all of it's ancestors are visible
const unsigned long STATE_SINGLE_LINE = 0x20000000; // This text object can only contain 1 line of text
const unsigned long STATE_TRANSIENT = 0x40000000; // Tells accessibility aid "Don't add event listener - this object doesn't generate any". For example, could be used with higher level containers.
const unsigned long STATE_VERTICAL = 0x80000000; // Especially used for sliders and scrollbars
// MSAA Roles - only one per nsIAccessible or IAccessible
const unsigned long ROLE_TITLEBAR = 0x00000001;
const unsigned long ROLE_MENUBAR = 0x00000002;
const unsigned long ROLE_SCROLLBAR = 0x00000003;
const unsigned long ROLE_GRIP = 0x00000004;
const unsigned long ROLE_SOUND = 0x00000005;
const unsigned long ROLE_CURSOR = 0x00000006;
const unsigned long ROLE_CARET = 0x00000007;
const unsigned long ROLE_ALERT = 0x00000008;
const unsigned long ROLE_WINDOW = 0x00000009;
const unsigned long ROLE_CLIENT = 0x0000000A;
const unsigned long ROLE_MENUPOPUP = 0x0000000B;
const unsigned long ROLE_MENUITEM = 0x0000000C;
const unsigned long ROLE_TOOLTIP = 0x0000000D;
const unsigned long ROLE_APPLICATION = 0x0000000E;
const unsigned long ROLE_DOCUMENT = 0x0000000F;
const unsigned long ROLE_PANE = 0x00000010;
const unsigned long ROLE_CHART = 0x00000011;
const unsigned long ROLE_DIALOG = 0x00000012;
const unsigned long ROLE_BORDER = 0x00000013;
const unsigned long ROLE_GROUPING = 0x00000014;
const unsigned long ROLE_SEPARATOR = 0x00000015;
const unsigned long ROLE_TOOLBAR = 0x00000016;
const unsigned long ROLE_STATUSBAR = 0x00000017;
const unsigned long ROLE_TABLE = 0x00000018;
const unsigned long ROLE_COLUMNHEADER = 0x00000019;
const unsigned long ROLE_ROWHEADER = 0x0000001A;
const unsigned long ROLE_COLUMN = 0x0000001B;
const unsigned long ROLE_ROW = 0x0000001C;
const unsigned long ROLE_CELL = 0x0000001D;
const unsigned long ROLE_LINK = 0x0000001E;
const unsigned long ROLE_HELPBALLOON = 0x0000001F;
const unsigned long ROLE_CHARACTER = 0x00000020;
const unsigned long ROLE_LIST = 0x00000021;
const unsigned long ROLE_LISTITEM = 0x00000022;
const unsigned long ROLE_OUTLINE = 0x00000023;
const unsigned long ROLE_OUTLINEITEM = 0x00000024;
const unsigned long ROLE_PAGETAB = 0x00000025;
const unsigned long ROLE_PROPERTYPAGE = 0x00000026;
const unsigned long ROLE_INDICATOR = 0x00000027;
const unsigned long ROLE_GRAPHIC = 0x00000028;
const unsigned long ROLE_STATICTEXT = 0x00000029;
const unsigned long ROLE_TEXT = 0x0000002A; // Editable, selectable, etc.
const unsigned long ROLE_PUSHBUTTON = 0x0000002B;
const unsigned long ROLE_CHECKBUTTON = 0x0000002C;
const unsigned long ROLE_RADIOBUTTON = 0x0000002D;
const unsigned long ROLE_COMBOBOX = 0x0000002E;
const unsigned long ROLE_DROPLIST = 0x0000002F;
const unsigned long ROLE_PROGRESSBAR = 0x00000030;
const unsigned long ROLE_DIAL = 0x00000031;
const unsigned long ROLE_HOTKEYFIELD = 0x00000032;
const unsigned long ROLE_SLIDER = 0x00000033;
const unsigned long ROLE_SPINBUTTON = 0x00000034;
const unsigned long ROLE_DIAGRAM = 0x00000035;
const unsigned long ROLE_ANIMATION = 0x00000036;
const unsigned long ROLE_EQUATION = 0x00000037;
const unsigned long ROLE_BUTTONDROPDOWN = 0x00000038;
const unsigned long ROLE_BUTTONMENU = 0x00000039;
const unsigned long ROLE_BUTTONDROPDOWNGRID = 0x0000003A;
const unsigned long ROLE_WHITESPACE = 0x0000003B;
const unsigned long ROLE_PAGETABLIST = 0x0000003C;
const unsigned long ROLE_CLOCK = 0x0000003D;
const unsigned long ROLE_SPLITBUTTON = 0x0000003E; // New in MSAA 2.0
const unsigned long ROLE_IPADDRESS = 0x0000003F; // New in MSAA 2.0
};

View File

@@ -0,0 +1,41 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Original Author: Aaron Leventhal
*
* Contributor(s):
* John Gaunt
*/
#include "nsISupports.idl"
#include "nsIAccessible.idl"
#include "domstubs.idl"
interface nsIDocument;
[scriptable, uuid(8781FC88-355F-4439-881F-6504A0A1CEB6)]
interface nsIAccessibleDocument : nsISupports
{
readonly attribute DOMString URL;
readonly attribute DOMString title;
readonly attribute DOMString mimeType;
readonly attribute DOMString docType;
DOMString getNameSpaceURIForID(in short nameSpaceID);
[noscript] nsIDocument getDocument();
};

View File

@@ -0,0 +1,41 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Original Author: Eric D Vaughan (evaughan@netscape.com)
*
* Contributor(s):
*/
#include "nsISupports.idl"
#include "nsIAccessible.idl"
[scriptable, uuid(BEE49E7D-9D06-49bf-8984-1694C697D74F)]
interface nsIAccessibleEventListener : nsISupports
{
// these are set to the values given by MSAA
const unsigned long EVENT_FOCUS = 0x8005;
const unsigned long EVENT_STATE_CHANGE = 0x800A;
const unsigned long EVENT_NAME_CHANGE = 0x800C;
const unsigned long EVENT_SELECTION = 0x8006;
const unsigned long EVENT_SELECTION_ADD = 0x8007;
const unsigned long EVENT_SELECTION_REMOVE = 0x8008;
const unsigned long EVENT_SELECTION_WITHIN = 0x8009;
void handleEvent(in unsigned long aEvent, in nsIAccessible aTarget);
};

View File

@@ -0,0 +1,32 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Original Author: Eric D Vaughan (evaughan@netscape.com)
*
* Contributor(s):
*/
#include "nsIAccessibleEventListener.idl"
[scriptable, uuid(AB331E47-4FAA-4a12-9480-9B480DD78B39)]
interface nsIAccessibleEventReceiver : nsISupports
{
void addAccessibleEventListener(in nsIAccessibleEventListener aListener);
void removeAccessibleEventListener();
};

View File

@@ -0,0 +1,33 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Original Author: John Gaunt (jgaunt@netscape.com)
*
* Contributor(s):
* John Gaunt
*/
#include "nsISupports.idl"
#include "nsIAccessible.idl"
[scriptable, uuid(3f0e3eb0-1dd2-11b2-9605-be5b8e76cf4b)]
interface nsIAccessibleProvider : nsISupports
{
readonly attribute nsIAccessible accessible;
};

View File

@@ -0,0 +1,34 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Original Author: John Gaunt (jgaunt@netscape.com)
*
* Contributor(s):
* John Gaunt
*/
#include "nsISupports.idl"
#include "nsIAccessible.idl"
#include "nsISupportsArray.idl"
[scriptable, uuid(34d268d6-1dd2-11b2-9d63-83a5e0ada290)]
interface nsIAccessibleSelectable : nsISupports
{
nsISupportsArray GetSelectedChildren();
};

View File

@@ -0,0 +1 @@
accessible.properties

View File

@@ -0,0 +1,80 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = accessibility
LIBRARY_NAME = accessibility_s
REQUIRES = xpcom \
string \
gfx \
layout \
content \
widget \
dom \
view \
locale \
intl \
docshell \
webshell \
necko \
htmlparser \
xuldoc \
imglib2 \
gfx2 \
uriloader \
timer \
$(NULL)
CPPSRCS = \
nsAccessible.cpp \
nsAccessibilityService.cpp \
nsBaseWidgetAccessible.cpp \
nsFormControlAccessible.cpp \
nsGenericAccessible.cpp \
nsHTMLAreaAccessible.cpp \
nsHTMLFormControlAccessible.cpp \
nsHTMLIFrameRootAccessible.cpp \
nsHTMLImageAccessible.cpp \
nsHTMLLinkAccessible.cpp \
nsHTMLSelectAccessible.cpp \
nsHTMLTableAccessible.cpp \
nsHTMLTextAccessible.cpp \
nsRootAccessible.cpp \
nsSelectAccessible.cpp \
nsXULFormControlAccessible.cpp \
nsXULTextAccessible.cpp \
$(NULL)
EXPORTS = \
nsRootAccessible.h \
$(NULL)
# we don't want the shared lib, but we want to force the creation of a static lib.
FORCE_STATIC_LIB = 1
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,5 @@
jump = Jump
press = Press
check = Check
uncheck = Uncheck
select = Select

View File

@@ -0,0 +1 @@
accessible.properties

View File

@@ -0,0 +1,5 @@
jump = Jump
press = Press
check = Check
uncheck = Uncheck
select = Select

View File

@@ -0,0 +1,3 @@
en-US.jar:
locale/en-US/global/accessible.properties

View File

@@ -0,0 +1,790 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Original Author: David W. Hyatt (hyatt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#include "nsAccessible.h"
#include "nsCOMPtr.h"
#include "nsIDocument.h"
#include "nsIPresShell.h"
#include "nsIPresContext.h"
#include "nsIContent.h"
#include "nsIFrame.h"
#include "nsRootAccessible.h"
#include "nsINameSpaceManager.h"
#include "nsLayoutAtoms.h"
#include "nsIDOMNode.h"
#include "nsHTMLTextAccessible.h"
#include "nsITextContent.h"
#include "nsTextFragment.h"
#include "nsHTMLTableAccessible.h"
#include "nsHTMLImageAccessible.h"
#include "nsHTMLAreaAccessible.h"
#include "nsHTMLLinkAccessible.h"
#include "nsHTMLSelectAccessible.h"
#include "nsIDOMHTMLAreaElement.h"
#include "nsHTMLFormControlAccessible.h"
#include "nsIAccessibleProvider.h"
#include "nsILink.h"
#include "nsIDocShellTreeItem.h"
#include "nsIDOMDocument.h"
#include "nsIDOMHTMLOptionElement.h"
#include "nsIDOMXULCheckboxElement.h"
#include "nsXULFormControlAccessible.h"
#include "nsXULTextAccessible.h"
#include "nsString.h"
// IFrame
#include "nsIDocShell.h"
#include "nsHTMLIFrameRootAccessible.h"
/**
* nsAccessibility Service
*/
nsAccessibilityService::nsAccessibilityService()
{
NS_INIT_REFCNT();
}
nsAccessibilityService::~nsAccessibilityService()
{
}
NS_IMPL_THREADSAFE_ISUPPORTS1(nsAccessibilityService, nsIAccessibilityService);
////////////////////////////////////////////////////////////////////////////////
// nsIAccessibilityService methods:
NS_IMETHODIMP
nsAccessibilityService::CreateRootAccessible(nsISupports* aPresContext, nsISupports* aFrame, nsIAccessible **_retval)
{
// XXX - jgaunt - looks like we aren't using this
//nsIFrame* f = NS_STATIC_CAST(nsIFrame*, aFrame);
nsCOMPtr<nsIPresContext> presContext(do_QueryInterface(aPresContext));
NS_ASSERTION(presContext,"Error non prescontext passed to accessible factory!!!");
nsCOMPtr<nsIPresShell> presShell;
presContext->GetShell(getter_AddRefs(presShell));
NS_ASSERTION(presShell,"Error not presshell!!");
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(presShell));
*_retval = new nsRootAccessible(weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateHTMLComboboxAccessible(nsIDOMNode* aDOMNode, nsISupports* aPresContext, nsIAccessible **_retval)
{
nsCOMPtr<nsIPresContext> presContext(do_QueryInterface(aPresContext));
NS_ASSERTION(presContext,"Error non prescontext passed to accessible factory!!!");
nsCOMPtr<nsIPresShell> presShell;
presContext->GetShell(getter_AddRefs(presShell));
nsCOMPtr<nsIWeakReference> weakShell = do_GetWeakReference(presShell);
*_retval = new nsHTMLComboboxAccessible(aDOMNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateHTMLListboxAccessible(nsIDOMNode* aDOMNode, nsISupports* aPresContext, nsIAccessible **_retval)
{
nsCOMPtr<nsIPresContext> presContext(do_QueryInterface(aPresContext));
NS_ASSERTION(presContext,"Error non prescontext passed to accessible factory!!!");
nsCOMPtr<nsIPresShell> presShell;
presContext->GetShell(getter_AddRefs(presShell));
nsCOMPtr<nsIWeakReference> weakShell = do_GetWeakReference(presShell);
*_retval = new nsHTMLListboxAccessible(aDOMNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateHTMLSelectOptionAccessible(nsIDOMNode* aDOMNode, nsIAccessible *aAccParent, nsISupports* aPresContext, nsIAccessible **_retval)
{
nsCOMPtr<nsIPresContext> presContext(do_QueryInterface(aPresContext));
NS_ASSERTION(presContext,"Error non prescontext passed to accessible factory!!!");
nsCOMPtr<nsIPresShell> presShell;
presContext->GetShell(getter_AddRefs(presShell));
nsCOMPtr<nsIWeakReference> weakShell = do_GetWeakReference(presShell);
*_retval = new nsHTMLSelectOptionAccessible(aAccParent, aDOMNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/* nsIAccessible createHTMLCheckboxAccessible (in nsISupports aPresShell, in nsISupports aFrame); */
NS_IMETHODIMP nsAccessibilityService::CreateHTMLCheckboxAccessible(nsISupports *aFrame, nsIAccessible **_retval)
{
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv))
return rv;
*_retval = new nsHTMLCheckboxAccessible(node, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsAccessibilityService::CreateXULCheckboxAccessible(nsIDOMNode *aNode, nsIAccessible **_retval)
{
nsCOMPtr<nsIWeakReference> weakShell;
GetShellFromNode(aNode, getter_AddRefs(weakShell));
// reusing the HTML accessible widget and enhancing for XUL
*_retval = new nsXULCheckboxAccessible(aNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/* nsIAccessible createHTMRadioButtonAccessible (in nsISupports aPresShell, in nsISupports aFrame); */
NS_IMETHODIMP nsAccessibilityService::CreateHTMLRadioButtonAccessible(nsISupports *aFrame, nsIAccessible **_retval)
{
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv))
return rv;
*_retval = new nsHTMLRadioButtonAccessible(node, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/* nsIAccessible createHTMLButtonAccessible (in nsISupports aPresShell, in nsISupports aFrame); */
NS_IMETHODIMP nsAccessibilityService::CreateHTMLButtonAccessible(nsISupports *aFrame, nsIAccessible **_retval)
{
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv))
return rv;
*_retval = new nsHTMLButtonAccessible(node, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/* nsIAccessible createHTML4ButtonAccessible (in nsISupports aPresShell, in nsISupports aFrame); */
NS_IMETHODIMP nsAccessibilityService::CreateHTML4ButtonAccessible(nsISupports *aFrame, nsIAccessible **_retval)
{
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv))
return rv;
*_retval = new nsHTML4ButtonAccessible(node, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsAccessibilityService::CreateXULButtonAccessible(nsIDOMNode *aNode, nsIAccessible **_retval)
{
nsCOMPtr<nsIWeakReference> weakShell;
GetShellFromNode(aNode, getter_AddRefs(weakShell));
// reusing the HTML accessible widget and enhancing for XUL
*_retval = new nsXULButtonAccessible(aNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/* nsIAccessible createHTMLTextAccessible (in nsISupports aPresShell, in nsISupports aFrame); */
NS_IMETHODIMP nsAccessibilityService::CreateHTMLTextAccessible(nsISupports *aFrame, nsIAccessible **_retval)
{
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv))
return rv;
*_retval = nsnull;
nsCOMPtr<nsITextContent> textContent(do_QueryInterface(node));
if (textContent) {
// If empty text string, don't include in accessible tree
// Items with length 0 are already gone, we just need to check for single NBSP's
PRInt32 textLength = 0;
textContent->GetTextLength(&textLength);
if (textLength == 1) {
const PRUnichar NBSP = 160;
const nsTextFragment *textFrag;
nsresult rv = textContent->GetText(&textFrag);
PRUnichar theChar = textFrag->CharAt(0);
if (theChar == NBSP)
return NS_ERROR_FAILURE;
}
}
*_retval = new nsHTMLTextAccessible(node, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsAccessibilityService::CreateXULTextAccessible(nsIDOMNode *aNode, nsIAccessible **_retval)
{
nsCOMPtr<nsIWeakReference> weakShell;
GetShellFromNode(aNode, getter_AddRefs(weakShell));
// reusing the HTML accessible widget and enhancing for XUL
*_retval = new nsXULTextAccessible(aNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/* nsIAccessible createHTMLTableAccessible (in nsISupports aPresShell, in nsISupports aFrame); */
NS_IMETHODIMP nsAccessibilityService::CreateHTMLTableAccessible(nsISupports *aFrame, nsIAccessible **_retval)
{
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv))
return rv;
*_retval = new nsHTMLTableAccessible(node, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/* nsIAccessible createHTMLTableCellAccessible (in nsISupports aPresShell, in nsISupports aFrame); */
NS_IMETHODIMP nsAccessibilityService::CreateHTMLTableCellAccessible(nsISupports *aFrame, nsIAccessible **_retval)
{
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv))
return rv;
*_retval = new nsHTMLTableCellAccessible(node, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsAccessibilityService::CreateXULImageAccessible(nsIDOMNode *aNode, nsIAccessible **_retval)
{
// Don't include nameless images in accessible tree
*_retval = nsnull;
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aNode));
NS_ASSERTION(elt, "No DOM element or node!");
PRBool hasTextEquivalent;
elt->HasAttribute(NS_LITERAL_STRING("tooltiptext"), &hasTextEquivalent); // Prefer value over tooltiptext
if (!hasTextEquivalent) {
return NS_OK;
}
nsCOMPtr<nsIWeakReference> weakShell;
GetShellFromNode(aNode, getter_AddRefs(weakShell));
*_retval = new nsHTMLImageAccessible(aNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/* nsIAccessible createHTMLImageAccessible (in nsISupports aPresShell, in nsISupports aFrame); */
NS_IMETHODIMP nsAccessibilityService::CreateHTMLImageAccessible(nsISupports *aFrame, nsIAccessible **_retval)
{
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv))
return rv;
*_retval = new nsHTMLImageAccessible(node, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/* nsIAccessible createHTMLAreaAccessible (in nsISupports aPresShell, in nsISupports aFrame); */
NS_IMETHODIMP nsAccessibilityService::CreateHTMLAreaAccessible(nsIWeakReference *aShell, nsIDOMNode *aDOMNode, nsIAccessible *aAccParent,
nsIAccessible **_retval)
{
*_retval = new nsHTMLAreaAccessible(aDOMNode, aAccParent, aShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/* nsIAccessible createHTMLTextFieldAccessible (in nsISupports aPresShell, in nsISupports aFrame); */
NS_IMETHODIMP nsAccessibilityService::CreateHTMLTextFieldAccessible(nsISupports *aFrame, nsIAccessible **_retval)
{
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv))
return rv;
*_retval = new nsHTMLTextFieldAccessible(node, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsAccessibilityService::GetShellFromNode(nsIDOMNode *aNode, nsIWeakReference **aWeakShell)
{
nsCOMPtr<nsIDOMDocument> domDoc;
aNode->GetOwnerDocument(getter_AddRefs(domDoc));
nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
if (!doc)
return NS_ERROR_INVALID_ARG;
// ---- Get the pres shell ----
nsCOMPtr<nsIPresShell> shell;
doc->GetShellAt(0, getter_AddRefs(shell));
if (!shell)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIWeakReference> weakRef(do_GetWeakReference(shell));
*aWeakShell = weakRef;
NS_IF_ADDREF(*aWeakShell);
return NS_OK;
}
NS_IMETHODIMP nsAccessibilityService::GetInfo(nsISupports* aFrame, nsIFrame** aRealFrame, nsIWeakReference** aShell, nsIDOMNode** aNode)
{
NS_ASSERTION(aFrame,"Error -- 1st argument (aFrame) is null!!");
*aRealFrame = NS_STATIC_CAST(nsIFrame*, aFrame);
nsCOMPtr<nsIContent> content;
(*aRealFrame)->GetContent(getter_AddRefs(content));
nsCOMPtr<nsIDOMNode> node(do_QueryInterface(content));
if (!content || !node)
return NS_ERROR_FAILURE;
*aNode = node;
NS_IF_ADDREF(*aNode);
nsCOMPtr<nsIDocument> document;
content->GetDocument(*getter_AddRefs(document));
if (!document)
return NS_ERROR_FAILURE;
#ifdef DEBUG
PRInt32 shells = document->GetNumberOfShells();
NS_ASSERTION(shells > 0,"Error no shells!");
#endif
// do_GetWR only works into a |nsCOMPtr| :-(
nsCOMPtr<nsIPresShell> tempShell;
nsCOMPtr<nsIWeakReference> weakShell;
document->GetShellAt(0, getter_AddRefs(tempShell));
weakShell = do_GetWeakReference(tempShell);
NS_IF_ADDREF(*aShell = weakShell);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateAccessible(nsIDOMNode* aDOMNode, nsISupports* aDocument, nsIAccessible **_retval)
{
nsCOMPtr<nsIDocument> document (do_QueryInterface(aDocument));
if (!document)
return NS_ERROR_FAILURE;
#ifdef DEBUG
PRInt32 shells = document->GetNumberOfShells();
NS_ASSERTION(shells > 0,"Error no shells!");
#endif
nsCOMPtr<nsIPresShell> tempShell;
document->GetShellAt(0, getter_AddRefs(tempShell));
nsCOMPtr<nsIWeakReference> weakShell = do_GetWeakReference(tempShell);
*_retval = new nsAccessible(aDOMNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateHTMLBlockAccessible(nsIDOMNode* aDOMNode, nsISupports* aDocument, nsIAccessible **_retval)
{
nsCOMPtr<nsIDocument> document (do_QueryInterface(aDocument));
if (!document)
return NS_ERROR_FAILURE;
#ifdef DEBUG
PRInt32 shells = document->GetNumberOfShells();
NS_ASSERTION(shells > 0,"Error no shells!");
#endif
nsCOMPtr<nsIPresShell> tempShell;
document->GetShellAt(0, getter_AddRefs(tempShell));
nsCOMPtr<nsIWeakReference> weakShell = do_GetWeakReference(tempShell);
*_retval = new nsAccessible(aDOMNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateHTMLIFrameAccessible(nsIDOMNode* aDOMNode, nsISupports* aPresContext, nsIAccessible **_retval)
{
*_retval = nsnull;
nsCOMPtr<nsIContent> content(do_QueryInterface(aDOMNode));
NS_ASSERTION(content,"Error non nsIContent passed to accessible factory!!!");
nsCOMPtr<nsIPresContext> presContext(do_QueryInterface(aPresContext));
NS_ASSERTION(presContext,"Error non prescontext passed to accessible factory!!!");
nsCOMPtr<nsIPresShell> presShell;
presContext->GetShell(getter_AddRefs(presShell));
NS_ASSERTION(presShell,"Error non PresShell passed to accessible factory!!!");
nsCOMPtr<nsIWeakReference> weakRef = do_GetWeakReference(presShell);
nsCOMPtr<nsIDocument> doc;
if (NS_SUCCEEDED(content->GetDocument(*getter_AddRefs(doc))) && doc) {
nsCOMPtr<nsIPresShell> presShell;
doc->GetShellAt(0, getter_AddRefs(presShell));
if (presShell) {
nsCOMPtr<nsISupports> supps;
presShell->GetSubShellFor(content, getter_AddRefs(supps));
if (supps) {
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(supps));
if (docShell) {
nsCOMPtr<nsIPresShell> ps;
docShell->GetPresShell(getter_AddRefs(ps));
if (ps) {
nsCOMPtr<nsIWeakReference> wr = do_GetWeakReference(ps);
nsCOMPtr<nsIDocument> innerDoc;
ps->GetDocument(getter_AddRefs(innerDoc));
if (innerDoc) {
nsCOMPtr<nsIAccessible> root = new nsHTMLIFrameRootAccessible(aDOMNode, wr);
if ( root ) {
nsHTMLIFrameAccessible* frameAcc = new nsHTMLIFrameAccessible(aDOMNode, root, weakRef, innerDoc);
if ( frameAcc != nsnull ) {
*_retval = NS_STATIC_CAST(nsIAccessible*, frameAcc);
if ( *_retval ) {
NS_ADDREF(*_retval);
return NS_OK;
}
}
}
}
}
}
}
}
}
return NS_ERROR_FAILURE;
}
void nsAccessibilityService::GetOwnerFor(nsIPresShell *aPresShell, nsIPresShell **aOwnerShell, nsIContent **aOwnerContent)
{
nsCOMPtr<nsIPresContext> presContext;
aPresShell->GetPresContext(getter_AddRefs(presContext));
if (!presContext)
return;
nsCOMPtr<nsISupports> pcContainer;
presContext->GetContainer(getter_AddRefs(pcContainer));
if (!pcContainer)
return;
nsCOMPtr<nsISupports> docShellSupports(do_QueryInterface(pcContainer));
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(pcContainer));
if (!treeItem)
return;
// Get Parent Doc
nsCOMPtr<nsIDocShellTreeItem> treeItemParent;
treeItem->GetParent(getter_AddRefs(treeItemParent));
if (!treeItemParent)
return;
nsCOMPtr<nsIDocShell> parentDS(do_QueryInterface(treeItemParent));
if (!parentDS)
return;
nsCOMPtr<nsIPresShell> parentPresShell;
parentDS->GetPresShell(getter_AddRefs(parentPresShell));
if (!parentPresShell)
return;
nsCOMPtr<nsIDocument> parentDoc;
parentPresShell->GetDocument(getter_AddRefs(parentDoc));
if (!parentDoc)
return;
nsCOMPtr<nsIContent> rootContent;
parentDoc->GetRootContent(getter_AddRefs(rootContent));
nsCOMPtr<nsIContent> tempContent;
parentPresShell->FindContentForShell(docShellSupports, getter_AddRefs(tempContent));
if (tempContent) {
*aOwnerContent = tempContent;
*aOwnerShell = parentPresShell;
NS_ADDREF(*aOwnerShell);
NS_ADDREF(*aOwnerContent);
}
}
/**
* GetAccessibleFor - get an nsIAccessible from a DOM node
*/
NS_IMETHODIMP nsAccessibilityService::GetAccessibleFor(nsIDOMNode *aNode,
nsIAccessible **_retval)
{
*_retval = nsnull;
if (!aNode)
return NS_ERROR_NULL_POINTER;
nsCOMPtr<nsIAccessible> newAcc;
nsCOMPtr<nsIAccessibleProvider> accProv(do_QueryInterface(aNode));
if (accProv) {
accProv->GetAccessible(getter_AddRefs(newAcc));
if (newAcc) {
*_retval = newAcc;
NS_ADDREF(*_retval);
return NS_OK;
}
}
// ---- Get the document for this node ----
nsCOMPtr<nsIDocument> doc;
nsCOMPtr<nsIDocument> nodeIsDoc(do_QueryInterface(aNode));
if (nodeIsDoc)
doc = nodeIsDoc;
else {
nsCOMPtr<nsIDOMDocument> domDoc;
aNode->GetOwnerDocument(getter_AddRefs(domDoc));
if (!domDoc)
return NS_ERROR_INVALID_ARG;
doc = do_QueryInterface(domDoc);
}
if (!doc)
return NS_ERROR_INVALID_ARG;
// ---- Get the pres shell ----
nsCOMPtr<nsIPresShell> shell;
doc->GetShellAt(0, getter_AddRefs(shell));
if (!shell)
return NS_ERROR_FAILURE;
// ---- Check if area node ----
nsCOMPtr<nsIDOMHTMLAreaElement> areaContent(do_QueryInterface(aNode));
if (areaContent) // Area elements are implemented in nsHTMLImageAccessible as children of the image
return NS_ERROR_FAILURE; // Return, otherwise the image frame looks like an accessible object in the wrong place
// ---- Check if we need outer owning doc ----
nsCOMPtr<nsIContent> content(do_QueryInterface(aNode));
if (!content && nodeIsDoc) {
// This happens when we're on the document node, which will not QI to an nsIContent,
// When that happens, we try to get the outer, parent document node that contains the document
// For example, a <browser> or <iframe> element
nsCOMPtr<nsIPresShell> ownerShell;
nsCOMPtr<nsIContent> ownerContent;
GetOwnerFor(shell, getter_AddRefs(ownerShell), getter_AddRefs(ownerContent));
if (content) {
shell = ownerShell;
content = ownerContent;
}
else {
doc->GetRootContent(getter_AddRefs(content));
nsIFrame* frame = nsnull;
shell->GetPrimaryFrameFor(content, &frame);
if (!frame)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIPresContext> presContext;
shell->GetPresContext(getter_AddRefs(presContext));
CreateRootAccessible(presContext, frame, getter_AddRefs(newAcc));
*_retval = newAcc;
NS_ADDREF(*_retval);
return NS_OK;
}
}
// ---- If still no nsIContent, return ----
if (!content)
return NS_ERROR_FAILURE;
// ---- Try using frame to get IAccessible ----
nsIFrame* frame = nsnull;
shell->GetPrimaryFrameFor(content, &frame);
if (!frame)
return NS_ERROR_FAILURE;
frame->GetAccessible(getter_AddRefs(newAcc));
// ---- If link, create link accessible ----
if (!newAcc) {
// is it a link?
nsCOMPtr<nsILink> link(do_QueryInterface(aNode));
if (link) {
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(shell));
newAcc = new nsHTMLLinkAccessible(aNode, weakShell);
}
}
// ---- If <select> option, create select option accessible
if (!newAcc) {
nsCOMPtr<nsIDOMHTMLOptionElement> optionElement(do_QueryInterface(aNode));
if (optionElement) {
// nsHTMLSelectionOptionAccessible's must be created via the parent
nsCOMPtr<nsIDOMNode> parentNode;
aNode->GetParentNode(getter_AddRefs(parentNode));
if (parentNode) {
nsCOMPtr<nsIAccessible> parentAccessible;
GetAccessibleFor(parentNode, getter_AddRefs(parentAccessible));
if (parentAccessible) {
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(shell));
newAcc = new nsHTMLSelectOptionAccessible(parentAccessible, aNode, weakShell);
}
}
}
}
if (!newAcc)
return NS_ERROR_FAILURE;
*_retval = newAcc;
NS_ADDREF(*_retval);
return NS_OK;
}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
nsresult
NS_NewAccessibilityService(nsIAccessibilityService** aResult)
{
NS_PRECONDITION(aResult != nsnull, "null ptr");
if (! aResult)
return NS_ERROR_NULL_POINTER;
nsAccessibilityService* accService = new nsAccessibilityService();
if (!accService)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(accService);
*aResult = accService;
return NS_OK;
}

View File

@@ -0,0 +1,74 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Original Author: David W. Hyatt (hyatt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __nsAccessibilityService_h__
#define __nsAccessibilityService_h__
#include "nsIAccessibilityService.h"
#include "nsIContent.h"
#include "nsIPresShell.h"
#include "nsIDocShell.h"
class nsIFrame;
class nsIWeakReference;
class nsIDOMNode;
class nsAccessibilityService : public nsIAccessibilityService
{
public:
NS_DECL_ISUPPORTS
// nsIAccessibilityService methods:
NS_DECL_NSIACCESSIBILITYSERVICE
// nsAccessibilityService methods:
nsAccessibilityService();
virtual ~nsAccessibilityService();
public:
private:
NS_IMETHOD GetInfo(nsISupports* aFrame, nsIFrame** aRealFrame, nsIWeakReference** aShell, nsIDOMNode** aContent);
NS_IMETHOD GetShellFromNode(nsIDOMNode *aNode, nsIWeakReference **weakShell);
void GetOwnerFor(nsIPresShell *aPresShell, nsIPresShell **aOwnerShell, nsIContent **aOwnerContent);
nsIContent* FindContentForDocShell(nsIPresShell* aPresShell, nsIContent* aContent, nsIDocShell* aDocShell);
};
#endif /* __nsIAccessibilityService_h__ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,151 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* John Gaunt (jgaunt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsAccessible_H_
#define _nsAccessible_H_
#include "nsCOMPtr.h"
#include "nsGenericAccessible.h"
#include "nsIAccessible.h"
#include "nsIDOMNode.h"
#include "nsIFocusController.h"
#include "nsIPresContext.h"
#include "nsIPresShell.h"
#include "nsPoint.h"
#include "nsRect.h"
#include "nsWeakReference.h"
#include "nsIDOMNodeList.h"
#include "nsIBindingManager.h"
#define ACCESSIBLE_BUNDLE_URL "chrome://global/locale/accessible.properties"
class nsIContent;
class nsIDocShell;
class nsIFrame;
class nsIWebShell;
enum { eSiblingsUninitialized = -1, eSiblingsWalkNormalDOM = -2}; // Used in sibling index field as flags
class nsAccessible : public nsGenericAccessible
{
public:
// to eliminate the confusion of "magic numbers" -- if ( 0 ){ foo; }
enum { eAction_Switch=0, eAction_Jump=0, eAction_Click=0 };
// how many actions
enum { eNo_Action=0, eSingle_Action=1 };
NS_IMETHOD GetAccName(nsAWritableString& _retval);
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
NS_IMETHOD GetAccFocused(nsIAccessible **_retval);
NS_IMETHOD AccGetAt(PRInt32 x, PRInt32 y, nsIAccessible **_retval);
NS_IMETHOD AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height);
NS_IMETHOD AccRemoveSelection(void);
NS_IMETHOD AccTakeSelection(void);
NS_IMETHOD AccTakeFocus(void);
NS_IMETHOD AccGetDOMNode(nsIDOMNode **_retval);
public:
nsAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
virtual ~nsAccessible();
virtual void GetListAtomForFrame(nsIFrame* aFrame, nsIAtom*& aList) { aList = nsnull; }
// Helper Routines for Sub-Docs
static nsresult GetDocShellObjects(nsIDocShell* aDocShell,
nsIPresShell** aPresShell,
nsIPresContext** aPresContext,
nsIContent** aContent);
static nsresult GetDocShells(nsIPresShell* aPresShell,
nsIDocShell** aDocShell,
nsIDocShell** aParentDocShell);
static nsresult GetParentPresShellAndContent(nsIPresShell* aPresShell,
nsIPresShell** aParentPresShell,
nsIContent** aSubShellContent);
static PRBool FindContentForWebShell(nsIPresShell* aParentPresShell,
nsIContent* aParentContent,
nsIWebShell* aWebShell,
nsIContent** aFoundContent);
nsresult CalcOffset(nsIFrame* aFrame,
nsIPresContext * aPresContext,
nsRect& aRect);
nsresult GetAbsPosition(nsIPresShell* aPresShell, nsPoint& aPoint);
nsresult GetAbsoluteFramePosition(nsIPresContext* aPresContext,
nsIFrame *aFrame,
nsRect& aAbsoluteTwipsRect,
nsRect& aAbsolutePixelRect);
static nsresult GetTranslatedString(PRUnichar *aKey, nsAWritableString *aStringOut);
// helper method to verify frames
static PRBool IsCorrectFrameType(nsIFrame* aFrame, nsIAtom* aAtom);
protected:
NS_IMETHOD AppendLabelText(nsIDOMNode *aLabelNode, nsAWritableString& _retval);
NS_IMETHOD AppendLabelFor(nsIContent *aLookNode, nsAReadableString *aId, nsAWritableString *aLabel);
NS_IMETHOD GetHTMLAccName(nsAWritableString& _retval);
NS_IMETHOD GetXULAccName(nsAWritableString& _retval);
protected:
virtual nsIFrame* GetFrame();
virtual nsIFrame* GetBoundsFrame();
virtual void GetBounds(nsRect& aRect, nsIFrame** aRelativeFrame);
virtual void GetPresContext(nsCOMPtr<nsIPresContext>& aContext);
PRBool IsEntirelyVisible();
NS_IMETHOD AppendFlatStringFromSubtree(nsIContent *aContent, nsAWritableString *aFlatString);
NS_IMETHOD AppendFlatStringFromContentNode(nsIContent *aContent, nsAWritableString *aFlatString);
NS_IMETHOD AppendStringWithSpaces(nsAWritableString *aFlatString, nsAReadableString& textEquivalent);
NS_IMETHOD GetFocusedElement(nsIDOMElement **aFocusedElement);
NS_IMETHOD CacheOptimizations(nsIAccessible *aParent, PRInt32 aSiblingIndex, nsIDOMNodeList *aSiblingList);
// Data Members
nsCOMPtr<nsIDOMNode> mDOMNode;
nsCOMPtr<nsIWeakReference> mPresShell;
nsCOMPtr<nsIAccessible> mParent;
nsCOMPtr<nsIDOMNodeList> mSiblingList; // If some of our computed siblings are anonymous content nodes, cache node list
PRInt32 mSiblingIndex; // Cache where we are in list of kids that we got from nsIBindingManager::GetContentList(parentContent)
};
#endif

View File

@@ -0,0 +1,410 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* John Gaunt (jgaunt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsAccessible.h"
#include "nsBaseWidgetAccessible.h"
#include "nsCOMPtr.h"
#include "nsGUIEvent.h"
#include "nsIContent.h"
#include "nsIDOMElement.h"
#include "nsIDOMEventReceiver.h"
#include "nsIFrame.h"
#include "nsILink.h"
#include "nsIPresContext.h"
#include "nsIPresShell.h"
#include "nsISelection.h"
#include "nsISelectionController.h"
// ------------
// nsBlockAccessible
// ------------
nsBlockAccessible::nsBlockAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):nsAccessible(aNode, aShell)
{
}
/* nsIAccessible accGetAt (in long x, in long y); */
NS_IMETHODIMP nsBlockAccessible::AccGetAt(PRInt32 tx, PRInt32 ty, nsIAccessible **_retval)
{
// We're going to find the child that contains coordinates (tx,ty)
PRInt32 x,y,w,h;
AccGetBounds(&x,&y,&w,&h); // Get bounds for this accessible
if (tx > x && tx < x + w && ty > y && ty < y + h)
{
// It's within this nsIAccessible, let's drill down
nsCOMPtr<nsIAccessible> child;
nsCOMPtr<nsIAccessible> smallestChild;
PRInt32 smallestArea = -1;
nsCOMPtr<nsIAccessible> next;
GetAccFirstChild(getter_AddRefs(child));
PRInt32 cx,cy,cw,ch; // Child bounds
while(child) {
child->AccGetBounds(&cx,&cy,&cw,&ch);
// ok if there are multiple frames the contain the point
// and they overlap then pick the smallest. We need to do this
// for text frames.
// For example, A point that's in block #2 is also in block #1, but we want to return #2:
//
// [[block #1 is long wrapped text that continues to
// another line]] [[here is a shorter block #2]]
if (tx > cx && tx < cx + cw && ty > cy && ty < cy + ch)
{
if (smallestArea == -1 || cw*ch < smallestArea) {
smallestArea = cw*ch;
smallestChild = child;
}
}
child->GetAccNextSibling(getter_AddRefs(next));
child = next;
}
if (smallestChild != nsnull)
{
*_retval = smallestChild;
NS_ADDREF(*_retval);
return NS_OK;
}
*_retval = this;
NS_ADDREF(this);
return NS_OK;
}
*_retval = nsnull;
return NS_OK;
}
/**
* nsContainerAccessible
*/
nsContainerAccessible::nsContainerAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsAccessible(aNode, aShell)
{
}
/** no actions */
NS_IMETHODIMP nsContainerAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = eNo_Action;
return NS_OK;
}
/** no actions */
NS_IMETHODIMP nsContainerAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
return NS_OK;
}
/** no actions */
NS_IMETHODIMP nsContainerAccessible::AccDoAction(PRUint8 index)
{
return NS_OK;
}
/** no state -- normal */
NS_IMETHODIMP nsContainerAccessible::GetAccState(PRUint32 *_retval)
{
*_retval = 0;
return NS_OK;
}
/** no value */
NS_IMETHODIMP nsContainerAccessible::GetAccValue(nsAWritableString& _retval)
{
return NS_OK;
}
/** no name*/
NS_IMETHODIMP nsContainerAccessible::GetAccName(nsAWritableString& _retval)
{
return NS_OK;
}
//-------------
// nsLeafFrameAccessible
//-------------
nsLeafAccessible::nsLeafAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsAccessible(aNode, aShell)
{
}
/* nsIAccessible getAccFirstChild (); */
NS_IMETHODIMP nsLeafAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/* nsIAccessible getAccLastChild (); */
NS_IMETHODIMP nsLeafAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/* long getAccChildCount (); */
NS_IMETHODIMP nsLeafAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 0;
return NS_OK;
}
//----------------
// nsLinkableAccessible
//----------------
nsLinkableAccessible::nsLinkableAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsAccessible(aNode, aShell), mIsALinkCached(PR_FALSE), mLinkContent(nsnull), mIsLinkVisited(PR_FALSE)
{
}
/* long GetAccState (); */
NS_IMETHODIMP nsLinkableAccessible::GetAccState(PRUint32 *_retval)
{
nsAccessible::GetAccState(_retval);
*_retval |= STATE_READONLY | STATE_SELECTABLE;
if (IsALink()) {
*_retval |= STATE_LINKED;
if (mIsLinkVisited)
*_retval |= STATE_TRAVERSED;
}
// Get current selection and find out if current node is in it
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
if (!shell) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIPresContext> context;
shell->GetPresContext(getter_AddRefs(context));
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
nsIFrame *frame;
if (content && NS_SUCCEEDED(shell->GetPrimaryFrameFor(content, &frame))) {
nsCOMPtr<nsISelectionController> selCon;
frame->GetSelectionController(context,getter_AddRefs(selCon));
if (selCon) {
nsCOMPtr<nsISelection> domSel;
selCon->GetSelection(nsISelectionController::SELECTION_NORMAL, getter_AddRefs(domSel));
if (domSel) {
PRBool isSelected = PR_FALSE, isCollapsed = PR_TRUE;
domSel->ContainsNode(mDOMNode, PR_TRUE, &isSelected);
domSel->GetIsCollapsed(&isCollapsed);
if (isSelected && !isCollapsed)
*_retval |=STATE_SELECTED;
}
}
}
// Focused? Do we implement that here or up the chain?
return NS_OK;
}
NS_IMETHODIMP nsLinkableAccessible::GetAccValue(nsAWritableString& _retval)
{
if (IsALink()) {
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(mLinkContent));
if (elt)
return elt->GetAttribute(NS_LITERAL_STRING("href"), _retval);
}
return NS_ERROR_FAILURE;
}
/* PRUint8 getAccNumActions (); */
NS_IMETHODIMP nsLinkableAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = eSingle_Action;
return NS_OK;
}
/* wstring getAccActionName (in PRUint8 index); */
NS_IMETHODIMP nsLinkableAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
// Action 0 (default action): Jump to link
if (index == eAction_Jump) {
if (IsALink()) {
_retval = NS_LITERAL_STRING("jump");
return NS_OK;
}
}
return NS_ERROR_FAILURE;
}
/* void accDoAction (in PRUint8 index); */
NS_IMETHODIMP nsLinkableAccessible::AccDoAction(PRUint8 index)
{
// Action 0 (default action): Jump to link
if (index == 0) {
if (IsALink()) {
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
if (!shell) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIPresContext> presContext;
shell->GetPresContext(getter_AddRefs(presContext));
if (presContext) {
nsMouseEvent linkClickEvent;
linkClickEvent.eventStructType = NS_EVENT;
linkClickEvent.message = NS_MOUSE_LEFT_CLICK;
linkClickEvent.isShift = PR_FALSE;
linkClickEvent.isControl = PR_FALSE;
linkClickEvent.isAlt = PR_FALSE;
linkClickEvent.isMeta = PR_FALSE;
linkClickEvent.clickCount = 0;
linkClickEvent.widget = nsnull;
nsEventStatus eventStatus = nsEventStatus_eIgnore;
mLinkContent->HandleDOMEvent(presContext,
&linkClickEvent,
nsnull,
NS_EVENT_FLAG_INIT,
&eventStatus);
return NS_OK;
}
}
}
return NS_ERROR_FAILURE;
}
PRBool nsLinkableAccessible::IsALink()
{
if (mIsALinkCached) // Cached answer?
return mLinkContent? PR_TRUE: PR_FALSE;
nsCOMPtr<nsIContent> walkUpContent(do_QueryInterface(mDOMNode));
if (walkUpContent) {
nsCOMPtr<nsIContent> tempContent = walkUpContent;
while (walkUpContent) {
nsCOMPtr<nsILink> link(do_QueryInterface(walkUpContent));
if (link) {
mLinkContent = tempContent;
mIsALinkCached = PR_TRUE;
nsLinkState linkState;
link->GetLinkState(linkState);
if (linkState == eLinkState_Visited)
mIsLinkVisited = PR_TRUE;
return PR_TRUE;
}
walkUpContent->GetParent(*getter_AddRefs(tempContent));
walkUpContent = tempContent;
}
}
mIsALinkCached = PR_TRUE; // Cached that there is no link
return PR_FALSE;
}
// ------------
// nsMenuListenerAccessible
// ------------
NS_IMPL_ISUPPORTS_INHERITED1(nsMenuListenerAccessible, nsAccessible, nsIDOMXULListener)
nsMenuListenerAccessible::nsMenuListenerAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
nsAccessible(aDOMNode, aShell)
{
mRegistered = PR_FALSE;
mOpen = PR_FALSE;
}
nsMenuListenerAccessible::~nsMenuListenerAccessible()
{
if (mRegistered) {
nsCOMPtr<nsIDOMEventReceiver> eventReceiver(do_QueryInterface(mDOMNode));
if (eventReceiver)
eventReceiver->RemoveEventListener(NS_LITERAL_STRING("popupshowing"), this, PR_TRUE);
}
}
NS_IMETHODIMP nsMenuListenerAccessible::PopupShowing(nsIDOMEvent* aEvent)
{
mOpen = PR_TRUE;
/* TBD send state change event */
return NS_OK;
}
NS_IMETHODIMP nsMenuListenerAccessible::PopupHiding(nsIDOMEvent* aEvent)
{
mOpen = PR_FALSE;
/* TBD send state change event */
return NS_OK;
}
NS_IMETHODIMP nsMenuListenerAccessible::Close(nsIDOMEvent* aEvent)
{
mOpen = PR_FALSE;
/* TBD send state change event */
return NS_OK;
}
void
nsMenuListenerAccessible::SetupMenuListener()
{
// if not already one, register ourselves as a popup listener
if (!mRegistered) {
nsCOMPtr<nsIDOMEventReceiver> eventReceiver(do_QueryInterface(mDOMNode));
if (!eventReceiver) {
return;
}
nsresult rv = eventReceiver->AddEventListener(NS_LITERAL_STRING("popupshowing"), this, PR_TRUE);
if (NS_FAILED(rv)) {
return;
}
mRegistered = PR_TRUE;
}
}

View File

@@ -0,0 +1,148 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* John Gaunt (jgaunt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsBaseWidgetAccessible_H_
#define _nsBaseWidgetAccessible_H_
#include "nsAccessible.h"
#include "nsCOMPtr.h"
#include "nsIContent.h"
#include "nsIDOMNode.h"
#include "nsIDOMXULListener.h"
/**
* This file contains a number of classes that are used as base
* classes for the different accessibility implementations of
* the HTML and XUL widget sets. --jgaunt
*/
/**
* Special Accessible that knows how to handle hit detection for flowing text
*/
class nsBlockAccessible : public nsAccessible
{
public:
nsBlockAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD AccGetAt(PRInt32 x, PRInt32 y, nsIAccessible **_retval);
};
/**
* Special Accessible that just contains other accessible objects
* no actions, no name, no state, no value
*/
class nsContainerAccessible : public nsAccessible
{
public:
nsContainerAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
NS_IMETHOD AccDoAction(PRUint8 index);
NS_IMETHOD GetAccState(PRUint32 *_retval);
NS_IMETHOD GetAccValue(nsAWritableString& _retval);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
};
/**
* Leaf version of DOM Accessible -- has no children
*/
class nsLeafAccessible : public nsAccessible
{
public:
nsLeafAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
};
/**
* A type of accessible for DOM nodes containing an href="" attribute.
* It knows how to report the state of the link ( traveled or not )
* and can activate ( click ) the link programmatically.
*/
class nsLinkableAccessible : public nsAccessible
{
public:
nsLinkableAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
NS_IMETHOD AccDoAction(PRUint8 index);
NS_IMETHOD GetAccState(PRUint32 *_retval);
NS_IMETHOD GetAccValue(nsAWritableString& _retval);
protected:
PRBool IsALink();
PRBool mIsALinkCached; // -1 = unknown, 0 = not a link, 1 = is a link
nsCOMPtr<nsIContent> mLinkContent;
PRBool mIsLinkVisited;
};
/*
* A base class that can listen to menu events. Its used by selects so the
* button and the window accessibles can change their name and role
* depending on whether the drop down list is dropped down on not
*/
class nsMenuListenerAccessible : public nsAccessible, public nsIDOMXULListener
{
public:
NS_DECL_ISUPPORTS_INHERITED
nsMenuListenerAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsMenuListenerAccessible();
// popup listener
NS_IMETHOD PopupShowing(nsIDOMEvent* aEvent);
NS_IMETHOD PopupShown(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD PopupHiding(nsIDOMEvent* aEvent);
NS_IMETHOD PopupHidden(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD Close(nsIDOMEvent* aEvent);
NS_IMETHOD Command(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD Broadcast(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD CommandUpdate(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent) { return NS_OK; }
virtual void SetupMenuListener();
PRBool mRegistered;
PRBool mOpen;
};
#endif

View File

@@ -0,0 +1,226 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* John Gaunt (jgaunt@netscape.com)
* Aaron Leventhal (aaronl@netscape.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// NOTE: alphabetically ordered
#include "nsFormControlAccessible.h"
#include "nsIDocument.h"
#include "nsIDOMHTMLFormElement.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMHTMLLabelElement.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMXULButtonElement.h"
#include "nsIDOMXULCheckboxElement.h"
#include "nsIDOMXULDocument.h"
#include "nsIDOMXULElement.h"
#include "nsIDOMXULLabelElement.h"
#include "nsIDOMXULSelectCntrlEl.h"
#include "nsIDOMXULSelectCntrlItemEl.h"
#include "nsReadableUtils.h"
#include "nsString.h"
/**
* nsFormControlAccessible
*/
nsFormControlAccessible::nsFormControlAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsAccessible(aNode, aShell)
{
}
/**
* XUL states: focused, unavailable(disabled), focusable, ?protected?
* HTML states: focused, unabailable(disabled), focusable, protected
*/
NS_IMETHODIMP nsFormControlAccessible::GetAccState(PRUint32 *_retval)
{
// Get the focused state from the nsAccessible
nsAccessible::GetAccState(_retval);
PRBool disabled = PR_FALSE;
nsresult rv = NS_ERROR_FAILURE;
nsCOMPtr<nsIDOMHTMLInputElement> htmlFormElement(do_QueryInterface(mDOMNode, &rv));
if (NS_SUCCEEDED(rv) && htmlFormElement) {
htmlFormElement->GetDisabled(&disabled);
nsAutoString typeString;
htmlFormElement->GetType(typeString);
if (typeString.EqualsIgnoreCase("password"))
*_retval |= STATE_PROTECTED;
}
else {
nsCOMPtr<nsIDOMXULControlElement> xulFormElement(do_QueryInterface(mDOMNode, &rv));
if (NS_SUCCEEDED(rv) && xulFormElement) {
xulFormElement->GetDisabled(&disabled);
/* XXX jgaunt do XUL elements support password fields? */
}
}
if (disabled)
*_retval |= STATE_UNAVAILABLE;
else
*_retval |= STATE_FOCUSABLE;
return NS_OK;
}
/**
* Will be called by both HTML and XUL elements, this method
* merely checks who is calling and then calls the appropriate
* protected method for the XUL or HTML element.
*/
NS_IMETHODIMP nsFormControlAccessible::GetAccName(nsAWritableString& _retval)
{
nsCOMPtr<nsIDOMXULElement> xulFormElement(do_QueryInterface(mDOMNode));
if (xulFormElement)
return GetXULAccName(_retval);
else
return GetHTMLAccName(_retval);
}
/**
* No Children
*/
NS_IMETHODIMP nsFormControlAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
* No Children
*/
NS_IMETHODIMP nsFormControlAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
* No Children
*/
NS_IMETHODIMP nsFormControlAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 0;
return NS_OK;
}
// ------------
// Radio button
// ------------
nsRadioButtonAccessible::nsRadioButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsFormControlAccessible(aNode, aShell)
{
}
/**
*
*/
NS_IMETHODIMP nsRadioButtonAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = eSingle_Action;
return NS_OK;
}
/**
*
*/
NS_IMETHODIMP nsRadioButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
if (index == eAction_Click) {
_retval = NS_LITERAL_STRING("select");
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
/**
*
*/
NS_IMETHODIMP nsRadioButtonAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_RADIOBUTTON;
return NS_OK;
}
// ------------
// Text Accessibles
// ------------
nsTextAccessible::nsTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell):
nsLinkableAccessible(aDomNode, aShell)
{
}
/**
* We are text
*/
NS_IMETHODIMP nsTextAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_TEXT;
return NS_OK;
}
/**
* No Children
*/
NS_IMETHODIMP nsTextAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
* No Children
*/
NS_IMETHODIMP nsTextAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
* No Children
*/
NS_IMETHODIMP nsTextAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 0;
return NS_OK;
}

View File

@@ -0,0 +1,93 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Eric D Vaughan (evaughan@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsFormControlAccessible_H_
#define _nsFormControlAccessible_H_
#include "nsBaseWidgetAccessible.h"
/**
* This supports name and state information for both XUL and HTML
* widgets. Designed to be a base class for the impls of XUL
* and HTML form widget Accessibles
*/
class nsFormControlAccessible : public nsAccessible
{
public:
nsFormControlAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
};
/**
*
*/
class nsRadioButtonAccessible : public nsFormControlAccessible
{
public:
nsRadioButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
};
/**
* Text nodes have no children, but since double inheritance
* no-worky we have to re-impl the LeafAccessiblity blocks
* this way.
*/
class nsTextAccessible : public nsLinkableAccessible
{
public:
nsTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
};
#endif

View File

@@ -0,0 +1,243 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Eric Vaughan (evaughan@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsGenericAccessible.h"
#include "nsIFrame.h"
#include "nsCOMPtr.h"
#include "nsIWeakReference.h"
#include "nsReadableUtils.h"
#include "nsIContent.h"
/* Implementation file */
NS_IMPL_ISUPPORTS1(nsGenericAccessible, nsIAccessible)
nsGenericAccessible::nsGenericAccessible()
{
NS_INIT_ISUPPORTS();
/* member initializers and constructor code */
}
nsGenericAccessible::~nsGenericAccessible()
{
/* destructor code */
}
/* nsIAccessible getAccParent (); */
NS_IMETHODIMP nsGenericAccessible::GetAccParent(nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIAccessible getAccNextSibling (); */
NS_IMETHODIMP nsGenericAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIAccessible getAccPreviousSibling (); */
NS_IMETHODIMP nsGenericAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIAccessible getAccFirstChild (); */
NS_IMETHODIMP nsGenericAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIAccessible getAccLastChild (); */
NS_IMETHODIMP nsGenericAccessible::GetAccLastChild(nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* long getAccChildCount (); */
NS_IMETHODIMP nsGenericAccessible::GetAccChildCount(PRInt32 *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* wstring getAccName (); */
NS_IMETHODIMP nsGenericAccessible::GetAccName(nsAWritableString& _retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* wstring getAccValue (); */
NS_IMETHODIMP nsGenericAccessible::GetAccValue(nsAWritableString& _retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void setAccName (in wstring name); */
NS_IMETHODIMP nsGenericAccessible::SetAccName(const nsAReadableString& name)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* wstring getAccDescription (); */
NS_IMETHODIMP nsGenericAccessible::GetAccDescription(nsAWritableString& _retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsGenericAccessible::GetAccRole(PRUint32 *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* wstring getAccState (); */
NS_IMETHODIMP nsGenericAccessible::GetAccState(PRUint32 *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* PRUint8 getAccNumActions (); */
NS_IMETHODIMP nsGenericAccessible::GetAccNumActions(PRUint8 *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* wstring getAccActionName (in PRUint8 index); */
NS_IMETHODIMP nsGenericAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void accDoAction (in PRUint8 index); */
NS_IMETHODIMP nsGenericAccessible::AccDoAction(PRUint8 index)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIAccessible getAccFocused(); */
NS_IMETHODIMP nsGenericAccessible::GetAccFocused(nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* wstring getAccHelp (); */
NS_IMETHODIMP nsGenericAccessible::GetAccHelp(nsAWritableString& _retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIAccessible accGetAt (in long x, in long y); */
NS_IMETHODIMP nsGenericAccessible::AccGetAt(PRInt32 x, PRInt32 y, nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIAccessible accNavigateRight (); */
NS_IMETHODIMP nsGenericAccessible::AccNavigateRight(nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIAccessible accNavigateLeft (); */
NS_IMETHODIMP nsGenericAccessible::AccNavigateLeft(nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIAccessible accNavigateUp (); */
NS_IMETHODIMP nsGenericAccessible::AccNavigateUp(nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIAccessible accNavigateDown (); */
NS_IMETHODIMP nsGenericAccessible::AccNavigateDown(nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void accGetBounds (out long x, out long y, out long width, out long height); */
NS_IMETHODIMP nsGenericAccessible::AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void accAddSelection (); */
NS_IMETHODIMP nsGenericAccessible::AccAddSelection()
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void accRemoveSelection (); */
NS_IMETHODIMP nsGenericAccessible::AccRemoveSelection()
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void accExtendSelection (); */
NS_IMETHODIMP nsGenericAccessible::AccExtendSelection()
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void accTakeSelection (); */
NS_IMETHODIMP nsGenericAccessible::AccTakeSelection()
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void accTakeFocus (); */
NS_IMETHODIMP nsGenericAccessible::AccTakeFocus()
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* unsigned long getAccExtState (); */
NS_IMETHODIMP nsGenericAccessible::GetAccExtState(PRUint32 *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsGenericAccessible::AccGetDOMNode(nsIDOMNode **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsGenericAccessible::CacheOptimizations(nsIAccessible *aParent, PRInt32 aSiblingIndex, nsIDOMNodeList *aSiblingList)
{
return NS_ERROR_NOT_IMPLEMENTED;
}

View File

@@ -0,0 +1,67 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Eric D Vaughan (evaughan@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsGenericAccessible_H_
#define _nsGenericAccessible_H_
#include "nsISupports.h"
#include "nsIAccessible.h"
#include "nsIContent.h"
#include "nsIDOMNode.h"
#include "nsIPresShell.h"
#include "nsIPresContext.h"
#include "nsCOMPtr.h"
#include "nsIWeakReference.h"
/**
* Basic implementation
* supports nothing
*/
class nsGenericAccessible : public nsIAccessible
{
NS_DECL_ISUPPORTS
NS_DECL_NSIACCESSIBLE
public:
nsGenericAccessible();
virtual ~nsGenericAccessible();
};
#endif

View File

@@ -0,0 +1,587 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsIAccessible.h"
#include "nsRootAccessible.h"
#include "nsCOMPtr.h"
#include "nsIDocument.h"
#include "nsIDOMNSDocument.h"
#include "nsIPresShell.h"
#include "nsIPresContext.h"
#include "nsIContent.h"
#include "nsIFrame.h"
#include "nsIDOMEventTarget.h"
#include "nsIDOMElement.h"
#include "nsIDOMEventReceiver.h"
#include "nsIDOMEventListener.h"
#include "nsReadableUtils.h"
#include "nsILink.h"
#include "nsHTMLFormControlAccessible.h"
#include "nsHTMLLinkAccessible.h"
#include "nsIURI.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsIWebNavigation.h"
#include "nsIXULDocument.h"
#include "nsIDOMDocument.h"
#include "nsIDOMDocumentType.h"
#include "nsINameSpaceManager.h"
#include "nsIDOMNSHTMLSelectElement.h"
#include "nsIAccessibleSelectable.h"
#include "nsLayoutAtoms.h"
#include "nsString.h"
#include "nsXPIDLString.h"
#include "nsIAccessibilityService.h"
#include "nsIServiceManager.h"
#include "nsHTMLSelectAccessible.h"
#include "nsIDOMHTMLSelectElement.h"
#include "nsIWebProgress.h"
#include "nsCURILoader.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIScriptGlobalObject.h"
NS_INTERFACE_MAP_BEGIN(nsRootAccessible)
NS_INTERFACE_MAP_ENTRY(nsIAccessibleDocument)
NS_INTERFACE_MAP_ENTRY(nsIAccessibleEventReceiver)
NS_INTERFACE_MAP_ENTRY(nsIDOMFocusListener)
NS_INTERFACE_MAP_ENTRY(nsIDOMFormListener)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMFormListener)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMEventListener, nsIDOMFormListener)
NS_INTERFACE_MAP_END_INHERITING(nsAccessible)
NS_IMPL_ADDREF_INHERITED(nsRootAccessible, nsAccessible);
NS_IMPL_RELEASE_INHERITED(nsRootAccessible, nsAccessible);
//-----------------------------------------------------
// construction
//-----------------------------------------------------
nsRootAccessible::nsRootAccessible(nsIWeakReference* aShell):nsAccessible(nsnull,aShell),
nsDocAccessibleMixin(aShell), mAccService(do_GetService("@mozilla.org/accessibilityService;1")),
mBusy(eBusyStateUninitialized)
{
mListener = nsnull;
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
if (shell) {
shell->GetDocument(getter_AddRefs(mDocument));
mDOMNode = do_QueryInterface(mDocument);
nsLayoutAtoms::AddRefAtoms();
}
}
//-----------------------------------------------------
// destruction
//-----------------------------------------------------
nsRootAccessible::~nsRootAccessible()
{
nsLayoutAtoms::ReleaseAtoms();
RemoveAccessibleEventListener();
}
/* attribute wstring accName; */
NS_IMETHODIMP nsRootAccessible::GetAccName(nsAWritableString& aAccName)
{
return GetTitle(aAccName);
}
// helpers
nsIFrame* nsRootAccessible::GetFrame()
{
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
nsIFrame* root = nsnull;
if (shell)
shell->GetRootFrame(&root);
return root;
}
void nsRootAccessible::GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame)
{
*aRelativeFrame = GetFrame();
(*aRelativeFrame)->GetRect(aBounds);
}
/* readonly attribute nsIAccessible accParent; */
NS_IMETHODIMP nsRootAccessible::GetAccParent(nsIAccessible * *aAccParent)
{
*aAccParent = nsnull;
return NS_OK;
}
/* readonly attribute unsigned long accRole; */
NS_IMETHODIMP nsRootAccessible::GetAccRole(PRUint32 *aAccRole)
{
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
if (!shell) {
*aAccRole = 0;
return NS_ERROR_FAILURE;
}
/*
// Commenting this out for now.
// It was requested that we always use pane objects instead of client objects.
// However, it might be asked that we put client objects back.
nsCOMPtr<nsIPresContext> context;
shell->GetPresContext(getter_AddRefs(context));
nsCOMPtr<nsISupports> container;
context->GetContainer(getter_AddRefs(container));
if (container) {
nsCOMPtr<nsIDocShellTreeItem> parentTreeItem, docTreeItem(do_QueryInterface(container));
if (docTreeItem) {
docTreeItem->GetSameTypeParent(getter_AddRefs(parentTreeItem));
// Basically, if this docshell has a parent of the same type, it's a frame
if (parentTreeItem) {
*aAccRole = ROLE_PANE;
return NS_OK;
}
}
}
*aAccRole = ROLE_CLIENT;
*/
*aAccRole = ROLE_PANE;
return NS_OK;
}
NS_IMETHODIMP nsRootAccessible::GetAccState(PRUint32 *aAccState)
{
*aAccState = STATE_FOCUSABLE;
if (mBusy == eBusyStateLoading)
*aAccState |= STATE_BUSY;
return NS_OK;
}
NS_IMETHODIMP nsRootAccessible::GetAccValue(nsAWritableString& aAccValue)
{
return GetURL(aAccValue);
}
void nsRootAccessible::Notify(nsITimer *timer)
{
// Short timer is finished
if (mBusy != eBusyStateDone) {
mBusy = eBusyStateDone;
if (mListener)
mListener->HandleEvent(nsIAccessibleEventListener::EVENT_STATE_CHANGE, this);
}
}
NS_IMETHODIMP nsRootAccessible::StartDocReadyTimer()
{
nsresult rv;
if (!mTimer) {
mTimer = do_CreateInstance("@mozilla.org/timer;1", &rv);
if (NS_SUCCEEDED(rv)) {
const PRUint32 kUpdateTimerDelay = 1;
rv = mTimer->Init(NS_STATIC_CAST(nsITimerCallback*, this), kUpdateTimerDelay);
}
}
return rv;
}
/* void addAccessibleEventListener (in nsIAccessibleEventListener aListener); */
NS_IMETHODIMP nsRootAccessible::AddAccessibleEventListener(nsIAccessibleEventListener *aListener)
{
if (mListener)
return NS_OK;
mListener = aListener;
// add an event listener to the document
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
if (!shell)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIDocument> document;
shell->GetDocument(getter_AddRefs(document));
if (!document)
return NS_ERROR_FAILURE;
// use AddEventListener from the nsIDOMEventTarget interface
nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(document));
if (target) {
// capture DOM focus events
nsresult rv = target->AddEventListener(NS_LITERAL_STRING("focus"), NS_STATIC_CAST(nsIDOMFocusListener*, this), PR_TRUE);
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to register listener");
rv = target->AddEventListener(NS_LITERAL_STRING("blur"), NS_STATIC_CAST(nsIDOMFocusListener*, this), PR_TRUE);
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to register listener");
// capture Form change events
rv = target->AddEventListener(NS_LITERAL_STRING("change"), NS_STATIC_CAST(nsIDOMFormListener*, this), PR_TRUE);
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to register listener");
// add ourself as a CheckboxStateChange listener (custom event fired in nsHTMLInputElement.cpp)
rv = target->AddEventListener(NS_LITERAL_STRING("CheckboxStateChange"), NS_STATIC_CAST(nsIDOMFormListener*, this), PR_TRUE);
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to register listener");
// add ourself as a RadiobuttonStateChange listener (custom event fired in nsHTMLInputElement.cpp)
rv = target->AddEventListener(NS_LITERAL_STRING("RadiobuttonStateChange"), NS_STATIC_CAST(nsIDOMFormListener*, this), PR_TRUE);
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to register listener");
// Extremely short timer, after which we announce that pane is finished loading
// By waiting until after this short time, we know that the 3rd party accessibility software
// has received it's accessible, and can handle events on it.
StartDocReadyTimer();
}
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mPresShell));
if (presShell) {
nsCOMPtr<nsIPresContext> context;
presShell->GetPresContext(getter_AddRefs(context));
if (context) {
nsCOMPtr<nsISupports> container;
context->GetContainer(getter_AddRefs(container));
if (container) {
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(container));
if (docShell) {
nsCOMPtr<nsIWebProgress> webProgress(do_GetInterface(docShell));
if (webProgress) {
webProgress->AddProgressListener(this);
}
}
}
}
}
return NS_OK;
}
/* void removeAccessibleEventListener (); */
NS_IMETHODIMP nsRootAccessible::RemoveAccessibleEventListener()
{
if (mListener) {
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
nsCOMPtr<nsIDocument> document;
if (shell) {
shell->GetDocument(getter_AddRefs(document));
nsCOMPtr<nsIDOMEventReceiver> eventReceiver(do_QueryInterface(document));
if (eventReceiver) {
nsresult rv = eventReceiver->RemoveEventListenerByIID(NS_STATIC_CAST(nsIDOMFocusListener *, this), NS_GET_IID(nsIDOMFocusListener));
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to unregister listener");
rv = eventReceiver->RemoveEventListenerByIID(NS_STATIC_CAST(nsIDOMFormListener *, this), NS_GET_IID(nsIDOMFormListener));
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to unregister listener");
}
}
}
mListener = nsnull;
return NS_OK;
}
// --------------- nsIDOMEventListener Methods (3) ------------------------
NS_IMETHODIMP nsRootAccessible::HandleEvent(nsIDOMEvent* aEvent)
{
if (mListener) {
// optionTargetNode is set to current option for HTML selects
nsCOMPtr<nsIDOMNode> targetNode, optionTargetNode;
nsresult rv = GetTargetNode(aEvent, targetNode);
if (NS_FAILED(rv))
return rv;
// Check to see if it's a select element. If so, need the currently focused option
nsCOMPtr<nsIDOMHTMLSelectElement> selectElement(do_QueryInterface(targetNode));
if (selectElement) // ----- Target Node is an HTML <select> element ------
nsHTMLSelectOptionAccessible::GetFocusedOptionNode(mPresShell, targetNode, optionTargetNode);
nsAutoString eventType;
aEvent->GetType(eventType);
nsCOMPtr<nsIAccessible> accessible;
if (NS_SUCCEEDED(mAccService->GetAccessibleFor(targetNode, getter_AddRefs(accessible)))) {
if (eventType.EqualsIgnoreCase("focus")) {
if (mCurrentFocus != targetNode) {
mListener->HandleEvent(nsIAccessibleEventListener::EVENT_FOCUS, accessible);
mCurrentFocus = targetNode;
}
}
else if (eventType.EqualsIgnoreCase("change")) {
if (optionTargetNode) { // Set to current option only for HTML selects
mListener->HandleEvent(nsIAccessibleEventListener::EVENT_SELECTION, accessible);
if (mCurrentFocus != optionTargetNode &&
NS_SUCCEEDED(mAccService->GetAccessibleFor(optionTargetNode, getter_AddRefs(accessible)))) {
mListener->HandleEvent(nsIAccessibleEventListener::EVENT_FOCUS, accessible);
mCurrentFocus = optionTargetNode;
}
}
else
mListener->HandleEvent(nsIAccessibleEventListener::EVENT_STATE_CHANGE, accessible);
}
else if (eventType.EqualsIgnoreCase("CheckboxStateChange"))
mListener->HandleEvent(nsIAccessibleEventListener::EVENT_STATE_CHANGE, accessible);
else if (eventType.EqualsIgnoreCase("RadiobuttonStateChange"))
mListener->HandleEvent(nsIAccessibleEventListener::EVENT_STATE_CHANGE, accessible);
}
}
return NS_OK;
}
NS_IMETHODIMP nsRootAccessible::GetTargetNode(nsIDOMEvent *aEvent, nsCOMPtr<nsIDOMNode>& aTargetNode)
{
nsCOMPtr<nsIDOMEventTarget> domEventTarget;
aEvent->GetOriginalTarget(getter_AddRefs(domEventTarget));
nsresult rv;
aTargetNode = do_QueryInterface(domEventTarget, &rv);
return rv;
}
// ------- nsIDOMFocusListener Methods (1) -------------
NS_IMETHODIMP nsRootAccessible::Focus(nsIDOMEvent* aEvent)
{
return HandleEvent(aEvent);
}
NS_IMETHODIMP nsRootAccessible::Blur(nsIDOMEvent* aEvent) { return NS_OK; }
// ------- nsIDOMFormListener Methods (5) -------------
NS_IMETHODIMP nsRootAccessible::Submit(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHODIMP nsRootAccessible::Reset(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHODIMP nsRootAccessible::Change(nsIDOMEvent* aEvent)
{
// get change events when the form elements changes its state, checked->not,
// deleted text, new text, change in selection for list/combo boxes
// this may be the event that we have the individual Accessible objects
// handle themselves -- have list/combos figure out the change in selection
// have textareas and inputs fire a change of state etc...
return HandleEvent(aEvent);
}
// gets Select events when text is selected in a textarea or input
NS_IMETHODIMP nsRootAccessible::Select(nsIDOMEvent* aEvent) { return NS_OK; }
// gets Input events when text is entered or deleted in a textarea or input
NS_IMETHODIMP nsRootAccessible::Input(nsIDOMEvent* aEvent) { return NS_OK; }
// ------- nsIAccessibleDocument Methods (5) ---------------
NS_IMETHODIMP nsRootAccessible::GetURL(nsAWritableString& aURL)
{
return nsDocAccessibleMixin::GetURL(aURL);
}
NS_IMETHODIMP nsRootAccessible::GetTitle(nsAWritableString& aTitle)
{
return nsDocAccessibleMixin::GetTitle(aTitle);
}
NS_IMETHODIMP nsRootAccessible::GetMimeType(nsAWritableString& aMimeType)
{
return nsDocAccessibleMixin::GetMimeType(aMimeType);
}
NS_IMETHODIMP nsRootAccessible::GetDocType(nsAWritableString& aDocType)
{
return nsDocAccessibleMixin::GetDocType(aDocType);
}
NS_IMETHODIMP nsRootAccessible::GetNameSpaceURIForID(PRInt16 aNameSpaceID, nsAWritableString& aNameSpaceURI)
{
return nsDocAccessibleMixin::GetNameSpaceURIForID(aNameSpaceID, aNameSpaceURI);
}
NS_IMETHODIMP nsRootAccessible::GetDocument(nsIDocument **doc)
{
return nsDocAccessibleMixin::GetDocument(doc);
}
NS_IMETHODIMP nsRootAccessible::OnStateChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus)
{
return NS_OK;
}
/* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */
NS_IMETHODIMP nsRootAccessible::OnProgressChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress,
PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress)
{
return NS_OK;
}
/* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location); */
NS_IMETHODIMP nsRootAccessible::OnLocationChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, nsIURI *location)
{
// Load has been verified, it will occur, about to commence
if (mListener && mBusy != eBusyStateLoading) {
mBusy = eBusyStateLoading;
mListener->HandleEvent(nsIAccessibleEventListener::EVENT_STATE_CHANGE, this);
StartDocReadyTimer();
}
return NS_OK;
}
/* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
NS_IMETHODIMP nsRootAccessible::OnStatusChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage)
{
return NS_OK;
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
NS_IMETHODIMP nsRootAccessible::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, PRInt32 state)
{
return NS_OK;
}
nsDocAccessibleMixin::nsDocAccessibleMixin(nsIDocument *aDoc):mDocument(aDoc)
{
}
nsDocAccessibleMixin::nsDocAccessibleMixin(nsIWeakReference *aPresShell)
{
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(aPresShell));
if (shell)
shell->GetDocument(getter_AddRefs(mDocument));
}
nsDocAccessibleMixin::~nsDocAccessibleMixin()
{
}
NS_IMETHODIMP nsDocAccessibleMixin::GetURL(nsAWritableString& aURL)
{
nsCOMPtr<nsIPresShell> presShell;
mDocument->GetShellAt(0, getter_AddRefs(presShell));
NS_ASSERTION(presShell,"Shell is gone!!! What are we doing here?");
nsCOMPtr<nsIDocShell> docShell;
GetDocShellFromPS(presShell, getter_AddRefs(docShell));
nsCOMPtr<nsIWebNavigation> webNav(do_GetInterface(docShell));
nsXPIDLCString theURL;
if (webNav) {
nsCOMPtr<nsIURI> pURI;
webNav->GetCurrentURI(getter_AddRefs(pURI));
if (pURI)
pURI->GetSpec(getter_Copies(theURL));
}
//XXXaaronl Need to use CopyUTF8toUCS2(nsDependentCString(theURL), aURL); when it's written
aURL.Assign(NS_ConvertUTF8toUCS2(theURL).get());
return NS_OK;
}
NS_IMETHODIMP nsDocAccessibleMixin::GetTitle(nsAWritableString& aTitle)
{
// This doesn't leak - we don't own the const pointer that's returned
aTitle = *(mDocument->GetDocumentTitle());
return NS_OK;
}
NS_IMETHODIMP nsDocAccessibleMixin::GetMimeType(nsAWritableString& aMimeType)
{
nsCOMPtr<nsIDOMNSDocument> domnsDocument(do_QueryInterface(mDocument));
if (domnsDocument) {
return domnsDocument->GetContentType(aMimeType);
}
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsDocAccessibleMixin::GetDocType(nsAWritableString& aDocType)
{
nsCOMPtr<nsIXULDocument> xulDoc(do_QueryInterface(mDocument));
nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(mDocument));
nsCOMPtr<nsIDOMDocumentType> docType;
if (xulDoc) {
aDocType = NS_LITERAL_STRING("window"); // doctype not implemented for XUL at time of writing - causes assertion
return NS_OK;
}
else if (domDoc && NS_SUCCEEDED(domDoc->GetDoctype(getter_AddRefs(docType))) && docType) {
return docType->GetName(aDocType);
}
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsDocAccessibleMixin::GetNameSpaceURIForID(PRInt16 aNameSpaceID, nsAWritableString& aNameSpaceURI)
{
if (mDocument) {
nsCOMPtr<nsINameSpaceManager> nameSpaceManager;
if (NS_SUCCEEDED(mDocument->GetNameSpaceManager(*getter_AddRefs(nameSpaceManager))))
return nameSpaceManager->GetNameSpaceURI(aNameSpaceID, aNameSpaceURI);
}
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsDocAccessibleMixin::GetDocument(nsIDocument **doc)
{
*doc = mDocument;
if (mDocument) {
NS_IF_ADDREF(*doc);
return NS_OK;
}
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsDocAccessibleMixin::GetDocShellFromPS(nsIPresShell* aPresShell, nsIDocShell** aDocShell)
{
*aDocShell = nsnull;
if (aPresShell) {
nsCOMPtr<nsIDocument> doc;
aPresShell->GetDocument(getter_AddRefs(doc));
if (doc) {
nsCOMPtr<nsIScriptGlobalObject> scriptObj;
doc->GetScriptGlobalObject(getter_AddRefs(scriptObj));
if (scriptObj) {
scriptObj->GetDocShell(aDocShell);
if (*aDocShell)
return NS_OK;
}
}
}
return NS_ERROR_FAILURE;
}

View File

@@ -0,0 +1,140 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsRootAccessible_H_
#define _nsRootAccessible_H_
#include "nsAccessible.h"
#include "nsIAccessibleEventReceiver.h"
#include "nsIAccessibleEventListener.h"
#include "nsIAccessibleDocument.h"
#include "nsIDOMFormListener.h"
#include "nsIDOMFocusListener.h"
#include "nsIDocument.h"
#include "nsIAccessibilityService.h"
#include "nsIWebProgressListener.h"
#include "nsIWeakReference.h"
#include "nsITimer.h"
#include "nsITimerCallback.h"
class nsDocAccessibleMixin
{
public:
nsDocAccessibleMixin(nsIDocument *doc);
nsDocAccessibleMixin(nsIWeakReference *aShell);
virtual ~nsDocAccessibleMixin();
NS_DECL_NSIACCESSIBLEDOCUMENT
protected:
NS_IMETHOD GetDocShellFromPS(nsIPresShell* aPresShell, nsIDocShell** aDocShell);
PRBool mTopLevelDocument;
nsCOMPtr<nsIDocument> mDocument;
};
class nsRootAccessible : public nsAccessible,
public nsDocAccessibleMixin,
public nsIAccessibleDocument,
public nsIAccessibleEventReceiver,
public nsIDOMFocusListener,
public nsIDOMFormListener,
public nsIWebProgressListener,
public nsITimerCallback,
public nsSupportsWeakReference
{
NS_DECL_ISUPPORTS_INHERITED
public:
enum EBusyState {eBusyStateUninitialized, eBusyStateLoading, eBusyStateDone};
nsRootAccessible(nsIWeakReference* aShell);
virtual ~nsRootAccessible();
/* attribute wstring accName; */
NS_IMETHOD GetAccName(nsAWritableString& aAccName);
NS_IMETHOD GetAccValue(nsAWritableString& aAccValue);
NS_IMETHOD GetAccParent(nsIAccessible * *aAccParent);
NS_IMETHOD GetAccRole(PRUint32 *aAccRole);
NS_IMETHOD GetAccState(PRUint32 *aAccState);
// ----- nsIAccessibleEventReceiver -------------------
NS_IMETHOD AddAccessibleEventListener(nsIAccessibleEventListener *aListener);
NS_IMETHOD RemoveAccessibleEventListener();
// ----- nsIDOMEventListener --------------------------
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent);
// ----- nsIDOMFocusListener --------------------------
NS_IMETHOD Focus(nsIDOMEvent* aEvent);
NS_IMETHOD Blur(nsIDOMEvent* aEvent);
// ----- nsIDOMFormListener ---------------------------
NS_IMETHOD Submit(nsIDOMEvent* aEvent);
NS_IMETHOD Reset(nsIDOMEvent* aEvent);
NS_IMETHOD Change(nsIDOMEvent* aEvent);
NS_IMETHOD Select(nsIDOMEvent* aEvent);
NS_IMETHOD Input(nsIDOMEvent* aEvent);
NS_IMETHOD_(void) Notify(nsITimer *timer);
NS_IMETHOD StartDocReadyTimer();
NS_DECL_NSIACCESSIBLEDOCUMENT
NS_DECL_NSIWEBPROGRESSLISTENER
protected:
NS_IMETHOD GetTargetNode(nsIDOMEvent *aEvent, nsCOMPtr<nsIDOMNode>& aTargetNode);
virtual void GetBounds(nsRect& aRect, nsIFrame** aRelativeFrame);
virtual nsIFrame* GetFrame();
// mListener is not a com pointer. We don't own the listener
// it is the callers responsibility to remove the listener
// otherwise we will get into circular referencing problems
// We don't need a weak reference, because we're owned by this listener
nsIAccessibleEventListener *mListener;
nsCOMPtr<nsITimer> mTimer;
nsCOMPtr<nsIDOMNode> mCurrentFocus;
nsCOMPtr<nsIAccessibilityService> mAccService;
EBusyState mBusy;
};
#endif

View File

@@ -0,0 +1,680 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Original Author: Eric Vaughan (evaughan@netscape.com)
* Contributor(s): John Gaunt (jgaunt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsCOMPtr.h"
#include "nsFormControlAccessible.h"
#include "nsIAtom.h"
#include "nsIComboboxControlFrame.h"
#include "nsIDOMEventReceiver.h"
#include "nsIDOMHTMLCollection.h"
#include "nsIDOMHTMLOptionElement.h"
#include "nsIDOMHTMLSelectElement.h"
#include "nsIFrame.h"
#include "nsIListControlFrame.h"
#include "nsISelectControlFrame.h"
#include "nsLayoutAtoms.h"
#include "nsRootAccessible.h"
#include "nsSelectAccessible.h"
/** ------------------------------------------------------ */
/** First, the common widgets */
/** ------------------------------------------------------ */
/** Constructor -- cache our parent */
nsSelectListAccessible::nsSelectListAccessible(nsIAccessible* aParent,
nsIDOMNode* aDOMNode,
nsIWeakReference* aShell)
:nsAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
/** Return our parents bounds */
NS_IMETHODIMP nsSelectListAccessible::AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height)
{
return mParent->AccGetBounds(x,y,width,height);
}
/** Return our cached parent */
NS_IMETHODIMP nsSelectListAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_ADDREF(*_retval);
return NS_OK;
}
/** We are a list */
NS_IMETHODIMP nsSelectListAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_LIST;
return NS_OK;
}
/** We are an only child */
NS_IMETHODIMP nsSelectListAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/** We are an only child */
NS_IMETHODIMP nsSelectListAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
* nsSelectOptionAccessible
*/
/** Constructor -- cache our parent */
nsSelectOptionAccessible::nsSelectOptionAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
nsLeafAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
/** We are a ListItem */
NS_IMETHODIMP nsSelectOptionAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_LISTITEM;
return NS_OK;
}
/** Return our cached parent */
NS_IMETHODIMP nsSelectOptionAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
/**
* Get our Name from our Content's subtree
*/
NS_IMETHODIMP nsSelectOptionAccessible::GetAccName(nsAWritableString& _retval)
{
nsCOMPtr<nsIContent> content (do_QueryInterface(mDOMNode));
if (!content) {
return NS_ERROR_FAILURE;
}
nsAutoString option;
nsresult rv = AppendFlatStringFromSubtree(content, &option);
if (NS_SUCCEEDED(rv)) {
// Temp var needed until CompressWhitespace built for nsAWritableString
option.CompressWhitespace();
_retval.Assign(option);
}
return rv;
}
/** ------------------------------------------------------ */
/** Secondly, the Listbox widget */
/** ------------------------------------------------------ */
/** ----- nsListboxAccessible ----- */
/** Constructor */
nsListboxAccessible::nsListboxAccessible(nsIDOMNode* aDOMNode,
nsIWeakReference* aShell):
nsAccessible(aDOMNode, aShell)
{
}
/** We are a window, as far as MSAA is concerned */
NS_IMETHODIMP nsListboxAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_WINDOW;
return NS_OK;
}
/**
* We always have 1 child: a subclass of nsSelectListAccessible.
*/
NS_IMETHODIMP nsListboxAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 1;
return NS_OK;
}
/**
* As a nsHTMLListboxAccessible we can have the following states:
* STATE_FOCUSED
* STATE_READONLY
* STATE_FOCUSABLE
*/
NS_IMETHODIMP nsListboxAccessible::GetAccState(PRUint32 *_retval)
{
// Get focus status from base class
nsAccessible::GetAccState(_retval);
*_retval |= STATE_READONLY | STATE_FOCUSABLE;
return NS_OK;
}
/** ------------------------------------------------------ */
/** Finally, the Combobox widgets */
/** ------------------------------------------------------ */
/** ----- nsComboboxAccessible ----- */
/**
* Constructor -- set initial state - closed, register ourself
*/
nsComboboxAccessible::nsComboboxAccessible(nsIDOMNode* aDOMNode,
nsIWeakReference* aShell):
nsAccessible(aDOMNode, aShell)
{
mRegistered = PR_FALSE;
mOpen = PR_FALSE;
SetupMenuListener();
}
/**
* Destructor -- If we are registered, remove ourselves as a listener.
*/
nsComboboxAccessible::~nsComboboxAccessible()
{
if (mRegistered) {
nsCOMPtr<nsIDOMEventReceiver> eventReceiver(do_QueryInterface(mDOMNode));
if (eventReceiver)
eventReceiver->RemoveEventListener(NS_LITERAL_STRING("popupshowing"), this, PR_TRUE);
}
}
/**
* Inherit the ISupports impl from nsAccessible,
* handle nsIDOMXULListener and nsIAccessibleSelectable ourself
*/
NS_IMPL_ISUPPORTS_INHERITED2(nsComboboxAccessible, nsAccessible, nsIDOMXULListener, nsIAccessibleSelectable)
/**
* If we aren't already registered, register ourselves as a
* listener to "popupshowing" events on our DOM node. Set our
* state to registered, but don't notify MSAA as they
* don't need to know about this state.
*/
void
nsComboboxAccessible::SetupMenuListener()
{
// if not already registered as a popup listener, register ourself
if (!mRegistered) {
nsCOMPtr<nsIDOMEventReceiver> eventReceiver(do_QueryInterface(mDOMNode));
if (eventReceiver && NS_SUCCEEDED(eventReceiver->AddEventListener(NS_LITERAL_STRING("popupshowing"), this, PR_TRUE)))
mRegistered = PR_TRUE;
}
}
/** We are a combobox */
NS_IMETHODIMP nsComboboxAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_COMBOBOX;
return NS_OK;
}
/**
* We always have 3 children: TextField, Button, Window. In that order
*/
NS_IMETHODIMP nsComboboxAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 3;
return NS_OK;
}
/**
* nsIAccessibleSelectable method. No-op because our selection is returned through
* GetValue(). This _may_ change just to provide additional info for the vendors
* and another option for them to get at stuff. Despite the fact that we are
* single selection only.
*/
NS_IMETHODIMP nsComboboxAccessible::GetSelectedChildren(nsISupportsArray **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
* As a nsComboboxAccessible we can have the following states:
* STATE_FOCUSED
* STATE_READONLY
* STATE_FOCUSABLE
* STATE_HASPOPUP
* STATE_EXPANDED
* STATE_COLLAPSED
*/
NS_IMETHODIMP nsComboboxAccessible::GetAccState(PRUint32 *_retval)
{
// Get focus status from base class
nsAccessible::GetAccState(_retval);
if (mOpen)
*_retval |= STATE_EXPANDED;
else
*_retval |= STATE_COLLAPSED;
*_retval |= STATE_HASPOPUP | STATE_READONLY | STATE_FOCUSABLE;
return NS_OK;
}
/**
* Set our state to open and (TBD) fire an event to MSAA saying our state
* has changed.
*/
NS_IMETHODIMP nsComboboxAccessible::PopupShowing(nsIDOMEvent* aEvent)
{
mOpen = PR_TRUE;
/* TBD send state change event */
return NS_OK;
}
/**
* Set our state to not open and (TDB) fire an event to MSAA saying
* our state has changed.
*/
NS_IMETHODIMP nsComboboxAccessible::PopupHiding(nsIDOMEvent* aEvent)
{
mOpen = PR_FALSE;
/* TBD send state change event */
return NS_OK;
}
/**
* Set our state to not open and (TDB) fire an event to MSAA saying
* our state has changed.
*/
NS_IMETHODIMP nsComboboxAccessible::Close(nsIDOMEvent* aEvent)
{
mOpen = PR_FALSE;
/* TBD send state change event */
return NS_OK;
}
/** ----- nsComboboxTextFieldAccessible ----- */
/** Constructor */
nsComboboxTextFieldAccessible::nsComboboxTextFieldAccessible(nsIAccessible* aParent,
nsIDOMNode* aDOMNode,
nsIWeakReference* aShell):
nsLeafAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
/**
* Currently gets the text from the first option, needs to check for selection
* and then return that text.
* Walks the Frame tree and checks for proper frames.
*/
NS_IMETHODIMP nsComboboxTextFieldAccessible::GetAccValue(nsAWritableString& _retval)
{
nsIFrame* frame = nsAccessible::GetBoundsFrame();
nsCOMPtr<nsIPresContext> context;
GetPresContext(context);
if (!frame || !context)
return NS_ERROR_FAILURE;
frame->FirstChild(context, nsnull, &frame);
#ifdef DEBUG
if (! nsAccessible::IsCorrectFrameType(frame, nsLayoutAtoms::blockFrame))
return NS_ERROR_FAILURE;
#endif
frame->FirstChild(context, nsnull, &frame);
#ifdef DEBUG
if (! nsAccessible::IsCorrectFrameType(frame, nsLayoutAtoms::textFrame))
return NS_ERROR_FAILURE;
#endif
nsCOMPtr<nsIContent> content;
frame->GetContent(getter_AddRefs(content));
if (!content)
return NS_ERROR_FAILURE;
AppendFlatStringFromSubtree(content, &_retval);
return NS_OK;
}
/**
* Gets the bounds for the BlockFrame.
* Walks the Frame tree and checks for proper frames.
*/
void nsComboboxTextFieldAccessible::GetBounds(nsRect& aBounds, nsIFrame** aBoundingFrame)
{
// get our first child's frame
nsIFrame* frame = nsAccessible::GetBoundsFrame();
nsCOMPtr<nsIPresContext> context;
GetPresContext(context);
if (!frame || !context)
return;
frame->FirstChild(context, nsnull, aBoundingFrame);
frame->FirstChild(context, nsnull, &frame);
#ifdef DEBUG
if (! nsAccessible::IsCorrectFrameType(frame, nsLayoutAtoms::blockFrame))
return;
#endif
frame->GetRect(aBounds);
}
/** Return our cached parent */
NS_IMETHODIMP nsComboboxTextFieldAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
/**
* We are the first child of our parent, no previous sibling
*/
NS_IMETHODIMP nsComboboxTextFieldAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
* Our role is currently only static text, but we should be able to have
* editable text here and we need to check that case.
*/
NS_IMETHODIMP nsComboboxTextFieldAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_STATICTEXT;
return NS_OK;
}
/**
* As a nsComboboxTextFieldAccessible we can have the following states:
* STATE_READONLY
* STATE_FOCUSED
* STATE_FOCUSABLE
*/
NS_IMETHODIMP nsComboboxTextFieldAccessible::GetAccState(PRUint32 *_retval)
{
// Get focus status from base class
nsAccessible::GetAccState(_retval);
*_retval |= STATE_READONLY | STATE_FOCUSABLE;
return NS_OK;
}
/** -----ComboboxButtonAccessible ----- */
/** Constructor -- cache our parent */
nsComboboxButtonAccessible::nsComboboxButtonAccessible(nsIAccessible* aParent,
nsIDOMNode* aDOMNode,
nsIWeakReference* aShell):
nsLeafAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
/** Just one action ( click ). */
NS_IMETHODIMP nsComboboxButtonAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = eSingle_Action;
return NS_OK;
}
/**
* Gets the bounds for the gfxButtonControlFrame.
* Walks the Frame tree and checks for proper frames.
*/
void nsComboboxButtonAccessible::GetBounds(nsRect& aBounds, nsIFrame** aBoundingFrame)
{
// get our second child's frame
nsIFrame* frame = nsAccessible::GetBoundsFrame();
nsCOMPtr<nsIPresContext> context;
GetPresContext(context);
if (!context)
return;
frame->FirstChild(context, nsnull, &frame);
#ifdef DEBUG
if (! nsAccessible::IsCorrectFrameType(frame, nsLayoutAtoms::blockFrame))
return;
#endif
frame->GetNextSibling(aBoundingFrame);
frame->GetNextSibling(&frame);
#ifdef DEBUG
if (! nsAccessible::IsCorrectFrameType(frame, nsLayoutAtoms::gfxButtonControlFrame))
return;
#endif
frame->GetRect(aBounds);
}
/** We are a button. */
NS_IMETHODIMP nsComboboxButtonAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_PUSHBUTTON;
return NS_OK;
}
/** Return our cached parent */
NS_IMETHODIMP nsComboboxButtonAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
/**
* Gets the name from GetAccActionName()
*/
NS_IMETHODIMP nsComboboxButtonAccessible::GetAccName(nsAWritableString& _retval)
{
return GetAccActionName(eAction_Click, _retval);
}
/**
* Our action name is the reverse of our state:
* if we are closed -> open is our name.
* if we are open -> closed is our name.
* Uses the frame to get the state, updated on every click
*/
NS_IMETHODIMP nsComboboxButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
PRBool isOpen = PR_FALSE;
nsIFrame *boundsFrame = GetBoundsFrame();
nsIComboboxControlFrame* comboFrame;
boundsFrame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame), (void**)&comboFrame);
if (!comboFrame)
return NS_ERROR_FAILURE;
comboFrame->IsDroppedDown(&isOpen);
if (isOpen)
_retval = NS_LITERAL_STRING("Close");
else
_retval = NS_LITERAL_STRING("Open");
return NS_OK;
}
/**
* As a nsComboboxButtonAccessible we can have the following states:
* STATE_PRESSED
* STATE_FOCUSED
* STATE_FOCUSABLE
*/
NS_IMETHODIMP nsComboboxButtonAccessible::GetAccState(PRUint32 *_retval)
{
// Get focus status from base class
nsAccessible::GetAccState(_retval);
// we are open or closed --> pressed or not
PRBool isOpen = PR_FALSE;
nsIFrame *boundsFrame = GetBoundsFrame();
nsIComboboxControlFrame* comboFrame;
boundsFrame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame), (void**)&comboFrame);
if (!comboFrame)
return NS_ERROR_FAILURE;
comboFrame->IsDroppedDown(&isOpen);
if (isOpen)
*_retval |= STATE_PRESSED;
*_retval |= STATE_FOCUSABLE;
return NS_OK;
}
/** ----- nsComboboxWindowAccessible ----- */
/**
* Constructor -- cache our parent
*/
nsComboboxWindowAccessible::nsComboboxWindowAccessible(nsIAccessible* aParent,
nsIDOMNode* aDOMNode,
nsIWeakReference* aShell):
nsAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
/**
* As a nsComboboxWindowAccessible we can have the following states:
* STATE_FOCUSED
* STATE_FOCUSABLE
* STATE_INVISIBLE
* STATE_FLOATING
*/
NS_IMETHODIMP nsComboboxWindowAccessible::GetAccState(PRUint32 *_retval)
{
// Get focus status from base class
nsAccessible::GetAccState(_retval);
// we are open or closed
PRBool isOpen = PR_FALSE;
nsIFrame *boundsFrame = GetBoundsFrame();
nsIComboboxControlFrame* comboFrame = nsnull;
boundsFrame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame), (void**)&comboFrame);
if (!comboFrame)
return NS_ERROR_FAILURE;
comboFrame->IsDroppedDown(&isOpen);
if (! isOpen)
*_retval |= STATE_INVISIBLE;
*_retval |= STATE_FOCUSABLE | STATE_FLOATING;
return NS_OK;
}
/** We are a window */
NS_IMETHODIMP nsComboboxWindowAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_WINDOW;
return NS_OK;
}
/** Return our cached parent */
NS_IMETHODIMP nsComboboxWindowAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
/**
* We are the last sibling of our parent.
*/
NS_IMETHODIMP nsComboboxWindowAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
* We only have one child, a list
*/
NS_IMETHODIMP nsComboboxWindowAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 1;
return NS_OK;
}
/**
* Gets the bounds for the areaFrame.
* Walks the Frame tree and checks for proper frames.
*/
void nsComboboxWindowAccessible::GetBounds(nsRect& aBounds, nsIFrame** aBoundingFrame)
{
// get our first option
nsCOMPtr<nsIDOMNode> child;
mDOMNode->GetFirstChild(getter_AddRefs(child));
// now get its frame
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
if (!shell) {
*aBoundingFrame = nsnull;
return;
}
nsIFrame* frame = nsnull;
nsCOMPtr<nsIContent> content(do_QueryInterface(child));
shell->GetPrimaryFrameFor(content, &frame);
#ifdef DEBUG
if (! nsAccessible::IsCorrectFrameType(frame, nsLayoutAtoms::blockFrame))
return;
#endif
frame->GetParent(aBoundingFrame);
frame->GetParent(&frame);
#ifdef DEBUG
if (! nsAccessible::IsCorrectFrameType(frame, nsLayoutAtoms::areaFrame))
return;
#endif
frame->GetRect(aBounds);
}

View File

@@ -0,0 +1,237 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Original Author: Eric Vaughan (evaughan@netscape.com)
* Contributor(s): John Gaunt (jgaunt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __nsSelectAccessible_h__
#define __nsSelectAccessible_h__
#include "nsBaseWidgetAccessible.h"
#include "nsIAccessibleSelectable.h"
#include "nsIDOMXULListener.h"
/** ------------------------------------------------------ */
/** First, the common widgets */
/** ------------------------------------------------------ */
/**
* The list that contains all the options in the select.
*/
class nsSelectListAccessible : public nsAccessible
{
public:
nsSelectListAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsSelectListAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
protected:
nsCOMPtr<nsIAccessible> mParent;
};
/**
* Options inside the select, contained within the list
*/
class nsSelectOptionAccessible : public nsLeafAccessible
{
public:
nsSelectOptionAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsSelectOptionAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
protected:
nsCOMPtr<nsIAccessible> mParent;
};
/** ------------------------------------------------------ */
/** Secondly, the Listbox widget */
/** ------------------------------------------------------ */
/**
* A class that represents the Listbox widget.
*/
class nsListboxAccessible : public nsAccessible
{
public:
nsListboxAccessible (nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsListboxAccessible () {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
};
/** ------------------------------------------------------ */
/** Finally, the Combobox widgets */
/** ------------------------------------------------------ */
/**
* A class the represents the HTML Combobox widget.
*/
class nsComboboxAccessible : public nsAccessible,
public nsIAccessibleSelectable,
public nsIDOMXULListener
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIACCESSIBLESELECTABLE
nsComboboxAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsComboboxAccessible();
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
/* ----- nsIDOMXULListener ----- */
NS_IMETHOD PopupShowing(nsIDOMEvent* aEvent);
NS_IMETHOD PopupShown(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD PopupHiding(nsIDOMEvent* aEvent);
NS_IMETHOD PopupHidden(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD Close(nsIDOMEvent* aEvent);
NS_IMETHOD Command(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD Broadcast(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD CommandUpdate(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent) { return NS_OK; }
virtual void SetupMenuListener();
protected:
PRBool mRegistered;
PRBool mOpen;
};
/**
* A class the represents the text field in the Combobox to the left
* of the drop down button
*/
class nsComboboxTextFieldAccessible : public nsLeafAccessible
{
public:
nsComboboxTextFieldAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsComboboxTextFieldAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccValue(nsAWritableString& _retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
virtual void GetBounds(nsRect& aBounds, nsIFrame** aBoundingFrame);
protected:
nsCOMPtr<nsIAccessible> mParent;
};
/**
* A class that represents the button inside the Select to the
* right of the text field
*/
class nsComboboxButtonAccessible : public nsLeafAccessible
{
public:
nsComboboxButtonAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsComboboxButtonAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
virtual void GetBounds(nsRect& aBounds, nsIFrame** aBoundingFrame);
protected:
nsCOMPtr<nsIAccessible> mParent;
};
/**
* A class that represents the window that lives to the right
* of the drop down button inside the Select. This is the window
* that is made visible when the button is pressed.
*/
class nsComboboxWindowAccessible : public nsAccessible
{
public:
nsComboboxWindowAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsComboboxWindowAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
virtual void GetBounds(nsRect& aBounds, nsIFrame** aBoundingFrame);
protected:
nsCOMPtr<nsIAccessible> mParent;
};
#endif

View File

@@ -0,0 +1,169 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Aaron Leventhal (aaronl@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsGenericAccessible.h"
#include "nsHTMLAreaAccessible.h"
#include "nsReadableUtils.h"
#include "nsString.h"
#include "nsAccessible.h"
#include "nsIAccessibilityService.h"
#include "nsIServiceManager.h"
#include "nsIDOMElement.h"
#include "nsIDOMHTMLAreaElement.h"
// --- area -----
nsHTMLAreaAccessible::nsHTMLAreaAccessible(nsIDOMNode *aDomNode, nsIAccessible *aAccParent, nsIWeakReference* aShell):
nsLinkableAccessible(aDomNode, aShell), mAccParent(aAccParent)
{
}
/* wstring getAccName (); */
NS_IMETHODIMP nsHTMLAreaAccessible::GetAccName(nsAWritableString & _retval)
{
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(mDOMNode));
if (elt) {
nsAutoString hrefString;
elt->GetAttribute(NS_LITERAL_STRING("title"), _retval);
}
return NS_OK;
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLAreaAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_LINK;
return NS_OK;
}
/* wstring getAccValue (); */
NS_IMETHODIMP nsHTMLAreaAccessible::GetAccValue(nsAWritableString& _retval)
{
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(mDOMNode));
if (elt)
elt->GetAttribute(NS_LITERAL_STRING("href"), _retval);
return NS_OK;
}
/* wstring getAccDescription (); */
NS_IMETHODIMP nsHTMLAreaAccessible::GetAccDescription(nsAWritableString& _retval)
{
// Still to do - follow IE's standard here
nsCOMPtr<nsIDOMHTMLAreaElement> area(do_QueryInterface(mDOMNode));
if (area)
area->GetShape(_retval);
return NS_OK;
}
/* nsIAccessible getAccFirstChild (); */
NS_IMETHODIMP nsHTMLAreaAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/* nsIAccessible getAccLastChild (); */
NS_IMETHODIMP nsHTMLAreaAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/* long getAccChildCount (); */
NS_IMETHODIMP nsHTMLAreaAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 0;
return NS_OK;
}
NS_IMETHODIMP nsHTMLAreaAccessible::GetAccParent(nsIAccessible * *aAccParent)
{
*aAccParent = mAccParent;
NS_IF_ADDREF(*aAccParent);
return NS_OK;
}
nsIAccessible *nsHTMLAreaAccessible::CreateAreaAccessible(nsIDOMNode *aDOMNode)
{
nsCOMPtr<nsIAccessibilityService> accService(do_GetService("@mozilla.org/accessibilityService;1"));
if (accService) {
nsIAccessible* acc = nsnull;
accService->CreateHTMLAreaAccessible(mPresShell, aDOMNode, mAccParent, &acc);
return acc;
}
return nsnull;
}
NS_IMETHODIMP nsHTMLAreaAccessible::GetAccNextSibling(nsIAccessible * *aAccNextSibling)
{
*aAccNextSibling = nsnull;
nsCOMPtr<nsIDOMNode> nextNode;
mDOMNode->GetNextSibling(getter_AddRefs(nextNode));
if (nextNode)
*aAccNextSibling = CreateAreaAccessible(nextNode);
return NS_OK;
}
/* readonly attribute nsIAccessible accPreviousSibling; */
NS_IMETHODIMP nsHTMLAreaAccessible::GetAccPreviousSibling(nsIAccessible * *aAccPrevSibling)
{
*aAccPrevSibling = nsnull;
nsCOMPtr<nsIDOMNode> prevNode;
mDOMNode->GetPreviousSibling(getter_AddRefs(prevNode));
if (prevNode)
*aAccPrevSibling = CreateAreaAccessible(prevNode);
return NS_OK;
}
/* void accGetBounds (out long x, out long y, out long width, out long height); */
NS_IMETHODIMP nsHTMLAreaAccessible::AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height)
{
//nsIFrame *frame;
// Do a better job on this later - need to use GetRect on mAreas of nsImageMap from nsImageFrame
//return mAccParent->nsAccessible::AccGetBounds(x,y,width,height);
*x = *y = *width = *height = 0;
return NS_ERROR_NOT_IMPLEMENTED;
}

View File

@@ -0,0 +1,71 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Aaron Leventhal (aaronl@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsHTMLAreaAccessible_H_
#define _nsHTMLAreaAccessible_H_
#include "nsBaseWidgetAccessible.h"
#include "nsAccessible.h"
/* Accessible for image map areas - must be child of image
*/
class nsHTMLAreaAccessible : public nsLinkableAccessible
{
public:
nsHTMLAreaAccessible(nsIDOMNode *domNode, nsIAccessible *accParent, nsIWeakReference* aShell);
NS_IMETHOD GetAccName(nsAWritableString & _retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccValue(nsAWritableString& _retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
NS_IMETHOD GetAccParent(nsIAccessible * *aAccParent);
NS_IMETHOD GetAccNextSibling(nsIAccessible * *aAccNextSibling);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible * *aAccPreviousSibling);
NS_IMETHOD GetAccDescription(nsAWritableString& _retval);
NS_IMETHOD AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height);
protected:
nsIAccessible *CreateAreaAccessible(nsIDOMNode *aDOMNode);
nsCOMPtr<nsIAccessible> mAccParent;
};
#endif

View File

@@ -0,0 +1,376 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Eric Vaughan (evaughan@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// NOTE: alphabetically ordered
#include "nsAccessible.h"
#include "nsFormControlAccessible.h"
#include "nsHTMLAtoms.h"
#include "nsHTMLFormControlAccessible.h"
#include "nsIDOMHTMLButtonElement.h"
#include "nsIDOMHTMLFormElement.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMHTMLLabelElement.h"
#include "nsIDOMHTMLTextAreaElement.h"
#include "nsIDOMXULCheckboxElement.h"
#include "nsIDOMXULButtonElement.h"
#include "nsIDOMXULSelectCntrlItemEl.h"
#include "nsIDOMXULSelectCntrlEl.h"
#include "nsINameSpaceManager.h"
#include "nsIFrame.h"
#include "nsISelectionController.h"
#include "nsReadableUtils.h"
#include "nsWeakReference.h"
// --- checkbox -----
nsHTMLCheckboxAccessible::nsHTMLCheckboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsFormControlAccessible(aNode, aShell)
{
}
NS_IMETHODIMP nsHTMLCheckboxAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_CHECKBUTTON;
return NS_OK;
}
NS_IMETHODIMP nsHTMLCheckboxAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = eSingle_Action;
return NS_OK;
}
NS_IMETHODIMP nsHTMLCheckboxAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
if (index == eAction_Click) { // 0 is the magic value for default action
// check or uncheck
PRUint32 state;
GetAccState(&state);
if (state & STATE_CHECKED)
_retval = NS_LITERAL_STRING("uncheck");
else
_retval = NS_LITERAL_STRING("check");
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP nsHTMLCheckboxAccessible::AccDoAction(PRUint8 index)
{
if (index == 0) { // 0 is the magic value for default action
nsCOMPtr<nsIDOMHTMLInputElement> htmlCheckboxElement(do_QueryInterface(mDOMNode));
PRBool checked = PR_FALSE;
if (htmlCheckboxElement) {
htmlCheckboxElement->GetChecked(&checked);
htmlCheckboxElement->SetChecked(!checked);
return NS_OK;
}
return NS_ERROR_FAILURE;
}
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP nsHTMLCheckboxAccessible::GetAccState(PRUint32 *_retval)
{
nsFormControlAccessible::GetAccState(_retval);
PRBool checked = PR_FALSE; // Radio buttons and check boxes can be checked
nsCOMPtr<nsIDOMHTMLInputElement> htmlCheckboxElement(do_QueryInterface(mDOMNode));
if (htmlCheckboxElement)
htmlCheckboxElement->GetChecked(&checked);
if (checked)
*_retval |= STATE_CHECKED;
return NS_OK;
}
//------ Radio button -------
nsHTMLRadioButtonAccessible::nsHTMLRadioButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsRadioButtonAccessible(aNode, aShell)
{
}
NS_IMETHODIMP nsHTMLRadioButtonAccessible::AccDoAction(PRUint8 index)
{
if (index == eAction_Click) {
nsCOMPtr<nsIDOMHTMLInputElement> element(do_QueryInterface(mDOMNode));
element->Click();
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP nsHTMLRadioButtonAccessible::GetAccState(PRUint32 *_retval)
{
nsFormControlAccessible::GetAccState(_retval);
PRBool checked = PR_FALSE; // Radio buttons and check boxes can be checked
nsCOMPtr<nsIDOMHTMLInputElement> htmlRadioElement(do_QueryInterface(mDOMNode));
if (htmlRadioElement)
htmlRadioElement->GetChecked(&checked);
if (checked)
*_retval |= STATE_CHECKED;
return NS_OK;
}
// ----- Button -----
nsHTMLButtonAccessible::nsHTMLButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsFormControlAccessible(aNode, aShell)
{
}
NS_IMETHODIMP nsHTMLButtonAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = eSingle_Action;
return NS_OK;;
}
NS_IMETHODIMP nsHTMLButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
if (index == eAction_Click) {
_retval = NS_LITERAL_STRING("press");
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP nsHTMLButtonAccessible::AccDoAction(PRUint8 index)
{
if (index == 0) {
nsCOMPtr<nsIDOMHTMLInputElement> element(do_QueryInterface(mDOMNode));
element->Click();
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP nsHTMLButtonAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_PUSHBUTTON;
return NS_OK;
}
NS_IMETHODIMP nsHTMLButtonAccessible::GetAccName(nsAWritableString& _retval)
{
nsCOMPtr<nsIDOMHTMLInputElement> button(do_QueryInterface(mDOMNode));
if (!button)
return NS_ERROR_FAILURE;
nsAutoString name;
button->GetValue(name);
name.CompressWhitespace();
_retval.Assign(name);
return NS_OK;
}
// ----- HTML 4 Button: can contain arbitrary HTML content -----
nsHTML4ButtonAccessible::nsHTML4ButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsBlockAccessible(aNode, aShell)
{
}
NS_IMETHODIMP nsHTML4ButtonAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = eSingle_Action;
return NS_OK;;
}
NS_IMETHODIMP nsHTML4ButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
if (index == eAction_Click) {
_retval = NS_LITERAL_STRING("press");
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP nsHTML4ButtonAccessible::AccDoAction(PRUint8 index)
{
if (index == 0) {
nsCOMPtr<nsIDOMHTMLInputElement> inputElement(do_QueryInterface(mDOMNode));
if ( inputElement )
{
inputElement->Click();
return NS_OK;
}
return NS_ERROR_FAILURE;
}
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP nsHTML4ButtonAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_PUSHBUTTON;
return NS_OK;
}
NS_IMETHODIMP nsHTML4ButtonAccessible::GetAccState(PRUint32 *_retval)
{
nsAccessible::GetAccState(_retval);
*_retval |= STATE_FOCUSABLE;
return NS_OK;
}
NS_IMETHODIMP nsHTML4ButtonAccessible::GetAccName(nsAWritableString& _retval)
{
nsresult rv = NS_ERROR_FAILURE;
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
nsAutoString name;
if (content)
rv = AppendFlatStringFromSubtree(content, &name);
if (NS_SUCCEEDED(rv)) {
// Temp var needed until CompressWhitespace built for nsAWritableString
name.CompressWhitespace();
_retval.Assign(name);
}
return rv;
}
// --- textfield -----
nsHTMLTextFieldAccessible::nsHTMLTextFieldAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsFormControlAccessible(aNode, aShell)
{
}
NS_IMETHODIMP nsHTMLTextFieldAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_TEXT;
return NS_OK;
}
NS_IMETHODIMP nsHTMLTextFieldAccessible::GetAccValue(nsAWritableString& _retval)
{
PRUint32 state;
GetAccState(&state);
if (state & STATE_PROTECTED) // Don't return password text!
return NS_ERROR_FAILURE;
nsCOMPtr<nsIDOMHTMLTextAreaElement> textArea(do_QueryInterface(mDOMNode));
if (textArea) {
textArea->GetValue(_retval);
return NS_OK;
}
nsCOMPtr<nsIDOMHTMLInputElement> inputElement(do_QueryInterface(mDOMNode));
if (inputElement) {
inputElement->GetValue(_retval);
return NS_OK;
}
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsHTMLTextFieldAccessible::GetAccState(PRUint32 *_retval)
{
// can be
// focusable, focused, protected. readonly, unavailable, selected
nsAccessible::GetAccState(_retval);
*_retval |= STATE_FOCUSABLE;
nsCOMPtr<nsIDOMHTMLTextAreaElement> textArea(do_QueryInterface(mDOMNode));
nsCOMPtr<nsIDOMHTMLInputElement> inputElement(do_QueryInterface(mDOMNode));
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(mDOMNode));
PRBool isReadOnly = PR_FALSE;
elt->HasAttribute(NS_LITERAL_STRING("readonly"), &isReadOnly);
if (isReadOnly)
*_retval |= STATE_READONLY;
// Get current selection and find out if current node is in it
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
if (!shell) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIPresContext> context;
shell->GetPresContext(getter_AddRefs(context));
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
nsIFrame *frame;
if (content && NS_SUCCEEDED(shell->GetPrimaryFrameFor(content, &frame))) {
nsCOMPtr<nsISelectionController> selCon;
frame->GetSelectionController(context,getter_AddRefs(selCon));
if (selCon) {
nsCOMPtr<nsISelection> domSel;
selCon->GetSelection(nsISelectionController::SELECTION_NORMAL, getter_AddRefs(domSel));
if (domSel) {
PRBool isCollapsed = PR_TRUE;
domSel->GetIsCollapsed(&isCollapsed);
if (!isCollapsed)
*_retval |=STATE_SELECTED;
}
}
}
if (!textArea) {
if (inputElement) {
/////// ====== Must be a password field, so it uses nsIDOMHTMLFormControl ==== ///////
PRUint32 moreStates = 0;
nsresult rv = nsFormControlAccessible::GetAccState(&moreStates);
*_retval |= moreStates;
return rv;
}
return NS_ERROR_FAILURE;
}
PRBool disabled = PR_FALSE;
textArea->GetDisabled(&disabled);
if (disabled)
*_retval |= STATE_UNAVAILABLE;
return NS_OK;
}

View File

@@ -0,0 +1,103 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Eric D Vaughan (evaughan@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsHTMLFormControlAccessible_H_
#define _nsHTMLFormControlAccessible_H_
#include "nsBaseWidgetAccessible.h"
#include "nsFormControlAccessible.h"
class nsICheckboxControlFrame;
class nsHTMLCheckboxAccessible : public nsFormControlAccessible
{
public:
nsHTMLCheckboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
NS_IMETHOD AccDoAction(PRUint8 index);
NS_IMETHOD GetAccState(PRUint32 *_retval);
};
class nsHTMLRadioButtonAccessible : public nsRadioButtonAccessible
{
public:
nsHTMLRadioButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD AccDoAction(PRUint8 index);
NS_IMETHOD GetAccState(PRUint32 *_retval);
};
class nsHTMLButtonAccessible : public nsFormControlAccessible
{
public:
nsHTMLButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
NS_IMETHOD AccDoAction(PRUint8 index);
};
class nsHTML4ButtonAccessible : public nsBlockAccessible
{
public:
nsHTML4ButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
NS_IMETHOD AccDoAction(PRUint8 index);
};
class nsHTMLTextFieldAccessible : public nsFormControlAccessible
{
public:
nsHTMLTextFieldAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccValue(nsAWritableString& _retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
};
#endif

View File

@@ -0,0 +1,207 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsHTMLIFrameRootAccessible.h"
#include "nsCOMPtr.h"
#include "nsIDocument.h"
#include "nsIPresShell.h"
#include "nsIContent.h"
#include "nsIFrame.h"
#include "nsIDOMDocument.h"
#include "nsReadableUtils.h"
NS_INTERFACE_MAP_BEGIN(nsHTMLIFrameRootAccessible)
NS_INTERFACE_MAP_END_INHERITING(nsRootAccessible)
NS_IMPL_ADDREF_INHERITED(nsHTMLIFrameRootAccessible, nsRootAccessible);
NS_IMPL_RELEASE_INHERITED(nsHTMLIFrameRootAccessible, nsRootAccessible);
NS_IMPL_ADDREF_INHERITED(nsHTMLIFrameAccessible, nsBlockAccessible);
NS_IMPL_RELEASE_INHERITED(nsHTMLIFrameAccessible, nsBlockAccessible);
NS_IMETHODIMP
nsHTMLIFrameAccessible::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
NS_ASSERTION(aInstancePtr, "QueryInterface requires a non-NULL destination!");
if ( !aInstancePtr )
return NS_ERROR_NULL_POINTER;
if (aIID.Equals(NS_GET_IID(nsIAccessibleDocument))) {
*aInstancePtr = (void*)(nsIAccessibleDocument*) this;
NS_IF_ADDREF(this);
return NS_OK;
}
return nsBlockAccessible::QueryInterface(aIID, aInstancePtr);
}
nsHTMLIFrameAccessible::nsHTMLIFrameAccessible(nsIDOMNode* aNode, nsIAccessible* aRoot, nsIWeakReference* aShell, nsIDocument *aDoc):
nsBlockAccessible(aNode, aShell), mRootAccessible(aRoot), nsDocAccessibleMixin(aDoc)
{
}
/* attribute wstring accName; */
NS_IMETHODIMP nsHTMLIFrameAccessible::GetAccName(nsAWritableString& aAccName)
{
return GetTitle(aAccName);
}
NS_IMETHODIMP nsHTMLIFrameAccessible::GetAccValue(nsAWritableString& aAccValue)
{
return GetURL(aAccValue);
}
/* nsIAccessible getAccFirstChild (); */
NS_IMETHODIMP nsHTMLIFrameAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
return mRootAccessible->GetAccFirstChild(_retval);
}
/* nsIAccessible getAccLastChild (); */
NS_IMETHODIMP nsHTMLIFrameAccessible::GetAccLastChild(nsIAccessible **_retval)
{
return mRootAccessible->GetAccLastChild(_retval);
}
/* long getAccChildCount (); */
NS_IMETHODIMP nsHTMLIFrameAccessible::GetAccChildCount(PRInt32 *_retval)
{
return mRootAccessible->GetAccChildCount(_retval);
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLIFrameAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_PANE;
return NS_OK;
}
NS_IMETHODIMP nsHTMLIFrameAccessible::GetAccState(PRUint32 *aAccState)
{
return nsAccessible::GetAccState(aAccState);
}
NS_IMETHODIMP nsHTMLIFrameAccessible::GetURL(nsAWritableString& aURL)
{
return nsDocAccessibleMixin::GetURL(aURL);
}
NS_IMETHODIMP nsHTMLIFrameAccessible::GetTitle(nsAWritableString& aTitle)
{
return nsDocAccessibleMixin::GetTitle(aTitle);
}
NS_IMETHODIMP nsHTMLIFrameAccessible::GetMimeType(nsAWritableString& aMimeType)
{
return nsDocAccessibleMixin::GetMimeType(aMimeType);
}
NS_IMETHODIMP nsHTMLIFrameAccessible::GetDocType(nsAWritableString& aDocType)
{
return nsDocAccessibleMixin::GetDocType(aDocType);
}
NS_IMETHODIMP nsHTMLIFrameAccessible::GetNameSpaceURIForID(PRInt16 aNameSpaceID, nsAWritableString& aNameSpaceURI)
{
return nsDocAccessibleMixin::GetNameSpaceURIForID(aNameSpaceID, aNameSpaceURI);
}
NS_IMETHODIMP nsHTMLIFrameAccessible::GetDocument(nsIDocument **doc)
{
return nsDocAccessibleMixin::GetDocument(doc);
}
//=============================//
// nsHTMLIFrameRootAccessible //
//=============================//
//-----------------------------------------------------
// construction
//-----------------------------------------------------
nsHTMLIFrameRootAccessible::nsHTMLIFrameRootAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
mOuterNode(aNode), nsRootAccessible(aShell)
{
}
//-----------------------------------------------------
// destruction
//-----------------------------------------------------
nsHTMLIFrameRootAccessible::~nsHTMLIFrameRootAccessible()
{
}
void nsHTMLIFrameRootAccessible::Init()
{
if (!mOuterAccessible) {
nsCOMPtr<nsIDOMDocument> domDoc;
mOuterNode->GetOwnerDocument(getter_AddRefs(domDoc));
nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
if (doc) {
nsCOMPtr<nsIPresShell> parentShell;
doc->GetShellAt(0, getter_AddRefs(parentShell));
if (parentShell) {
nsCOMPtr<nsIContent> content(do_QueryInterface(mOuterNode));
nsIFrame* frame = nsnull;
parentShell->GetPrimaryFrameFor(content, &frame);
NS_ASSERTION(frame, "No outer frame.");
frame->GetAccessible(getter_AddRefs(mOuterAccessible));
NS_ASSERTION(mOuterAccessible, "Something's wrong - there's no accessible for the outer parent of this frame.");
}
}
}
}
/* readonly attribute nsIAccessible accParent; */
NS_IMETHODIMP nsHTMLIFrameRootAccessible::GetAccParent(nsIAccessible * *_retval)
{
Init();
return mOuterAccessible->GetAccParent(_retval);
}
/* nsIAccessible getAccNextSibling (); */
NS_IMETHODIMP nsHTMLIFrameRootAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
Init();
return mOuterAccessible->GetAccNextSibling(_retval);
}
NS_IMETHODIMP nsHTMLIFrameRootAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
Init();
return mOuterAccessible->GetAccPreviousSibling(_retval);
}

View File

@@ -0,0 +1,101 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsIFrameRootAccessible_H_
#define _nsIFrameRootAccessible_H_
#include "nsBaseWidgetAccessible.h"
#include "nsRootAccessible.h"
#include "nsAccessible.h"
#include "nsIAccessibleDocument.h"
class nsIWebShell;
class nsIWeakReference;
class nsHTMLIFrameAccessible : public nsBlockAccessible,
public nsIAccessibleDocument,
public nsDocAccessibleMixin
{
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIACCESSIBLEDOCUMENT
public:
nsHTMLIFrameAccessible(nsIDOMNode* aNode, nsIAccessible* aRoot, nsIWeakReference* aShell, nsIDocument *doc);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
NS_IMETHOD GetAccName(nsAWritableString& aAccName);
NS_IMETHOD GetAccValue(nsAWritableString& AccValue);
NS_IMETHOD GetAccRole(PRUint32 *aAccRole);
NS_IMETHOD GetAccState(PRUint32 *aAccState);
protected:
nsCOMPtr<nsIAccessible> mRootAccessible;
};
class nsHTMLIFrameRootAccessible : public nsRootAccessible
{
NS_DECL_ISUPPORTS_INHERITED
public:
nsHTMLIFrameRootAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
virtual ~nsHTMLIFrameRootAccessible();
/* attribute wstring accName; */
NS_IMETHOD GetAccParent(nsIAccessible * *aAccParent);
/* nsIAccessible getAccNextSibling (); */
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
/* nsIAccessible getAccPreviousSibling (); */
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
protected:
void Init();
// In these variable names, "outer" relates to the nsHTMLIFrameAccessible, as opposed to the
// nsHTMLIFrameRootAccessible which is "inner".
// The outer node is a <browser> or <iframe> tag, whereas the inner node corresponds to the inner document root.
nsCOMPtr<nsIDOMNode> mOuterNode;
nsCOMPtr<nsIAccessible> mOuterAccessible;
};
#endif

View File

@@ -0,0 +1,205 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Aaron Leventhal (aaronl@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsGenericAccessible.h"
#include "nsHTMLImageAccessible.h"
#include "nsReadableUtils.h"
#include "nsAccessible.h"
#include "nsIHTMLDocument.h"
#include "nsIDocument.h"
#include "nsIDOMHTMLCollection.h"
#include "nsIAccessibilityService.h"
#include "nsIServiceManager.h"
#include "imgIRequest.h"
#include "imgIContainer.h"
#include "nsIImageFrame.h"
// --- image -----
nsHTMLImageAccessible::nsHTMLImageAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
nsLinkableAccessible(aDOMNode, aShell)
{
nsCOMPtr<nsIDOMElement> element(do_QueryInterface(aDOMNode));
nsCOMPtr<nsIDocument> doc;
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
if (!shell)
return;
shell->GetDocument(getter_AddRefs(doc));
nsAutoString mapElementName;
if (doc && element) {
nsCOMPtr<nsIHTMLDocument> htmlDoc(do_QueryInterface(doc));
element->GetAttribute(NS_LITERAL_STRING("usemap"),mapElementName);
if (htmlDoc && !mapElementName.IsEmpty()) {
if (mapElementName.CharAt(0) == '#')
mapElementName.Cut(0,1);
htmlDoc->GetImageMap(mapElementName, getter_AddRefs(mMapElement));
}
}
}
NS_IMETHODIMP nsHTMLImageAccessible::GetAccState(PRUint32 *_retval)
{
// The state is a bitfield, get our inherited state, then logically OR it with STATE_ANIMATED if this
// is an animated image.
nsLinkableAccessible::GetAccState(_retval);
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
nsIFrame *frame = nsnull;
if (content && shell)
shell->GetPrimaryFrameFor(content, &frame);
nsCOMPtr<nsIImageFrame> imageFrame(do_QueryInterface(frame));
nsCOMPtr<imgIRequest> imageRequest;
if (imageFrame)
imageFrame->GetImageRequest(getter_AddRefs(imageRequest));
nsCOMPtr<imgIContainer> imgContainer;
if (imageRequest)
imageRequest->GetImage(getter_AddRefs(imgContainer));
if (imgContainer) {
PRUint32 numFrames;
imgContainer->GetNumFrames(&numFrames);
if (numFrames > 1)
*_retval |= STATE_ANIMATED;
}
return NS_OK;
}
/* wstring getAccName (); */
NS_IMETHODIMP nsHTMLImageAccessible::GetAccName(nsAWritableString& _retval)
{
nsresult rv = NS_ERROR_FAILURE;
nsCOMPtr<nsIContent> imageContent(do_QueryInterface(mDOMNode));
if (imageContent) {
nsAutoString name;
rv = AppendFlatStringFromContentNode(imageContent, &name);
if (NS_SUCCEEDED(rv)) {
// Temp var needed until CompressWhitespace built for nsAWritableString
name.CompressWhitespace();
_retval.Assign(name);
}
}
return rv;
}
/* wstring getAccRole (); */
NS_IMETHODIMP nsHTMLImageAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_GRAPHIC;
return NS_OK;
}
nsIAccessible *nsHTMLImageAccessible::CreateAreaAccessible(PRUint32 areaNum)
{
if (!mMapElement)
return nsnull;
if (areaNum == -1) {
PRInt32 numAreaMaps;
GetAccChildCount(&numAreaMaps);
if (numAreaMaps<=0)
return nsnull;
areaNum = NS_STATIC_CAST(PRUint32,numAreaMaps-1);
}
nsIDOMHTMLCollection *mapAreas;
mMapElement->GetAreas(&mapAreas);
if (!mapAreas)
return nsnull;
nsIDOMNode *domNode = nsnull;
mapAreas->Item(areaNum,&domNode);
if (!domNode)
return nsnull;
nsCOMPtr<nsIAccessibilityService> accService(do_GetService("@mozilla.org/accessibilityService;1"));
if (!accService)
return nsnull;
if (accService) {
nsIAccessible* acc = nsnull;
accService->CreateHTMLAreaAccessible(mPresShell, domNode, this, &acc);
return acc;
}
return nsnull;
}
/* nsIAccessible getAccFirstChild (); */
NS_IMETHODIMP nsHTMLImageAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = CreateAreaAccessible(0);
return NS_OK;
}
/* nsIAccessible getAccLastChild (); */
NS_IMETHODIMP nsHTMLImageAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = CreateAreaAccessible(-1);
return NS_OK;
}
/* long getAccChildCount (); */
NS_IMETHODIMP nsHTMLImageAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 0;
if (mMapElement) {
nsIDOMHTMLCollection *mapAreas;
mMapElement->GetAreas(&mapAreas);
if (mapAreas) {
PRUint32 length;
mapAreas->GetLength(&length);
*_retval = NS_STATIC_CAST(PRInt32, length);
}
}
return NS_OK;
}

View File

@@ -0,0 +1,71 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Aaron Leventhal (aaronl@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsHTMLImageAccessible_H_
#define _nsHTMLImageAccessible_H_
#include "nsAccessible.h"
#include "nsBaseWidgetAccessible.h"
#include "nsIFrame.h"
#include "nsIImageFrame.h"
#include "nsIDOMHTMLMapElement.h"
/* Accessible for supporting images
* supports:
* - gets name, role
* - support basic state
*/
class nsHTMLImageAccessible : public nsLinkableAccessible
{
public:
nsHTMLImageAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
protected:
nsIAccessible *CreateAreaAccessible(PRUint32 areaNum);
nsCOMPtr<nsIDOMHTMLMapElement> mMapElement;
};
#endif

View File

@@ -0,0 +1,79 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Aaron Leventhal (aaronl@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsHTMLLinkAccessible.h"
#include "nsWeakReference.h"
#include "nsIFrame.h"
#include "nsILink.h"
#include "nsILinkHandler.h"
#include "nsISelection.h"
#include "nsISelectionController.h"
#include "nsIPresContext.h"
#include "nsReadableUtils.h"
#include "nsIDOMElement.h"
nsHTMLLinkAccessible::nsHTMLLinkAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell):
nsLinkableAccessible(aDomNode, aShell)
{
}
/* wstring getAccName (); */
NS_IMETHODIMP nsHTMLLinkAccessible::GetAccName(nsAWritableString& _retval)
{
if (!IsALink()) // Also initializes private data members
return NS_ERROR_FAILURE;
nsAutoString name;
nsresult rv = AppendFlatStringFromSubtree(mLinkContent, &name);
if (NS_SUCCEEDED(rv)) {
// Temp var needed until CompressWhitespace built for nsAWritableString
name.CompressWhitespace();
_retval.Assign(name);
}
return rv;
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLLinkAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_LINK;
return NS_OK;
}

View File

@@ -0,0 +1,55 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Aaron Leventhal (aaronl@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsHTMLLinkAccessible_H_
#define _nsHTMLLinkAccessible_H_
#include "nsAccessible.h"
#include "nsBaseWidgetAccessible.h"
class nsHTMLLinkAccessible : public nsLinkableAccessible
{
public:
nsHTMLLinkAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
};
#endif

View File

@@ -0,0 +1,589 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Original Author: Eric Vaughan (evaughan@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsCOMPtr.h"
#include "nsHTMLSelectAccessible.h"
#include "nsIAccessibilityService.h"
#include "nsIFrame.h"
#include "nsIComboboxControlFrame.h"
#include "nsIDOMEventReceiver.h"
#include "nsIDOMHTMLCollection.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMHTMLOptionElement.h"
#include "nsIDOMHTMLSelectElement.h"
#include "nsIListControlFrame.h"
#include "nsIServiceManager.h"
#include "nsLayoutAtoms.h"
/**
* Selects, Listboxes and Comboboxes, are made up of a number of different
* widgets, some of which are shared between the two. This file contains
* all of the widgets for both of the Selects, for HTML only. Some of them
* extend classes from nsSelectAccessible.cpp, which contains base classes
* that are also extended by the XUL Select Accessibility support.
*
* Listbox:
* - nsHTMLListboxAccessible
* - nsHTMLSelctListAccessible
* - nsHTMLSelectOptionAccessible
*
* Comboboxes:
* - nsHTMLComboboxAccessilbe
* - nsHTMLComboboxTextFieldAccessible
* - nsHTMLComboboxButtonAccessible
* - nsHTMLComboboxWindowAccessilbe
* - nsHTMLSelctListAccessible
* - nsHTMLSelectOptionAccessible
*/
/** ------------------------------------------------------ */
/** First, the common widgets */
/** ------------------------------------------------------ */
/** ----- nsHTMLSelectListAccessible ----- */
/** Default Constructor */
nsHTMLSelectListAccessible::nsHTMLSelectListAccessible(nsIAccessible* aParent,
nsIDOMNode* aDOMNode,
nsIWeakReference* aShell)
:nsSelectListAccessible(aParent, aDOMNode, aShell)
{
}
/**
* As a nsHTMLSelectListAccessible we can have the following states:
* STATE_MULTISELECTABLE
* STATE_EXTSELECTABLE
*/
NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccState(PRUint32 *_retval)
{
nsCOMPtr<nsIDOMHTMLSelectElement> select (do_QueryInterface(mDOMNode));
if ( select ) {
PRBool multiple;
select->GetMultiple(&multiple);
if ( multiple )
*_retval |= STATE_MULTISELECTABLE | STATE_EXTSELECTABLE;
}
return NS_OK;
}
/**
* Gets the last child of the DOM node and creates and returns
* a nsHTMLSelectOptionAccessible.
*/
NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccLastChild(nsIAccessible **_retval)
{
nsCOMPtr<nsIDOMNode> last;
mDOMNode->GetLastChild(getter_AddRefs(last));
*_retval = new nsHTMLSelectOptionAccessible(this, last, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
/**
* Gets the First child of the DOM node and creates and returns
* a nsHTMLSelectOptionAccessible.
*/
NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
nsCOMPtr<nsIDOMNode> first;
mDOMNode->GetFirstChild(getter_AddRefs(first));
*_retval = new nsHTMLSelectOptionAccessible(this, first, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
/** ----- nsHTMLSelectOptionAccessible ----- */
/** Default Constructor */
nsHTMLSelectOptionAccessible::nsHTMLSelectOptionAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
nsSelectOptionAccessible(aParent, aDOMNode, aShell)
{
}
/**
* Gets the next sibling of the DOM node and creates and returns
* a nsHTMLSelectOptionAccessible.
*/
NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
nsCOMPtr<nsIDOMNode> next;
mDOMNode->GetNextSibling(getter_AddRefs(next));
if (next) {
*_retval = new nsHTMLSelectOptionAccessible(mParent, next, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
}
return NS_OK;
}
/**
* Gets the previous sibling of the DOM node and creates and returns
* a nsHTMLSelectOptionAccessible.
*/
NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
nsCOMPtr<nsIDOMNode> prev;
mDOMNode->GetPreviousSibling(getter_AddRefs(prev));
if (prev) {
*_retval = new nsHTMLSelectOptionAccessible(mParent, prev, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
}
return NS_OK;
}
/**
* As a nsHTMLSelectOptionAccessible we can have the following states:
* STATE_SELECTABLE
* STATE_SELECTED
* STATE_FOCUSED
* STATE_FOCUSABLE
* STATE_INVISIBLE -- not implemented yet
*/
NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccState(PRUint32 *_retval)
{
*_retval = 0;
nsCOMPtr<nsIDOMNode> focusedOptionNode, parentNode;
mParent->AccGetDOMNode(getter_AddRefs(parentNode));
// find out if we are the focused node
GetFocusedOptionNode(mPresShell, parentNode, focusedOptionNode);
if (focusedOptionNode == mDOMNode)
*_retval |= STATE_FOCUSED;
// Are we selected?
nsCOMPtr<nsIDOMHTMLOptionElement> option (do_QueryInterface(mDOMNode));
if ( option ) {
PRBool isSelected = PR_FALSE;
option->GetSelected(&isSelected);
if ( isSelected )
*_retval |= STATE_SELECTED;
}
*_retval |= STATE_SELECTABLE | STATE_FOCUSABLE;
return NS_OK;
}
/**
* Helper method for getting the focused DOM Node from our parent(list) node. We
* need to use the frame to get the focused option because for some reason we
* weren't getting the proper notification when the focus changed using the DOM
*/
nsresult nsHTMLSelectOptionAccessible::GetFocusedOptionNode(nsIWeakReference *aPresShell,
nsIDOMNode *aListNode,
nsCOMPtr<nsIDOMNode>& aFocusedOptionNode)
{
NS_ASSERTION(aListNode, "Called GetFocusedOptionNode without a valid list node");
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(aPresShell));
if (!shell)
return NS_ERROR_FAILURE;
nsIFrame *frame = nsnull;
nsCOMPtr<nsIContent> content(do_QueryInterface(aListNode));
shell->GetPrimaryFrameFor(content, &frame);
nsresult rv;
nsCOMPtr<nsIListControlFrame> listFrame(do_QueryInterface(frame, &rv));
if (NS_FAILED(rv))
return rv; // How can list content not have a list frame?
NS_ASSERTION(listFrame, "We don't have a list frame, but rv returned a success code.");
// Get what's focused by asking frame for "selected item".
PRInt32 focusedOptionIndex = 0;
rv = listFrame->GetSelectedIndex(&focusedOptionIndex);
nsCOMPtr<nsIDOMHTMLCollection> options;
// Get options
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIDOMHTMLSelectElement> selectElement(do_QueryInterface(aListNode));
NS_ASSERTION(selectElement, "No select element where it should be");
rv = selectElement->GetOptions(getter_AddRefs(options));
}
// Either use options and focused index, or default to list node itself
if (NS_SUCCEEDED(rv) && options && focusedOptionIndex >= 0) // Something is focused
rv = options->Item(focusedOptionIndex, getter_AddRefs(aFocusedOptionNode));
else { // If no options in list or focusedOptionIndex <0, then we are not focused on an item
aFocusedOptionNode = aListNode; // return normal target content
rv = NS_OK;
}
return rv;
}
/** ------------------------------------------------------ */
/** Secondly, the Listbox widget */
/** ------------------------------------------------------ */
/** ----- nsHTMLListboxAccessible ----- */
/** Constructor */
nsHTMLListboxAccessible::nsHTMLListboxAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
nsListboxAccessible(aDOMNode, aShell)
{
}
/** Inherit the ISupports impl from nsAccessible, we handle nsIAccessibleSelectable */
NS_IMPL_ISUPPORTS_INHERITED1(nsHTMLListboxAccessible, nsListboxAccessible, nsIAccessibleSelectable)
/**
* Our last (and only) child is an nsHTMLSelectListAccessible object
*/
NS_IMETHODIMP nsHTMLListboxAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = new nsHTMLSelectListAccessible(this, mDOMNode, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
/**
* Our first (and only) child is an nsHTMLSelectListAccessible object
*/
NS_IMETHODIMP nsHTMLListboxAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = new nsHTMLSelectListAccessible(this, mDOMNode, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
/**
* Our value is the value of our ( first ) selected child. nsIDOMHTMLSelectElement
* returns this by default with GetValue().
*/
NS_IMETHODIMP nsHTMLListboxAccessible::GetAccValue(nsAWritableString& _retval)
{
nsCOMPtr<nsIDOMHTMLSelectElement> select (do_QueryInterface(mDOMNode));
if ( select ) {
select->GetValue(_retval);
return NS_OK;
}
return NS_ERROR_FAILURE;
}
/**
* nsIAccessibleSelectable method.
* - gets from the Select DOMNode the list of all Select Options
* - iterates through all of the options looking for selected Options
* - creates IAccessible objects for selected Options
* - Returns the IAccessibles for selectd Options in the nsISupportsArray
*
* retval will be nsnull if:
* - there are no Options in the Select Element
* - there are Options but none are selected
* - the DOMNode is not a nsIDOMHTMLSelectElement ( shouldn't happen )
*/
NS_IMETHODIMP nsHTMLListboxAccessible::GetSelectedChildren(nsISupportsArray **_retval)
{
nsCOMPtr<nsIDOMHTMLSelectElement> select(do_QueryInterface(mDOMNode));
if(select) {
nsCOMPtr<nsIDOMHTMLCollection> options;
// get all the options in the select
select->GetOptions(getter_AddRefs(options));
if (options) {
// set up variables we need to get the selected options and to get their nsIAccessile objects
PRUint32 length;
options->GetLength(&length);
nsCOMPtr<nsIAccessibilityService> accService(do_GetService("@mozilla.org/accessibilityService;1"));
nsCOMPtr<nsISupportsArray> selectedAccessibles;
NS_NewISupportsArray(getter_AddRefs(selectedAccessibles));
if (!selectedAccessibles || !accService)
return NS_ERROR_FAILURE;
// find the selected options and get the accessible objects;
PRBool isSelected = PR_FALSE;
nsCOMPtr<nsIPresContext> context;
GetPresContext(context);
for (PRUint32 i = 0 ; i < length ; i++) {
nsCOMPtr<nsIDOMNode> tempNode;
options->Item(i,getter_AddRefs(tempNode));
if (tempNode) {
nsCOMPtr<nsIDOMHTMLOptionElement> tempOption(do_QueryInterface(tempNode));
if (tempOption)
tempOption->GetSelected(&isSelected);
if (isSelected) {
nsCOMPtr<nsIAccessible> tempAccess;
accService->CreateHTMLSelectOptionAccessible(tempOption, this, context, getter_AddRefs(tempAccess));
if ( tempAccess )
selectedAccessibles->AppendElement(tempAccess);
isSelected = PR_FALSE;
}
}
}
selectedAccessibles->Count(&length); // reusing length
if ( length != 0 ) { // length of nsISupportsArray containing selected options
*_retval = selectedAccessibles;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
}
}
// no options, not a select or none of the options are selected
*_retval = nsnull;
return NS_OK;
}
/** ------------------------------------------------------ */
/** Finally, the Combobox widgets */
/** ------------------------------------------------------ */
/** ----- nsHTMLComboboxAccessible ----- */
/** Constructor */
nsHTMLComboboxAccessible::nsHTMLComboboxAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
nsComboboxAccessible(aDOMNode, aShell)
{
}
/**
* Our last child is an nsHTMLComboboxWindowAccessible object
*/
NS_IMETHODIMP nsHTMLComboboxAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = new nsHTMLComboboxWindowAccessible(this, mDOMNode, mPresShell);
if (! *_retval)
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
/**
* Our last child is an nsHTMLComboboxTextFieldAccessible object
*/
NS_IMETHODIMP nsHTMLComboboxAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = new nsHTMLComboboxTextFieldAccessible(this, mDOMNode, mPresShell);
if (! *_retval)
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
/**
* Our value is the value of our ( first ) selected child. nsIDOMHTMLSelectElement
* returns this by default with GetValue().
*/
NS_IMETHODIMP nsHTMLComboboxAccessible::GetAccValue(nsAWritableString& _retval)
{
nsCOMPtr<nsIDOMHTMLSelectElement> select (do_QueryInterface(mDOMNode));
if (select) {
select->GetValue(_retval);
return NS_OK;
}
return NS_ERROR_FAILURE;
}
/** ----- nsHTMLComboboxTextFieldAccessible ----- */
/** Constructor */
nsHTMLComboboxTextFieldAccessible::nsHTMLComboboxTextFieldAccessible(nsIAccessible* aParent,
nsIDOMNode* aDOMNode,
nsIWeakReference* aShell):
nsComboboxTextFieldAccessible(aParent, aDOMNode, aShell)
{
}
/**
* Our next sibling is an nsHTMLComboboxButtonAccessible object
*/
NS_IMETHODIMP nsHTMLComboboxTextFieldAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
nsCOMPtr<nsIAccessible> parent;
GetAccParent(getter_AddRefs(parent));
*_retval = new nsHTMLComboboxButtonAccessible(parent, mDOMNode, mPresShell);
if (! *_retval)
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
/** -----ComboboxButtonAccessible ----- */
/** Constructor -- cache our parent */
nsHTMLComboboxButtonAccessible::nsHTMLComboboxButtonAccessible(nsIAccessible* aParent,
nsIDOMNode* aDOMNode,
nsIWeakReference* aShell):
nsComboboxButtonAccessible(aParent, aDOMNode, aShell)
{
}
/**
* Programmaticaly click on the button, causing either the display or
* the hiding of the drop down box ( window ).
* Walks the Frame tree and checks for proper frames.
*/
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::AccDoAction(PRUint8 index)
{
nsIFrame* frame = nsAccessible::GetBoundsFrame();
nsCOMPtr<nsIPresContext> context;
GetPresContext(context);
if (!context)
return NS_ERROR_FAILURE;
frame->FirstChild(context, nsnull, &frame);
#ifdef DEBUG
if (! nsAccessible::IsCorrectFrameType(frame, nsLayoutAtoms::blockFrame))
return NS_ERROR_FAILURE;
#endif
frame->GetNextSibling(&frame);
#ifdef DEBUG
if (! nsAccessible::IsCorrectFrameType(frame, nsLayoutAtoms::gfxButtonControlFrame))
return NS_ERROR_FAILURE;
#endif
nsCOMPtr<nsIContent> content;
frame->GetContent(getter_AddRefs(content));
// We only have one action, click. Any other index is meaningless(wrong)
if (index == eAction_Click) {
nsCOMPtr<nsIDOMHTMLInputElement> element(do_QueryInterface(content));
if (element)
{
element->Click();
return NS_OK;
}
return NS_ERROR_FAILURE;
}
return NS_ERROR_INVALID_ARG;
}
/**
* Our next sibling is an nsHTMLComboboxWindowAccessible object
*/
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
nsCOMPtr<nsIAccessible> parent;
GetAccParent(getter_AddRefs(parent));
*_retval = new nsHTMLComboboxWindowAccessible(parent, mDOMNode, mPresShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/**
* Our next sibling is an nsHTMLComboboxTextFieldAccessible object
*/
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
nsCOMPtr<nsIAccessible> parent;
GetAccParent(getter_AddRefs(parent));
*_retval = new nsHTMLComboboxTextFieldAccessible(parent, mDOMNode, mPresShell);
if (! *_retval)
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
/** ----- nsHTMLComboboxWindowAccessible ----- */
/**
* Constructor -- cache our parent
*/
nsHTMLComboboxWindowAccessible::nsHTMLComboboxWindowAccessible(nsIAccessible* aParent,
nsIDOMNode* aDOMNode,
nsIWeakReference* aShell):
nsComboboxWindowAccessible(aParent, aDOMNode, aShell)
{
}
/**
* Our previous sibling is a nsHTMLComboboxButtonAccessible object
*/
NS_IMETHODIMP nsHTMLComboboxWindowAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
nsCOMPtr<nsIAccessible> parent;
GetAccParent(getter_AddRefs(parent));
*_retval = new nsHTMLComboboxButtonAccessible(parent, mDOMNode, mPresShell);
if (! *_retval)
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
/**
* We only have one child, a list
*/
NS_IMETHODIMP nsHTMLComboboxWindowAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = new nsHTMLSelectListAccessible(this, mDOMNode, mPresShell);
if (! *_retval)
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
/**
* We only have one child, a list
*/
NS_IMETHODIMP nsHTMLComboboxWindowAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = new nsHTMLSelectListAccessible(this, mDOMNode, mPresShell);
if (! *_retval)
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}

View File

@@ -0,0 +1,209 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Original Author: Eric Vaughan (evaughan@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __nsHTMLSelectAccessible_h__
#define __nsHTMLSelectAccessible_h__
#include "nsCOMPtr.h"
#include "nsIAccessibleSelectable.h"
#include "nsIDOMNode.h"
#include "nsIWeakReference.h"
#include "nsSelectAccessible.h"
/**
* Selects, Listboxes and Comboboxes, are made up of a number of different
* widgets, some of which are shared between the two. This file contains
* all of the widgets for both of the Selects, for HTML only. Some of them
* extend classes from nsSelectAccessible.cpp, which contains base classes
* that are also extended by the XUL Select Accessibility support.
*
* Listbox:
* - nsHTMLListboxAccessible
* - nsHTMLSelctListAccessible
* - nsHTMLSelectOptionAccessible
*
* Comboboxes:
* - nsHTMLComboboxAccessilbe
* - nsHTMLComboboxTextFieldAccessible
* - nsHTMLComboboxButtonAccessible
* - nsHTMLComboboxWindowAccessilbe
* - nsHTMLSelectListAccessible
* - nsHTMLSelectOptionAccessible(s)
*/
/** ------------------------------------------------------ */
/** First, the common widgets */
/** ------------------------------------------------------ */
/*
* The list that contains all the options in the select.
*/
class nsHTMLSelectListAccessible : public nsSelectListAccessible
{
public:
nsHTMLSelectListAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLSelectListAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccState(PRUint32 *_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
};
/*
* Options inside the select, contained within the list
*/
class nsHTMLSelectOptionAccessible : public nsSelectOptionAccessible
{
public:
nsHTMLSelectOptionAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLSelectOptionAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccState(PRUint32 *_retval);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
static nsresult GetFocusedOptionNode(nsIWeakReference *aPresShell, nsIDOMNode *aListNode, nsCOMPtr<nsIDOMNode>& aFocusedOptionNode);
};
/** ------------------------------------------------------ */
/** Secondly, the Listbox widget */
/** ------------------------------------------------------ */
/*
* A class the represents the HTML Listbox widget.
*/
class nsHTMLListboxAccessible : public nsListboxAccessible,
public nsIAccessibleSelectable
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIACCESSIBLESELECTABLE
nsHTMLListboxAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLListboxAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccValue(nsAWritableString& _retval);
};
/** ------------------------------------------------------ */
/** Finally, the Combobox widgets */
/** ------------------------------------------------------ */
/*
* A class the represents the HTML Combobox widget.
*/
class nsHTMLComboboxAccessible : public nsComboboxAccessible
{
public:
nsHTMLComboboxAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLComboboxAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccValue(nsAWritableString& _retval);
};
/*
* A class the represents the text field in the Select to the left
* of the drop down button
*/
class nsHTMLComboboxTextFieldAccessible : public nsComboboxTextFieldAccessible
{
public:
nsHTMLComboboxTextFieldAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLComboboxTextFieldAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
};
/**
* A class that represents the button inside the Select to the
* right of the text field
*/
class nsHTMLComboboxButtonAccessible : public nsComboboxButtonAccessible
{
public:
nsHTMLComboboxButtonAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLComboboxButtonAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD AccDoAction(PRUint8 index);
};
/*
* A class that represents the window that lives to the right
* of the drop down button inside the Select. This is the window
* that is made visible when the button is pressed.
*/
class nsHTMLComboboxWindowAccessible : public nsComboboxWindowAccessible
{
public:
nsHTMLComboboxWindowAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLComboboxWindowAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
};
#endif

View File

@@ -0,0 +1,67 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Aaron Leventhal (aaronl@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsHTMLTableAccessible.h"
#include "nsWeakReference.h"
#include "nsReadableUtils.h"
nsHTMLTableCellAccessible::nsHTMLTableCellAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell):
nsBlockAccessible(aDomNode, aShell)
{
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLTableCellAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_CELL;
return NS_OK;
}
nsHTMLTableAccessible::nsHTMLTableAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell):
nsBlockAccessible(aDomNode, aShell)
{
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLTableAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_TABLE;
return NS_OK;
}

View File

@@ -0,0 +1,61 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Aaron Leventhal (aaronl@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsHTMLTableAccessible_H_
#define _nsHTMLTableAccessible_H_
#include "nsAccessible.h"
#include "nsBaseWidgetAccessible.h"
class nsHTMLTableCellAccessible : public nsBlockAccessible
{
public:
nsHTMLTableCellAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
};
class nsHTMLTableAccessible : public nsBlockAccessible
{
public:
nsHTMLTableAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
};
#endif

View File

@@ -0,0 +1,51 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Eric Vaughan (evaughan@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsHTMLTextAccessible.h"
nsHTMLTextAccessible::nsHTMLTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell):
nsTextAccessible(aDomNode, aShell)
{
}
/* wstring getAccName (); */
NS_IMETHODIMP nsHTMLTextAccessible::GetAccName(nsAWritableString& _retval)
{
return mDOMNode->GetNodeValue(_retval);
}

View File

@@ -0,0 +1,54 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsHTMLTextAccessible_H_
#define _nsHTMLTextAccessible_H_
#include "nsFormControlAccessible.h"
class nsIWeakReference;
class nsHTMLTextAccessible : public nsTextAccessible
{
public:
nsHTMLTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
};
#endif

View File

@@ -0,0 +1,3 @@
en-US.jar:
locale/en-US/global/accessible.properties

View File

@@ -0,0 +1,87 @@
#!gmake
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
DEPTH=..\..
MODULE=accessibility
LIBRARY_NAME=accessibility_s
REQUIRES = xpcom \
string \
layout \
content \
content_xul \
widget \
dom \
view \
locale \
intl \
docshell \
webshell \
necko \
htmlparser \
imglib2 \
gfx \
gfx2 \
uriloader \
timer \
$(NULL)
CPP_OBJS= \
.\$(OBJDIR)\nsAccessible.obj \
.\$(OBJDIR)\nsAccessibilityService.obj \
.\$(OBJDIR)\nsBaseWidgetAccessible.obj \
.\$(OBJDIR)\nsFormControlAccessible.obj \
.\$(OBJDIR)\nsGenericAccessible.obj \
.\$(OBJDIR)\nsHTMLAreaAccessible.obj \
.\$(OBJDIR)\nsHTMLFormControlAccessible.obj \
.\$(OBJDIR)\nsHTMLIFrameRootAccessible.obj \
.\$(OBJDIR)\nsHTMLImageAccessible.obj \
.\$(OBJDIR)\nsHTMLLinkAccessible.obj \
.\$(OBJDIR)\nsHTMLSelectAccessible.obj \
.\$(OBJDIR)\nsHTMLTableAccessible.obj \
.\$(OBJDIR)\nsHTMLTextAccessible.obj \
.\$(OBJDIR)\nsRootAccessible.obj \
.\$(OBJDIR)\nsSelectAccessible.obj \
.\$(OBJDIR)\nsXULFormControlAccessible.obj \
.\$(OBJDIR)\nsXULTextAccessible.obj \
$(NULL)
EXPORTS = \
.\nsRootAccessible.h \
$(NULL)
LINCS= \
-I..\..\layout\html\forms\public \
-I..\..\layout\html\forms\src \
-I..\..\layout\html\base\src \
$(NULL)
include <$(DEPTH)\config\rules.mak>
install:: $(LIBRARY)
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
clobber::
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib

View File

@@ -0,0 +1,790 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Original Author: David W. Hyatt (hyatt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsIAccessibilityService.h"
#include "nsAccessibilityService.h"
#include "nsAccessible.h"
#include "nsCOMPtr.h"
#include "nsIDocument.h"
#include "nsIPresShell.h"
#include "nsIPresContext.h"
#include "nsIContent.h"
#include "nsIFrame.h"
#include "nsRootAccessible.h"
#include "nsINameSpaceManager.h"
#include "nsLayoutAtoms.h"
#include "nsIDOMNode.h"
#include "nsHTMLTextAccessible.h"
#include "nsITextContent.h"
#include "nsTextFragment.h"
#include "nsHTMLTableAccessible.h"
#include "nsHTMLImageAccessible.h"
#include "nsHTMLAreaAccessible.h"
#include "nsHTMLLinkAccessible.h"
#include "nsHTMLSelectAccessible.h"
#include "nsIDOMHTMLAreaElement.h"
#include "nsHTMLFormControlAccessible.h"
#include "nsIAccessibleProvider.h"
#include "nsILink.h"
#include "nsIDocShellTreeItem.h"
#include "nsIDOMDocument.h"
#include "nsIDOMHTMLOptionElement.h"
#include "nsIDOMXULCheckboxElement.h"
#include "nsXULFormControlAccessible.h"
#include "nsXULTextAccessible.h"
#include "nsString.h"
// IFrame
#include "nsIDocShell.h"
#include "nsHTMLIFrameRootAccessible.h"
/**
* nsAccessibility Service
*/
nsAccessibilityService::nsAccessibilityService()
{
NS_INIT_REFCNT();
}
nsAccessibilityService::~nsAccessibilityService()
{
}
NS_IMPL_THREADSAFE_ISUPPORTS1(nsAccessibilityService, nsIAccessibilityService);
////////////////////////////////////////////////////////////////////////////////
// nsIAccessibilityService methods:
NS_IMETHODIMP
nsAccessibilityService::CreateRootAccessible(nsISupports* aPresContext, nsISupports* aFrame, nsIAccessible **_retval)
{
// XXX - jgaunt - looks like we aren't using this
//nsIFrame* f = NS_STATIC_CAST(nsIFrame*, aFrame);
nsCOMPtr<nsIPresContext> presContext(do_QueryInterface(aPresContext));
NS_ASSERTION(presContext,"Error non prescontext passed to accessible factory!!!");
nsCOMPtr<nsIPresShell> presShell;
presContext->GetShell(getter_AddRefs(presShell));
NS_ASSERTION(presShell,"Error not presshell!!");
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(presShell));
*_retval = new nsRootAccessible(weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateHTMLComboboxAccessible(nsIDOMNode* aDOMNode, nsISupports* aPresContext, nsIAccessible **_retval)
{
nsCOMPtr<nsIPresContext> presContext(do_QueryInterface(aPresContext));
NS_ASSERTION(presContext,"Error non prescontext passed to accessible factory!!!");
nsCOMPtr<nsIPresShell> presShell;
presContext->GetShell(getter_AddRefs(presShell));
nsCOMPtr<nsIWeakReference> weakShell = do_GetWeakReference(presShell);
*_retval = new nsHTMLComboboxAccessible(aDOMNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateHTMLListboxAccessible(nsIDOMNode* aDOMNode, nsISupports* aPresContext, nsIAccessible **_retval)
{
nsCOMPtr<nsIPresContext> presContext(do_QueryInterface(aPresContext));
NS_ASSERTION(presContext,"Error non prescontext passed to accessible factory!!!");
nsCOMPtr<nsIPresShell> presShell;
presContext->GetShell(getter_AddRefs(presShell));
nsCOMPtr<nsIWeakReference> weakShell = do_GetWeakReference(presShell);
*_retval = new nsHTMLListboxAccessible(aDOMNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateHTMLSelectOptionAccessible(nsIDOMNode* aDOMNode, nsIAccessible *aAccParent, nsISupports* aPresContext, nsIAccessible **_retval)
{
nsCOMPtr<nsIPresContext> presContext(do_QueryInterface(aPresContext));
NS_ASSERTION(presContext,"Error non prescontext passed to accessible factory!!!");
nsCOMPtr<nsIPresShell> presShell;
presContext->GetShell(getter_AddRefs(presShell));
nsCOMPtr<nsIWeakReference> weakShell = do_GetWeakReference(presShell);
*_retval = new nsHTMLSelectOptionAccessible(aAccParent, aDOMNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/* nsIAccessible createHTMLCheckboxAccessible (in nsISupports aPresShell, in nsISupports aFrame); */
NS_IMETHODIMP nsAccessibilityService::CreateHTMLCheckboxAccessible(nsISupports *aFrame, nsIAccessible **_retval)
{
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv))
return rv;
*_retval = new nsHTMLCheckboxAccessible(node, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsAccessibilityService::CreateXULCheckboxAccessible(nsIDOMNode *aNode, nsIAccessible **_retval)
{
nsCOMPtr<nsIWeakReference> weakShell;
GetShellFromNode(aNode, getter_AddRefs(weakShell));
// reusing the HTML accessible widget and enhancing for XUL
*_retval = new nsXULCheckboxAccessible(aNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/* nsIAccessible createHTMRadioButtonAccessible (in nsISupports aPresShell, in nsISupports aFrame); */
NS_IMETHODIMP nsAccessibilityService::CreateHTMLRadioButtonAccessible(nsISupports *aFrame, nsIAccessible **_retval)
{
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv))
return rv;
*_retval = new nsHTMLRadioButtonAccessible(node, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/* nsIAccessible createHTMLButtonAccessible (in nsISupports aPresShell, in nsISupports aFrame); */
NS_IMETHODIMP nsAccessibilityService::CreateHTMLButtonAccessible(nsISupports *aFrame, nsIAccessible **_retval)
{
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv))
return rv;
*_retval = new nsHTMLButtonAccessible(node, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/* nsIAccessible createHTML4ButtonAccessible (in nsISupports aPresShell, in nsISupports aFrame); */
NS_IMETHODIMP nsAccessibilityService::CreateHTML4ButtonAccessible(nsISupports *aFrame, nsIAccessible **_retval)
{
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv))
return rv;
*_retval = new nsHTML4ButtonAccessible(node, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsAccessibilityService::CreateXULButtonAccessible(nsIDOMNode *aNode, nsIAccessible **_retval)
{
nsCOMPtr<nsIWeakReference> weakShell;
GetShellFromNode(aNode, getter_AddRefs(weakShell));
// reusing the HTML accessible widget and enhancing for XUL
*_retval = new nsXULButtonAccessible(aNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/* nsIAccessible createHTMLTextAccessible (in nsISupports aPresShell, in nsISupports aFrame); */
NS_IMETHODIMP nsAccessibilityService::CreateHTMLTextAccessible(nsISupports *aFrame, nsIAccessible **_retval)
{
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv))
return rv;
*_retval = nsnull;
nsCOMPtr<nsITextContent> textContent(do_QueryInterface(node));
if (textContent) {
// If empty text string, don't include in accessible tree
// Items with length 0 are already gone, we just need to check for single NBSP's
PRInt32 textLength = 0;
textContent->GetTextLength(&textLength);
if (textLength == 1) {
const PRUnichar NBSP = 160;
const nsTextFragment *textFrag;
nsresult rv = textContent->GetText(&textFrag);
PRUnichar theChar = textFrag->CharAt(0);
if (theChar == NBSP)
return NS_ERROR_FAILURE;
}
}
*_retval = new nsHTMLTextAccessible(node, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsAccessibilityService::CreateXULTextAccessible(nsIDOMNode *aNode, nsIAccessible **_retval)
{
nsCOMPtr<nsIWeakReference> weakShell;
GetShellFromNode(aNode, getter_AddRefs(weakShell));
// reusing the HTML accessible widget and enhancing for XUL
*_retval = new nsXULTextAccessible(aNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/* nsIAccessible createHTMLTableAccessible (in nsISupports aPresShell, in nsISupports aFrame); */
NS_IMETHODIMP nsAccessibilityService::CreateHTMLTableAccessible(nsISupports *aFrame, nsIAccessible **_retval)
{
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv))
return rv;
*_retval = new nsHTMLTableAccessible(node, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/* nsIAccessible createHTMLTableCellAccessible (in nsISupports aPresShell, in nsISupports aFrame); */
NS_IMETHODIMP nsAccessibilityService::CreateHTMLTableCellAccessible(nsISupports *aFrame, nsIAccessible **_retval)
{
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv))
return rv;
*_retval = new nsHTMLTableCellAccessible(node, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsAccessibilityService::CreateXULImageAccessible(nsIDOMNode *aNode, nsIAccessible **_retval)
{
// Don't include nameless images in accessible tree
*_retval = nsnull;
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aNode));
NS_ASSERTION(elt, "No DOM element or node!");
PRBool hasTextEquivalent;
elt->HasAttribute(NS_LITERAL_STRING("tooltiptext"), &hasTextEquivalent); // Prefer value over tooltiptext
if (!hasTextEquivalent) {
return NS_OK;
}
nsCOMPtr<nsIWeakReference> weakShell;
GetShellFromNode(aNode, getter_AddRefs(weakShell));
*_retval = new nsHTMLImageAccessible(aNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/* nsIAccessible createHTMLImageAccessible (in nsISupports aPresShell, in nsISupports aFrame); */
NS_IMETHODIMP nsAccessibilityService::CreateHTMLImageAccessible(nsISupports *aFrame, nsIAccessible **_retval)
{
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv))
return rv;
*_retval = new nsHTMLImageAccessible(node, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/* nsIAccessible createHTMLAreaAccessible (in nsISupports aPresShell, in nsISupports aFrame); */
NS_IMETHODIMP nsAccessibilityService::CreateHTMLAreaAccessible(nsIWeakReference *aShell, nsIDOMNode *aDOMNode, nsIAccessible *aAccParent,
nsIAccessible **_retval)
{
*_retval = new nsHTMLAreaAccessible(aDOMNode, aAccParent, aShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/* nsIAccessible createHTMLTextFieldAccessible (in nsISupports aPresShell, in nsISupports aFrame); */
NS_IMETHODIMP nsAccessibilityService::CreateHTMLTextFieldAccessible(nsISupports *aFrame, nsIAccessible **_retval)
{
nsIFrame* frame;
nsCOMPtr<nsIDOMNode> node;
nsCOMPtr<nsIWeakReference> weakShell;
nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
if (NS_FAILED(rv))
return rv;
*_retval = new nsHTMLTextFieldAccessible(node, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsAccessibilityService::GetShellFromNode(nsIDOMNode *aNode, nsIWeakReference **aWeakShell)
{
nsCOMPtr<nsIDOMDocument> domDoc;
aNode->GetOwnerDocument(getter_AddRefs(domDoc));
nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
if (!doc)
return NS_ERROR_INVALID_ARG;
// ---- Get the pres shell ----
nsCOMPtr<nsIPresShell> shell;
doc->GetShellAt(0, getter_AddRefs(shell));
if (!shell)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIWeakReference> weakRef(do_GetWeakReference(shell));
*aWeakShell = weakRef;
NS_IF_ADDREF(*aWeakShell);
return NS_OK;
}
NS_IMETHODIMP nsAccessibilityService::GetInfo(nsISupports* aFrame, nsIFrame** aRealFrame, nsIWeakReference** aShell, nsIDOMNode** aNode)
{
NS_ASSERTION(aFrame,"Error -- 1st argument (aFrame) is null!!");
*aRealFrame = NS_STATIC_CAST(nsIFrame*, aFrame);
nsCOMPtr<nsIContent> content;
(*aRealFrame)->GetContent(getter_AddRefs(content));
nsCOMPtr<nsIDOMNode> node(do_QueryInterface(content));
if (!content || !node)
return NS_ERROR_FAILURE;
*aNode = node;
NS_IF_ADDREF(*aNode);
nsCOMPtr<nsIDocument> document;
content->GetDocument(*getter_AddRefs(document));
if (!document)
return NS_ERROR_FAILURE;
#ifdef DEBUG
PRInt32 shells = document->GetNumberOfShells();
NS_ASSERTION(shells > 0,"Error no shells!");
#endif
// do_GetWR only works into a |nsCOMPtr| :-(
nsCOMPtr<nsIPresShell> tempShell;
nsCOMPtr<nsIWeakReference> weakShell;
document->GetShellAt(0, getter_AddRefs(tempShell));
weakShell = do_GetWeakReference(tempShell);
NS_IF_ADDREF(*aShell = weakShell);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateAccessible(nsIDOMNode* aDOMNode, nsISupports* aDocument, nsIAccessible **_retval)
{
nsCOMPtr<nsIDocument> document (do_QueryInterface(aDocument));
if (!document)
return NS_ERROR_FAILURE;
#ifdef DEBUG
PRInt32 shells = document->GetNumberOfShells();
NS_ASSERTION(shells > 0,"Error no shells!");
#endif
nsCOMPtr<nsIPresShell> tempShell;
document->GetShellAt(0, getter_AddRefs(tempShell));
nsCOMPtr<nsIWeakReference> weakShell = do_GetWeakReference(tempShell);
*_retval = new nsAccessible(aDOMNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateHTMLBlockAccessible(nsIDOMNode* aDOMNode, nsISupports* aDocument, nsIAccessible **_retval)
{
nsCOMPtr<nsIDocument> document (do_QueryInterface(aDocument));
if (!document)
return NS_ERROR_FAILURE;
#ifdef DEBUG
PRInt32 shells = document->GetNumberOfShells();
NS_ASSERTION(shells > 0,"Error no shells!");
#endif
nsCOMPtr<nsIPresShell> tempShell;
document->GetShellAt(0, getter_AddRefs(tempShell));
nsCOMPtr<nsIWeakReference> weakShell = do_GetWeakReference(tempShell);
*_retval = new nsAccessible(aDOMNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateHTMLIFrameAccessible(nsIDOMNode* aDOMNode, nsISupports* aPresContext, nsIAccessible **_retval)
{
*_retval = nsnull;
nsCOMPtr<nsIContent> content(do_QueryInterface(aDOMNode));
NS_ASSERTION(content,"Error non nsIContent passed to accessible factory!!!");
nsCOMPtr<nsIPresContext> presContext(do_QueryInterface(aPresContext));
NS_ASSERTION(presContext,"Error non prescontext passed to accessible factory!!!");
nsCOMPtr<nsIPresShell> presShell;
presContext->GetShell(getter_AddRefs(presShell));
NS_ASSERTION(presShell,"Error non PresShell passed to accessible factory!!!");
nsCOMPtr<nsIWeakReference> weakRef = do_GetWeakReference(presShell);
nsCOMPtr<nsIDocument> doc;
if (NS_SUCCEEDED(content->GetDocument(*getter_AddRefs(doc))) && doc) {
nsCOMPtr<nsIPresShell> presShell;
doc->GetShellAt(0, getter_AddRefs(presShell));
if (presShell) {
nsCOMPtr<nsISupports> supps;
presShell->GetSubShellFor(content, getter_AddRefs(supps));
if (supps) {
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(supps));
if (docShell) {
nsCOMPtr<nsIPresShell> ps;
docShell->GetPresShell(getter_AddRefs(ps));
if (ps) {
nsCOMPtr<nsIWeakReference> wr = do_GetWeakReference(ps);
nsCOMPtr<nsIDocument> innerDoc;
ps->GetDocument(getter_AddRefs(innerDoc));
if (innerDoc) {
nsCOMPtr<nsIAccessible> root = new nsHTMLIFrameRootAccessible(aDOMNode, wr);
if ( root ) {
nsHTMLIFrameAccessible* frameAcc = new nsHTMLIFrameAccessible(aDOMNode, root, weakRef, innerDoc);
if ( frameAcc != nsnull ) {
*_retval = NS_STATIC_CAST(nsIAccessible*, frameAcc);
if ( *_retval ) {
NS_ADDREF(*_retval);
return NS_OK;
}
}
}
}
}
}
}
}
}
return NS_ERROR_FAILURE;
}
void nsAccessibilityService::GetOwnerFor(nsIPresShell *aPresShell, nsIPresShell **aOwnerShell, nsIContent **aOwnerContent)
{
nsCOMPtr<nsIPresContext> presContext;
aPresShell->GetPresContext(getter_AddRefs(presContext));
if (!presContext)
return;
nsCOMPtr<nsISupports> pcContainer;
presContext->GetContainer(getter_AddRefs(pcContainer));
if (!pcContainer)
return;
nsCOMPtr<nsISupports> docShellSupports(do_QueryInterface(pcContainer));
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(pcContainer));
if (!treeItem)
return;
// Get Parent Doc
nsCOMPtr<nsIDocShellTreeItem> treeItemParent;
treeItem->GetParent(getter_AddRefs(treeItemParent));
if (!treeItemParent)
return;
nsCOMPtr<nsIDocShell> parentDS(do_QueryInterface(treeItemParent));
if (!parentDS)
return;
nsCOMPtr<nsIPresShell> parentPresShell;
parentDS->GetPresShell(getter_AddRefs(parentPresShell));
if (!parentPresShell)
return;
nsCOMPtr<nsIDocument> parentDoc;
parentPresShell->GetDocument(getter_AddRefs(parentDoc));
if (!parentDoc)
return;
nsCOMPtr<nsIContent> rootContent;
parentDoc->GetRootContent(getter_AddRefs(rootContent));
nsCOMPtr<nsIContent> tempContent;
parentPresShell->FindContentForShell(docShellSupports, getter_AddRefs(tempContent));
if (tempContent) {
*aOwnerContent = tempContent;
*aOwnerShell = parentPresShell;
NS_ADDREF(*aOwnerShell);
NS_ADDREF(*aOwnerContent);
}
}
/**
* GetAccessibleFor - get an nsIAccessible from a DOM node
*/
NS_IMETHODIMP nsAccessibilityService::GetAccessibleFor(nsIDOMNode *aNode,
nsIAccessible **_retval)
{
*_retval = nsnull;
if (!aNode)
return NS_ERROR_NULL_POINTER;
nsCOMPtr<nsIAccessible> newAcc;
nsCOMPtr<nsIAccessibleProvider> accProv(do_QueryInterface(aNode));
if (accProv) {
accProv->GetAccessible(getter_AddRefs(newAcc));
if (newAcc) {
*_retval = newAcc;
NS_ADDREF(*_retval);
return NS_OK;
}
}
// ---- Get the document for this node ----
nsCOMPtr<nsIDocument> doc;
nsCOMPtr<nsIDocument> nodeIsDoc(do_QueryInterface(aNode));
if (nodeIsDoc)
doc = nodeIsDoc;
else {
nsCOMPtr<nsIDOMDocument> domDoc;
aNode->GetOwnerDocument(getter_AddRefs(domDoc));
if (!domDoc)
return NS_ERROR_INVALID_ARG;
doc = do_QueryInterface(domDoc);
}
if (!doc)
return NS_ERROR_INVALID_ARG;
// ---- Get the pres shell ----
nsCOMPtr<nsIPresShell> shell;
doc->GetShellAt(0, getter_AddRefs(shell));
if (!shell)
return NS_ERROR_FAILURE;
// ---- Check if area node ----
nsCOMPtr<nsIDOMHTMLAreaElement> areaContent(do_QueryInterface(aNode));
if (areaContent) // Area elements are implemented in nsHTMLImageAccessible as children of the image
return NS_ERROR_FAILURE; // Return, otherwise the image frame looks like an accessible object in the wrong place
// ---- Check if we need outer owning doc ----
nsCOMPtr<nsIContent> content(do_QueryInterface(aNode));
if (!content && nodeIsDoc) {
// This happens when we're on the document node, which will not QI to an nsIContent,
// When that happens, we try to get the outer, parent document node that contains the document
// For example, a <browser> or <iframe> element
nsCOMPtr<nsIPresShell> ownerShell;
nsCOMPtr<nsIContent> ownerContent;
GetOwnerFor(shell, getter_AddRefs(ownerShell), getter_AddRefs(ownerContent));
if (content) {
shell = ownerShell;
content = ownerContent;
}
else {
doc->GetRootContent(getter_AddRefs(content));
nsIFrame* frame = nsnull;
shell->GetPrimaryFrameFor(content, &frame);
if (!frame)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIPresContext> presContext;
shell->GetPresContext(getter_AddRefs(presContext));
CreateRootAccessible(presContext, frame, getter_AddRefs(newAcc));
*_retval = newAcc;
NS_ADDREF(*_retval);
return NS_OK;
}
}
// ---- If still no nsIContent, return ----
if (!content)
return NS_ERROR_FAILURE;
// ---- Try using frame to get IAccessible ----
nsIFrame* frame = nsnull;
shell->GetPrimaryFrameFor(content, &frame);
if (!frame)
return NS_ERROR_FAILURE;
frame->GetAccessible(getter_AddRefs(newAcc));
// ---- If link, create link accessible ----
if (!newAcc) {
// is it a link?
nsCOMPtr<nsILink> link(do_QueryInterface(aNode));
if (link) {
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(shell));
newAcc = new nsHTMLLinkAccessible(aNode, weakShell);
}
}
// ---- If <select> option, create select option accessible
if (!newAcc) {
nsCOMPtr<nsIDOMHTMLOptionElement> optionElement(do_QueryInterface(aNode));
if (optionElement) {
// nsHTMLSelectionOptionAccessible's must be created via the parent
nsCOMPtr<nsIDOMNode> parentNode;
aNode->GetParentNode(getter_AddRefs(parentNode));
if (parentNode) {
nsCOMPtr<nsIAccessible> parentAccessible;
GetAccessibleFor(parentNode, getter_AddRefs(parentAccessible));
if (parentAccessible) {
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(shell));
newAcc = new nsHTMLSelectOptionAccessible(parentAccessible, aNode, weakShell);
}
}
}
}
if (!newAcc)
return NS_ERROR_FAILURE;
*_retval = newAcc;
NS_ADDREF(*_retval);
return NS_OK;
}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
nsresult
NS_NewAccessibilityService(nsIAccessibilityService** aResult)
{
NS_PRECONDITION(aResult != nsnull, "null ptr");
if (! aResult)
return NS_ERROR_NULL_POINTER;
nsAccessibilityService* accService = new nsAccessibilityService();
if (!accService)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(accService);
*aResult = accService;
return NS_OK;
}

View File

@@ -0,0 +1,74 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Original Author: David W. Hyatt (hyatt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __nsAccessibilityService_h__
#define __nsAccessibilityService_h__
#include "nsIAccessibilityService.h"
#include "nsIContent.h"
#include "nsIPresShell.h"
#include "nsIDocShell.h"
class nsIFrame;
class nsIWeakReference;
class nsIDOMNode;
class nsAccessibilityService : public nsIAccessibilityService
{
public:
NS_DECL_ISUPPORTS
// nsIAccessibilityService methods:
NS_DECL_NSIACCESSIBILITYSERVICE
// nsAccessibilityService methods:
nsAccessibilityService();
virtual ~nsAccessibilityService();
public:
private:
NS_IMETHOD GetInfo(nsISupports* aFrame, nsIFrame** aRealFrame, nsIWeakReference** aShell, nsIDOMNode** aContent);
NS_IMETHOD GetShellFromNode(nsIDOMNode *aNode, nsIWeakReference **weakShell);
void GetOwnerFor(nsIPresShell *aPresShell, nsIPresShell **aOwnerShell, nsIContent **aOwnerContent);
nsIContent* FindContentForDocShell(nsIPresShell* aPresShell, nsIContent* aContent, nsIDocShell* aDocShell);
};
#endif /* __nsIAccessibilityService_h__ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,151 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* John Gaunt (jgaunt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsAccessible_H_
#define _nsAccessible_H_
#include "nsCOMPtr.h"
#include "nsGenericAccessible.h"
#include "nsIAccessible.h"
#include "nsIDOMNode.h"
#include "nsIFocusController.h"
#include "nsIPresContext.h"
#include "nsIPresShell.h"
#include "nsPoint.h"
#include "nsRect.h"
#include "nsWeakReference.h"
#include "nsIDOMNodeList.h"
#include "nsIBindingManager.h"
#define ACCESSIBLE_BUNDLE_URL "chrome://global/locale/accessible.properties"
class nsIContent;
class nsIDocShell;
class nsIFrame;
class nsIWebShell;
enum { eSiblingsUninitialized = -1, eSiblingsWalkNormalDOM = -2}; // Used in sibling index field as flags
class nsAccessible : public nsGenericAccessible
{
public:
// to eliminate the confusion of "magic numbers" -- if ( 0 ){ foo; }
enum { eAction_Switch=0, eAction_Jump=0, eAction_Click=0 };
// how many actions
enum { eNo_Action=0, eSingle_Action=1 };
NS_IMETHOD GetAccName(nsAWritableString& _retval);
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
NS_IMETHOD GetAccFocused(nsIAccessible **_retval);
NS_IMETHOD AccGetAt(PRInt32 x, PRInt32 y, nsIAccessible **_retval);
NS_IMETHOD AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height);
NS_IMETHOD AccRemoveSelection(void);
NS_IMETHOD AccTakeSelection(void);
NS_IMETHOD AccTakeFocus(void);
NS_IMETHOD AccGetDOMNode(nsIDOMNode **_retval);
public:
nsAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
virtual ~nsAccessible();
virtual void GetListAtomForFrame(nsIFrame* aFrame, nsIAtom*& aList) { aList = nsnull; }
// Helper Routines for Sub-Docs
static nsresult GetDocShellObjects(nsIDocShell* aDocShell,
nsIPresShell** aPresShell,
nsIPresContext** aPresContext,
nsIContent** aContent);
static nsresult GetDocShells(nsIPresShell* aPresShell,
nsIDocShell** aDocShell,
nsIDocShell** aParentDocShell);
static nsresult GetParentPresShellAndContent(nsIPresShell* aPresShell,
nsIPresShell** aParentPresShell,
nsIContent** aSubShellContent);
static PRBool FindContentForWebShell(nsIPresShell* aParentPresShell,
nsIContent* aParentContent,
nsIWebShell* aWebShell,
nsIContent** aFoundContent);
nsresult CalcOffset(nsIFrame* aFrame,
nsIPresContext * aPresContext,
nsRect& aRect);
nsresult GetAbsPosition(nsIPresShell* aPresShell, nsPoint& aPoint);
nsresult GetAbsoluteFramePosition(nsIPresContext* aPresContext,
nsIFrame *aFrame,
nsRect& aAbsoluteTwipsRect,
nsRect& aAbsolutePixelRect);
static nsresult GetTranslatedString(PRUnichar *aKey, nsAWritableString *aStringOut);
// helper method to verify frames
static PRBool IsCorrectFrameType(nsIFrame* aFrame, nsIAtom* aAtom);
protected:
NS_IMETHOD AppendLabelText(nsIDOMNode *aLabelNode, nsAWritableString& _retval);
NS_IMETHOD AppendLabelFor(nsIContent *aLookNode, nsAReadableString *aId, nsAWritableString *aLabel);
NS_IMETHOD GetHTMLAccName(nsAWritableString& _retval);
NS_IMETHOD GetXULAccName(nsAWritableString& _retval);
protected:
virtual nsIFrame* GetFrame();
virtual nsIFrame* GetBoundsFrame();
virtual void GetBounds(nsRect& aRect, nsIFrame** aRelativeFrame);
virtual void GetPresContext(nsCOMPtr<nsIPresContext>& aContext);
PRBool IsEntirelyVisible();
NS_IMETHOD AppendFlatStringFromSubtree(nsIContent *aContent, nsAWritableString *aFlatString);
NS_IMETHOD AppendFlatStringFromContentNode(nsIContent *aContent, nsAWritableString *aFlatString);
NS_IMETHOD AppendStringWithSpaces(nsAWritableString *aFlatString, nsAReadableString& textEquivalent);
NS_IMETHOD GetFocusedElement(nsIDOMElement **aFocusedElement);
NS_IMETHOD CacheOptimizations(nsIAccessible *aParent, PRInt32 aSiblingIndex, nsIDOMNodeList *aSiblingList);
// Data Members
nsCOMPtr<nsIDOMNode> mDOMNode;
nsCOMPtr<nsIWeakReference> mPresShell;
nsCOMPtr<nsIAccessible> mParent;
nsCOMPtr<nsIDOMNodeList> mSiblingList; // If some of our computed siblings are anonymous content nodes, cache node list
PRInt32 mSiblingIndex; // Cache where we are in list of kids that we got from nsIBindingManager::GetContentList(parentContent)
};
#endif

View File

@@ -0,0 +1,410 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* John Gaunt (jgaunt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsAccessible.h"
#include "nsBaseWidgetAccessible.h"
#include "nsCOMPtr.h"
#include "nsGUIEvent.h"
#include "nsIContent.h"
#include "nsIDOMElement.h"
#include "nsIDOMEventReceiver.h"
#include "nsIFrame.h"
#include "nsILink.h"
#include "nsIPresContext.h"
#include "nsIPresShell.h"
#include "nsISelection.h"
#include "nsISelectionController.h"
// ------------
// nsBlockAccessible
// ------------
nsBlockAccessible::nsBlockAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):nsAccessible(aNode, aShell)
{
}
/* nsIAccessible accGetAt (in long x, in long y); */
NS_IMETHODIMP nsBlockAccessible::AccGetAt(PRInt32 tx, PRInt32 ty, nsIAccessible **_retval)
{
// We're going to find the child that contains coordinates (tx,ty)
PRInt32 x,y,w,h;
AccGetBounds(&x,&y,&w,&h); // Get bounds for this accessible
if (tx > x && tx < x + w && ty > y && ty < y + h)
{
// It's within this nsIAccessible, let's drill down
nsCOMPtr<nsIAccessible> child;
nsCOMPtr<nsIAccessible> smallestChild;
PRInt32 smallestArea = -1;
nsCOMPtr<nsIAccessible> next;
GetAccFirstChild(getter_AddRefs(child));
PRInt32 cx,cy,cw,ch; // Child bounds
while(child) {
child->AccGetBounds(&cx,&cy,&cw,&ch);
// ok if there are multiple frames the contain the point
// and they overlap then pick the smallest. We need to do this
// for text frames.
// For example, A point that's in block #2 is also in block #1, but we want to return #2:
//
// [[block #1 is long wrapped text that continues to
// another line]] [[here is a shorter block #2]]
if (tx > cx && tx < cx + cw && ty > cy && ty < cy + ch)
{
if (smallestArea == -1 || cw*ch < smallestArea) {
smallestArea = cw*ch;
smallestChild = child;
}
}
child->GetAccNextSibling(getter_AddRefs(next));
child = next;
}
if (smallestChild != nsnull)
{
*_retval = smallestChild;
NS_ADDREF(*_retval);
return NS_OK;
}
*_retval = this;
NS_ADDREF(this);
return NS_OK;
}
*_retval = nsnull;
return NS_OK;
}
/**
* nsContainerAccessible
*/
nsContainerAccessible::nsContainerAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsAccessible(aNode, aShell)
{
}
/** no actions */
NS_IMETHODIMP nsContainerAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = eNo_Action;
return NS_OK;
}
/** no actions */
NS_IMETHODIMP nsContainerAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
return NS_OK;
}
/** no actions */
NS_IMETHODIMP nsContainerAccessible::AccDoAction(PRUint8 index)
{
return NS_OK;
}
/** no state -- normal */
NS_IMETHODIMP nsContainerAccessible::GetAccState(PRUint32 *_retval)
{
*_retval = 0;
return NS_OK;
}
/** no value */
NS_IMETHODIMP nsContainerAccessible::GetAccValue(nsAWritableString& _retval)
{
return NS_OK;
}
/** no name*/
NS_IMETHODIMP nsContainerAccessible::GetAccName(nsAWritableString& _retval)
{
return NS_OK;
}
//-------------
// nsLeafFrameAccessible
//-------------
nsLeafAccessible::nsLeafAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsAccessible(aNode, aShell)
{
}
/* nsIAccessible getAccFirstChild (); */
NS_IMETHODIMP nsLeafAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/* nsIAccessible getAccLastChild (); */
NS_IMETHODIMP nsLeafAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/* long getAccChildCount (); */
NS_IMETHODIMP nsLeafAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 0;
return NS_OK;
}
//----------------
// nsLinkableAccessible
//----------------
nsLinkableAccessible::nsLinkableAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsAccessible(aNode, aShell), mIsALinkCached(PR_FALSE), mLinkContent(nsnull), mIsLinkVisited(PR_FALSE)
{
}
/* long GetAccState (); */
NS_IMETHODIMP nsLinkableAccessible::GetAccState(PRUint32 *_retval)
{
nsAccessible::GetAccState(_retval);
*_retval |= STATE_READONLY | STATE_SELECTABLE;
if (IsALink()) {
*_retval |= STATE_LINKED;
if (mIsLinkVisited)
*_retval |= STATE_TRAVERSED;
}
// Get current selection and find out if current node is in it
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
if (!shell) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIPresContext> context;
shell->GetPresContext(getter_AddRefs(context));
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
nsIFrame *frame;
if (content && NS_SUCCEEDED(shell->GetPrimaryFrameFor(content, &frame))) {
nsCOMPtr<nsISelectionController> selCon;
frame->GetSelectionController(context,getter_AddRefs(selCon));
if (selCon) {
nsCOMPtr<nsISelection> domSel;
selCon->GetSelection(nsISelectionController::SELECTION_NORMAL, getter_AddRefs(domSel));
if (domSel) {
PRBool isSelected = PR_FALSE, isCollapsed = PR_TRUE;
domSel->ContainsNode(mDOMNode, PR_TRUE, &isSelected);
domSel->GetIsCollapsed(&isCollapsed);
if (isSelected && !isCollapsed)
*_retval |=STATE_SELECTED;
}
}
}
// Focused? Do we implement that here or up the chain?
return NS_OK;
}
NS_IMETHODIMP nsLinkableAccessible::GetAccValue(nsAWritableString& _retval)
{
if (IsALink()) {
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(mLinkContent));
if (elt)
return elt->GetAttribute(NS_LITERAL_STRING("href"), _retval);
}
return NS_ERROR_FAILURE;
}
/* PRUint8 getAccNumActions (); */
NS_IMETHODIMP nsLinkableAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = eSingle_Action;
return NS_OK;
}
/* wstring getAccActionName (in PRUint8 index); */
NS_IMETHODIMP nsLinkableAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
// Action 0 (default action): Jump to link
if (index == eAction_Jump) {
if (IsALink()) {
_retval = NS_LITERAL_STRING("jump");
return NS_OK;
}
}
return NS_ERROR_FAILURE;
}
/* void accDoAction (in PRUint8 index); */
NS_IMETHODIMP nsLinkableAccessible::AccDoAction(PRUint8 index)
{
// Action 0 (default action): Jump to link
if (index == 0) {
if (IsALink()) {
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
if (!shell) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIPresContext> presContext;
shell->GetPresContext(getter_AddRefs(presContext));
if (presContext) {
nsMouseEvent linkClickEvent;
linkClickEvent.eventStructType = NS_EVENT;
linkClickEvent.message = NS_MOUSE_LEFT_CLICK;
linkClickEvent.isShift = PR_FALSE;
linkClickEvent.isControl = PR_FALSE;
linkClickEvent.isAlt = PR_FALSE;
linkClickEvent.isMeta = PR_FALSE;
linkClickEvent.clickCount = 0;
linkClickEvent.widget = nsnull;
nsEventStatus eventStatus = nsEventStatus_eIgnore;
mLinkContent->HandleDOMEvent(presContext,
&linkClickEvent,
nsnull,
NS_EVENT_FLAG_INIT,
&eventStatus);
return NS_OK;
}
}
}
return NS_ERROR_FAILURE;
}
PRBool nsLinkableAccessible::IsALink()
{
if (mIsALinkCached) // Cached answer?
return mLinkContent? PR_TRUE: PR_FALSE;
nsCOMPtr<nsIContent> walkUpContent(do_QueryInterface(mDOMNode));
if (walkUpContent) {
nsCOMPtr<nsIContent> tempContent = walkUpContent;
while (walkUpContent) {
nsCOMPtr<nsILink> link(do_QueryInterface(walkUpContent));
if (link) {
mLinkContent = tempContent;
mIsALinkCached = PR_TRUE;
nsLinkState linkState;
link->GetLinkState(linkState);
if (linkState == eLinkState_Visited)
mIsLinkVisited = PR_TRUE;
return PR_TRUE;
}
walkUpContent->GetParent(*getter_AddRefs(tempContent));
walkUpContent = tempContent;
}
}
mIsALinkCached = PR_TRUE; // Cached that there is no link
return PR_FALSE;
}
// ------------
// nsMenuListenerAccessible
// ------------
NS_IMPL_ISUPPORTS_INHERITED1(nsMenuListenerAccessible, nsAccessible, nsIDOMXULListener)
nsMenuListenerAccessible::nsMenuListenerAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
nsAccessible(aDOMNode, aShell)
{
mRegistered = PR_FALSE;
mOpen = PR_FALSE;
}
nsMenuListenerAccessible::~nsMenuListenerAccessible()
{
if (mRegistered) {
nsCOMPtr<nsIDOMEventReceiver> eventReceiver(do_QueryInterface(mDOMNode));
if (eventReceiver)
eventReceiver->RemoveEventListener(NS_LITERAL_STRING("popupshowing"), this, PR_TRUE);
}
}
NS_IMETHODIMP nsMenuListenerAccessible::PopupShowing(nsIDOMEvent* aEvent)
{
mOpen = PR_TRUE;
/* TBD send state change event */
return NS_OK;
}
NS_IMETHODIMP nsMenuListenerAccessible::PopupHiding(nsIDOMEvent* aEvent)
{
mOpen = PR_FALSE;
/* TBD send state change event */
return NS_OK;
}
NS_IMETHODIMP nsMenuListenerAccessible::Close(nsIDOMEvent* aEvent)
{
mOpen = PR_FALSE;
/* TBD send state change event */
return NS_OK;
}
void
nsMenuListenerAccessible::SetupMenuListener()
{
// if not already one, register ourselves as a popup listener
if (!mRegistered) {
nsCOMPtr<nsIDOMEventReceiver> eventReceiver(do_QueryInterface(mDOMNode));
if (!eventReceiver) {
return;
}
nsresult rv = eventReceiver->AddEventListener(NS_LITERAL_STRING("popupshowing"), this, PR_TRUE);
if (NS_FAILED(rv)) {
return;
}
mRegistered = PR_TRUE;
}
}

View File

@@ -0,0 +1,148 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* John Gaunt (jgaunt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsBaseWidgetAccessible_H_
#define _nsBaseWidgetAccessible_H_
#include "nsAccessible.h"
#include "nsCOMPtr.h"
#include "nsIContent.h"
#include "nsIDOMNode.h"
#include "nsIDOMXULListener.h"
/**
* This file contains a number of classes that are used as base
* classes for the different accessibility implementations of
* the HTML and XUL widget sets. --jgaunt
*/
/**
* Special Accessible that knows how to handle hit detection for flowing text
*/
class nsBlockAccessible : public nsAccessible
{
public:
nsBlockAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD AccGetAt(PRInt32 x, PRInt32 y, nsIAccessible **_retval);
};
/**
* Special Accessible that just contains other accessible objects
* no actions, no name, no state, no value
*/
class nsContainerAccessible : public nsAccessible
{
public:
nsContainerAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
NS_IMETHOD AccDoAction(PRUint8 index);
NS_IMETHOD GetAccState(PRUint32 *_retval);
NS_IMETHOD GetAccValue(nsAWritableString& _retval);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
};
/**
* Leaf version of DOM Accessible -- has no children
*/
class nsLeafAccessible : public nsAccessible
{
public:
nsLeafAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
};
/**
* A type of accessible for DOM nodes containing an href="" attribute.
* It knows how to report the state of the link ( traveled or not )
* and can activate ( click ) the link programmatically.
*/
class nsLinkableAccessible : public nsAccessible
{
public:
nsLinkableAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
NS_IMETHOD AccDoAction(PRUint8 index);
NS_IMETHOD GetAccState(PRUint32 *_retval);
NS_IMETHOD GetAccValue(nsAWritableString& _retval);
protected:
PRBool IsALink();
PRBool mIsALinkCached; // -1 = unknown, 0 = not a link, 1 = is a link
nsCOMPtr<nsIContent> mLinkContent;
PRBool mIsLinkVisited;
};
/*
* A base class that can listen to menu events. Its used by selects so the
* button and the window accessibles can change their name and role
* depending on whether the drop down list is dropped down on not
*/
class nsMenuListenerAccessible : public nsAccessible, public nsIDOMXULListener
{
public:
NS_DECL_ISUPPORTS_INHERITED
nsMenuListenerAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsMenuListenerAccessible();
// popup listener
NS_IMETHOD PopupShowing(nsIDOMEvent* aEvent);
NS_IMETHOD PopupShown(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD PopupHiding(nsIDOMEvent* aEvent);
NS_IMETHOD PopupHidden(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD Close(nsIDOMEvent* aEvent);
NS_IMETHOD Command(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD Broadcast(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD CommandUpdate(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent) { return NS_OK; }
virtual void SetupMenuListener();
PRBool mRegistered;
PRBool mOpen;
};
#endif

View File

@@ -0,0 +1,226 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* John Gaunt (jgaunt@netscape.com)
* Aaron Leventhal (aaronl@netscape.com)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// NOTE: alphabetically ordered
#include "nsFormControlAccessible.h"
#include "nsIDocument.h"
#include "nsIDOMHTMLFormElement.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMHTMLLabelElement.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMXULButtonElement.h"
#include "nsIDOMXULCheckboxElement.h"
#include "nsIDOMXULDocument.h"
#include "nsIDOMXULElement.h"
#include "nsIDOMXULLabelElement.h"
#include "nsIDOMXULSelectCntrlEl.h"
#include "nsIDOMXULSelectCntrlItemEl.h"
#include "nsReadableUtils.h"
#include "nsString.h"
/**
* nsFormControlAccessible
*/
nsFormControlAccessible::nsFormControlAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsAccessible(aNode, aShell)
{
}
/**
* XUL states: focused, unavailable(disabled), focusable, ?protected?
* HTML states: focused, unabailable(disabled), focusable, protected
*/
NS_IMETHODIMP nsFormControlAccessible::GetAccState(PRUint32 *_retval)
{
// Get the focused state from the nsAccessible
nsAccessible::GetAccState(_retval);
PRBool disabled = PR_FALSE;
nsresult rv = NS_ERROR_FAILURE;
nsCOMPtr<nsIDOMHTMLInputElement> htmlFormElement(do_QueryInterface(mDOMNode, &rv));
if (NS_SUCCEEDED(rv) && htmlFormElement) {
htmlFormElement->GetDisabled(&disabled);
nsAutoString typeString;
htmlFormElement->GetType(typeString);
if (typeString.EqualsIgnoreCase("password"))
*_retval |= STATE_PROTECTED;
}
else {
nsCOMPtr<nsIDOMXULControlElement> xulFormElement(do_QueryInterface(mDOMNode, &rv));
if (NS_SUCCEEDED(rv) && xulFormElement) {
xulFormElement->GetDisabled(&disabled);
/* XXX jgaunt do XUL elements support password fields? */
}
}
if (disabled)
*_retval |= STATE_UNAVAILABLE;
else
*_retval |= STATE_FOCUSABLE;
return NS_OK;
}
/**
* Will be called by both HTML and XUL elements, this method
* merely checks who is calling and then calls the appropriate
* protected method for the XUL or HTML element.
*/
NS_IMETHODIMP nsFormControlAccessible::GetAccName(nsAWritableString& _retval)
{
nsCOMPtr<nsIDOMXULElement> xulFormElement(do_QueryInterface(mDOMNode));
if (xulFormElement)
return GetXULAccName(_retval);
else
return GetHTMLAccName(_retval);
}
/**
* No Children
*/
NS_IMETHODIMP nsFormControlAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
* No Children
*/
NS_IMETHODIMP nsFormControlAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
* No Children
*/
NS_IMETHODIMP nsFormControlAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 0;
return NS_OK;
}
// ------------
// Radio button
// ------------
nsRadioButtonAccessible::nsRadioButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsFormControlAccessible(aNode, aShell)
{
}
/**
*
*/
NS_IMETHODIMP nsRadioButtonAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = eSingle_Action;
return NS_OK;
}
/**
*
*/
NS_IMETHODIMP nsRadioButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
if (index == eAction_Click) {
_retval = NS_LITERAL_STRING("select");
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
/**
*
*/
NS_IMETHODIMP nsRadioButtonAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_RADIOBUTTON;
return NS_OK;
}
// ------------
// Text Accessibles
// ------------
nsTextAccessible::nsTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell):
nsLinkableAccessible(aDomNode, aShell)
{
}
/**
* We are text
*/
NS_IMETHODIMP nsTextAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_TEXT;
return NS_OK;
}
/**
* No Children
*/
NS_IMETHODIMP nsTextAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
* No Children
*/
NS_IMETHODIMP nsTextAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
* No Children
*/
NS_IMETHODIMP nsTextAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 0;
return NS_OK;
}

View File

@@ -0,0 +1,93 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Eric D Vaughan (evaughan@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsFormControlAccessible_H_
#define _nsFormControlAccessible_H_
#include "nsBaseWidgetAccessible.h"
/**
* This supports name and state information for both XUL and HTML
* widgets. Designed to be a base class for the impls of XUL
* and HTML form widget Accessibles
*/
class nsFormControlAccessible : public nsAccessible
{
public:
nsFormControlAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
};
/**
*
*/
class nsRadioButtonAccessible : public nsFormControlAccessible
{
public:
nsRadioButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
};
/**
* Text nodes have no children, but since double inheritance
* no-worky we have to re-impl the LeafAccessiblity blocks
* this way.
*/
class nsTextAccessible : public nsLinkableAccessible
{
public:
nsTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
};
#endif

View File

@@ -0,0 +1,243 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Eric Vaughan (evaughan@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsGenericAccessible.h"
#include "nsIFrame.h"
#include "nsCOMPtr.h"
#include "nsIWeakReference.h"
#include "nsReadableUtils.h"
#include "nsIContent.h"
/* Implementation file */
NS_IMPL_ISUPPORTS1(nsGenericAccessible, nsIAccessible)
nsGenericAccessible::nsGenericAccessible()
{
NS_INIT_ISUPPORTS();
/* member initializers and constructor code */
}
nsGenericAccessible::~nsGenericAccessible()
{
/* destructor code */
}
/* nsIAccessible getAccParent (); */
NS_IMETHODIMP nsGenericAccessible::GetAccParent(nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIAccessible getAccNextSibling (); */
NS_IMETHODIMP nsGenericAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIAccessible getAccPreviousSibling (); */
NS_IMETHODIMP nsGenericAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIAccessible getAccFirstChild (); */
NS_IMETHODIMP nsGenericAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIAccessible getAccLastChild (); */
NS_IMETHODIMP nsGenericAccessible::GetAccLastChild(nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* long getAccChildCount (); */
NS_IMETHODIMP nsGenericAccessible::GetAccChildCount(PRInt32 *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* wstring getAccName (); */
NS_IMETHODIMP nsGenericAccessible::GetAccName(nsAWritableString& _retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* wstring getAccValue (); */
NS_IMETHODIMP nsGenericAccessible::GetAccValue(nsAWritableString& _retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void setAccName (in wstring name); */
NS_IMETHODIMP nsGenericAccessible::SetAccName(const nsAReadableString& name)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* wstring getAccDescription (); */
NS_IMETHODIMP nsGenericAccessible::GetAccDescription(nsAWritableString& _retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsGenericAccessible::GetAccRole(PRUint32 *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* wstring getAccState (); */
NS_IMETHODIMP nsGenericAccessible::GetAccState(PRUint32 *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* PRUint8 getAccNumActions (); */
NS_IMETHODIMP nsGenericAccessible::GetAccNumActions(PRUint8 *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* wstring getAccActionName (in PRUint8 index); */
NS_IMETHODIMP nsGenericAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void accDoAction (in PRUint8 index); */
NS_IMETHODIMP nsGenericAccessible::AccDoAction(PRUint8 index)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIAccessible getAccFocused(); */
NS_IMETHODIMP nsGenericAccessible::GetAccFocused(nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* wstring getAccHelp (); */
NS_IMETHODIMP nsGenericAccessible::GetAccHelp(nsAWritableString& _retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIAccessible accGetAt (in long x, in long y); */
NS_IMETHODIMP nsGenericAccessible::AccGetAt(PRInt32 x, PRInt32 y, nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIAccessible accNavigateRight (); */
NS_IMETHODIMP nsGenericAccessible::AccNavigateRight(nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIAccessible accNavigateLeft (); */
NS_IMETHODIMP nsGenericAccessible::AccNavigateLeft(nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIAccessible accNavigateUp (); */
NS_IMETHODIMP nsGenericAccessible::AccNavigateUp(nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIAccessible accNavigateDown (); */
NS_IMETHODIMP nsGenericAccessible::AccNavigateDown(nsIAccessible **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void accGetBounds (out long x, out long y, out long width, out long height); */
NS_IMETHODIMP nsGenericAccessible::AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void accAddSelection (); */
NS_IMETHODIMP nsGenericAccessible::AccAddSelection()
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void accRemoveSelection (); */
NS_IMETHODIMP nsGenericAccessible::AccRemoveSelection()
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void accExtendSelection (); */
NS_IMETHODIMP nsGenericAccessible::AccExtendSelection()
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void accTakeSelection (); */
NS_IMETHODIMP nsGenericAccessible::AccTakeSelection()
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void accTakeFocus (); */
NS_IMETHODIMP nsGenericAccessible::AccTakeFocus()
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* unsigned long getAccExtState (); */
NS_IMETHODIMP nsGenericAccessible::GetAccExtState(PRUint32 *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsGenericAccessible::AccGetDOMNode(nsIDOMNode **_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsGenericAccessible::CacheOptimizations(nsIAccessible *aParent, PRInt32 aSiblingIndex, nsIDOMNodeList *aSiblingList)
{
return NS_ERROR_NOT_IMPLEMENTED;
}

View File

@@ -0,0 +1,67 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Eric D Vaughan (evaughan@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsGenericAccessible_H_
#define _nsGenericAccessible_H_
#include "nsISupports.h"
#include "nsIAccessible.h"
#include "nsIContent.h"
#include "nsIDOMNode.h"
#include "nsIPresShell.h"
#include "nsIPresContext.h"
#include "nsCOMPtr.h"
#include "nsIWeakReference.h"
/**
* Basic implementation
* supports nothing
*/
class nsGenericAccessible : public nsIAccessible
{
NS_DECL_ISUPPORTS
NS_DECL_NSIACCESSIBLE
public:
nsGenericAccessible();
virtual ~nsGenericAccessible();
};
#endif

View File

@@ -0,0 +1,169 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Aaron Leventhal (aaronl@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsGenericAccessible.h"
#include "nsHTMLAreaAccessible.h"
#include "nsReadableUtils.h"
#include "nsString.h"
#include "nsAccessible.h"
#include "nsIAccessibilityService.h"
#include "nsIServiceManager.h"
#include "nsIDOMElement.h"
#include "nsIDOMHTMLAreaElement.h"
// --- area -----
nsHTMLAreaAccessible::nsHTMLAreaAccessible(nsIDOMNode *aDomNode, nsIAccessible *aAccParent, nsIWeakReference* aShell):
nsLinkableAccessible(aDomNode, aShell), mAccParent(aAccParent)
{
}
/* wstring getAccName (); */
NS_IMETHODIMP nsHTMLAreaAccessible::GetAccName(nsAWritableString & _retval)
{
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(mDOMNode));
if (elt) {
nsAutoString hrefString;
elt->GetAttribute(NS_LITERAL_STRING("title"), _retval);
}
return NS_OK;
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLAreaAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_LINK;
return NS_OK;
}
/* wstring getAccValue (); */
NS_IMETHODIMP nsHTMLAreaAccessible::GetAccValue(nsAWritableString& _retval)
{
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(mDOMNode));
if (elt)
elt->GetAttribute(NS_LITERAL_STRING("href"), _retval);
return NS_OK;
}
/* wstring getAccDescription (); */
NS_IMETHODIMP nsHTMLAreaAccessible::GetAccDescription(nsAWritableString& _retval)
{
// Still to do - follow IE's standard here
nsCOMPtr<nsIDOMHTMLAreaElement> area(do_QueryInterface(mDOMNode));
if (area)
area->GetShape(_retval);
return NS_OK;
}
/* nsIAccessible getAccFirstChild (); */
NS_IMETHODIMP nsHTMLAreaAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/* nsIAccessible getAccLastChild (); */
NS_IMETHODIMP nsHTMLAreaAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/* long getAccChildCount (); */
NS_IMETHODIMP nsHTMLAreaAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 0;
return NS_OK;
}
NS_IMETHODIMP nsHTMLAreaAccessible::GetAccParent(nsIAccessible * *aAccParent)
{
*aAccParent = mAccParent;
NS_IF_ADDREF(*aAccParent);
return NS_OK;
}
nsIAccessible *nsHTMLAreaAccessible::CreateAreaAccessible(nsIDOMNode *aDOMNode)
{
nsCOMPtr<nsIAccessibilityService> accService(do_GetService("@mozilla.org/accessibilityService;1"));
if (accService) {
nsIAccessible* acc = nsnull;
accService->CreateHTMLAreaAccessible(mPresShell, aDOMNode, mAccParent, &acc);
return acc;
}
return nsnull;
}
NS_IMETHODIMP nsHTMLAreaAccessible::GetAccNextSibling(nsIAccessible * *aAccNextSibling)
{
*aAccNextSibling = nsnull;
nsCOMPtr<nsIDOMNode> nextNode;
mDOMNode->GetNextSibling(getter_AddRefs(nextNode));
if (nextNode)
*aAccNextSibling = CreateAreaAccessible(nextNode);
return NS_OK;
}
/* readonly attribute nsIAccessible accPreviousSibling; */
NS_IMETHODIMP nsHTMLAreaAccessible::GetAccPreviousSibling(nsIAccessible * *aAccPrevSibling)
{
*aAccPrevSibling = nsnull;
nsCOMPtr<nsIDOMNode> prevNode;
mDOMNode->GetPreviousSibling(getter_AddRefs(prevNode));
if (prevNode)
*aAccPrevSibling = CreateAreaAccessible(prevNode);
return NS_OK;
}
/* void accGetBounds (out long x, out long y, out long width, out long height); */
NS_IMETHODIMP nsHTMLAreaAccessible::AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height)
{
//nsIFrame *frame;
// Do a better job on this later - need to use GetRect on mAreas of nsImageMap from nsImageFrame
//return mAccParent->nsAccessible::AccGetBounds(x,y,width,height);
*x = *y = *width = *height = 0;
return NS_ERROR_NOT_IMPLEMENTED;
}

View File

@@ -0,0 +1,71 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Aaron Leventhal (aaronl@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsHTMLAreaAccessible_H_
#define _nsHTMLAreaAccessible_H_
#include "nsBaseWidgetAccessible.h"
#include "nsAccessible.h"
/* Accessible for image map areas - must be child of image
*/
class nsHTMLAreaAccessible : public nsLinkableAccessible
{
public:
nsHTMLAreaAccessible(nsIDOMNode *domNode, nsIAccessible *accParent, nsIWeakReference* aShell);
NS_IMETHOD GetAccName(nsAWritableString & _retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccValue(nsAWritableString& _retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
NS_IMETHOD GetAccParent(nsIAccessible * *aAccParent);
NS_IMETHOD GetAccNextSibling(nsIAccessible * *aAccNextSibling);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible * *aAccPreviousSibling);
NS_IMETHOD GetAccDescription(nsAWritableString& _retval);
NS_IMETHOD AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height);
protected:
nsIAccessible *CreateAreaAccessible(nsIDOMNode *aDOMNode);
nsCOMPtr<nsIAccessible> mAccParent;
};
#endif

View File

@@ -0,0 +1,376 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Eric Vaughan (evaughan@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// NOTE: alphabetically ordered
#include "nsAccessible.h"
#include "nsFormControlAccessible.h"
#include "nsHTMLAtoms.h"
#include "nsHTMLFormControlAccessible.h"
#include "nsIDOMHTMLButtonElement.h"
#include "nsIDOMHTMLFormElement.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMHTMLLabelElement.h"
#include "nsIDOMHTMLTextAreaElement.h"
#include "nsIDOMXULCheckboxElement.h"
#include "nsIDOMXULButtonElement.h"
#include "nsIDOMXULSelectCntrlItemEl.h"
#include "nsIDOMXULSelectCntrlEl.h"
#include "nsINameSpaceManager.h"
#include "nsIFrame.h"
#include "nsISelectionController.h"
#include "nsReadableUtils.h"
#include "nsWeakReference.h"
// --- checkbox -----
nsHTMLCheckboxAccessible::nsHTMLCheckboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsFormControlAccessible(aNode, aShell)
{
}
NS_IMETHODIMP nsHTMLCheckboxAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_CHECKBUTTON;
return NS_OK;
}
NS_IMETHODIMP nsHTMLCheckboxAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = eSingle_Action;
return NS_OK;
}
NS_IMETHODIMP nsHTMLCheckboxAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
if (index == eAction_Click) { // 0 is the magic value for default action
// check or uncheck
PRUint32 state;
GetAccState(&state);
if (state & STATE_CHECKED)
_retval = NS_LITERAL_STRING("uncheck");
else
_retval = NS_LITERAL_STRING("check");
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP nsHTMLCheckboxAccessible::AccDoAction(PRUint8 index)
{
if (index == 0) { // 0 is the magic value for default action
nsCOMPtr<nsIDOMHTMLInputElement> htmlCheckboxElement(do_QueryInterface(mDOMNode));
PRBool checked = PR_FALSE;
if (htmlCheckboxElement) {
htmlCheckboxElement->GetChecked(&checked);
htmlCheckboxElement->SetChecked(!checked);
return NS_OK;
}
return NS_ERROR_FAILURE;
}
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP nsHTMLCheckboxAccessible::GetAccState(PRUint32 *_retval)
{
nsFormControlAccessible::GetAccState(_retval);
PRBool checked = PR_FALSE; // Radio buttons and check boxes can be checked
nsCOMPtr<nsIDOMHTMLInputElement> htmlCheckboxElement(do_QueryInterface(mDOMNode));
if (htmlCheckboxElement)
htmlCheckboxElement->GetChecked(&checked);
if (checked)
*_retval |= STATE_CHECKED;
return NS_OK;
}
//------ Radio button -------
nsHTMLRadioButtonAccessible::nsHTMLRadioButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsRadioButtonAccessible(aNode, aShell)
{
}
NS_IMETHODIMP nsHTMLRadioButtonAccessible::AccDoAction(PRUint8 index)
{
if (index == eAction_Click) {
nsCOMPtr<nsIDOMHTMLInputElement> element(do_QueryInterface(mDOMNode));
element->Click();
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP nsHTMLRadioButtonAccessible::GetAccState(PRUint32 *_retval)
{
nsFormControlAccessible::GetAccState(_retval);
PRBool checked = PR_FALSE; // Radio buttons and check boxes can be checked
nsCOMPtr<nsIDOMHTMLInputElement> htmlRadioElement(do_QueryInterface(mDOMNode));
if (htmlRadioElement)
htmlRadioElement->GetChecked(&checked);
if (checked)
*_retval |= STATE_CHECKED;
return NS_OK;
}
// ----- Button -----
nsHTMLButtonAccessible::nsHTMLButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsFormControlAccessible(aNode, aShell)
{
}
NS_IMETHODIMP nsHTMLButtonAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = eSingle_Action;
return NS_OK;;
}
NS_IMETHODIMP nsHTMLButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
if (index == eAction_Click) {
_retval = NS_LITERAL_STRING("press");
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP nsHTMLButtonAccessible::AccDoAction(PRUint8 index)
{
if (index == 0) {
nsCOMPtr<nsIDOMHTMLInputElement> element(do_QueryInterface(mDOMNode));
element->Click();
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP nsHTMLButtonAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_PUSHBUTTON;
return NS_OK;
}
NS_IMETHODIMP nsHTMLButtonAccessible::GetAccName(nsAWritableString& _retval)
{
nsCOMPtr<nsIDOMHTMLInputElement> button(do_QueryInterface(mDOMNode));
if (!button)
return NS_ERROR_FAILURE;
nsAutoString name;
button->GetValue(name);
name.CompressWhitespace();
_retval.Assign(name);
return NS_OK;
}
// ----- HTML 4 Button: can contain arbitrary HTML content -----
nsHTML4ButtonAccessible::nsHTML4ButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsBlockAccessible(aNode, aShell)
{
}
NS_IMETHODIMP nsHTML4ButtonAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = eSingle_Action;
return NS_OK;;
}
NS_IMETHODIMP nsHTML4ButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
if (index == eAction_Click) {
_retval = NS_LITERAL_STRING("press");
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP nsHTML4ButtonAccessible::AccDoAction(PRUint8 index)
{
if (index == 0) {
nsCOMPtr<nsIDOMHTMLInputElement> inputElement(do_QueryInterface(mDOMNode));
if ( inputElement )
{
inputElement->Click();
return NS_OK;
}
return NS_ERROR_FAILURE;
}
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP nsHTML4ButtonAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_PUSHBUTTON;
return NS_OK;
}
NS_IMETHODIMP nsHTML4ButtonAccessible::GetAccState(PRUint32 *_retval)
{
nsAccessible::GetAccState(_retval);
*_retval |= STATE_FOCUSABLE;
return NS_OK;
}
NS_IMETHODIMP nsHTML4ButtonAccessible::GetAccName(nsAWritableString& _retval)
{
nsresult rv = NS_ERROR_FAILURE;
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
nsAutoString name;
if (content)
rv = AppendFlatStringFromSubtree(content, &name);
if (NS_SUCCEEDED(rv)) {
// Temp var needed until CompressWhitespace built for nsAWritableString
name.CompressWhitespace();
_retval.Assign(name);
}
return rv;
}
// --- textfield -----
nsHTMLTextFieldAccessible::nsHTMLTextFieldAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsFormControlAccessible(aNode, aShell)
{
}
NS_IMETHODIMP nsHTMLTextFieldAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_TEXT;
return NS_OK;
}
NS_IMETHODIMP nsHTMLTextFieldAccessible::GetAccValue(nsAWritableString& _retval)
{
PRUint32 state;
GetAccState(&state);
if (state & STATE_PROTECTED) // Don't return password text!
return NS_ERROR_FAILURE;
nsCOMPtr<nsIDOMHTMLTextAreaElement> textArea(do_QueryInterface(mDOMNode));
if (textArea) {
textArea->GetValue(_retval);
return NS_OK;
}
nsCOMPtr<nsIDOMHTMLInputElement> inputElement(do_QueryInterface(mDOMNode));
if (inputElement) {
inputElement->GetValue(_retval);
return NS_OK;
}
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsHTMLTextFieldAccessible::GetAccState(PRUint32 *_retval)
{
// can be
// focusable, focused, protected. readonly, unavailable, selected
nsAccessible::GetAccState(_retval);
*_retval |= STATE_FOCUSABLE;
nsCOMPtr<nsIDOMHTMLTextAreaElement> textArea(do_QueryInterface(mDOMNode));
nsCOMPtr<nsIDOMHTMLInputElement> inputElement(do_QueryInterface(mDOMNode));
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(mDOMNode));
PRBool isReadOnly = PR_FALSE;
elt->HasAttribute(NS_LITERAL_STRING("readonly"), &isReadOnly);
if (isReadOnly)
*_retval |= STATE_READONLY;
// Get current selection and find out if current node is in it
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
if (!shell) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIPresContext> context;
shell->GetPresContext(getter_AddRefs(context));
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
nsIFrame *frame;
if (content && NS_SUCCEEDED(shell->GetPrimaryFrameFor(content, &frame))) {
nsCOMPtr<nsISelectionController> selCon;
frame->GetSelectionController(context,getter_AddRefs(selCon));
if (selCon) {
nsCOMPtr<nsISelection> domSel;
selCon->GetSelection(nsISelectionController::SELECTION_NORMAL, getter_AddRefs(domSel));
if (domSel) {
PRBool isCollapsed = PR_TRUE;
domSel->GetIsCollapsed(&isCollapsed);
if (!isCollapsed)
*_retval |=STATE_SELECTED;
}
}
}
if (!textArea) {
if (inputElement) {
/////// ====== Must be a password field, so it uses nsIDOMHTMLFormControl ==== ///////
PRUint32 moreStates = 0;
nsresult rv = nsFormControlAccessible::GetAccState(&moreStates);
*_retval |= moreStates;
return rv;
}
return NS_ERROR_FAILURE;
}
PRBool disabled = PR_FALSE;
textArea->GetDisabled(&disabled);
if (disabled)
*_retval |= STATE_UNAVAILABLE;
return NS_OK;
}

View File

@@ -0,0 +1,103 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Eric D Vaughan (evaughan@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsHTMLFormControlAccessible_H_
#define _nsHTMLFormControlAccessible_H_
#include "nsBaseWidgetAccessible.h"
#include "nsFormControlAccessible.h"
class nsICheckboxControlFrame;
class nsHTMLCheckboxAccessible : public nsFormControlAccessible
{
public:
nsHTMLCheckboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
NS_IMETHOD AccDoAction(PRUint8 index);
NS_IMETHOD GetAccState(PRUint32 *_retval);
};
class nsHTMLRadioButtonAccessible : public nsRadioButtonAccessible
{
public:
nsHTMLRadioButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD AccDoAction(PRUint8 index);
NS_IMETHOD GetAccState(PRUint32 *_retval);
};
class nsHTMLButtonAccessible : public nsFormControlAccessible
{
public:
nsHTMLButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
NS_IMETHOD AccDoAction(PRUint8 index);
};
class nsHTML4ButtonAccessible : public nsBlockAccessible
{
public:
nsHTML4ButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
NS_IMETHOD AccDoAction(PRUint8 index);
};
class nsHTMLTextFieldAccessible : public nsFormControlAccessible
{
public:
nsHTMLTextFieldAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccValue(nsAWritableString& _retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
};
#endif

View File

@@ -0,0 +1,207 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsHTMLIFrameRootAccessible.h"
#include "nsCOMPtr.h"
#include "nsIDocument.h"
#include "nsIPresShell.h"
#include "nsIContent.h"
#include "nsIFrame.h"
#include "nsIDOMDocument.h"
#include "nsReadableUtils.h"
NS_INTERFACE_MAP_BEGIN(nsHTMLIFrameRootAccessible)
NS_INTERFACE_MAP_END_INHERITING(nsRootAccessible)
NS_IMPL_ADDREF_INHERITED(nsHTMLIFrameRootAccessible, nsRootAccessible);
NS_IMPL_RELEASE_INHERITED(nsHTMLIFrameRootAccessible, nsRootAccessible);
NS_IMPL_ADDREF_INHERITED(nsHTMLIFrameAccessible, nsBlockAccessible);
NS_IMPL_RELEASE_INHERITED(nsHTMLIFrameAccessible, nsBlockAccessible);
NS_IMETHODIMP
nsHTMLIFrameAccessible::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
NS_ASSERTION(aInstancePtr, "QueryInterface requires a non-NULL destination!");
if ( !aInstancePtr )
return NS_ERROR_NULL_POINTER;
if (aIID.Equals(NS_GET_IID(nsIAccessibleDocument))) {
*aInstancePtr = (void*)(nsIAccessibleDocument*) this;
NS_IF_ADDREF(this);
return NS_OK;
}
return nsBlockAccessible::QueryInterface(aIID, aInstancePtr);
}
nsHTMLIFrameAccessible::nsHTMLIFrameAccessible(nsIDOMNode* aNode, nsIAccessible* aRoot, nsIWeakReference* aShell, nsIDocument *aDoc):
nsBlockAccessible(aNode, aShell), mRootAccessible(aRoot), nsDocAccessibleMixin(aDoc)
{
}
/* attribute wstring accName; */
NS_IMETHODIMP nsHTMLIFrameAccessible::GetAccName(nsAWritableString& aAccName)
{
return GetTitle(aAccName);
}
NS_IMETHODIMP nsHTMLIFrameAccessible::GetAccValue(nsAWritableString& aAccValue)
{
return GetURL(aAccValue);
}
/* nsIAccessible getAccFirstChild (); */
NS_IMETHODIMP nsHTMLIFrameAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
return mRootAccessible->GetAccFirstChild(_retval);
}
/* nsIAccessible getAccLastChild (); */
NS_IMETHODIMP nsHTMLIFrameAccessible::GetAccLastChild(nsIAccessible **_retval)
{
return mRootAccessible->GetAccLastChild(_retval);
}
/* long getAccChildCount (); */
NS_IMETHODIMP nsHTMLIFrameAccessible::GetAccChildCount(PRInt32 *_retval)
{
return mRootAccessible->GetAccChildCount(_retval);
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLIFrameAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_PANE;
return NS_OK;
}
NS_IMETHODIMP nsHTMLIFrameAccessible::GetAccState(PRUint32 *aAccState)
{
return nsAccessible::GetAccState(aAccState);
}
NS_IMETHODIMP nsHTMLIFrameAccessible::GetURL(nsAWritableString& aURL)
{
return nsDocAccessibleMixin::GetURL(aURL);
}
NS_IMETHODIMP nsHTMLIFrameAccessible::GetTitle(nsAWritableString& aTitle)
{
return nsDocAccessibleMixin::GetTitle(aTitle);
}
NS_IMETHODIMP nsHTMLIFrameAccessible::GetMimeType(nsAWritableString& aMimeType)
{
return nsDocAccessibleMixin::GetMimeType(aMimeType);
}
NS_IMETHODIMP nsHTMLIFrameAccessible::GetDocType(nsAWritableString& aDocType)
{
return nsDocAccessibleMixin::GetDocType(aDocType);
}
NS_IMETHODIMP nsHTMLIFrameAccessible::GetNameSpaceURIForID(PRInt16 aNameSpaceID, nsAWritableString& aNameSpaceURI)
{
return nsDocAccessibleMixin::GetNameSpaceURIForID(aNameSpaceID, aNameSpaceURI);
}
NS_IMETHODIMP nsHTMLIFrameAccessible::GetDocument(nsIDocument **doc)
{
return nsDocAccessibleMixin::GetDocument(doc);
}
//=============================//
// nsHTMLIFrameRootAccessible //
//=============================//
//-----------------------------------------------------
// construction
//-----------------------------------------------------
nsHTMLIFrameRootAccessible::nsHTMLIFrameRootAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
mOuterNode(aNode), nsRootAccessible(aShell)
{
}
//-----------------------------------------------------
// destruction
//-----------------------------------------------------
nsHTMLIFrameRootAccessible::~nsHTMLIFrameRootAccessible()
{
}
void nsHTMLIFrameRootAccessible::Init()
{
if (!mOuterAccessible) {
nsCOMPtr<nsIDOMDocument> domDoc;
mOuterNode->GetOwnerDocument(getter_AddRefs(domDoc));
nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
if (doc) {
nsCOMPtr<nsIPresShell> parentShell;
doc->GetShellAt(0, getter_AddRefs(parentShell));
if (parentShell) {
nsCOMPtr<nsIContent> content(do_QueryInterface(mOuterNode));
nsIFrame* frame = nsnull;
parentShell->GetPrimaryFrameFor(content, &frame);
NS_ASSERTION(frame, "No outer frame.");
frame->GetAccessible(getter_AddRefs(mOuterAccessible));
NS_ASSERTION(mOuterAccessible, "Something's wrong - there's no accessible for the outer parent of this frame.");
}
}
}
}
/* readonly attribute nsIAccessible accParent; */
NS_IMETHODIMP nsHTMLIFrameRootAccessible::GetAccParent(nsIAccessible * *_retval)
{
Init();
return mOuterAccessible->GetAccParent(_retval);
}
/* nsIAccessible getAccNextSibling (); */
NS_IMETHODIMP nsHTMLIFrameRootAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
Init();
return mOuterAccessible->GetAccNextSibling(_retval);
}
NS_IMETHODIMP nsHTMLIFrameRootAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
Init();
return mOuterAccessible->GetAccPreviousSibling(_retval);
}

View File

@@ -0,0 +1,101 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsIFrameRootAccessible_H_
#define _nsIFrameRootAccessible_H_
#include "nsBaseWidgetAccessible.h"
#include "nsRootAccessible.h"
#include "nsAccessible.h"
#include "nsIAccessibleDocument.h"
class nsIWebShell;
class nsIWeakReference;
class nsHTMLIFrameAccessible : public nsBlockAccessible,
public nsIAccessibleDocument,
public nsDocAccessibleMixin
{
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIACCESSIBLEDOCUMENT
public:
nsHTMLIFrameAccessible(nsIDOMNode* aNode, nsIAccessible* aRoot, nsIWeakReference* aShell, nsIDocument *doc);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
NS_IMETHOD GetAccName(nsAWritableString& aAccName);
NS_IMETHOD GetAccValue(nsAWritableString& AccValue);
NS_IMETHOD GetAccRole(PRUint32 *aAccRole);
NS_IMETHOD GetAccState(PRUint32 *aAccState);
protected:
nsCOMPtr<nsIAccessible> mRootAccessible;
};
class nsHTMLIFrameRootAccessible : public nsRootAccessible
{
NS_DECL_ISUPPORTS_INHERITED
public:
nsHTMLIFrameRootAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
virtual ~nsHTMLIFrameRootAccessible();
/* attribute wstring accName; */
NS_IMETHOD GetAccParent(nsIAccessible * *aAccParent);
/* nsIAccessible getAccNextSibling (); */
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
/* nsIAccessible getAccPreviousSibling (); */
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
protected:
void Init();
// In these variable names, "outer" relates to the nsHTMLIFrameAccessible, as opposed to the
// nsHTMLIFrameRootAccessible which is "inner".
// The outer node is a <browser> or <iframe> tag, whereas the inner node corresponds to the inner document root.
nsCOMPtr<nsIDOMNode> mOuterNode;
nsCOMPtr<nsIAccessible> mOuterAccessible;
};
#endif

View File

@@ -0,0 +1,205 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Aaron Leventhal (aaronl@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsGenericAccessible.h"
#include "nsHTMLImageAccessible.h"
#include "nsReadableUtils.h"
#include "nsAccessible.h"
#include "nsIHTMLDocument.h"
#include "nsIDocument.h"
#include "nsIDOMHTMLCollection.h"
#include "nsIAccessibilityService.h"
#include "nsIServiceManager.h"
#include "imgIRequest.h"
#include "imgIContainer.h"
#include "nsIImageFrame.h"
// --- image -----
nsHTMLImageAccessible::nsHTMLImageAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
nsLinkableAccessible(aDOMNode, aShell)
{
nsCOMPtr<nsIDOMElement> element(do_QueryInterface(aDOMNode));
nsCOMPtr<nsIDocument> doc;
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
if (!shell)
return;
shell->GetDocument(getter_AddRefs(doc));
nsAutoString mapElementName;
if (doc && element) {
nsCOMPtr<nsIHTMLDocument> htmlDoc(do_QueryInterface(doc));
element->GetAttribute(NS_LITERAL_STRING("usemap"),mapElementName);
if (htmlDoc && !mapElementName.IsEmpty()) {
if (mapElementName.CharAt(0) == '#')
mapElementName.Cut(0,1);
htmlDoc->GetImageMap(mapElementName, getter_AddRefs(mMapElement));
}
}
}
NS_IMETHODIMP nsHTMLImageAccessible::GetAccState(PRUint32 *_retval)
{
// The state is a bitfield, get our inherited state, then logically OR it with STATE_ANIMATED if this
// is an animated image.
nsLinkableAccessible::GetAccState(_retval);
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
nsIFrame *frame = nsnull;
if (content && shell)
shell->GetPrimaryFrameFor(content, &frame);
nsCOMPtr<nsIImageFrame> imageFrame(do_QueryInterface(frame));
nsCOMPtr<imgIRequest> imageRequest;
if (imageFrame)
imageFrame->GetImageRequest(getter_AddRefs(imageRequest));
nsCOMPtr<imgIContainer> imgContainer;
if (imageRequest)
imageRequest->GetImage(getter_AddRefs(imgContainer));
if (imgContainer) {
PRUint32 numFrames;
imgContainer->GetNumFrames(&numFrames);
if (numFrames > 1)
*_retval |= STATE_ANIMATED;
}
return NS_OK;
}
/* wstring getAccName (); */
NS_IMETHODIMP nsHTMLImageAccessible::GetAccName(nsAWritableString& _retval)
{
nsresult rv = NS_ERROR_FAILURE;
nsCOMPtr<nsIContent> imageContent(do_QueryInterface(mDOMNode));
if (imageContent) {
nsAutoString name;
rv = AppendFlatStringFromContentNode(imageContent, &name);
if (NS_SUCCEEDED(rv)) {
// Temp var needed until CompressWhitespace built for nsAWritableString
name.CompressWhitespace();
_retval.Assign(name);
}
}
return rv;
}
/* wstring getAccRole (); */
NS_IMETHODIMP nsHTMLImageAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_GRAPHIC;
return NS_OK;
}
nsIAccessible *nsHTMLImageAccessible::CreateAreaAccessible(PRUint32 areaNum)
{
if (!mMapElement)
return nsnull;
if (areaNum == -1) {
PRInt32 numAreaMaps;
GetAccChildCount(&numAreaMaps);
if (numAreaMaps<=0)
return nsnull;
areaNum = NS_STATIC_CAST(PRUint32,numAreaMaps-1);
}
nsIDOMHTMLCollection *mapAreas;
mMapElement->GetAreas(&mapAreas);
if (!mapAreas)
return nsnull;
nsIDOMNode *domNode = nsnull;
mapAreas->Item(areaNum,&domNode);
if (!domNode)
return nsnull;
nsCOMPtr<nsIAccessibilityService> accService(do_GetService("@mozilla.org/accessibilityService;1"));
if (!accService)
return nsnull;
if (accService) {
nsIAccessible* acc = nsnull;
accService->CreateHTMLAreaAccessible(mPresShell, domNode, this, &acc);
return acc;
}
return nsnull;
}
/* nsIAccessible getAccFirstChild (); */
NS_IMETHODIMP nsHTMLImageAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = CreateAreaAccessible(0);
return NS_OK;
}
/* nsIAccessible getAccLastChild (); */
NS_IMETHODIMP nsHTMLImageAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = CreateAreaAccessible(-1);
return NS_OK;
}
/* long getAccChildCount (); */
NS_IMETHODIMP nsHTMLImageAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 0;
if (mMapElement) {
nsIDOMHTMLCollection *mapAreas;
mMapElement->GetAreas(&mapAreas);
if (mapAreas) {
PRUint32 length;
mapAreas->GetLength(&length);
*_retval = NS_STATIC_CAST(PRInt32, length);
}
}
return NS_OK;
}

View File

@@ -0,0 +1,71 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Aaron Leventhal (aaronl@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsHTMLImageAccessible_H_
#define _nsHTMLImageAccessible_H_
#include "nsAccessible.h"
#include "nsBaseWidgetAccessible.h"
#include "nsIFrame.h"
#include "nsIImageFrame.h"
#include "nsIDOMHTMLMapElement.h"
/* Accessible for supporting images
* supports:
* - gets name, role
* - support basic state
*/
class nsHTMLImageAccessible : public nsLinkableAccessible
{
public:
nsHTMLImageAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
protected:
nsIAccessible *CreateAreaAccessible(PRUint32 areaNum);
nsCOMPtr<nsIDOMHTMLMapElement> mMapElement;
};
#endif

View File

@@ -0,0 +1,79 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Aaron Leventhal (aaronl@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsHTMLLinkAccessible.h"
#include "nsWeakReference.h"
#include "nsIFrame.h"
#include "nsILink.h"
#include "nsILinkHandler.h"
#include "nsISelection.h"
#include "nsISelectionController.h"
#include "nsIPresContext.h"
#include "nsReadableUtils.h"
#include "nsIDOMElement.h"
nsHTMLLinkAccessible::nsHTMLLinkAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell):
nsLinkableAccessible(aDomNode, aShell)
{
}
/* wstring getAccName (); */
NS_IMETHODIMP nsHTMLLinkAccessible::GetAccName(nsAWritableString& _retval)
{
if (!IsALink()) // Also initializes private data members
return NS_ERROR_FAILURE;
nsAutoString name;
nsresult rv = AppendFlatStringFromSubtree(mLinkContent, &name);
if (NS_SUCCEEDED(rv)) {
// Temp var needed until CompressWhitespace built for nsAWritableString
name.CompressWhitespace();
_retval.Assign(name);
}
return rv;
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLLinkAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_LINK;
return NS_OK;
}

View File

@@ -0,0 +1,55 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Aaron Leventhal (aaronl@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsHTMLLinkAccessible_H_
#define _nsHTMLLinkAccessible_H_
#include "nsAccessible.h"
#include "nsBaseWidgetAccessible.h"
class nsHTMLLinkAccessible : public nsLinkableAccessible
{
public:
nsHTMLLinkAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
};
#endif

View File

@@ -0,0 +1,589 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Original Author: Eric Vaughan (evaughan@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsCOMPtr.h"
#include "nsHTMLSelectAccessible.h"
#include "nsIAccessibilityService.h"
#include "nsIFrame.h"
#include "nsIComboboxControlFrame.h"
#include "nsIDOMEventReceiver.h"
#include "nsIDOMHTMLCollection.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMHTMLOptionElement.h"
#include "nsIDOMHTMLSelectElement.h"
#include "nsIListControlFrame.h"
#include "nsIServiceManager.h"
#include "nsLayoutAtoms.h"
/**
* Selects, Listboxes and Comboboxes, are made up of a number of different
* widgets, some of which are shared between the two. This file contains
* all of the widgets for both of the Selects, for HTML only. Some of them
* extend classes from nsSelectAccessible.cpp, which contains base classes
* that are also extended by the XUL Select Accessibility support.
*
* Listbox:
* - nsHTMLListboxAccessible
* - nsHTMLSelctListAccessible
* - nsHTMLSelectOptionAccessible
*
* Comboboxes:
* - nsHTMLComboboxAccessilbe
* - nsHTMLComboboxTextFieldAccessible
* - nsHTMLComboboxButtonAccessible
* - nsHTMLComboboxWindowAccessilbe
* - nsHTMLSelctListAccessible
* - nsHTMLSelectOptionAccessible
*/
/** ------------------------------------------------------ */
/** First, the common widgets */
/** ------------------------------------------------------ */
/** ----- nsHTMLSelectListAccessible ----- */
/** Default Constructor */
nsHTMLSelectListAccessible::nsHTMLSelectListAccessible(nsIAccessible* aParent,
nsIDOMNode* aDOMNode,
nsIWeakReference* aShell)
:nsSelectListAccessible(aParent, aDOMNode, aShell)
{
}
/**
* As a nsHTMLSelectListAccessible we can have the following states:
* STATE_MULTISELECTABLE
* STATE_EXTSELECTABLE
*/
NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccState(PRUint32 *_retval)
{
nsCOMPtr<nsIDOMHTMLSelectElement> select (do_QueryInterface(mDOMNode));
if ( select ) {
PRBool multiple;
select->GetMultiple(&multiple);
if ( multiple )
*_retval |= STATE_MULTISELECTABLE | STATE_EXTSELECTABLE;
}
return NS_OK;
}
/**
* Gets the last child of the DOM node and creates and returns
* a nsHTMLSelectOptionAccessible.
*/
NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccLastChild(nsIAccessible **_retval)
{
nsCOMPtr<nsIDOMNode> last;
mDOMNode->GetLastChild(getter_AddRefs(last));
*_retval = new nsHTMLSelectOptionAccessible(this, last, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
/**
* Gets the First child of the DOM node and creates and returns
* a nsHTMLSelectOptionAccessible.
*/
NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
nsCOMPtr<nsIDOMNode> first;
mDOMNode->GetFirstChild(getter_AddRefs(first));
*_retval = new nsHTMLSelectOptionAccessible(this, first, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
/** ----- nsHTMLSelectOptionAccessible ----- */
/** Default Constructor */
nsHTMLSelectOptionAccessible::nsHTMLSelectOptionAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
nsSelectOptionAccessible(aParent, aDOMNode, aShell)
{
}
/**
* Gets the next sibling of the DOM node and creates and returns
* a nsHTMLSelectOptionAccessible.
*/
NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
nsCOMPtr<nsIDOMNode> next;
mDOMNode->GetNextSibling(getter_AddRefs(next));
if (next) {
*_retval = new nsHTMLSelectOptionAccessible(mParent, next, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
}
return NS_OK;
}
/**
* Gets the previous sibling of the DOM node and creates and returns
* a nsHTMLSelectOptionAccessible.
*/
NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
nsCOMPtr<nsIDOMNode> prev;
mDOMNode->GetPreviousSibling(getter_AddRefs(prev));
if (prev) {
*_retval = new nsHTMLSelectOptionAccessible(mParent, prev, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
}
return NS_OK;
}
/**
* As a nsHTMLSelectOptionAccessible we can have the following states:
* STATE_SELECTABLE
* STATE_SELECTED
* STATE_FOCUSED
* STATE_FOCUSABLE
* STATE_INVISIBLE -- not implemented yet
*/
NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccState(PRUint32 *_retval)
{
*_retval = 0;
nsCOMPtr<nsIDOMNode> focusedOptionNode, parentNode;
mParent->AccGetDOMNode(getter_AddRefs(parentNode));
// find out if we are the focused node
GetFocusedOptionNode(mPresShell, parentNode, focusedOptionNode);
if (focusedOptionNode == mDOMNode)
*_retval |= STATE_FOCUSED;
// Are we selected?
nsCOMPtr<nsIDOMHTMLOptionElement> option (do_QueryInterface(mDOMNode));
if ( option ) {
PRBool isSelected = PR_FALSE;
option->GetSelected(&isSelected);
if ( isSelected )
*_retval |= STATE_SELECTED;
}
*_retval |= STATE_SELECTABLE | STATE_FOCUSABLE;
return NS_OK;
}
/**
* Helper method for getting the focused DOM Node from our parent(list) node. We
* need to use the frame to get the focused option because for some reason we
* weren't getting the proper notification when the focus changed using the DOM
*/
nsresult nsHTMLSelectOptionAccessible::GetFocusedOptionNode(nsIWeakReference *aPresShell,
nsIDOMNode *aListNode,
nsCOMPtr<nsIDOMNode>& aFocusedOptionNode)
{
NS_ASSERTION(aListNode, "Called GetFocusedOptionNode without a valid list node");
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(aPresShell));
if (!shell)
return NS_ERROR_FAILURE;
nsIFrame *frame = nsnull;
nsCOMPtr<nsIContent> content(do_QueryInterface(aListNode));
shell->GetPrimaryFrameFor(content, &frame);
nsresult rv;
nsCOMPtr<nsIListControlFrame> listFrame(do_QueryInterface(frame, &rv));
if (NS_FAILED(rv))
return rv; // How can list content not have a list frame?
NS_ASSERTION(listFrame, "We don't have a list frame, but rv returned a success code.");
// Get what's focused by asking frame for "selected item".
PRInt32 focusedOptionIndex = 0;
rv = listFrame->GetSelectedIndex(&focusedOptionIndex);
nsCOMPtr<nsIDOMHTMLCollection> options;
// Get options
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIDOMHTMLSelectElement> selectElement(do_QueryInterface(aListNode));
NS_ASSERTION(selectElement, "No select element where it should be");
rv = selectElement->GetOptions(getter_AddRefs(options));
}
// Either use options and focused index, or default to list node itself
if (NS_SUCCEEDED(rv) && options && focusedOptionIndex >= 0) // Something is focused
rv = options->Item(focusedOptionIndex, getter_AddRefs(aFocusedOptionNode));
else { // If no options in list or focusedOptionIndex <0, then we are not focused on an item
aFocusedOptionNode = aListNode; // return normal target content
rv = NS_OK;
}
return rv;
}
/** ------------------------------------------------------ */
/** Secondly, the Listbox widget */
/** ------------------------------------------------------ */
/** ----- nsHTMLListboxAccessible ----- */
/** Constructor */
nsHTMLListboxAccessible::nsHTMLListboxAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
nsListboxAccessible(aDOMNode, aShell)
{
}
/** Inherit the ISupports impl from nsAccessible, we handle nsIAccessibleSelectable */
NS_IMPL_ISUPPORTS_INHERITED1(nsHTMLListboxAccessible, nsListboxAccessible, nsIAccessibleSelectable)
/**
* Our last (and only) child is an nsHTMLSelectListAccessible object
*/
NS_IMETHODIMP nsHTMLListboxAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = new nsHTMLSelectListAccessible(this, mDOMNode, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
/**
* Our first (and only) child is an nsHTMLSelectListAccessible object
*/
NS_IMETHODIMP nsHTMLListboxAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = new nsHTMLSelectListAccessible(this, mDOMNode, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
/**
* Our value is the value of our ( first ) selected child. nsIDOMHTMLSelectElement
* returns this by default with GetValue().
*/
NS_IMETHODIMP nsHTMLListboxAccessible::GetAccValue(nsAWritableString& _retval)
{
nsCOMPtr<nsIDOMHTMLSelectElement> select (do_QueryInterface(mDOMNode));
if ( select ) {
select->GetValue(_retval);
return NS_OK;
}
return NS_ERROR_FAILURE;
}
/**
* nsIAccessibleSelectable method.
* - gets from the Select DOMNode the list of all Select Options
* - iterates through all of the options looking for selected Options
* - creates IAccessible objects for selected Options
* - Returns the IAccessibles for selectd Options in the nsISupportsArray
*
* retval will be nsnull if:
* - there are no Options in the Select Element
* - there are Options but none are selected
* - the DOMNode is not a nsIDOMHTMLSelectElement ( shouldn't happen )
*/
NS_IMETHODIMP nsHTMLListboxAccessible::GetSelectedChildren(nsISupportsArray **_retval)
{
nsCOMPtr<nsIDOMHTMLSelectElement> select(do_QueryInterface(mDOMNode));
if(select) {
nsCOMPtr<nsIDOMHTMLCollection> options;
// get all the options in the select
select->GetOptions(getter_AddRefs(options));
if (options) {
// set up variables we need to get the selected options and to get their nsIAccessile objects
PRUint32 length;
options->GetLength(&length);
nsCOMPtr<nsIAccessibilityService> accService(do_GetService("@mozilla.org/accessibilityService;1"));
nsCOMPtr<nsISupportsArray> selectedAccessibles;
NS_NewISupportsArray(getter_AddRefs(selectedAccessibles));
if (!selectedAccessibles || !accService)
return NS_ERROR_FAILURE;
// find the selected options and get the accessible objects;
PRBool isSelected = PR_FALSE;
nsCOMPtr<nsIPresContext> context;
GetPresContext(context);
for (PRUint32 i = 0 ; i < length ; i++) {
nsCOMPtr<nsIDOMNode> tempNode;
options->Item(i,getter_AddRefs(tempNode));
if (tempNode) {
nsCOMPtr<nsIDOMHTMLOptionElement> tempOption(do_QueryInterface(tempNode));
if (tempOption)
tempOption->GetSelected(&isSelected);
if (isSelected) {
nsCOMPtr<nsIAccessible> tempAccess;
accService->CreateHTMLSelectOptionAccessible(tempOption, this, context, getter_AddRefs(tempAccess));
if ( tempAccess )
selectedAccessibles->AppendElement(tempAccess);
isSelected = PR_FALSE;
}
}
}
selectedAccessibles->Count(&length); // reusing length
if ( length != 0 ) { // length of nsISupportsArray containing selected options
*_retval = selectedAccessibles;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
}
}
// no options, not a select or none of the options are selected
*_retval = nsnull;
return NS_OK;
}
/** ------------------------------------------------------ */
/** Finally, the Combobox widgets */
/** ------------------------------------------------------ */
/** ----- nsHTMLComboboxAccessible ----- */
/** Constructor */
nsHTMLComboboxAccessible::nsHTMLComboboxAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
nsComboboxAccessible(aDOMNode, aShell)
{
}
/**
* Our last child is an nsHTMLComboboxWindowAccessible object
*/
NS_IMETHODIMP nsHTMLComboboxAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = new nsHTMLComboboxWindowAccessible(this, mDOMNode, mPresShell);
if (! *_retval)
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
/**
* Our last child is an nsHTMLComboboxTextFieldAccessible object
*/
NS_IMETHODIMP nsHTMLComboboxAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = new nsHTMLComboboxTextFieldAccessible(this, mDOMNode, mPresShell);
if (! *_retval)
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
/**
* Our value is the value of our ( first ) selected child. nsIDOMHTMLSelectElement
* returns this by default with GetValue().
*/
NS_IMETHODIMP nsHTMLComboboxAccessible::GetAccValue(nsAWritableString& _retval)
{
nsCOMPtr<nsIDOMHTMLSelectElement> select (do_QueryInterface(mDOMNode));
if (select) {
select->GetValue(_retval);
return NS_OK;
}
return NS_ERROR_FAILURE;
}
/** ----- nsHTMLComboboxTextFieldAccessible ----- */
/** Constructor */
nsHTMLComboboxTextFieldAccessible::nsHTMLComboboxTextFieldAccessible(nsIAccessible* aParent,
nsIDOMNode* aDOMNode,
nsIWeakReference* aShell):
nsComboboxTextFieldAccessible(aParent, aDOMNode, aShell)
{
}
/**
* Our next sibling is an nsHTMLComboboxButtonAccessible object
*/
NS_IMETHODIMP nsHTMLComboboxTextFieldAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
nsCOMPtr<nsIAccessible> parent;
GetAccParent(getter_AddRefs(parent));
*_retval = new nsHTMLComboboxButtonAccessible(parent, mDOMNode, mPresShell);
if (! *_retval)
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
/** -----ComboboxButtonAccessible ----- */
/** Constructor -- cache our parent */
nsHTMLComboboxButtonAccessible::nsHTMLComboboxButtonAccessible(nsIAccessible* aParent,
nsIDOMNode* aDOMNode,
nsIWeakReference* aShell):
nsComboboxButtonAccessible(aParent, aDOMNode, aShell)
{
}
/**
* Programmaticaly click on the button, causing either the display or
* the hiding of the drop down box ( window ).
* Walks the Frame tree and checks for proper frames.
*/
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::AccDoAction(PRUint8 index)
{
nsIFrame* frame = nsAccessible::GetBoundsFrame();
nsCOMPtr<nsIPresContext> context;
GetPresContext(context);
if (!context)
return NS_ERROR_FAILURE;
frame->FirstChild(context, nsnull, &frame);
#ifdef DEBUG
if (! nsAccessible::IsCorrectFrameType(frame, nsLayoutAtoms::blockFrame))
return NS_ERROR_FAILURE;
#endif
frame->GetNextSibling(&frame);
#ifdef DEBUG
if (! nsAccessible::IsCorrectFrameType(frame, nsLayoutAtoms::gfxButtonControlFrame))
return NS_ERROR_FAILURE;
#endif
nsCOMPtr<nsIContent> content;
frame->GetContent(getter_AddRefs(content));
// We only have one action, click. Any other index is meaningless(wrong)
if (index == eAction_Click) {
nsCOMPtr<nsIDOMHTMLInputElement> element(do_QueryInterface(content));
if (element)
{
element->Click();
return NS_OK;
}
return NS_ERROR_FAILURE;
}
return NS_ERROR_INVALID_ARG;
}
/**
* Our next sibling is an nsHTMLComboboxWindowAccessible object
*/
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
nsCOMPtr<nsIAccessible> parent;
GetAccParent(getter_AddRefs(parent));
*_retval = new nsHTMLComboboxWindowAccessible(parent, mDOMNode, mPresShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
/**
* Our next sibling is an nsHTMLComboboxTextFieldAccessible object
*/
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
nsCOMPtr<nsIAccessible> parent;
GetAccParent(getter_AddRefs(parent));
*_retval = new nsHTMLComboboxTextFieldAccessible(parent, mDOMNode, mPresShell);
if (! *_retval)
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
/** ----- nsHTMLComboboxWindowAccessible ----- */
/**
* Constructor -- cache our parent
*/
nsHTMLComboboxWindowAccessible::nsHTMLComboboxWindowAccessible(nsIAccessible* aParent,
nsIDOMNode* aDOMNode,
nsIWeakReference* aShell):
nsComboboxWindowAccessible(aParent, aDOMNode, aShell)
{
}
/**
* Our previous sibling is a nsHTMLComboboxButtonAccessible object
*/
NS_IMETHODIMP nsHTMLComboboxWindowAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
nsCOMPtr<nsIAccessible> parent;
GetAccParent(getter_AddRefs(parent));
*_retval = new nsHTMLComboboxButtonAccessible(parent, mDOMNode, mPresShell);
if (! *_retval)
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
/**
* We only have one child, a list
*/
NS_IMETHODIMP nsHTMLComboboxWindowAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = new nsHTMLSelectListAccessible(this, mDOMNode, mPresShell);
if (! *_retval)
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
/**
* We only have one child, a list
*/
NS_IMETHODIMP nsHTMLComboboxWindowAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = new nsHTMLSelectListAccessible(this, mDOMNode, mPresShell);
if (! *_retval)
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}

View File

@@ -0,0 +1,209 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Original Author: Eric Vaughan (evaughan@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __nsHTMLSelectAccessible_h__
#define __nsHTMLSelectAccessible_h__
#include "nsCOMPtr.h"
#include "nsIAccessibleSelectable.h"
#include "nsIDOMNode.h"
#include "nsIWeakReference.h"
#include "nsSelectAccessible.h"
/**
* Selects, Listboxes and Comboboxes, are made up of a number of different
* widgets, some of which are shared between the two. This file contains
* all of the widgets for both of the Selects, for HTML only. Some of them
* extend classes from nsSelectAccessible.cpp, which contains base classes
* that are also extended by the XUL Select Accessibility support.
*
* Listbox:
* - nsHTMLListboxAccessible
* - nsHTMLSelctListAccessible
* - nsHTMLSelectOptionAccessible
*
* Comboboxes:
* - nsHTMLComboboxAccessilbe
* - nsHTMLComboboxTextFieldAccessible
* - nsHTMLComboboxButtonAccessible
* - nsHTMLComboboxWindowAccessilbe
* - nsHTMLSelectListAccessible
* - nsHTMLSelectOptionAccessible(s)
*/
/** ------------------------------------------------------ */
/** First, the common widgets */
/** ------------------------------------------------------ */
/*
* The list that contains all the options in the select.
*/
class nsHTMLSelectListAccessible : public nsSelectListAccessible
{
public:
nsHTMLSelectListAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLSelectListAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccState(PRUint32 *_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
};
/*
* Options inside the select, contained within the list
*/
class nsHTMLSelectOptionAccessible : public nsSelectOptionAccessible
{
public:
nsHTMLSelectOptionAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLSelectOptionAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccState(PRUint32 *_retval);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
static nsresult GetFocusedOptionNode(nsIWeakReference *aPresShell, nsIDOMNode *aListNode, nsCOMPtr<nsIDOMNode>& aFocusedOptionNode);
};
/** ------------------------------------------------------ */
/** Secondly, the Listbox widget */
/** ------------------------------------------------------ */
/*
* A class the represents the HTML Listbox widget.
*/
class nsHTMLListboxAccessible : public nsListboxAccessible,
public nsIAccessibleSelectable
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIACCESSIBLESELECTABLE
nsHTMLListboxAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLListboxAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccValue(nsAWritableString& _retval);
};
/** ------------------------------------------------------ */
/** Finally, the Combobox widgets */
/** ------------------------------------------------------ */
/*
* A class the represents the HTML Combobox widget.
*/
class nsHTMLComboboxAccessible : public nsComboboxAccessible
{
public:
nsHTMLComboboxAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLComboboxAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccValue(nsAWritableString& _retval);
};
/*
* A class the represents the text field in the Select to the left
* of the drop down button
*/
class nsHTMLComboboxTextFieldAccessible : public nsComboboxTextFieldAccessible
{
public:
nsHTMLComboboxTextFieldAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLComboboxTextFieldAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
};
/**
* A class that represents the button inside the Select to the
* right of the text field
*/
class nsHTMLComboboxButtonAccessible : public nsComboboxButtonAccessible
{
public:
nsHTMLComboboxButtonAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLComboboxButtonAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD AccDoAction(PRUint8 index);
};
/*
* A class that represents the window that lives to the right
* of the drop down button inside the Select. This is the window
* that is made visible when the button is pressed.
*/
class nsHTMLComboboxWindowAccessible : public nsComboboxWindowAccessible
{
public:
nsHTMLComboboxWindowAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLComboboxWindowAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
};
#endif

View File

@@ -0,0 +1,67 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Aaron Leventhal (aaronl@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsHTMLTableAccessible.h"
#include "nsWeakReference.h"
#include "nsReadableUtils.h"
nsHTMLTableCellAccessible::nsHTMLTableCellAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell):
nsBlockAccessible(aDomNode, aShell)
{
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLTableCellAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_CELL;
return NS_OK;
}
nsHTMLTableAccessible::nsHTMLTableAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell):
nsBlockAccessible(aDomNode, aShell)
{
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLTableAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_TABLE;
return NS_OK;
}

View File

@@ -0,0 +1,61 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Aaron Leventhal (aaronl@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsHTMLTableAccessible_H_
#define _nsHTMLTableAccessible_H_
#include "nsAccessible.h"
#include "nsBaseWidgetAccessible.h"
class nsHTMLTableCellAccessible : public nsBlockAccessible
{
public:
nsHTMLTableCellAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
};
class nsHTMLTableAccessible : public nsBlockAccessible
{
public:
nsHTMLTableAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
};
#endif

View File

@@ -0,0 +1,51 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: Eric Vaughan (evaughan@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsHTMLTextAccessible.h"
nsHTMLTextAccessible::nsHTMLTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell):
nsTextAccessible(aDomNode, aShell)
{
}
/* wstring getAccName (); */
NS_IMETHODIMP nsHTMLTextAccessible::GetAccName(nsAWritableString& _retval)
{
return mDOMNode->GetNodeValue(_retval);
}

View File

@@ -0,0 +1,54 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsHTMLTextAccessible_H_
#define _nsHTMLTextAccessible_H_
#include "nsFormControlAccessible.h"
class nsIWeakReference;
class nsHTMLTextAccessible : public nsTextAccessible
{
public:
nsHTMLTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
};
#endif

View File

@@ -0,0 +1,587 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsIAccessible.h"
#include "nsRootAccessible.h"
#include "nsCOMPtr.h"
#include "nsIDocument.h"
#include "nsIDOMNSDocument.h"
#include "nsIPresShell.h"
#include "nsIPresContext.h"
#include "nsIContent.h"
#include "nsIFrame.h"
#include "nsIDOMEventTarget.h"
#include "nsIDOMElement.h"
#include "nsIDOMEventReceiver.h"
#include "nsIDOMEventListener.h"
#include "nsReadableUtils.h"
#include "nsILink.h"
#include "nsHTMLFormControlAccessible.h"
#include "nsHTMLLinkAccessible.h"
#include "nsIURI.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsIWebNavigation.h"
#include "nsIXULDocument.h"
#include "nsIDOMDocument.h"
#include "nsIDOMDocumentType.h"
#include "nsINameSpaceManager.h"
#include "nsIDOMNSHTMLSelectElement.h"
#include "nsIAccessibleSelectable.h"
#include "nsLayoutAtoms.h"
#include "nsString.h"
#include "nsXPIDLString.h"
#include "nsIAccessibilityService.h"
#include "nsIServiceManager.h"
#include "nsHTMLSelectAccessible.h"
#include "nsIDOMHTMLSelectElement.h"
#include "nsIWebProgress.h"
#include "nsCURILoader.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIScriptGlobalObject.h"
NS_INTERFACE_MAP_BEGIN(nsRootAccessible)
NS_INTERFACE_MAP_ENTRY(nsIAccessibleDocument)
NS_INTERFACE_MAP_ENTRY(nsIAccessibleEventReceiver)
NS_INTERFACE_MAP_ENTRY(nsIDOMFocusListener)
NS_INTERFACE_MAP_ENTRY(nsIDOMFormListener)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMFormListener)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMEventListener, nsIDOMFormListener)
NS_INTERFACE_MAP_END_INHERITING(nsAccessible)
NS_IMPL_ADDREF_INHERITED(nsRootAccessible, nsAccessible);
NS_IMPL_RELEASE_INHERITED(nsRootAccessible, nsAccessible);
//-----------------------------------------------------
// construction
//-----------------------------------------------------
nsRootAccessible::nsRootAccessible(nsIWeakReference* aShell):nsAccessible(nsnull,aShell),
nsDocAccessibleMixin(aShell), mAccService(do_GetService("@mozilla.org/accessibilityService;1")),
mBusy(eBusyStateUninitialized)
{
mListener = nsnull;
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
if (shell) {
shell->GetDocument(getter_AddRefs(mDocument));
mDOMNode = do_QueryInterface(mDocument);
nsLayoutAtoms::AddRefAtoms();
}
}
//-----------------------------------------------------
// destruction
//-----------------------------------------------------
nsRootAccessible::~nsRootAccessible()
{
nsLayoutAtoms::ReleaseAtoms();
RemoveAccessibleEventListener();
}
/* attribute wstring accName; */
NS_IMETHODIMP nsRootAccessible::GetAccName(nsAWritableString& aAccName)
{
return GetTitle(aAccName);
}
// helpers
nsIFrame* nsRootAccessible::GetFrame()
{
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
nsIFrame* root = nsnull;
if (shell)
shell->GetRootFrame(&root);
return root;
}
void nsRootAccessible::GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame)
{
*aRelativeFrame = GetFrame();
(*aRelativeFrame)->GetRect(aBounds);
}
/* readonly attribute nsIAccessible accParent; */
NS_IMETHODIMP nsRootAccessible::GetAccParent(nsIAccessible * *aAccParent)
{
*aAccParent = nsnull;
return NS_OK;
}
/* readonly attribute unsigned long accRole; */
NS_IMETHODIMP nsRootAccessible::GetAccRole(PRUint32 *aAccRole)
{
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
if (!shell) {
*aAccRole = 0;
return NS_ERROR_FAILURE;
}
/*
// Commenting this out for now.
// It was requested that we always use pane objects instead of client objects.
// However, it might be asked that we put client objects back.
nsCOMPtr<nsIPresContext> context;
shell->GetPresContext(getter_AddRefs(context));
nsCOMPtr<nsISupports> container;
context->GetContainer(getter_AddRefs(container));
if (container) {
nsCOMPtr<nsIDocShellTreeItem> parentTreeItem, docTreeItem(do_QueryInterface(container));
if (docTreeItem) {
docTreeItem->GetSameTypeParent(getter_AddRefs(parentTreeItem));
// Basically, if this docshell has a parent of the same type, it's a frame
if (parentTreeItem) {
*aAccRole = ROLE_PANE;
return NS_OK;
}
}
}
*aAccRole = ROLE_CLIENT;
*/
*aAccRole = ROLE_PANE;
return NS_OK;
}
NS_IMETHODIMP nsRootAccessible::GetAccState(PRUint32 *aAccState)
{
*aAccState = STATE_FOCUSABLE;
if (mBusy == eBusyStateLoading)
*aAccState |= STATE_BUSY;
return NS_OK;
}
NS_IMETHODIMP nsRootAccessible::GetAccValue(nsAWritableString& aAccValue)
{
return GetURL(aAccValue);
}
void nsRootAccessible::Notify(nsITimer *timer)
{
// Short timer is finished
if (mBusy != eBusyStateDone) {
mBusy = eBusyStateDone;
if (mListener)
mListener->HandleEvent(nsIAccessibleEventListener::EVENT_STATE_CHANGE, this);
}
}
NS_IMETHODIMP nsRootAccessible::StartDocReadyTimer()
{
nsresult rv;
if (!mTimer) {
mTimer = do_CreateInstance("@mozilla.org/timer;1", &rv);
if (NS_SUCCEEDED(rv)) {
const PRUint32 kUpdateTimerDelay = 1;
rv = mTimer->Init(NS_STATIC_CAST(nsITimerCallback*, this), kUpdateTimerDelay);
}
}
return rv;
}
/* void addAccessibleEventListener (in nsIAccessibleEventListener aListener); */
NS_IMETHODIMP nsRootAccessible::AddAccessibleEventListener(nsIAccessibleEventListener *aListener)
{
if (mListener)
return NS_OK;
mListener = aListener;
// add an event listener to the document
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
if (!shell)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIDocument> document;
shell->GetDocument(getter_AddRefs(document));
if (!document)
return NS_ERROR_FAILURE;
// use AddEventListener from the nsIDOMEventTarget interface
nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(document));
if (target) {
// capture DOM focus events
nsresult rv = target->AddEventListener(NS_LITERAL_STRING("focus"), NS_STATIC_CAST(nsIDOMFocusListener*, this), PR_TRUE);
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to register listener");
rv = target->AddEventListener(NS_LITERAL_STRING("blur"), NS_STATIC_CAST(nsIDOMFocusListener*, this), PR_TRUE);
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to register listener");
// capture Form change events
rv = target->AddEventListener(NS_LITERAL_STRING("change"), NS_STATIC_CAST(nsIDOMFormListener*, this), PR_TRUE);
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to register listener");
// add ourself as a CheckboxStateChange listener (custom event fired in nsHTMLInputElement.cpp)
rv = target->AddEventListener(NS_LITERAL_STRING("CheckboxStateChange"), NS_STATIC_CAST(nsIDOMFormListener*, this), PR_TRUE);
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to register listener");
// add ourself as a RadiobuttonStateChange listener (custom event fired in nsHTMLInputElement.cpp)
rv = target->AddEventListener(NS_LITERAL_STRING("RadiobuttonStateChange"), NS_STATIC_CAST(nsIDOMFormListener*, this), PR_TRUE);
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to register listener");
// Extremely short timer, after which we announce that pane is finished loading
// By waiting until after this short time, we know that the 3rd party accessibility software
// has received it's accessible, and can handle events on it.
StartDocReadyTimer();
}
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mPresShell));
if (presShell) {
nsCOMPtr<nsIPresContext> context;
presShell->GetPresContext(getter_AddRefs(context));
if (context) {
nsCOMPtr<nsISupports> container;
context->GetContainer(getter_AddRefs(container));
if (container) {
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(container));
if (docShell) {
nsCOMPtr<nsIWebProgress> webProgress(do_GetInterface(docShell));
if (webProgress) {
webProgress->AddProgressListener(this);
}
}
}
}
}
return NS_OK;
}
/* void removeAccessibleEventListener (); */
NS_IMETHODIMP nsRootAccessible::RemoveAccessibleEventListener()
{
if (mListener) {
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
nsCOMPtr<nsIDocument> document;
if (shell) {
shell->GetDocument(getter_AddRefs(document));
nsCOMPtr<nsIDOMEventReceiver> eventReceiver(do_QueryInterface(document));
if (eventReceiver) {
nsresult rv = eventReceiver->RemoveEventListenerByIID(NS_STATIC_CAST(nsIDOMFocusListener *, this), NS_GET_IID(nsIDOMFocusListener));
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to unregister listener");
rv = eventReceiver->RemoveEventListenerByIID(NS_STATIC_CAST(nsIDOMFormListener *, this), NS_GET_IID(nsIDOMFormListener));
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to unregister listener");
}
}
}
mListener = nsnull;
return NS_OK;
}
// --------------- nsIDOMEventListener Methods (3) ------------------------
NS_IMETHODIMP nsRootAccessible::HandleEvent(nsIDOMEvent* aEvent)
{
if (mListener) {
// optionTargetNode is set to current option for HTML selects
nsCOMPtr<nsIDOMNode> targetNode, optionTargetNode;
nsresult rv = GetTargetNode(aEvent, targetNode);
if (NS_FAILED(rv))
return rv;
// Check to see if it's a select element. If so, need the currently focused option
nsCOMPtr<nsIDOMHTMLSelectElement> selectElement(do_QueryInterface(targetNode));
if (selectElement) // ----- Target Node is an HTML <select> element ------
nsHTMLSelectOptionAccessible::GetFocusedOptionNode(mPresShell, targetNode, optionTargetNode);
nsAutoString eventType;
aEvent->GetType(eventType);
nsCOMPtr<nsIAccessible> accessible;
if (NS_SUCCEEDED(mAccService->GetAccessibleFor(targetNode, getter_AddRefs(accessible)))) {
if (eventType.EqualsIgnoreCase("focus")) {
if (mCurrentFocus != targetNode) {
mListener->HandleEvent(nsIAccessibleEventListener::EVENT_FOCUS, accessible);
mCurrentFocus = targetNode;
}
}
else if (eventType.EqualsIgnoreCase("change")) {
if (optionTargetNode) { // Set to current option only for HTML selects
mListener->HandleEvent(nsIAccessibleEventListener::EVENT_SELECTION, accessible);
if (mCurrentFocus != optionTargetNode &&
NS_SUCCEEDED(mAccService->GetAccessibleFor(optionTargetNode, getter_AddRefs(accessible)))) {
mListener->HandleEvent(nsIAccessibleEventListener::EVENT_FOCUS, accessible);
mCurrentFocus = optionTargetNode;
}
}
else
mListener->HandleEvent(nsIAccessibleEventListener::EVENT_STATE_CHANGE, accessible);
}
else if (eventType.EqualsIgnoreCase("CheckboxStateChange"))
mListener->HandleEvent(nsIAccessibleEventListener::EVENT_STATE_CHANGE, accessible);
else if (eventType.EqualsIgnoreCase("RadiobuttonStateChange"))
mListener->HandleEvent(nsIAccessibleEventListener::EVENT_STATE_CHANGE, accessible);
}
}
return NS_OK;
}
NS_IMETHODIMP nsRootAccessible::GetTargetNode(nsIDOMEvent *aEvent, nsCOMPtr<nsIDOMNode>& aTargetNode)
{
nsCOMPtr<nsIDOMEventTarget> domEventTarget;
aEvent->GetOriginalTarget(getter_AddRefs(domEventTarget));
nsresult rv;
aTargetNode = do_QueryInterface(domEventTarget, &rv);
return rv;
}
// ------- nsIDOMFocusListener Methods (1) -------------
NS_IMETHODIMP nsRootAccessible::Focus(nsIDOMEvent* aEvent)
{
return HandleEvent(aEvent);
}
NS_IMETHODIMP nsRootAccessible::Blur(nsIDOMEvent* aEvent) { return NS_OK; }
// ------- nsIDOMFormListener Methods (5) -------------
NS_IMETHODIMP nsRootAccessible::Submit(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHODIMP nsRootAccessible::Reset(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHODIMP nsRootAccessible::Change(nsIDOMEvent* aEvent)
{
// get change events when the form elements changes its state, checked->not,
// deleted text, new text, change in selection for list/combo boxes
// this may be the event that we have the individual Accessible objects
// handle themselves -- have list/combos figure out the change in selection
// have textareas and inputs fire a change of state etc...
return HandleEvent(aEvent);
}
// gets Select events when text is selected in a textarea or input
NS_IMETHODIMP nsRootAccessible::Select(nsIDOMEvent* aEvent) { return NS_OK; }
// gets Input events when text is entered or deleted in a textarea or input
NS_IMETHODIMP nsRootAccessible::Input(nsIDOMEvent* aEvent) { return NS_OK; }
// ------- nsIAccessibleDocument Methods (5) ---------------
NS_IMETHODIMP nsRootAccessible::GetURL(nsAWritableString& aURL)
{
return nsDocAccessibleMixin::GetURL(aURL);
}
NS_IMETHODIMP nsRootAccessible::GetTitle(nsAWritableString& aTitle)
{
return nsDocAccessibleMixin::GetTitle(aTitle);
}
NS_IMETHODIMP nsRootAccessible::GetMimeType(nsAWritableString& aMimeType)
{
return nsDocAccessibleMixin::GetMimeType(aMimeType);
}
NS_IMETHODIMP nsRootAccessible::GetDocType(nsAWritableString& aDocType)
{
return nsDocAccessibleMixin::GetDocType(aDocType);
}
NS_IMETHODIMP nsRootAccessible::GetNameSpaceURIForID(PRInt16 aNameSpaceID, nsAWritableString& aNameSpaceURI)
{
return nsDocAccessibleMixin::GetNameSpaceURIForID(aNameSpaceID, aNameSpaceURI);
}
NS_IMETHODIMP nsRootAccessible::GetDocument(nsIDocument **doc)
{
return nsDocAccessibleMixin::GetDocument(doc);
}
NS_IMETHODIMP nsRootAccessible::OnStateChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus)
{
return NS_OK;
}
/* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */
NS_IMETHODIMP nsRootAccessible::OnProgressChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress,
PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress)
{
return NS_OK;
}
/* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location); */
NS_IMETHODIMP nsRootAccessible::OnLocationChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, nsIURI *location)
{
// Load has been verified, it will occur, about to commence
if (mListener && mBusy != eBusyStateLoading) {
mBusy = eBusyStateLoading;
mListener->HandleEvent(nsIAccessibleEventListener::EVENT_STATE_CHANGE, this);
StartDocReadyTimer();
}
return NS_OK;
}
/* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
NS_IMETHODIMP nsRootAccessible::OnStatusChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage)
{
return NS_OK;
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
NS_IMETHODIMP nsRootAccessible::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, PRInt32 state)
{
return NS_OK;
}
nsDocAccessibleMixin::nsDocAccessibleMixin(nsIDocument *aDoc):mDocument(aDoc)
{
}
nsDocAccessibleMixin::nsDocAccessibleMixin(nsIWeakReference *aPresShell)
{
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(aPresShell));
if (shell)
shell->GetDocument(getter_AddRefs(mDocument));
}
nsDocAccessibleMixin::~nsDocAccessibleMixin()
{
}
NS_IMETHODIMP nsDocAccessibleMixin::GetURL(nsAWritableString& aURL)
{
nsCOMPtr<nsIPresShell> presShell;
mDocument->GetShellAt(0, getter_AddRefs(presShell));
NS_ASSERTION(presShell,"Shell is gone!!! What are we doing here?");
nsCOMPtr<nsIDocShell> docShell;
GetDocShellFromPS(presShell, getter_AddRefs(docShell));
nsCOMPtr<nsIWebNavigation> webNav(do_GetInterface(docShell));
nsXPIDLCString theURL;
if (webNav) {
nsCOMPtr<nsIURI> pURI;
webNav->GetCurrentURI(getter_AddRefs(pURI));
if (pURI)
pURI->GetSpec(getter_Copies(theURL));
}
//XXXaaronl Need to use CopyUTF8toUCS2(nsDependentCString(theURL), aURL); when it's written
aURL.Assign(NS_ConvertUTF8toUCS2(theURL).get());
return NS_OK;
}
NS_IMETHODIMP nsDocAccessibleMixin::GetTitle(nsAWritableString& aTitle)
{
// This doesn't leak - we don't own the const pointer that's returned
aTitle = *(mDocument->GetDocumentTitle());
return NS_OK;
}
NS_IMETHODIMP nsDocAccessibleMixin::GetMimeType(nsAWritableString& aMimeType)
{
nsCOMPtr<nsIDOMNSDocument> domnsDocument(do_QueryInterface(mDocument));
if (domnsDocument) {
return domnsDocument->GetContentType(aMimeType);
}
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsDocAccessibleMixin::GetDocType(nsAWritableString& aDocType)
{
nsCOMPtr<nsIXULDocument> xulDoc(do_QueryInterface(mDocument));
nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(mDocument));
nsCOMPtr<nsIDOMDocumentType> docType;
if (xulDoc) {
aDocType = NS_LITERAL_STRING("window"); // doctype not implemented for XUL at time of writing - causes assertion
return NS_OK;
}
else if (domDoc && NS_SUCCEEDED(domDoc->GetDoctype(getter_AddRefs(docType))) && docType) {
return docType->GetName(aDocType);
}
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsDocAccessibleMixin::GetNameSpaceURIForID(PRInt16 aNameSpaceID, nsAWritableString& aNameSpaceURI)
{
if (mDocument) {
nsCOMPtr<nsINameSpaceManager> nameSpaceManager;
if (NS_SUCCEEDED(mDocument->GetNameSpaceManager(*getter_AddRefs(nameSpaceManager))))
return nameSpaceManager->GetNameSpaceURI(aNameSpaceID, aNameSpaceURI);
}
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsDocAccessibleMixin::GetDocument(nsIDocument **doc)
{
*doc = mDocument;
if (mDocument) {
NS_IF_ADDREF(*doc);
return NS_OK;
}
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsDocAccessibleMixin::GetDocShellFromPS(nsIPresShell* aPresShell, nsIDocShell** aDocShell)
{
*aDocShell = nsnull;
if (aPresShell) {
nsCOMPtr<nsIDocument> doc;
aPresShell->GetDocument(getter_AddRefs(doc));
if (doc) {
nsCOMPtr<nsIScriptGlobalObject> scriptObj;
doc->GetScriptGlobalObject(getter_AddRefs(scriptObj));
if (scriptObj) {
scriptObj->GetDocShell(aDocShell);
if (*aDocShell)
return NS_OK;
}
}
}
return NS_ERROR_FAILURE;
}

View File

@@ -0,0 +1,140 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsRootAccessible_H_
#define _nsRootAccessible_H_
#include "nsAccessible.h"
#include "nsIAccessibleEventReceiver.h"
#include "nsIAccessibleEventListener.h"
#include "nsIAccessibleDocument.h"
#include "nsIDOMFormListener.h"
#include "nsIDOMFocusListener.h"
#include "nsIDocument.h"
#include "nsIAccessibilityService.h"
#include "nsIWebProgressListener.h"
#include "nsIWeakReference.h"
#include "nsITimer.h"
#include "nsITimerCallback.h"
class nsDocAccessibleMixin
{
public:
nsDocAccessibleMixin(nsIDocument *doc);
nsDocAccessibleMixin(nsIWeakReference *aShell);
virtual ~nsDocAccessibleMixin();
NS_DECL_NSIACCESSIBLEDOCUMENT
protected:
NS_IMETHOD GetDocShellFromPS(nsIPresShell* aPresShell, nsIDocShell** aDocShell);
PRBool mTopLevelDocument;
nsCOMPtr<nsIDocument> mDocument;
};
class nsRootAccessible : public nsAccessible,
public nsDocAccessibleMixin,
public nsIAccessibleDocument,
public nsIAccessibleEventReceiver,
public nsIDOMFocusListener,
public nsIDOMFormListener,
public nsIWebProgressListener,
public nsITimerCallback,
public nsSupportsWeakReference
{
NS_DECL_ISUPPORTS_INHERITED
public:
enum EBusyState {eBusyStateUninitialized, eBusyStateLoading, eBusyStateDone};
nsRootAccessible(nsIWeakReference* aShell);
virtual ~nsRootAccessible();
/* attribute wstring accName; */
NS_IMETHOD GetAccName(nsAWritableString& aAccName);
NS_IMETHOD GetAccValue(nsAWritableString& aAccValue);
NS_IMETHOD GetAccParent(nsIAccessible * *aAccParent);
NS_IMETHOD GetAccRole(PRUint32 *aAccRole);
NS_IMETHOD GetAccState(PRUint32 *aAccState);
// ----- nsIAccessibleEventReceiver -------------------
NS_IMETHOD AddAccessibleEventListener(nsIAccessibleEventListener *aListener);
NS_IMETHOD RemoveAccessibleEventListener();
// ----- nsIDOMEventListener --------------------------
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent);
// ----- nsIDOMFocusListener --------------------------
NS_IMETHOD Focus(nsIDOMEvent* aEvent);
NS_IMETHOD Blur(nsIDOMEvent* aEvent);
// ----- nsIDOMFormListener ---------------------------
NS_IMETHOD Submit(nsIDOMEvent* aEvent);
NS_IMETHOD Reset(nsIDOMEvent* aEvent);
NS_IMETHOD Change(nsIDOMEvent* aEvent);
NS_IMETHOD Select(nsIDOMEvent* aEvent);
NS_IMETHOD Input(nsIDOMEvent* aEvent);
NS_IMETHOD_(void) Notify(nsITimer *timer);
NS_IMETHOD StartDocReadyTimer();
NS_DECL_NSIACCESSIBLEDOCUMENT
NS_DECL_NSIWEBPROGRESSLISTENER
protected:
NS_IMETHOD GetTargetNode(nsIDOMEvent *aEvent, nsCOMPtr<nsIDOMNode>& aTargetNode);
virtual void GetBounds(nsRect& aRect, nsIFrame** aRelativeFrame);
virtual nsIFrame* GetFrame();
// mListener is not a com pointer. We don't own the listener
// it is the callers responsibility to remove the listener
// otherwise we will get into circular referencing problems
// We don't need a weak reference, because we're owned by this listener
nsIAccessibleEventListener *mListener;
nsCOMPtr<nsITimer> mTimer;
nsCOMPtr<nsIDOMNode> mCurrentFocus;
nsCOMPtr<nsIAccessibilityService> mAccService;
EBusyState mBusy;
};
#endif

View File

@@ -0,0 +1,680 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Original Author: Eric Vaughan (evaughan@netscape.com)
* Contributor(s): John Gaunt (jgaunt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsCOMPtr.h"
#include "nsFormControlAccessible.h"
#include "nsIAtom.h"
#include "nsIComboboxControlFrame.h"
#include "nsIDOMEventReceiver.h"
#include "nsIDOMHTMLCollection.h"
#include "nsIDOMHTMLOptionElement.h"
#include "nsIDOMHTMLSelectElement.h"
#include "nsIFrame.h"
#include "nsIListControlFrame.h"
#include "nsISelectControlFrame.h"
#include "nsLayoutAtoms.h"
#include "nsRootAccessible.h"
#include "nsSelectAccessible.h"
/** ------------------------------------------------------ */
/** First, the common widgets */
/** ------------------------------------------------------ */
/** Constructor -- cache our parent */
nsSelectListAccessible::nsSelectListAccessible(nsIAccessible* aParent,
nsIDOMNode* aDOMNode,
nsIWeakReference* aShell)
:nsAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
/** Return our parents bounds */
NS_IMETHODIMP nsSelectListAccessible::AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height)
{
return mParent->AccGetBounds(x,y,width,height);
}
/** Return our cached parent */
NS_IMETHODIMP nsSelectListAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_ADDREF(*_retval);
return NS_OK;
}
/** We are a list */
NS_IMETHODIMP nsSelectListAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_LIST;
return NS_OK;
}
/** We are an only child */
NS_IMETHODIMP nsSelectListAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/** We are an only child */
NS_IMETHODIMP nsSelectListAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
* nsSelectOptionAccessible
*/
/** Constructor -- cache our parent */
nsSelectOptionAccessible::nsSelectOptionAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
nsLeafAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
/** We are a ListItem */
NS_IMETHODIMP nsSelectOptionAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_LISTITEM;
return NS_OK;
}
/** Return our cached parent */
NS_IMETHODIMP nsSelectOptionAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
/**
* Get our Name from our Content's subtree
*/
NS_IMETHODIMP nsSelectOptionAccessible::GetAccName(nsAWritableString& _retval)
{
nsCOMPtr<nsIContent> content (do_QueryInterface(mDOMNode));
if (!content) {
return NS_ERROR_FAILURE;
}
nsAutoString option;
nsresult rv = AppendFlatStringFromSubtree(content, &option);
if (NS_SUCCEEDED(rv)) {
// Temp var needed until CompressWhitespace built for nsAWritableString
option.CompressWhitespace();
_retval.Assign(option);
}
return rv;
}
/** ------------------------------------------------------ */
/** Secondly, the Listbox widget */
/** ------------------------------------------------------ */
/** ----- nsListboxAccessible ----- */
/** Constructor */
nsListboxAccessible::nsListboxAccessible(nsIDOMNode* aDOMNode,
nsIWeakReference* aShell):
nsAccessible(aDOMNode, aShell)
{
}
/** We are a window, as far as MSAA is concerned */
NS_IMETHODIMP nsListboxAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_WINDOW;
return NS_OK;
}
/**
* We always have 1 child: a subclass of nsSelectListAccessible.
*/
NS_IMETHODIMP nsListboxAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 1;
return NS_OK;
}
/**
* As a nsHTMLListboxAccessible we can have the following states:
* STATE_FOCUSED
* STATE_READONLY
* STATE_FOCUSABLE
*/
NS_IMETHODIMP nsListboxAccessible::GetAccState(PRUint32 *_retval)
{
// Get focus status from base class
nsAccessible::GetAccState(_retval);
*_retval |= STATE_READONLY | STATE_FOCUSABLE;
return NS_OK;
}
/** ------------------------------------------------------ */
/** Finally, the Combobox widgets */
/** ------------------------------------------------------ */
/** ----- nsComboboxAccessible ----- */
/**
* Constructor -- set initial state - closed, register ourself
*/
nsComboboxAccessible::nsComboboxAccessible(nsIDOMNode* aDOMNode,
nsIWeakReference* aShell):
nsAccessible(aDOMNode, aShell)
{
mRegistered = PR_FALSE;
mOpen = PR_FALSE;
SetupMenuListener();
}
/**
* Destructor -- If we are registered, remove ourselves as a listener.
*/
nsComboboxAccessible::~nsComboboxAccessible()
{
if (mRegistered) {
nsCOMPtr<nsIDOMEventReceiver> eventReceiver(do_QueryInterface(mDOMNode));
if (eventReceiver)
eventReceiver->RemoveEventListener(NS_LITERAL_STRING("popupshowing"), this, PR_TRUE);
}
}
/**
* Inherit the ISupports impl from nsAccessible,
* handle nsIDOMXULListener and nsIAccessibleSelectable ourself
*/
NS_IMPL_ISUPPORTS_INHERITED2(nsComboboxAccessible, nsAccessible, nsIDOMXULListener, nsIAccessibleSelectable)
/**
* If we aren't already registered, register ourselves as a
* listener to "popupshowing" events on our DOM node. Set our
* state to registered, but don't notify MSAA as they
* don't need to know about this state.
*/
void
nsComboboxAccessible::SetupMenuListener()
{
// if not already registered as a popup listener, register ourself
if (!mRegistered) {
nsCOMPtr<nsIDOMEventReceiver> eventReceiver(do_QueryInterface(mDOMNode));
if (eventReceiver && NS_SUCCEEDED(eventReceiver->AddEventListener(NS_LITERAL_STRING("popupshowing"), this, PR_TRUE)))
mRegistered = PR_TRUE;
}
}
/** We are a combobox */
NS_IMETHODIMP nsComboboxAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_COMBOBOX;
return NS_OK;
}
/**
* We always have 3 children: TextField, Button, Window. In that order
*/
NS_IMETHODIMP nsComboboxAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 3;
return NS_OK;
}
/**
* nsIAccessibleSelectable method. No-op because our selection is returned through
* GetValue(). This _may_ change just to provide additional info for the vendors
* and another option for them to get at stuff. Despite the fact that we are
* single selection only.
*/
NS_IMETHODIMP nsComboboxAccessible::GetSelectedChildren(nsISupportsArray **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
* As a nsComboboxAccessible we can have the following states:
* STATE_FOCUSED
* STATE_READONLY
* STATE_FOCUSABLE
* STATE_HASPOPUP
* STATE_EXPANDED
* STATE_COLLAPSED
*/
NS_IMETHODIMP nsComboboxAccessible::GetAccState(PRUint32 *_retval)
{
// Get focus status from base class
nsAccessible::GetAccState(_retval);
if (mOpen)
*_retval |= STATE_EXPANDED;
else
*_retval |= STATE_COLLAPSED;
*_retval |= STATE_HASPOPUP | STATE_READONLY | STATE_FOCUSABLE;
return NS_OK;
}
/**
* Set our state to open and (TBD) fire an event to MSAA saying our state
* has changed.
*/
NS_IMETHODIMP nsComboboxAccessible::PopupShowing(nsIDOMEvent* aEvent)
{
mOpen = PR_TRUE;
/* TBD send state change event */
return NS_OK;
}
/**
* Set our state to not open and (TDB) fire an event to MSAA saying
* our state has changed.
*/
NS_IMETHODIMP nsComboboxAccessible::PopupHiding(nsIDOMEvent* aEvent)
{
mOpen = PR_FALSE;
/* TBD send state change event */
return NS_OK;
}
/**
* Set our state to not open and (TDB) fire an event to MSAA saying
* our state has changed.
*/
NS_IMETHODIMP nsComboboxAccessible::Close(nsIDOMEvent* aEvent)
{
mOpen = PR_FALSE;
/* TBD send state change event */
return NS_OK;
}
/** ----- nsComboboxTextFieldAccessible ----- */
/** Constructor */
nsComboboxTextFieldAccessible::nsComboboxTextFieldAccessible(nsIAccessible* aParent,
nsIDOMNode* aDOMNode,
nsIWeakReference* aShell):
nsLeafAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
/**
* Currently gets the text from the first option, needs to check for selection
* and then return that text.
* Walks the Frame tree and checks for proper frames.
*/
NS_IMETHODIMP nsComboboxTextFieldAccessible::GetAccValue(nsAWritableString& _retval)
{
nsIFrame* frame = nsAccessible::GetBoundsFrame();
nsCOMPtr<nsIPresContext> context;
GetPresContext(context);
if (!frame || !context)
return NS_ERROR_FAILURE;
frame->FirstChild(context, nsnull, &frame);
#ifdef DEBUG
if (! nsAccessible::IsCorrectFrameType(frame, nsLayoutAtoms::blockFrame))
return NS_ERROR_FAILURE;
#endif
frame->FirstChild(context, nsnull, &frame);
#ifdef DEBUG
if (! nsAccessible::IsCorrectFrameType(frame, nsLayoutAtoms::textFrame))
return NS_ERROR_FAILURE;
#endif
nsCOMPtr<nsIContent> content;
frame->GetContent(getter_AddRefs(content));
if (!content)
return NS_ERROR_FAILURE;
AppendFlatStringFromSubtree(content, &_retval);
return NS_OK;
}
/**
* Gets the bounds for the BlockFrame.
* Walks the Frame tree and checks for proper frames.
*/
void nsComboboxTextFieldAccessible::GetBounds(nsRect& aBounds, nsIFrame** aBoundingFrame)
{
// get our first child's frame
nsIFrame* frame = nsAccessible::GetBoundsFrame();
nsCOMPtr<nsIPresContext> context;
GetPresContext(context);
if (!frame || !context)
return;
frame->FirstChild(context, nsnull, aBoundingFrame);
frame->FirstChild(context, nsnull, &frame);
#ifdef DEBUG
if (! nsAccessible::IsCorrectFrameType(frame, nsLayoutAtoms::blockFrame))
return;
#endif
frame->GetRect(aBounds);
}
/** Return our cached parent */
NS_IMETHODIMP nsComboboxTextFieldAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
/**
* We are the first child of our parent, no previous sibling
*/
NS_IMETHODIMP nsComboboxTextFieldAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
* Our role is currently only static text, but we should be able to have
* editable text here and we need to check that case.
*/
NS_IMETHODIMP nsComboboxTextFieldAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_STATICTEXT;
return NS_OK;
}
/**
* As a nsComboboxTextFieldAccessible we can have the following states:
* STATE_READONLY
* STATE_FOCUSED
* STATE_FOCUSABLE
*/
NS_IMETHODIMP nsComboboxTextFieldAccessible::GetAccState(PRUint32 *_retval)
{
// Get focus status from base class
nsAccessible::GetAccState(_retval);
*_retval |= STATE_READONLY | STATE_FOCUSABLE;
return NS_OK;
}
/** -----ComboboxButtonAccessible ----- */
/** Constructor -- cache our parent */
nsComboboxButtonAccessible::nsComboboxButtonAccessible(nsIAccessible* aParent,
nsIDOMNode* aDOMNode,
nsIWeakReference* aShell):
nsLeafAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
/** Just one action ( click ). */
NS_IMETHODIMP nsComboboxButtonAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = eSingle_Action;
return NS_OK;
}
/**
* Gets the bounds for the gfxButtonControlFrame.
* Walks the Frame tree and checks for proper frames.
*/
void nsComboboxButtonAccessible::GetBounds(nsRect& aBounds, nsIFrame** aBoundingFrame)
{
// get our second child's frame
nsIFrame* frame = nsAccessible::GetBoundsFrame();
nsCOMPtr<nsIPresContext> context;
GetPresContext(context);
if (!context)
return;
frame->FirstChild(context, nsnull, &frame);
#ifdef DEBUG
if (! nsAccessible::IsCorrectFrameType(frame, nsLayoutAtoms::blockFrame))
return;
#endif
frame->GetNextSibling(aBoundingFrame);
frame->GetNextSibling(&frame);
#ifdef DEBUG
if (! nsAccessible::IsCorrectFrameType(frame, nsLayoutAtoms::gfxButtonControlFrame))
return;
#endif
frame->GetRect(aBounds);
}
/** We are a button. */
NS_IMETHODIMP nsComboboxButtonAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_PUSHBUTTON;
return NS_OK;
}
/** Return our cached parent */
NS_IMETHODIMP nsComboboxButtonAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
/**
* Gets the name from GetAccActionName()
*/
NS_IMETHODIMP nsComboboxButtonAccessible::GetAccName(nsAWritableString& _retval)
{
return GetAccActionName(eAction_Click, _retval);
}
/**
* Our action name is the reverse of our state:
* if we are closed -> open is our name.
* if we are open -> closed is our name.
* Uses the frame to get the state, updated on every click
*/
NS_IMETHODIMP nsComboboxButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
PRBool isOpen = PR_FALSE;
nsIFrame *boundsFrame = GetBoundsFrame();
nsIComboboxControlFrame* comboFrame;
boundsFrame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame), (void**)&comboFrame);
if (!comboFrame)
return NS_ERROR_FAILURE;
comboFrame->IsDroppedDown(&isOpen);
if (isOpen)
_retval = NS_LITERAL_STRING("Close");
else
_retval = NS_LITERAL_STRING("Open");
return NS_OK;
}
/**
* As a nsComboboxButtonAccessible we can have the following states:
* STATE_PRESSED
* STATE_FOCUSED
* STATE_FOCUSABLE
*/
NS_IMETHODIMP nsComboboxButtonAccessible::GetAccState(PRUint32 *_retval)
{
// Get focus status from base class
nsAccessible::GetAccState(_retval);
// we are open or closed --> pressed or not
PRBool isOpen = PR_FALSE;
nsIFrame *boundsFrame = GetBoundsFrame();
nsIComboboxControlFrame* comboFrame;
boundsFrame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame), (void**)&comboFrame);
if (!comboFrame)
return NS_ERROR_FAILURE;
comboFrame->IsDroppedDown(&isOpen);
if (isOpen)
*_retval |= STATE_PRESSED;
*_retval |= STATE_FOCUSABLE;
return NS_OK;
}
/** ----- nsComboboxWindowAccessible ----- */
/**
* Constructor -- cache our parent
*/
nsComboboxWindowAccessible::nsComboboxWindowAccessible(nsIAccessible* aParent,
nsIDOMNode* aDOMNode,
nsIWeakReference* aShell):
nsAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
/**
* As a nsComboboxWindowAccessible we can have the following states:
* STATE_FOCUSED
* STATE_FOCUSABLE
* STATE_INVISIBLE
* STATE_FLOATING
*/
NS_IMETHODIMP nsComboboxWindowAccessible::GetAccState(PRUint32 *_retval)
{
// Get focus status from base class
nsAccessible::GetAccState(_retval);
// we are open or closed
PRBool isOpen = PR_FALSE;
nsIFrame *boundsFrame = GetBoundsFrame();
nsIComboboxControlFrame* comboFrame = nsnull;
boundsFrame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame), (void**)&comboFrame);
if (!comboFrame)
return NS_ERROR_FAILURE;
comboFrame->IsDroppedDown(&isOpen);
if (! isOpen)
*_retval |= STATE_INVISIBLE;
*_retval |= STATE_FOCUSABLE | STATE_FLOATING;
return NS_OK;
}
/** We are a window */
NS_IMETHODIMP nsComboboxWindowAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_WINDOW;
return NS_OK;
}
/** Return our cached parent */
NS_IMETHODIMP nsComboboxWindowAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
/**
* We are the last sibling of our parent.
*/
NS_IMETHODIMP nsComboboxWindowAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
* We only have one child, a list
*/
NS_IMETHODIMP nsComboboxWindowAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 1;
return NS_OK;
}
/**
* Gets the bounds for the areaFrame.
* Walks the Frame tree and checks for proper frames.
*/
void nsComboboxWindowAccessible::GetBounds(nsRect& aBounds, nsIFrame** aBoundingFrame)
{
// get our first option
nsCOMPtr<nsIDOMNode> child;
mDOMNode->GetFirstChild(getter_AddRefs(child));
// now get its frame
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
if (!shell) {
*aBoundingFrame = nsnull;
return;
}
nsIFrame* frame = nsnull;
nsCOMPtr<nsIContent> content(do_QueryInterface(child));
shell->GetPrimaryFrameFor(content, &frame);
#ifdef DEBUG
if (! nsAccessible::IsCorrectFrameType(frame, nsLayoutAtoms::blockFrame))
return;
#endif
frame->GetParent(aBoundingFrame);
frame->GetParent(&frame);
#ifdef DEBUG
if (! nsAccessible::IsCorrectFrameType(frame, nsLayoutAtoms::areaFrame))
return;
#endif
frame->GetRect(aBounds);
}

View File

@@ -0,0 +1,237 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Original Author: Eric Vaughan (evaughan@netscape.com)
* Contributor(s): John Gaunt (jgaunt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __nsSelectAccessible_h__
#define __nsSelectAccessible_h__
#include "nsBaseWidgetAccessible.h"
#include "nsIAccessibleSelectable.h"
#include "nsIDOMXULListener.h"
/** ------------------------------------------------------ */
/** First, the common widgets */
/** ------------------------------------------------------ */
/**
* The list that contains all the options in the select.
*/
class nsSelectListAccessible : public nsAccessible
{
public:
nsSelectListAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsSelectListAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
protected:
nsCOMPtr<nsIAccessible> mParent;
};
/**
* Options inside the select, contained within the list
*/
class nsSelectOptionAccessible : public nsLeafAccessible
{
public:
nsSelectOptionAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsSelectOptionAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
protected:
nsCOMPtr<nsIAccessible> mParent;
};
/** ------------------------------------------------------ */
/** Secondly, the Listbox widget */
/** ------------------------------------------------------ */
/**
* A class that represents the Listbox widget.
*/
class nsListboxAccessible : public nsAccessible
{
public:
nsListboxAccessible (nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsListboxAccessible () {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
};
/** ------------------------------------------------------ */
/** Finally, the Combobox widgets */
/** ------------------------------------------------------ */
/**
* A class the represents the HTML Combobox widget.
*/
class nsComboboxAccessible : public nsAccessible,
public nsIAccessibleSelectable,
public nsIDOMXULListener
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIACCESSIBLESELECTABLE
nsComboboxAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsComboboxAccessible();
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
/* ----- nsIDOMXULListener ----- */
NS_IMETHOD PopupShowing(nsIDOMEvent* aEvent);
NS_IMETHOD PopupShown(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD PopupHiding(nsIDOMEvent* aEvent);
NS_IMETHOD PopupHidden(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD Close(nsIDOMEvent* aEvent);
NS_IMETHOD Command(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD Broadcast(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD CommandUpdate(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent) { return NS_OK; }
virtual void SetupMenuListener();
protected:
PRBool mRegistered;
PRBool mOpen;
};
/**
* A class the represents the text field in the Combobox to the left
* of the drop down button
*/
class nsComboboxTextFieldAccessible : public nsLeafAccessible
{
public:
nsComboboxTextFieldAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsComboboxTextFieldAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccValue(nsAWritableString& _retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
virtual void GetBounds(nsRect& aBounds, nsIFrame** aBoundingFrame);
protected:
nsCOMPtr<nsIAccessible> mParent;
};
/**
* A class that represents the button inside the Select to the
* right of the text field
*/
class nsComboboxButtonAccessible : public nsLeafAccessible
{
public:
nsComboboxButtonAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsComboboxButtonAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
virtual void GetBounds(nsRect& aBounds, nsIFrame** aBoundingFrame);
protected:
nsCOMPtr<nsIAccessible> mParent;
};
/**
* A class that represents the window that lives to the right
* of the drop down button inside the Select. This is the window
* that is made visible when the button is pressed.
*/
class nsComboboxWindowAccessible : public nsAccessible
{
public:
nsComboboxWindowAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsComboboxWindowAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
virtual void GetBounds(nsRect& aBounds, nsIFrame** aBoundingFrame);
protected:
nsCOMPtr<nsIAccessible> mParent;
};
#endif

View File

@@ -0,0 +1,212 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: John Gaunt (jgaunt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// NOTE: alphabetically ordered
#include "nsIDocument.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMXULButtonElement.h"
#include "nsIDOMXULCheckboxElement.h"
#include "nsIDOMXULDescriptionElement.h"
#include "nsIDOMXULDocument.h"
#include "nsIDOMXULLabelElement.h"
#include "nsIDOMXULSelectCntrlEl.h"
#include "nsIDOMXULSelectCntrlItemEl.h"
#include "nsReadableUtils.h"
#include "nsString.h"
#include "nsXULFormControlAccessible.h"
/**
* XUL Button: can contain arbitrary HTML content
*/
/**
* Default Constructor
*/
nsXULButtonAccessible::nsXULButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsFormControlAccessible(aNode, aShell)
{
}
/**
* Only one actions available
*/
NS_IMETHODIMP nsXULButtonAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = eSingle_Action;
return NS_OK;;
}
/**
* Return the name of our only action
*/
NS_IMETHODIMP nsXULButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
if (index == eAction_Click) {
_retval = NS_LITERAL_STRING("press");
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
/**
* Tell the button to do it's action
*/
NS_IMETHODIMP nsXULButtonAccessible::AccDoAction(PRUint8 index)
{
if (index == 0) {
nsCOMPtr<nsIDOMXULButtonElement> buttonElement(do_QueryInterface(mDOMNode));
if ( buttonElement )
{
buttonElement->DoCommand();
return NS_OK;
}
return NS_ERROR_FAILURE;
}
return NS_ERROR_INVALID_ARG;
}
/**
* We are a pushbutton
*/
NS_IMETHODIMP nsXULButtonAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_PUSHBUTTON;
return NS_OK;
}
/**
* Possible states: focused, focusable, unavailable(disabled)
*/
NS_IMETHODIMP nsXULButtonAccessible::GetAccState(PRUint32 *_retval)
{
// get focus and disable status from base class
nsFormControlAccessible::GetAccState(_retval);
*_retval |= STATE_FOCUSABLE;
return NS_OK;
}
/**
* XUL checkbox
*/
/**
* Default Constructor
*/
nsXULCheckboxAccessible::nsXULCheckboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsFormControlAccessible(aNode, aShell)
{
}
/**
* We are a CheckButton
*/
NS_IMETHODIMP nsXULCheckboxAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_CHECKBUTTON;
return NS_OK;
}
/**
* Only one action available
*/
NS_IMETHODIMP nsXULCheckboxAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = eSingle_Action;
return NS_OK;
}
/**
* Return the name of our only action
*/
NS_IMETHODIMP nsXULCheckboxAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
if (index == eAction_Click) {
// check or uncheck
PRUint32 state;
GetAccState(&state);
if (state & STATE_CHECKED)
_retval = NS_LITERAL_STRING("uncheck");
else
_retval = NS_LITERAL_STRING("check");
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
/**
* Tell the checkbox to do its only action -- check( or uncheck) itself
*/
NS_IMETHODIMP nsXULCheckboxAccessible::AccDoAction(PRUint8 index)
{
if (index == eAction_Click) {
PRBool checked = PR_FALSE;
nsCOMPtr<nsIDOMXULCheckboxElement> xulCheckboxElement(do_QueryInterface(mDOMNode));
if (xulCheckboxElement) {
xulCheckboxElement->GetChecked(&checked);
xulCheckboxElement->SetChecked(!checked);
return NS_OK;
}
return NS_ERROR_FAILURE;
}
return NS_ERROR_INVALID_ARG;
}
/**
* Possible states: focused, focusable, unavailable(disabled), checked
*/
NS_IMETHODIMP nsXULCheckboxAccessible::GetAccState(PRUint32 *_retval)
{
// Get focus and disable status from base class
nsFormControlAccessible::GetAccState(_retval);
// Determine Checked state
PRBool checked = PR_FALSE;
nsCOMPtr<nsIDOMXULCheckboxElement> xulCheckboxElement(do_QueryInterface(mDOMNode));
if (xulCheckboxElement)
xulCheckboxElement->GetChecked(&checked);
if (checked)
*_retval |= STATE_CHECKED;
return NS_OK;
}

View File

@@ -0,0 +1,71 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: John Gaunt (jgaunt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsXULFormControlAccessible_H_
#define _nsXULFormControlAccessible_H_
// NOTE: alphabetically ordered
#include "nsBaseWidgetAccessible.h"
#include "nsFormControlAccessible.h"
#include "nsHTMLFormControlAccessible.h"
class nsXULButtonAccessible : public nsFormControlAccessible
{
public:
nsXULButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
NS_IMETHOD AccDoAction(PRUint8 index);
};
class nsXULCheckboxAccessible : public nsFormControlAccessible
{
public:
nsXULCheckboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
NS_IMETHOD AccDoAction(PRUint8 index);
NS_IMETHOD GetAccState(PRUint32 *_retval);
};
#endif

View File

@@ -0,0 +1,62 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: John Gaunt (jgaunt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// NOTE: alphabetically ordered
#include "nsIDOMXULDescriptionElement.h"
#include "nsWeakReference.h"
#include "nsXULTextAccessible.h"
/**
* For XUL descriptions and labels
*/
nsXULTextAccessible::nsXULTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell):
nsTextAccessible(aDomNode, aShell)
{
}
/* wstring getAccName (); */
NS_IMETHODIMP nsXULTextAccessible::GetAccName(nsAWritableString& _retval)
{
nsCOMPtr<nsIDOMXULDescriptionElement> descriptionElement(do_QueryInterface(mDOMNode));
if (descriptionElement) {
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
return AppendFlatStringFromSubtree(content, &_retval);
}
return NS_ERROR_FAILURE;
}

View File

@@ -0,0 +1,55 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: John Gaunt (jgaunt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsXULTextAccessible_H_
#define _nsXULTextAccessible_H_
#include "nsFormControlAccessible.h"
class nsIWeakReference;
class nsXULTextAccessible : public nsTextAccessible
{
public:
nsXULTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
};
#endif

View File

@@ -0,0 +1,212 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: John Gaunt (jgaunt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// NOTE: alphabetically ordered
#include "nsIDocument.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMXULButtonElement.h"
#include "nsIDOMXULCheckboxElement.h"
#include "nsIDOMXULDescriptionElement.h"
#include "nsIDOMXULDocument.h"
#include "nsIDOMXULLabelElement.h"
#include "nsIDOMXULSelectCntrlEl.h"
#include "nsIDOMXULSelectCntrlItemEl.h"
#include "nsReadableUtils.h"
#include "nsString.h"
#include "nsXULFormControlAccessible.h"
/**
* XUL Button: can contain arbitrary HTML content
*/
/**
* Default Constructor
*/
nsXULButtonAccessible::nsXULButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsFormControlAccessible(aNode, aShell)
{
}
/**
* Only one actions available
*/
NS_IMETHODIMP nsXULButtonAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = eSingle_Action;
return NS_OK;;
}
/**
* Return the name of our only action
*/
NS_IMETHODIMP nsXULButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
if (index == eAction_Click) {
_retval = NS_LITERAL_STRING("press");
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
/**
* Tell the button to do it's action
*/
NS_IMETHODIMP nsXULButtonAccessible::AccDoAction(PRUint8 index)
{
if (index == 0) {
nsCOMPtr<nsIDOMXULButtonElement> buttonElement(do_QueryInterface(mDOMNode));
if ( buttonElement )
{
buttonElement->DoCommand();
return NS_OK;
}
return NS_ERROR_FAILURE;
}
return NS_ERROR_INVALID_ARG;
}
/**
* We are a pushbutton
*/
NS_IMETHODIMP nsXULButtonAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_PUSHBUTTON;
return NS_OK;
}
/**
* Possible states: focused, focusable, unavailable(disabled)
*/
NS_IMETHODIMP nsXULButtonAccessible::GetAccState(PRUint32 *_retval)
{
// get focus and disable status from base class
nsFormControlAccessible::GetAccState(_retval);
*_retval |= STATE_FOCUSABLE;
return NS_OK;
}
/**
* XUL checkbox
*/
/**
* Default Constructor
*/
nsXULCheckboxAccessible::nsXULCheckboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsFormControlAccessible(aNode, aShell)
{
}
/**
* We are a CheckButton
*/
NS_IMETHODIMP nsXULCheckboxAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_CHECKBUTTON;
return NS_OK;
}
/**
* Only one action available
*/
NS_IMETHODIMP nsXULCheckboxAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = eSingle_Action;
return NS_OK;
}
/**
* Return the name of our only action
*/
NS_IMETHODIMP nsXULCheckboxAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
if (index == eAction_Click) {
// check or uncheck
PRUint32 state;
GetAccState(&state);
if (state & STATE_CHECKED)
_retval = NS_LITERAL_STRING("uncheck");
else
_retval = NS_LITERAL_STRING("check");
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
/**
* Tell the checkbox to do its only action -- check( or uncheck) itself
*/
NS_IMETHODIMP nsXULCheckboxAccessible::AccDoAction(PRUint8 index)
{
if (index == eAction_Click) {
PRBool checked = PR_FALSE;
nsCOMPtr<nsIDOMXULCheckboxElement> xulCheckboxElement(do_QueryInterface(mDOMNode));
if (xulCheckboxElement) {
xulCheckboxElement->GetChecked(&checked);
xulCheckboxElement->SetChecked(!checked);
return NS_OK;
}
return NS_ERROR_FAILURE;
}
return NS_ERROR_INVALID_ARG;
}
/**
* Possible states: focused, focusable, unavailable(disabled), checked
*/
NS_IMETHODIMP nsXULCheckboxAccessible::GetAccState(PRUint32 *_retval)
{
// Get focus and disable status from base class
nsFormControlAccessible::GetAccState(_retval);
// Determine Checked state
PRBool checked = PR_FALSE;
nsCOMPtr<nsIDOMXULCheckboxElement> xulCheckboxElement(do_QueryInterface(mDOMNode));
if (xulCheckboxElement)
xulCheckboxElement->GetChecked(&checked);
if (checked)
*_retval |= STATE_CHECKED;
return NS_OK;
}

View File

@@ -0,0 +1,71 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: John Gaunt (jgaunt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsXULFormControlAccessible_H_
#define _nsXULFormControlAccessible_H_
// NOTE: alphabetically ordered
#include "nsBaseWidgetAccessible.h"
#include "nsFormControlAccessible.h"
#include "nsHTMLFormControlAccessible.h"
class nsXULButtonAccessible : public nsFormControlAccessible
{
public:
nsXULButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
NS_IMETHOD AccDoAction(PRUint8 index);
};
class nsXULCheckboxAccessible : public nsFormControlAccessible
{
public:
nsXULCheckboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
NS_IMETHOD AccDoAction(PRUint8 index);
NS_IMETHOD GetAccState(PRUint32 *_retval);
};
#endif

View File

@@ -0,0 +1,62 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: John Gaunt (jgaunt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
// NOTE: alphabetically ordered
#include "nsIDOMXULDescriptionElement.h"
#include "nsWeakReference.h"
#include "nsXULTextAccessible.h"
/**
* For XUL descriptions and labels
*/
nsXULTextAccessible::nsXULTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell):
nsTextAccessible(aDomNode, aShell)
{
}
/* wstring getAccName (); */
NS_IMETHODIMP nsXULTextAccessible::GetAccName(nsAWritableString& _retval)
{
nsCOMPtr<nsIDOMXULDescriptionElement> descriptionElement(do_QueryInterface(mDOMNode));
if (descriptionElement) {
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
return AppendFlatStringFromSubtree(content, &_retval);
}
return NS_ERROR_FAILURE;
}

View File

@@ -0,0 +1,55 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Author: John Gaunt (jgaunt@netscape.com)
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef _nsXULTextAccessible_H_
#define _nsXULTextAccessible_H_
#include "nsFormControlAccessible.h"
class nsIWeakReference;
class nsXULTextAccessible : public nsTextAccessible
{
public:
nsXULTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
};
#endif

14
mozilla/aclocal.m4 vendored Normal file
View File

@@ -0,0 +1,14 @@
dnl
dnl Local autoconf macros used with mozilla
dnl The contents of this file are under the Public Domain.
dnl
builtin(include, build/autoconf/glib.m4)dnl
builtin(include, build/autoconf/gtk.m4)dnl
builtin(include, build/autoconf/libIDL.m4)dnl
builtin(include, build/autoconf/nspr.m4)dnl
builtin(include, build/autoconf/pkg.m4)dnl
dnl
define(MOZ_TOPSRCDIR,.)dnl MOZ_TOPSRCDIR is used in altoptions.m4
builtin(include, build/autoconf/altoptions.m4)dnl

Some files were not shown because too many files have changed in this diff Show More