Compare commits

..

567 Commits

Author SHA1 Message Date
waterson%netscape.com
bbd4de52c2 Bug 98844. Don't link with LDAP libs if DISABLE_LDAP build flag set. r=rpotts, sr=jst, a=rpotts
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102835 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-12 21:15:28 +00:00
harishd%netscape.com
5eb77c6928 98645 - Added SELECT to the set of tags that cannot be crossed over when an end tag ( block-level ) tries to close it's matching open tag on the stack. r=heikki, sr=vidur
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102832 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-12 20:56:31 +00:00
harishd%netscape.com
bac0dab97a 96440 ( bugscape 9409 ) - Before reloading the document with the new charset we should completely shutoff the current load. nsMetaCharsetObserver::Notify() does indeed result in calling stopDocumentLoad() however it failed to ( accidently ) propagate the appropriate error message back to the parser. r=ftang,sr=kin,a=dbaron.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102831 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-12 20:51:30 +00:00
attinasi%netscape.com
2d4e98c7b4 Fix allows percentage-height replaced elements to get their height-basis from the nearest containing block that has a computed height. b=85016 r=karnaze sr=waterson
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102716 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-11 00:55:37 +00:00
attinasi%netscape.com
11cafa1d79 Fixed some problems with wrapping in tables where images are in text runs. b=97619 r=bernd sr=waterson
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102602 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-09 05:27:07 +00:00
darin%netscape.com
c367d55f78 fixes bug 92675 "Half or less images load on www.businessweek.com / Links don't work"
a=marek


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102498 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-07 01:19:26 +00:00
shanjian%netscape.com
7164188578 #8832 cs/gecko: Going to www.etrade.com causes gpf in gkgfxwin.dll - See attachments f
r=rbs, sr=waterson, a=marek
Previous checkin backed out here and new patch come in.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102493 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-07 00:17:45 +00:00
harishd%netscape.com
e38dbc98d7 96031 - Made LI's parent model to be flow entity. This would allow inline elements, such as I,B,FONT, etc., to contain LI such that bullets / numbers would also inherit the parent properties.
r=heikki, sr=vidur, a=asa.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102419 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 18:33:58 +00:00
attinasi%netscape.com
043bf4ab3e Two topembed, QuirkMode only fixes: 1) prevent bullets from getting resized with LI and 2) collapse margins for empty elements in BODY and table cells. b=97351 r=pierre sr=waterson b=97361 r=pierre sr=hyatt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102364 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 01:24:32 +00:00
dbaron%fas.harvard.edu
1b0a9ea605 Moving fix for bug 93270 over to the branch. (See also bug 93365.) a=marek
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102354 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 01:01:58 +00:00
kin%netscape.com
708b54b73c Fix for bug #97387: WRMB:iframe with frameborder="no" does not work
Call ParseFrameborderValue() with value returned from InNavQuirksMode(),
instead of hardcoded PR_TRUE.

r=karnaze@netscape.com  sr=attinasi@netscape.com  a=chofmann@netscape.com


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102332 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-05 22:27:24 +00:00
dcone%netscape.com
cad7f0e94a b=97461 sr=attinasi r=rods Make sure the printer is ready before getting the device and printing.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102322 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-05 20:59:14 +00:00
karnaze%netscape.com
23b3acfa75 bug 95688 - null check for base url, possibly fixing talkback reports, sr=kin, r=alexsavulov.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102296 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-05 14:09:03 +00:00
peterlubczynski%netscape.com
75ce8f13fe Fix for not setting reflow state on object frame in printing case bug 97563 r=av sr=attinasi
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102258 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-05 02:53:24 +00:00
yokoyama%netscape.com
1e8912238b Bug 96318:
FontPackageService is omitted by 94831.
Re-establishing.
/r=ftang, /sr=waterson


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102233 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-04 23:47:23 +00:00
karnaze%netscape.com
3c37f17e8c bug 46268 - fantasia's patch to make backgrounds on tables in quirks behave as in standard. sr=attinasi, r=bernd
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102204 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-04 13:17:40 +00:00
waterson%netscape.com
5bdbb7ebc4 Bug 55086. Be sure to position child views, too! r=dbaron, sr=attinasi, a=marek.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102094 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-31 20:44:35 +00:00
shanjian%netscape.com
a1ceaa36c4 #8832 cs/gecko: Going to www.etrade.com causes gpf in gkgfxwin.dll
This is the 2nd patch since the first one does not seem to work. I consider it
as a temporary one. Approved by marek to check in to fix the urgent crash.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102026 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-30 15:12:49 +00:00
shanjian%netscape.com
9ee2b121d0 #8832 cs/gecko: Going to www.etrade.com causes gpf in gkgfxwin.dll - See attachments f
r/sr=waterson a=marek


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102012 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-30 03:57:45 +00:00
darin%netscape.com
870f5b66b8 fixes bug 95981 "Changes in background images on pages do not show on reload"
r=rpotts, sr=dougt, a=marek


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102010 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-30 03:24:06 +00:00
darin%netscape.com
a693a589bf fixes bug 90288 "not honoring "Pragma: no-cache" from HTTP-EQUIV"
r=gagan, sr=dougt, a=marek


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@102008 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-30 03:19:57 +00:00
waterson%netscape.com
1a7212bd3f Fix windows bustage.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101985 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-29 22:57:19 +00:00
yokoyama%netscape.com
5f962ed735 Bug 91193:
Menu for Universal Charset Detector shows as chardet.Universal_charset_detector
Makefile change to create universalchardet.dll instead of universalchrdet.dll


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101984 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-29 22:40:36 +00:00
waterson%netscape.com
bc4ccb63cf Bug 96910. Restore NS_NewGenericModule() entry point for backwards compatibility. r=dougt, sr=jband, a=marek
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101977 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-29 22:00:49 +00:00
waterson%netscape.com
c310b15d87 Bug 93100. Fix meta-components stuff so that gecko can be built as a DLL. a=marek
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101974 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-29 21:55:00 +00:00
waterson%netscape.com
b17ec8678b Bug 94831. Convert locale to a generic module.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101973 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-29 21:52:35 +00:00
waterson%netscape.com
660ea10b58 Bug 94831. Convert locale to a generic module. a=marek
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101965 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-29 20:47:10 +00:00
dcone%netscape.com
6e42247bc4 b=12097 Fix small regression from update a few days ago. Images would no longer print. Now fixed.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101937 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-29 03:46:27 +00:00
attinasi%netscape.com
61f7feb259 Images in text runs, or multiple consequtive images, will not cause line breaks. Fixes zillions (or more) of pages. b=32191 r=bernd, dbaron, sr=waterson
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101923 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-28 23:43:10 +00:00
rods%netscape.com
c5627dd49f Giving the dropdown its top border back
Bug 88399 r=dcone sr=attinasi


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101893 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-28 16:44:39 +00:00
attinasi%netscape.com
104b73befd [Checkin for alexsavulov] Improvement on patch for bug 93363. Fix for layout problem where shrinkwrapping of floats ignores padding. b=95511 r=dbaron sr=attinasi a=marek
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101862 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-28 00:42:25 +00:00
av%netscape.com
caead46ae4 Fix for 96528 -- crash on File/Exit with full-page xpcom plugin, r=peterl, sr=attinasi, a=asa, for 0.9.2 a=marek
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101846 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-27 22:29:15 +00:00
dbaron%fas.harvard.edu
e8b0d37e3d Fix buffer overruns pointed out by Ulrich Drepper <drepper@cygnus.com> caused by incorrect porting of |char|-based code to |PRUnichar|. b=96764 r=bbaetz sr=brendan a=valeski
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101836 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-27 14:38:56 +00:00
dcone%netscape.com
284e280d7f bug12037 r=peterl sr=attinasi a=dbaron fixed printout of transparent images to have a white transparent area instead of a black area
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101820 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-27 03:45:51 +00:00
locka%iol.ie
4dccc6698b Fix to prevent docshells from loading uris on themselves after they are torn down. b=94229 r=ccarlen@netscape.com sr=rpotts@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101753 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-24 18:15:17 +00:00
harishd%netscape.com
d5643e52bc 56245 - Misplaced /FONT was closing out TABLE. I've added logic such that if a residual style tag ( inline element ) cannot contain a tag ( block element ) then it
cannot close it either. Which implies that the end tag is misplaced. Also, made userdefined tags to act as inline elements.
r=heikki,sr=vidur,a=tor.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101752 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-24 18:06:22 +00:00
dcone%netscape.com
6c87f41a38 b=58002 r=dcone r=rods sr=attinasi a=asa. fix so the correct compatablity mode is set for PC. Fixes radio button printing
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101683 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-23 02:27:10 +00:00
rods%netscape.com
3abb8c2765 Disabling the auto radio seleciton and fixing a bug if it ever gets turned on
The bug is that when printing you don't want to do the auto default selection stuff because
it ends up calling into the DOM and changing the radios on the page.
Bug 96367 r=timeless sr=attinasi


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101650 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-22 22:57:12 +00:00
attinasi%netscape.com
3434142365 Pushing to the branch a fix that has been on the trunk for a while now. Fixes the remainder of TOPEMBED bug 93365 by blocking color inheritance into tables. Hyatt made the original fix, I'm just migrating it. (+'d by valeski)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101647 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-22 22:47:22 +00:00
aaronl%netscape.com
6f8a6caab0 Some more accessibility changes that didn't make it in
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101628 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-22 05:09:19 +00:00
dcone%netscape.com
85abdfb910 fix the warnings from the previous checkin.. some compilers may die on the extra comma.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101603 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-22 03:41:51 +00:00
dcone%netscape.com
6484ca2357 b=73884 r=peterl sr=attinasi added and invert penmode for moz-outline
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101584 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-22 00:55:12 +00:00
dbaron%fas.harvard.edu
94a56abe52 Fix build bustage by checking in a configure automatically generated by an autoconf known to work correctly.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101567 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-22 00:04:21 +00:00
pchen%netscape.com
61c0818682 bug 95044, r=morse, sr=rpotts, apply fix from trunk onto branch for morse since he's on vacation
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101558 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-21 22:22:15 +00:00
attinasi%netscape.com
c0ebf0b254 Checkin for Hixie: surgically removes the font-size antiquirk and ungets the token for invalid font weights b=92623 sr=attinasi r=pierre
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101534 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-21 19:49:00 +00:00
ftang%netscape.com
38e616834a fix 92988. add more fallback face name for Japanese
r=shanjian rs=ftang


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101525 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-21 18:59:20 +00:00
leaf%mozilla.org
cb083114a9 automated update (needed to add build/autoconf/pkg.m4 to branch tag)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101515 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-21 18:21:09 +00:00
aaronl%netscape.com
4ef26d6341 Fixing mac bustage - same problem had been fixed in trunk
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101483 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-21 05:16:39 +00:00
jgaunt%netscape.com
7bacfdec0f landing of Accessible bug 95819.
a=marek


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101459 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-21 01:27:06 +00:00
bryner%netscape.com
b7e80261ef Bug 66617 - if tabbing scrolls page, focus outline stays on first link. r=saari,roc, sr=hyatt.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101457 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-21 01:17:13 +00:00
pinkerton%netscape.com
9ac490b5d8 adding listbox, combobox, selectlist for jgaunt. bug 90182.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101456 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-21 01:16:21 +00:00
(no author)
89bdd4f0c9 This commit was manufactured by cvs2svn to create branch
'MOZILLA_0_9_2_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101448 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-21 00:55:21 +00:00
dcone%netscape.com
ec50b21a62 b=76456 r=dcone sr=attasi a=choffman. Silent parameter is passed into the print.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101370 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 23:50:16 +00:00
radha%netscape.com
9b0a76f68d Fix for topEmbed bug 93027. r=pollmann sr=darin. a=marek
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101366 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 23:33:11 +00:00
harishd%netscape.com
b5be6628fb 93365 - Allow FONT to contain TABLE so that we can control what properties can and cannot propagate inside TABLE in layout. r=heikki, sr=jst
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101352 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 22:31:54 +00:00
pavlov%netscape.com
f3ca8c7288 fixing mac bustage.. forgot to check this in.. sigh
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101343 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 21:18:02 +00:00
ftang%netscape.com
800a4a4a21 move fix 76848 from trunk to 92 branch.
this also fix 85509


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101340 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 20:30:57 +00:00
saari%netscape.com
9cf1e61671 simple null check to fix a top crash bug
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101339 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 20:22:53 +00:00
pollmann%netscape.com
0d1b97df60 Bug 93972: Don't save form controls in session history if they have an autocomplete attribute set to off, or if the form they are in has an autocomplete attribute set to off. r/sr=jst@netscape.com,vidur@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101335 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 19:51:25 +00:00
saari%netscape.com
43b31d2696 actually fixing 93521 on the branch like I meant to last night
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101331 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 18:57:57 +00:00
pavlov%netscape.com
bb21405585 fixing mac bustage
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101326 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 16:52:21 +00:00
pavlov%netscape.com
36d9942fcb updating mac projects
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101325 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 16:51:03 +00:00
pavlov%netscape.com
ef3887530b yetanotherfix.. weeeeeeee
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101323 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 15:45:05 +00:00
pavlov%netscape.com
8e58e9ca99 !@#!@#
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101322 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 15:29:00 +00:00
pavlov%netscape.com
6b56427526 unix makefile change
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101321 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 15:25:23 +00:00
pavlov%netscape.com
cb33e5644a fixing makefile
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101316 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 14:32:45 +00:00
pavlov%netscape.com
5a5342713e forgot to add files
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101314 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 14:30:53 +00:00
pavlov%netscape.com
190cf42bb3 *sigh*
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101311 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 14:29:35 +00:00
pavlov%netscape.com
4751b90055 ok, undo whatever i just did..
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101310 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 14:26:22 +00:00
pavlov%netscape.com
bb7c0ff538 ack, didn't mean to check this in.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101309 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 14:23:16 +00:00
pavlov%netscape.com
483808a1ab bug 78690 r=jst sr=waterson a=chofmann. initial branch landing.. little more to follow in a minute (mac)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101304 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 13:54:24 +00:00
av%netscape.com
f41f82c821 Fix for 89672 -- crash on exit with xpcom plugin, r=peterl, sr=waterson, a=marek
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101280 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 07:47:11 +00:00
peterlubczynski%netscape.com
352048d687 Fix making x and y be signed for NPWindow struct bug 93500 r=av sr=attinasi a=chofmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101270 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 02:48:25 +00:00
peterlubczynski%netscape.com
83c8883b75 Fix for windowless plugins don't draw in the correct place when scrolled bug 93056 patch by dbrittain@superscape.com r=peterl sr=waterson a=chofmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101269 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 02:45:33 +00:00
darin%netscape.com
14c123943b fixes bug 92140 "Download dialog of 'file of type: text/html, text/html from <URL>'"
a=marek


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101262 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 02:01:16 +00:00
darin%netscape.com
6357de6b6a fixes bug 92438 "http 0.9 rendered as content-type: text/plain with Java applets"
a=marek


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101261 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 01:59:31 +00:00
attinasi%netscape.com
8fc4d05ed5 Checkin for hixie: Treat classes case insensitively in Quirks mode. r=pierre, sr=attinasi
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101253 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 01:10:05 +00:00
rods%netscape.com
069f9b7b48 The update listener is not being ref counted correctly and then deleted instead of released ( Bug 92434)
The method SetOptionSelected didn't check to see if there was an update timer so it could do the processing there instead.
Bug 91434 & 92458 r=dcone sr=attinasi


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101247 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-17 00:43:22 +00:00
dougt%netscape.com
c3ab4b7064 fixes 95488. r=bbaetz@netscape.com, sr=darin@Netscape.rom, a=marek
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101232 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-16 23:00:09 +00:00
bbaetz%cs.mcgill.ca
c443a648fc Bug 94038 - get the status bar hostname correct when reusing connections to prox
y servers. r=gagan, sr=darin, a=marek


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101228 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-16 20:14:29 +00:00
karnaze%netscape.com
69e3080538 bug 94041 - hixie's patch, give empty cells background color in quirks mode. sr=waterson, r=alexsavulov
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101218 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-16 15:03:27 +00:00
karnaze%netscape.com
3a10ee14af bug 78162 - don't optimize resize reflow on cell if its desired size exceeds its last avail size. sr=timeout, r=alexsavulov
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101216 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-16 15:00:40 +00:00
karnaze%netscape.com
20ba9d31d8 bug 92647 - correct calculate preferred table widths and cache the value. sr=attinasi, r=alexsavulov
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101214 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-16 14:56:46 +00:00
dbaron%fas.harvard.edu
df2fa23c73 Fix trunk smoketest blocker bug 93558 by modifying the fix for bug 70258 since different XUL documents can have different frame structures between the root element's primary frame and the RootBoxFrame. r=jst sr=waterson a=marek
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101155 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-16 00:29:52 +00:00
attinasi%netscape.com
3f01069e0e Made attributes topmargin and leftmargin work on the BODY element in Quirks Mode. b=9258 r=alexsavulov sr=jst
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101136 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-15 22:22:41 +00:00
attinasi%netscape.com
c6d321de04 repair layout in blocks when font size is increased or decreased dynamically. b=80817 r=peterl,karnaze sr=waterson
(checking in for alexsavulov)


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101134 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-15 22:10:31 +00:00
attinasi%netscape.com
d1a2758699 repair layout in blocks when font size is increased or decreased dynamically. b=80817 r=peterl,karnaze sr=waterson
repair layout of block that wrap contained in nowrap blocks. b=93363 r=peterl, sr=attinasi
(checking in for alexsavulov)


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101133 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-15 22:09:34 +00:00
ftang%netscape.com
aa0542b650 fix 94319, enable symbolic font depend on a pref.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101132 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-15 21:33:03 +00:00
ftang%netscape.com
e7d17ae312 add pref of 94319
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101131 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-15 21:30:24 +00:00
darin%netscape.com
5578a42786 fixes bug 94742 "header parsing regression" a=marek
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101121 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-15 19:28:43 +00:00
harishd%netscape.com
a9c2a8586f 91051 - Look for '<' or '>' which ever comes first to end DOCTYPE consumption. r=heikki, sr=vidur.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101051 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-15 00:12:35 +00:00
dougt%netscape.com
6b971aee8c fix for 93353. r/sr=darin@netscape.com, a=marek@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101045 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-14 23:08:59 +00:00
yokoyama%netscape.com
6c9fe924b5 Bug 92341:
properties file change for Universal AutoDet


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101041 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-14 21:49:13 +00:00
yokoyama%netscape.com
169a51be21 Bug 92341: extensions/universalchardet makefile change
/r=nhotta;/sr=blizzard


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101040 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-14 21:48:07 +00:00
yokoyama%netscape.com
ffc45ee3d8 Bug 92341:
Adding files under extensions/universalchardet


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101038 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-14 21:19:22 +00:00
yokoyama%netscape.com
deae7022a2 Bug fix 91250:
Adding a return Boolean from
nsIFontEnumerator::UpdateFontList()
to identify if the font lang group has changed from
receiving the WM_FONTCHANGE msg.
/r=rbs;/sr=brendan


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101035 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-14 20:33:33 +00:00
(no author)
087285da40 This commit was manufactured by cvs2svn to create branch
'MOZILLA_0_9_2_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@101005 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-14 06:01:49 +00:00
av%netscape.com
3beeb38ef7 Fix for 93351 -- preventing loop on navigator.plugins.refresh, r=peterl, sr=jst
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100976 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-14 01:40:38 +00:00
darin%netscape.com
296be879e8 fixes bug 93209 "should not discard the remainder of the packet after a 100 Continue"
a=marek


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100935 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-13 19:57:17 +00:00
darin%netscape.com
1528aa8498 fixes bug 91710 "opening page several times quickly shows completely blank page"
a=marek


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100931 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-13 19:54:19 +00:00
darin%netscape.com
ed00c7b6c2 fixes bug 90196 "M092 crash [@ nsHttpConnection::OnHeadersAvailable]"
a=marek


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100930 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-13 19:53:24 +00:00
darin%netscape.com
5d9c282c10 fixes bug 88792 "redirection with no final \r\n not processed"
a=marek


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100928 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-13 19:52:05 +00:00
darin%netscape.com
c2c5765dd4 fixes bug 86265 "Only send If-Modified-Since if given a Last-Modified header"
a=marek


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100927 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-13 19:51:06 +00:00
darin%netscape.com
287321e9fb fixes bug 83465 "response with empty content-type opens helper dialog"
a=marek


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100924 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-13 19:49:36 +00:00
jst%netscape.com
5298cbd7fb Fixing topembed crash bug 94374 (DIGBug) by checking in bryner@netscape.com's fix for bug 92735. sr=jst@netscape.com, r=jaggernaut@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100862 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-11 02:30:42 +00:00
harishd%netscape.com
c3897c8b5a 94208 - When removing styles off the style stack ( residual style ) make sure that
the correct ones are getting removed. r=heikki, sr=jst
92530 - FORM should behave as a container if the parent is TD or TH. r=heikki,sr=vidur


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100802 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-10 20:55:23 +00:00
peterlubczynski%netscape.com
1871b36dfe Fix for sending events to windowless plugins bug 90574 r=av sr=waterson
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100797 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-10 20:20:26 +00:00
valeski%netscape.com
a46c1ea2a7 fix for bugscape 7647, sorry no bugzilla id. protects script context usage inside a null check of the context. r=rpotts, sr=vidur
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100774 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-10 18:52:49 +00:00
rpotts%netscape.com
a3a5c5f743 bug #91165 - selectAll does not work in framesets. (r=nisheeth, sr=sfraser, a=valeski). This patch is only for the branch. ive put a different patch which moves the implementation to the correct place on the trunk.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100737 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-10 04:24:57 +00:00
jst%netscape.com
960444efae Fixing topembed bug 92433 (DIGBug), crash when using webmail app due to element.replace(child, child) not workinig correctly.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100687 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-09 22:47:46 +00:00
waterson%netscape.com
70d3926739 Windows sucks!
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100626 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-09 02:41:37 +00:00
waterson%netscape.com
cb704db180 Remove nsLayoutFactory.cpp, too.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100613 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-09 01:06:37 +00:00
waterson%netscape.com
c726f4c37d Whoops, forgot to add this.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100612 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-09 01:02:11 +00:00
waterson%netscape.com
65fbba7098 Bug 71248. Convert layout into a generic module.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100604 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-08 22:33:50 +00:00
waterson%netscape.com
a4608396cf Bug 71248. Convert content, layout, parser, and uconv to generic modules so that they can be linked into a meta-module. r=cathleen, sr=brendan
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100603 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-08 22:24:40 +00:00
waterson%netscape.com
9d3476afd7 Bug 71248. Convert content, layout, parser, and uconv to generic modules so that tey can be linked into a meta-module. r=cathleen, sr=brendan
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100602 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-08 22:23:16 +00:00
waterson%netscape.com
4702e5e9e4 Bug 71248. Convert content, layout, parser, and uconv to generic modules so that they can be linked into a meta-module. r=cathleen, sr=brendan
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100601 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-08 22:21:07 +00:00
(no author)
5c2d0ecb6d This commit was manufactured by cvs2svn to create branch
'MOZILLA_0_9_2_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100466 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-07 04:11:10 +00:00
waterson%netscape.com
95aaf9205a Bug 70258. A XUL document has a different root frame hierarchy than an HTML document, and |ReconstructDocElementHierarchy()| needs to deal. Specifically, for a XUL document, it must remove the GfxScroll from the RootBoxFrame; in an HTML document, it must remove the Area from the Canvas frame. r=bryner, sr=hyatt, a=chofmann (according to bbaetz, anyway)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100449 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-07 01:07:35 +00:00
bbaetz%cs.mcgill.ca
5c2eeda69c Bug 89365. Fix topcrash where the transaction gets cancelled after we get the status line but before we get any headers. r=gagan, sr=darin, a=choffmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100333 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-03 22:47:17 +00:00
chak%netscape.com
7c84408517 Fix for #92798 - Asserts in nsParser.cpp when registering JS components
r=valseki, sr=blizzard, a=valeski


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100303 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-03 17:41:10 +00:00
waterson%netscape.com
5d135cfd3e Bug 79486. Make sure that |MoveChildrenTo()| correctly updates the NS_FRAME_HAS_CHILD_WITH_VIEW flag when moving child frames into the new {ib} split frames. r=dbaron, sr=attinasi, a=chofmann.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100300 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-03 14:40:48 +00:00
ddrinan%netscape.com
e22dcb560c Bug 89995 - https referrals. r=bbaetz,sr=blizzard,a=chofmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100267 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-03 05:52:23 +00:00
blakeross%telocity.com
a476b6f572 messed up tag meant this got checked into the wrong tree.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100154 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-02 00:02:50 +00:00
bbaetz%cs.mcgill.ca
c1cefc5f34 Bugs 84264 and 87047. Fix http persistent connections to work with HTTP/1.1 servers. r=gagan, sr=dougt, a=choffmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100152 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-02 00:01:41 +00:00
blakeross%telocity.com
968faa0f9a View Toolbar items appear when toolbars are hidden in a popup window that requested no chrome, and can't show toolbars in that case (75742); disable Edit Page, Send Page, View Source for pages with post data; allow users to hide the component bar (83059). r=kerz,sr=ben
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100150 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-01 23:58:58 +00:00
harishd%netscape.com
ef7b483859 93144 - Fix hexadecimal parsing. r=nisheeth.
91205 - Remove printf statement that got enabled accidently. r=nisheeth sr=jst.
a=chofmann.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100113 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-01 21:44:21 +00:00
cltbld%netscape.com
564117992e backout my change. I checked it in the wrong tree
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100028 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-31 19:02:20 +00:00
cltbld%netscape.com
406c246f65 backout my change. I checked it in the wrong tree
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100025 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-31 18:42:22 +00:00
cltbld%netscape.com
7c92cf0059 Update the tag to Netscape61_RELEASE
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@100022 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-31 18:16:30 +00:00
darin%netscape.com
1a3a5505f7 Patch to NOT cache responses containing a 'Cache-control: no-store' header.
a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99956 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-27 00:40:33 +00:00
syd%netscape.com
24cec26a93 Fix for 78948. r=pavlov, pdt+ encouraged and blessed by me! Will land on
trunk once branch is verified and get an sr= for trunk.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99794 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-24 09:12:18 +00:00
jst%netscape.com
384a9f42fa Backing out part of the fix for bug 55459 which turned out to not be needed for fixing that bug and caused crasher bugs 91919 and 91950. r=pollmann, jag, rs=blake
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99791 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-24 07:46:10 +00:00
av%netscape.com
19902ad77a Fix for bug 91921 -- latering NPP_DestroyStream call for seekable streams till plugin instance destroy, r=peterl, sr=jst
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99784 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-24 06:11:09 +00:00
dcone%netscape.com
bb7cabaff3 b=91678 r/sr waterson& attinasi a=lchiang@netscape.com Do a resize reflow instead of a stylereflow. Fixes missing line on printout.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99783 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-24 05:06:49 +00:00
jaggernaut%netscape.com
62bd697fea Bug 91930: browser window doesn't show up on first launch on new/migrated profiles. r=sdagley, sr=jst
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99778 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-24 03:00:45 +00:00
rpotts%netscape.com
308cae8fb0 bug #84749 (r=nisheeth, sr=jst, a=pdt). Moving patch onto the branch - fixes onUnload events to fire before docshell state has been changed for the new page...
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99765 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-23 22:47:54 +00:00
pollmann%netscape.com
842c5b49aa Bug 90392: Trigger form controls on KEY_PRESS for Enter bug KEY_UP for Space. This matches the way XUL dialogs and IE trigger. This prevents a problem where a Enter KEY_DOWN in a form submit warning dialog would dismiss the dialog, but the releaseing the key would send an Enter KEY_UP to the form, causing it to be submitted repeatedly. r=jag@netscape.com, sr=jst@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99756 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-23 19:58:47 +00:00
jaggernaut%netscape.com
7742ca3b3a Bug 68394: ``Non-ASCII headers sent as unicode when quoted-printable encoding turned off and mail.strictly_mime_headers is false.'', patch by nhotta, r=ducarroz, sr=bienvenu.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99750 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-23 10:34:17 +00:00
jaggernaut%netscape.com
3ec26e86e0 Bug 91788: ``[mac] Parent window blanks out when a javascript popup window comes up''. patch by jrgm, r=jag, sr=scc.
This patch has the added bonus that it gets rid of some flicker seen for ages on Windows and Linux.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99748 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-23 08:07:08 +00:00
peterlubczynski%netscape.com
c6defed4bb Fix for bug 90951 Trunk & N610 crash in [@ 0x00000000 - MimeTypeElementImpl::GetEnabledPlugin] after plugin.refresh() r=av/dbaron sr=brendan
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99745 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-23 05:28:31 +00:00
jaggernaut%netscape.com
e9b45b5e97 Bug 65993: window.open("") should open a blank browser window, but loads the homepage instead. This should fix a whole bunch of similar complaints about the homepage loading instead of, or right before, the url you wanted from e.g. mail/news. r=jst, r=racham, sr=ben. Many thanks to racham for helping me test my patches.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99739 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-22 23:33:16 +00:00
blakeross%telocity.com
fdff6c2292 Startup url shows up on every browser launch (91585). Patch by racham (backing out morse's earlier fix). r=jag sr=blake
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99737 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-22 21:21:38 +00:00
blakeross%telocity.com
91e8a77834 Trunk/m092 bookmarks topcrash using drag and drop, @ nsMenuFrame::ActivateMenu (90151). r=bz sr=ben
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99736 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-22 21:01:04 +00:00
blakeross%telocity.com
8e60dd9853 Crash when opening Netscape-Japan homepage that was saved locally (90733). Patch by attinasi. r=nisheeth sr=waterson
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99733 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-22 19:19:53 +00:00
ssu%netscape.com
a1f58cabbf fixing bug 2808 - Allow MS Windows Shell to recognize N6Mail and N6 browser in Start Menu. sr=syd.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99712 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-21 09:16:14 +00:00
blakeross%telocity.com
fee7be3f44 History date/time of new pages is the date/time of the first url added in the session (91717). This will likely also help page loading time and hierarchical history folder opening (as well as item deletion). Would you believe we've been firing a timer every three seconds that flushes and recommits all of the user's global history (when all we meant to do was set a boolean to PR_TRUE) because of a copy and paste error Alec made in march? :-) r=jag sr=ben
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99711 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-21 09:01:51 +00:00
blakeross%telocity.com
5f8d7fe80c In a standalone window, Open Link in New Window fails silently (91720). r=mscott sr=ben
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99710 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-21 08:58:34 +00:00
av%netscape.com
87ffafc0bb Fixing 91140, the Acrobat blocker -- latering plugin stream destruction, r=peterl, bnesse, sr=vidur
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99708 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-21 07:50:28 +00:00
sdagley%netscape.com
5743e4c6af Additional fix for #81659. Now recognize non-bundle OS X plugins of type 'IEPL' (e.g. Apple's iTools plugin). Also moved test for OS X plugin types inside an #if TARGET_CARBON. Checkin is PDT+ and r=jag
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99707 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-21 06:58:05 +00:00
pollmann%netscape.com
63861adc4a Don't assume filenames have . in them when getting content type for file inputs. Thanks jst, vidur, and av for helping resolve all the subtle edge cases here... r=av@netscape.com, sr=jst@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99706 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-21 06:04:41 +00:00
mstoltz%netscape.com
be260e45cd Bug 90591: Add security hooks for accessing __proto__. r=mstoltz, sr=brendan.
Bug 90418: assure that
if the prototype of an object in one domain is set to an object in another domain,
security checks are done on the original object. r=mstoltz, sr=brendan.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99693 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-21 02:00:00 +00:00
ssu%netscape.com
3b831d5b84 fixing bug 90020 - Installer Downloader stops frequently. r=dveditz,syd, sr=mscott.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99688 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-21 01:14:21 +00:00
rpotts%netscape.com
3e9ab3239b bug #88229 (r=adamlock, r=ccarlen) Allow the embeddor to spin up a sub-event-pump when nsIWebBrowserChrome::CreateBrowserWindow(...) is called to ensure that a documeent has been loaded before returning... This means that we need to push a PLEventQ for them :-)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99676 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-20 23:09:35 +00:00
jst%netscape.com
294a9c3f28 Fixing bug 91614 (and probably 58974, 58970, and 84208). Don't use the document as a factory for creating document fragments since the document is not always around, call internal methods to create the document fragment in stead. r=pollmann, sr=vidur
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99675 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-20 22:42:15 +00:00
jaggernaut%netscape.com
ff8032c739 Bug 91571: Closing popup window from menu crashes Mac.
r=saari, sr=hyatt.

Problem here was that the urlbar, which is hidden for a chrome-less dialog, got focussed which on Mac somehow results in a crash when you try to close the window. A nice side-effect of this fix is that accelerator keys now work again in popups without having to click in them first.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99673 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-20 22:37:34 +00:00
jst%netscape.com
6b05ebe63f Branch fix for crasher bug 55459. Don't double releasing timeout that is currently being handled since that causes a refcount inbalance that leads to a crash. r/sr=vidur&rpotts
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99672 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-20 22:36:17 +00:00
dougt%netscape.com
d4e037a43a Fixes 82720. Patch by rpotts@netscape.com, r=bbaetz@netscape.com, sr=me.
Store the cancel state regardless of transaction state.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99666 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-20 21:32:16 +00:00
mstoltz%netscape.com
f0e31285c5 Bug 88087 - about: pages should not get the system principal. r=bbaetz, sr=waterson
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99658 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-20 20:24:42 +00:00
blakeross%telocity.com
1033c09611 I inadvertently made a change in my nsContextMenu.js checkin that was part of other changes that weren't supposed to go on the branch...reverting here. (r=bz sr=ben)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99632 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-20 05:36:43 +00:00
gagan%netscape.com
7aa201eca9 Backing out all my changes for 90288. a=clayton.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99628 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-20 05:07:41 +00:00
blakeross%telocity.com
accb68a8bf Can't delete selection if end of selection contains "<br\n" (90499). Patch by kin <kin@netscape.com>. r=brade sr=waterson
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99627 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-20 02:38:15 +00:00
blakeross%telocity.com
1d96cd163e Crash on form of visual hebrew with dir=rtl (89964). Patch by Simon Montagu <simon.softel.co.il>. r=ftang sr=kin
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99625 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-20 02:19:33 +00:00
peterlubczynski%netscape.com
a89cfe81a2 Fix for plugins not working on Mac OS less than 9.1 bug 90959 r=bnesse sr=attinasi
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99624 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-20 01:57:11 +00:00
mstoltz%netscape.com
7f1ce07995 Bug 91043 - don't allow scripts to call document.write on pages they don't own
r=jesse, sr=jband.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99623 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-20 01:16:20 +00:00
gagan%netscape.com
03c4b4dabe Fix for 91538. Fixing my previous mistake... need check for mParser.r=harishd, sr=dougt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99602 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 22:34:03 +00:00
gagan%netscape.com
69fb0160bc Fix for 91538. r=harishd, sr=dougt.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99601 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 22:22:26 +00:00
naving%netscape.com
d1f8c17a94 91412; r/sr=mscott. Call the CopyFileMessage on the destFolder; do not use
copyService.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99599 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 20:54:38 +00:00
beard%netscape.com
aed545ca69 Fix for bug #81659, r=pinkerton, sr=scc.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99595 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 19:32:34 +00:00
ben%netscape.com
7c0e48de88 PDT+ 91438 - bookmark folder is deleted if it is filed into itself.
r=vishy, sr=blake.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99587 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 09:07:03 +00:00
saari%netscape.com
6e5372bb9f second part of checkin for 77657, had to merge with changes
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99585 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 08:18:03 +00:00
gagan%netscape.com
f164350b02 Fix for bug 86474 (nsFileTransport won't truncate files) Checking in on gordon's behalf, r=gagan, gordon (sr'd previously by darin), a=me
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99584 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 08:09:55 +00:00
saari%netscape.com
5e93b0cb07 Fix for 77675, windows stealing focus from each other.
r=bryner, sr=hyatt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99583 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 08:03:45 +00:00
dbaron%fas.harvard.edu
d3ded988b8 Add mstoltz's accidental checkin on the trunk to the branch as well since it 'fixes' bug 89488. What it probably does is (by granting a privilege that doesn't exist and therefore shouldn't do any harm) cause a loop over privileges in CAPS to be entered that changes initialization order in a way that allows us to start up when we bring up the profile manager in a build with the Java plugin installed. b=89488 a=selmer
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99582 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 08:02:09 +00:00
vishy%netscape.com
86904ce218 bugzilla bug 83805. topcrash. Added some defensive checks to prevent divide by zero errors. r=saari, sr=blake, a=PDT. Going on Netscape branch only as this are pure hacks which may help our mtbf
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99581 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 08:01:15 +00:00
dveditz%netscape.com
30ff4c5a28 pdt+ bug 84896, reduce xpicleanup sleep cycle from 15 seconds to 1. r=selmer@netscape.com,rs=me
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99577 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 07:31:14 +00:00
hewitt%netscape.com
ba2bea057a fixing typo on behalf of blake
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99576 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 07:25:25 +00:00
vishy%netscape.com
cf9582637f bugzilla bug 84832, topcrash, added defensive check for null callback. Going on branch only as this may just be a bandaid for a more extensive real fix. r=saari, sr=ben, a=PDT
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99574 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 06:50:56 +00:00
pollmann%netscape.com
5ea11e7488 Bug 43410 : Correct z-index ordering of iframes. This change redundantly sets the widget's z-index, and should be cleaned up later. Fix includes work by beard@netscape.com. r=beard@netscape.com,self sr=jst@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99572 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 06:04:24 +00:00
pollmann%netscape.com
6342e0042f Bug 43410 : Correct z-index ordering of iframes. Passing in initdata that tells the widget it needs to clip sibling and child widgets prevents overlapping iframes from painting on top of one another. Fix includes work by beard@netscape.com. r=beard@netscape.com,self sr=jst@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99571 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 05:58:19 +00:00
valeski%netscape.com
0c4ba3b3d7 91365. r=dougt, sr=hyatt. nsIScriptGlobalObject->GetContext() can legitimately return NS_OK *and* a nsnull outparam. Various callsites were not respecting the nsnull out param and this patch gracefully handles those cases.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99570 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 05:48:49 +00:00
pollmann%netscape.com
416cd5cff2 Bug 43410 : Correct z-index ordering of iframes. This PlaceBehind() call is needed on Windows to cause the actual ::SetWindowPos system call that reorders the widgets to be made. Mac and Gtk do not implement PlaceBehind and should not be affected by this change. Fix includes work by beard@netscape.com. r=beard@netscape.com,self sr=jst@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99569 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 05:41:31 +00:00
blakeross%telocity.com
e66f4bb970 View Source and Send Link for pages with postdata need to be disabled (91341/91342). r=bbaetz sr=ben
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99568 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 05:03:26 +00:00
blakeross%telocity.com
032dc1e383 Need means to reuse/reload current page without refetching from server (40867, branch solution). Patch by Rick Potts <rpotts@netscape.com>. r=bbaetz sr=blake
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99567 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 04:52:44 +00:00
dougt%netscape.com
9d57fbad2b Potential fix for 82720. r=bbaetz, gordon, sr=me.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99563 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 02:45:02 +00:00
dougt%netscape.com
75e8aae85f Adding check for null - Shootin' in the dark for bug 84073. r=bbaetz, sr=me.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99562 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 02:36:23 +00:00
gagan%netscape.com
f390c91431 fix for bug 90288. r=gordon, harishd, sr=dougt.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99558 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 02:02:58 +00:00
gagan%netscape.com
57b572b41c *** empty log message ***
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99557 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-19 01:52:33 +00:00
pollmann%netscape.com
f352a93a9e Bug 90288/65947: Don't save password input values in session history. This resolves a potential security hole where, even after a web service has been logged out of, if the window remains open, a malicious user with physical access to the machine can click back to the login page and log in without knowing the password. r/a=gagan@netscape.com, sr=vidur@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99529 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-18 22:02:52 +00:00
heikki%netscape.com
ab3a8ff546 Bug 89710, typo broke Save Link As Bookmark functionality. r=harishd, sr=blake.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99510 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-18 20:46:00 +00:00
waterson%netscape.com
9f286b9fb7 Bug 89184. Use nsXPIDLCString instead of uninitialized bare |char*|. r=dbaron, sr=jst, a=lchiang+clayton
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99505 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-18 20:22:17 +00:00
oeschger%netscape.com
ad9257ee09 help content updates/mozification, bug=46917, author=zach, r=oeschger
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99493 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-18 19:20:56 +00:00
nhotta%netscape.com
acacfcce28 Bug 91171 checkin for yokoyama
adding webdings font entry in fontEncoding.properties file.
/r=ftang, /sr=sspitzer.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99491 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-18 18:32:07 +00:00
cls%seawood.org
35f2e3da2d Fixing corrupt .cvsignore
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99485 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-18 11:58:31 +00:00
jaggernaut%netscape.com
c30ee62e0f Bug 88678: ``nsProxyEventObject creation/destruction is not thread-safe'', patch by rpotts@netscape.com, r=dougt, sr=jst
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99484 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-18 09:51:50 +00:00
jaggernaut%netscape.com
18d7ad7f6b Bug 63463: ``Mac mousewheel doesn't work with kensington scroll mice'', patch by pinkerton@netscape.com, r=pchen, sr=hyatt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99477 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-18 07:54:37 +00:00
jaggernaut%netscape.com
690e4ca267 Bug 89536: DOM test crashes mozilla, patch by pete collins <petejc@optonline.net>, r=pollman@netscape.com, sr=jst
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99475 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-18 07:31:26 +00:00
oeschger%netscape.com
9118337715 last minute help content updates per bug 88435, PDT+, r=oeschger, author=jatin
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99472 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-18 05:43:16 +00:00
waterson%netscape.com
6bbe2e3f0e Bug 87543, 88766, 91130, etc. Don't try to do arithmetic when psd->mRightEdge == NS_UNCONSTRAINEDSIZE. r=rbs, sr=attinasi, a=selmer
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99471 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-18 04:58:32 +00:00
waterson%netscape.com
8f04cb70d0 Bug 91149. Be sure to call |MapAlignAttributesInto()| to make us notice the |align| attribute. r=karnaze, sr=attinasi, a=selmer.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99470 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-18 04:52:34 +00:00
peterlubczynski%netscape.com
5a712d166f Fix for plugins stop working on Mac bug 90959 r=av sr=attinasi
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99467 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-18 03:37:00 +00:00
blakeross%telocity.com
7a33acf451 Topcrash after pressing left arrow key in textbox (88849). Patch by attinasi. r=karnaze sr=blake,waterson
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99466 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-18 03:36:06 +00:00
harishd%netscape.com
3ce3979831 90379 - Added null checks to avoid a topcrash. Real problem unknown!
r=heikki,sr=blake


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99455 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-18 00:06:09 +00:00
dougt%netscape.com
7d2d820666 Fixing 75633. r=valeski, gagan, sr=vidur
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99438 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-17 21:24:58 +00:00
brade%netscape.com
d61f2299a9 fix tree bustage (thanks dbradley and Pike!) (move necessary changes over from trunk)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99410 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-17 16:03:35 +00:00
jst%netscape.com
8c0024b259 Fixing PDT+ bug 83433, exposing DOM object prototypes in JS. r=dbradley, sr=vidur&rpotts
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99403 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-17 11:16:06 +00:00
jst%netscape.com
fbe2b6e7c2 Fixing PDT+ bug 87389, refreshing the XPConnect wrapper prototypes when going from document to document, changes by jband and dbradley, sr=jst/jband, r=dbradley/jband/jst
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99402 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-17 11:08:15 +00:00
pavlov%netscape.com
7ef8a08a43 fix for bugscape bug 6650 r=jud sr=waterson pdt+ from marek
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99400 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-17 08:45:37 +00:00
edburns%acm.org
398886f5aa bug=88053
r=peterl
approval=selmer

After testing real and java on win32 and linux, we're satisfied that this works.

Checking in to branch.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99399 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-17 08:24:03 +00:00
aaronl%netscape.com
233de2f571 Bug 90624: Fix bounds reporting for accessible objects, r=jgaunt, attinasi, sr=brendan, a=choffman.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99391 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-17 05:35:55 +00:00
hewitt%netscape.com
300d93773b 90505 - need a way to get OnSecurityChange and OnStatusChange when on top of the embedding layer (patch from blizzard), r=valeski, sr=dougt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99389 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-17 05:21:39 +00:00
hewitt%netscape.com
472298b7e5 85451 - trunk crash viewing certificate (patch from jag), r=bbaetz, sr=blake
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99386 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-17 05:16:49 +00:00
blakeross%telocity.com
e020a6dcd1 At the eleventh hour, jrgm noticed another case that could cause the stack in topcrash 90151. r=bz sr=ben
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99385 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-17 04:36:58 +00:00
naving%netscape.com
6d39f773e1 90186 r=bienvenu sr=mscott Sort the keyArray but keep the msgHdrs in sync.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99384 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-17 04:13:32 +00:00
jst%netscape.com
acde752fcf Make history.length readable by web pages (86984). patch=jesse and jrgm. r=jband sr=jst a=clayton. (Jesse checking in from jst's account.)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99383 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-17 03:40:18 +00:00
hewitt%netscape.com
8fd5694108 90284 - remove 'use this theme' checkbox from theme installer dialog, r=syd, sr=mscott
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99382 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-17 03:28:32 +00:00
bienvenu%netscape.com
094093a489 fix top crash in listthreadids, r=naving, sr=sspitzer, a=pdt 90215
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99377 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-17 02:57:18 +00:00
blakeross%telocity.com
e2a84f9b90 Trunk/N610 topcrash during drag and drop @nsMenuFrame::ActivateMenu (90151). r=dean sr=ben
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99375 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-17 02:26:17 +00:00
av%netscape.com
26cd2722cf Fix for 87913 -- r=mstolz, peterl, sr=shaver, attinasi
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99373 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-17 01:59:09 +00:00
av%netscape.com
915cac63f5 Baking out existing fix to 87913, getting ready for another fix -- r=mstolz, sr=shaver, sr=attinasi
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99372 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-17 01:52:58 +00:00
naving%netscape.com
3729461eaf 89463 r=cavin sr=bienvenu; do not use copyService in compose code and use the
listener in the copystate instead of creating another copy in mCopyListener


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99371 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-17 01:27:58 +00:00
dougt%netscape.com
a5da51b0ad Fixes 89191. r=gagan, av, peterl. approved by marek.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99365 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-17 01:14:04 +00:00
nisheeth%netscape.com
6715fd0acf Fix for PDT+ bug 77485. Checking in on behalf of mstoltz@netscape.com. New domain checks for function definition.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99363 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-17 00:45:38 +00:00
dveditz%netscape.com
7e1a6cb5ca topcrash 85307 installing JRE; r=ssu,sr=mscott
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99357 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-16 23:56:33 +00:00
pinkerton%netscape.com
ca979b3cd0 nullcheck document to prevent crash when there isn't a document. r=saari/sr=hyatt. bug#89373
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99346 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-16 22:16:10 +00:00
harishd%netscape.com
ba30744253 Fix for PDT+ bug 40867. Also fixes bug 84106. Save As... of pages generated by
a form post uses a cache key to force loading out of the cache. If the page is
not in the cache, a dialog is brought up to confirm reposting. r=adamlock,
sr=rpotts, checkin by vidur (from a harishd tree).


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99325 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-16 19:37:36 +00:00
edburns%acm.org
a4a891a92f bug=79851
r=peterl
sr=darin
branch approval=chofmann

This fix has been in the trunk for a while.

This enables the browser to properly set the cookie for the plugin.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99324 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-16 19:30:55 +00:00
kin%netscape.com
1e7f500e87 Fixes from kin@netscape.com and brade@netscape.com
for bug #86450: pasting plaintext into text area loses significant whitespace

    content/base/src/nsDocumentEncoder.cpp    trunk revision 1.51
        - Look for -moz-pre-wrap in the correct attribute ("style").

    editor/base/nsHTMLDataTransfer.cpp         trunk revision 1.17
    editor/base/nsPlaintextDataTransfer.cpp    trunk revision 1.9
        - Set the correct mime-type on the encoder and transfer data.
        - Pass correct init flags to encoder.

    layout/base/src/nsCopySupport.cpp    trunk revision 1.9
    layout/base/src/nsCopySupport.h:     trunk revision 1.3
        - Added IsPlainTextContext() method.
        - Modified HTMLCopy() to pass correct init flags and
          mime-type to the encoder during plaintext copy.

r=kin@netscape.com,brade@netscape.com
sr=sfraser@netscape.com
a=chofmann@netscape.com,clayton@netscape.com (pdt)


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99322 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-16 19:10:47 +00:00
pinkerton%netscape.com
4e8734814f Under carbon, don't use the modal dialog proc for all dialogs since that enforces modality and we may not want that. r=pchen/sr=scc. bug# 88709
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99318 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-16 18:41:27 +00:00
hewitt%netscape.com
c09d896111 86731 - autocomplete incorrectly lowercases when matching, r=matt, sr=blake
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99298 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-16 01:09:47 +00:00
blakeross%telocity.com
81f8f80fc2 Reinstating a line that was mistakenly removed in a previous revision (and which horked the help viewer).
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99293 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-15 04:15:16 +00:00
dveditz%netscape.com
915317287d Fixing linux build bustage
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99278 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-14 05:49:38 +00:00
jelwell%netscape.com
0d2f2d3613 Fix for 87658 -- fix failover installs for Mac. PDT+, r=ssu, sr=dveditz (this is a branch only checkin, bug will not be closed, more stuff to land on the trunk).
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99277 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-14 04:54:33 +00:00
blakeross%telocity.com
dc1adefe95 Menu for turbo systray icon doesn't work on Windows 9x (90524). r=blake sr=ben (patch by ftang)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99270 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-14 03:05:42 +00:00
dveditz%netscape.com
c47c7530fa Shutdown turbo/server mode after a partial install (pdt+ bug 86976).
r=syd@netscape.com, sr=mscott@netscape.com


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99269 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-14 03:03:32 +00:00
dveditz%netscape.com
698c05d0db Hooks so XPInstall can shut down server/turbo mode (pdt+ bug 86976).
r=syd@netscape.com,sr=mscott@netscape.com


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99267 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-14 02:50:45 +00:00
mscott%netscape.com
58119c414a Bug #89628 --> don't create a session history entry if we don't have a session history object. This fixes the problem
where the scrollbar position was getting remembered in the message pane.
(checking in for Radha)
r=valeski
sr=mscott
a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99256 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-14 00:52:24 +00:00
edburns%acm.org
4d5c414769 bug=88053
r/sr=brendan
a=choffmann

This checkin makes plugins honor the doCallSetWindowAfterDestroy contract.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99253 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-14 00:38:27 +00:00
mscott%netscape.com
190e376490 Bug #89181 --> byte align the moz-icon RGB data so they render at certain
resolutions. This also fixes a crash by preventing a ABR.
r=pavlov
sr=sspitzer
a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99250 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-14 00:29:23 +00:00
morse%netscape.com
3d1cbfcf54 bug 73141, clicking on link in mail window brings up browser on home page, r=jag, sr=mscott
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99244 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-13 23:52:10 +00:00
karnaze%netscape.com
e1e180ecb0 bug 89116 - rebalance table on cell incremental reflow when maximum width changes. sr=attinasi, r=alexsavulov.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99241 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-13 23:43:50 +00:00
ssu%netscape.com
a803eced3f checking in patch for dbragg for bug 78442 - Crash for scenario test case using execute (blk param not required). r=ssu. nsJSFile.cpp
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99240 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-13 23:42:01 +00:00
oeschger%netscape.com
3f87776aab image updates for help content, bug=85925, author=jatin, r=oeschger
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99239 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-13 23:41:47 +00:00
pinkerton%netscape.com
25e721cf57 fix non-carbon bustage.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99238 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-13 23:35:46 +00:00
harishd%netscape.com
928ac84eab 87110 - Avoid memory bloat by moving Malloc out of do-while. Also do not propagate er
from unicode coverter. r=ftang, sr=vidur.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99236 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-13 23:26:48 +00:00
ddrinan%netscape.com
aada707a0a Check in for tao. r=mcgreer,sr=blizzard
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99230 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-13 23:08:38 +00:00
peterlubczynski%netscape.com
9fc63b895f Real fix for Quicktime 4.x sweep bug 89407 r=av sr=blizzard
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99223 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-13 22:02:45 +00:00
peterlubczynski%netscape.com
f3637ccef7 Fixing key and context menu events for full-page plugins on Mac bug 84681 r=bnesse sr=blizzard
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99222 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-13 22:01:52 +00:00
pinkerton%netscape.com
af1d5e61c3 Get printing working on carbon after it was broken in the landing of print options. fix a memory leak that was leaking the deviceContextSpec on mac. r=sdagley/sr=sfraser. bug# 58254.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99220 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-13 21:43:48 +00:00
harishd%netscape.com
6244144401 [ checking in for vidur ]
81253 - Avoid reload by sniffing ahead for document's charset in the META tag.
r=me sr=waterson


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99209 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-13 20:06:23 +00:00
cotter%netscape.com
6a1dfeb3b4 help content updates per b=85925, PDT approved, r=oeschger@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99207 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-13 19:57:06 +00:00
bnesse%netscape.com
3a939ed2b0 Fix for bug 85231. Fix MLK/crasher caused by cyclical xpcom references in nsPluginInstance and nsTimer. r=av, peterlubczynski. sr=scc. PDT+
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99191 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-13 17:38:37 +00:00
brendan%mozilla.org
2177942f24 eval fix from trunk rev 3.59 (77578, r=rogerl, sr=shaver, a=selmer).
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99190 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-13 17:36:14 +00:00
dcone%netscape.com
e53081357e b=88343 r=peterl sr=karnaze a=selmer or PDT+ team. Keep browser from crashing on listboxes when
the backbutton is hit


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99189 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-13 17:32:00 +00:00
locka%iol.ie
0539703cbd Added new interface nsITooltipTextProvider and service to chrome listener. b=90195 r=valeski@netscape.com sr=rpotts@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99181 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-13 09:21:34 +00:00
ddrinan%netscape.com
2eacc11b03 Bug 88839 - necko does not close ssl sockets. r=gagan,sr=dougt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99164 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-13 05:41:28 +00:00
ddrinan%netscape.com
190d6dbc3f Bug 90355 - extra (false) security warning. r=bryner,sr=jst
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99163 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-13 05:34:22 +00:00
cotter%netscape.com
41b4b2ac5b help content update per b=85925, PDT approved, r=oeschger@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99144 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-12 23:18:27 +00:00
hewitt%netscape.com
87d02611c6 84051 - more colorful icons in modern theme, r=andreww, sr=hyatt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99119 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-12 10:03:32 +00:00
(no author)
ab6f361aec This commit was manufactured by cvs2svn to create branch
'MOZILLA_0_9_2_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99118 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-12 09:59:30 +00:00
cmanske%netscape.com
db9362b5c9 Fixed initialization of color picker color in dialog, b=89973, r=sfraser, sr=kin
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99107 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-12 04:33:45 +00:00
cmanske%netscape.com
9a44266025 Fixed reseting font color to default, b=89700, r=akkana, sr=kin
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99106 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-12 04:24:52 +00:00
mscott%netscape.com
86978f8b9a Bug #90073 --> clear out the cache entry on the url if we aren't going to read it in from the url
r/sr=bienvenu, sspitzer
a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99105 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-12 04:08:23 +00:00
mstoltz%netscape.com
6e1414eaac Fixing blocker bug 90197 by backing out fix for 87913 that changed the behavior of
ComponentManager::AutoRegister and instead using patch v2 from 87913 which
adds a new function rather than changing the existing one. r=mstoltz, dveditz.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99104 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-12 04:00:24 +00:00
peterlubczynski%netscape.com
a9972aee91 Patch to fix Shockwave games bug 90173 r=av sr=attinasi
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99103 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-12 03:46:43 +00:00
ssu%netscape.com
c81e6297a3 fixing bug 90159 - Uninstall does not complete when run while Mozilla,N6 running in turbo mode. r=syd,dveditz sr=mscott
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99102 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-12 03:14:46 +00:00
ddrinan%netscape.com
13e9022c10 Bug 77837 - PSM in language pack r=tao,sr=blizzard
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99099 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-12 01:41:11 +00:00
mstoltz%netscape.com
9ed4bb554e Bug 88417, checking in for jesse@netscape.com. Don't let web scripts change
just the host part of location. r=mstoltz, sr=jst.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99091 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 23:49:31 +00:00
cmanske%netscape.com
eba708b5a6 Fixed remaining missing menulists in Table Properties dialog, b=89644, r=sfraser, sr=kin
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99090 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 23:46:59 +00:00
andreww%netscape.com
71184a9207 bugscape 6426 and 5001. Implement windows classic precaching for aim, and search+shop buttons in classic skin, respectively. PDT + approved
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99089 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 23:04:59 +00:00
ccarlen%netscape.com
07fcaf5125 Bug 90065 - nsAppShellService::GetNativeAppSupport returns NS_OK when it fails causing crash. r=valeski/sr=blake/a=chofmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99087 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 22:19:49 +00:00
racham%netscape.com
037b39835d Fixing bug 6684. Adding context sensitive help system for Account Manager dialog. r=oeschger, sr=sspitzer, a=pdt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99086 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 22:18:00 +00:00
racham%netscape.com
6e983898ba Fixing bug 6684. Adding mail context sensitive tags to the help.js. This tags will help help window to display corresponding help page for the item selected on Account Manager dialog. r=oeschger, sr=sspitzer, a=pdt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99085 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 22:12:24 +00:00
oeschger%netscape.com
6ae54b6985 content and image updates per bug 85925, PDT approved
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99084 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 21:09:02 +00:00
cotter%netscape.com
0ccb85402f help content update per b=85925, PDT approved, r=oeschger@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99083 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 20:55:29 +00:00
ftang%netscape.com
2bcba9fb52 fix 75707. r=nhotta sr=sfraser
fix gbk block boundary problem
init the in/out parameter to 0


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99082 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 20:50:50 +00:00
nhotta%netscape.com
1158c40099 Changed simplified chinese encoders (GBK and GB2312) to include the unmapped character to length in case of NS_ERROR_UENC_NOMAPPING,
bug 90202, r=ftang, sr=blizzard.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99081 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 20:50:31 +00:00
ftang%netscape.com
7a7f73cedf fix bug 75707 into branch r=nhotta, sr=sfraser
fix big5 and euckr problem in buffer bundary


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99080 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 20:49:57 +00:00
bstell%netscape.com
defa879a6b bug 89250, r=ftang, sr=blizzard, PDT+
set minimum size of Japanese font to 16 point (sigh)


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99079 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 20:38:57 +00:00
harishd%netscape.com
dc62af156c Nisheeth checking in on behalf of Heikki from Harish's machine! Fix for PDT+ bug 88327. XMLHttpRequest correctly processes international char set XML text returned from the server.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99078 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 20:36:04 +00:00
akkana%netscape.com
14ea7b6bca 78727,86998: Fix a hang with rewrap introduced by the string API conversion. r=sspitzer, sr=sfraser
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99077 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 20:33:30 +00:00
jst%netscape.com
34c093eed8 Fixing PDT+ bug 87961, problems with accessing items in DOM arrays. r/sr=vidur@netscape.com, brendan@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99056 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 05:27:19 +00:00
mstoltz%netscape.com
41ff1bf3e6 Checking in bug 87913 for jesse@netscape.com - Allow untrusted scripts
to call Components.manager.autoRefresh, but only with default params.
r=mstoltz, sr=jst. (PDT+)


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99051 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 04:50:07 +00:00
tao%netscape.com
4ec3814190 (part of 86807), Take out extra "/" in RDF:Description.
r=BenB,sr=blizzard. See 90170.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99047 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 04:32:27 +00:00
peterlubczynski%netscape.com
5d0febe9ec Only flush the font cache and don't do a reframe for font.internaluseonly.changed
Fix for 3D Groove not working on Win32, bug 89493, patch by attinasi r=peterl sr=waterson


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99042 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 03:30:45 +00:00
blakeross%telocity.com
9789a71884 Fixing minor merge conflicts from the xul landing.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99041 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 03:23:36 +00:00
blakeross%telocity.com
7873717825 Help updates (85925). r=oeschger sr=ben
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99038 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 03:08:04 +00:00
mstoltz%netscape.com
cddc2caf53 Checking in 88153 on behalf of jesse@netscape.com. Making Components.manager.autoRegister
callable by untrusted scripts, but parameters will be ignored. r=mstoltz, sr=jst.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99031 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 01:42:35 +00:00
cotter%netscape.com
33fb37d9cb help content update per b=85925, PDT approved, r=oeschger@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99030 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-11 01:16:40 +00:00
anthonyd%netscape.com
f9d10cb7dd bug fix for 88263 - Range selectNodeContents(null) crashes browser
r=anthonyd
sr=sfraser
a=beppe


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99011 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 23:38:02 +00:00
pchen%netscape.com
27b607c4aa bug 65241, r=vishy, sr=ben, PDT+, turn on content_pack option for mac build
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99006 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 21:41:57 +00:00
blakeross%telocity.com
f6f2899c6b Readding a function that was mistakenly removed yesterday (wasn't part of reviewed patch).
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@99000 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 18:28:43 +00:00
jgaunt%netscape.com
413e6a32f5 Fix for mac build bustage introduced with the accessibility checkin on the 4th.
bug 89473 r=saari,peterv sr=scc pdt+=selmer


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98999 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 18:02:16 +00:00
brade%netscape.com
0b12c30405 setup Apply button (bug #88377)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98995 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 14:35:21 +00:00
brade%netscape.com
b34b4070c9 remove unused string (apply)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98994 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 14:34:24 +00:00
brade%netscape.com
e99d99c4a1 add help button to dialog (bug #88377)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98993 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 14:34:04 +00:00
brade%netscape.com
6323b51408 add Apply string (bug #88377)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98992 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 14:23:31 +00:00
peterv%netscape.com
12c53ca382 Fixing build bustage. r=jag.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98989 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 11:48:04 +00:00
jst%netscape.com
43986cf066 Fixing PDT+ bug 84648, fixing problem with blocking and unblocking the parser when document.writeing link tags to external css files. r=harishd@netscape.com, sr=vidur@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98980 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 07:25:34 +00:00
jst%netscape.com
fdfd08f4d1 Fixing PDT+ bug 81290, problems with element.offsetXXX when used on positioned elements. r=pollmann@netscape.com, sr=vidur@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98977 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 06:23:05 +00:00
ccarlen%netscape.com
7d5670e620 Bug 87150 - enter or double-click does not close profile mgr window. r=brade/sr=blake/PDT+
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98976 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 06:00:35 +00:00
timeless%mac.com
195ca3a554 Per blake, because mac doesn't have that object. r=ben sr=blake
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98975 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 05:40:01 +00:00
ccarlen%netscape.com
846fba3d1a Bug 88630 - Themes and locales do not change when using turbo. r=vishy/sr=blake/PDT+
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98973 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 05:33:26 +00:00
ddrinan%netscape.com
d142656ab1 Fixed problem with previous check in
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98971 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 05:01:16 +00:00
vishy%netscape.com
f9615fa82c bugzilla bug 49861, PDT+, code=vishy, branch only fix, bug remains open on trunk, commented out the Demonstration item from Form Manager on the branch
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98970 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 04:57:23 +00:00
vishy%netscape.com
c94b05e6fa bugzilla bug 89725, PDT+, code=stephen walker, r=bbarsky, sr=blake, fix empty content pack submenu in prefs, had failed to register chrome
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98968 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 04:53:11 +00:00
peterlubczynski%netscape.com
9a4d82ec23 Slightly change pluign timer interval to fix url bar on Mac bug 88936 r=bnesse sr=sfraser
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98965 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 04:11:12 +00:00
cmanske%netscape.com
86cfdb050e Fixed missing Choose File button in Image Dialog and menulists in Table Dialog: b=89644, r=brade, sr=sfraser
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98963 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 03:59:45 +00:00
cmanske%netscape.com
1df38a7072 Fixed prompt for saving file from HTML Source mode bug 86742, r=timeless, sr=sfraser
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98961 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 03:44:09 +00:00
cmanske%netscape.com
26b4b63b5b Fixed Spell Check dialog layout bug 57398, r=hewitt, sr=sfraser
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98960 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 03:41:40 +00:00
cmanske%netscape.com
ebd5475240 Fix join table cells bug 86009, r=mjudge, sr=sfraser
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98959 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 03:39:45 +00:00
harishd%netscape.com
ac76dec562 Fix for PDT+ bugs 40072, 76722. Nisheeth checking in on behalf of Harish. These fixes have baked on the trunk for a couple of weeks.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98957 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 03:15:28 +00:00
peterlubczynski%netscape.com
5a95443abe Fix for OS X "Internet Plugins Dir" bug 78751 patch by ccarlen r=peterl sr=sfraser
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98954 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 02:44:00 +00:00
peterlubczynski%netscape.com
9917213e84 Fix for crash with garbage in nsGUIEvent bug 87112 sr=sfraser r=ccarlen
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98953 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 02:30:42 +00:00
bstell%netscape.com
eed94a0705 bug 63831, r=ftang@netscape.com, sr=sfraser, PDT+
when measuring space glyph width
use  8 bit space char with  8 bit font
use 16 bit space char with 16 bit font


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98946 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 01:39:58 +00:00
ddrinan%netscape.com
c9259a9ebd Check in for tao. Bug 86807 - Menu items are missing. r=jbetak,sr=hyatt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98942 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 01:18:24 +00:00
ddrinan%netscape.com
ce258020b8 Bug 89139 - RegisterProfileChangeObserver() return value. r=walk84,sr=blizzard
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98940 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 01:03:57 +00:00
ddrinan%netscape.com
b0f45632ed Check in for walk84. Bug 88838 - Help button for Cert Mgr/CA. r=ddrinan,r=oeschger,sr=blizzard
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98939 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 00:58:31 +00:00
peterlubczynski%netscape.com
068594afa9 Patch to include Quicktime5 in 4.x plugin folder scan bug 89407 r=av sr=waterson
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98938 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 00:55:17 +00:00
waterson%netscape.com
c7e25e2ad5 Bug 88073. Back out changes for bug 84645 for now.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98932 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-10 00:22:57 +00:00
blakeross%telocity.com
dbdd0d2d86 No, wait, this was the problem. sr=ben
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98931 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-09 23:51:45 +00:00
blakeross%telocity.com
790fd0d931 This was the real problem.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98929 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-09 23:38:57 +00:00
blakeross%telocity.com
c4392496b8 adding back. all is well.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98928 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-09 23:37:46 +00:00
blakeross%telocity.com
953d7b18f9 Okay, removing these lines again...something went wrong with how turboDialog.* were added, and this will probably just cause the tree to go red.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98925 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-09 23:22:11 +00:00
blakeross%telocity.com
64340eb3e2 missed a line in my turbo dialog checkin.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98924 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-09 23:03:23 +00:00
mstoltz%netscape.com
8f8c437bca Bug 89163 (part of bugscape 6934): if chrome JS calls nsRange::CreateContextualFragment,
push the current document's JS context on the stack so that event handlers in the fragment
are not compiled with the system principal. r=jelwell, sr=jst.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98922 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-09 23:02:30 +00:00
gagan%netscape.com
707b4b8fc1 Fix for bug 89206. Checking this in on bbaetz behalf. r=dougt, sr=sfraser, a=pdt+
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98921 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-09 22:59:16 +00:00
peterlubczynski%netscape.com
3ba1dffc17 Fix for Quicktime being broken on Classic MacOS bug 89662 r=sfraser sr=attinasi
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98917 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-09 22:47:58 +00:00
locka%iol.ie
0c66824fe1 Embedding manifest generator. NOT PART OF BUILD. b=83393
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98914 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-09 22:40:10 +00:00
tao%netscape.com
871d74976d 86807: Some menu items are missing if you use incompatibly profle.
r=jbetak,sr=hyatt. Add locale version to all packages and their locale
providers.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98911 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-09 22:29:51 +00:00
chuang%netscape.com
bb7cbc76f7 PDT+bug 80446 Importing Outlook Contacts doesn't import email addresses,
r=Cyrille.Moureaux@Sun.com, sr=mscott


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98906 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-09 21:19:57 +00:00
pchen%netscape.com
78efa36b73 bug 89685, fix by sfraser, r=pchen, sr=blake, PDT+, mainWindowDTD entity misdefined as navigatorDTD which was already defined, ooops
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98904 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-09 21:07:06 +00:00
sspitzer%netscape.com
65d2952bdd fix for #40480, search / filter ui problems when terms are offscreen.
this hack is for the nsBranch only (0.9.2), I'm working on something else
for the trunk.  sr=alecf.  PDT+.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98903 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-09 21:05:08 +00:00
blakeross%telocity.com
f3180f84b3 Show dialog when last window is closed while in turbo mode (89166). r=ccarlen sr=ben PDT+
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98902 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-09 21:04:56 +00:00
cotter%netscape.com
668b0faa82 help content updates per b=85925, PDT approved, r=oeschger@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98900 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-09 20:47:20 +00:00
naving%netscape.com
0143cfaf0c 89189 r/sr=bienveu; Clear the m_keyArray so that the next folder can be
compacted correctly (for CompactAll)


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98898 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-09 20:40:04 +00:00
blakeross%telocity.com
e34d70695b File | Exit should not kill -turbo mode (89165). r=timeless sr=ben PDT+
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98896 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-09 20:27:43 +00:00
blizzard%redhat.com
81588892c5 Don't leave any core files behind. Not part of the build.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98894 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-09 20:07:58 +00:00
blizzard%redhat.com
0a4fc87f07 Generated files aren't verified. Not part of the build.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98882 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-09 15:03:21 +00:00
blizzard%redhat.com
38fbc1f30a Fix problems with mozilla.sh using readlink which is in the tetex package and isn't on a lot of systems. Replace with perl instead. Also, use --shared for one of the packages that was missing it so we don't end up with files in /usr/lib/defaults/. Not part of the build.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98877 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-08 20:40:45 +00:00
ftang%netscape.com
2ffe8e2463 back out to 1.31.2.2 for dogut after talk to dougt.
dougt back out wrongly in 1.31.2.4 and cause other problem. he need more sleep :)
fix 89643


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98843 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-07 00:03:51 +00:00
av%netscape.com
94cdfebf78 Fix for 87469 -- crash on exit with Acrobat, waterson, r=peterl, sr=shaver
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98841 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 23:21:14 +00:00
peterlubczynski%netscape.com
95b90f2ce4 Fix for browser freezes on loading pages with flash, shockwave bug 89529 r=dcone sr=sfraser
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98838 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 21:48:55 +00:00
(no author)
65f55f9084 This commit was manufactured by cvs2svn to create branch
'MOZILLA_0_9_2_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98837 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 21:48:48 +00:00
peterlubczynski%netscape.com
229099f304 Fix for Plugin MIME-type attribute should not be case sensitive bug 87290 r=av sr=attinasi
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98835 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 21:46:19 +00:00
dougt%netscape.com
5b888d75ed For whatever reason, with the patch 82418, we are getting reports that non ascii pages don't load. backing out. a=leaf.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98827 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 19:41:49 +00:00
vishy%netscape.com
c388cbff57 smoketest blocker, bugzilla 89600, code=ben, r=vishy, sr=blake, missed a var definition so prefs dialog would not open
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98820 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 17:43:14 +00:00
peterv%netscape.com
7fd4f6c2d3 Bustage fix.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98816 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 15:32:10 +00:00
peterv%netscape.com
c84ca9767e More bustage fix.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98815 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 15:25:26 +00:00
peterv%netscape.com
f11a0efd1d Bustage fix.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98814 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 15:19:10 +00:00
peterv%netscape.com
9ba48ff819 Rewrite of XPath lexer and parser and implement the remaining XPath features (Unary minus and processing-insruction(Literal)). Bug 75102.
Lexer changes by Axel Hecht, parser and expressionclasses changes by Jonas Sicking. r=peterv, Pike, sicking, sr=jst.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98811 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 14:20:59 +00:00
ccarlen%netscape.com
79e2c80556 Bug 89160 - Clearing user prefs can go into infinite loop. r=bnesse,valeski/sr=vidur/a=pdt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98809 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 14:12:29 +00:00
ccarlen%netscape.com
f8269bfb01 Bug 89162 - Profile change observer for single-signon must be static. Otherwise, if no instances exist, there's nothing to observe the change. r=valeski/sr=alecf/a=pdt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98808 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 14:11:19 +00:00
peterv%netscape.com
03b80c2c4a Fix for bug 83589 (Doing a commercial build clobbers DefinesOptions.h, forcing an entire rebuild). We now have separate headers for the optional defines for mozilla/commercial and debug/optimized. sr=sfraser.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98803 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 13:41:00 +00:00
vishy%netscape.com
1575ced7a2 bugzilla bug 65251, code=ben, PDT+, merging changes from trunk onto branch, adding content pack chrome registration to installer
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98800 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 09:59:24 +00:00
ben%netscape.com
b349946b58 make prefwindow non-modal as part of fix for 65241.
r=matt, sr=blake


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98797 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 07:00:49 +00:00
jaggernaut%netscape.com
d781554f42 Bug 73064: If your navigation bar is in a collapsed state when you closed your browser, its "collapsed" grippy wouldn't show up upon the next browser startup. Work-around which happens to work, only to be checked in on the branch, we'll figure out something better for the trunk. r=hixie, sr=ben.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98796 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 06:59:48 +00:00
ben%netscape.com
1972943c75 65241 - download content packs button for content pack pref panel.
r=matt, sr=blake


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98795 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 06:59:03 +00:00
ssu%netscape.com
d70d5b3346 fixing bug 87033 - Unable to start installer/uninstaller when having Quick Launch option on. r=dbragg, sr=mscott. affects only windows platforms
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98791 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 06:06:34 +00:00
ssu%netscape.com
c5116c672e fixing bug 87033 - Unable to start installer/uninstaller when having Quick Launch option on. r=dbragg, sr=mscott. affects only windows platforms. not part of tinderbox builds
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98790 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 06:03:50 +00:00
pchen%netscape.com
3a040fa3d7 bugscape 6875, r=jag, sr=waterson, include navExtraOverlay.xul which, for commercial build, hides qa and debug menus
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98786 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 04:37:54 +00:00
pchen%netscape.com
0657251543 bugscape 6664, i.e. bugscape 4157 part deux, r=ben, sr=alecf, reapply patches for removing buildid from ns commercial build that were done for beta, here reference new mainWindow.dtd file
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98785 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 03:52:01 +00:00
pchen%netscape.com
1eb5c933aa bugscape 6664, i.e. bugscape 4157 part deux, r=ben, sr=alecf, reapply patches for removing buildid from ns commercial build that were done for beta, here remove mainWindow.title* entities
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98784 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 03:51:58 +00:00
pchen%netscape.com
29d8922424 bugscape 6664, i.e. bugscape 4157 part deux, r=ben, sr=alecf, reapply patches for removing buildid from ns commercial build that were done for beta, here mainWindow.dtd, the new home of mainwindow.title* entities
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98783 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 03:51:53 +00:00
pchen%netscape.com
dbab608bec bugscape 6664, i.e. bugscape 4157 part deux, r=ben, sr=alecf, reapply patches for removing buildid from ns commercial build that were done for beta, here add new mainWindow.dtd file to jar file
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98782 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 03:51:49 +00:00
pchen%netscape.com
ec2f610b07 bugscape 6664, i.e. bugscape 4157 part deux, r=ben, sr=alecf, reapply patches for removing buildid from ns commercial build that were done for beta, here hidden window needs to reference mainWindow.dtd for window title entities
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98781 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 03:51:41 +00:00
vishy%netscape.com
fcf32c8dd1 bugzilla bug 85984, code=law/blake, sr=ben, r=kerz, a=PDT/selmer, system tray icon and UI on windows for turbo mode
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98780 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 03:41:42 +00:00
syd%netscape.com
72c07616c3 Fix for 87053 - r=ssu, sr=alecf, PDT+, and Vishy said I should land it :-)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98779 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 03:29:33 +00:00
jaggernaut%netscape.com
9e6be78004 Bug 70048: ``Text of modifiers on accelerators can't be localized''.
Patch by lordpixel@mac.com, jag. r=jag, lordpixel, pinkerton, sr=ben, blake.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98777 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 03:25:14 +00:00
cls%seawood.org
14701aa929 Cleaning up mess caused by missed file from bug 53226
Thanks to Simon Fraser <sfraser@netscape.com> for the patch.
Bug #89134 r=peterv@netscape.com a=chofmann


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98774 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 02:50:45 +00:00
ccarlen%netscape.com
aa3ba8e1ae Bug 89157 - disable -turbo mode for multiple profiles. r=blake/sr=alecf/a=pdt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98771 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 02:27:11 +00:00
mscott%netscape.com
bab1f77e74 back out a file I didn't mean to check into the branch.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98770 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 02:20:00 +00:00
mscott%netscape.com
cd9ca2ef01 Bug #80866 --> redesign the helper app dialog.
r/sr=hewitt,sspitzer
a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98766 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 01:42:53 +00:00
mscott%netscape.com
713e3d7cff Bug #80866 --> redesign the helper app dialog.
r/sr=hewitt,sspitzer
a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98765 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 01:42:26 +00:00
mscott%netscape.com
d21c5a3858 Bug #80866 --> redesign the helper app dialog. Hook up the remember setting for showing the helper
app dialog for real.

r/sr=hewitt,sspitzer
a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98764 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 01:41:33 +00:00
mscott%netscape.com
b2fd8da528 Bug #80866 --> redesign the helper app dialog.
r/sr=hewitt, sspitzer
a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98763 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 01:37:10 +00:00
mscott%netscape.com
613a2adfd4 Bug #80866 --> redesign the helper app dialog.
remove obsolete entry for outgoing mimetype
r/sr=sspitzer
a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98760 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 01:34:12 +00:00
mscott%netscape.com
d91a6e1194 Bug #88429 --> insert a missing return
r/sr=blake, sspitzer
a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98758 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 01:30:11 +00:00
mscott%netscape.com
00cc10defb Bug 84410 --> properly show unknown time and put the progress bar in undetermined mode
when we don't know how large the download is.
r=sspitzer
sr=blake
a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98757 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 01:28:28 +00:00
mscott%netscape.com
a3f5a56eac Bug 84410 --> properly show unknown time and put the progress bar in undetermined mode
when we don't know how large the download is.
r=blake
sr=sspitzer
a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98756 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 01:27:58 +00:00
mscott%netscape.com
bba9360b31 bug #80220 --> show a tooltip over long attachments
Bug #79584 --> remove the .Print attachment menu item
Bug #74139 --> persist the collapsed header state
r/sr=hewitt, sspitzer
a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98755 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 01:25:59 +00:00
sfraser%netscape.com
1e60a07a10 Fixing bug 87910: Edit Page fails if composer window already up (fix error return r=dougt, sr=kin), and bug 85504: Crash in GetSelectedElement if loading a bad frameset page (fix frameset detection, and add null checks r=akkana, sr=waterson). a=pdt2
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98748 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 00:45:36 +00:00
sfraser%netscape.com
479393b368 Fixing bug 84778 on the branch. When loading page with <iframe>s, give better error message. r=brade, sr=blake, a=pdt2
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98747 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 00:42:40 +00:00
dougt%netscape.com
e31fd50602 fix for 87861. submitted by sfraser, sr darin. already on trunk
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98745 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 00:36:14 +00:00
heikki%netscape.com
8078e5f18d Bug 86894, make context menu and metadata dialog work with non-default namespaces. r=sicking,blake, sr=jst.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98744 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 00:25:56 +00:00
jaggernaut%netscape.com
6cab6d8215 Bug 86726: Form Manager is blank. r=pchen, sr=blake. Note: this is a temporary work-around.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98743 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 00:23:13 +00:00
naving%netscape.com
ccd47adb52 59871 r=bienvenu sr=mscott; Update the unread count for imap and local empty
trash


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98741 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-06 00:03:57 +00:00
hewitt%netscape.com
cdc6e1671e 4901 - classic keyverb button ugliness, r=andreww, sr=hyatt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98739 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 23:45:02 +00:00
hewitt%netscape.com
a71651e3ca 84051 - modern theme update, r=andreww, sr=hyatt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98736 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 23:31:59 +00:00
ftang%netscape.com
db57460c67 fix 85813. check into m92
fix crasher while do selection in arabic text on a system which are not bidi system
r=ftang sr=srfraser.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98734 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 23:11:26 +00:00
racham%netscape.com
da9e2e8cc1 Fixing bug 81494. Getting rid of duplicate pref for limit download size from POP server panel. r=dianesun, sr=sspitzer a=pdt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98733 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 23:10:56 +00:00
ducarroz%netscape.com
e920e58af2 Fix for bug 88124. Do not fetch urls received when replying to a message. R=varada, SR=sfraser.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98732 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 22:58:08 +00:00
waterson%netscape.com
e2d7c1cf2d Bug 84645. Put back logic that fixes |parentFrame| for continuations. r=rbs, sr=attinasi/hyatt, a=chofmann.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98730 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 22:45:52 +00:00
varada%netscape.com
13b67592b5 fix for bug #79487 and #81738 ; removing HTML menu items from plaintext compose window;r=ducarroz;sr=sspitzer
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98726 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 22:33:24 +00:00
ddrinan%netscape.com
fec8ccd60c Bug# 88834 - fixed typo in cert detail view. r=javi,sr=tor
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98724 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 22:25:35 +00:00
cotter%netscape.com
e8c81c361e help content update per b=85925, PDT approved, r=oeschger@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98722 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 22:23:33 +00:00
ddrinan%netscape.com
a69c1db812 Checkin on behalf of Javi. Bug 83695 - delete a cert from smartcard. r=ddrinan,sr=blizzard
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98720 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 22:19:56 +00:00
cotter%netscape.com
b464e4495b help content updates per b=85925, PDT approved, r=oeschger@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98717 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 22:05:56 +00:00
naving%netscape.com
f1058e66c0 52564. make the newfolder dialog look better for UW:IMAP server. r=bhuvan
sr= sspitzer


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98715 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 21:50:00 +00:00
dougt%netscape.com
d4c7b930d7 Fixes 85549. fixed on trunk. r=peterl, sr=av.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98713 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 21:38:33 +00:00
dougt%netscape.com
6a2c67fbb7 Fixed on trunk bug 85529, r=valeski, sr=rpotts.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98712 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 21:33:58 +00:00
blizzard%redhat.com
fa33363e8e Bug #88206. Mark umask explicitly so that files are generated with the proper p
ermissions.  Not part of the build.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98709 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 21:02:03 +00:00
ftang%netscape.com
0221b3024d check in 87202 for nhotta into m92 branch
in case of mailto url, convert to UTF8
r=ftang/jst sr=mscott


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98707 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 20:59:40 +00:00
ftang%netscape.com
dc95123a2a check in 68993 for nhotta into m92
in case we cannot handle the file name for attachment, use some other fallback code for the file name
r=ducarroz sr=bienvenu


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98706 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 20:50:02 +00:00
ftang%netscape.com
f4a1e7a952 check in 87535 for jbetak into m0.9.2
do not show relaunch prompt in case we show the download more page
r=nhotta sr=alecf


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98705 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 20:45:08 +00:00
ftang%netscape.com
62572ddc74 check in for jbetak
fix 86957. make it work if there are space between ,
r=bstell sr=alecf


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98704 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 20:41:29 +00:00
ftang%netscape.com
7f48147de4 fix 87991. null terminate even the length is 0
land into m92 branch
r=yokoyama sr=alecf


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98703 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 20:37:56 +00:00
ftang%netscape.com
4e5fd7604f check in 88955 for unix.
change the default font size for unix from 13 to 12 since origionally althought the font size is set to 13
we are using 12 size bitmap font to render it.
Now we enable outline font, if we keep set to 13, we will use a scaled font which does not look good like
12.
r=yokoyama and rs=bstell


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98700 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 20:21:14 +00:00
ftang%netscape.com
18739e5aef check in 87871 for nhotta into m92 branch
split font size pref into platform specific pref file
change mac font name for mac
change mac japanese size from 16 to 14.
r=ftang rs=blizzard


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98699 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 20:17:49 +00:00
dougt%netscape.com
8f6e4d1a26 Fixes 85547. Fixed on trunk - now checkin in on the branch. r=valeski, sr=rpotts.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98693 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 19:26:12 +00:00
mjudge%netscape.com
4e034101ae PDT+ 88164 backing out of bad bug for keyboard navigation.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98690 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 19:11:32 +00:00
dougt%netscape.com
447ca512ef Fixed on trunk. Fixes byteranges in necko. r=valeski, sr=rpotts, b=85529
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98678 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 17:39:59 +00:00
ben%netscape.com
917d85c0ff bugscape bug 6054 - debug pref panels in branch. lame fix for .9.2, debug extension
coming later!
r=matt, sr=sfraser


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98664 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-05 07:19:02 +00:00
dbaron%fas.harvard.edu
065947451c Checking in makefile changes that were made after accessibility branch landing on trunk but didn't get transferred to MOZILLA_0_9_2_BRANCH. Bug 86517. Fixes orange.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98661 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-04 23:46:04 +00:00
jst%netscape.com
74d5a88806 Fixing PDT+ bug 86147. Adding security checks when setting getters or setters for properties on DOM objects, also fixing a JS engine bug where jsids were passed as jsvals, this caused problems with the real fix for this bug. r=mstoltz@netscape.com, sr=brendan@mozilla.org
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98659 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-04 23:10:32 +00:00
dbaron%fas.harvard.edu
5e371ffe11 ftp.netscape.com is having problems, so remove it from the bloat test list on the branch as well so that the tests are useful. (Does not affect build.)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98657 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-04 20:38:36 +00:00
jgaunt%netscape.com
3fb16da57b Checking in accessibility branch. Bug 86517. sr=waterson, r=many people, a=choffman
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98656 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-04 20:29:43 +00:00
dougt%netscape.com
dc30597866 Fix for 82418. Fixed on Trunk as well
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98638 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-04 15:10:27 +00:00
waterson%netscape.com
b97f24e29e Bug 85422. Since nsIContent::GetDocument() may now sometimes return a null document back-pointer due to paint suppression, be extra paraniod with a sprinkle of null-check fairy dust. r=brendan, sr=attinasi, a=clayton
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98630 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-04 05:55:56 +00:00
pinkerton%netscape.com
2e99ac2302 removing xml comment as we think that makes the finder crash on OSX. r=sdagley/sr=sfraser. bug# 89152.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98603 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-04 02:04:13 +00:00
oeschger%netscape.com
fca233553c fix for mac modality issue with help, bug=87720, sr=blake, r=danmn, PDT says do it
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98600 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-04 01:36:32 +00:00
cotter%netscape.com
68d3839138 help content updates per b=85925, PDT approved, r=oeschger@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98574 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-03 21:43:56 +00:00
peterlubczynski%netscape.com
f5bb2d8c18 Fix for Shockwave registration bug 85334 r=av sr=attinasi
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98541 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-03 06:21:18 +00:00
mstoltz%netscape.com
81dcb1b113 Better fix for JS URL/session history exploit 88167 - JS URLs in session
history have no access to the current page. Other forms of loading (bookmarks,
URL bar, links) remain as they were. r=jesse, sr=jst.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98536 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-03 05:27:22 +00:00
(no author)
b50408b623 This commit was manufactured by cvs2svn to create branch
'MOZILLA_0_9_2_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98531 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-03 04:41:16 +00:00
oeschger%netscape.com
b2458e90c4 minor context sensitivity updates per bugs 46226 and 85925, approved as part of content updates
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98528 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-03 03:15:00 +00:00
oeschger%netscape.com
a41ec4f010 minor context sensitivity updates per bugs 46226 and 85925, approved as part of content updates
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98526 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-03 03:09:10 +00:00
radha%netscape.com
43c6b170fd Fix for bugzilla bug 86330. r=adamlock, sr=rpotts a=chofmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98496 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-02 23:53:34 +00:00
ddrinan%netscape.com
02433a57a6 Bug 87233, r=javi,sr=mscott,a=chofman
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98490 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-02 23:18:04 +00:00
pinkerton%netscape.com
5bc3bf3bda Adding scrollwheel support for OSX via carbon events. Turning off phantom scrollbar hack under carbon. refactoring scrollwheel event dispatch so both can co-exist. r=beard/sr=sfraser/a=chofmann bug 71045
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98489 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-02 23:05:08 +00:00
ftang%netscape.com
96935e84a1 check into moz0.9.2 branch for 87413.
back out shanjian's early change which cause infinite loop
r=shanjian sr=sfraser


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98486 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-02 22:29:19 +00:00
danm%netscape.com
d9369da2e2 keep nonmodal windows out of the modal window (topmost) layer. already on the trunk. bug 84047 r=alecf,jag a=chofmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98484 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-02 22:27:49 +00:00
pinkerton%netscape.com
ddde8477cf change cursor to show action feedback when keys held down. r=saari/sr=sfraser. bug# 87911
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98483 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-02 22:27:08 +00:00
cotter%netscape.com
71f1775754 help content update per b=85925, PDT approved, r=oeschger@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98472 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-02 21:23:01 +00:00
dcone%netscape.com
283db13612 bug 84017 r=kmcclusk sr=attinasi a=choffman. Added a style reflow to build frame model.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98464 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-02 20:24:24 +00:00
dcone%netscape.com
cf508f9dc1 bug 24406 r=kmmclusk sr=attinasi a=choffman. Added a style reflow to build frame model for printout
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98463 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-02 20:22:04 +00:00
bstell%netscape.com
449aa3da78 bug 85059, r=bstell@netscape, a=chofmann
fix bustage in the other OSs (C++ scoping problem)
this i jag's fix from the trunk applied to the branch


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98460 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-02 20:00:56 +00:00
mstoltz%netscape.com
cadd4797b4 Partial fix for bug 88167 - javascript URLs should never inherit the system
principal or a signed/privileged principal from the page they're called
against. r=bbaetz, sr=jst, a=lchiang


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98442 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-02 06:37:46 +00:00
blizzard%redhat.com
756b821e63 oops, left in an echo
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98410 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-01 19:50:49 +00:00
blizzard%redhat.com
208107228d properly handle relative and absolute path names in jvm paths
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98409 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-01 19:38:53 +00:00
ben%netscape.com
72e572a243 87371 - make preferences dialog size localizable.
r=vishy, sr=hyatt, a=chofmann


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98389 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-30 23:54:37 +00:00
ben%netscape.com
5dd2046ea5 87373 - make preferences dialog resizable.
r=vishy, sr=hyatt, a=chofmann.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98388 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-30 23:52:52 +00:00
dbaron%fas.harvard.edu
4d7312ffa7 Fix leak of strings (and potential for the same in other places) by converting to nsXPIDLCString. b=87245 r=bstell sr=waterson a=chofmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98381 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-30 19:01:14 +00:00
dbaron%fas.harvard.edu
3f054655ab Fix leak from complicated ownership cycle by releasing |mChromeEventHandler| in |CleanUp| and |SetDocShell|. b=87466 r=saari sr=hyatt a=chofmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98380 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-30 19:01:00 +00:00
dbaron%fas.harvard.edu
37e23da065 Correctly respond to pref changed notifications when dpi pref is set to 0 or -1 (special values). Fixes blank window after unconfirmed profile automigration. b=87843 r=attinasi sr=brendan a=chofmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98379 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-30 19:00:59 +00:00
dbaron%fas.harvard.edu
08aaf3ae93 Back out earlier change so that we again treat hyphen as numeric terminator rather than neutral (and conform to the Unicode Bidi algorithm rather than be compatible with IE). b=73251 r=simon@softel.co.il sr=hyatt a=chofmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98378 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-30 19:00:46 +00:00
dbaron%fas.harvard.edu
fee1f5d5c2 Fix BiDi regression from style system landing by correcting implementation of 'unicode-bidi' to be a non-inherited property, correctly mapping attributes to it, splitting text frames with both strong RTL and LTR characters, and stripping BiDi control characters. Code by me and lkemmel@il.ibm.com r=simon@softel.co.il sr=hyatt a=chofmann b=83958
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98377 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-30 18:59:45 +00:00
peterlubczynski%netscape.com
9e86368148 Fix for regxpcom.exe infinite loop with Beatnik registration bug 84411 patch by sean@betanik.com r=peterl sr=shaver
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98371 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-30 16:33:12 +00:00
peterlubczynski%netscape.com
0a236279e1 Fix for Plugins stop working after first clicking on reload once bug 87397 sr=dougt/darin
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98370 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-30 16:29:49 +00:00
katakai%japan.sun.com
9e1eab5b57 bug 80230
PDT+ RFE: need -region option to switch Region at start up
r=ccarlen, nhotta, sr=blizzard


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98353 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-30 03:44:06 +00:00
srilatha%netscape.com
9c84cde421 Fix for bug 86966. cahnged SavePrefFile to savePrefFile.
Added try catch for ldap calls. r=ducarroz, sr=alecf


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98348 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-30 01:39:59 +00:00
morse%netscape.com
f5c2f7d302 bugscape 4428, launch what's-new, r=bnesse, sr=alecf, a=chofmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98343 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-30 00:57:25 +00:00
sgehani%netscape.com
d330736ba0 Add basic mode search sidebar dropdown list of engines.
b  = 86483
r  = matt
sr = alecf


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98336 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-30 00:19:54 +00:00
bstell%netscape.com
2e7f56f32d bug 85059, r=ftang, sr=aflec, PDT+
if the user defined font fails to load, point to an empty
char map instead of a null pointer.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98333 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-30 00:14:39 +00:00
oeschger%netscape.com
022b1a0ef8 context sensitive 'key' addition, r=cotter, sr-less dispensation per 85925
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98331 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-30 00:01:56 +00:00
bstell%netscape.com
9ff348aa32 bug 87167, r=ftang@netscape.com, sr=blizzard@mozilla.org
adjust the thresholds where we decide to bitmap scale CJK fonts


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98330 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-29 23:59:56 +00:00
ftang%netscape.com
42a1c00e46 check in to moz0.92 branch for nhotta.
fix 87880. r=matt/ftang sr=alecf
change the fallback of locale from the buggy UserAgent locale to pref value.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98329 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-29 23:57:14 +00:00
javi%netscape.com
fbb4781e2c Fix For Bug 86548 Checking in for oescger
r=javi,sr=hewitt,a=clayton (on behalf of pdt2)

  Enable context sensitive help buttons for PSM2 dialogs.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98322 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-29 23:02:28 +00:00
cathleen%netscape.com
6ce7e43326 fix bug 85770, auto register components always called at startup. r=ssu
sr=alecf a=chofmann


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98321 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-29 22:57:09 +00:00
alecf%netscape.com
9d72d16360 fix for bug 11412 - history delete broke again..somehow. hacky fix for RTM branch
r=brade, sr=blake, a=chofmann


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98318 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-29 22:46:27 +00:00
javi%netscape.com
5173e61174 Fix for Bug 88256 r=mcgreer, sr=brendan, a=clayton (on behalf of pdt2)
Fix cert back-up on the Mac.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98314 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-29 22:31:59 +00:00
rpotts%netscape.com
a1ccd9b78b bug #87370 (r=dougt, sr=mscott, a=chofmann). These are both of the patches which allow multiple OnStopRequest notifications to be fired for multipart/mixed content and ensure that OnStopRequest is called even if the load fails...
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98313 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-29 22:24:11 +00:00
ssu%netscape.com
3f7fa435aa fixing bug 86959 - win32 installer needs to log additional data
bug 87456 - download time out should automatically reconnect
r=sgehani
rs=mscott


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98306 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-29 21:59:45 +00:00
bienvenu%netscape.com
ef530ce186 fix for missing msgs in thead with msgkey 1 r=naving, sr=sspitzer 84438
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98302 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-29 20:38:48 +00:00
ftang%netscape.com
17e592d390 check in for 82244 and 87700 . the previous fix for 82244 cause 87700. We back out the change and use a new way.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98300 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-29 20:35:40 +00:00
hewitt%netscape.com
09c0736e15 backing out blake's patch for 73065, a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98256 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-29 05:46:37 +00:00
oeschger%netscape.com
658a6aaae5 minor content updates per bug 85925, r=cotter
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98219 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-29 00:36:26 +00:00
brade%netscape.com
1a10d5a4e5 help for Composer dialogs (bug #6685)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98207 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-28 21:03:48 +00:00
brade%netscape.com
38bc2f590d delete previous word keybindings (bug #57967)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98206 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-28 21:01:29 +00:00
brade%netscape.com
baef1a7dda help buttons in Composer dialogs (bug #6685)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98205 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-28 21:00:34 +00:00
ddrinan%netscape.com
c4f5e922cb Checking fix for bug 87902 for Javi. r=ddrinan,sr=brendan,a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98198 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-28 20:06:52 +00:00
blakeross%telocity.com
529afe704f If Navigation toolbar disappears, it doesn't come back (73064). r=kerz sr=ben a=tor
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98196 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-28 19:53:39 +00:00
cotter%netscape.com
40a93a75e9 help content updates per b=85925, PDT approved, r=oeschger, a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98158 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-28 08:02:06 +00:00
syd%netscape.com
66753fbf22 Set tcp window size to rational value. Part of fix for 85716. r=ssu, sr=ben, a=chofmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98150 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-28 07:43:34 +00:00
sgehani%netscape.com
0a4a4c53e0 Strip libs before making xpi packages.
b  = 88129
r  = ssu
sr = granrose


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98136 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-28 03:06:05 +00:00
bryner%uiuc.edu
1db63fb1d5 Bug 75049 - Enable NSS for carbon build. patch from beard, r=mcgreer, sr=nelsonb, a=asa.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98122 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-28 01:44:13 +00:00
javi%netscape.com
3e7bb48c81 Fix for Bug 87865 r=mcgreer,nelsonb sr=blizzard, a=asa
Fix KEYGEN on the Mac by using the defined constant SEIVE_SIZE 
  instead of the sizeof operator.  This caused problem because the 
  var sieve was of type unsigned char * instead of unsigned char[]
  like the other platforms.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98106 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-28 00:39:32 +00:00
sspitzer%netscape.com
7a5b28641e fix for #86197. fix the "any" / "all" radio button in the classic skin.
(this patch comes from a larger patch that already landed on the trunk.)
fix by blake, sr=sspitzer, a=asa


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98105 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-28 00:34:07 +00:00
ducarroz%netscape.com
ac4d214f0f Fix for bug 87980. Fix security breach. R=vidur, SR=brendan, A=chofmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98087 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 21:07:34 +00:00
jj%netscape.com
f96694d4c8 fix for bugscape 6252 (update version string to 0.9.2 on the branch) r=granrose, a=pdt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98086 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 19:57:25 +00:00
oeschger%netscape.com
ca2f139006 bug=46226, sr=blizzard, r=mkaply, setting os2 up with proper prefs buttons, a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98079 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 19:06:09 +00:00
blizzard%redhat.com
5f639e0bf2 bug #87629. bookmarks corrupted when filed. patch to fix by calling exists() instead of relying on exception to be thrown. r/sr=dougt/alecf
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98078 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 18:42:25 +00:00
blizzard%redhat.com
9495c53b8c check for specific versions of the JVM to see if we need to set LD_ASSUME_KERNEL
.  not part of the build.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98076 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 17:52:31 +00:00
oeschger%netscape.com
f910db78b3 update to cshelp keys, b=46226, r=cotter, a=asa for immediate check-in on branch
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98074 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 17:41:57 +00:00
oeschger%netscape.com
7f2668139f fix=walk84, a=asa for immediate check-in, r=oeschger, bug=87487, help packaging issue, plus minor content updates
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98073 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 17:30:28 +00:00
sicking%bigfoot.com
01b51438fe Bustage fix. This should hopfully be the last one. Corrected case in UInt32
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98072 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 17:16:56 +00:00
sicking%bigfoot.com
fedc0edf3b bustage fix. Checked in a too fresh version of txKeyFunctionCall.cpp. It should be UInt32 on the branch.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98070 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 16:53:24 +00:00
blizzard%redhat.com
05386278ce bug #87834. Crash when saving a forced backup *.p12 file. Checking in for javi. r=ddrinan, sr=blizzard
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98068 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 16:38:02 +00:00
peterv%netscape.com
71bbc07422 Implement <xsl:key> and the key() xslt function. Also extend the Map class to enable it to own either it's key-objects or it's value-objects, not just both.
b=65986, r=peterv,pike sr=jst a=blizzard


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98067 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 16:31:02 +00:00
sicking%bigfoot.com
d10e942c53 Implement <xsl:key> and the key() xslt function. Also extend the Map class to enable it to own either it's key-objects or it's value-objects, not just both.
b=65986, r=peterv,pike sr=jst a=blizzard


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98066 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 16:28:35 +00:00
blizzard%redhat.com
04a55769a3 bug #87360. PSM manager does not work on https sites. Merged from tip.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98065 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 15:30:27 +00:00
blizzard%redhat.com
aa0724f069 bug #83906. Fix crashes when hitting search in mail/news. Specifically "Outliner crashes when columns are hidden by default." r/sr=blake/hyatt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98064 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 15:26:41 +00:00
blizzard%redhat.com
f19d199cba bug #87999. "selector *:not(X):pseudo-element does not consider the negation" Moved from the tip.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98062 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 15:03:33 +00:00
blizzard%redhat.com
158c32ddeb Fix bug #87610. Crash when viewing Arabic or hebrew content. Moved from the trunk.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98061 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 15:00:25 +00:00
blizzard%redhat.com
fa13563270 Fix bug #87710. Checkin for darin. Make sure that the image cache expires cache entries according to headers and revalidate properly.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98060 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 14:48:57 +00:00
pinkerton%netscape.com
753df81810 don't increment the number of menus unless the menu is actually visible. r=saari/sr=ben/a=asa. bug# 83430.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98051 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 06:37:44 +00:00
ddrinan%netscape.com
b8aeb7c25f Bug # 87182. r=javi,sr=hyatt, a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98050 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 06:29:17 +00:00
ddrinan%netscape.com
4730808ad7 Bug # 97922. r=lord,sr=darin,a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98046 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 04:51:11 +00:00
joki%netscape.com
d0ab9863a1 Fix 0.9.2 bug. Add code to prevent double release of timeout during reentrant timeout dispatch. sr:jst, r:vidur, pr:beard
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98045 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 04:48:50 +00:00
ddrinan%netscape.com
35cc6595c7 Bug # 97922. r=lord,sr=darin,a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98044 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 04:46:53 +00:00
leaf%mozilla.org
1589591ff1 pull NSS_CO_TAG from the 0.9.2 branch; a=leaf
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98038 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 03:58:43 +00:00
danm%netscape.com
2c5ab92e59 add titlebar to other... font size dialog. bug 82105 r=ben,hyatt a=chofmann (branch version; this change is already on the trunk)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98037 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 03:57:02 +00:00
beard%netscape.com
21f61fc00a Fix for bug #81659, r=pinkerton/wtc, sr=sfraser, a=clayton.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98035 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 03:45:09 +00:00
ben%netscape.com
a086d13512 Add content pack jar file to packager files for 65251. r=hixie, sr=hyatt, a=chofmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98033 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 03:31:06 +00:00
cotter%netscape.com
9b0414915f Second of two changes needed to fix bug 82434, r =javi, sr=darin, a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98027 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 02:53:58 +00:00
cotter%netscape.com
11c8f1d06b One of two wording changes required to fix bug 82434 r=javi, sr=darin, a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98025 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 02:49:19 +00:00
(no author)
f2798b3aab This commit was manufactured by cvs2svn to create branch
'MOZILLA_0_9_2_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@98013 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-27 01:42:47 +00:00
jfrancis%netscape.com
97f340020a 092 branch landing of bug fix 84744: insert br after user creates table if table is last node in block
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97992 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 23:10:27 +00:00
leaf%mozilla.org
c1d6cff586 bug 85459, a=tor
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97989 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 22:31:04 +00:00
cls%seawood.org
891b871fa9 Add --without-system-nspr option.
Bug #87612 r=bryner a=blizzard


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97987 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 22:22:49 +00:00
jelwell%netscape.com
6f684fb638 Checked in for leaf, r=, sr= are in the bug - a=leaf, bug 86323
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97986 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 22:12:26 +00:00
leaf%mozilla.org
a1cd743ede bug 86323, a=chofmann, use standard zlib 1.1.3 to avoid conflicts for embedding
clients


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97984 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 21:58:30 +00:00
attinasi%netscape.com
66233b8535 Stripping out leading and trailing whitespace from image src-attributes. r=heikki sr=blizzard a=asa for bug 79929 (branch only)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97981 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 21:39:43 +00:00
mkaply%us.ibm.com
f291bbd3ec #84420
r=mkaply for OS/2, r=r=VYA04230@nifty.com for BeOS, sr=darin, a=asa for drivers
Code from gordon to make DNS on OS/2 and BeOS use the same paths as Unix


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97979 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 21:36:50 +00:00
ssu%netscape.com
5e8bfbdae8 fixing bug 77244 - Installers need to create Win32 Reg. key schema that Gecko Embedding browsers can follow. r=sgehani, sr=mscott, a=drivers. not part of tinderbox builds. affects only windows platforms.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97973 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 21:21:13 +00:00
ssu%netscape.com
8a37f20df2 fixing bug 87721 - UI cleanup of uninstaller. r=sgehani, sr=mscott, a=drivers. affects only windows platforms.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97971 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 21:19:01 +00:00
ssu%netscape.com
bfed79a328 fixing bug 87702 - Change UI text for mozilla setup. r=sgehani, sr=mscott, a=drivers. not part of tinderbox builds. affects only windows platforms
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97969 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 21:13:12 +00:00
sspitzer%netscape.com
b4c2256488 fix for #84156. get news searches to work with "@".
r=cavin, sr=mscott, a=asa


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97964 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 20:54:45 +00:00
jj%netscape.com
20f26c7bc8 #4830: turning traceback off in optimized builds on MOZILLA_0_9_2_BRANCH
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97960 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 19:57:39 +00:00
darin%netscape.com
8ef710175c Fixes bug 86133 'Conn+DNS: no "could not be found" dialog for DNS errors'
r=gagan, sr=waterson, a=blizzard


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97959 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 19:38:12 +00:00
kmcclusk%netscape.com
0d6826d71f check for a null mPrintContext in nsPostScriptObj destructor to fix crash when the open of the postscript file fails. bug 85535, sr=attinasi@netscape.com,r=dcone@netscape.com,a=asa@mozilla.org
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97957 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 19:32:28 +00:00
mkaply%us.ibm.com
c583910ece #86711
r=cls, a=blizzard (drivers)
gmake clean deletes dom/public/idl/core directory on OS/2


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97956 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 18:43:00 +00:00
anthonyd%netscape.com
ac6f497063 checking in mjudge's fix for 82151 - right arrow key in textarea
r=cmanske@netscape.com, anthonyd@netscape.com
sr=kin@netscape.com
a=asa@mozilla.org


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97955 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 18:38:21 +00:00
anthonyd%netscape.com
24babfc28a fix for 84208 - calling extractContents crashes browser
r=sfraser@netscape.com
sr=kin@netscape.com
a=asa@mozilla.org


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97954 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 18:34:50 +00:00
javi%netscape.com
04862385bd Fix for Bug 87675 r=ddrinan,sr=alecf,a=blizzard
Only copy the CERTCertTrust field if it's non-NULL in the appropriate
  nsNSSCertTrust contstructor and provide a default case for the cert
  type so that we don't go in and try to verify with an unknown certUsage.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97951 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 17:50:47 +00:00
blizzard%redhat.com
4f9d9fd485 Fix bug #87534. Parse content-type properly for multipart/mixed documents. r=dougt,sr=darin,a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97949 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 16:38:11 +00:00
brade%netscape.com
859d65f04a remove debug menu from Composer (#83349)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97943 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 13:06:50 +00:00
jaggernaut%netscape.com
c14d9a7929 Bug 78458: ``Remove our broken text/rtf support'', patch by Boris Zbarsky <bzbarsky@mit.edu>, r=harishd, sr=jst, a=tor
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97929 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 05:24:21 +00:00
dougt%netscape.com
e3d76d82dd Fixes 87289 - context menu bustage fix - r=gagan@netscape.com, sr=alecf@nets
cape.com, a=chofmann


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97924 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 05:00:39 +00:00
peterlubczynski%netscape.com
5412099ab1 Fix for bug 87755, a comparison problem r=alexsavulov & sr=attinasi a=chofmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97922 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 04:46:19 +00:00
bryner%uiuc.edu
87fc81f148 Bug 82123 -- enable embeddors to alter the focus traversal so that the document itself receives focus first instead of last. r=saari, adamlock, sr=jst, a=chofmann.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97914 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 01:26:34 +00:00
attinasi%netscape.com
0d509fabe2 Fixed allocation alignment problem: checking in for jim_nance@yahoo.com
b=85890 r=attinasi sr=alecf a=blizzard


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97909 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 00:54:51 +00:00
morse%netscape.com
8be1cd88a3 bug 86885 crash if cookie service not available, c=waterson, r=morse, sr=scc, a=chofmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97908 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 00:17:32 +00:00
ftang%netscape.com
e40723808c fix 87224. r=bstell sr=waterson a=tor
improve ibench 5% by moving converter cache from class static to global


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97904 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-26 00:10:15 +00:00
locka%iol.ie
e37904d5d9 Added missing interface to NS_IMPL_ISUPPORTS macro. sr=jst@netscape.com a=asa@mozilla.org b=86641
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97894 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-25 22:22:57 +00:00
tor%cs.brown.edu
946f6074a9 Bug 87540 - nsImageFrame was offsetting invalidate rect by one pixel
for historical reasons (jpeg decoder used to one-index update rect).
r=kmcclusk, sr=blizzard, a=asa


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97893 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-25 22:19:54 +00:00
tor%cs.brown.edu
fd934a50d0 Bug 87550 - nsImageFrame wasn't adjusting for bordering padding when
invalidating itself.  r=kmcclusk, sr=blizzard, a=asa


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97892 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-25 22:19:18 +00:00
ducarroz%netscape.com
e4051bd01e Fix for bug 84065. Add an AppleFileDecoder into the stream converters and modify save/save all attachment in order to be able to select the decoder when dealing with an apple double attachment. R=mscott, SR=sspitzer, A=asa@mozilla.org
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97890 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-25 22:18:48 +00:00
(no author)
dff96daeee This commit was manufactured by cvs2svn to create branch
'MOZILLA_0_9_2_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97887 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-25 22:11:44 +00:00
alecf%netscape.com
d74efca4b1 fix for bug 83489 - fix the url-duping code in session history so that we don't throw exceptions on badly formed urls
r=dougt, sr=blizzard, a=chofmann


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97885 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-25 22:01:35 +00:00
oeschger%netscape.com
aff82b47d0 putting latest help content into mozilla, a=asa, b=85925
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97882 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-25 21:52:11 +00:00
kin%netscape.com
12c47b6b4d Fix for bug #87133 Can't select last few lines of text in an Editor
Modified GetClosestLine() to include first (0) and last (n-1) line
in search if neccessary. Returned index should now be guaranteed to be
within 0 to n-1 when exiting main loop. Removed unused var and define,
added comments, and renamed countLines to numLines.

r=waterson@netscape.com,mjudge@netscape.com
sr=blizzard@mozilla.org
a=chofmann@netscape.com


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97861 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-25 14:06:19 +00:00
ccarlen%netscape.com
9e992b33df Bug 86922 - app hangs after profile migration dialog. r=danm/sr=alecf/a=chofmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97860 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-25 14:00:06 +00:00
jdunn%netscape.com
a4c750efec fixing AIX bustage to match trunk checkin
a= chofmann@netscape.com
r= javi@netscape.com
# 82377


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97859 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-25 12:42:13 +00:00
rpotts%netscape.com
1e5d3a1933 bug #82458 (r=jst, sr=darin, a=blizzard). This patch causes STATE_TRANSFERRING notifications to fire when URLs are loaded out of the disk cache or memory cache
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97857 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-25 08:04:54 +00:00
rpotts%netscape.com
a342a9d9a0 bug #68955 (r=vidur, sr=jst, a=choffman). This patch prevents the short-circuit optimization for the image src attribute.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97856 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-25 07:48:22 +00:00
ddrinan%netscape.com
67b053dfbc Bug# 86872. r=javi,sr=blizzard,a=blizzard
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97853 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-25 02:02:02 +00:00
javi%netscape.com
45e5889728 Fix typo
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97851 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-24 20:32:49 +00:00
javi%netscape.com
e62b8c3252 Fixing typo
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97850 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-24 20:31:04 +00:00
javi%netscape.com
082d7280b5 Fixing typo.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97849 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-24 20:28:02 +00:00
mcgreer%netscape.com
ce5efe3046 fix for 82882, add .p12 extension
r=javi,sr=blizzard,a=choffman for 0.9.2 branch


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97848 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-24 19:17:13 +00:00
bstell%netscape.com
fc2eca685a bug 87055, r=dr@netscape.com, sr=blizzard@mozilla.org, a=tor@acm.org
adjust the threshold where X mozilla decides to use a wrong sized
(but good looking) bitmap font vs a right sized (but ugly) bitmap
scaled font


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97840 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-24 02:19:33 +00:00
mitesh%netscape.com
5b67363f2f Fixes for bug 70348 - autoconfig feature
r=bnesse, sr=alecf and a=dbaron


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97838 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-23 22:49:46 +00:00
cls%seawood.org
acbc3e0928 Remove gfx/src/gtk from xprint INCLUDES so that the proper nsGCCache.h is found. Fixes alternate toolkit bustage.
Bug #87148 r=daa@distributed.net a=tor


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97836 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-23 22:03:37 +00:00
racham%netscape.com
886d2e4827 Part of Fix to bug 87396. Set the global pref to point special folders prefs to server to true. r,sr=sspitzer a=chofmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97834 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-23 21:23:49 +00:00
racham%netscape.com
3f5ae1c5f2 Fixing bug 87396. Today, when a new IMAP account is created special folder prefs are pointed to the server. This will be a problem for ISPs who do not want allow any folder creation on their servers and it is not very user friendly experience for end user in such a case. This check in allows ISPs to turn off that default setting to point to server via rdf file. Local folders will be used as home for special folders in such cases. r,sr=sspitzer a=chofmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97833 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-23 21:23:38 +00:00
javi%netscape.com
8ea982c660 Fix for Bug 75596 r=mcgreer, sr=blizzard, a=chofmann (for trunk)
Add 20 pixels in height to some SSL error dialogs and add
  key press events to get rid of the dialogs.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97829 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-23 19:44:17 +00:00
mcgreer%netscape.com
1500110217 fix for 82375, UI fixes in password change
r=javi,sr=blizzard,a=choffman for 0.9.2 branch


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97826 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-23 19:28:21 +00:00
blizzard%redhat.com
643a3f1970 disable xprint. not part of the build.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97821 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-23 15:42:52 +00:00
blizzard%redhat.com
7998b1b8b8 add spec file for 0.9.2 pre-release builds. not part of the build.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97820 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-23 15:20:05 +00:00
blizzard%redhat.com
f3a6aad8dd make mozilla-devel depend on mozilla. not part of the build.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97818 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-23 15:12:36 +00:00
mcgreer%netscape.com
595b86dfaa fix for 82895
some certs not verifying
a=javi;sr,a=blizzard
a=choffman for 0.9.2


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97816 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-23 13:56:02 +00:00
mcgreer%netscape.com
75e6dd047a fix for 87185
verisign & thawte timestamping roots added to builtin token
a=choffman for 0.9.2


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97815 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-23 13:53:49 +00:00
waterson%netscape.com
5e42801b08 Bug 87346. Fix txtsvc makefile to create component DLL. r=kin, a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97810 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-23 05:45:43 +00:00
tor%cs.brown.edu
f1b8ea833d Bug 86822 - gif spacer image detector was looking at uninitialized data;
animated gif spacer flag wasn't being updated.  r=pavlov, sr=blizzard, a=dbaron


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97809 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-23 05:07:43 +00:00
jj%netscape.com
33d3a50af8 Pulling from MOZILLA_0_9_2_BRANCH
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97802 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-23 00:54:31 +00:00
(no author)
c046cb3226 This commit was manufactured by cvs2svn to create branch
'MOZILLA_0_9_2_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_2_BRANCH@97789 18797224-902f-48f8-a5cc-f745e15eee43
2001-06-22 18:35:25 +00:00
23326 changed files with 4717872 additions and 106011 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."

197
mozilla/Makefile.in Normal file
View File

@@ -0,0 +1,197 @@
#
# 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
DIRS = config build
ifdef MOZ_JAVA_SUPPLEMENT
DIRS += \
java/util \
java/webclient \
$(NULL)
endif
# boehm needs to be built before XPCOM
ifdef GC_LEAK_DETECTOR
DIRS += gc/boehm
endif
DIRS += $(NSPRPUB_DIR)
DIRS += dbm modules/libreg js string xpcom js/src/xpconnect
ifdef MOZ_OJI
DIRS += js/src/liveconnect
endif
ifdef MOZ_JSDEBUGGER
DIRS += js/jsd
endif
ifndef MOZ_NATIVE_ZLIB
DIRS += modules/zlib
endif
ifndef MOZ_NATIVE_JPEG
DIRS += jpeg
endif
ifdef MOZ_ENABLE_XLIB
DIRS += gfx/src/xlibrgb widget/src/xlibxtbin
endif
ifdef MOZ_ENABLE_GTK
DIRS += widget/src/gtksuperwin widget/src/gtkxtbin
endif
# Linux and Solaris installer needs standalone libjar, hence standalone zlib
ifneq (,$(filter Linux SunOS,$(OS_ARCH)))
DIRS += modules/zlib/standalone
endif
DIRS += \
widget/timer \
include \
modules/libutil \
netwerk \
modules/mpfilelocprovider \
uriloader \
intl \
modules/libpref \
modules/libimg \
modules/oji \
modules/libjar \
caps \
rdf \
expat \
htmlparser \
gfx \
$(NULL)
ifdef USE_IMG2
DIRS += gfx2 modules/libpr0n
endif
DIRS += \
modules/plugin \
dom \
view \
widget \
content \
layout \
db \
docshell \
webshell \
embedding \
editor \
sun-java \
profile \
themes \
$(NULL)
ifdef ACCESSIBILITY
DIRS += accessible
endif
# This must preceed xpfe
ifdef MOZ_JPROF
DIRS += tools/jprof
endif
ifdef MOZ_BUILD_XPFE
DIRS += xpfe
endif
DIRS += xpinstall
ifdef MOZ_PSM
ifdef MOZ_NSS_AUTOCONF
DIRS += security/nss
endif
DIRS += security/manager
endif
ifdef MOZ_LDAP_XPCOM
DIRS += directory/c-sdk/ldap directory/xpcom
endif
ifdef MOZ_EXTENSIONS
DIRS += extensions
endif
ifdef MOZ_MAIL_NEWS
DIRS += mailnews
endif
ifdef MOZ_LEAKY
DIRS += tools/leaky
endif
ifdef ENABLE_TESTS
DIRS += xpcom/tests
endif
DIRS += l10n
ifneq (,$(MOZ_STATIC_COMPONENTS)$(MOZ_META_COMPONENTS))
DIRS += modules/staticmod
endif
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
export::
+$(LOOP_OVER_EXPORT_DIRS)
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,56 @@
#
# 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
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) \
$(EXTRA_DSO_LIBS) \
-lgkgfx \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,46 @@
#!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
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,60 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* 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):
*/
#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,45 @@
#
# 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 \
$(NULL)
EXPORTS = \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,38 @@
#!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 \
$(NULL)
EXPORTS = \
$(NULL)
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,67 @@
/* -*- 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 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,189 @@
/* -*- 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();
// 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(in nsIAccessibleEventListener aListener);
};

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,58 @@
#
# 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 layout widget dom view locale gfx2 js intl docshell webshell necko uriloader htmlparser xuldoc
CPPSRCS = \
nsAccessible.cpp \
nsAccessibilityService.cpp \
nsRootAccessible.cpp \
nsHTMLIFrameRootAccessible.cpp \
nsHTMLFormControlAccessible.cpp \
nsHTMLTextAccessible.cpp \
nsHTMLTableAccessible.cpp \
nsHTMLImageAccessible.cpp \
nsHTMLAreaAccessible.cpp \
nsHTMLLinkAccessible.cpp \
nsHTMLSelectListAccessible.cpp \
nsHTMLComboboxAccessible.cpp \
nsHTMLListboxAccessible.cpp \
nsGenericAccessible.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,688 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Original Author: David W. Hyatt (hyatt@netscape.com)
*
* Contributor(s):
*/
#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 "nsHTMLTableAccessible.h"
#include "nsHTMLImageAccessible.h"
#include "nsHTMLAreaAccessible.h"
#include "nsHTMLLinkAccessible.h"
#include "nsHTMLSelectListAccessible.h"
#include "nsHTMLComboboxAccessible.h"
#include "nsHTMLListboxAccessible.h"
#include "nsIDOMHTMLAreaElement.h"
#include "nsHTMLFormControlAccessible.h"
#include "nsILink.h"
#include "nsIDocShellTreeItem.h"
#include "nsIDOMDocument.h"
#include "nsIDOMHTMLOptionElement.h"
// IFrame
#include "nsIDocShell.h"
#include "nsHTMLIFrameRootAccessible.h"
//--------------------
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;
}
/* 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;
}
/* 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 = new nsHTMLTextAccessible(node, 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;
}
/* 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;
nsIImageFrame* imageFrame = nsnull;
// not using a nsCOMPtr frames don't support them.
aFrame->QueryInterface(NS_GET_IID(nsIImageFrame), (void**)&imageFrame);
if (!imageFrame)
return NS_ERROR_FAILURE;
*_retval = new nsHTMLImageAccessible(node, imageFrame, 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::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));
*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;
document->GetShellAt(0, getter_AddRefs(tempShell));
nsCOMPtr<nsIWeakReference> weak = do_GetWeakReference(tempShell);
NS_IF_ADDREF(*aShell = weak);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateAccessible(nsIDOMNode* node, nsISupports* document, nsIAccessible **_retval)
{
nsCOMPtr<nsIContent> content (do_QueryInterface(node));
nsCOMPtr<nsIDocument> d (do_QueryInterface(document));
if (!d)
return NS_ERROR_FAILURE;
#ifdef DEBUG
PRInt32 shells = d->GetNumberOfShells();
NS_ASSERTION(shells > 0,"Error no shells!");
#endif
nsCOMPtr<nsIPresShell> tempShell;
d->GetShellAt(0, getter_AddRefs(tempShell));
nsCOMPtr<nsIWeakReference> wr = do_GetWeakReference(tempShell);
*_retval = new nsAccessible(node, wr);
if ( *_retval ) {
NS_ADDREF(*_retval);
return NS_OK;
}
return NS_ERROR_OUT_OF_MEMORY;
}
NS_IMETHODIMP
nsAccessibilityService::CreateHTMLBlockAccessible(nsIDOMNode* node, nsISupports* document, nsIAccessible **_retval)
{
nsCOMPtr<nsIContent> content (do_QueryInterface(node));
nsCOMPtr<nsIDocument> d (do_QueryInterface(document));
if (!d)
return NS_ERROR_FAILURE;
#ifdef DEBUG
PRInt32 shells = d->GetNumberOfShells();
NS_ASSERTION(shells > 0,"Error no shells!");
#endif
nsCOMPtr<nsIPresShell> tempShell;
d->GetShellAt(0, getter_AddRefs(tempShell));
nsCOMPtr<nsIWeakReference> wr = do_GetWeakReference(tempShell);
*_retval = new nsAccessible(node, wr);
if ( *_retval ) {
NS_ADDREF(*_retval);
return NS_OK;
}
return NS_ERROR_OUT_OF_MEMORY;
}
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;
}
//-----------------------------------------------------------------------
// This method finds the content node in the parent document
// corresponds to the docshell
// This code is copied and pasted from nsEventStateManager.cpp
// Is also inefficient - better solution should come along as part of
// Bug 85602: "FindContentForDocShell walks entire content tree"
// Hopefully there will be a better method soon, with a public interface
nsIContent*
nsAccessibilityService::FindContentForDocShell(nsIPresShell* aPresShell,
nsIContent* aContent,
nsIDocShell* aDocShell)
{
NS_ASSERTION(aPresShell, "Pointer is null!");
NS_ASSERTION(aDocShell, "Pointer is null!");
NS_ASSERTION(aContent, "Pointer is null!");
nsCOMPtr<nsISupports> supps;
aPresShell->GetSubShellFor(aContent, getter_AddRefs(supps));
if (supps) {
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(supps));
if (docShell.get() == aDocShell)
return aContent;
}
// walk children content
PRInt32 count;
aContent->ChildCount(count);
for (PRInt32 i=0;i<count;i++) {
nsCOMPtr<nsIContent> child;
aContent->ChildAt(i, *getter_AddRefs(child));
nsIContent* foundContent = FindContentForDocShell(aPresShell, child, aDocShell);
if (foundContent != nsnull) {
return foundContent;
}
}
return nsnull;
}
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<nsIDocShell> docShell(do_QueryInterface(pcContainer));
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(docShell));
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));
nsIContent *tempContent;
tempContent = FindContentForDocShell(parentPresShell, rootContent, docShell);
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;
/********** 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 PR_FALSE; // 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));
shell = ownerShell;
content = ownerContent;
}
/*********** If still no nsIContent, return ************/
if (!content)
return PR_FALSE;
/*********** Try using frame to get IAccessible *******/
nsIFrame* frame = nsnull;
shell->GetPrimaryFrameFor(content, &frame);
if (!frame)
return PR_FALSE;
nsCOMPtr<nsIAccessible> newAcc;
frame->GetAccessible(getter_AddRefs(newAcc));
/*********** Try QI'ing node to get nsIAccessible *******/
if (!newAcc)
newAcc = do_QueryInterface(aNode);
/*********** 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,59 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
*
* Original Author: David W. Hyatt (hyatt@netscape.com)
*
* Contributor(s):
*/
#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);
void GetOwnerFor(nsIPresShell *aPresShell, nsIPresShell **aOwnerShell, nsIContent **aOwnerContent);
nsIContent* FindContentForDocShell(nsIPresShell* aPresShell, nsIContent* aContent, nsIDocShell* aDocShell);
};
#endif /* __nsIccessibilityService_h__ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,155 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
*/
#ifndef _nsAccessible_H_
#define _nsAccessible_H_
#include "nsISupports.h"
#include "nsGenericAccessible.h"
#include "nsCOMPtr.h"
#include "nsIContent.h"
#include "nsIDOMNode.h"
#include "nsIPresShell.h"
#include "nsIPresContext.h"
#include "nsWeakReference.h"
#include "nsIFocusController.h"
#include "nsRect.h"
#include "nsPoint.h"
#define ACCESSIBLE_BUNDLE_URL "chrome://global/locale/accessible.properties"
class nsIFrame;
class nsIDocShell;
class nsIWebShell;
class nsIContent;
class nsAccessible : public nsGenericAccessible
{
public:
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 GetDocShellFromPS(nsIPresShell* aPresShell, nsIDocShell** aDocShell);
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:
virtual nsIFrame* GetFrame();
virtual nsIFrame* GetBoundsFrame();
virtual void GetBounds(nsRect& aRect, nsIFrame** aRelativeFrame);
virtual void GetPresContext(nsCOMPtr<nsIPresContext>& aContext);
NS_IMETHOD AppendFlatStringFromSubtree(nsIContent *aContent, nsAWritableString *aFlatString);
NS_IMETHOD AppendFlatStringFromContentNode(nsIContent *aContent, nsAWritableString *aFlatString);
// Data Members
nsCOMPtr<nsIDOMNode> mDOMNode;
nsCOMPtr<nsIWeakReference> mPresShell;
nsCOMPtr<nsIFocusController> mFocusController;
};
/* Special Accessible that knows how to handle hit detection for flowing text */
class nsHTMLBlockAccessible : public nsAccessible
{
public:
nsHTMLBlockAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD AccGetAt(PRInt32 x, PRInt32 y, nsIAccessible **_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);
};
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;
};
#endif

View File

@@ -0,0 +1,224 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Eric Vaughan (evaughan@netscape.com)
* Contributor(s):
*/
#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;
}

View File

@@ -0,0 +1,51 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Eric D Vaughan (evaughan@netscape.com)
* Contributor(s):
*/
#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,478 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
*/
#include "nsIAccessible.h"
#include "nsRootAccessible.h"
#include "nsCOMPtr.h"
#include "nsIDocument.h"
#include "nsIPresShell.h"
#include "nsIPresContext.h"
#include "nsIContent.h"
#include "nsIFrame.h"
#include "nsIDOMEventTarget.h"
#include "nsIDOMElement.h"
#include "nsIDOMEventReceiver.h"
#include "nsReadableUtils.h"
#include "nsILink.h"
#include "nsHTMLFormControlAccessible.h"
#include "nsHTMLLinkAccessible.h"
#include "nsIURI.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.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 "nsHTMLSelectListAccessible.h"
#include "nsIDOMHTMLSelectElement.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_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"))
{
mListener = nsnull;
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
NS_ASSERTION(shell,"Shell is gone!!! What are we doing here?");
shell->GetDocument(getter_AddRefs(mDocument));
mDOMNode = do_QueryInterface(mDocument);
nsLayoutAtoms::AddRefAtoms();
}
//-----------------------------------------------------
// destruction
//-----------------------------------------------------
nsRootAccessible::~nsRootAccessible()
{
nsLayoutAtoms::ReleaseAtoms();
RemoveAccessibleEventListener(mListener);
}
/* attribute wstring accName; */
NS_IMETHODIMP nsRootAccessible::GetAccName(nsAWritableString& aAccName)
{
return GetTitle(aAccName);
}
// helpers
nsIFrame* nsRootAccessible::GetFrame()
{
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
if (!shell)
return nsnull;
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)
{
return nsDocAccessibleMixin::GetAccState(aAccState);
}
NS_IMETHODIMP nsRootAccessible::GetAccValue(nsAWritableString& aAccValue)
{
return GetURL(aAccValue);
}
/* void addAccessibleEventListener (in nsIAccessibleEventListener aListener); */
NS_IMETHODIMP nsRootAccessible::AddAccessibleEventListener(nsIAccessibleEventListener *aListener)
{
if (!mListener)
{
// 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));
// use AddEventListener from the nsIDOMEventTarget interface
nsCOMPtr<nsIDOMEventTarget> target;
if (NS_SUCCEEDED(document->QueryInterface(NS_GET_IID(nsIDOMEventTarget), getter_AddRefs(target))) && target)
{
nsresult rv = NS_OK;
// we're a DOMEventListener now!!
nsCOMPtr<nsIDOMEventListener> listener;
rv = this->QueryInterface( NS_GET_IID(nsIDOMEventListener), getter_AddRefs(listener) );
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to QI");
// capture DOM focus events
rv = target->AddEventListener( NS_LITERAL_STRING("focus") , listener, PR_TRUE );
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to register listener");
// capture Form change events
rv = target->AddEventListener( NS_LITERAL_STRING("change") , listener, 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") , listener, 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") , listener, PR_TRUE );
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to register listener");
}
}
// create a weak reference to the listener
mListener = aListener;
return NS_OK;
}
/* void removeAccessibleEventListener (in nsIAccessibleEventListener aListener); */
NS_IMETHODIMP nsRootAccessible::RemoveAccessibleEventListener(nsIAccessibleEventListener *aListener)
{
if (mListener)
{
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
nsCOMPtr<nsIDocument> document;
if (!shell)
return NS_OK;
shell->GetDocument(getter_AddRefs(document));
nsCOMPtr<nsIDOMEventReceiver> erP;
if (NS_SUCCEEDED(document->QueryInterface(NS_GET_IID(nsIDOMEventReceiver), getter_AddRefs(erP))) && erP)
{
nsresult rv = erP->RemoveEventListenerByIID(NS_STATIC_CAST(nsIDOMFocusListener *, this), NS_GET_IID(nsIDOMFocusListener));
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to register 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);
}
nsDocAccessibleMixin::nsDocAccessibleMixin(nsIDocument *aDoc):mDocument(aDoc)
{
}
nsDocAccessibleMixin::nsDocAccessibleMixin(nsIWeakReference *aPresShell)
{
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(aPresShell));
NS_ASSERTION(shell,"Shell is gone!!! What are we doing here?");
shell->GetDocument(getter_AddRefs(mDocument));
}
nsDocAccessibleMixin::~nsDocAccessibleMixin()
{
}
NS_IMETHODIMP nsDocAccessibleMixin::GetURL(nsAWritableString& aURL)
{
nsCOMPtr<nsIURI> pURI;
mDocument->GetDocumentURL(getter_AddRefs(pURI));
nsXPIDLCString path;
pURI->GetSpec(getter_Copies(path));
aURL.Assign(NS_ConvertUTF8toUCS2(path).get());
//XXXaaronl Need to use CopyUTF8toUCS2(nsDependentCString(path), aURL); when it's written
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)
{
if (mDocument)
return mDocument->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::GetAccState(PRUint32 *aAccState)
{
// Screen readers need to know when the document is finished loading (STATE_BUSY flag)
// We do it this way, rather than via nsIWebProgressListener, because
// if accessibility was turned on after a document already finished loading,
// we would get no state changes from nsIWebProgressListener.
// The GetBusyFlags method, however, always has the current busy state information for us.
*aAccState = 0;
if (mDocument) {
nsCOMPtr<nsIPresShell> presShell;
mDocument->GetShellAt(0, getter_AddRefs(presShell));
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) {
PRUint32 busyFlags;
docShell->GetBusyFlags(&busyFlags);
if (busyFlags != nsIDocShell::BUSY_FLAGS_NONE)
*aAccState = nsIAccessible::STATE_BUSY;
}
}
}
}
}
return NS_OK;
}

View File

@@ -0,0 +1,106 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
*/
#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"
class nsDocAccessibleMixin
{
public:
nsDocAccessibleMixin(nsIDocument *doc);
nsDocAccessibleMixin(nsIWeakReference *aShell);
virtual ~nsDocAccessibleMixin();
NS_DECL_NSIACCESSIBLEDOCUMENT
NS_IMETHOD GetAccState(PRUint32 *aAccState);
protected:
nsCOMPtr<nsIDocument> mDocument;
};
class nsRootAccessible : public nsAccessible,
public nsDocAccessibleMixin,
public nsIAccessibleDocument,
public nsIAccessibleEventReceiver,
public nsIDOMFocusListener,
public nsIDOMFormListener
{
NS_DECL_ISUPPORTS_INHERITED
public:
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(nsIAccessibleEventListener *aListener);
// ----- nsIDOMEventListener --------------------------
NS_IMETHOD HandleEvent(nsIDOMEvent* anEvent);
// ----- 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_DECL_NSIACCESSIBLEDOCUMENT
protected:
NS_IMETHOD GetTargetNode(nsIDOMEvent *aEvent, nsCOMPtr<nsIDOMNode>& aTargetNode);
virtual void GetBounds(nsRect& aRect, nsIFrame** aRelativeFrame);
virtual nsIFrame* GetFrame();
// 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
nsIAccessibleEventListener* mListener;
nsCOMPtr<nsIDOMNode> mCurrentFocus;
nsCOMPtr<nsIAccessibilityService> mAccService;
};
#endif

View File

@@ -0,0 +1,152 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Aaron Leventhal (aaronl@netscape.com)
* Contributor(s):
*/
#include "nsGenericAccessible.h"
#include "nsHTMLAreaAccessible.h"
#include "nsReadableUtils.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,55 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Aaron Leventhal (aaronl@netscape.com)
* Contributor(s):
*/
#ifndef _nsHTMLAreaAccessible_H_
#define _nsHTMLAreaAccessible_H_
#include "nsGenericAccessible.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,465 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Eric Vaughan (evaughan@netscape.com)
* Contributor(s):
*/
#include "nsHTMLFormControlAccessible.h"
#include "nsWeakReference.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMHTMLTextAreaElement.h"
#include "nsINameSpaceManager.h"
#include "nsHTMLAtoms.h"
#include "nsIDOMHTMLButtonElement.h"
#include "nsReadableUtils.h"
#include "nsAccessible.h"
#include "nsIFrame.h"
#include "nsIDOMHTMLLabelElement.h"
#include "nsIDOMHTMLFormElement.h"
nsHTMLFormControlAccessible::nsHTMLFormControlAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsLeafAccessible(aNode, aShell)
{
}
NS_IMETHODIMP nsHTMLFormControlAccessible::AppendLabelFor(nsIContent *aLookNode, nsAReadableString *aId, nsAWritableString *aLabel)
{
PRInt32 numChildren = 0;
nsCOMPtr<nsIDOMHTMLLabelElement> labelElement(do_QueryInterface(aLookNode));
if (labelElement) {
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aLookNode));
nsresult rv = NS_OK;
if (elt) {
nsAutoString labelIsFor;
elt->GetAttribute(NS_LITERAL_STRING("for"),labelIsFor);
if (labelIsFor.Equals(*aId))
rv = AppendFlatStringFromSubtree(aLookNode, aLabel);
}
return rv;
}
aLookNode->ChildCount(numChildren);
nsIContent *contentWalker;
PRInt32 index;
for (index = 0; index < numChildren; index++) {
aLookNode->ChildAt(index, contentWalker);
if (contentWalker)
AppendLabelFor(contentWalker, aId, aLabel);
}
return NS_OK;
}
/* wstring getAccName (); */
NS_IMETHODIMP nsHTMLFormControlAccessible::GetAccName(nsAWritableString& _retval)
{
nsCOMPtr<nsIContent> walkUpContent(do_QueryInterface(mDOMNode));
nsCOMPtr<nsIDOMHTMLLabelElement> labelElement;
nsCOMPtr<nsIDOMHTMLFormElement> formElement;
nsresult rv = NS_OK;
nsAutoString label;
// go up tree get name of ancestor label if there is one. Don't go up farther than form element
while (walkUpContent && label.IsEmpty() && !formElement) {
labelElement = do_QueryInterface(walkUpContent);
if (labelElement)
rv = AppendFlatStringFromSubtree(walkUpContent, &label);
formElement = do_QueryInterface(walkUpContent); // reached top ancestor in form
nsCOMPtr<nsIContent> nextParent;
walkUpContent->GetParent(*getter_AddRefs(nextParent));
walkUpContent = nextParent;
}
// There can be a label targeted at this control using the for="control_id" attribute
// To save computing time, only look for those inside of a form element
walkUpContent = do_QueryInterface(formElement);
if (walkUpContent) {
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(mDOMNode));
nsAutoString forId;
elt->GetAttribute(NS_LITERAL_STRING("id"), forId);
// Actually we'll be walking down the content this time, with a depth first search
if (!forId.IsEmpty())
AppendLabelFor(walkUpContent,&forId,&label);
}
label.CompressWhitespace();
if (label.IsEmpty())
return nsAccessible::GetAccName(_retval);
_retval.Assign(label);
return NS_OK;
}
/* long getAccState (); */
NS_IMETHODIMP nsHTMLFormControlAccessible::GetAccState(PRUint32 *_retval)
{
// can be
// focusable, focused, checked, protected, unavailable
nsCOMPtr<nsIDOMHTMLInputElement> element(do_QueryInterface(mDOMNode));
nsAccessible::GetAccState(_retval);
*_retval |= STATE_FOCUSABLE;
PRBool checked = PR_FALSE;
element->GetChecked(&checked);
if (checked) *_retval |= STATE_CHECKED;
PRBool disabled = PR_FALSE;
element->GetDisabled(&disabled);
if (disabled)
*_retval |= STATE_UNAVAILABLE;
nsAutoString typeString;
element->GetType(typeString);
if (typeString.EqualsIgnoreCase("password"))
*_retval |= STATE_PROTECTED;
return NS_OK;
}
// --- checkbox -----
nsHTMLCheckboxAccessible::nsHTMLCheckboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsHTMLFormControlAccessible(aNode, aShell)
{
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLCheckboxAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_CHECKBUTTON;
return NS_OK;
}
/* PRUint8 getAccNumActions (); */
NS_IMETHODIMP nsHTMLCheckboxAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = 1;
return NS_OK;
}
/* wstring getAccActionName (in PRUint8 index); */
NS_IMETHODIMP nsHTMLCheckboxAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
if (index == 0) {
// check or uncheck
nsCOMPtr<nsIDOMHTMLInputElement> element(do_QueryInterface(mDOMNode));
PRBool checked = PR_FALSE;
if (element)
element->GetChecked(&checked);
if (checked)
_retval = NS_LITERAL_STRING("uncheck");
else
_retval = NS_LITERAL_STRING("check");
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
/* void accDoAction (in PRUint8 index); */
NS_IMETHODIMP nsHTMLCheckboxAccessible::AccDoAction(PRUint8 index)
{
if (index == 0) { // 0 is the magic value for default action
nsCOMPtr<nsIDOMHTMLInputElement> element(do_QueryInterface(mDOMNode));
PRBool checked = PR_FALSE;
element->GetChecked(&checked);
element->SetChecked(checked ? PR_FALSE : PR_TRUE);
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
//------ Radio button -------
nsHTMLRadioButtonAccessible::nsHTMLRadioButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsHTMLFormControlAccessible(aNode, aShell)
{
}
/* PRUint8 getAccNumActions (); */
NS_IMETHODIMP nsHTMLRadioButtonAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = 1;
return NS_OK;
}
/* wstring getAccActionName (in PRUint8 index); */
NS_IMETHODIMP nsHTMLRadioButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
if (index == 0) {
_retval = NS_LITERAL_STRING("select");
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
/* void accDoAction (in PRUint8 index); */
NS_IMETHODIMP nsHTMLRadioButtonAccessible::AccDoAction(PRUint8 index)
{
if (index == 0) {
nsCOMPtr<nsIDOMHTMLInputElement> element(do_QueryInterface(mDOMNode));
element->Click();
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLRadioButtonAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_RADIOBUTTON;
return NS_OK;
}
// ----- Button -----
nsHTMLButtonAccessible::nsHTMLButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsHTMLFormControlAccessible(aNode, aShell)
{
}
/* PRUint8 getAccNumActions (); */
NS_IMETHODIMP nsHTMLButtonAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = 1;
return NS_OK;;
}
/* wstring getAccActionName (in PRUint8 index); */
NS_IMETHODIMP nsHTMLButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
if (index == 0) {
_retval = NS_LITERAL_STRING("press");
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
/* void accDoAction (in PRUint8 index); */
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;
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLButtonAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_PUSHBUTTON;
return NS_OK;
}
/* wstring getAccName (); */
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):
nsHTMLBlockAccessible(aNode, aShell)
{
}
/* PRUint8 getAccNumActions (); */
NS_IMETHODIMP nsHTML4ButtonAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = 1;
return NS_OK;;
}
/* wstring getAccActionName (in PRUint8 index); */
NS_IMETHODIMP nsHTML4ButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
if (index == 0) {
_retval = NS_LITERAL_STRING("press");
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
/* void accDoAction (in PRUint8 index); */
NS_IMETHODIMP nsHTML4ButtonAccessible::AccDoAction(PRUint8 index)
{
if (index == 0) {
nsCOMPtr<nsIDOMHTMLInputElement> element(do_QueryInterface(mDOMNode));
element->Click();
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTML4ButtonAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_PUSHBUTTON;
return NS_OK;
}
/* long getAccState (); */
NS_IMETHODIMP nsHTML4ButtonAccessible::GetAccState(PRUint32 *_retval)
{
nsAccessible::GetAccState(_retval);
*_retval |= STATE_FOCUSABLE;
return NS_OK;
}
/* wstring getAccName (); */
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):
nsHTMLFormControlAccessible(aNode, aShell)
{
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLTextFieldAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_TEXT;
return NS_OK;
}
/* wstring getAccValue (); */
NS_IMETHODIMP nsHTMLTextFieldAccessible::GetAccValue(nsAWritableString& _retval)
{
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;
}
/* long getAccState (); */
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 = nsHTMLFormControlAccessible::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,105 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Eric D Vaughan (evaughan@netscape.com)
* Contributor(s):
*/
#ifndef _nsHTMLFormControlAccessible_H_
#define _nsHTMLFormControlAccessible_H_
#include "nsAccessible.h"
class nsICheckboxControlFrame;
/* Accessible for supporting for controls
* supports:
* - walking up to get name from label
* - support basic state
*/
class nsHTMLFormControlAccessible : public nsLeafAccessible
{
public:
nsHTMLFormControlAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
protected:
NS_IMETHODIMP AppendLabelFor(nsIContent *aLookNode, nsAReadableString *aId, nsAWritableString *aLabel);
};
class nsHTMLCheckboxAccessible : public nsHTMLFormControlAccessible
{
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);
};
class nsHTMLRadioButtonAccessible : public nsHTMLFormControlAccessible
{
public:
nsHTMLRadioButtonAccessible(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);
};
class nsHTMLButtonAccessible : public nsHTMLFormControlAccessible
{
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 nsHTMLBlockAccessible
{
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 nsHTMLFormControlAccessible
{
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,274 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
*/
#include "nsHTMLIFrameRootAccessible.h"
#include "nsCOMPtr.h"
#include "nsIDocument.h"
#include "nsIPresShell.h"
#include "nsIPresContext.h"
#include "nsIContent.h"
#include "nsIFrame.h"
#include "nsIDocShell.h"
#include "nsIWebShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsIXULDocument.h"
#include "nsIDOMDocument.h"
#include "nsIDOMDocumentType.h"
#include "nsINameSpaceManager.h"
#include "nsReadableUtils.h"
NS_INTERFACE_MAP_BEGIN(nsHTMLIFrameRootAccessible)
NS_INTERFACE_MAP_ENTRY(nsIDOMFocusListener)
NS_INTERFACE_MAP_ENTRY(nsIDOMFormListener)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMFormListener)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMEventListener, nsIDOMFormListener)
NS_INTERFACE_MAP_END_INHERITING(nsRootAccessible)
NS_IMPL_ADDREF_INHERITED(nsHTMLIFrameRootAccessible, nsRootAccessible);
NS_IMPL_RELEASE_INHERITED(nsHTMLIFrameRootAccessible, nsRootAccessible);
NS_IMPL_ADDREF_INHERITED(nsHTMLIFrameAccessible, nsHTMLBlockAccessible);
NS_IMPL_RELEASE_INHERITED(nsHTMLIFrameAccessible, nsHTMLBlockAccessible);
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 nsHTMLBlockAccessible::QueryInterface(aIID, aInstancePtr);
}
nsHTMLIFrameAccessible::nsHTMLIFrameAccessible(nsIDOMNode* aNode, nsIAccessible* aRoot, nsIWeakReference* aShell, nsIDocument *aDoc):
nsHTMLBlockAccessible(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 nsDocAccessibleMixin::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):
nsRootAccessible(aShell)
{
mRealDOMNode = aNode;
}
//-----------------------------------------------------
// destruction
//-----------------------------------------------------
nsHTMLIFrameRootAccessible::~nsHTMLIFrameRootAccessible()
{
}
/* readonly attribute nsIAccessible accParent; */
NS_IMETHODIMP nsHTMLIFrameRootAccessible::GetAccParent(nsIAccessible * *_retval)
{
nsCOMPtr<nsIAccessible> accessible;
if (NS_SUCCEEDED(GetHTMLIFrameAccessible(getter_AddRefs(accessible))))
return accessible->GetAccParent(_retval);
*_retval = nsnull;
return NS_OK;
}
/* nsIAccessible getAccNextSibling (); */
NS_IMETHODIMP nsHTMLIFrameRootAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
nsCOMPtr<nsIAccessible> accessible;
if (NS_SUCCEEDED(GetHTMLIFrameAccessible(getter_AddRefs(accessible))))
return accessible->GetAccNextSibling(_retval);
*_retval = nsnull;
return NS_ERROR_FAILURE;
}
/* nsIAccessible getAccPreviousSibling (); */
NS_IMETHODIMP nsHTMLIFrameRootAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
nsCOMPtr<nsIAccessible> accessible;
if (NS_SUCCEEDED(GetHTMLIFrameAccessible(getter_AddRefs(accessible))))
return accessible->GetAccPreviousSibling(_retval);
*_retval = nsnull;
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsHTMLIFrameRootAccessible::GetHTMLIFrameAccessible(nsIAccessible** aAcc)
{
// Start by finding our PresShell and from that
// we get our nsIDocShell in order to walk the DocShell tree
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mPresShell));
if (!presShell) {
*aAcc = nsnull;
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIDocShell> docShell;
if (NS_SUCCEEDED(GetDocShellFromPS(presShell, getter_AddRefs(docShell)))) {
// Now that we have the DocShell QI
// it to a tree item to find it's parent
nsCOMPtr<nsIDocShellTreeItem> item(do_QueryInterface(docShell));
if (item) {
nsCOMPtr<nsIDocShellTreeItem> itemParent;
item->GetParent(getter_AddRefs(itemParent));
// QI to get the WebShell for the parent document
nsCOMPtr<nsIDocShell> parentDocShell(do_QueryInterface(itemParent));
if (parentDocShell) {
// Get the PresShell/Content and
// Root Content Node of the parent document
nsCOMPtr<nsIPresShell> parentPresShell;
nsCOMPtr<nsIPresContext> parentPresContext;
nsCOMPtr<nsIContent> rootContent;
if (NS_SUCCEEDED(GetDocShellObjects(parentDocShell,
getter_AddRefs(parentPresShell),
getter_AddRefs(parentPresContext),
getter_AddRefs(rootContent)))) {
// QI the DocShell (of this sub-doc) to a webshell
nsCOMPtr<nsIWebShell> webShell(do_QueryInterface(docShell));
if (webShell && parentPresShell && parentPresContext && rootContent) {
// Now, find the Content in the parent document
// that represents this sub-doc,
// we do that matching webshells
nsCOMPtr<nsIContent> content;
if (FindContentForWebShell(parentPresShell,
rootContent,
webShell,
getter_AddRefs(content))) {
// OK, we found the content node in the parent doc
// that corresponds to this sub-doc
// Get the frame for that content
nsCOMPtr<nsIWeakReference> wr = do_GetWeakReference(parentPresShell);
nsIFrame* frame = nsnull;
parentPresShell->GetPrimaryFrameFor(content, &frame);
#ifdef NS_DEBUG_X
printf("** Found: Con:%p Fr:%p", content, frame);
char * name;
if (GetNameForFrame(frame, &name)) {
printf(" Name:[%s]", name);
nsMemory::Free(name);
}
printf("\n");
#endif
nsCOMPtr<nsIDOMNode> node(do_QueryInterface(content));
nsCOMPtr<nsIAccessible> acc(do_QueryInterface(frame));
*aAcc = acc;
NS_IF_ADDREF(*aAcc);
return NS_OK;
}
}
}
}
}
}
return NS_ERROR_FAILURE;
}

View File

@@ -0,0 +1,78 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
*/
#ifndef _nsIFrameRootAccessible_H_
#define _nsIFrameRootAccessible_H_
#include "nsRootAccessible.h"
#include "nsAccessible.h"
#include "nsIAccessibleDocument.h"
class nsIWebShell;
class nsIWeakReference;
class nsHTMLIFrameAccessible : public nsHTMLBlockAccessible,
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:
NS_IMETHOD GetHTMLIFrameAccessible(nsIAccessible** aAcc);
nsCOMPtr<nsIDOMNode> mRealDOMNode;
};
#endif

View File

@@ -0,0 +1,188 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Aaron Leventhal (aaronl@netscape.com)
* Contributor(s):
*/
#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, nsIImageFrame *aImageFrame, nsIWeakReference* aShell):
nsLinkableAccessible(aDOMNode, aShell)
{
nsCOMPtr<nsIDOMElement> element(do_QueryInterface(aDOMNode));
nsCOMPtr<nsIDocument> doc;
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
NS_ASSERTION(shell,"Shell is gone!!! What are we doing here?");
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,54 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Aaron Leventhal (aaronl@netscape.com)
* Contributor(s):
*/
#ifndef _nsHTMLImageAccessible_H_
#define _nsHTMLImageAccessible_H_
#include "nsAccessible.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, nsIImageFrame *imageFrame, 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,63 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Aaron Leventhal (aaronl@netscape.com)
* Contributor(s):
*/
#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,38 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
* Author: Aaron Leventhal (aaronl@netscape.com)
*/
#ifndef _nsHTMLLinkAccessible_H_
#define _nsHTMLLinkAccessible_H_
#include "nsAccessible.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,792 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Original Author: Eric Vaughan (evaughan@netscape.com)
*
* Contributor(s):
*/
#include "nsHTMLSelectAccessible.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 "nsIDOMHTMLInputElement.h"
#include "nsLayoutAtoms.h"
#include "nsIDOMMenuListener.h"
#include "nsIDOMEventReceiver.h"
#include "nsReadableUtils.h"
#include "nsIDOMHTMLCollection.h"
#include "nsISelectElement.h"
#include "nsIDOMHTMLSelectElement.h"
#include "nsIAccessibilityService.h"
#include "nsIServiceManager.h"
#include "nsIDOMHTMLOptionElement.h"
/*
* A class the represents the text field in the Select to the left
* of the drop down button
*/
class nsHTMLSelectTextFieldAccessible : public nsLeafAccessible
{
public:
nsHTMLSelectTextFieldAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccValue(nsAWritableString& _retval);
virtual void GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame);
nsCOMPtr<nsIAccessible> mParent;
};
/*
* A base class that can listen to menu events. Its used so the
* button and the window accessibles can change there name and role
* depending on whether the drop down list is dropped down on not
*/
class nsMenuListenerAccessible : public nsAccessible,
public nsIDOMMenuListener
{
public:
NS_DECL_ISUPPORTS_INHERITED
nsMenuListenerAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsMenuListenerAccessible();
// popup listener
NS_IMETHOD Create(nsIDOMEvent* aEvent);
NS_IMETHOD Close(nsIDOMEvent* aEvent);
NS_IMETHOD Destroy(nsIDOMEvent* aEvent);
NS_IMETHOD Action(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;
};
NS_IMPL_ISUPPORTS_INHERITED(nsMenuListenerAccessible, nsAccessible, nsIDOMMenuListener)
/**
* A class that represents the button inside the Select to the right of the text field
*/
class nsHTMLSelectButtonAccessible : public nsMenuListenerAccessible
{
public:
nsHTMLSelectButtonAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
NS_IMETHOD AccDoAction(PRUint8 index);
virtual void GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame);
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 nsHTMLSelectWindowAccessible : public nsMenuListenerAccessible
{
public:
nsHTMLSelectWindowAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
virtual void GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame);
nsCOMPtr<nsIAccessible> mParent;
};
/*
* The list that contains all the options in the select. It is inside the window.
*/
class nsHTMLSelectListAccessible : public nsAccessible
{
public:
nsHTMLSelectListAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLSelectListAccessible() {}
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
nsCOMPtr<nsIAccessible> mParent;
};
//--------- nsHTMLSelectAccessible -----
nsHTMLSelectAccessible::nsHTMLSelectAccessible(nsIDOMNode* aDOMNode,
nsIWeakReference* aShell)
:nsAccessible(aDOMNode, aShell)
{
}
NS_IMPL_ISUPPORTS_INHERITED1(nsHTMLSelectAccessible, nsAccessible, nsIAccessibleSelectable)
// ------------- Helper method for determination of proper Frame ------
//static
PRBool nsHTMLSelectAccessible::IsCorrectFrame( nsIFrame* aFrame, nsIAtom* aAtom ) {
if (!aFrame || !aAtom)
return PR_FALSE;
nsCOMPtr<nsIAtom> frameType;
aFrame->GetFrameType(getter_AddRefs(frameType));
if (frameType.get() != aAtom)
return PR_FALSE;
return PR_TRUE;
}
NS_IMETHODIMP nsHTMLSelectAccessible::GetAccValue(nsAWritableString& _retval)
{
nsCOMPtr<nsIAccessible> text;
GetAccFirstChild(getter_AddRefs(text));
if (text)
return text->GetAccValue(_retval);
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsHTMLSelectAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_COMBOBOX;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectAccessible::GetAccLastChild(nsIAccessible **_retval)
{
// create a window accessible
*_retval = new nsHTMLSelectWindowAccessible(this, mDOMNode, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
// create a text field
*_retval = new nsHTMLSelectTextFieldAccessible(this, mDOMNode, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectAccessible::GetAccChildCount(PRInt32 *_retval)
{
// always have 3 children
*_retval = 3;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectAccessible::GetSelectedChildren(nsISupportsArray **_retval)
{
*_retval = nsnull;
return NS_OK;
}
//-------- SelectTextFieldAccessible ------
nsHTMLSelectTextFieldAccessible::nsHTMLSelectTextFieldAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
nsLeafAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
NS_IMETHODIMP nsHTMLSelectTextFieldAccessible::GetAccValue(nsAWritableString& _retval)
{
nsIFrame* frame = nsAccessible::GetBoundsFrame();
nsCOMPtr<nsIPresContext> context;
GetPresContext(context);
if ( !frame )
return NS_ERROR_FAILURE;
frame->FirstChild(context, nsnull, &frame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::blockFrame) )
return NS_ERROR_FAILURE;
frame->FirstChild(context, nsnull, &frame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::textFrame) )
return NS_ERROR_FAILURE;
nsCOMPtr<nsIContent> content;
frame->GetContent(getter_AddRefs(content));
if (!content)
return NS_ERROR_FAILURE;
AppendFlatStringFromSubtree(content, &_retval);
return NS_OK;
}
void nsHTMLSelectTextFieldAccessible::GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame)
{
// get our first child's frame
nsIFrame* frame = nsAccessible::GetBoundsFrame();
nsCOMPtr<nsIPresContext> context;
GetPresContext(context);
if ( !frame )
return;
frame->FirstChild(context, nsnull, &frame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::blockFrame) )
return;
frame->GetParent(aRelativeFrame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( *aRelativeFrame, nsLayoutAtoms::areaFrame) )
return;
frame->GetRect(aBounds);
}
NS_IMETHODIMP nsHTMLSelectTextFieldAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectTextFieldAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
nsCOMPtr<nsIAccessible> parent;
GetAccParent(getter_AddRefs(parent));
*_retval = new nsHTMLSelectButtonAccessible(parent, mDOMNode, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectTextFieldAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectTextFieldAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_STATICTEXT;
return NS_OK;
}
// --------- nsMenuListenerAccessible -----------
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("create"), this, PR_TRUE);
}
}
NS_IMETHODIMP nsMenuListenerAccessible::Create(nsIDOMEvent* aEvent)
{
mOpen = PR_TRUE;
/* TBD send state change event */
return NS_OK;
}
NS_IMETHODIMP nsMenuListenerAccessible::Destroy(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()
{
// not 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("create"), this, PR_TRUE);
if (NS_FAILED(rv)) {
return;
}
mRegistered = PR_TRUE;
}
}
//-------- SelectButtonAccessible ------
nsHTMLSelectButtonAccessible::nsHTMLSelectButtonAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
nsMenuListenerAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
/* void accDoAction (in PRUint8 index); */
NS_IMETHODIMP nsHTMLSelectButtonAccessible::AccDoAction(PRUint8 index)
{
nsIFrame* frame = nsAccessible::GetBoundsFrame();
nsCOMPtr<nsIPresContext> context;
GetPresContext(context);
frame->FirstChild(context, nsnull, &frame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::blockFrame) )
return NS_ERROR_FAILURE;
frame->GetNextSibling(&frame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::gfxButtonControlFrame) )
return NS_ERROR_FAILURE;
nsCOMPtr<nsIContent> content;
frame->GetContent(getter_AddRefs(content));
if (index == 0) {
nsCOMPtr<nsIDOMHTMLInputElement> element(do_QueryInterface(content));
if (element)
{
element->Click();
return NS_OK;
}
return NS_ERROR_FAILURE;
}
return NS_ERROR_NOT_IMPLEMENTED;
}
/* PRUint8 getAccNumActions (); */
NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = 1;
return NS_OK;
}
void nsHTMLSelectButtonAccessible::GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame)
{
// get our second child's frame
nsIFrame* frame = nsAccessible::GetBoundsFrame();
nsCOMPtr<nsIPresContext> context;
GetPresContext(context);
frame->FirstChild(context, nsnull, &frame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::blockFrame) )
return;
frame->GetNextSibling(&frame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::gfxButtonControlFrame) )
return;
frame->GetParent(aRelativeFrame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( *aRelativeFrame, nsLayoutAtoms::areaFrame) )
return;
frame->GetRect(aBounds);
}
NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_PUSHBUTTON;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccName(nsAWritableString& _retval)
{
return GetAccActionName(0, _retval);
}
NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
SetupMenuListener();
// get the current state open or closed
// set _retval to it.
// notice its supposed to be reversed. Close if opened
// and Open if closed.
if (mOpen)
_retval = NS_LITERAL_STRING("Close");
else
_retval = NS_LITERAL_STRING("Open");
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
nsCOMPtr<nsIAccessible> parent;
GetAccParent(getter_AddRefs(parent));
*_retval = new nsHTMLSelectWindowAccessible(parent, mDOMNode, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
nsCOMPtr<nsIAccessible> parent;
GetAccParent(getter_AddRefs(parent));
*_retval = new nsHTMLSelectTextFieldAccessible(parent, mDOMNode, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 0;
return NS_OK;
}
//---------------------
nsHTMLSelectWindowAccessible::nsHTMLSelectWindowAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell)
:nsMenuListenerAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccState(PRUint32 *_retval)
{
nsAccessible::GetAccState(_retval);
SetupMenuListener();
// if open we are visible if closed we are invisible
// set _retval to it.
if (mOpen)
*_retval |= STATE_DEFAULT;
else
*_retval |= STATE_INVISIBLE;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_WINDOW;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
nsCOMPtr<nsIAccessible> parent;
GetAccParent(getter_AddRefs(parent));
*_retval = new nsHTMLSelectButtonAccessible(parent, mDOMNode, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = new nsHTMLSelectListAccessible(this, mDOMNode, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = new nsHTMLSelectListAccessible(this, mDOMNode, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 1;
return NS_OK;
}
void nsHTMLSelectWindowAccessible::GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame)
{
// get our first option
nsCOMPtr<nsIDOMNode> child;
mDOMNode->GetFirstChild(getter_AddRefs(child));
// now get its frame
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
if (!shell) {
*aRelativeFrame = nsnull;
return;
}
nsIFrame* frame = nsnull;
nsCOMPtr<nsIContent> content(do_QueryInterface(child));
shell->GetPrimaryFrameFor(content, &frame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::blockFrame) )
return;
frame->GetParent(&frame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::areaFrame) )
return;
frame->GetParent(aRelativeFrame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( *aRelativeFrame, nsLayoutAtoms::listControlFrame) )
return;
frame->GetRect(aBounds);
}
//----------
nsHTMLSelectListAccessible::nsHTMLSelectListAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell)
:nsAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
NS_IMETHODIMP nsHTMLSelectListAccessible::AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height)
{
return mParent->AccGetBounds(x,y,width,height);
}
NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_LIST;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
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;
}
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::nsHTMLSelectOptionAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
nsLeafAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_LISTITEM;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
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;
}
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;
}
NS_IMETHODIMP nsHTMLSelectOptionAccessible::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;
}

View File

@@ -0,0 +1,72 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Original Author: Eric Vaughan (evaughan@netscape.com)
*
* Contributor(s):
*/
#ifndef __nsHTMLSelectAccessible_h__
#define __nsHTMLSelectAccessible_h__
#include "nsAccessible.h"
#include "nsCOMPtr.h"
#include "nsIAtom.h"
#include "nsIAccessibleSelectable.h"
class nsHTMLSelectAccessible : public nsAccessible,
public nsIAccessibleSelectable
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIACCESSIBLESELECTABLE
nsHTMLSelectAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLSelectAccessible() {}
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccValue(nsAWritableString& _retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
// helper method to verify frames
static PRBool IsCorrectFrame( nsIFrame* aFrame, nsIAtom* aAtom );
};
/*
* Each option in the Select. These are in the nsListAccessible
*/
class nsHTMLSelectOptionAccessible : public nsLeafAccessible
{
public:
nsHTMLSelectOptionAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
nsCOMPtr<nsIAccessible> mParent;
};
#endif

View File

@@ -0,0 +1,51 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Aaron Leventhal (aaronl@netscape.com)
* Contributor(s):
*/
#include "nsHTMLTableAccessible.h"
#include "nsWeakReference.h"
#include "nsReadableUtils.h"
nsHTMLTableCellAccessible::nsHTMLTableCellAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell):
nsHTMLBlockAccessible(aDomNode, aShell)
{
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLTableCellAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_CELL;
return NS_OK;
}
nsHTMLTableAccessible::nsHTMLTableAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell):
nsHTMLBlockAccessible(aDomNode, aShell)
{
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLTableAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_TABLE;
return NS_OK;
}

View File

@@ -0,0 +1,44 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Aaron Leventhal (aaronl@netscape.com)
* Contributor(s):
*/
#ifndef _nsHTMLTableAccessible_H_
#define _nsHTMLTableAccessible_H_
#include "nsAccessible.h"
class nsHTMLTableCellAccessible : public nsHTMLBlockAccessible
{
public:
nsHTMLTableCellAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
};
class nsHTMLTableAccessible : public nsHTMLBlockAccessible
{
public:
nsHTMLTableAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
};
#endif

View File

@@ -0,0 +1,73 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Eric Vaughan (evaughan@netscape.com)
* Contributor(s):
*/
#include "nsHTMLTextAccessible.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"
nsHTMLTextAccessible::nsHTMLTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell):
nsLinkableAccessible(aDomNode, aShell)
{
}
/* wstring getAccName (); */
NS_IMETHODIMP nsHTMLTextAccessible::GetAccName(nsAWritableString& _retval)
{
return mDOMNode->GetNodeValue(_retval);
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLTextAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_TEXT;
return NS_OK;
}
/* nsIAccessible getAccFirstChild (); */
NS_IMETHODIMP nsHTMLTextAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/* nsIAccessible getAccLastChild (); */
NS_IMETHODIMP nsHTMLTextAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/* long getAccChildCount (); */
NS_IMETHODIMP nsHTMLTextAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 0;
return NS_OK;
}

View File

@@ -0,0 +1,43 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
*/
#ifndef _nsHTMLTextAccessible_H_
#define _nsHTMLTextAccessible_H_
#include "nsAccessible.h"
class nsIWeakReference;
class nsITextControlFrame;
class nsHTMLTextAccessible : public nsLinkableAccessible
{
public:
nsHTMLTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
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,3 @@
en-US.jar:
locale/en-US/global/accessible.properties

View File

@@ -0,0 +1,64 @@
#!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
CPP_OBJS=\
.\$(OBJDIR)\nsAccessible.obj \
.\$(OBJDIR)\nsRootAccessible.obj \
.\$(OBJDIR)\nsHTMLIFrameRootAccessible.obj \
.\$(OBJDIR)\nsAccessibilityService.obj \
.\$(OBJDIR)\nsHTMLSelectListAccessible.obj \
.\$(OBJDIR)\nsGenericAccessible.obj \
.\$(OBJDIR)\nsHTMLFormControlAccessible.obj \
.\$(OBJDIR)\nsHTMLTextAccessible.obj \
.\$(OBJDIR)\nsHTMLImageAccessible.obj \
.\$(OBJDIR)\nsHTMLAreaAccessible.obj \
.\$(OBJDIR)\nsHTMLTableAccessible.obj \
.\$(OBJDIR)\nsHTMLLinkAccessible.obj \
.\$(OBJDIR)\nsHTMLComboboxAccessible.obj \
.\$(OBJDIR)\nsHTMLListboxAccessible.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,688 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Original Author: David W. Hyatt (hyatt@netscape.com)
*
* Contributor(s):
*/
#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 "nsHTMLTableAccessible.h"
#include "nsHTMLImageAccessible.h"
#include "nsHTMLAreaAccessible.h"
#include "nsHTMLLinkAccessible.h"
#include "nsHTMLSelectListAccessible.h"
#include "nsHTMLComboboxAccessible.h"
#include "nsHTMLListboxAccessible.h"
#include "nsIDOMHTMLAreaElement.h"
#include "nsHTMLFormControlAccessible.h"
#include "nsILink.h"
#include "nsIDocShellTreeItem.h"
#include "nsIDOMDocument.h"
#include "nsIDOMHTMLOptionElement.h"
// IFrame
#include "nsIDocShell.h"
#include "nsHTMLIFrameRootAccessible.h"
//--------------------
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;
}
/* 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;
}
/* 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 = new nsHTMLTextAccessible(node, 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;
}
/* 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;
nsIImageFrame* imageFrame = nsnull;
// not using a nsCOMPtr frames don't support them.
aFrame->QueryInterface(NS_GET_IID(nsIImageFrame), (void**)&imageFrame);
if (!imageFrame)
return NS_ERROR_FAILURE;
*_retval = new nsHTMLImageAccessible(node, imageFrame, 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::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));
*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;
document->GetShellAt(0, getter_AddRefs(tempShell));
nsCOMPtr<nsIWeakReference> weak = do_GetWeakReference(tempShell);
NS_IF_ADDREF(*aShell = weak);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateAccessible(nsIDOMNode* node, nsISupports* document, nsIAccessible **_retval)
{
nsCOMPtr<nsIContent> content (do_QueryInterface(node));
nsCOMPtr<nsIDocument> d (do_QueryInterface(document));
if (!d)
return NS_ERROR_FAILURE;
#ifdef DEBUG
PRInt32 shells = d->GetNumberOfShells();
NS_ASSERTION(shells > 0,"Error no shells!");
#endif
nsCOMPtr<nsIPresShell> tempShell;
d->GetShellAt(0, getter_AddRefs(tempShell));
nsCOMPtr<nsIWeakReference> wr = do_GetWeakReference(tempShell);
*_retval = new nsAccessible(node, wr);
if ( *_retval ) {
NS_ADDREF(*_retval);
return NS_OK;
}
return NS_ERROR_OUT_OF_MEMORY;
}
NS_IMETHODIMP
nsAccessibilityService::CreateHTMLBlockAccessible(nsIDOMNode* node, nsISupports* document, nsIAccessible **_retval)
{
nsCOMPtr<nsIContent> content (do_QueryInterface(node));
nsCOMPtr<nsIDocument> d (do_QueryInterface(document));
if (!d)
return NS_ERROR_FAILURE;
#ifdef DEBUG
PRInt32 shells = d->GetNumberOfShells();
NS_ASSERTION(shells > 0,"Error no shells!");
#endif
nsCOMPtr<nsIPresShell> tempShell;
d->GetShellAt(0, getter_AddRefs(tempShell));
nsCOMPtr<nsIWeakReference> wr = do_GetWeakReference(tempShell);
*_retval = new nsAccessible(node, wr);
if ( *_retval ) {
NS_ADDREF(*_retval);
return NS_OK;
}
return NS_ERROR_OUT_OF_MEMORY;
}
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;
}
//-----------------------------------------------------------------------
// This method finds the content node in the parent document
// corresponds to the docshell
// This code is copied and pasted from nsEventStateManager.cpp
// Is also inefficient - better solution should come along as part of
// Bug 85602: "FindContentForDocShell walks entire content tree"
// Hopefully there will be a better method soon, with a public interface
nsIContent*
nsAccessibilityService::FindContentForDocShell(nsIPresShell* aPresShell,
nsIContent* aContent,
nsIDocShell* aDocShell)
{
NS_ASSERTION(aPresShell, "Pointer is null!");
NS_ASSERTION(aDocShell, "Pointer is null!");
NS_ASSERTION(aContent, "Pointer is null!");
nsCOMPtr<nsISupports> supps;
aPresShell->GetSubShellFor(aContent, getter_AddRefs(supps));
if (supps) {
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(supps));
if (docShell.get() == aDocShell)
return aContent;
}
// walk children content
PRInt32 count;
aContent->ChildCount(count);
for (PRInt32 i=0;i<count;i++) {
nsCOMPtr<nsIContent> child;
aContent->ChildAt(i, *getter_AddRefs(child));
nsIContent* foundContent = FindContentForDocShell(aPresShell, child, aDocShell);
if (foundContent != nsnull) {
return foundContent;
}
}
return nsnull;
}
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<nsIDocShell> docShell(do_QueryInterface(pcContainer));
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(docShell));
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));
nsIContent *tempContent;
tempContent = FindContentForDocShell(parentPresShell, rootContent, docShell);
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;
/********** 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 PR_FALSE; // 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));
shell = ownerShell;
content = ownerContent;
}
/*********** If still no nsIContent, return ************/
if (!content)
return PR_FALSE;
/*********** Try using frame to get IAccessible *******/
nsIFrame* frame = nsnull;
shell->GetPrimaryFrameFor(content, &frame);
if (!frame)
return PR_FALSE;
nsCOMPtr<nsIAccessible> newAcc;
frame->GetAccessible(getter_AddRefs(newAcc));
/*********** Try QI'ing node to get nsIAccessible *******/
if (!newAcc)
newAcc = do_QueryInterface(aNode);
/*********** 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,59 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
*
* Original Author: David W. Hyatt (hyatt@netscape.com)
*
* Contributor(s):
*/
#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);
void GetOwnerFor(nsIPresShell *aPresShell, nsIPresShell **aOwnerShell, nsIContent **aOwnerContent);
nsIContent* FindContentForDocShell(nsIPresShell* aPresShell, nsIContent* aContent, nsIDocShell* aDocShell);
};
#endif /* __nsIccessibilityService_h__ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,155 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
*/
#ifndef _nsAccessible_H_
#define _nsAccessible_H_
#include "nsISupports.h"
#include "nsGenericAccessible.h"
#include "nsCOMPtr.h"
#include "nsIContent.h"
#include "nsIDOMNode.h"
#include "nsIPresShell.h"
#include "nsIPresContext.h"
#include "nsWeakReference.h"
#include "nsIFocusController.h"
#include "nsRect.h"
#include "nsPoint.h"
#define ACCESSIBLE_BUNDLE_URL "chrome://global/locale/accessible.properties"
class nsIFrame;
class nsIDocShell;
class nsIWebShell;
class nsIContent;
class nsAccessible : public nsGenericAccessible
{
public:
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 GetDocShellFromPS(nsIPresShell* aPresShell, nsIDocShell** aDocShell);
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:
virtual nsIFrame* GetFrame();
virtual nsIFrame* GetBoundsFrame();
virtual void GetBounds(nsRect& aRect, nsIFrame** aRelativeFrame);
virtual void GetPresContext(nsCOMPtr<nsIPresContext>& aContext);
NS_IMETHOD AppendFlatStringFromSubtree(nsIContent *aContent, nsAWritableString *aFlatString);
NS_IMETHOD AppendFlatStringFromContentNode(nsIContent *aContent, nsAWritableString *aFlatString);
// Data Members
nsCOMPtr<nsIDOMNode> mDOMNode;
nsCOMPtr<nsIWeakReference> mPresShell;
nsCOMPtr<nsIFocusController> mFocusController;
};
/* Special Accessible that knows how to handle hit detection for flowing text */
class nsHTMLBlockAccessible : public nsAccessible
{
public:
nsHTMLBlockAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD AccGetAt(PRInt32 x, PRInt32 y, nsIAccessible **_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);
};
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;
};
#endif

View File

@@ -0,0 +1,224 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Eric Vaughan (evaughan@netscape.com)
* Contributor(s):
*/
#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;
}

View File

@@ -0,0 +1,51 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Eric D Vaughan (evaughan@netscape.com)
* Contributor(s):
*/
#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,152 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Aaron Leventhal (aaronl@netscape.com)
* Contributor(s):
*/
#include "nsGenericAccessible.h"
#include "nsHTMLAreaAccessible.h"
#include "nsReadableUtils.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,55 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Aaron Leventhal (aaronl@netscape.com)
* Contributor(s):
*/
#ifndef _nsHTMLAreaAccessible_H_
#define _nsHTMLAreaAccessible_H_
#include "nsGenericAccessible.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,728 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Original Author: Eric Vaughan (evaughan@netscape.com)
*
* Contributor(s): John Gaunt (jgaunt@netscape.com)
*/
#include "nsHTMLComboboxAccessible.h"
#include "nsCOMPtr.h"
#include "nsIComboboxControlFrame.h"
#include "nsIDOMEventReceiver.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMHTMLSelectElement.h"
#include "nsIFrame.h"
#include "nsLayoutAtoms.h"
/** ----- nsHTMLComboboxAccessible ----- */
/**
* Constructor -- create the nsHTMLAccessible and set initial state
* closed and not registered
*/
nsHTMLComboboxAccessible::nsHTMLComboboxAccessible(nsIDOMNode* aDOMNode,
nsIWeakReference* aShell)
:nsAccessible(aDOMNode, aShell)
{
mRegistered = PR_FALSE;
mOpen = PR_FALSE;
SetupMenuListener();
}
/**
* Destructor -- If we are registered, remove ourselves as a listener.
*/
nsHTMLComboboxAccessible::~nsHTMLComboboxAccessible()
{
if (mRegistered) {
nsCOMPtr<nsIDOMEventReceiver> eventReceiver(do_QueryInterface(mDOMNode));
if (eventReceiver)
eventReceiver->RemoveEventListener(NS_LITERAL_STRING("create"), this, PR_TRUE);
}
}
/** Inherit the ISupports impl from nsAccessible -- handle nsIDOMMenuListener ourself */
NS_IMPL_ISUPPORTS_INHERITED(nsHTMLComboboxAccessible, nsAccessible, nsIDOMMenuListener)
/**
* Tell our caller we are a combobox
*/
NS_IMETHODIMP nsHTMLComboboxAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_COMBOBOX;
return NS_OK;
}
/**
* Through the arg, pass back our last child, a 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;
}
/**
* Through the arg, pass back our first child, a 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;
}
/**
* We always have 3 children: TextField, Button, Window. In that order
*/
NS_IMETHODIMP nsHTMLComboboxAccessible::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.
*/
NS_IMETHODIMP nsHTMLComboboxAccessible::GetSelectedChildren(nsISupportsArray **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
* Our value is the value of our ( first ) selected child. SelectElement
* 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;
}
/**
* As a nsHTMLComboboxAccessible we can have the following states:
* STATE_FOCUSED
* STATE_READONLY
* STATE_FOCUSABLE
* STATE_HASPOPUP
* STATE_EXPANDED
* STATE_COLLAPSED
*/
NS_IMETHODIMP nsHTMLComboboxAccessible::GetAccState(PRUint32 *_retval)
{
// this sets either STATE_FOCUSED or 0
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 nsHTMLComboboxAccessible::Create(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 nsHTMLComboboxAccessible::Destroy(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 nsHTMLComboboxAccessible::Close(nsIDOMEvent* aEvent)
{
mOpen = PR_FALSE;
/* TBD send state change event */
return NS_OK;
}
/**
* If we aren't already registered, register ourselves as a
* listener to "create" 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
nsHTMLComboboxAccessible::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("create"), this, PR_TRUE)))
mRegistered = PR_TRUE;
}
}
/** ----- nsHTMLComboboxTextFieldAccessible ----- */
/**
* Constructor -- create the nsLeafAccessible and set our parent
*/
nsHTMLComboboxTextFieldAccessible::nsHTMLComboboxTextFieldAccessible(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 nsHTMLComboboxTextFieldAccessible::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 nsHTMLComboboxTextFieldAccessible::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);
}
/**
* Getter for our parent
*/
NS_IMETHODIMP nsHTMLComboboxTextFieldAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
/**
* Through the arg, pass back our next sibling, a
* 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;
}
/**
* We are the first child of our parent, no previous sibling
*/
NS_IMETHODIMP nsHTMLComboboxTextFieldAccessible::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 nsHTMLComboboxTextFieldAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_STATICTEXT;
return NS_OK;
}
/**
* As a nsHTMLComboboxTextFieldAccessible we can have the following states:
* STATE_READONLY
* STATE_FOCUSED
* STATE_FOCUSABLE
*/
NS_IMETHODIMP nsHTMLComboboxTextFieldAccessible::GetAccState(PRUint32 *_retval)
{
// this sets either STATE_FOCUSED or 0
nsAccessible::GetAccState(_retval);
*_retval |= STATE_READONLY | STATE_FOCUSABLE;
return NS_OK;
}
/** -----SelectButtonAccessible ----- */
/**
* Constructor -- create the nsMenuListenerAccessible and set our parent
*/
nsHTMLComboboxButtonAccessible::nsHTMLComboboxButtonAccessible(nsIAccessible* aParent,
nsIDOMNode* aDOMNode,
nsIWeakReference* aShell)
:nsAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
/**
* 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;
}
/**
* Just one action ( click ).
*/
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = 1;
return NS_OK;
}
/**
* Gets the bounds for the gfxButtonControlFrame.
* Walks the Frame tree and checks for proper frames.
*/
void nsHTMLComboboxButtonAccessible::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);
}
/**
* Tell our caller we are a button.
*/
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_PUSHBUTTON;
return NS_OK;
}
/**
* Getter for our parent
*/
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
/**
* Gets the name from GetAccActionName()
*/
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::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.
*/
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
// we are open or closed
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;
}
/**
* Through the arg, pass back our next sibling, a
* 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;
}
/**
* Through the arg, pass back our previous sibling, a
* 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;
}
/**
* No Children. Just a button ( over-riding nsAccessible )
*/
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
* No Children. Just a button ( over-riding nsAccessible )
*/
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
* No Children. Just a button ( over-riding nsAccessible )
*/
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 0;
return NS_OK;
}
/**
* As a nsHTMLComboboxButtonAccessible we can have the following states:
* STATE_PRESSED
* STATE_FOCUSED
* STATE_FOCUSABLE
*/
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetAccState(PRUint32 *_retval)
{
// this sets either STATE_FOCUSED or 0
nsAccessible::GetAccState(_retval);
// we are open or closed
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;
}
/** ----- nsHTMLComboboxWindowAccessible ----- */
/**
* Constructor -- create the nsMenuListener and set our parent
*/
nsHTMLComboboxWindowAccessible::nsHTMLComboboxWindowAccessible(nsIAccessible* aParent,
nsIDOMNode* aDOMNode,
nsIWeakReference* aShell)
:nsAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
/**
* As a nsHTMLComboboxWindowAccessible we can have the following states:
* STATE_FOCUSED
* STATE_FOCUSABLE
* STATE_INVISIBLE
* STATE_FLOATING
*/
NS_IMETHODIMP nsHTMLComboboxWindowAccessible::GetAccState(PRUint32 *_retval)
{
// this sets either STATE_FOCUSED or 0
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;
}
/**
* Tell our caller we are a window
*/
NS_IMETHODIMP nsHTMLComboboxWindowAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_WINDOW;
return NS_OK;
}
/**
* Getter for our parent
*/
NS_IMETHODIMP nsHTMLComboboxWindowAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
/**
* Through the arg, pass back our previous sibling, 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 are the last sibling of our parent.
*/
NS_IMETHODIMP nsHTMLComboboxWindowAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
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;
}
/**
* We only have one child, a list
*/
NS_IMETHODIMP nsHTMLComboboxWindowAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 1;
return NS_OK;
}
/**
* Gets the bounds for the areaFrame.
* Walks the Frame tree and checks for proper frames.
*/
void nsHTMLComboboxWindowAccessible::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,161 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Original Author: John Gaunt (jgaunt@netscape.com)
*
* Contributor(s):
*/
#ifndef __nsHTMLComboboxAccessible_h__
#define __nsHTMLComboboxAccessible_h__
#include "nsAccessible.h"
#include "nsIAccessibleSelectable.h"
#include "nsCOMPtr.h"
#include "nsHTMLSelectListAccessible.h"
#include "nsIDOMMenuListener.h"
/*
* A class the represents the HTML Combobox widget.
*/
class nsHTMLComboboxAccessible : public nsAccessible,
public nsIAccessibleSelectable,
public nsIDOMMenuListener
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIACCESSIBLESELECTABLE
nsHTMLComboboxAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLComboboxAccessible();
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
NS_IMETHOD GetAccValue(nsAWritableString& _retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
// popup listener
NS_IMETHOD Create(nsIDOMEvent* aEvent);
NS_IMETHOD Close(nsIDOMEvent* aEvent);
NS_IMETHOD Destroy(nsIDOMEvent* aEvent);
NS_IMETHOD Action(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 Select to the left
* of the drop down button
*/
class nsHTMLComboboxTextFieldAccessible : public nsLeafAccessible
{
public:
nsHTMLComboboxTextFieldAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
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 nsHTMLComboboxButtonAccessible : public nsAccessible
{
public:
enum { eAction_Click=0 };
nsHTMLComboboxButtonAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
NS_IMETHOD AccDoAction(PRUint8 index);
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 nsHTMLComboboxWindowAccessible : public nsAccessible
{
public:
nsHTMLComboboxWindowAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(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,465 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Eric Vaughan (evaughan@netscape.com)
* Contributor(s):
*/
#include "nsHTMLFormControlAccessible.h"
#include "nsWeakReference.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMHTMLTextAreaElement.h"
#include "nsINameSpaceManager.h"
#include "nsHTMLAtoms.h"
#include "nsIDOMHTMLButtonElement.h"
#include "nsReadableUtils.h"
#include "nsAccessible.h"
#include "nsIFrame.h"
#include "nsIDOMHTMLLabelElement.h"
#include "nsIDOMHTMLFormElement.h"
nsHTMLFormControlAccessible::nsHTMLFormControlAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsLeafAccessible(aNode, aShell)
{
}
NS_IMETHODIMP nsHTMLFormControlAccessible::AppendLabelFor(nsIContent *aLookNode, nsAReadableString *aId, nsAWritableString *aLabel)
{
PRInt32 numChildren = 0;
nsCOMPtr<nsIDOMHTMLLabelElement> labelElement(do_QueryInterface(aLookNode));
if (labelElement) {
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aLookNode));
nsresult rv = NS_OK;
if (elt) {
nsAutoString labelIsFor;
elt->GetAttribute(NS_LITERAL_STRING("for"),labelIsFor);
if (labelIsFor.Equals(*aId))
rv = AppendFlatStringFromSubtree(aLookNode, aLabel);
}
return rv;
}
aLookNode->ChildCount(numChildren);
nsIContent *contentWalker;
PRInt32 index;
for (index = 0; index < numChildren; index++) {
aLookNode->ChildAt(index, contentWalker);
if (contentWalker)
AppendLabelFor(contentWalker, aId, aLabel);
}
return NS_OK;
}
/* wstring getAccName (); */
NS_IMETHODIMP nsHTMLFormControlAccessible::GetAccName(nsAWritableString& _retval)
{
nsCOMPtr<nsIContent> walkUpContent(do_QueryInterface(mDOMNode));
nsCOMPtr<nsIDOMHTMLLabelElement> labelElement;
nsCOMPtr<nsIDOMHTMLFormElement> formElement;
nsresult rv = NS_OK;
nsAutoString label;
// go up tree get name of ancestor label if there is one. Don't go up farther than form element
while (walkUpContent && label.IsEmpty() && !formElement) {
labelElement = do_QueryInterface(walkUpContent);
if (labelElement)
rv = AppendFlatStringFromSubtree(walkUpContent, &label);
formElement = do_QueryInterface(walkUpContent); // reached top ancestor in form
nsCOMPtr<nsIContent> nextParent;
walkUpContent->GetParent(*getter_AddRefs(nextParent));
walkUpContent = nextParent;
}
// There can be a label targeted at this control using the for="control_id" attribute
// To save computing time, only look for those inside of a form element
walkUpContent = do_QueryInterface(formElement);
if (walkUpContent) {
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(mDOMNode));
nsAutoString forId;
elt->GetAttribute(NS_LITERAL_STRING("id"), forId);
// Actually we'll be walking down the content this time, with a depth first search
if (!forId.IsEmpty())
AppendLabelFor(walkUpContent,&forId,&label);
}
label.CompressWhitespace();
if (label.IsEmpty())
return nsAccessible::GetAccName(_retval);
_retval.Assign(label);
return NS_OK;
}
/* long getAccState (); */
NS_IMETHODIMP nsHTMLFormControlAccessible::GetAccState(PRUint32 *_retval)
{
// can be
// focusable, focused, checked, protected, unavailable
nsCOMPtr<nsIDOMHTMLInputElement> element(do_QueryInterface(mDOMNode));
nsAccessible::GetAccState(_retval);
*_retval |= STATE_FOCUSABLE;
PRBool checked = PR_FALSE;
element->GetChecked(&checked);
if (checked) *_retval |= STATE_CHECKED;
PRBool disabled = PR_FALSE;
element->GetDisabled(&disabled);
if (disabled)
*_retval |= STATE_UNAVAILABLE;
nsAutoString typeString;
element->GetType(typeString);
if (typeString.EqualsIgnoreCase("password"))
*_retval |= STATE_PROTECTED;
return NS_OK;
}
// --- checkbox -----
nsHTMLCheckboxAccessible::nsHTMLCheckboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsHTMLFormControlAccessible(aNode, aShell)
{
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLCheckboxAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_CHECKBUTTON;
return NS_OK;
}
/* PRUint8 getAccNumActions (); */
NS_IMETHODIMP nsHTMLCheckboxAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = 1;
return NS_OK;
}
/* wstring getAccActionName (in PRUint8 index); */
NS_IMETHODIMP nsHTMLCheckboxAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
if (index == 0) {
// check or uncheck
nsCOMPtr<nsIDOMHTMLInputElement> element(do_QueryInterface(mDOMNode));
PRBool checked = PR_FALSE;
if (element)
element->GetChecked(&checked);
if (checked)
_retval = NS_LITERAL_STRING("uncheck");
else
_retval = NS_LITERAL_STRING("check");
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
/* void accDoAction (in PRUint8 index); */
NS_IMETHODIMP nsHTMLCheckboxAccessible::AccDoAction(PRUint8 index)
{
if (index == 0) { // 0 is the magic value for default action
nsCOMPtr<nsIDOMHTMLInputElement> element(do_QueryInterface(mDOMNode));
PRBool checked = PR_FALSE;
element->GetChecked(&checked);
element->SetChecked(checked ? PR_FALSE : PR_TRUE);
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
//------ Radio button -------
nsHTMLRadioButtonAccessible::nsHTMLRadioButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsHTMLFormControlAccessible(aNode, aShell)
{
}
/* PRUint8 getAccNumActions (); */
NS_IMETHODIMP nsHTMLRadioButtonAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = 1;
return NS_OK;
}
/* wstring getAccActionName (in PRUint8 index); */
NS_IMETHODIMP nsHTMLRadioButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
if (index == 0) {
_retval = NS_LITERAL_STRING("select");
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
/* void accDoAction (in PRUint8 index); */
NS_IMETHODIMP nsHTMLRadioButtonAccessible::AccDoAction(PRUint8 index)
{
if (index == 0) {
nsCOMPtr<nsIDOMHTMLInputElement> element(do_QueryInterface(mDOMNode));
element->Click();
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLRadioButtonAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_RADIOBUTTON;
return NS_OK;
}
// ----- Button -----
nsHTMLButtonAccessible::nsHTMLButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsHTMLFormControlAccessible(aNode, aShell)
{
}
/* PRUint8 getAccNumActions (); */
NS_IMETHODIMP nsHTMLButtonAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = 1;
return NS_OK;;
}
/* wstring getAccActionName (in PRUint8 index); */
NS_IMETHODIMP nsHTMLButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
if (index == 0) {
_retval = NS_LITERAL_STRING("press");
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
/* void accDoAction (in PRUint8 index); */
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;
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLButtonAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_PUSHBUTTON;
return NS_OK;
}
/* wstring getAccName (); */
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):
nsHTMLBlockAccessible(aNode, aShell)
{
}
/* PRUint8 getAccNumActions (); */
NS_IMETHODIMP nsHTML4ButtonAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = 1;
return NS_OK;;
}
/* wstring getAccActionName (in PRUint8 index); */
NS_IMETHODIMP nsHTML4ButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
if (index == 0) {
_retval = NS_LITERAL_STRING("press");
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
/* void accDoAction (in PRUint8 index); */
NS_IMETHODIMP nsHTML4ButtonAccessible::AccDoAction(PRUint8 index)
{
if (index == 0) {
nsCOMPtr<nsIDOMHTMLInputElement> element(do_QueryInterface(mDOMNode));
element->Click();
return NS_OK;
}
return NS_ERROR_INVALID_ARG;
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTML4ButtonAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_PUSHBUTTON;
return NS_OK;
}
/* long getAccState (); */
NS_IMETHODIMP nsHTML4ButtonAccessible::GetAccState(PRUint32 *_retval)
{
nsAccessible::GetAccState(_retval);
*_retval |= STATE_FOCUSABLE;
return NS_OK;
}
/* wstring getAccName (); */
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):
nsHTMLFormControlAccessible(aNode, aShell)
{
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLTextFieldAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_TEXT;
return NS_OK;
}
/* wstring getAccValue (); */
NS_IMETHODIMP nsHTMLTextFieldAccessible::GetAccValue(nsAWritableString& _retval)
{
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;
}
/* long getAccState (); */
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 = nsHTMLFormControlAccessible::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,105 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Eric D Vaughan (evaughan@netscape.com)
* Contributor(s):
*/
#ifndef _nsHTMLFormControlAccessible_H_
#define _nsHTMLFormControlAccessible_H_
#include "nsAccessible.h"
class nsICheckboxControlFrame;
/* Accessible for supporting for controls
* supports:
* - walking up to get name from label
* - support basic state
*/
class nsHTMLFormControlAccessible : public nsLeafAccessible
{
public:
nsHTMLFormControlAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
protected:
NS_IMETHODIMP AppendLabelFor(nsIContent *aLookNode, nsAReadableString *aId, nsAWritableString *aLabel);
};
class nsHTMLCheckboxAccessible : public nsHTMLFormControlAccessible
{
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);
};
class nsHTMLRadioButtonAccessible : public nsHTMLFormControlAccessible
{
public:
nsHTMLRadioButtonAccessible(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);
};
class nsHTMLButtonAccessible : public nsHTMLFormControlAccessible
{
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 nsHTMLBlockAccessible
{
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 nsHTMLFormControlAccessible
{
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,274 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
*/
#include "nsHTMLIFrameRootAccessible.h"
#include "nsCOMPtr.h"
#include "nsIDocument.h"
#include "nsIPresShell.h"
#include "nsIPresContext.h"
#include "nsIContent.h"
#include "nsIFrame.h"
#include "nsIDocShell.h"
#include "nsIWebShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsIXULDocument.h"
#include "nsIDOMDocument.h"
#include "nsIDOMDocumentType.h"
#include "nsINameSpaceManager.h"
#include "nsReadableUtils.h"
NS_INTERFACE_MAP_BEGIN(nsHTMLIFrameRootAccessible)
NS_INTERFACE_MAP_ENTRY(nsIDOMFocusListener)
NS_INTERFACE_MAP_ENTRY(nsIDOMFormListener)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMFormListener)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMEventListener, nsIDOMFormListener)
NS_INTERFACE_MAP_END_INHERITING(nsRootAccessible)
NS_IMPL_ADDREF_INHERITED(nsHTMLIFrameRootAccessible, nsRootAccessible);
NS_IMPL_RELEASE_INHERITED(nsHTMLIFrameRootAccessible, nsRootAccessible);
NS_IMPL_ADDREF_INHERITED(nsHTMLIFrameAccessible, nsHTMLBlockAccessible);
NS_IMPL_RELEASE_INHERITED(nsHTMLIFrameAccessible, nsHTMLBlockAccessible);
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 nsHTMLBlockAccessible::QueryInterface(aIID, aInstancePtr);
}
nsHTMLIFrameAccessible::nsHTMLIFrameAccessible(nsIDOMNode* aNode, nsIAccessible* aRoot, nsIWeakReference* aShell, nsIDocument *aDoc):
nsHTMLBlockAccessible(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 nsDocAccessibleMixin::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):
nsRootAccessible(aShell)
{
mRealDOMNode = aNode;
}
//-----------------------------------------------------
// destruction
//-----------------------------------------------------
nsHTMLIFrameRootAccessible::~nsHTMLIFrameRootAccessible()
{
}
/* readonly attribute nsIAccessible accParent; */
NS_IMETHODIMP nsHTMLIFrameRootAccessible::GetAccParent(nsIAccessible * *_retval)
{
nsCOMPtr<nsIAccessible> accessible;
if (NS_SUCCEEDED(GetHTMLIFrameAccessible(getter_AddRefs(accessible))))
return accessible->GetAccParent(_retval);
*_retval = nsnull;
return NS_OK;
}
/* nsIAccessible getAccNextSibling (); */
NS_IMETHODIMP nsHTMLIFrameRootAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
nsCOMPtr<nsIAccessible> accessible;
if (NS_SUCCEEDED(GetHTMLIFrameAccessible(getter_AddRefs(accessible))))
return accessible->GetAccNextSibling(_retval);
*_retval = nsnull;
return NS_ERROR_FAILURE;
}
/* nsIAccessible getAccPreviousSibling (); */
NS_IMETHODIMP nsHTMLIFrameRootAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
nsCOMPtr<nsIAccessible> accessible;
if (NS_SUCCEEDED(GetHTMLIFrameAccessible(getter_AddRefs(accessible))))
return accessible->GetAccPreviousSibling(_retval);
*_retval = nsnull;
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsHTMLIFrameRootAccessible::GetHTMLIFrameAccessible(nsIAccessible** aAcc)
{
// Start by finding our PresShell and from that
// we get our nsIDocShell in order to walk the DocShell tree
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mPresShell));
if (!presShell) {
*aAcc = nsnull;
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIDocShell> docShell;
if (NS_SUCCEEDED(GetDocShellFromPS(presShell, getter_AddRefs(docShell)))) {
// Now that we have the DocShell QI
// it to a tree item to find it's parent
nsCOMPtr<nsIDocShellTreeItem> item(do_QueryInterface(docShell));
if (item) {
nsCOMPtr<nsIDocShellTreeItem> itemParent;
item->GetParent(getter_AddRefs(itemParent));
// QI to get the WebShell for the parent document
nsCOMPtr<nsIDocShell> parentDocShell(do_QueryInterface(itemParent));
if (parentDocShell) {
// Get the PresShell/Content and
// Root Content Node of the parent document
nsCOMPtr<nsIPresShell> parentPresShell;
nsCOMPtr<nsIPresContext> parentPresContext;
nsCOMPtr<nsIContent> rootContent;
if (NS_SUCCEEDED(GetDocShellObjects(parentDocShell,
getter_AddRefs(parentPresShell),
getter_AddRefs(parentPresContext),
getter_AddRefs(rootContent)))) {
// QI the DocShell (of this sub-doc) to a webshell
nsCOMPtr<nsIWebShell> webShell(do_QueryInterface(docShell));
if (webShell && parentPresShell && parentPresContext && rootContent) {
// Now, find the Content in the parent document
// that represents this sub-doc,
// we do that matching webshells
nsCOMPtr<nsIContent> content;
if (FindContentForWebShell(parentPresShell,
rootContent,
webShell,
getter_AddRefs(content))) {
// OK, we found the content node in the parent doc
// that corresponds to this sub-doc
// Get the frame for that content
nsCOMPtr<nsIWeakReference> wr = do_GetWeakReference(parentPresShell);
nsIFrame* frame = nsnull;
parentPresShell->GetPrimaryFrameFor(content, &frame);
#ifdef NS_DEBUG_X
printf("** Found: Con:%p Fr:%p", content, frame);
char * name;
if (GetNameForFrame(frame, &name)) {
printf(" Name:[%s]", name);
nsMemory::Free(name);
}
printf("\n");
#endif
nsCOMPtr<nsIDOMNode> node(do_QueryInterface(content));
nsCOMPtr<nsIAccessible> acc(do_QueryInterface(frame));
*aAcc = acc;
NS_IF_ADDREF(*aAcc);
return NS_OK;
}
}
}
}
}
}
return NS_ERROR_FAILURE;
}

View File

@@ -0,0 +1,78 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
*/
#ifndef _nsIFrameRootAccessible_H_
#define _nsIFrameRootAccessible_H_
#include "nsRootAccessible.h"
#include "nsAccessible.h"
#include "nsIAccessibleDocument.h"
class nsIWebShell;
class nsIWeakReference;
class nsHTMLIFrameAccessible : public nsHTMLBlockAccessible,
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:
NS_IMETHOD GetHTMLIFrameAccessible(nsIAccessible** aAcc);
nsCOMPtr<nsIDOMNode> mRealDOMNode;
};
#endif

View File

@@ -0,0 +1,188 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Aaron Leventhal (aaronl@netscape.com)
* Contributor(s):
*/
#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, nsIImageFrame *aImageFrame, nsIWeakReference* aShell):
nsLinkableAccessible(aDOMNode, aShell)
{
nsCOMPtr<nsIDOMElement> element(do_QueryInterface(aDOMNode));
nsCOMPtr<nsIDocument> doc;
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
NS_ASSERTION(shell,"Shell is gone!!! What are we doing here?");
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,54 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Aaron Leventhal (aaronl@netscape.com)
* Contributor(s):
*/
#ifndef _nsHTMLImageAccessible_H_
#define _nsHTMLImageAccessible_H_
#include "nsAccessible.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, nsIImageFrame *imageFrame, 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,63 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Aaron Leventhal (aaronl@netscape.com)
* Contributor(s):
*/
#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,38 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
* Author: Aaron Leventhal (aaronl@netscape.com)
*/
#ifndef _nsHTMLLinkAccessible_H_
#define _nsHTMLLinkAccessible_H_
#include "nsAccessible.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,183 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Original Author: Eric Vaughan (evaughan@netscape.com)
*
* Contributor(s):
*/
#include "nsHTMLListboxAccessible.h"
#include "nsCOMPtr.h"
#include "nsIAccessibilityService.h"
#include "nsIDOMHTMLCollection.h"
#include "nsIDOMHTMLInputElement.h"
#include "nsIDOMHTMLSelectElement.h"
#include "nsIDOMHTMLOptionElement.h"
#include "nsIFrame.h"
#include "nsIServiceManager.h"
#include "nsLayoutAtoms.h"
/** ----- nsHTMLListboxAccessible ----- */
/**
* Constructor -- create the nsHTMLAccessible
*/
nsHTMLListboxAccessible::nsHTMLListboxAccessible(nsIDOMNode* aDOMNode,
nsIWeakReference* aShell)
:nsAccessible(aDOMNode, aShell)
{
}
/** Inherit the ISupports impl from nsAccessible */
NS_IMPL_ISUPPORTS_INHERITED1(nsHTMLListboxAccessible, nsAccessible, nsIAccessibleSelectable)
/**
* Tell our caller we are a list ( there isn't a listbox value )
*/
NS_IMETHODIMP nsHTMLListboxAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_WINDOW;
return NS_OK;
}
/**
* Through the arg, pass back our last child, a nsHTMLListboxWindowAccessible 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;
}
/**
* Through the arg, pass back our first child, a nsHTMLListboxWindowAccessible 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;
}
/**
* We always have 1 child: SelectList.
*/
NS_IMETHODIMP nsHTMLListboxAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 1;
return NS_OK;
}
/**
* nsIAccessibleSelectable method. This needs to get from the select the list
* of select options and then iterate through that pulling out the selected
* items and creating IAccessible objects for them. Put the IAccessibles in
* the nsISupportsArray and return them.
* retval will be nsnull if:
* - there are no options in the select
* - 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;
}
/**
* Our value is the value of our ( first ) selected child. SelectElement
* 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;
}
/**
* As a nsHTMLListboxAccessible we can have the following states:
* STATE_FOCUSED
* STATE_READONLY
* STATE_FOCUSABLE
*/
NS_IMETHODIMP nsHTMLListboxAccessible::GetAccState(PRUint32 *_retval)
{
// this sets either STATE_FOCUSED or 0
nsAccessible::GetAccState(_retval);
*_retval |= STATE_READONLY | STATE_FOCUSABLE;
return NS_OK;
}

View File

@@ -0,0 +1,57 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Original Author: John Gaunt (jgaunt@netscape.com)
*
* Contributor(s):
*/
#ifndef __nsHTMLListboxAccessible_h__
#define __nsHTMLListboxAccessible_h__
#include "nsAccessible.h"
#include "nsIAccessibleSelectable.h"
#include "nsCOMPtr.h"
#include "nsHTMLSelectListAccessible.h"
/*
* A class the represents the HTML Combobox widget.
*/
class nsHTMLListboxAccessible : public nsAccessible,
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 GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
NS_IMETHOD GetAccValue(nsAWritableString& _retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
};
#endif

View File

@@ -0,0 +1,792 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Original Author: Eric Vaughan (evaughan@netscape.com)
*
* Contributor(s):
*/
#include "nsHTMLSelectAccessible.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 "nsIDOMHTMLInputElement.h"
#include "nsLayoutAtoms.h"
#include "nsIDOMMenuListener.h"
#include "nsIDOMEventReceiver.h"
#include "nsReadableUtils.h"
#include "nsIDOMHTMLCollection.h"
#include "nsISelectElement.h"
#include "nsIDOMHTMLSelectElement.h"
#include "nsIAccessibilityService.h"
#include "nsIServiceManager.h"
#include "nsIDOMHTMLOptionElement.h"
/*
* A class the represents the text field in the Select to the left
* of the drop down button
*/
class nsHTMLSelectTextFieldAccessible : public nsLeafAccessible
{
public:
nsHTMLSelectTextFieldAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccValue(nsAWritableString& _retval);
virtual void GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame);
nsCOMPtr<nsIAccessible> mParent;
};
/*
* A base class that can listen to menu events. Its used so the
* button and the window accessibles can change there name and role
* depending on whether the drop down list is dropped down on not
*/
class nsMenuListenerAccessible : public nsAccessible,
public nsIDOMMenuListener
{
public:
NS_DECL_ISUPPORTS_INHERITED
nsMenuListenerAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsMenuListenerAccessible();
// popup listener
NS_IMETHOD Create(nsIDOMEvent* aEvent);
NS_IMETHOD Close(nsIDOMEvent* aEvent);
NS_IMETHOD Destroy(nsIDOMEvent* aEvent);
NS_IMETHOD Action(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;
};
NS_IMPL_ISUPPORTS_INHERITED(nsMenuListenerAccessible, nsAccessible, nsIDOMMenuListener)
/**
* A class that represents the button inside the Select to the right of the text field
*/
class nsHTMLSelectButtonAccessible : public nsMenuListenerAccessible
{
public:
nsHTMLSelectButtonAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
NS_IMETHOD GetAccNumActions(PRUint8 *_retval);
NS_IMETHOD GetAccActionName(PRUint8 index, nsAWritableString& _retval);
NS_IMETHOD AccDoAction(PRUint8 index);
virtual void GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame);
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 nsHTMLSelectWindowAccessible : public nsMenuListenerAccessible
{
public:
nsHTMLSelectWindowAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
virtual void GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame);
nsCOMPtr<nsIAccessible> mParent;
};
/*
* The list that contains all the options in the select. It is inside the window.
*/
class nsHTMLSelectListAccessible : public nsAccessible
{
public:
nsHTMLSelectListAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLSelectListAccessible() {}
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
nsCOMPtr<nsIAccessible> mParent;
};
//--------- nsHTMLSelectAccessible -----
nsHTMLSelectAccessible::nsHTMLSelectAccessible(nsIDOMNode* aDOMNode,
nsIWeakReference* aShell)
:nsAccessible(aDOMNode, aShell)
{
}
NS_IMPL_ISUPPORTS_INHERITED1(nsHTMLSelectAccessible, nsAccessible, nsIAccessibleSelectable)
// ------------- Helper method for determination of proper Frame ------
//static
PRBool nsHTMLSelectAccessible::IsCorrectFrame( nsIFrame* aFrame, nsIAtom* aAtom ) {
if (!aFrame || !aAtom)
return PR_FALSE;
nsCOMPtr<nsIAtom> frameType;
aFrame->GetFrameType(getter_AddRefs(frameType));
if (frameType.get() != aAtom)
return PR_FALSE;
return PR_TRUE;
}
NS_IMETHODIMP nsHTMLSelectAccessible::GetAccValue(nsAWritableString& _retval)
{
nsCOMPtr<nsIAccessible> text;
GetAccFirstChild(getter_AddRefs(text));
if (text)
return text->GetAccValue(_retval);
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsHTMLSelectAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_COMBOBOX;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectAccessible::GetAccLastChild(nsIAccessible **_retval)
{
// create a window accessible
*_retval = new nsHTMLSelectWindowAccessible(this, mDOMNode, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
// create a text field
*_retval = new nsHTMLSelectTextFieldAccessible(this, mDOMNode, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectAccessible::GetAccChildCount(PRInt32 *_retval)
{
// always have 3 children
*_retval = 3;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectAccessible::GetSelectedChildren(nsISupportsArray **_retval)
{
*_retval = nsnull;
return NS_OK;
}
//-------- SelectTextFieldAccessible ------
nsHTMLSelectTextFieldAccessible::nsHTMLSelectTextFieldAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
nsLeafAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
NS_IMETHODIMP nsHTMLSelectTextFieldAccessible::GetAccValue(nsAWritableString& _retval)
{
nsIFrame* frame = nsAccessible::GetBoundsFrame();
nsCOMPtr<nsIPresContext> context;
GetPresContext(context);
if ( !frame )
return NS_ERROR_FAILURE;
frame->FirstChild(context, nsnull, &frame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::blockFrame) )
return NS_ERROR_FAILURE;
frame->FirstChild(context, nsnull, &frame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::textFrame) )
return NS_ERROR_FAILURE;
nsCOMPtr<nsIContent> content;
frame->GetContent(getter_AddRefs(content));
if (!content)
return NS_ERROR_FAILURE;
AppendFlatStringFromSubtree(content, &_retval);
return NS_OK;
}
void nsHTMLSelectTextFieldAccessible::GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame)
{
// get our first child's frame
nsIFrame* frame = nsAccessible::GetBoundsFrame();
nsCOMPtr<nsIPresContext> context;
GetPresContext(context);
if ( !frame )
return;
frame->FirstChild(context, nsnull, &frame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::blockFrame) )
return;
frame->GetParent(aRelativeFrame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( *aRelativeFrame, nsLayoutAtoms::areaFrame) )
return;
frame->GetRect(aBounds);
}
NS_IMETHODIMP nsHTMLSelectTextFieldAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectTextFieldAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
nsCOMPtr<nsIAccessible> parent;
GetAccParent(getter_AddRefs(parent));
*_retval = new nsHTMLSelectButtonAccessible(parent, mDOMNode, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectTextFieldAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectTextFieldAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_STATICTEXT;
return NS_OK;
}
// --------- nsMenuListenerAccessible -----------
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("create"), this, PR_TRUE);
}
}
NS_IMETHODIMP nsMenuListenerAccessible::Create(nsIDOMEvent* aEvent)
{
mOpen = PR_TRUE;
/* TBD send state change event */
return NS_OK;
}
NS_IMETHODIMP nsMenuListenerAccessible::Destroy(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()
{
// not 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("create"), this, PR_TRUE);
if (NS_FAILED(rv)) {
return;
}
mRegistered = PR_TRUE;
}
}
//-------- SelectButtonAccessible ------
nsHTMLSelectButtonAccessible::nsHTMLSelectButtonAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
nsMenuListenerAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
/* void accDoAction (in PRUint8 index); */
NS_IMETHODIMP nsHTMLSelectButtonAccessible::AccDoAction(PRUint8 index)
{
nsIFrame* frame = nsAccessible::GetBoundsFrame();
nsCOMPtr<nsIPresContext> context;
GetPresContext(context);
frame->FirstChild(context, nsnull, &frame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::blockFrame) )
return NS_ERROR_FAILURE;
frame->GetNextSibling(&frame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::gfxButtonControlFrame) )
return NS_ERROR_FAILURE;
nsCOMPtr<nsIContent> content;
frame->GetContent(getter_AddRefs(content));
if (index == 0) {
nsCOMPtr<nsIDOMHTMLInputElement> element(do_QueryInterface(content));
if (element)
{
element->Click();
return NS_OK;
}
return NS_ERROR_FAILURE;
}
return NS_ERROR_NOT_IMPLEMENTED;
}
/* PRUint8 getAccNumActions (); */
NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccNumActions(PRUint8 *_retval)
{
*_retval = 1;
return NS_OK;
}
void nsHTMLSelectButtonAccessible::GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame)
{
// get our second child's frame
nsIFrame* frame = nsAccessible::GetBoundsFrame();
nsCOMPtr<nsIPresContext> context;
GetPresContext(context);
frame->FirstChild(context, nsnull, &frame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::blockFrame) )
return;
frame->GetNextSibling(&frame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::gfxButtonControlFrame) )
return;
frame->GetParent(aRelativeFrame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( *aRelativeFrame, nsLayoutAtoms::areaFrame) )
return;
frame->GetRect(aBounds);
}
NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_PUSHBUTTON;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccName(nsAWritableString& _retval)
{
return GetAccActionName(0, _retval);
}
NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccActionName(PRUint8 index, nsAWritableString& _retval)
{
SetupMenuListener();
// get the current state open or closed
// set _retval to it.
// notice its supposed to be reversed. Close if opened
// and Open if closed.
if (mOpen)
_retval = NS_LITERAL_STRING("Close");
else
_retval = NS_LITERAL_STRING("Open");
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
nsCOMPtr<nsIAccessible> parent;
GetAccParent(getter_AddRefs(parent));
*_retval = new nsHTMLSelectWindowAccessible(parent, mDOMNode, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
nsCOMPtr<nsIAccessible> parent;
GetAccParent(getter_AddRefs(parent));
*_retval = new nsHTMLSelectTextFieldAccessible(parent, mDOMNode, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectButtonAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 0;
return NS_OK;
}
//---------------------
nsHTMLSelectWindowAccessible::nsHTMLSelectWindowAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell)
:nsMenuListenerAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccState(PRUint32 *_retval)
{
nsAccessible::GetAccState(_retval);
SetupMenuListener();
// if open we are visible if closed we are invisible
// set _retval to it.
if (mOpen)
*_retval |= STATE_DEFAULT;
else
*_retval |= STATE_INVISIBLE;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_WINDOW;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
nsCOMPtr<nsIAccessible> parent;
GetAccParent(getter_AddRefs(parent));
*_retval = new nsHTMLSelectButtonAccessible(parent, mDOMNode, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = new nsHTMLSelectListAccessible(this, mDOMNode, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = new nsHTMLSelectListAccessible(this, mDOMNode, mPresShell);
if ( ! *_retval )
return NS_ERROR_FAILURE;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectWindowAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 1;
return NS_OK;
}
void nsHTMLSelectWindowAccessible::GetBounds(nsRect& aBounds, nsIFrame** aRelativeFrame)
{
// get our first option
nsCOMPtr<nsIDOMNode> child;
mDOMNode->GetFirstChild(getter_AddRefs(child));
// now get its frame
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
if (!shell) {
*aRelativeFrame = nsnull;
return;
}
nsIFrame* frame = nsnull;
nsCOMPtr<nsIContent> content(do_QueryInterface(child));
shell->GetPrimaryFrameFor(content, &frame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::blockFrame) )
return;
frame->GetParent(&frame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( frame, nsLayoutAtoms::areaFrame) )
return;
frame->GetParent(aRelativeFrame);
if ( ! nsHTMLSelectAccessible::IsCorrectFrame( *aRelativeFrame, nsLayoutAtoms::listControlFrame) )
return;
frame->GetRect(aBounds);
}
//----------
nsHTMLSelectListAccessible::nsHTMLSelectListAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell)
:nsAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
NS_IMETHODIMP nsHTMLSelectListAccessible::AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height)
{
return mParent->AccGetBounds(x,y,width,height);
}
NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_LIST;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
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;
}
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::nsHTMLSelectOptionAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
nsLeafAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_LISTITEM;
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
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;
}
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;
}
NS_IMETHODIMP nsHTMLSelectOptionAccessible::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;
}

View File

@@ -0,0 +1,72 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Original Author: Eric Vaughan (evaughan@netscape.com)
*
* Contributor(s):
*/
#ifndef __nsHTMLSelectAccessible_h__
#define __nsHTMLSelectAccessible_h__
#include "nsAccessible.h"
#include "nsCOMPtr.h"
#include "nsIAtom.h"
#include "nsIAccessibleSelectable.h"
class nsHTMLSelectAccessible : public nsAccessible,
public nsIAccessibleSelectable
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIACCESSIBLESELECTABLE
nsHTMLSelectAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLSelectAccessible() {}
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccValue(nsAWritableString& _retval);
NS_IMETHOD GetAccChildCount(PRInt32 *_retval);
// helper method to verify frames
static PRBool IsCorrectFrame( nsIFrame* aFrame, nsIAtom* aAtom );
};
/*
* Each option in the Select. These are in the nsListAccessible
*/
class nsHTMLSelectOptionAccessible : public nsLeafAccessible
{
public:
nsHTMLSelectOptionAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
nsCOMPtr<nsIAccessible> mParent;
};
#endif

View File

@@ -0,0 +1,312 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Original Author: Eric Vaughan (evaughan@netscape.com)
*
* Contributor(s): John Gaunt (jgaunt@netscape.com)
*/
#include "nsHTMLSelectListAccessible.h"
#include "nsRootAccessible.h"
#include "nsCOMPtr.h"
#include "nsLayoutAtoms.h"
#include "nsIAtom.h"
#include "nsIFrame.h"
#include "nsISelectControlFrame.h"
#include "nsIDOMHTMLOptionElement.h"
#include "nsIDOMHTMLSelectElement.h"
#include "nsIDOMHTMLCollection.h"
#include "nsIListControlFrame.h"
/** ----- nsHTMLSelectListAccessible ----- */
/**
*
*/
nsHTMLSelectListAccessible::nsHTMLSelectListAccessible(nsIAccessible* aParent,
nsIDOMNode* aDOMNode,
nsIWeakReference* aShell)
:nsAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
/**
*
*/
NS_IMETHODIMP nsHTMLSelectListAccessible::AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height)
{
return mParent->AccGetBounds(x,y,width,height);
}
/**
*
*/
NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_ADDREF(*_retval);
return NS_OK;
}
/**
*
*/
NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_LIST;
return NS_OK;
}
/**
*
*/
NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccPreviousSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
*
*/
NS_IMETHODIMP nsHTMLSelectListAccessible::GetAccNextSibling(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/**
*
*/
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;
}
/**
*
*/
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;
}
/**
* As a nsHTMLSelectListAccessible we can have the following states:
* STATE_MULTISELECTABLE
* STATE_EXTSELECTABLE
* no STATE_FOCUSED! -- can't be focused, options are focused instead
* no STATE_FOCUSABLE! -- can't be focused, options are focused instead
*/
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;
}
/** ----- nsHTMLSelectOptionAccessible ----- */
/**
*
*/
nsHTMLSelectOptionAccessible::nsHTMLSelectOptionAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
nsLeafAccessible(aDOMNode, aShell)
{
mParent = aParent;
}
/**
*
*/
NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_LISTITEM;
return NS_OK;
}
/**
*
*/
NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetAccParent(nsIAccessible **_retval)
{
*_retval = mParent;
NS_IF_ADDREF(*_retval);
return NS_OK;
}
/**
*
*/
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;
}
/**
*
*/
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;
}
/**
*
*/
NS_IMETHODIMP nsHTMLSelectOptionAccessible::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;
}
/**
* 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)
{
// this sets either STATE_FOCUSED or 0 (nsAccessible::GetAccState() doesn't know about list options)
*_retval = 0;
nsCOMPtr<nsIDOMNode> focusedOptionNode, parentNode;
mParent->AccGetDOMNode(getter_AddRefs(parentNode));
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;
}
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".
// Don't use DOM method of getting selected item, which instead gives *first* selected option
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;
}

View File

@@ -0,0 +1,79 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Original Author: Eric Vaughan (evaughan@netscape.com)
*
* Contributor(s):
*/
#ifndef __nsHTMLSelectListAccessible_h__
#define __nsHTMLSelectListAccessible_h__
#include "nsAccessible.h"
#include "nsCOMPtr.h"
/*
* The list that contains all the options in the select.
*/
class nsHTMLSelectListAccessible : public nsAccessible
{
public:
nsHTMLSelectListAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLSelectListAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD AccGetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height);
NS_IMETHOD GetAccLastChild(nsIAccessible **_retval);
NS_IMETHOD GetAccFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
protected:
nsCOMPtr<nsIAccessible> mParent;
};
/*
* Options inside the select, contained within the list
*/
class nsHTMLSelectOptionAccessible : public nsLeafAccessible
{
public:
nsHTMLSelectOptionAccessible(nsIAccessible* aParent, nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
/* ----- nsIAccessible ----- */
NS_IMETHOD GetAccParent(nsIAccessible **_retval);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
NS_IMETHOD GetAccNextSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccPreviousSibling(nsIAccessible **_retval);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
NS_IMETHOD GetAccState(PRUint32 *_retval);
static nsresult GetFocusedOptionNode(nsIWeakReference *aPresShell, nsIDOMNode *aListNode, nsCOMPtr<nsIDOMNode>& aFocusedOptionNode);
protected:
nsCOMPtr<nsIAccessible> mParent;
};
#endif

View File

@@ -0,0 +1,51 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Aaron Leventhal (aaronl@netscape.com)
* Contributor(s):
*/
#include "nsHTMLTableAccessible.h"
#include "nsWeakReference.h"
#include "nsReadableUtils.h"
nsHTMLTableCellAccessible::nsHTMLTableCellAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell):
nsHTMLBlockAccessible(aDomNode, aShell)
{
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLTableCellAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_CELL;
return NS_OK;
}
nsHTMLTableAccessible::nsHTMLTableAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell):
nsHTMLBlockAccessible(aDomNode, aShell)
{
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLTableAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_TABLE;
return NS_OK;
}

View File

@@ -0,0 +1,44 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Aaron Leventhal (aaronl@netscape.com)
* Contributor(s):
*/
#ifndef _nsHTMLTableAccessible_H_
#define _nsHTMLTableAccessible_H_
#include "nsAccessible.h"
class nsHTMLTableCellAccessible : public nsHTMLBlockAccessible
{
public:
nsHTMLTableCellAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
};
class nsHTMLTableAccessible : public nsHTMLBlockAccessible
{
public:
nsHTMLTableAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccRole(PRUint32 *_retval);
};
#endif

View File

@@ -0,0 +1,73 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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.
*
* Author: Eric Vaughan (evaughan@netscape.com)
* Contributor(s):
*/
#include "nsHTMLTextAccessible.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"
nsHTMLTextAccessible::nsHTMLTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell):
nsLinkableAccessible(aDomNode, aShell)
{
}
/* wstring getAccName (); */
NS_IMETHODIMP nsHTMLTextAccessible::GetAccName(nsAWritableString& _retval)
{
return mDOMNode->GetNodeValue(_retval);
}
/* unsigned long getAccRole (); */
NS_IMETHODIMP nsHTMLTextAccessible::GetAccRole(PRUint32 *_retval)
{
*_retval = ROLE_TEXT;
return NS_OK;
}
/* nsIAccessible getAccFirstChild (); */
NS_IMETHODIMP nsHTMLTextAccessible::GetAccFirstChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/* nsIAccessible getAccLastChild (); */
NS_IMETHODIMP nsHTMLTextAccessible::GetAccLastChild(nsIAccessible **_retval)
{
*_retval = nsnull;
return NS_OK;
}
/* long getAccChildCount (); */
NS_IMETHODIMP nsHTMLTextAccessible::GetAccChildCount(PRInt32 *_retval)
{
*_retval = 0;
return NS_OK;
}

View File

@@ -0,0 +1,43 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
*/
#ifndef _nsHTMLTextAccessible_H_
#define _nsHTMLTextAccessible_H_
#include "nsAccessible.h"
class nsIWeakReference;
class nsITextControlFrame;
class nsHTMLTextAccessible : public nsLinkableAccessible
{
public:
nsHTMLTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetAccName(nsAWritableString& _retval);
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,478 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
*/
#include "nsIAccessible.h"
#include "nsRootAccessible.h"
#include "nsCOMPtr.h"
#include "nsIDocument.h"
#include "nsIPresShell.h"
#include "nsIPresContext.h"
#include "nsIContent.h"
#include "nsIFrame.h"
#include "nsIDOMEventTarget.h"
#include "nsIDOMElement.h"
#include "nsIDOMEventReceiver.h"
#include "nsReadableUtils.h"
#include "nsILink.h"
#include "nsHTMLFormControlAccessible.h"
#include "nsHTMLLinkAccessible.h"
#include "nsIURI.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.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 "nsHTMLSelectListAccessible.h"
#include "nsIDOMHTMLSelectElement.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_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"))
{
mListener = nsnull;
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
NS_ASSERTION(shell,"Shell is gone!!! What are we doing here?");
shell->GetDocument(getter_AddRefs(mDocument));
mDOMNode = do_QueryInterface(mDocument);
nsLayoutAtoms::AddRefAtoms();
}
//-----------------------------------------------------
// destruction
//-----------------------------------------------------
nsRootAccessible::~nsRootAccessible()
{
nsLayoutAtoms::ReleaseAtoms();
RemoveAccessibleEventListener(mListener);
}
/* attribute wstring accName; */
NS_IMETHODIMP nsRootAccessible::GetAccName(nsAWritableString& aAccName)
{
return GetTitle(aAccName);
}
// helpers
nsIFrame* nsRootAccessible::GetFrame()
{
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
if (!shell)
return nsnull;
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)
{
return nsDocAccessibleMixin::GetAccState(aAccState);
}
NS_IMETHODIMP nsRootAccessible::GetAccValue(nsAWritableString& aAccValue)
{
return GetURL(aAccValue);
}
/* void addAccessibleEventListener (in nsIAccessibleEventListener aListener); */
NS_IMETHODIMP nsRootAccessible::AddAccessibleEventListener(nsIAccessibleEventListener *aListener)
{
if (!mListener)
{
// 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));
// use AddEventListener from the nsIDOMEventTarget interface
nsCOMPtr<nsIDOMEventTarget> target;
if (NS_SUCCEEDED(document->QueryInterface(NS_GET_IID(nsIDOMEventTarget), getter_AddRefs(target))) && target)
{
nsresult rv = NS_OK;
// we're a DOMEventListener now!!
nsCOMPtr<nsIDOMEventListener> listener;
rv = this->QueryInterface( NS_GET_IID(nsIDOMEventListener), getter_AddRefs(listener) );
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to QI");
// capture DOM focus events
rv = target->AddEventListener( NS_LITERAL_STRING("focus") , listener, PR_TRUE );
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to register listener");
// capture Form change events
rv = target->AddEventListener( NS_LITERAL_STRING("change") , listener, 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") , listener, 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") , listener, PR_TRUE );
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to register listener");
}
}
// create a weak reference to the listener
mListener = aListener;
return NS_OK;
}
/* void removeAccessibleEventListener (in nsIAccessibleEventListener aListener); */
NS_IMETHODIMP nsRootAccessible::RemoveAccessibleEventListener(nsIAccessibleEventListener *aListener)
{
if (mListener)
{
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mPresShell));
nsCOMPtr<nsIDocument> document;
if (!shell)
return NS_OK;
shell->GetDocument(getter_AddRefs(document));
nsCOMPtr<nsIDOMEventReceiver> erP;
if (NS_SUCCEEDED(document->QueryInterface(NS_GET_IID(nsIDOMEventReceiver), getter_AddRefs(erP))) && erP)
{
nsresult rv = erP->RemoveEventListenerByIID(NS_STATIC_CAST(nsIDOMFocusListener *, this), NS_GET_IID(nsIDOMFocusListener));
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to register 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);
}
nsDocAccessibleMixin::nsDocAccessibleMixin(nsIDocument *aDoc):mDocument(aDoc)
{
}
nsDocAccessibleMixin::nsDocAccessibleMixin(nsIWeakReference *aPresShell)
{
nsCOMPtr<nsIPresShell> shell(do_QueryReferent(aPresShell));
NS_ASSERTION(shell,"Shell is gone!!! What are we doing here?");
shell->GetDocument(getter_AddRefs(mDocument));
}
nsDocAccessibleMixin::~nsDocAccessibleMixin()
{
}
NS_IMETHODIMP nsDocAccessibleMixin::GetURL(nsAWritableString& aURL)
{
nsCOMPtr<nsIURI> pURI;
mDocument->GetDocumentURL(getter_AddRefs(pURI));
nsXPIDLCString path;
pURI->GetSpec(getter_Copies(path));
aURL.Assign(NS_ConvertUTF8toUCS2(path).get());
//XXXaaronl Need to use CopyUTF8toUCS2(nsDependentCString(path), aURL); when it's written
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)
{
if (mDocument)
return mDocument->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::GetAccState(PRUint32 *aAccState)
{
// Screen readers need to know when the document is finished loading (STATE_BUSY flag)
// We do it this way, rather than via nsIWebProgressListener, because
// if accessibility was turned on after a document already finished loading,
// we would get no state changes from nsIWebProgressListener.
// The GetBusyFlags method, however, always has the current busy state information for us.
*aAccState = 0;
if (mDocument) {
nsCOMPtr<nsIPresShell> presShell;
mDocument->GetShellAt(0, getter_AddRefs(presShell));
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) {
PRUint32 busyFlags;
docShell->GetBusyFlags(&busyFlags);
if (busyFlags != nsIDocShell::BUSY_FLAGS_NONE)
*aAccState = nsIAccessible::STATE_BUSY;
}
}
}
}
}
return NS_OK;
}

View File

@@ -0,0 +1,106 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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):
*/
#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"
class nsDocAccessibleMixin
{
public:
nsDocAccessibleMixin(nsIDocument *doc);
nsDocAccessibleMixin(nsIWeakReference *aShell);
virtual ~nsDocAccessibleMixin();
NS_DECL_NSIACCESSIBLEDOCUMENT
NS_IMETHOD GetAccState(PRUint32 *aAccState);
protected:
nsCOMPtr<nsIDocument> mDocument;
};
class nsRootAccessible : public nsAccessible,
public nsDocAccessibleMixin,
public nsIAccessibleDocument,
public nsIAccessibleEventReceiver,
public nsIDOMFocusListener,
public nsIDOMFormListener
{
NS_DECL_ISUPPORTS_INHERITED
public:
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(nsIAccessibleEventListener *aListener);
// ----- nsIDOMEventListener --------------------------
NS_IMETHOD HandleEvent(nsIDOMEvent* anEvent);
// ----- 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_DECL_NSIACCESSIBLEDOCUMENT
protected:
NS_IMETHOD GetTargetNode(nsIDOMEvent *aEvent, nsCOMPtr<nsIDOMNode>& aTargetNode);
virtual void GetBounds(nsRect& aRect, nsIFrame** aRelativeFrame);
virtual nsIFrame* GetFrame();
// 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
nsIAccessibleEventListener* mListener;
nsCOMPtr<nsIDOMNode> mCurrentFocus;
nsCOMPtr<nsIAccessibilityService> mAccService;
};
#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/gdk-pixbuf.m4)dnl
builtin(include, build/autoconf/libIDL.m4)dnl
builtin(include, build/autoconf/nspr.m4)dnl
dnl
define(MOZ_TOPSRCDIR,.)dnl MOZ_TOPSRCDIR is used in altoptions.m4
builtin(include, build/autoconf/altoptions.m4)dnl

1180
mozilla/allmakefiles.sh Executable file

File diff suppressed because it is too large Load Diff

42
mozilla/build/Makefile.in Normal file
View File

@@ -0,0 +1,42 @@
#
# 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 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
ifneq ($(MOZ_WIDGET_TOOLKIT),os2)
DIRS = unix
endif
include $(topsrcdir)/config/rules.mk
# Install bloaturls.txt file for tinderbox Bloaty test.
install:: $(srcdir)/bloaturls.txt
$(INSTALL) $< $(DIST)/bin
# Install startup.html, startup test page.
install:: $(srcdir)/startup-test.html
$(INSTALL) $< $(DIST)/bin

View File

@@ -0,0 +1,179 @@
#! /usr/bin/env perl
#
# 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) 1999 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
# acoutput-fast.pl - Quickly create makefiles that are in a common format.
#
# Most of the makefiles in mozilla only refer to two configure variables:
# @srcdir@
# @top_srcdir@
# However, configure does not know any better and it runs sed on each file
# with over 150 replacement rules (slow as molasses).
#
# This script takes a list of makefiles as input. For example,
#
# echo $MAKEFILES | acoutput-fast.pl
#
# The script creates each Makefile that only references @srcdir@ and
# @top_srcdir@. For other files, it lists them in a shell command that is
# printed to stdout:
#
# CONFIG_FILES="unhandled_files..."; export CONFIG_FILES
#
# This command can be used to have config.status create the unhandled
# files. For example,
#
# eval "echo $MAKEFILES | acoutput-fast.pl"
# AC_OUTPUT($MAKEFILES)
#
# Send comments, improvements, bugs to Steve Lamm (slamm@netscape.com).
#use File::Basename;
sub dirname {
my $dir = $_[0];
return '.' if not $dir =~ m%/%;
$dir =~ s%/[^/][^/]*$%%;
return $dir;
}
# Create one directory. Assumes it doesn't already exist.
# Will create parent(s) if needed.
sub create_directory {
my $dir = $_[0];
my $parent = dirname($dir);
create_directory($parent) if not -d $parent;
mkdir "$dir",0777;
}
# Create all the directories at once.
# This can be much faster than calling mkdir() for each one.
sub create_directories {
my @makefiles = @_;
my @dirs = ();
my $ac_file;
foreach $ac_file (@makefiles) {
push @dirs, dirname($ac_file);
}
# Call mkdir with the directories sorted by subdir count (how many /'s)
if (@dirs) {
my $mkdir_command = "mkdir -p ". join(' ', @dirs);
if (system($mkdir_command) != 0) {
print STDERR "Creating dirs all at once failed; trying one at atime\n";
foreach $dir (@dirs) {
if (not -d $dir) {
print STDERR "Creating directory $dir\n";
create_directory($dir);
}
}
}
}
}
if ($ARGV[0] =~ /^--srcdir=/) {
$ac_given_srcdir = (split /=/, shift @ARGV)[1];
} else {
$ac_given_srcdir = $0;
$ac_given_srcdir =~ s|/?build/autoconf/.*$||;
$ac_given_srcdir = '.' if $ac_given_srcdir eq '';
}
# Read list of makefiles from the stdin or,
# from files listed on the command-line.
#
@makefiles=();
push @makefiles, split while (<>);
# Create all the directories at once.
# This can be much faster than calling mkdir() for each one.
create_directories(@makefiles);
# Output the makefiles.
#
@unhandled=();
foreach $ac_file (@makefiles) {
if (not $ac_file =~ /Makefile$/ or $ac_file =~ /:/) {
push @unhandled, $ac_file;
next;
}
$ac_file_in = "$ac_given_srcdir/$ac_file.in";
$ac_dir = dirname($ac_file);
if ($ac_dir eq '.') {
$ac_dir_suffix = '';
$ac_dots = '';
} else {
$ac_dir_suffix = "/$ac_dir";
$ac_dir_suffix =~ s%^/\./%/%;
$ac_dots = $ac_dir_suffix;
$ac_dots =~ s%/[^/]*%../%g;
}
if ($ac_given_srcdir eq '.') {
$srcdir = '.';
if ($ac_dots eq '') {
$top_srcdir = '.'
} else {
$top_srcdir = $ac_dots;
$top_srcdir =~ s%/$%%;
}
} elsif ($ac_given_srcdir =~ m%^/% or $ac_given_srcdir =~ m%^.:/%) {
$srcdir = "$ac_given_srcdir$ac_dir_suffix";
$top_srcdir = "$ac_given_srcdir";
} else {
$srcdir = "$ac_dots$ac_given_srcdir$ac_dir_suffix";
$top_srcdir = "$ac_dots$ac_given_srcdir";
}
if (-e $ac_file) {
next if -M _ < -M $ac_file_in;
print STDERR "updating $ac_file\n";
} else {
print STDERR "creating $ac_file\n";
}
open (INFILE, "<$ac_file_in")
or ( warn "can't read $ac_file_in: No such file or directory\n" and next);
open (OUTFILE, ">$ac_file")
or ( warn "Unable to create $ac_file\n" and next);
while (<INFILE>) {
#if (/\@[_a-zA-Z]*\@.*\@[_a-zA-Z]*\@/) {
# warn "Two defines on a line:$ac_file:$.:$_";
# push @unhandled, $ac_file;
# last;
#}
s/\@srcdir\@/$srcdir/g;
s/\@top_srcdir\@/$top_srcdir/g;
if (/\@[_a-zA-Z]*\@/) {
warn "Unknown variable:$ac_file:$.:$_";
push @unhandled, $ac_file;
last;
}
print OUTFILE;
}
close INFILE;
close OUTFILE;
}
# Print the shell command to be evaluated by configure.
#
print "CONFIG_FILES=\"".join(' ', @unhandled)."\"; export CONFIG_FILES\n";

View File

@@ -0,0 +1,140 @@
dnl The contents of this file are subject to the Netscape Public
dnl License Version 1.1 (the "License"); you may not use this file
dnl except in compliance with the License. You may obtain a copy of
dnl the License at http://www.mozilla.org/NPL/
dnl
dnl Software distributed under the License is distributed on an "AS
dnl IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
dnl implied. See the License for the specific language governing
dnl rights and limitations under the License.
dnl
dnl The Original Code is mozilla.org code.
dnl
dnl The Initial Developer of the Original Code is Netscape
dnl Communications Corporation. Portions created by Netscape are
dnl Copyright (C) 1999 Netscape Communications Corporation. All
dnl Rights Reserved.
dnl
dnl Contributor(s):
dnl
dnl altoptions.m4 - An alternative way of specifying command-line options.
dnl These macros are needed to support a menu-based configurator.
dnl This file also includes the macro, AM_READ_MYCONFIG, for reading
dnl the 'myconfig.m4' file.
dnl Send comments, improvements, bugs to Steve Lamm (slamm@netscape.com).
dnl MOZ_ARG_ENABLE_BOOL( NAME, HELP, IF-YES [, IF-NO [, ELSE]])
dnl MOZ_ARG_DISABLE_BOOL( NAME, HELP, IF-NO [, IF-YES [, ELSE]])
dnl MOZ_ARG_ENABLE_STRING( NAME, HELP, IF-SET [, ELSE])
dnl MOZ_ARG_ENABLE_BOOL_OR_STRING( NAME, HELP, IF-YES, IF-NO, IF-SET[, ELSE]]])
dnl MOZ_ARG_WITH_BOOL( NAME, HELP, IF-YES [, IF-NO [, ELSE])
dnl MOZ_ARG_WITHOUT_BOOL( NAME, HELP, IF-NO [, IF-YES [, ELSE])
dnl MOZ_ARG_WITH_STRING( NAME, HELP, IF-SET [, ELSE])
dnl MOZ_ARG_HEADER(Comment)
dnl MOZ_CHECK_PTHREADS( NAME, IF-YES [, ELSE ])
dnl MOZ_READ_MYCONFIG() - Read in 'myconfig.sh' file
dnl MOZ_TWO_STRING_TEST(NAME, STR1, IF-STR1, STR2, IF-STR2 [, ELSE])
AC_DEFUN(MOZ_TWO_STRING_TEST,
[if test "$enableval" = "[$2]"; then
ifelse([$3], , :, [$3])
elif test "$enableval" = "[$4]"; then
ifelse([$5], , :, [$5])
else
ifelse([$6], ,
[AC_MSG_ERROR([Option, [$1], does not take an argument ($enableval).])],
[$6])
fi])
dnl MOZ_ARG_ENABLE_BOOL(NAME, HELP, IF-YES [, IF-NO [, ELSE]])
AC_DEFUN(MOZ_ARG_ENABLE_BOOL,
[AC_ARG_ENABLE([$1], [$2],
[MOZ_TWO_STRING_TEST([$1], yes, [$3], no, [$4])],
[$5])])
dnl MOZ_ARG_DISABLE_BOOL(NAME, HELP, IF-NO [, IF-YES [, ELSE]])
AC_DEFUN(MOZ_ARG_DISABLE_BOOL,
[AC_ARG_ENABLE([$1], [$2],
[MOZ_TWO_STRING_TEST([$1], no, [$3], yes, [$4])],
[$5])])
dnl MOZ_ARG_ENABLE_STRING(NAME, HELP, IF-SET [, ELSE])
AC_DEFUN(MOZ_ARG_ENABLE_STRING,
[AC_ARG_ENABLE([$1], [$2], [$3], [$4])])
dnl MOZ_ARG_ENABLE_BOOL_OR_STRING(NAME, HELP, IF-YES, IF-NO, IF-SET[, ELSE]]])
AC_DEFUN(MOZ_ARG_ENABLE_BOOL_OR_STRING,
[ifelse([$5], ,
[errprint([Option, $1, needs an "IF-SET" argument.
])
m4exit(1)],
[AC_ARG_ENABLE([$1], [$2],
[MOZ_TWO_STRING_TEST([$1], yes, [$3], no, [$4], [$5])],
[$6])])])
dnl MOZ_ARG_WITH_BOOL(NAME, HELP, IF-YES [, IF-NO [, ELSE])
AC_DEFUN(MOZ_ARG_WITH_BOOL,
[AC_ARG_WITH([$1], [$2],
[MOZ_TWO_STRING_TEST([$1], yes, [$3], no, [$4])],
[$5])])
dnl MOZ_ARG_WITHOUT_BOOL(NAME, HELP, IF-NO [, IF-YES [, ELSE])
AC_DEFUN(MOZ_ARG_WITHOUT_BOOL,
[AC_ARG_WITH([$1], [$2],
[MOZ_TWO_STRING_TEST([$1], no, [$3], yes, [$4])],
[$5])])
dnl MOZ_ARG_WITH_STRING(NAME, HELP, IF-SET [, ELSE])
AC_DEFUN(MOZ_ARG_WITH_STRING,
[AC_ARG_WITH([$1], [$2], [$3], [$4])])
dnl MOZ_ARG_HEADER(Comment)
dnl This is used by webconfig to group options
define(MOZ_ARG_HEADER, [# $1])
dnl
dnl Apparently, some systems cannot properly check for the pthread
dnl library unless <pthread.h> is included so we need to test
dnl using it
dnl
dnl MOZ_CHECK_PTHREADS(lib, success, failure)
AC_DEFUN(MOZ_CHECK_PTHREADS,
[
AC_MSG_CHECKING([for pthread_create in -l$1])
echo "
#include <pthread.h>
void *foo(void *v) { int a = 1; }
int main() {
pthread_t t;
if (!pthread_create(&t, 0, &foo, 0)) {
pthread_join(t, 0);
}
exit(0);
}" > dummy.c ;
echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS" 1>&5;
${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS 2>&5;
_res=$? ;
rm -f dummy.c dummy${ac_exeext} ;
if test "$_res" = "0"; then
AC_MSG_RESULT([yes])
[$2]
else
AC_MSG_RESULT([no])
[$3]
fi
])
dnl MOZ_READ_MYCONFIG() - Read in 'myconfig.sh' file
AC_DEFUN(MOZ_READ_MOZCONFIG,
[AC_REQUIRE([AC_INIT_BINSH])dnl
# Read in '.mozconfig' script to set the initial options.
# See the mozconfig2configure script for more details.
_AUTOCONF_TOOLS_DIR=`dirname [$]0`/[$1]/build/autoconf
. $_AUTOCONF_TOOLS_DIR/mozconfig2configure])
dnl This gets inserted at the top of the configure script
MOZ_READ_MOZCONFIG(MOZ_TOPSRCDIR)

View File

@@ -0,0 +1,54 @@
#!/bin/sh
#
# 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):
#
# clean-config.sh - Removes all files generated by mozilla configure.
# Only removes files from the topsrcdir. To clean up an objdir,
# simply remove the directory and start over.
#
# Usage:
# 1. cd <topsrcdir>
# 2. build/autoconf/clean-config.sh
#
# Send comments, improvements, bugs to slamm@netscape.com
topsrcdir=`cd \`dirname $0\`/../..; pwd`
if [ ! -f configure.in ]; then
echo "clean-config.sh only cleans the source tree. To run," 2>&1
echo " cd $topsrcdir; build/autoconf/clean-config.sh" 2>&1
echo " (To clean a separate objdir, simple remove the directory.)" 2>&1
exit 1
fi
if [ -f mailnews/makefiles ]; then
MOZ_MAIL_NEWS=1
export MOZ_MAIL_NEWS
fi
. allmakefiles.sh
rm -fr $MAKEFILES \
config-defs.h \
config.cache \
config.log \
config.status \
$NULL

1391
mozilla/build/autoconf/config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

1373
mozilla/build/autoconf/config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,166 @@
# Configure paths for gdk-pixbuf
# Elliot Lee 2000-01-10
# stolen from Raph Levien 98-11-18
# stolen from Manish Singh 98-9-30
# stolen back from Frank Belew
# stolen from Manish Singh
# Shamelessly stolen from Owen Taylor
dnl AM_PATH_GDK_PIXBUF([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for GDK_PIXBUF, and define GDK_PIXBUF_CFLAGS and GDK_PIXBUF_LIBS
dnl
AC_DEFUN(AM_PATH_GDK_PIXBUF,
[dnl
dnl Get the cflags and libraries from the gdk-pixbuf-config script
dnl
AC_ARG_WITH(gdk-pixbuf-prefix,[ --with-gdk-pixbuf-prefix=PFX Prefix where GDK_PIXBUF is installed (optional)],
gdk_pixbuf_prefix="$withval", gdk_pixbuf_prefix="")
AC_ARG_WITH(gdk-pixbuf-exec-prefix,[ --with-gdk-pixbuf-exec-prefix=PFX Exec prefix where GDK_PIXBUF is installed (optional)],
gdk_pixbuf_exec_prefix="$withval", gdk_pixbuf_exec_prefix="")
AC_ARG_ENABLE(gdk_pixbuftest, [ --disable-gdk_pixbuftest Do not try to compile and run a test GDK_PIXBUF program],
, enable_gdk_pixbuftest=yes)
if test x$gdk_pixbuf_exec_prefix != x ; then
gdk_pixbuf_args="$gdk_pixbuf_args --exec-prefix=$gdk_pixbuf_exec_prefix"
if test x${GDK_PIXBUF_CONFIG+set} = xset ; then
GDK_PIXBUF_CONFIG=$gdk_pixbuf_exec_prefix/gdk-pixbuf-config
fi
fi
if test x$gdk_pixbuf_prefix != x ; then
gdk_pixbuf_args="$gdk_pixbuf_args --prefix=$gdk_pixbuf_prefix"
if test x${GDK_PIXBUF_CONFIG+set} = xset ; then
GDK_PIXBUF_CONFIG=$gdk_pixbuf_prefix/bin/gdk-pixbuf-config
fi
fi
AC_PATH_PROG(GDK_PIXBUF_CONFIG, gdk-pixbuf-config, no)
min_gdk_pixbuf_version=ifelse([$1], ,0.2.5,$1)
AC_MSG_CHECKING(for GDK_PIXBUF - version >= $min_gdk_pixbuf_version)
no_gdk_pixbuf=""
if test "$GDK_PIXBUF_CONFIG" = "no" ; then
no_gdk_pixbuf=yes
else
GDK_PIXBUF_CFLAGS=`$GDK_PIXBUF_CONFIG $gdk_pixbufconf_args --cflags`
GDK_PIXBUF_LIBS=`$GDK_PIXBUF_CONFIG $gdk_pixbufconf_args --libs`
gdk_pixbuf_major_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
gdk_pixbuf_minor_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
gdk_pixbuf_micro_version=`$GDK_PIXBUF_CONFIG $gdk_pixbuf_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_gdk_pixbuftest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS"
LIBS="$LIBS $GDK_PIXBUF_LIBS"
dnl
dnl Now check if the installed GDK_PIXBUF is sufficiently new. (Also sanity
dnl checks the results of gdk-pixbuf-config to some extent
dnl
rm -f conf.gdk_pixbuftest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
char*
my_strdup (char *str)
{
char *new_str;
if (str)
{
new_str = malloc ((strlen (str) + 1) * sizeof(char));
strcpy (new_str, str);
}
else
new_str = NULL;
return new_str;
}
int main ()
{
int major, minor, micro;
char *tmp_version;
system ("touch conf.gdk_pixbuftest");
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = my_strdup("$min_gdk_pixbuf_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_gdk_pixbuf_version");
exit(1);
}
if (($gdk_pixbuf_major_version > major) ||
(($gdk_pixbuf_major_version == major) && ($gdk_pixbuf_minor_version > minor)) ||
(($gdk_pixbuf_major_version == major) && ($gdk_pixbuf_minor_version == minor) && ($gdk_pixbuf_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** 'gdk-pixbuf-config --version' returned %d.%d.%d, but the minimum version\n", $gdk_pixbuf_major_version, $gdk_pixbuf_minor_version, $gdk_pixbuf_micro_version);
printf("*** of GDK_PIXBUF required is %d.%d.%d. If gdk-pixbuf-config is correct, then it is\n", major, minor, micro);
printf("*** best to upgrade to the required version.\n");
printf("*** If gdk-pixbuf-config was wrong, set the environment variable GDK_PIXBUF_CONFIG\n");
printf("*** to point to the correct copy of gdk-pixbuf-config, and remove the file\n");
printf("*** config.cache before re-running configure\n");
return 1;
}
}
],, no_gdk_pixbuf=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_gdk_pixbuf" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$GDK_PIXBUF_CONFIG" = "no" ; then
echo "*** The gdk-pixbuf-config script installed by GDK_PIXBUF could not be found"
echo "*** If GDK_PIXBUF was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the GDK_PIXBUF_CONFIG environment variable to the"
echo "*** full path to gdk-pixbuf-config."
else
if test -f conf.gdk_pixbuftest ; then
:
else
echo "*** Could not run GDK_PIXBUF test program, checking why..."
CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS"
LIBS="$LIBS $GDK_PIXBUF_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GDK_PIXBUF or finding the wrong"
echo "*** version of GDK_PIXBUF. If it is not finding GDK_PIXBUF, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means GDK_PIXBUF was incorrectly installed"
echo "*** or that you have moved GDK_PIXBUF since it was installed. In the latter case, you"
echo "*** may want to edit the gdk-pixbuf-config script: $GDK_PIXBUF_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
GDK_PIXBUF_CFLAGS=""
GDK_PIXBUF_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(GDK_PIXBUF_CFLAGS)
AC_SUBST(GDK_PIXBUF_LIBS)
rm -f conf.gdk_pixbuftest
])

View File

@@ -0,0 +1,200 @@
# Configure paths for GLIB
# Owen Taylor 97-11-3
dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
dnl gthread is specified in MODULES, pass to glib-config
dnl
AC_DEFUN(AM_PATH_GLIB,
[dnl
dnl Get the cflags and libraries from the glib-config script
dnl
AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)],
glib_config_prefix="$withval", glib_config_prefix="")
AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX
Exec prefix where GLIB is installed (optional)],
glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
, enable_glibtest=yes)
if test x$glib_config_exec_prefix != x ; then
glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
if test x${GLIB_CONFIG+set} != xset ; then
GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
fi
fi
if test x$glib_config_prefix != x ; then
glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
if test x${GLIB_CONFIG+set} != xset ; then
GLIB_CONFIG=$glib_config_prefix/bin/glib-config
fi
fi
for module in . $4
do
case "$module" in
gmodule)
glib_config_args="$glib_config_args gmodule"
;;
gthread)
glib_config_args="$glib_config_args gthread"
;;
esac
done
dnl Force a version check to keep upgraded versions from being overridden by the cached value.
unset ac_cv_path_GLIB_CONFIG
AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
min_glib_version=ifelse([$1], ,0.99.7,$1)
AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
no_glib=""
if test "$GLIB_CONFIG" = "no" ; then
no_glib=yes
else
GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_glibtest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$GLIB_LIBS $LIBS"
dnl
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
dnl checks the results of glib-config to some extent
dnl
rm -f conf.glibtest
AC_TRY_RUN([
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
int
main ()
{
int major, minor, micro;
char *tmp_version;
system ("touch conf.glibtest");
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = g_strdup("$min_glib_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_glib_version");
exit(1);
}
if ((glib_major_version != $glib_config_major_version) ||
(glib_minor_version != $glib_config_minor_version) ||
(glib_micro_version != $glib_config_micro_version))
{
printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
$glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
glib_major_version, glib_minor_version, glib_micro_version);
printf ("*** was found! If glib-config was correct, then it is best\n");
printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
printf("*** required on your system.\n");
printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
printf("*** before re-running configure\n");
}
else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
(glib_minor_version != GLIB_MINOR_VERSION) ||
(glib_micro_version != GLIB_MICRO_VERSION))
{
printf("*** GLIB header files (version %d.%d.%d) do not match\n",
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
printf("*** library (version %d.%d.%d)\n",
glib_major_version, glib_minor_version, glib_micro_version);
}
else
{
if ((glib_major_version > major) ||
((glib_major_version == major) && (glib_minor_version > minor)) ||
((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
glib_major_version, glib_minor_version, glib_micro_version);
printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
major, minor, micro);
printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
printf("***\n");
printf("*** If you have already installed a sufficiently new version, this error\n");
printf("*** probably means that the wrong copy of the glib-config shell script is\n");
printf("*** being found. The easiest way to fix this is to remove the old version\n");
printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
printf("*** correct copy of glib-config. (In this case, you will have to\n");
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
printf("*** so that the correct libraries are found at run-time))\n");
}
}
return 1;
}
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_glib" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$GLIB_CONFIG" = "no" ; then
echo "*** The glib-config script installed by GLIB could not be found"
echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the GLIB_CONFIG environment variable to the"
echo "*** full path to glib-config."
else
if test -f conf.glibtest ; then
:
else
echo "*** Could not run GLIB test program, checking why..."
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$LIBS $GLIB_LIBS"
AC_TRY_LINK([
#include <glib.h>
#include <stdio.h>
], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
echo "***"
echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
echo "*** came with the system with the command"
echo "***"
echo "*** rpm --erase --nodeps gtk gtk-devel" ],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
GLIB_CFLAGS=""
GLIB_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
rm -f conf.glibtest
])

View File

@@ -0,0 +1,191 @@
# Configure paths for GTK+
# Owen Taylor 97-11-3
# (copy of gtk.m4 (public domain))
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
dnl
AC_DEFUN(AM_PATH_GTK,
[dnl
dnl Get the cflags and libraries from the gtk-config script
dnl
AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
gtk_config_prefix="$withval", gtk_config_prefix="")
AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX
Exec prefix where GTK is installed (optional)],
gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
, enable_gtktest=yes)
if test x$gtk_config_exec_prefix != x ; then
gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
if test x${GTK_CONFIG+set} != xset ; then
GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
fi
fi
if test x$gtk_config_prefix != x ; then
gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
if test x${GTK_CONFIG+set} != xset ; then
GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
fi
fi
dnl Force a version check to keep upgraded versions from being overridden by the cached value.
unset ac_cv_path_GTK_CONFIG
AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
min_gtk_version=ifelse([$1], ,0.99.7,$1)
AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
no_gtk=""
if test "$GTK_CONFIG" = "no" ; then
no_gtk=yes
else
GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_gtktest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$LIBS $GTK_LIBS"
dnl
dnl Now check if the installed GTK is sufficiently new. (Also sanity
dnl checks the results of gtk-config to some extent
dnl
rm -f conf.gtktest
AC_TRY_RUN([
#include <gtk/gtk.h>
#include <stdio.h>
#include <stdlib.h>
int
main ()
{
int major, minor, micro;
char *tmp_version;
system ("touch conf.gtktest");
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = g_strdup("$min_gtk_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_gtk_version");
exit(1);
}
if ((gtk_major_version != $gtk_config_major_version) ||
(gtk_minor_version != $gtk_config_minor_version) ||
(gtk_micro_version != $gtk_config_micro_version))
{
printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
$gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
gtk_major_version, gtk_minor_version, gtk_micro_version);
printf ("*** was found! If gtk-config was correct, then it is best\n");
printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
printf("*** required on your system.\n");
printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
printf("*** before re-running configure\n");
}
#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
(gtk_minor_version != GTK_MINOR_VERSION) ||
(gtk_micro_version != GTK_MICRO_VERSION))
{
printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
printf("*** library (version %d.%d.%d)\n",
gtk_major_version, gtk_minor_version, gtk_micro_version);
}
#endif /* defined (GTK_MAJOR_VERSION) ... */
else
{
if ((gtk_major_version > major) ||
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
gtk_major_version, gtk_minor_version, gtk_micro_version);
printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
major, minor, micro);
printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
printf("***\n");
printf("*** If you have already installed a sufficiently new version, this error\n");
printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
printf("*** being found. The easiest way to fix this is to remove the old version\n");
printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
printf("*** correct copy of gtk-config. (In this case, you will have to\n");
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
printf("*** so that the correct libraries are found at run-time))\n");
}
}
return 1;
}
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_gtk" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$GTK_CONFIG" = "no" ; then
echo "*** The gtk-config script installed by GTK could not be found."
echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the GTK_CONFIG environment variable to the"
echo "*** full path to gtk-config."
echo "*** GTK+ is available from ftp://ftp.gtk.org/pub/gtk"
else
if test -f conf.gtktest ; then
:
else
echo "*** Could not run GTK test program, checking why..."
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$LIBS $GTK_LIBS"
AC_TRY_LINK([
#include <gtk/gtk.h>
#include <stdio.h>
], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GTK or finding the wrong"
echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
echo "***"
echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
echo "*** came with the system with the command"
echo "***"
echo "*** rpm --erase --nodeps gtk gtk-devel" ],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means GTK was incorrectly installed"
echo "*** or that you have moved GTK since it was installed. In the latter case, you"
echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
GTK_CFLAGS=""
GTK_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
rm -f conf.gtktest
])

119
mozilla/build/autoconf/install-sh Executable file
View File

@@ -0,0 +1,119 @@
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5; it is not part of GNU.
#
# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
#
# This script is compatible with the BSD install script, but was written
# from scratch.
#
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
instcmd="$mvprog"
chmodcmd=""
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
fi
# Make a temp file name in the proper directory.
dstdir=`dirname $dst`
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp
# and set any options; do chmod last to preserve setuid bits
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi
# Now rename the file to the real destination.
$doit $rmcmd $dst
$doit $mvcmd $dsttmp $dst
exit 0

View File

@@ -0,0 +1,198 @@
# Configure paths for LIBIDL
dnl AM_PATH_LIBIDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
dnl Test for LIBIDL, and define LIBIDL_CFLAGS and LIBIDL_LIBS
dnl
AC_DEFUN(AM_PATH_LIBIDL,
[dnl
dnl Get the cflags and libraries from the libIDL-config script
dnl
AC_ARG_WITH(libIDL-prefix,[ --with-libIDL-prefix=PFX
Prefix where libIDL is installed (optional)],
libIDL_config_prefix="$withval", libIDL_config_prefix="")
AC_ARG_WITH(libIDL-exec-prefix,[ --with-libIDL-exec-prefix=PFX
Exec prefix where libIDL is installed (optional)],
libIDL_config_exec_prefix="$withval", libIDL_config_exec_prefix="")
AC_ARG_ENABLE(libIDLtest, [ --disable-libIDLtest Do not try to compile and run a test libIDL program],
, enable_libIDLtest=yes)
if test x$libIDL_config_exec_prefix != x ; then
libIDL_config_args="$libIDL_config_args --exec-prefix=$libIDL_config_exec_prefix"
if test x${LIBIDL_CONFIG+set} != xset ; then
LIBIDL_CONFIG=$libIDL_config_exec_prefix/bin/libIDL-config
fi
fi
if test x$libIDL_config_prefix != x ; then
libIDL_config_args="$libIDL_config_args --prefix=$libIDL_config_prefix"
if test x${LIBIDL_CONFIG+set} != xset ; then
LIBIDL_CONFIG=$libIDL_config_prefix/bin/libIDL-config
fi
fi
AM_PATH_GLIB(1.2.0)
dnl Force a version check to keep upgraded versions from being overridden by the cached value.
unset ac_cv_path_LIBIDL_CONFIG
AC_PATH_PROG(LIBIDL_CONFIG, libIDL-config, no)
min_libIDL_version=ifelse([$1], ,0.6.0,$1)
AC_MSG_CHECKING(for libIDL - version >= $min_libIDL_version)
no_libIDL=""
if test "$LIBIDL_CONFIG" = "no" ; then
no_libIDL=yes
else
LIBIDL_CFLAGS=`$LIBIDL_CONFIG $libIDL_config_args --cflags`
LIBIDL_LIBS=`$LIBIDL_CONFIG $libIDL_config_args --libs`
# hack to allow us to keep using libIDL 0.6.3-0.6.7. Anyone may remove
# this after we start requiring libIDL 0.6.8 or anything higher
LIBIDL_CFLAGS="$GLIB_CFLAGS $LIBIDL_CFLAGS"
LIBIDL_LIBS="$GLIB_LIBS $LIBIDL_LIBS"
libIDL_config_major_version=`$LIBIDL_CONFIG $libIDL_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
libIDL_config_minor_version=`$LIBIDL_CONFIG $libIDL_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
libIDL_config_micro_version=`$LIBIDL_CONFIG $libIDL_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_libIDLtest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $LIBIDL_CFLAGS"
LIBS="$LIBIDL_LIBS $LIBS"
dnl
dnl Now check if the installed LIBIDL is sufficiently new.
dnl
rm -f conf.libIDLtest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <libIDL/IDL.h>
int
main ()
{
int major, minor, micro;
int libIDL_major_version;
int libIDL_minor_version;
int libIDL_micro_version;
char *tmp_version;
system ("touch conf.libIDLtest");
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = g_strdup ("$min_libIDL_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_libIDL_version");
exit(1);
}
tmp_version = g_strdup (IDL_get_libver_string ());
if (sscanf(tmp_version, "%d.%d.%d",
&libIDL_major_version,
&libIDL_minor_version,
&libIDL_micro_version) != 3) {
printf("%s, bad version string\n", tmp_version);
exit(1);
}
if ((libIDL_major_version != $libIDL_config_major_version) ||
(libIDL_minor_version != $libIDL_config_minor_version) ||
(libIDL_micro_version != $libIDL_config_micro_version))
{
printf("\n*** 'libIDL-config --version' returned %d.%d.%d, but libIDL (%d.%d.%d)\n",
$libIDL_config_major_version, $libIDL_config_minor_version, $libIDL_config_micro_version,
libIDL_major_version, libIDL_minor_version, libIDL_micro_version);
printf ("*** was found! If libIDL-config was correct, then it is best\n");
printf ("*** to remove the old version of LIBIDL. You may also be able to fix the error\n");
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
printf("*** required on your system.\n");
printf("*** If libIDL-config was wrong, set the environment variable LIBIDL_CONFIG\n");
printf("*** to point to the correct copy of libIDL-config, and remove the file config.cache\n");
printf("*** before re-running configure\n");
}
else if ((libIDL_major_version != LIBIDL_MAJOR_VERSION) ||
(libIDL_minor_version != LIBIDL_MINOR_VERSION) ||
(libIDL_micro_version != LIBIDL_MICRO_VERSION))
{
printf("\n*** libIDL header files (version %d.%d.%d) do not match\n",
LIBIDL_MAJOR_VERSION, LIBIDL_MINOR_VERSION, LIBIDL_MICRO_VERSION);
printf("*** library (version %d.%d.%d)\n",
libIDL_major_version, libIDL_minor_version, libIDL_micro_version);
}
else
{
if ((libIDL_major_version > major) ||
((libIDL_major_version == major) && (libIDL_minor_version > minor)) ||
((libIDL_major_version == major) && (libIDL_minor_version == minor) && (libIDL_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** An old version of libIDL (%d.%d.%d) was found.\n",
libIDL_major_version, libIDL_minor_version, libIDL_micro_version);
printf("*** You need at least libIDL version %d.%d.%d.\n",
major, minor, micro);
printf("***\n");
printf("*** If you have already installed a sufficiently new version, this error\n");
printf("*** probably means that the wrong copy of the libIDL-config shell script is\n");
printf("*** being found. The easiest way to fix this is to remove the old version\n");
printf("*** of libIDL, but you can also set the LIBIDL_CONFIG environment to point to the\n");
printf("*** correct copy of libIDL-config. (In this case, you will have to\n");
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
printf("*** so that the correct libraries are found at run-time))\n");
}
}
return 1;
}
],, no_libIDL=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_libIDL" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$LIBIDL_CONFIG" = "no" ; then
echo "*** The libIDL-config script installed by libIDL could not be found"
echo "*** If libIDL was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the LIBIDL_CONFIG environment variable to the"
echo "*** full path to libIDL-config."
else
if test -f conf.libIDLtest ; then
:
else
echo "*** Could not run libIDL test program, checking why..."
CFLAGS="$CFLAGS $LIBIDL_CFLAGS"
LIBS="$LIBS $LIBIDL_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <stdlib.h>
#include <libIDL/IDL.h>
], [ return IDL_get_libver_string ? 1 : 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding libIDL or finding the wrong"
echo "*** version of LIBIDL. If it is not finding libIDL, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means libIDL was incorrectly installed"
echo "*** or that you have moved libIDL since it was installed. In the latter case, you"
echo "*** may want to edit the libIDL-config script: $LIBIDL_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
LIBIDL_CFLAGS=""
LIBIDL_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(LIBIDL_CFLAGS)
AC_SUBST(LIBIDL_LIBS)
rm -f conf.libIDLtest
])

View File

@@ -0,0 +1,280 @@
#! /usr/bin/env perl
# 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) 1999 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
# make-makefiles - Quickly create Makefiles for subdirectories.
# Also, creates any needed subdirectories.
#
# usage: make-makefiles [ -t <topsrcdir> -d <depth> ] [ <subdir> | <subdir>/Makefile ] ...
# Send comments, improvements, bugs to Steve Lamm (slamm@netscape.com).
#$debug = 1;
# Determine various tree path variables
#
($topsrcdir, $depth, @makefiles) = parse_arguments(@ARGV);
$object_fullpath = `pwd`;
chdir $depth;
$object_root = `pwd`;
chomp $object_fullpath;
chomp $object_root;
# $source_subdir is the path from the object root to where
# 'make-makefile' was called. For example, if make-makefile was
# called from "mozilla/gfx/src", then $source_subdir would be
# "gfx/src/".
$source_subdir = "$object_fullpath/";
my $quoted_object_root = quotemeta($object_root);
$source_subdir =~ s|^$quoted_object_root/||;
# Prefix makefiles with $source_subdir so that paths
# will be relative to the top of the object tree.
#
for $makefile (@makefiles) {
$makefile = "$source_subdir$makefile";
}
create_directories(@makefiles);
# Find the path to the source directory based on how 'make-makefile'
# was invoked. The path is either relative to the object directory
# or an absolute path.
$given_srcdir = find_srcdir($topsrcdir, $depth);
if ($debug) {
warn "object_fullpath = $object_fullpath\n";
warn "object_root = $object_root\n";
warn "source_subdir = $source_subdir\n";
warn "makefiles = @makefiles\n";
warn "given_srcdir = $given_srcdir\n";
}
@unhandled = update_makefiles($given_srcdir, @makefiles);
run_config_status(@unhandled);
# end of Main
############################################################
sub dirname {
return $_[0] =~ /(.*)\/.*/ ? "$1" : '.';
}
# find_depth: Pull the value of DEPTH out of a Makefile (or Makefile.in)
sub find_depth {
my $depth = '';
open(MAKEFILE, "<$_[0]") || die "Unable to open $_[0]: $!\n";
while (<MAKEFILE>) {
next unless /^DEPTH\s*=\s*(\..*)/;
$depth = $1;
last;
}
close MAKEFILE;
return $depth;
}
sub parse_arguments {
my @args = @_;
my $depth = '';
my $topsrcdir = '';
my @makefiles = ();
while (1) {
if ($args[0] eq '-d') {
$depth = $args[1];
shift @args;
shift @args;
} elsif ($args[0] eq '-t') {
$topsrcdir = $args[1];
shift @args;
shift @args;
} else {
last;
}
}
if ($topsrcdir eq '') {
$topsrcdir = $0; # Figure out topsrcdir based on program name.
$topsrcdir =~ s|/?build/autoconf/.*$||;
}
if ($depth eq '') {
# Use $(DEPTH) in the Makefile or Makefile.in to determine the depth
if (-e "Makefile.in") {
$depth = find_depth("Makefile.in");
} elsif (-e "Makefile") {
$depth = find_depth("Makefile");
} elsif (-e "../Makefile") {
$depth = "../".find_depth("../Makefile");
$depth =~ s/\/\.$//;
} else {
warn "Unable to determine depth (e.g. ../..) to root of objdir tree.\n";
die "No Makefile(.in) present. Try running with '-d <depth>'\n";
}
}
# Build the list of makefiles to generate
#
@makefiles = ();
my $makefile;
foreach $makefile (@args) {
$makefile =~ s/\.in$//;
$makefile =~ s/\/$//;
$makefile =~ /Makefile$/ or $makefile .= "/Makefile";
push @makefiles, "$makefile";
}
@makefiles = "Makefile" unless @args;
return ($topsrcdir, $depth, @makefiles);
}
# Create all the directories at once.
# This can be much faster than calling mkdir() for each one.
sub create_directories {
my @makefiles = @_;
my @dirs = ();
my $ac_file;
foreach $ac_file (@makefiles) {
push @dirs, dirname($ac_file);
}
# Call mkdir with the directories sorted by subdir count (how many /'s)
system "mkdir -p ". join(' ', @dirs) if @dirs;
}
# Find the top of the source directory
# (Assuming that the executable is in $top_srcdir/build/autoconf)
sub find_srcdir {
my ($ac_given_srcdir, $depth) = @_;
if ($debug) {
print "ac_given_srcdir = $ac_given_srcdir\n";
print "depth = $depth\n";
}
if ($ac_given_srcdir =~ /^\./ and $depth ne '.') {
my $quoted_depth = quotemeta($depth);
$ac_given_srcdir =~ s|^$quoted_depth/?||;
}
if ($debug) {
print "ac_given_srcdir = $ac_given_srcdir\n";
}
$ac_given_srcdir = '.' if $ac_given_srcdir eq '';
return $ac_given_srcdir;
}
# Output the makefiles.
#
sub update_makefiles {
my ($ac_given_srcdir, @makefiles) = @_;
my @unhandled=();
my $ac_file;
foreach $ac_file (@makefiles) {
my $ac_file_in = "$ac_given_srcdir/${ac_file}.in";
my $ac_dir = dirname($ac_file);
my $ac_dots = '';
my $ac_dir_suffix = '';
my $srcdir = '.';
my $top_srcdir = '.';
# Determine $srcdir and $top_srcdir
#
if ($ac_dir ne '.') {
$ac_dir_suffix = "/$ac_dir";
$ac_dir_suffix =~ s%^/\./%/%;
$ac_dots = $ac_dir_suffix;
$ac_dots =~ s%/[^/]*%../%g;
}
if ($ac_given_srcdir eq '.') {
if ($ac_dots ne '') {
$top_srcdir = $ac_dots;
$top_srcdir =~ s%/$%%;
}
} elsif ($ac_given_srcdir =~ m%^/% or $ac_given_srcdir =~ m%^.:/%) {
$srcdir = "$ac_given_srcdir$ac_dir_suffix";
$top_srcdir = "$ac_given_srcdir";
} else {
$srcdir = "$ac_dots$ac_given_srcdir$ac_dir_suffix";
$top_srcdir = "$ac_dots$ac_given_srcdir";
}
if ($debug) {
print "ac_dir = $ac_dir\n";
print "ac_file = $ac_file\n";
print "ac_file_in = $ac_file_in\n";
print "srcdir = $srcdir\n";
print "top_srcdir = $top_srcdir\n";
print "cwd = " . `pwd` . "\n";
}
# Copy the file and make substitutions.
# @srcdir@ -> value of $srcdir
# @top_srcdir@ -> value of $top_srcdir
#
if (-e $ac_file) {
next if -M _ < -M $ac_file_in; # Next if Makefile is up-to-date.
warn "updating $ac_file\n";
} else {
warn "creating $ac_file\n";
}
open INFILE, "<$ac_file_in" or do {
warn "$0: Cannot read $ac_file_in: No such file or directory\n";
next;
};
open OUTFILE, ">$ac_file" or do {
warn "$0: Unable to create $ac_file\n";
next;
};
while (<INFILE>) {
#if (/\@[_a-zA-Z]*\@.*\@[_a-zA-Z]*\@/) {
# #warn "Two defines on a line:$ac_file:$.:$_";
# push @unhandled, $ac_file;
# last;
#}
s/\@srcdir\@/$srcdir/g;
s/\@top_srcdir\@/$top_srcdir/g;
if (/\@[_a-zA-Z]*\@/) {
#warn "Unknown variable:$ac_file:$.:$_";
push @unhandled, $ac_file;
last;
}
print OUTFILE;
}
close INFILE;
close OUTFILE;
}
return @unhandled;
}
sub run_config_status {
my @unhandled = @_;
# Run config.status with any unhandled files.
#
if (@unhandled) {
$ENV{CONFIG_FILES}= join ' ', @unhandled;
system "./config.status";
}
}

View File

@@ -0,0 +1,85 @@
#!/bin/sh
#
# 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):
#
#
# This script will match a dir with a set of dirs.
#
# Usage: match-dir.sh match [dir1 dir2 ... dirn]
#
# Send comments, improvements, bugs to ramiro@netscape.com
#
if [ -f Makefile ]; then
MAKEFILE="Makefile"
else
if [ -f Makefile.in ]; then
MAKEFILE="Makefile.in"
else
echo
echo "There ain't no 'Makefile' or 'Makefile.in' over here: $pwd, dude."
echo
exit 1
fi
fi
# Use DEPTH in the Makefile.in to determine the depth
depth=`grep -w DEPTH ${MAKEFILE} | grep "\.\." | awk -F"=" '{ print $2; }'`
cwd=`pwd`
# Determine the depth count
n=`echo $depth | tr '/' ' ' | wc -w`
cd $depth
objdir=`pwd`
path=`echo $cwd | sed "s|^${objdir}/||"`
match=$path
for i in $*
do
# echo "Looking for $match in $i"
echo $i | grep -q -x $match
if [ $? -eq 0 ]
then
echo "1"
exit 0
fi
# echo "Looking for $i in $match"
echo $match | grep -q $i
if [ $? -eq 0 ]
then
echo "1"
exit 0
fi
done
echo "0"
exit 0

View File

@@ -0,0 +1,46 @@
#! /bin/sh
#
# 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) 1999 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Stephen Lamm <slamm@netscape.com>
#
# mozconfigfind - Loads options from .mozconfig onto configure's
# command-line. The .mozconfig file is searched for in the
# order:
# if $MOZCONFIG is set, use that.
# Otherwise, use $TOPSRCDIR/.mozconfig
# Otherwise, use $HOME/.mozconfig
#
topsrcdir=$1
for _config in $MOZCONFIG \
$MOZ_MYCONFIG \
$topsrcdir/.mozconfig \
$topsrcdir/mozconfig \
$topsrcdir/mozconfig.sh \
$topsrcdir/myconfig.sh \
$HOME/.mozconfig \
$HOME/.mozconfig.sh \
$HOME/.mozmyconfig.sh
do
if test -f $_config; then
echo $_config;
exit 0
fi
done

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