Compare commits

..

460 Commits

Author SHA1 Message Date
syd%netscape.com
0581a1f59d Checkin fix for 89436 on NETSCAPE_6_2_1_BRANCH for a respin. a=adt
git-svn-id: svn://10.0.0.236/branches/NETSCAPE_6_2_1_BRANCH@112425 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-18 09:11:46 +00:00
alecf%netscape.com
fefa0b8482 final part of fix for bug 102043 sr=blake
git-svn-id: svn://10.0.0.236/branches/NETSCAPE_6_2_1_BRANCH@108918 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-26 21:42:59 +00:00
alecf%netscape.com
d865783e96 other part of bug 102043 r=radha sr=rpotts
git-svn-id: svn://10.0.0.236/branches/NETSCAPE_6_2_1_BRANCH@108632 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-20 22:30:53 +00:00
alecf%netscape.com
5a8e870248 check in bug 102043 to the 6.2.1 branch
git-svn-id: svn://10.0.0.236/branches/NETSCAPE_6_2_1_BRANCH@108631 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-20 22:28:23 +00:00
naving%netscape.com
0dd07fcb44 110067 r=naving sr=mscott. patch by bienvenu to fix corruption of mail attachments when configured
for offline use.


git-svn-id: svn://10.0.0.236/branches/NETSCAPE_6_2_1_BRANCH@108623 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-20 20:57:31 +00:00
mstoltz%netscape.com
a5d0cd6701 Bug 109113 - remove __call__ property of function objects, and add
same-origin check on the caller property. r=jst, sr=brendan, a=jaime


git-svn-id: svn://10.0.0.236/branches/NETSCAPE_6_2_1_BRANCH@108614 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-20 20:01:12 +00:00
joki%netscape.com
16aed83af0 Fix for 108104, prevent key/mouse events from untrusted scripts to spoof UI into thinking it got real native events. r:saari,sr:jst
git-svn-id: svn://10.0.0.236/branches/NETSCAPE_6_2_1_BRANCH@108572 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-20 10:08:09 +00:00
jst%netscape.com
1299c286cc Fixing bug 110242. Fix crash in text.substringData() when a count large enough to make count+start not fit in 32 bits is passed in. r=rayw@netscape.com, sr=vidur@netscape.com, a=jaimejr@netscape.com
git-svn-id: svn://10.0.0.236/branches/NETSCAPE_6_2_1_BRANCH@108553 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-20 04:28:16 +00:00
darin%netscape.com
a7ffb58fe2 fixes bug 97958 "[CRASH] on :jar protocol - M094 [@ ntdll.dll - nsInputStreamTee::TeeSegment]"
r=dbaron, sr=dougt, a=PDT


git-svn-id: svn://10.0.0.236/branches/NETSCAPE_6_2_1_BRANCH@108540 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-20 02:44:47 +00:00
darin%netscape.com
d8f4c33192 fixes bug 110418; r=morse, sr=alecf, a=pdt
git-svn-id: svn://10.0.0.236/branches/NETSCAPE_6_2_1_BRANCH@108532 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-20 02:23:18 +00:00
dougt%netscape.com
7ead48dbe8 fixes 108573. AutoRegisterComponent crashes when registered component loaders are not already created. r=dp, sr=rpotts, a=pdt
git-svn-id: svn://10.0.0.236/branches/NETSCAPE_6_2_1_BRANCH@108501 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-19 22:24:13 +00:00
leaf%mozilla.org
f1860fbadc Bumped up vers 2 to 6.2.1
git-svn-id: svn://10.0.0.236/branches/NETSCAPE_6_2_1_BRANCH@108200 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 23:04:25 +00:00
cltbld%netscape.com
818270ff9e updating to use NETSCAPE_6_2_1_BRANCH
git-svn-id: svn://10.0.0.236/branches/NETSCAPE_6_2_1_BRANCH@108191 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-15 21:52:36 +00:00
(no author)
ee71b5ceac This commit was manufactured by cvs2svn to create branch
'NETSCAPE_6_2_1_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/NETSCAPE_6_2_1_BRANCH@106175 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-24 17:20:10 +00:00
jj%netscape.com
4ba6ac6172 bugscape 10608: added oji.shlb to MacOS 9 installer & MacOS X package. r=granrose, sr=leaf+sfraser
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105992 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-22 23:57:08 +00:00
jj%netscape.com
de8322aab8 bugscape 10609: updated 'vers' 2 for 6.2
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105990 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-22 23:53:39 +00:00
mstoltz%netscape.com
43b4280a30 Bug 105705, temporary fix - remove security check optimization
(needsSecurityCheck) on global property access, since it misses an
important case. r=harishd, jband, sr=jst, a=jaimejr


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105986 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-22 23:26:22 +00:00
mscott%netscape.com
785f70d84d Bug 97497 --> fix a crash when expuning messages from the imap server by backing out part of an earlier
change from bienvenu
r=naving
sr=sspitzer


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105786 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-19 19:59:02 +00:00
racham%netscape.com
220bdb30be 105162 r=racham sr=mscott. Fix pop3 message size download limit pref. remove unused code.
This is naving


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105646 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-17 22:59:49 +00:00
racham%netscape.com
4bf6af20b9 105162 r=racham sr=mscott Remove unused prefs. This is naving
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105645 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-17 22:59:43 +00:00
rpotts%netscape.com
632cfc715e bug #104769 (r=pavlov@netscape.com, sr=jst@netscape.com, a=pdt). Opening new windows sometimes stalls...
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105604 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-17 05:50:22 +00:00
sdagley%netscape.com
ddc6be30ee Fix Bugscape #7630 - checking in for bnesse, r/sr=darin
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105596 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-17 04:34:12 +00:00
ssu%netscape.com
d0b0caddc4 fixing bug 103232 - Simple MAPI: Uninstaller needs to restore previous mapi32.dll if replaced. r=srilatha, sr=dveditz, sr=mscott
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105563 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-16 23:52:34 +00:00
law%netscape.com
e6ca9fead3 Branch fix for bug 104910; changes default for Don't ask me again checkbox on Quick Launch dialog; r=pchen, sr=blake, a=pdt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105562 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-16 23:50:15 +00:00
srilatha%netscape.com
0760514fb0 Fix for bug 104943. Added SendMessage in Set and Unset default mailClient to
broadcast the message once the registry is updated.
r=ssu, sr=dveditz, a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105549 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-16 23:20:54 +00:00
srilatha%netscape.com
2b0f8da028 Fix for bug # 104938. Changed the return value for all the APIs that are not
implemented to MAPI_E_FAILURE.
Checking in for kkhandrika@netscape.com
r=rdayal, sr=mscott, a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105548 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-16 23:07:45 +00:00
sfraser%netscape.com
5d2c1e284e Landing the fix for bug 42817 (Page setup UI on Mac) on the 0.9.4 branch. a=pdt2
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105482 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-16 07:00:52 +00:00
sfraser%netscape.com
ef568e7a83 Landing changes for bug 36796 (implement Page Setup on Mac) on the 0.9.4 branch. a=pdt2
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105481 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-16 06:48:18 +00:00
ssu%netscape.com
ef74dae0e8 fixing bug 10471 - The Netscape 6 item under WinXPs Start menu needs to be Netscape 6.2. sr=mscott r=syd
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105466 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-16 05:10:48 +00:00
mscott%netscape.com
b81b213d04 Checking in 98797 for bill law. Don't disable the keep me open checkbox when the download is complete.
sr=blake/mscott


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105463 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-16 04:34:33 +00:00
srilatha%netscape.com
1ccf8da466 Fix for Front Page crash and WordPad message after MAPI send.
Bug # 102645, r=ducarroz, sr=mscott.
Checking in for rdayal@netscape.com


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105454 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-16 02:08:17 +00:00
jelwell%netscape.com
2bb5dd3a5d Fix for Bugzilla bug 104953, r=jj, sr=sfraser PDT+
This ensures that the skin select statement is always last, which is necessary when generating the user-chrome.rdf file.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105449 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-16 00:59:13 +00:00
darin%netscape.com
eef1953101 fixes bug 103979 "Crash if autoconfig proxies prefs enabled by the default"
r=gagan,dougt sr=rpotts a=PDT


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105439 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-15 23:01:37 +00:00
ben%netscape.com
ba2c55238e bug 87864 - bookmarks file grows huge (due to duplicate bookmarks?)
- patch prevents the creation of duplicate bookmarks during edit operations.
r=jag, sr=waterson, a=pdt.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105406 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-15 08:35:10 +00:00
blakeross%telocity.com
1d1da6ebd3 Err, fix merge conflicts from tree switch.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105401 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-15 05:26:36 +00:00
blakeross%telocity.com
994df90bb5 View source for pages with post data needs to be disable (91341). Same patch from 092 branch. r=hixie sr=ben PDT+
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105400 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-15 05:13:16 +00:00
ssu%netscape.com
f6942a3d2a fixing bug 104275 - Cannot send message from Excel/PPoint97 using SimpleMAPI. r=curt, sr=dveditz. not part of tinderbox builds. affects windows platforms only
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105347 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-13 01:45:08 +00:00
darin%netscape.com
5425558f28 fixes bug 104181 "SH should not store layout state if server sends Cache-control: no-cache"
r=radha, sr=rpotts, a=jaimejr


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105332 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-13 01:03:02 +00:00
(no author)
7002800e9b This commit was manufactured by cvs2svn to create branch
'MOZILLA_0_9_4_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105308 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-12 23:48:35 +00:00
beard%netscape.com
30e74cffda Fix for bug #103431, r=peterl, sr=sfraser, a=pdt.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105299 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-12 22:00:28 +00:00
curt%scruznet.com
6a51761487 Only set MAPI and MAPIX in win.ini.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105271 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-12 19:50:36 +00:00
mscott%netscape.com
1c761ae69d Bug #7630 --> Landing this patch for bnesse onto the branch. Prevent a crash on urls that end with a CR
r=peterl
sr=darin,dougt
a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105268 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-12 18:07:30 +00:00
eddyk%netscape.com
612ff0c74e bug 104253: fields are editable when they shouldn't be, in AccountManager
r=mscott, sr=sspitzer


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105219 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-11 23:05:55 +00:00
joe.chou%eng.sun.com
13cf71081e Replacing a C++ comment in a C file (../include/npapi.h) with a C comment, so that Unix (Solaris, OS2, HP, etc.) will compile.
r=peterl, sr=attinasi, blizzard.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105201 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-11 21:10:41 +00:00
srilatha%netscape.com
d12292d5ea Fix for bug# 103908. Checking the mapidll, changed to getSytemDirectory
and also fixed getShowDialog()
r=ssu, sr=dveditz, a=pdt.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105152 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-11 10:43:32 +00:00
srilatha%netscape.com
f01eff3605 Fix for bug # 103897. Fixed the js error in onOK and also added code to ensure the
pref holds value when switched between panes
r=bhuvan, sr=sspitzer, a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105149 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-11 06:40:25 +00:00
srilatha%netscape.com
2293f7a84d Fix for bug # 103313, r=ducarroz, nhotta and sr=mscott.
Fix of problem for sending files with nonAscii filename and nonAscii subject
checking in for rdayal@netscape.com


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105148 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-11 06:10:03 +00:00
jj%netscape.com
42bd8c4dd3 bug 101608: keeping traceback option on for Carbon build. r=sdagley, sr=sfraser
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105147 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-11 06:02:07 +00:00
mscott%netscape.com
c2a53f73fa Backing out Bug #96748 which ended up making things worse for new account set up.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105139 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-11 04:28:23 +00:00
srilatha%netscape.com
806a8b39c2 Fix for Bug #102392. Refined COM code to detect whether mozilla is running
or not.  This is required to support multiple sends from the Application.
r=dougt, sr=mscott a=PDT


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105102 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-10 21:49:43 +00:00
darin%netscape.com
f6fd3e8875 fixes bug 52510 "HTTP handler should register as a listener for user agent
prefs changes." r=bnesse, sr=rpotts, a=PDT+


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105063 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-10 20:21:20 +00:00
pinkerton%netscape.com
d875eec3a4 unregister event handler when menu goes away. that way, if the menu is still in a visible menubar, we don't crash trying to build content off a dead listener. r=sdagley/sr=sfraser/a=jaime. bug#103935
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105033 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-10 14:20:18 +00:00
loadrunner%betak.net
3e416c0513 bug 88155, Trunk & M094 crash [@ MSVCRT.DLL - ns4xPluginStreamListener::OnDataAvailable, nsPluginStreamListenerPeer::OnDataAvailable] - seg faults loading http://www.planetjulie.com/, r=av,peterl, sr=waterson, removing unused nsHTMLUtils.* files resulting from repository copy, pdt+
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105024 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-10 07:20:23 +00:00
srilatha%netscape.com
12e9b7a298 Fix for bug # 95724. Added the registry keys for defailtIcon and shell\open\command.
Also changed the display name in the xp start menu
r=ssu, sr=dveditz, a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105015 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-10 05:42:50 +00:00
srilatha%netscape.com
005aa45847 Fix for bug # 103232. Changed the name for getting the version info for the mapi dll.
Also deleting the Mapi_backup_dll registry key instead of setting it to ""
r=ssu, sr=dveditz, a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105014 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-10 05:29:58 +00:00
loadrunner%betak.net
4eb1dbd5a7 bug 88155, Trunk & M094 crash [@ MSVCRT.DLL - ns4xPluginStreamListener::OnDataAvailable, nsPluginStreamListenerPeer::OnDataAvailable] - seg faults loading http://www.planetjulie.com/, r=av,peterl, sr=waterson, a=brendan, pdt+
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@105001 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-10 04:01:09 +00:00
sdagley%netscape.com
3cf0e74740 Fix #103612 - work around bug in Mac OS X 10.1 Internet prefs panel when setting DL folder. Merging fix from trunk. r=pinkerton,sr-sfraser,a=PDT
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104998 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-10 03:18:20 +00:00
mscott%netscape.com
4c3f215e2b Bug #102821 --> back out part of my fix from yesterday which attempted to keep mozilla.exe running
until the last mapi session had logged off. We found some holes were the mozilla process wasn't getting
terminated. Now we'll start up and terminate mozilla for each mapi transaction (unless it's already running
of course).

no r or sr since this is just a back out of part of yesterday's checkin.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104980 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-10 00:51:19 +00:00
loadrunner%betak.net
e9ef0ffacc bug 88155, Trunk & M094 crash [@ MSVCRT.DLL - ns4xPluginStreamListener::OnDataAvailable, nsPluginStreamListenerPeer::OnDataAvailable] - seg faults loading http://www.planetjulie.com/, r=av, peterl, sr=waterson, a=brendan, pdt+
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104979 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-10 00:51:00 +00:00
ssu%netscape.com
beed77f1c0 fixing bug 103232 - Changes the function pointer reference name (that the installer looks for in Mapi32.dll) from MAPIGetVersion() to GetMapiDllVersion(); also fixes mail.xpi to update mapi32.dll when appropriate. r=curt, sr=dveditz. affects windows platforms only
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104977 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-10 00:47:40 +00:00
mscott%netscape.com
174c0b1558 Bug #96784 --> avoid infinite recursion in the bin hex decoder when the data fork gives us back
macbinhex content as the content type.
sr=darin/sspitzer


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104976 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-10 00:37:29 +00:00
jaggernaut%netscape.com
a071e8dc70 Bug 103853: back out bogus sizeToContent in commonDialog.js, r=alecf, sr=hyatt, a=PDT
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104974 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-10 00:25:37 +00:00
ssu%netscape.com
4882e081f0 fixing bug 103939 - add new key, [JRE LIB PATH], to native win32 installer. r=curt, sr=dveditz. affects windows platforms only.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104973 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-10 00:24:20 +00:00
loadrunner%betak.net
81e2538482 bug 88155, Trunk & M094 crash [@ MSVCRT.DLL - ns4xPluginStreamListener::OnDataAvailable, nsPluginStreamListenerPeer::OnDataAvailable] - seg faults loading http://www.planetjulie.com/, r=av, peterl, sr=waterson, a=brendan, pdt+
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104971 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-10 00:12:41 +00:00
nhotta%netscape.com
efe018a9e6 Remove nsHTMLUtils.cpp from the project, bug 88155. r=av, peterl, sr=waterson, a=brendan, pdt+.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104970 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-10 00:11:45 +00:00
nhotta%netscape.com
34083e6795 Add nsHTMLUtils.cpp to the project, bug 88155. r=av, peterl, sr=waterson, a=brendan, pdt+.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104969 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-10 00:11:25 +00:00
rods%netscape.com
a031df1fb7 Remove borders/padding when getting the size of the dropdown after it has already been reflowed
Bug 101936 r=kmcclusk sr=attinasi a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104959 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 23:25:28 +00:00
heikki%netscape.com
3b6c8aa9e5 Bug 103250, attempting to fix topcrasher with a null check. Crash happens when you select text while page loading. r=harishd, sr=vidur.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104941 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 21:04:16 +00:00
mscott%netscape.com
f1bf83ec8f Forget this as part of Bug #102215 --> message display messed up by xul syntax changes
r=sspitzer
sr=hewitt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104938 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 21:01:34 +00:00
sspitzer%netscape.com
57de60b35e fix for #102918. don't show the "make Mozilla / Netscape your default
mail application" dialog until after the mailnews window shows up,
or for new profiles, until after the account wizard dismisses.
also, make the dialog modal to the mailnews window.
r=srilatha, sr=bienvenu, a=PDT


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104931 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 20:10:57 +00:00
pinkerton%netscape.com
bc1f68f1e9 respect the look&feel pref about showing comboboxes outside the client area. r=rods/sr=sfraser/a=asa. bug# 102834.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104912 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 14:17:38 +00:00
pinkerton%netscape.com
99194edfe0 prevent windows from extending behind dock when maximizing. r=danm/sr=sfraser/a=jaime. bug# 79974.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104911 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 14:15:33 +00:00
pinkerton%netscape.com
efa8d7d7c8 make long menu items crop. r=sdagley/sr=sfraser/a=jaime. bug# 98455
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104910 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 14:13:04 +00:00
rods%netscape.com
2a4287eccf Don't do BeginDocument when printing to file for regression tests
BUg 99633 r=karnaze a=attinasi a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104908 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 12:30:07 +00:00
sfraser%netscape.com
467a13f630 Fix bug 103031 -- don't put the top-left of the structure region into event.where before passing it off to raptor, because this might actually be outside of that window (like on X when windows have rounded corners). Instead, offset event.where by the amount that the window was moved. r=sdagley, sr=hyatt.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104902 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 06:02:08 +00:00
mscott%netscape.com
2c2aa68e1d Bug #102821 --> MAPI HACK FOR THE BRANCH only. This change is not intended for the trunk.
when processing -MAPIStartup, turn the show ui flag off to put us in a semi server mode. then in the mapi
code we'll manually make sure the app doesn't exit after the last window goes away until
all the mapi sessions have logged off.

r=bienvenu
sr=sspitzer


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104896 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 03:30:29 +00:00
mscott%netscape.com
f43cb3161d Landing Bug #103172 onto the branch for Rajiv. This patch removes the simple mapi auth dialog so we no longer
bring it up. You can choose your user identity from the subsequent compose window that comes up.
r=sspitzer
sr=mscott


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104891 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 02:55:53 +00:00
peterlubczynski%netscape.com
d1c54329ca Fix for bug 86591
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104890 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 02:55:45 +00:00
sfraser%netscape.com
9693956170 Fix for 100353 -- handle polling for read and write on different threads, and properly deal with sending to a socket that has flow control restrictions. Fixes a problem saving to IMAP server sent messages with attachments. r=gordon, wtc.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104889 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 02:16:47 +00:00
loadrunner%betak.net
2bc62b1415 bug 88155 - backing out premature checkin
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104888 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 01:59:55 +00:00
curt%scruznet.com
317249c56a Simple MAPI settings in win.ini.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104886 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 01:14:06 +00:00
pchen%netscape.com
4326de52b8 bugscape 9942, r=jag, sr=sfraser, include navExtraOverlay.xul in
hiddenWindow.xul to turn off qa and debug menus


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104879 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 00:33:01 +00:00
eddyk%netscape.com
4910524cab bug 103181: Disable code in AccountManager regression
r=bhuvan, sr=sspitzer, PDT+


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104877 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 00:24:02 +00:00
attinasi%netscape.com
f5420bca31 Support for invert color for outlines: improved handling of solid outlines, and made dotted and dashed outlines work. b=73884 r=kmcclusk sr=kin a=pdt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104876 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 00:18:01 +00:00
attinasi%netscape.com
b69cd49c6b active links are not given outline color 'invert' b=73884 r=kmcclusk sr=kin a=pdt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104874 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 00:16:43 +00:00
loadrunner%betak.net
40ae15b240 bug 88155, Trunk & M094 crash [@ MSVCRT.DLL - ns4xPluginStreamListener::OnDataAvailable, nsPluginStreamListenerPeer::OnDataAvailable] - seg faults loading http://www.planetjulie.com/, r=av, peterl, sr=waterson
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104866 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-08 23:42:40 +00:00
srilatha%netscape.com
d1a33f3259 Fix for bug #103260. RegisteringOkCallbackFunc in Startup()
sr=sspitzer, a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104863 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-08 23:20:56 +00:00
leif%netscape.com
b8b04b2777 Bug 102227: LDAP Autocomplete crash, r=dmose,sr=bienvenu.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104861 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-08 23:08:00 +00:00
srilatha%netscape.com
ac03659bd8 Fix for bug # 102798. Displays security warning during blind send.
Checking in for dougt, r=sspitzer, sr=mscott, a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104817 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-08 20:13:23 +00:00
kin%netscape.com
a0cc6531cb Make original patch for bug 99920 (hitting enter in any text field submits form without submit button passed as param)
work in OPT builds, by moving QI() call out of NS_ASSERTION macro.

r=rods@netscape.com  sr=waterson@netscape.com  a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104794 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-08 14:07:07 +00:00
dmose%netscape.com
60e2321259 Fix LDAP autocomplete regression on CJK strings by adding separate cjkMinStringLength that is defaulted differently from minStringLength (bug 101086). r=shanjian@netscape.com, sr=blizzard@mozilla.org, a=pdt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104754 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-07 02:19:56 +00:00
(no author)
0b83c005e9 This commit was manufactured by cvs2svn to create branch
'MOZILLA_0_9_4_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104723 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-06 05:08:43 +00:00
ssu%netscape.com
34349da08b fixing bug 103232 - Simple MAPI: Uninstaller needs to restore previous mapi32.dll if replaced. r=curt, sr=dveditz. not part of tinderbox builds. affects only windows.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104698 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-06 00:11:45 +00:00
ssu%netscape.com
598eacc4f9 fixing bug 103242 - component-specific timing dependency sections don't get run. r=curt, sr=dveditz. affects windows platforms only
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104696 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-06 00:02:53 +00:00
karnaze%netscape.com
0128156574 new regression tests, not affecting the build.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104694 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-05 23:21:45 +00:00
(no author)
a713920b70 This commit was manufactured by cvs2svn to create branch
'MOZILLA_0_9_4_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104691 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-05 23:16:07 +00:00
kmcclusk%netscape.com
0cdc966245 Added passing of error when allocating offscreen fails on GTK. bug 70424 r=pavlov sr=attinasi a=jaimejr
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104671 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-05 19:20:47 +00:00
pinkerton%netscape.com
d326bffa32 r=sdagley, sr=sfraser, a=asa bug#102204
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104662 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-05 14:23:43 +00:00
jaggernaut%netscape.com
b6ed21bc4a Bug 92635: password dialog for mailnews doesn't always come up at the correct size and is then also missing the label on the checkbox. Checking in a work-around for 0.9.4. r=sspitzer, sr=mscott, a=PDT.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104655 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-05 12:05:52 +00:00
srilatha%netscape.com
19039d5a68 Fix for bugs 95117, 95113, 95116, 95122, 102308 and 102798, 102570.
r,sr = bienvenu, ducarroz, rdayal, sspitzer, mscott, dveditz, ssu, dougt.
This is the implemetatin of Simple MAPI


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104645 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-05 05:32:50 +00:00
rpotts%netscape.com
d0901fa2c8 bug #102450. (r=pavlov@netscape.com, sr=vidur@netscape.com, a=pdt). Some pages never stop loading because an OnStopRequest is being dropped by the imgRequest...
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104644 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-05 05:29:41 +00:00
attinasi%netscape.com
4e07680f92 Sanity checking params to avoid topcrash. b=100298 sr=kin r=kmcclusk a=PDT
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104643 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-05 05:28:29 +00:00
srilatha%netscape.com
bca8035316 Fix for bugs 95117, 95113, 95116, 95122, 102308 and 102798, 102570.
r,sr = bienvenu, ducarroz, rdayal, sspitzer, mscott, dveditz, ssu, dougt.
This is the implemetatin of Simple MAPI.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104642 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-05 05:27:04 +00:00
ssu%netscape.com
89847524eb part of a fix for bug 95122 - Preference for Simple MAPI. r=curt, sr=dveditz. not part of tinderbox builds. affects windows only
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104641 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-05 05:24:51 +00:00
rpotts%netscape.com
ff21072f1f bug #102774 (r=jst@netscape.com, sr=vidur@netscape.com, a=pdt). from js location.reload(aBypassCache) ignores the bypass cache argument...
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104640 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-05 05:09:33 +00:00
peterlubczynski%netscape.com
6057fc9598 Fix for topcrash on UNIX where the ProxyJNI is broken with the JRE after a plugins.refresh(). bug 86591 r=av sr=blizard
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104639 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-05 04:56:24 +00:00
sspitzer%netscape.com
0b0cebe215 fix for #96314. get save as template and save as file to work
for imap messages, a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104632 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-05 02:38:35 +00:00
shanjian%netscape.com
b6658b6338 #8864 Debug messages in terminal window on Linux Japanese build.
r=bstell sr=waterson a=Jaime


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104617 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-05 01:06:56 +00:00
waterson%netscape.com
2dbe8975f0 Bug 96748. Be sure to check for |open| on new rows. r=varga@utcru.sk, sr=hyatt, a=jaimejr
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104612 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-05 00:52:59 +00:00
ssu%netscape.com
293f9035f1 fixing bug 9943 - 2 icons showing up on desktop after installing 6.2 - r=dveditz, sr=syd
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104598 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-04 21:49:02 +00:00
syd%netscape.com
910ceb167b Checkin for 78442. Fix from jband, sr=dveditz, r=syd, a=PDT This is a
quick and dirty fix which has nsXPITriggerInfo holding a reference to
the object referenced by nsXPITriggerInfo::mGlobalWrapper and to also
hold a JS root on XPITriggerEvent::cbval. The "right" way to fix this
is outlined in the bug.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104583 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-04 12:00:49 +00:00
mstoltz%netscape.com
1df70339e2 Bug 18553 (regression) clear all event handlers before loading a document,
except when called from document.open. r=heikki, sr=jst, a=clayton, jaime


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104576 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-04 05:37:16 +00:00
racham%netscape.com
c625f052ea Fixing bug 97650 on branch. This Fix facilitates the display of unread mail count of default mail account(s) on Windows XP welcome screen. r=mscott, sr=sspitzer, a=pdt. All checkins related to fix for bug 97650 are approved by pdt. I forgot to mention a= part in the last check in update.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104575 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-04 04:58:35 +00:00
racham%netscape.com
eef63da323 Fixing bug 97650. Checking in the IDL mcp file to build OS integration idl file. r=mscott, sr=sspitzer, a=pdt.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104574 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-04 04:56:43 +00:00
racham%netscape.com
3dfa1a19b0 Fixing bug 97650 on branch. This Fix facilitates the display of unread mail count of default mail account(s) on Windows XP welcome screen. r=mscott, sr=sspitzer
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104573 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-04 04:55:23 +00:00
suresh%netscape.com
ff9b7031d6 102545 r/sr=sspitzer. Set enabled to true only for new filters.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104572 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-04 02:39:02 +00:00
mscott%netscape.com
1c612c7742 Landing Bug # 101828 on the branch. Sending more than one piece of unsent mail fails when posting to the sent folder.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104567 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-04 01:25:34 +00:00
mscott%netscape.com
2d7c433ea6 Landing 101128 onto the branch (ftp sending spurious on stop requests before on start
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104566 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-04 01:18:57 +00:00
bienvenu%netscape.com
48a0d56aa9 fix paint leak of 1 byte per mime2 string from trunk 102466
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104564 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-04 01:07:26 +00:00
rods%netscape.com
91f350925b Check for failure after printing the next page. If it fails then pass back PR_TRUE
to indicate we are done printing this document.
Bug 101597 r=kmcclusk sr=attinasi a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104560 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-03 23:53:52 +00:00
sgehani%netscape.com
ac703f65e5 Remove debug prefs panel (on mozilla0.9.4 netscape-owned branch only).
b = 9968
r = pchen
sr = dveditz


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104559 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-03 23:52:37 +00:00
sspitzer%netscape.com
eee6d39a84 hack fixes for #100952 and #98418. don't show multiple inboxes in the folder pane
after imap migration and don't show accounts multiple times under "Get Msg" button.

these hacks aren't going in on the trunk.

r/sr=mscott,waterson,a=PDT.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104556 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-03 22:56:24 +00:00
peterv%netscape.com
b4a101d672 Fix for bug 97687 ([serializer]cs/gecko: copying using keyboard shortcuts>paste>source pasted {Country=US}). r=heikki, sr=jst.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104534 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-03 13:38:17 +00:00
heikki%netscape.com
7e84c99e83 Bugscape bug 9924, fix perceived hang by improving comment parsing performance in strict mode. Patch from harishd, r=heikki, sr=vidur.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104531 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-03 07:13:14 +00:00
mscott%netscape.com
97be76f8b4 Landing 97497 on the branch (add bullet proofing)
r=naving
sr=bienvenu


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104497 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-03 00:52:14 +00:00
curt%scruznet.com
1776a171d4 Removing obsolete files. Fixes bug #94108
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104457 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-02 23:04:05 +00:00
yokoyama%netscape.com
81093cb228 Bug 88425:
Force end IME Composition upon receiving OnChar
/r=yokoyama;/sr=shaver,/pdt=jaime


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104450 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-02 22:23:35 +00:00
varada%netscape.com
6e19a74a09 fix for bug#9440;show smtp server for new isp accounts;r=racham;sr=mscott
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104435 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-02 21:52:48 +00:00
hewitt%netscape.com
a60d8b4824 98415 - color picker crashes on mac, r=hewitt, sr=mscott, patch by btiffany@usermail.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104395 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-02 03:17:55 +00:00
sdagley%netscape.com
4ed58c0051 Finish fix of bug 97676 - Also use LaunchServices APIs to map creator code to app under OS X. Fixes automatic launch of helper app and restores ability to override helper app from download dialog. sr=sfraser,a=PDT (inferred a= since the bug has PDT+ and the previous checkin wasn't a complete fix)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104386 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-02 01:49:46 +00:00
bryner%netscape.com
ab5c9047fc Bug 59211 (topembed) - mouse wheel does nothing when cursor over plugin. Patch from markh@activestate.com, r=bryner, sr=hyatt.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104343 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-01 20:43:38 +00:00
waterson%netscape.com
f52bdbc3be Bug 96228. Make nsContainerFrame::PositionFrameView position _only_ the frame's view (don't recur). Explicitly call nsContainerFrame::PositionChildViews as appropriate when moving a frame post-Reflow. Consolidate view positioning logic duplicated between PositionFrameView and SyncFrameViewAfterReflow, which now correctly computes offset for anonymous view in nsScrollFrame and accounts for scrolled views. r=kmcclusk,karnaze sr=attinasi a=jaimejr
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104340 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-01 20:27:06 +00:00
yokoyama%netscape.com
23d14cad16 Bug 97404
To prevent freezing from copying URL.  Temporary fix until
we find actual cause of invalid string offset
/r=ftang, /sr=mscott, /PDT=jpm


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104339 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-01 20:24:31 +00:00
yokoyama%netscape.com
37c190c22e Bug 102041
Don't use the return error code from mAlias->Equals()
/r=ftang/harishd; /sr=shaver; /ptd=jaime


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104338 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-01 20:19:13 +00:00
darin%netscape.com
55f314e175 fixes bug 87817 "violation of HTTP 1.* standard when sending POST requests"
r=bbaetz, sr=mscott, a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104331 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-01 19:12:28 +00:00
rods%netscape.com
77e79f5968 Backing out fix for Bugs 85286 & 72906
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104323 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-01 18:25:48 +00:00
rods%netscape.com
1b7215b193 additional fix for Bug 99920
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104321 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-01 18:11:24 +00:00
karnaze%netscape.com
6db623ad82 new regression tests not affecting the build.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104318 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-01 16:22:48 +00:00
sdagley%netscape.com
745e0f8a58 Bug 97676 - Use LaunchServices APIs under OS X for helper app launching and fix Reveal to work with OS X Finder. r=ccarlen,sr=sfraser,a=PDT
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104308 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-01 07:40:16 +00:00
sdagley%netscape.com
310f048191 New project for OS X specific interfaces. Part of fix for 97676. r=ccarlen,sr=sfraser,a=PDT
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104307 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-01 07:01:42 +00:00
(no author)
61fcda7fc3 This commit was manufactured by cvs2svn to create branch
'MOZILLA_0_9_4_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104305 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-01 06:31:38 +00:00
jaggernaut%netscape.com
7aa36a6aca Bug 96843: 'Find in this page' textfield doesn't get focus by default. Patch by James Kelley <oneiros@darkspire.net>, r=kin, sr=alecf, a=PDT.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104277 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-01 01:17:59 +00:00
mscott%netscape.com
712dd7ecfc Landing Bug #101498 on the branch.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104270 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-30 21:39:23 +00:00
bryner%netscape.com
aaedc05e69 bug 97970 - nsExternalHelperAppService::AddMimeInfoToCache passing null to nsCStringKey ctor. patch from bzbarsky@mit.edu, r=timeless, sr=mscott. (PDT+)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104235 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-29 23:39:43 +00:00
ccarlen%netscape.com
0cbafcd8b0 Bug 92750 - Quitting Fizzilla with Cmd-Q doesn't ask to save changes. r=pink,brade/sr=sfraser
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104194 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-29 04:20:04 +00:00
ccarlen%netscape.com
d221f9042c Adding new files for bug 92750 - Quitting Fizzilla with Cmd-Q doesn't ask to save changes. r=pink,brade/sr=sfraser
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104193 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-29 04:07:56 +00:00
mscott%netscape.com
d3f2cfed94 Landing 102215 on the branch.
r=sspitzer
sr=hewitt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104192 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-29 03:56:24 +00:00
vidur%netscape.com
a4edbcb828 Fixes for printing bugs 84017 and 89151. The fix for bug 84017 removes the need for a resize reflow to get form frame values to print. The restoration of these values into the new frame model is done as part of the initial reflow. The fix for bug 89151 gets rid of the extra frame model built and forces printed images to come out of the decoded image cache. r=darinf, heikki, sr=rpotts
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104189 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-29 03:07:45 +00:00
karnaze%netscape.com
faee19ca68 bug 94341 - keep a separate pseudo frame list for a new pseudo block or inline frame. sr=attinasi, r=alexsavulov
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104187 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-29 02:25:18 +00:00
ssu%netscape.com
2964c08516 fixing bug 97650 - these patches updates the uninstaller to deal with undoing whatever mail integration we do to a WinXP system. r=curt, sr=dveditz. affects only windows platforms.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104185 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-29 02:17:38 +00:00
mscott%netscape.com
0088fee340 Bug #100669 --> landing some compose changes required by simple mapi for the simple mapi team.Bettter errror handling when cleaning
up the temp file.
r=ducarroz
sr=mscott

a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104183 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-29 02:05:22 +00:00
ssu%netscape.com
b76d92a07f fixing bugscape 9841 - Back button broken in eclient tool setup program. r=curt, sr=dveditz. affects only windows platforms
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104178 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-29 00:33:07 +00:00
waterson%netscape.com
1e590dafd5 Bug 97859. Always synchronize parent row, regardless of whether folder is opened or closed. r=varga%utcru.sk, sr=hyatt, a=jaimejr
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104174 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-29 00:15:07 +00:00
yokoyama%netscape.com
73005c9879 bug 88425:
Force to end IMEComposition when user switches keyboard layout.
/r=ftang; /sr=shaver; PDT+


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104168 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-29 00:05:38 +00:00
sgehani%netscape.com
edcfb9968f Make opening search sidebar tab on by default again.
r = pchen
sr = dveditz
b = 9643 (bugscape)


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104164 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 23:56:24 +00:00
serge%netscape.com
348410001b fix for 97362; Plugins error "invalid ELF header"; r=av, sr=waterson
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104146 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 22:42:09 +00:00
alexsavulov%netscape.com
16245543f1 fix for bug 99948 - added rounding to pixel in CalculateSizeStandard
sr= attinasi r= kmcclusk, [PDT+] available


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104134 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 21:45:36 +00:00
attinasi%netscape.com
8fd5d9b8d9 Fix for image wrapping in table cell problems. b=101674 sr=hyatt r=waterson a=Jaime/pdt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104132 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 21:37:45 +00:00
mscott%netscape.com
d07cea90df Landing 99391 on the branch.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104130 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 21:36:26 +00:00
peterlubczynski%netscape.com
f2d19fd047 Ignore leading and trailing whitespace for src and data attributes bug 96362 r=av sr=attinasi
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104125 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 20:15:27 +00:00
law%netscape.com
05c0c931e3 Bug 57443; Use PL_strncpyz to avoid buffer overrun when default file name is really long; r=sgehani, sr=mscott, a=pdt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104116 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 18:54:06 +00:00
sicking%bigfoot.com
60177508d7 Fix crasher and leak in parameters code
b=101946 r=peterv sr=shaver


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104101 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 09:08:29 +00:00
curt%scruznet.com
8f05990056 Adding ren8dot3.exe back into the installation for the time being.
Fixes bug #48306


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104088 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 05:44:58 +00:00
rpotts%netscape.com
7106093ea1 bug #102070 (r=valeski@netscape.com, sr=vidur@netscape.com, a=pdt). The LOAD_FLAGS_BYPASS_CACHE | LOAD_FLAGS_BYPASS_HISTORY combination is not handled correctly by the docshell...
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104085 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 04:23:21 +00:00
peterlubczynski%netscape.com
673ac81689 Fix for crash when object frame goes away but stream is still going bug 99569 r=av sr=attinasi
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104082 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 04:13:09 +00:00
serge%netscape.com
fb04fb600a fix bug 85701; problems using plugins [@ gtk_xtbin_init] topcrash; r=pavlov;sr=blizzard
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104063 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 01:51:06 +00:00
syd%netscape.com
dddc8c8df5 Fix for 97249. Crash was being caused (regardless of what stack is
showing) by not carefully iterating the component list and
processing CRCs only on those XPI files that were downloaded.
r=jag, sr=dveditz.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104051 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 01:13:45 +00:00
rods%netscape.com
071dcfab31 Make so hitting return in text field submits form when there is a single text field and no submit
or there is a submit and the submit btn is to be included in the post data
Bug 99920 r=attinasi sr=kin a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104035 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 00:39:44 +00:00
rods%netscape.com
fd55366c47 Use the nsIWebProgressListener to make sure two submits do not happen
the listener is used to know when the submit got thru so it can unreg itself
Bug 85286 r=rpotts sr=kin a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104033 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 00:33:23 +00:00
mitesh%netscape.com
c23f0ea75f Fix for Bug 95524 - LDAP DLLs must be packaged with browser.xpi instead mail.xpi - as a result of the fix to bug 75955 r=smfr and sr=waterson
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104032 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 00:31:06 +00:00
kmcclusk%netscape.com
291eda8da0 Force the backbuffer to be reallocated when the display depth is changed. bug 6061 r=karnaze sr=attinasi a=jaimejr@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104030 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 00:23:03 +00:00
oeschger%netscape.com
f60a4a1891 updating some of the images in the help content per minor UI changes, author=jatin, r=oeschger, b=85925, content only
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104029 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 00:19:46 +00:00
pchen%netscape.com
222ef59af5 bugscape 8771, r=samir, sr=hyatt, use insertafter="editorTask" instead
of position for address book tasks menu item, also use insertafter instead
of position for address book icon in component bar


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104026 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 00:15:35 +00:00
pchen%netscape.com
3793dbba82 bugscape 8771, r=samir, sr=hyatt, set id for editor tasks menu item
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104025 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 00:13:48 +00:00
joki%netscape.com
8d3f011b8d Fix for 71705, disabling right and middle 'click' events to web content for better compatibility with old-style 'onclick' handlers. r:saari,sr:hyatt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104024 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-28 00:12:02 +00:00
kmcclusk%netscape.com
945d2797fa check null pointer scrolledView before accessing it. bug 98270 patch from duraid@fl.net.au. r=karnaze sr=attinasi
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104022 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 23:57:30 +00:00
robinf%netscape.com
4122965e21 updates to existing images per bug8771; r=oeschger, a=adot, PDT+
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104019 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 23:44:27 +00:00
kin%netscape.com
7ddce62bb2 Fix for bug 89236: printing is producing crash
Modified nsBlockFrame::DrainOverflowLines() so that it
reparents any floater out-of-flow frames and their
views.

r=dbaron@fas.harvard.edu  sr=waterson@netscape.com  a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104013 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 23:16:32 +00:00
sfraser%netscape.com
5b8e1decdd Fix for 89734 -- fix window drawing/update problems on Mac OS X. Convert the saved update region to local coords. r=pink, sr=scc, a=pdt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104012 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 23:16:24 +00:00
sfraser%netscape.com
398e15602b Fix for bug 86694 -- optimize image tiling on the Mac. r=pavlov, sr=scc, a=pdt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104011 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 23:12:03 +00:00
sfraser%netscape.com
5a7f9ef37a Fix for 100700 and 58104-- some windows come up blank on carbon, and ATM causes blank windows. Properly save and restore GDevices. r=pierre, sr=scc
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104010 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 23:08:06 +00:00
ccarlen%netscape.com
48c8e05cbb Bug 101364 - Disable profile switching in turbo. r=dp/sr=alecf/PDT+
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104009 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 22:57:40 +00:00
beard%netscape.com
83bb6eb88a Fix for bug #92322, changes for Carbon/Mac OS X, r=peterl, sr=sfraser, a=jaimejr.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104008 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 22:56:00 +00:00
sfraser%netscape.com
84017680e7 Fixes for 71718 and 97866. Make Mac NSPR work on dual CPU Mac OS X machines, and fix the async IO code for Mac OS X. See bugs for reviewers. a=pdt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104007 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 22:50:40 +00:00
saari%netscape.com
307d8d5398 fix for bug 78857, an assertion that was caused by the event pool code. r=heikki, sr=jst
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@104005 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 22:43:53 +00:00
pinkerton%netscape.com
f654b64e8f correctly remove toplevel menus when hidden/collapsed attribute set. also fix assertions so they don't always show and add assertion when trying to show/hide a menu that is already in that state. r=sdagley/sr=sfraser. bug# 101795
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103994 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 21:49:14 +00:00
hyatt%netscape.com
1db35f9de8 Fix for 101510. r/sr=dbaron,waterson
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103985 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 21:37:44 +00:00
ssu%netscape.com
a2e139c514 fixing bug 97813 - Need to Properly integrate Navigator in the Windows XP Start Menu. These patches affect the installation part of the bug. r=law sr=dveditz. not part of tinderbox builds. affects only windows platforms
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103984 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 21:36:27 +00:00
darin%netscape.com
02b9280cdc fixes bug 101832 "back/forward buttons should use LOAD_NORMAL + VALIDATE_NEVER"
r=gagan, sr=rpotts, a=PDT


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103977 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 21:28:34 +00:00
waterson%netscape.com
66a8942ed5 Bug 73235. Don't add scrollbar's width to MES. r=attinasi, sr=hyatt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103973 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 20:53:21 +00:00
law%netscape.com
785351ad99 Fix for bug 97813; adds support for hooking into WindowsXP Start Menu as
the default internet application; includes a couple of minor tweaks to existing
code to support special handling of those registry keys; the change to
nsWindowsHooks.cpp is to suppress the "default browser" dialog when the user
doesn't have sufficient registry access to change the default browser.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103972 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 20:38:11 +00:00
rods%netscape.com
ada1e758a7 Part of previous checkin for Bug 99415, forgot to set this back to &PT
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103971 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 20:36:44 +00:00
karnaze%netscape.com
0bb1da4514 new regression tests, not affecting the build.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103952 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 16:30:53 +00:00
(no author)
746c14890a This commit was manufactured by cvs2svn to create branch
'MOZILLA_0_9_4_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103951 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 16:22:07 +00:00
jfrancis%netscape.com
5f0044d4b4 Fix for 100753: can't outdent empty list item. r=rade; sr=kin; pdt+
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103937 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 12:10:24 +00:00
syd%netscape.com
87d1ee2413 Checking in fix for 84896. PDT+, has reviews.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103931 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 08:11:11 +00:00
hewitt%netscape.com
eff3b014c2 91173 - page info window does not wrap, r=blake, sr=hewitt, patch by jrgm
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103914 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 02:20:20 +00:00
darin%netscape.com
0ea88c1ad9 fixes bug 99233 "FTP site doesn't load: ftp.asus.com" patch=bbaetz, r=dougt,
sr=darin, a=PDT


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103912 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 01:48:06 +00:00
serge%netscape.com
e2f208e326 fix bug 74938; acrobat fails on plugin registration on Linux; r=av; sr=waterson;a=pdt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103910 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-27 01:34:04 +00:00
ftang%netscape.com
dd1aa5f0ea fix bug 101434. ignore "UTF-16"xx and "UTF-32"xx in mime while it is impossible to get that value
while it is really UTF-16 and UTF-32.
r=bienvenu@netscape.com
sr=mscott


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103881 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 23:31:11 +00:00
pchen%netscape.com
13636923cd bugscape 9783 (again), r=ssu, sr=hyatt, need to increase height of top text pane in quick launch installer panel to accomodate longer text string
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103879 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 23:27:18 +00:00
darin%netscape.com
b92cb4590b fixes bug 98262 "avoid sending blank Accept-Charset header" a=PDT
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103878 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 23:26:47 +00:00
eddyk%netscape.com
2695b5b3be bug 96153: disable locked prefs for addressing panel in AccountManager
r=srilatha, sr=alecf,blake


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103875 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 23:03:10 +00:00
eddyk%netscape.com
ef87a82842 bug 96152: disable locked prefs for drafts and templates in AccountManager
r=bhuvan, sr=alecf


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103874 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 23:01:45 +00:00
pinkerton%netscape.com
821cd9a7fc don't associate .jar and .dat files with mozilla. r=sdagley/sr=sfraser. bug# 100065
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103870 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 21:54:50 +00:00
sspitzer%netscape.com
53b8205819 fix for bugscape bug #9178, a=PDT
Migration+Activation causes bad SMTP setup and failure to Send and a crash editing SMTP servers


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103869 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 21:48:54 +00:00
sspitzer%netscape.com
04445057b5 fix for #94180, a=PDT
Grippy appears to the left instead of center in addressbook and vertical 3 pane.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103868 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 21:37:14 +00:00
mitesh%netscape.com
debd6bd65f Additional check is as part of fix to bug 82412. OnLDAPInit should return a default value. Windows compiler complains about it.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103850 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 19:40:51 +00:00
sfraser%netscape.com
eb1bfcfde3 Fix for bug 67409 -- don't try counting connections to try to figure out if the browser is busy or not. Just look for pending PLEvents, which seems to give a good enough answer. r=saari, sr=kin, approved.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103849 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 19:37:29 +00:00
sfraser%netscape.com
ff11e9c7ae Fix for bug 99497. Re-order processing of jar.mn files so that we register en-mac locales after those for other platforms, so that non-installed builds (like the Mac OS X build) get Mac overlays. r=tao, sr=alecf.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103843 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 19:24:52 +00:00
mitesh%netscape.com
452517be8d Fix for bug 99515 - AutoConfig event loop was hanging on Linux. r=danm, sr=alecf and a=PDT
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103842 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 17:19:53 +00:00
karnaze%netscape.com
3a37dfe39b Fix bug "IFrames repositioned by whitespace in HTML" (no number yet) - give cols with no conent 0 width unless they have style width, sr=kin, r=alexsavulov
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103836 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 13:47:03 +00:00
rods%netscape.com
ce68108260 Enables the configuration of headers and footers, via 6 string in the nsIPrintOptions
3 for the header and 3 for the footer.
The new codes are &T,&U,&D,&P,&PT (see bug for explanation)
Bug 99415 r=kmcclusk, sr=attinasi a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103835 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 13:45:51 +00:00
peterv%netscape.com
403167314c Fix for bug 100732 (content_xsl.xpt missing in packaged bits). r=heikki, sr=jst.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103834 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 12:44:58 +00:00
dmose%netscape.com
e7269ea088 Packager changes to register LDAP XPCOM SDK chrome (bug 79935). r=ssu@netscape.com, sr=shaver@mozilla.org
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103828 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 07:20:19 +00:00
dmose%netscape.com
a7ca00446a Take advantage of ::failureItems functionality in teh autocomplete widget to pop up windows with an error message when LDAP autocomplete searches fail (bug 79935). r=ducarroz@netscape.com, sr=bienvenu@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103827 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 07:18:57 +00:00
dmose%netscape.com
31572ca31b Add ::failureItems result type to autocomplete interface and widget to allow for an error to return an item that can be displayed in the dropdown and fire an event if selected (eg pop up a dialog box); also changes LDAP autocomplete session interfaces and code to take advantage of this (bug 79935) r=hewitt@netscape.com, sr=bienvenu@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103826 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 07:18:27 +00:00
dmose%netscape.com
6984a86ab3 Update Mac buildsystem to include LDAP XPCOM SDK chrome when "ldap" option is used (bug 79935). r=pavlov@netscape.com, sr=bienvenu@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103825 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 07:08:52 +00:00
dmose%netscape.com
4b017c8f51 Addition of infrastructure to the LDAP XPCOM SDK to support better error reporting, error messages (bug 79935). r=jaggernaut@netscape.com,leif@netscape.com; sr=bienvenu@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103824 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 07:05:48 +00:00
dmose%netscape.com
10f2a7b17a Theme changes for LDAP autocomplete error messages in dropdowns (bug 79935). r=jaggernaut@netscape.com, sr=bienvenu@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103823 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 07:02:45 +00:00
leif%netscape.com
f1e8d63d77 Bug 91248: LDAP referrals hangs browswer. r=dmose, sr=bienvenu.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103822 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 06:20:53 +00:00
leif%netscape.com
c1de59c520 Bug 82412: Change LDAP XPCOM to use async DNS. r=dmose,mitesh sr=bienvenu,hewitt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103821 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 06:14:09 +00:00
pchen%netscape.com
e8915585fc bugscape 9783, r=ssu, sr=sfraser, add '(Designed for single-profile users)'
to quick launch checkbox text


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103812 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 05:11:06 +00:00
pchen%netscape.com
3cffe12af9 bugzilla 63870, r=danm, sr=ben, remove initialPromptText and simply
promptText


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103811 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 05:04:39 +00:00
pchen%netscape.com
d863f44f5c bugzilla 63870, r=danm, sr=ben, only check for http, https, and .html file
registry settings, load brandShortName and use it in new default browser
dialog string


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103810 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 05:03:17 +00:00
dbaron%fas.harvard.edu
086c238bc1 Allow declarations in style attribute to be surrounded by braces in quirks mode. Rename ParseDeclarations to ParseStyleAttribute since that's what it does. b=99554 r=hixie,glazman sr=attinasi
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103809 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 04:47:22 +00:00
peterlubczynski%netscape.com
d909c4e60d Bad signed conversion in plugin streaming code bug 100888 r=av sr=attinasi
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103805 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 04:02:48 +00:00
peterlubczynski%netscape.com
01e55af3d4 Incorrect GetAttributes/GetParameters for embed/object tag types patch by philanderton@yahoo.com bug 99063 r=peterl sr=attinasi
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103804 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 04:00:30 +00:00
peterlubczynski%netscape.com
cfd9316e7c Fix for doing GET rather than POST when NPN_PostURL is called bug 77603 r=av sr=attinasi
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103803 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 03:59:02 +00:00
peterlubczynski%netscape.com
f54c131e6d Clean up code in part for fix for doing GET rather than POST when NPN_PostURL is called bug 77603 r=av sr=attinasi
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103802 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 03:58:50 +00:00
attinasi%netscape.com
9d18923188 Fixed problem with images not wrapping in percentage width cells, in Quirks mode. sr=waterson r=kmcclusk a=chofmann b=100568
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103800 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 03:32:36 +00:00
hewitt%netscape.com
0b5a1e5389 90284 - Remove installer checkbox for 'Use this theme' to prevent dynamic skin switch, r=syd, sr=mscott
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103799 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 03:16:50 +00:00
naving%netscape.com
570251f1ed 52460 r=bienvenu sr=mscott. Allow subfolders creation for pop3 inbox folder.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103789 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 01:39:33 +00:00
naving%netscape.com
3caf2a49a4 97530 r=cavin sr=bienvenu.Save filter changes after renaming/deleting folder. Remove code
that save filter changes on shutdown.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103788 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 01:34:24 +00:00
ddrinan%netscape.com
d5a6b35429 Bug 95585 - Upated CA root certs
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103769 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 00:15:16 +00:00
heikki%netscape.com
ad97f177b4 Bug 95489, attempting to fix this topcrash with a null-check. r=harishd, sr=vidur.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103768 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-26 00:12:37 +00:00
andreww%netscape.com
e6cdf92b6d bugzilla 94794 sr=hewitt, r=hwaara - fixing sidebar grippy alignment in mac classic skin.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103724 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-25 20:44:08 +00:00
jband%netscape.com
5433034371 fix bug 100222. same fix as from the trunk. Avoid crash by only releasing from wrappedJS dtor if xpconnect has not shutdown. r=dbradley sr=jst a=chofmann.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103722 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-25 17:53:04 +00:00
rods%netscape.com
5aca2825f0 Removed setting page height to 5 pages when printing a document "AsIs"
Also, added special case code for sizing of "AsIs" documents when they
are positioned 0,0
Bug 100797 r=kmcclusk sr=attinasi


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103714 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-25 13:58:02 +00:00
srilatha%netscape.com
2ed16b645e Fix fro bug 98566. Adding support fro simple MAPI
r=law, sr=alecf, a=pdt. Checking in fro kkhandrika@netscape.com


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103691 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-25 03:28:07 +00:00
srilatha%netscape.com
08b216d231 Fix for bug# 97502. Setting gUpdate to false in onCancel()
r=mitesh, sr=spitzer a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103687 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-25 02:20:41 +00:00
cmanske%netscape.com
62d970524d Make URLs selected from Image, Link, and Page Colors and Properties dialogs relative to the source page, b=72583, r=brade, sr=kin
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103685 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-25 02:08:01 +00:00
bienvenu%netscape.com
586535752b fix 91936 from trunk
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103670 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-25 00:43:55 +00:00
cmanske%netscape.com
1d3f10ba78 Remove 'Debug' menu from Composer for final release, b=9442, r=brade, sr=kin
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103664 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-25 00:18:28 +00:00
naving%netscape.com
336d211083 100978 r=sspitzer sr=bienvenu. fix a filter editor bug that turns AND condition to OR.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103663 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-25 00:16:28 +00:00
pinkerton%netscape.com
6a8fcb18e0 fix apple menu from submenu fix. r=saari/sr=sfraser/a=chofmann.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103645 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-24 22:42:23 +00:00
pinkerton%netscape.com
e796f4ea2b use OS routine to sub out the menubar and dock on OSX/Carbon. r=sdagley/sr=sfraser/a=chofmann. bug# 83570.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103636 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-24 22:14:55 +00:00
bryner%netscape.com
9aaf9609bb Bug 42313 (PDT+) - unable to scroll with mousewheel over objects contained in IFRAMEs. r=saari, sr=hyatt.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103635 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-24 22:00:14 +00:00
blizzard%redhat.com
7d4e7bc7d8 Merge X remote fixes from the trunk back to the branch. Fixes lots of various bugs. a=chofmann
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103634 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-24 21:40:26 +00:00
mstoltz%netscape.com
11dda9e7e2 Bug 99020 - When changing the type of a text input element to "file,"
clear its value. sr=jst, r=heikki, a=PDT.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103633 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-24 20:56:38 +00:00
yokoyama%netscape.com
e4cc0bbde5 ftang using yokoyama's account
fix bug 94319 on m94 branch.
move the fix from m92 (3.111.10.2) branch to m94 branch
see the 3.111.10.2 check in log for r=/sr= and a= details.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103632 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-24 20:44:07 +00:00
shannond%netscape.com
f73176d18d Fixing HP-UX bustage by adding a newline.
Bug 101355, r=jdunn,bbaetz a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103631 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-24 20:06:53 +00:00
ddrinan%netscape.com
e9b07bdb22 Bug 100213 - Crash in GetOCSPResponders. r=rangansen,sr=kin
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103627 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-24 17:37:11 +00:00
gerv%gerv.net
4c4fc299f7 Backing out changes checked in for Mozilla's 0.9.4 release as part of bug 99441. This backout requested by syd and jband in that bug.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103625 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-24 17:09:16 +00:00
karnaze%netscape.com
2b8c082913 bug 82401 - remove cell from correct parent when cell spans into split row; work around bug 101264 by doing initial reflow with unconstrained height. sr=kin, r=attinasi.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103623 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-24 14:53:06 +00:00
jaggernaut%netscape.com
1018334fd6 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, a=PDT
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103617 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-24 12:38:07 +00:00
jaggernaut%netscape.com
2e6f663a94 Bug 79889: Download progress dialog not wide enough. r=hewitt, sr=hyatt, a=PDT
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103616 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-24 12:25:40 +00:00
peterlubczynski%netscape.com
9813c2d012 Fix for plugin printing bug 53349 and bug 27478 r=beard,av sr=attinasi
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103606 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-24 04:24:13 +00:00
sdagley%netscape.com
afbaedd313 For #97211 - Use OS mem allocators on Carbon builds. Only on branch for now. suggestedby=sfraser,sr=dbaron,a=PDT.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103603 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-24 03:22:38 +00:00
darin%netscape.com
852e7f39be fixes bug 92582 "Some MS ftp servers (ftp.microsoft.com) never display
lists - PASV invalid after error response" patch=dougt, r=gagan, sr=darin, a=PDT


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103546 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-22 08:27:23 +00:00
hyatt%netscape.com
8e503e987b Completely back out nsMenuPopupFrame changes.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103541 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-22 04:24:40 +00:00
hyatt%netscape.com
60055373bc Fix bustage.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103538 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-22 03:10:58 +00:00
hewitt%netscape.com
de2bdaeb68 93857 - Both 'To:' and 'Bcc:' options simultaneously checked in composition window, r=varada, sr=mscott
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103526 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-22 01:15:23 +00:00
hyatt%netscape.com
b4c3ba3158 Fix for 96291, leaky popups.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103522 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-22 00:41:37 +00:00
hyatt%netscape.com
afe70cb20e Fix for 94180.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103517 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-22 00:29:02 +00:00
darin%netscape.com
0130c09fdb fixes build bustage
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103515 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-22 00:27:57 +00:00
mstoltz%netscape.com
236c9c1438 Bug 101021, omitted assignment of return value from security check function
in nsWindowSH::GetProperty. r=harishd, sr=vidur, a(PDT)=nisheeth


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103513 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-22 00:26:42 +00:00
naving%netscape.com
5b724bb62c 98180 r/sr=sspitzer. Do not preflight the date picker w/ today's date if the argument has a date.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103512 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-22 00:25:31 +00:00
sspitzer%netscape.com
b963f74ca9 fix for #96979. hide folderpane columns for existing profiles. a=PDT
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103501 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-22 00:18:27 +00:00
sfraser%netscape.com
b2e55c3c08 Fix for bugscape bug 8740 -- fix notification sounds to work again by making sure we call EnterMovies() for Carbon. r=pink, beard. sr=jst, a=jaime
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103495 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 23:41:46 +00:00
darin%netscape.com
81e4a81df8 fixes bug 89500 for the mozilla 0.9.4 branch [a=PDT]
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103494 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 23:06:53 +00:00
gordon%netscape.com
7c3a29ea6a Fix bug 92348. Browser would fail to create windows if the capacity of the
disk or memory cache was set to 0. Fixed this by changing nsCacheService::
ActivateEntry() to fail if neither device is enabled or if the cache entry
is not stream-based and the memory cache is disabled.  No point handing out
a cache descriptor if we can't store any data. r=gagan, sr=dougt, darin.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103490 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 22:49:56 +00:00
naving%netscape.com
e2e79f0a98 70252 r=bienvenu sr=sspitzer Make filters having non-ascii name and conditions migrate from 4.xto 6.x
62437 r=bienvenu sr=sspitzer Make filter non-ascii folder names migrate from 4x. to 6.x


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103489 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 22:48:45 +00:00
darin%netscape.com
2447f93166 mac project changes for bug 89500 [a=PDT]
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103487 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 22:22:19 +00:00
bnesse%netscape.com
5e0bcc50ce Removed prefldap.h from manifest (file has been removed from cvs) to fix mac build.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103486 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 22:20:21 +00:00
darin%netscape.com
03517e0557 adding files for bug 89500 [a=PDT]
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103485 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 22:19:10 +00:00
darin%netscape.com
e016528374 fixes bug 97997 "easyweb.tdcanadatrust.com does not display" a=PDT
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103484 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 22:15:07 +00:00
tao%netscape.com
1ccc21361c 97606: Default character coding setting is blank in pref.
(r=dveditz,sr=alecf). add navigator.proeprties to en-{win,mac}.jar.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103483 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 22:13:52 +00:00
sdagley%netscape.com
60315dab09 Fix #99556 - landing trunk fix into 094 branch. Account for change in Mac epoch time as of MSL 6. r=wtc/sfraser
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103482 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 22:04:50 +00:00
sspitzer%netscape.com
d4ed5de1d5 fix for #98037. newsgroups requiring auth sometimes come up as all read. a=PDT
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103481 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 22:00:04 +00:00
heikki%netscape.com
d81ee0e696 Fixing build bustage, forgot to add a file.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103480 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 21:47:12 +00:00
naving%netscape.com
0d53807e8c 100326 r=bienvenu sr=sspitzer Abort compact if writing to folder fails.
90702 r=bienvenu sr=sspitzer Update the expunged bytes for offline stores after compacting.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103479 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 21:45:24 +00:00
bnesse%netscape.com
7efa0103e2 Fixing soon to be red mac tree by adding type cast for js call.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103478 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 21:06:34 +00:00
mitesh%netscape.com
7f7ef61de5 Removing prefldap.h - It's no longer needed as a part of bug 75955 fix
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103477 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 21:03:53 +00:00
mitesh%netscape.com
abeddd00b4 Checked in a wrong version of nsAutoConfig.cpp earlier with fixes for bug 75955. Updating it to a newer version
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103476 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 20:54:31 +00:00
beard%netscape.com
c8d8f9fc24 fix for bug #98290, keep stack aligned to 16 byte boundaries, r=beard, sr=sfraser, a=grega
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103475 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 20:50:57 +00:00
mscott%netscape.com
4fb3a770bf Landing Bug #100608 on the branch.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103474 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 20:48:49 +00:00
bnesse%netscape.com
fa4e9d0dd8 Fix for bug 75955 add getldapattributes. r=bnesse, dmose. sr=alecf,sfraser. Checking in mac files for mitesh.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103473 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 20:45:04 +00:00
ducarroz%netscape.com
343edffb97 Fix for bug 57902. As write to file is done using a buffer, we need to check the return code of the flush to be sure we phisically wrote the data to disk. Also check the file size when we are done writing to avoid sending empty mail (this include the fix for the regression introduced with the first fix). R=varada, SR=bienvenu
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103472 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 20:41:44 +00:00
mitesh%netscape.com
394693b9b6 Fix for bug 75955 - Adding getLDAPAttributes() functionality in AutoConfig
This a branch only check in - hasn't been checked into the trunk
r=bnesse,dmose, sr=shaver,alecf


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103471 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 20:40:08 +00:00
peterlubczynski%netscape.com
e0419770f6 Fix for OS X crash with bundle type plugins bug 98729 r=beard sr=attinasi
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103469 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 20:08:11 +00:00
shanjian%netscape.com
2e35258022 #99666 page is displayed as blank in certain situation
r=harishd, sr=rpotts, a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103466 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 19:43:43 +00:00
rogerl%netscape.com
9cde6c816e r=jst, sr=brendan, a=pdt. Fixes crash when parsing /[/.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103464 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 19:20:22 +00:00
loadrunner%betak.net
d647581a41 bug 99108, Bidi (Hebrew and Arabic) Encoding can not be set as the default encoding for composing mail, patch from simon@softel.co.il, r=jbetak, sr=kin, PDT+
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103461 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 18:39:10 +00:00
heikki%netscape.com
b2d293d7c0 Bug 78622, DOMParser and XMLHttpRequest failures with xml-stylesheet PIs etc. r=harishd, sr=vidur.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103460 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 18:30:09 +00:00
pinkerton%netscape.com
2c917ae462 make the system unit of mousewhell scrolling 3 lines on osx. r=sdagley/sr=sfraser/a=chofmann. bug# 100799
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103459 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 18:27:41 +00:00
pinkerton%netscape.com
5a9683a4ab implements code for responding to hidden/collapsed attributes on top-level menus. bug 100122. r=saari/sr=sfraser/a=chofmann.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103458 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 18:24:14 +00:00
rods%netscape.com
7b58da0cad Should set PrintObject to print "AsIs" if it doesn't have children
Bug 83683 r=kmcclusk r=attinasi


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103440 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 12:52:06 +00:00
ssu%netscape.com
ce6add0fed fixing bug 99526 - update uninstaller to be able to undo the new MAPI settings set by mail. r=dveditz, sr=mscott. affects windows platforms only.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103435 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 06:33:46 +00:00
ssu%netscape.com
b7a27c33db fixing bug 9614 - Default the Turbo checkbox to be unselected in installer. r=curt, sr=dveditz.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103433 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 06:22:28 +00:00
naving%netscape.com
078783926a 95584 r=bienvenu sr=mscott. Made it so that downloading messages and compacting folder do not
write each others data.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103432 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 05:50:17 +00:00
mscott%netscape.com
dcc28801e7 Landing 89950 on the branch for varada.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103431 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 05:32:24 +00:00
mscott%netscape.com
3f5a2e8a5c Landing 99234 on the branch.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103430 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 05:29:02 +00:00
rangansen%netscape.com
0c3eee476f r=rangansen sr=kin@netscape.com
PDT + = Jaime Rodriguez, Jr.
bug# 100193 - updating PSM version


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103424 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 04:35:55 +00:00
ducarroz%netscape.com
858763d06d Fix for bug 88079. In the case we fetch a local file, verify that the file path is a valid file and not a directory. R=varada, SR=bienvenu
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103417 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 03:53:53 +00:00
sspitzer%netscape.com
ede0c5ab73 fix for #59449 for branch. prevent case where we show the news message source (instead of the message)
because we're using a bad nsNNTPProtocol from the connection cache. a=PDT


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103416 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 03:44:13 +00:00
srilatha%netscape.com
9c28bc6229 Fix for bug # 100645. NextToken returns UTF8 instead UCS2
r=dmose, sr=alecf, a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103415 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 03:43:38 +00:00
dbaron%fas.harvard.edu
f6eb933aec Fix topcrash bug 99057 (crash @ GetExtensionsAndDescriptionFromMimetypesFile). Patch from bzbarsky@mit.edu. r=me sr=scc
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103411 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 03:17:12 +00:00
bnesse%netscape.com
0a6a9fd629 Fix for bug 80789. Change rot value from 7 to 13 for config file obfuscation. r=bnesse, sr=alefc. Checking in for chipc.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103409 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 03:08:50 +00:00
sfraser%netscape.com
627a2fa5d3 Fix for bug 96160, checking in for ftang. r=yokoyama, sr=sfraser, a=asa, sa=ptd2. Don't crash if we fail to get an i18n system resource.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103394 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 01:19:00 +00:00
(no author)
8bad31c580 This commit was manufactured by cvs2svn to create branch
'MOZILLA_0_9_4_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103393 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 01:17:00 +00:00
brendan%mozilla.org
973a138490 Join fixes for 81847 to the branch, with pdt approval.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103384 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-21 00:14:10 +00:00
srilatha%netscape.com
766d65fa78 Fix for smoketest blocker bugscape bug 9703.
r=dmose, sr=sspitzer a=granrose.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103379 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-20 23:34:31 +00:00
karnaze%netscape.com
2bed6f7a2b bug 68998 - added additional param to Paint, PaintChildren, PaintChild used by tables in standard mode. sr=waterson, r=alexsavulov.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103316 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-20 13:56:45 +00:00
rods%netscape.com
1db6f7b7c8 Make the default "submit"
Bug 59035 r=kmcclusk sr=attinasi


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103298 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-20 10:46:40 +00:00
srilatha%netscape.com
3ee4597b02 Fix for bug 95122 / 100668. part of the simple mapi UI checkin
sr=sspitzer. Fixing the js error and removing extra content from contents.rdf


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103278 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-20 05:15:19 +00:00
loadrunner%betak.net
a4a473d518 bug 97541, Enable multiple spellcheckers in mail/composer, r=cmanske, sr=kin, PDT+
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103274 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-20 04:40:24 +00:00
loadrunner%betak.net
6a6ab4e28f bug 97541, Enable multiple spellcheckers in mail/composer, r=cmanske, sr=kin, PDT+
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103272 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-20 04:31:53 +00:00
blakeross%telocity.com
a3e9b17f10 Turbo turns off if you go to the advanced panel and press ok without making any changes (99677). r=hewitt sr=ben everything+
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103269 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-20 04:01:01 +00:00
naving%netscape.com
253a49cd77 98391 r=bienvenu sr=sspitzer a=pdt. Made it so that the filtering still works to a local folder if
parent is renamed. The fix also includes the fix for 98470 because it is in the same code.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103267 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-20 03:53:07 +00:00
ccarlen%netscape.com
cd21c03664 Bug 99117 - account creation problems when using turbo mode. UnloadAccounts() resets some vars which needed to be reset and weren't. r=bhuvan,dp/sr=mscott/a=pdt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103260 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-20 02:20:08 +00:00
cltbld%netscape.com
cf126e08a2 #91990: changing default skin from 'classic/1.0' to 'modern/1.0' on MOZILLA_0_9_4_BRANCH (now owned by Netscape) r=jelwell, sr=sdagley.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103246 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-20 00:47:09 +00:00
ftang%netscape.com
d5205a0cbe move fix of 94319 from m92 branch to m94 branch per marek in pdt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103240 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-20 00:15:02 +00:00
kin%netscape.com
44f8952c2b Fix for bug #92215: [Table Printing] Mozilla crashes when printing the front page of slashdot
Modified nsBlockFrame::ReflowDirtyLines() so that it
removes any floaters on it's continuing frames list,
if they are on lines that are being pulled up.

r=dbaron@fas.harvard.edu  sr=waterson@netscape.com   a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103235 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 23:10:21 +00:00
ducarroz%netscape.com
b4356e037d Fix for bug 96386. When a generic or unknown error occures while posting a message, we should report a post error instead of a send error. Also, the send unsent message listener should not display errors. Finally, the Display Send Report function should avoid displaying twice the same string. R=varada, sr=mscott
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103234 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 23:06:59 +00:00
gordon%netscape.com
dc98e60ad1 FIX bug 100216, crash in nsCacheService on shutdown. Added null pointer
check in nsCacheEntryDescriptor::RequestDataSizeChange(). r=gagan, sr=darin.

Also renamed cache directory preference per discussion in bug 78480. r=gagan
sr=darin.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103224 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 21:25:47 +00:00
jfrancis%netscape.com
12b282edd2 fixes 97797: empty solo list item won't indent. Changes to nsHTMLEditRules::WillMakeList() to not outsmart itself so badly. r=fm;sr=kin
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103223 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 20:57:12 +00:00
bnesse%netscape.com
9dc2508915 Landing fix for bug 92447 on branch. Internalize .cfg reading into prefs library. This also re-enables reading of the .cfg file which was broken by a checkin for bug 88844. r=miteh, sr=sfraser, a=PDT.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103209 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 18:47:32 +00:00
rpotts%netscape.com
913974ff70 bug #88229. moving patch from the 0.9.2 branch onto 0.9.4.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103186 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 06:58:34 +00:00
jst%netscape.com
a611c3fa27 Fixing bug 95840. Speeding up global property access in JS. r=mstoltz@netscape.com, sr=vidur@netscape.com, a=PDT
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103185 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 06:53:42 +00:00
mitesh%netscape.com
e2f91e0eef Fix for bug 99515 - AutoConfig event loop hangs during pref migration
r=danm and sr=alecf


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103182 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 05:08:18 +00:00
mitesh%netscape.com
e9812af9dd Fix for bug 97228 - Multiple appends of email addresses to the autoconfig URL
r=bnesse and sr=shaver


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103181 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 04:55:13 +00:00
kmcclusk%netscape.com
9391a7135e Protect against null view in nsViewManager::ProcessPendingUpdates. sr=mscott@netscape.com r=peterl@netscape.com a=jaimejr@netsca
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103166 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 01:33:20 +00:00
rangansen%netscape.com
ed6ff1f297 r=ddrinan sr=sr=kin@netscape.com PDT+=Jaime Rodriguez, Jr.
bug# 97719 - fixing broken crl expired warning dialog


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103165 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 00:56:23 +00:00
pinkerton%netscape.com
c8b90827ed work around bugs in CarbonLib's ::MenuSelect() with submenus. r=saari/sr=sfraser. bug#83639
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103163 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 00:42:07 +00:00
mscott%netscape.com
32e5e46df0 Landing 99491 onto the branch
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103152 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 00:09:14 +00:00
harishd%netscape.com
8f3d1f533b 98187 - Make sure that the end tag, inline element, does not close tags in the root tag list. r=heikki,sr-vidur,a=PDT.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103148 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 00:03:11 +00:00
mscott%netscape.com
68683e8186 Landing 91751 on the branch.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103144 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 23:59:30 +00:00
bienvenu%netscape.com
5226e443c4 fix regression in downloading messages for offline use and disabling commands when local message is loaded while offline r=naving, sr=sspitzer 99696 100124
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103143 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 23:49:51 +00:00
dp%netscape.com
1ffe13a4bb removing ^M at the end of line
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103141 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 23:47:34 +00:00
pchen%netscape.com
3aa4e8ee82 bugscape 8850, r=jag, sr=alecf, new mainWindow.dtd file that holds mainWindow* entities
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103140 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 23:44:24 +00:00
pchen%netscape.com
95fdb80ac3 bugscape 8850, r=jag, sr=alecf, bump minimum macos version to 8.6
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103139 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 23:43:39 +00:00
pchen%netscape.com
592d631348 buscape 8850, r=jag, sr=alecf, include mainWindow.dtd to get mainWindow entities
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103138 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 23:43:36 +00:00
pchen%netscape.com
5ad63473b5 buscape 8850, r=jag, sr=alecf, remove mainwindow entities from navigator.dtd (they're going into mainWindow.dtd)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103137 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 23:43:33 +00:00
pchen%netscape.com
ca2930fef6 bugscape 8850, r=jag, sr=alecf, add mainWindow.dtd to jar file
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103136 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 23:43:29 +00:00
pchen%netscape.com
e042778097 bugscsape 8850, r=jag, sr=alecf, include mainwindow.dtd
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103135 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 23:43:26 +00:00
heikki%netscape.com
48e8dc3afe Bug 100106, XMLHttpRequest.responseText is empty if XML parser error. r=harishd, sr=vidur.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103134 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 23:43:08 +00:00
dp%netscape.com
ee5b88f504 bug 88844 preventing xpcom from double init on launch after turbo mode is enabled. Getting turbo mode initialized properly. r=law, sr=alec,seth
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103133 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 23:41:21 +00:00
heikki%netscape.com
da4c1220ad Bug 98597, second part, bogus events with XMLHttpRequest. Patch from vidur. r=heikki, sr=jst.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103132 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 23:37:22 +00:00
harishd%netscape.com
5d20e95a61 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,a=PDT
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103129 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 23:30:53 +00:00
harishd%netscape.com
1518265a7a 91744 - Avoid stack overflow by replacing recursion with a simple do-while. Removed unwanted assertions. r=heikki,sr=vidur,a=PDT
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103127 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 23:25:32 +00:00
yokoyama%netscape.com
8c85e4fcf1 bug 97224:Update UTF-8 for Unicode 3.01 conformance
maintaining a byte count.
/r=yokoyama, /sr=waterson


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103097 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 17:35:58 +00:00
bienvenu%netscape.com
e53aec46d1 checking in fix for 99510 from trunk
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103095 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 13:59:07 +00:00
(no author)
6887bc1966 This commit was manufactured by cvs2svn to create branch
'MOZILLA_0_9_4_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103094 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 13:41:48 +00:00
peterv%netscape.com
9b5877a83a Fix for bug 99044 (Big memory leak in DOMHelper.cpp). r=Pike, sr=jst.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103085 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 10:12:28 +00:00
peterv%netscape.com
ba09c542b2 Fix for bug 85708 (Should support "text/xml" MIME media type). r=Pike, sr=jst.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103084 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 10:10:41 +00:00
srilatha%netscape.com
a66b153c53 Fix for bug # 95122. UI implementation for Simple MAPI.
r=rdayal, sr=sspitzer


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103081 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 05:48:42 +00:00
bienvenu%netscape.com
e65919336e checking in fix for 79245 from the trunk
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103077 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 04:52:24 +00:00
rpotts%netscape.com
e2f1a9bc9b bug #98844. Moving this patch over to 0.9.4 from 0.9.2...
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103076 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 04:33:15 +00:00
rpotts%netscape.com
c9465eb348 bug #98469 (r=pavlov@netscape.com, sr=jst@netscape.com, a=pdt). The _content window target does not always exist...
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103075 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 04:29:40 +00:00
jst%netscape.com
e45ffff2a7 Landing the fix for bug 98292 on the branch, implement image.x and .y. r=jrgm@netscape.com, sr=blizzard@mozilla.org
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103073 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 03:51:47 +00:00
bienvenu%netscape.com
c9bf14bd6f more landing of 81690 onto the branch
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103071 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 03:27:53 +00:00
waterson%netscape.com
2c7c8fa4ac Bug 97383. Include the float's max-element-width in computation of the line's max-element-width so that we're guaranteed to place content next to a left floater. Revert some of the NOWRAP changes that should no longer be necessary. r=dbaron, sr=attinasi, a=jaimejr
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103070 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 03:26:26 +00:00
mscott%netscape.com
7910b2e903 Landing XBL brutal sharing on the branch
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103066 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 02:30:04 +00:00
mscott%netscape.com
bda5786937 Landing XBL brutal sharing on the branch.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103065 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 02:29:29 +00:00
srilatha%netscape.com
bd8d4b80bc removing these old unused files
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103063 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 02:21:17 +00:00
oeschger%netscape.com
a9f8eb5255 updating some screenshots in the help content, bug=85925, pdt-stamped, author=jatin, r=oeschger
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103061 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 02:14:53 +00:00
heikki%netscape.com
a19dc671ba Bug 98597, bogus event with XMLHttpRequest, including crasher fix. Patch from vidur. r=heikki, sr=jst.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103053 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 01:00:22 +00:00
heikki%netscape.com
214d0bb707 Bug 78021, Copy Link Address broken for image maps (<area> elements), <link> elements and simple XLinks. r=harishd, sr=vidur.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103051 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 00:48:06 +00:00
attinasi%netscape.com
da71dddcd1 Fix for percentage-height images in shrink-wrapping containers. b=85016 r=karnaze sr=waterson a=pdt
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103050 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 00:38:15 +00:00
ducarroz%netscape.com
c01dd3e2f6 Fix for bug 97256. Don't be case sensitive when checking for a RFC822 header!
Patch provided by Denis Antrushin <adu@sparc.spb.su>. R=ducarroz, SR=sspitzer


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103049 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 00:29:46 +00:00
kin%netscape.com
a1945a4b37 Fix for bug 98018: Impossible to delete text in textbox
nsEditor::CreateTxnForDeleteInsertionPoint() shouldn't
use count-1 when calculating isLast, in the non-text case.

r=jfrancis@netscape.com  sr=sfraser@netscape.com  a=pdt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103047 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 00:18:34 +00:00
harishd%netscape.com
d6c7837d7e 98261 - Instead of throwing away the current tag close it's parent such that the stack level does not go beyond the reflow depth limit. This would allow leaf tags, that follow the current tag, to find the correct node. r=heikki, sr=attinasi.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103046 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 00:11:27 +00:00
harishd%netscape.com
7ab11a2910 98261 - reconcile the difference between the ContentSink's notion of depth and Layout's notion of depth. r=heikki, sr=attinasi.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103045 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-18 00:11:16 +00:00
sspitzer%netscape.com
918aedd742 fix for #98793. hack to pre-cache the unread / read / flagged / unflagged icons to work around a problem
between outliner and imagelib.  a=PDT/


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103037 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-17 23:41:16 +00:00
hewitt%netscape.com
3a6dcacb77 99102 - update skin versions in all contents.rdf, r=hyatt, sr=blake
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103036 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-17 23:40:50 +00:00
mscott%netscape.com
5d4c9c03c9 Landing 81690 on the branch for bienvenu.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103033 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-17 23:23:07 +00:00
mscott%netscape.com
1665532f16 Landing 84260 and 91352 onto the branch for bienvenu.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103031 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-17 23:20:33 +00:00
mscott%netscape.com
11f1c99c39 Landing Bug #96335 on the branch for bienvenu.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103030 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-17 23:17:34 +00:00
mscott%netscape.com
afd88479d3 Landing Bug #96631 on the branch for bienvenu.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103029 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-17 23:15:46 +00:00
attinasi%netscape.com
7168d1a8c3 Fixing erroneous addition to previously reviewed and approved patch: b=97619 r=bernd sr=waterson
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103028 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-17 23:14:43 +00:00
mscott%netscape.com
964dde1cad Landing Bug #99228 on the branch for bienvenu.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103027 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-17 23:13:44 +00:00
av%netscape.com
90e92c729e Fixing bug 98285 -- adding access to the service manager from plugins, r=beard, sr=vidur
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103024 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-17 23:02:32 +00:00
sspitzer%netscape.com
9c8e527cba fix for #98381. "Server:" -> "Account:" in subscribe UI. a=PDT,mcarlson
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103022 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-17 22:41:16 +00:00
tao%netscape.com
ccb1e2fd37 71517: Dynamically select platform jar in langxxxx.xpi. (r=jbetak,sr=mscott)
package en-{unix,win}.jar on mac, too.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103021 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-17 22:40:46 +00:00
gordon%netscape.com
d326ebbdba Fix bug 88768, [a=nisheeth], fixing unary operator usage.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103016 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-17 20:49:42 +00:00
mscott%netscape.com
5662ee8b97 Bug #99222 --> for compose auto complete, don't show the popup if we have an exact
match.
r=ducarroz
sr=sspitzer


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103013 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-17 20:36:29 +00:00
mscott%netscape.com
34fd65e72e Bug #99222 --> make the widget flexible enough to only show the popup if
there are  a certain # of results present in the list.
r=sspitzer
sr=hewitt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103012 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-17 20:35:02 +00:00
mscott%netscape.com
1619de5a13 Bug #88315 --> select the first partial match when presented with multiple matches
r=ducarroz, sspitzer
sr=hewitt


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103009 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-17 20:32:31 +00:00
hyatt%netscape.com
cef8df4890 Fix for 96899, unable to see addresswes when scrolling up in mailcompose. r=mscott, sr=brendan
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103007 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-17 20:24:30 +00:00
sspitzer%netscape.com
c5d40fbb22 fix for #97585. if signature file pref points to a directory, don't hang
on msg compose. a=PDT


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103005 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-17 19:39:18 +00:00
sspitzer%netscape.com
c6e4cd4a0c fix for #98453. use "Mail & Newsgroups" consistently in the UI.
a=PDT,mcarlson


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@103002 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-17 19:25:33 +00:00
kaie%netscape.com
a0da673610 b=97614
Merging changes from NSS_CLIENT_TAG into MOZILLA_0_9_4_BRANCH for directory mozilla/security/nss.
a=pdt is covered by bug 96018


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102966 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-15 01:18:52 +00:00
cavin%netscape.com
6915c9b64f Bug #98294: In DiscoverChildren(), make sure we have a consistent server hierarchy delimiter. r=sspitzer, sr=mscott.
Bug #98433: In GetListOfFoldersWithPath(), if the folder path contains 'INBOX' of any forms, we need to convert it to uppercase before finding it under the root folder. r=naving, sr=mscott.
Bug #99101: In RenameLeaf(), unescape the folder name before searching for hierarchy delimiter (to figure out parent pathname). r=naving, sr=bienvenu.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102961 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-15 00:31:07 +00:00
pierre%netscape.com
d4ddf5b901 Bug 93371 "Treat classes case insensitively in quirks mode". Back out ianh's patch in nsCSSParser and nsHTMLAttributes. Implements case-insensitiveness in nsCSSStyleSheet as described in bug 35522. r=glazman (+dbaron/jst), sr=hyatt, a=grega for PDT/asa for drivers
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102959 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-14 23:52:15 +00:00
ssu%netscape.com
bec02d74b7 fixing bug 99340's part regarding turbo settings in installer not retained when running installer in silent/auto modes. r=dveditz,syd sr=mscott, a=pdt+ affects windows platforms only.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102938 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-14 20:54:54 +00:00
kaie%netscape.com
fbf8f97a35 b=96018 r=ddrinan sr=blake a=pdt
New "Reset Master Password" functionality, for users who have forgotten their password.

b=99525 r=ddrinan/morse/relyea sr=blizzard a=pdt
Completing feature added with bug 96018.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102931 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-14 20:36:20 +00:00
cotter%netscape.com
9f0ad3c850 privacy & security help updates per b=85925 (a=asa, r=oeschger) and b=96018 (PDT+)
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102930 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-14 20:34:02 +00:00
(no author)
7cb1660860 This commit was manufactured by cvs2svn to create branch
'MOZILLA_0_9_4_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102925 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-14 20:19:30 +00:00
gerv%gerv.net
cb6a00d0dd Prevent problems with NS initial start page appearing, by renaming pref. Bug 99441. r=syd, gerv, sr=jband, a=asa. This will be backed out immediately after 0.9.4 ships.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102880 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-13 17:53:45 +00:00
gerv%gerv.net
19a5fead7d Prevent problems with NS initial start page appearing, by renaming pref. Bug 99441. r=syd, gerv, sr=jband. This will be backed out immediately after 0.9.4 ships.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102878 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-13 16:57:41 +00:00
law%netscape.com
62f334a0a2 Applying fixes for bug 88844 and bug 89532 to the mozilla0.9.4 branch.
These changes also fix some other minor turbo-mode bugs.
These changes have all been reviewed and super-reviewed prior to being
checked in on the trunk; see the bugs for details.

a=asa for applying the fix to the branch.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102867 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-13 12:01:25 +00:00
ssu%netscape.com
102a2724fa fixing bug 99340 - Installer dies with error 2 under Win9x. r=syd,dveditz sr=mscott a=asa. not part of tinderbox builds. affects windows installers only.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102833 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-12 20:59:48 +00:00
brendan%mozilla.org
a5cae88f2e Checking in bstell@netscape.com's patch for bug 95906, r=jag, sr=me, a=asa.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102826 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-12 20:36:53 +00:00
cmanske%netscape.com
e327210730 Fixing dataloss bug 98768, r=syd, sr=kin, a=roc+moz
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102817 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-12 19:21:33 +00:00
blizzard%redhat.com
80626e227e Fix bug #97620. Crash unloading -turbo mozilla from tray icon. r/sr=ben,rpotts,brendan,me
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102816 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-12 19:11:20 +00:00
kaie%netscape.com
adf70abbbb b=99052 r=nelsonb a=asa on irc
Fix crash in NSS during SSL handshake


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102806 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-12 16:17:01 +00:00
blakeross%telocity.com
498ce0aaf9 Committing a file I forgot yesterday in an r/sr/a'd checkin (caused an xml error when opening the addressbook sidebar panel).
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102780 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-12 01:00:14 +00:00
shanjian%netscape.com
5e0af0ccdd #90581 universal charset detector does not work in mail/news
r=yokoyama, sr=waterson, a=roc+moz


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102779 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-12 00:37:53 +00:00
waterson%netscape.com
de0910f6ee Bug 72152. Be sure to update the pres context's visible area after doing a resize reflow. r=dbaron, sr=attinasi, a=blizzard
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102765 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-11 22:24:01 +00:00
timeless%mac.com
b61fa5b60e Bugzilla Bug 85543 Extra blank box to the left of 'Done.' on mac classic skin.
r=ksosez sr=blake a=asa


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102753 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-11 08:52:58 +00:00
jaggernaut%netscape.com
8efa6975cc Bug 91884, 91788 & 91571: reverting code from 91884 and checking in the fix we had in NS 6.1 / 0.9.2.1. r=reverting code, sr=hyatt, a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102750 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-11 07:29:39 +00:00
peterlubczynski%netscape.com
9695eac077 Use memmove instead of strncpy bug 98705 r=av sr=attinasi a=roc+moz
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102735 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-11 03:28:00 +00:00
cmanske%netscape.com
fbb7e7472a New strings needed in case full fix for bug 72583 is approved, r=brade, sr=kin, a=grega
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102717 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-11 00:59:05 +00:00
leaf%mozilla.org
32f3806bf0 mac version update and user agent string update, bug 93164, sr=mscott, a,r=dbaron
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102710 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-11 00:28:38 +00:00
syd%netscape.com
3fbb2b5028 Fix typo in last checkin, wanted "Quick Launch", not "QuickLaunch"
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102709 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-11 00:17:32 +00:00
syd%netscape.com
373281325e Commercial addition for bug 97380. Looking at the bug, appropriate reviews and
such have been given for the mozilla version. Also, bug number 98594.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102707 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-11 00:04:56 +00:00
attinasi%netscape.com
07d3891457 Fix for image wrapping problems in table cells. b=97619 r=bernd sr=waterson
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102689 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-10 22:57:07 +00:00
blakeross%telocity.com
ce34146fa4 App sometimes hangs when scrolling addressbook panel (99121). r=hwaara,varada sr=sspitzer a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102677 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-10 22:03:47 +00:00
dbaron%fas.harvard.edu
2e1a9bce6d Null checks for topcrash 99056. r=jag sr=waterson a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102673 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-10 21:45:40 +00:00
dbaron%fas.harvard.edu
e68b30e16e Null check to fix topcrash 97226. r=hixie sr=waterson a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102672 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-10 21:43:32 +00:00
robinf%netscape.com
f75f2c964a routine help updates per bug 85923; r=oeschger@netscape.com, a=adot@netscape.com
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102660 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-10 20:29:07 +00:00
oeschger%netscape.com
3cc3b02e9f adding help key for content updates, a=asa, bug=85925, r=cotter
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102625 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-10 00:55:46 +00:00
cls%seawood.org
43082cc7d3 Replace cat<<EOF with echos to avoid potential security risk with predictable /tmp files.
Thanks to Ashu Kulkarni <ashuk@eng.sun.com> for the patch.
Bug #98723 r=cls a=blizzard


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102593 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-08 19:16:27 +00:00
yokoyama%netscape.com
84ca3e46fc Bug 91193
makefile.win change
renaming from universalautochrdet.dll to universalautochardet.dll
/r=ftang;/sr=waterson;/a=asa


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102557 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-07 23:06:12 +00:00
waterson%netscape.com
b71a0d4153 Bug 55086. Change nsContainerFrame::PositionFrameView() to position child views. Eliminate the |aView| parameter from that method, because the view can be retrieved from the frame and need not be done by the caller. Eliminate the NS_FRAME_NO_MOVE_CHILD_VIEWS flag, which was read-only; i.e., never set by anyone. r=dbaron, sr=attinasi, a=asa.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102541 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-07 21:21:25 +00:00
sspitzer%netscape.com
88232d9b3d fix for #98660. don't call PR_GetEnv("PARSE_MODE") a bunch of times if we don't have to.
r=dbaron, sr=sfraser, a=blizzard


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102537 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-07 20:36:15 +00:00
axel%pike.org
8532c1fd58 bug 94834, --without-png and --without-mng leads to DIRS=' ', r=pavlov, sr=jst, a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102523 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-07 10:16:49 +00:00
attinasi%netscape.com
18603b97ef two approved bugs:
1) prevent list item bullets from resizing in Quirks mode (IE compat). b=97351 r=pierre sr=waterson a=drivers
2) fix collapsing margins of empty elements in BODY and TD in Quirks mode. b=97361 r=pierre sr=hyatt a=drivers


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102513 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-07 04:10:39 +00:00
bstell%netscape.com
137b5e30b9 bug 97533, patch by dbaron@fas.harvard.edu, r=bstell, sr=blizzard
check return status from getIntPref


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102512 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-07 04:06:54 +00:00
kaie%netscape.com
574b31e2c7 b=87578 r=ddrinan sr=blizzard a=asa
Enable a user to use (or switch to) an empty security password, i.e. no password at all.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102490 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-07 00:05:22 +00:00
kaie%netscape.com
e127df6817 b=93103 r=ddrinan/relyea sr=blizzard a=asa
Enable display of complete chains when viewing certificates.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102488 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 23:54:06 +00:00
shanjian%netscape.com
1b9e0a9dbb #97516 crash in nsRenderingContextWin::GetWidth() in certain situation
r=rbs, sr=waterson, a=asa


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102482 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 23:12:42 +00:00
pinkerton%netscape.com
4c002b41db allow changing of the label of a submenu. r=saari/sr=smfr/a=asa. bug# 97549.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102476 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 22:49:55 +00:00
waterson%netscape.com
1b7655115b Bug 98456. Fix makefile so that meta-modules build. r=dp, sr=cls, a=asa.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102466 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 21:54:43 +00:00
gerv%gerv.net
3b9e749579 Set start page override and home page to be http://www.mozilla.org/start , a page encouraging people to get involved with Mozilla. r,a=asa.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102463 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 21:44:35 +00:00
jj%netscape.com
9ede8deaa5 #4830: turning traceback off in optimized builds on MOZILLA_0_9_4_BRANCH
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102462 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 21:43:19 +00:00
kin%netscape.com
c926a9ad82 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=asa@mozilla.org


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102439 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 20:13:46 +00:00
varada%netscape.com
d63d20c4e9 fix for bug#82120;disable editable fields during sending of mail;r=cmanske;sr=sspitzer;a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102432 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 19:22:37 +00:00
cotter%netscape.com
87a35d18c4 privacy & security help content update per b=85925, a=asa, r=oeschger
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102427 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 19:08:50 +00:00
cotter%netscape.com
58bb911f81 privacy & security help content updates per b=85925, a=asa, r=oeschger
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102426 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 19:01:41 +00:00
dbaron%fas.harvard.edu
1fc4f6cf6d Fix topcrash bug 96563 by reading only the number of characters of string that we have, rather than double that number. r=pavlov sr=blizzard a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102411 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 16:16:13 +00:00
karnaze%netscape.com
1322ba0abd bug 95688 - check for null base url, possibly fixing talkback reported errors, sr=kin, r=alexsavulov
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102408 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 14:13:17 +00:00
blizzard%redhat.com
276b070725 Bug #97851. Fix security permissions on temporary file created when doing file uploads. r=pete, sr=waterson, a=dbaron
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102389 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 06:09:09 +00:00
jst%netscape.com
d1ebb0777f Fixing bug 62613. Making CSSStyleDeclaration objects appear as arrays in JS. patch by Fabian <hidday@geocities.com>, r=harishd@netscape.com, sr=jst@netscape.com, a=asa@mozilla.org
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102387 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 05:30:42 +00:00
mkaply%us.ibm.com
c5fed3e06b No bug
r=mkaply, sr=blizzard, a=asa for drivers
OS/2 only - code from javier - more font improvements - better scaling and text zoom for bitmap fonts


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102382 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 03:59:10 +00:00
mkaply%us.ibm.com
19d0f57a0f No bug
r=mkaply, sr=blizzard, a=asa for drivers
OS/2 only - Got these reversed - on OS/2, NEWFRAME is used at the end of a page, not the beginning


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102381 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 03:58:24 +00:00
jband%netscape.com
93c47a625f fix bug 97444. It is not good to patch a different fun into the frame. Let's safely shunt aside the callee frame instead. This is already on in the trunk. r=rogerl sr=brendan a=asa.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102370 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 02:18:43 +00:00
brendan%mozilla.org
4892be5264 Don't cache chrome scripts unless their master document URL is chrome too (we need the prototype cache to root the script objects; 98207, sr=jband&waterson, a=asa).
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102368 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 02:01:40 +00:00
av%netscape.com
703d584111 Fix for bug 86642 -- crash in DOMMimeTypeImpl::DOMMimeTypeImpl() when plugin doesn't set some fields in its version stamp, r=peterl, sr=attinasi, a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102346 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 00:04:31 +00:00
yokoyama%netscape.com
65b6908093 Bug 96318:
Fixing accident removal of nsIFontPackageService
/ftang;/sr=waterson;/a=asa


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102345 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-06 00:01:37 +00:00
peterlubczynski%netscape.com
9e99e7738f Fix for not setting reflow state on object frame in printing case bug 97563 r=av sr=attinasi a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102298 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-05 14:51:43 +00:00
cls%seawood.org
055359c675 Updating module dependencies caused by checkin for bug 97380
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102290 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-05 08:41:48 +00:00
cls%seawood.org
7301a8096a Deactivate sidebar panels when the panel is not selected.
Special thanks to matt@netscape.com for providing this patch.
Bug #53239 r=cls sr=ben a=asa


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102286 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-05 07:58:16 +00:00
sspitzer%netscape.com
4c2fcd5edd fix for #88970. new thread pane icons. r,sr=sspitzer,hewitt, a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102280 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-05 07:04:32 +00:00
sspitzer%netscape.com
16f4fe9967 fix for #92429. new alert icons. sr=hewitt, a=asa
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102279 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-05 07:03:45 +00:00
edburns%acm.org
fda7a2186a bug=97930
r=peterl
sr=waterson
a=asa


modules/plugin/base/src/nsIPluginInstanceOwner.h
modules/plugin/base/src/nsPluginHostImpl.cpp
modules/plugin/base/src/nsPluginHostImpl.h
modules/plugin/base/src/nsPluginViewer.cpp
modules/oji/src/nsJVMManager.cpp
modules/oji/src/nsJVMManager.h
layout/html/base/src/nsObjectFrame.cpp
xpfe/global/resources/locale/en-US/region.properties


Here's what I did to fix this bug.

I pestered Rick Potts about the problem of
nsIWebBrowserChrome->SetStatus() not being synchronous. He fixed that
under bug 97227.

Taking advantage of Rick's fix to 97227, I modified
nsIPluginInstanceOwner to have new method, ShowStatus(const PRUnichar
*aStatusMsg). This is necessary to allow for localized messages to be
posted from the plugin, such as "Starting plugin for type
application/x-java-vm" or "Beginnen steckbar für Art
application/x-java-vm".

I modified all the implementations of nsIPluginInstanceOwner:

layout/html/base/src/nsObjectFrame.cpp
modules/plugin/base/src/nsPluginViewer.cpp

I inserted a call to nsIPluginInstanceOwner->ShowStatus() at the part
just before the big "whole damn app freezes when starting java" thing
happens.

I also modifed nsJVMManager.cpp ShowJavaConsole() to do the same. These
are the two places I know of now that can start java.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102274 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-05 06:40:01 +00:00
ftang%netscape.com
90bc0fe117 fix bug 98233. back out change to 56863
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102245 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-05 01:23:06 +00:00
leaf%mozilla.org
3f49f9c396 pull from the branch
git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102215 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-04 22:58:51 +00:00
(no author)
ab3d5d6cb7 This commit was manufactured by cvs2svn to create branch
'MOZILLA_0_9_4_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/MOZILLA_0_9_4_BRANCH@102203 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-04 05:25:09 +00:00
23098 changed files with 4704495 additions and 498 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."

187
mozilla/Makefile.in Normal file
View File

@@ -0,0 +1,187 @@
#
# 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 \
gfx2 \
modules/libpr0n \
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
DIRS += xpfe
DIRS += xpinstall
ifdef MOZ_PSM
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,57 @@
#
# 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) \
-L$(DIST)/lib \
$(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 intl docshell webshell necko htmlparser xuldoc imglib2 gfx2
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,685 @@
/* -*- 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;
nsCOMPtr<nsIWeakReference> weakShell;
document->GetShellAt(0, getter_AddRefs(tempShell));
weakShell = do_GetWeakReference(tempShell);
NS_IF_ADDREF(*aShell = weakShell);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateAccessible(nsIDOMNode* aDOMNode, nsISupports* aDocument, nsIAccessible **_retval)
{
nsCOMPtr<nsIDocument> document (do_QueryInterface(aDocument));
if (!document)
return NS_ERROR_FAILURE;
#ifdef DEBUG
PRInt32 shells = document->GetNumberOfShells();
NS_ASSERTION(shells > 0,"Error no shells!");
#endif
nsCOMPtr<nsIPresShell> tempShell;
document->GetShellAt(0, getter_AddRefs(tempShell));
nsCOMPtr<nsIWeakReference> weakShell = do_GetWeakReference(tempShell);
*_retval = new nsAccessible(aDOMNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateHTMLBlockAccessible(nsIDOMNode* aDOMNode, nsISupports* aDocument, nsIAccessible **_retval)
{
nsCOMPtr<nsIDocument> document (do_QueryInterface(aDocument));
if (!document)
return NS_ERROR_FAILURE;
#ifdef DEBUG
PRInt32 shells = document->GetNumberOfShells();
NS_ASSERTION(shells > 0,"Error no shells!");
#endif
nsCOMPtr<nsIPresShell> tempShell;
document->GetShellAt(0, getter_AddRefs(tempShell));
nsCOMPtr<nsIWeakReference> weakShell = do_GetWeakReference(tempShell);
*_retval = new nsAccessible(aDOMNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateHTMLIFrameAccessible(nsIDOMNode* aDOMNode, nsISupports* aPresContext, nsIAccessible **_retval)
{
*_retval = nsnull;
nsCOMPtr<nsIContent> content(do_QueryInterface(aDOMNode));
NS_ASSERTION(content,"Error non nsIContent passed to accessible factory!!!");
nsCOMPtr<nsIPresContext> presContext(do_QueryInterface(aPresContext));
NS_ASSERTION(presContext,"Error non prescontext passed to accessible factory!!!");
nsCOMPtr<nsIPresShell> presShell;
presContext->GetShell(getter_AddRefs(presShell));
NS_ASSERTION(presShell,"Error non PresShell passed to accessible factory!!!");
nsCOMPtr<nsIWeakReference> weakRef = do_GetWeakReference(presShell);
nsCOMPtr<nsIDocument> doc;
if (NS_SUCCEEDED(content->GetDocument(*getter_AddRefs(doc))) && doc) {
nsCOMPtr<nsIPresShell> presShell;
doc->GetShellAt(0, getter_AddRefs(presShell));
if (presShell) {
nsCOMPtr<nsISupports> supps;
presShell->GetSubShellFor(content, getter_AddRefs(supps));
if (supps) {
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(supps));
if (docShell) {
nsCOMPtr<nsIPresShell> ps;
docShell->GetPresShell(getter_AddRefs(ps));
if (ps) {
nsCOMPtr<nsIWeakReference> wr = do_GetWeakReference(ps);
nsCOMPtr<nsIDocument> innerDoc;
ps->GetDocument(getter_AddRefs(innerDoc));
if (innerDoc) {
nsCOMPtr<nsIAccessible> root = new nsHTMLIFrameRootAccessible(aDOMNode, wr);
if ( root ) {
nsHTMLIFrameAccessible* frameAcc = new nsHTMLIFrameAccessible(aDOMNode, root, weakRef, innerDoc);
if ( frameAcc != nsnull ) {
*_retval = NS_STATIC_CAST(nsIAccessible*, frameAcc);
if ( *_retval ) {
NS_ADDREF(*_retval);
return NS_OK;
}
}
}
}
}
}
}
}
}
return NS_ERROR_FAILURE;
}
//-----------------------------------------------------------------------
// 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,225 @@
/* -*- 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 "nsISelectionController.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,154 @@
/* -*- 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 "nsString.h"
#include "nsAccessible.h"
#include "nsIAccessibilityService.h"
#include "nsIServiceManager.h"
#include "nsIDOMElement.h"
#include "nsIDOMHTMLAreaElement.h"
#include "nsGUIEvent.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,467 @@
/* -*- 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 "nsString.h"
#include "nsAccessible.h"
#include "nsIFrame.h"
#include "nsIDOMHTMLLabelElement.h"
#include "nsIDOMHTMLFormElement.h"
#include "nsISelectionController.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,794 @@
/* -*- 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 "nsIDOMXULListener.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 nsIDOMXULListener
{
public:
NS_DECL_ISUPPORTS_INHERITED
nsMenuListenerAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsMenuListenerAccessible();
// popup listener
NS_IMETHOD PopupShowing(nsIDOMEvent* aEvent);
NS_IMETHOD PopupShown(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD PopupHiding(nsIDOMEvent* aEvent);
NS_IMETHOD PopupHidden(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD Close(nsIDOMEvent* aEvent);
NS_IMETHOD Command(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD Broadcast(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD CommandUpdate(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent) { return NS_OK; }
virtual void SetupMenuListener();
PRBool mRegistered;
PRBool mOpen;
};
NS_IMPL_ISUPPORTS_INHERITED(nsMenuListenerAccessible, nsAccessible, nsIDOMXULListener)
/**
* 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("popupshowing"), this, PR_TRUE);
}
}
NS_IMETHODIMP nsMenuListenerAccessible::PopupShowing(nsIDOMEvent* aEvent)
{
mOpen = PR_TRUE;
/* TBD send state change event */
return NS_OK;
}
NS_IMETHODIMP nsMenuListenerAccessible::PopupHiding(nsIDOMEvent* aEvent)
{
mOpen = PR_FALSE;
/* TBD send state change event */
return NS_OK;
}
NS_IMETHODIMP nsMenuListenerAccessible::Close(nsIDOMEvent* aEvent)
{
mOpen = PR_FALSE;
/* TBD send state change event */
return NS_OK;
}
void
nsMenuListenerAccessible::SetupMenuListener()
{
// 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("popupshowing"), 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,74 @@
/* -*- 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 "nsString.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,685 @@
/* -*- 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;
nsCOMPtr<nsIWeakReference> weakShell;
document->GetShellAt(0, getter_AddRefs(tempShell));
weakShell = do_GetWeakReference(tempShell);
NS_IF_ADDREF(*aShell = weakShell);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateAccessible(nsIDOMNode* aDOMNode, nsISupports* aDocument, nsIAccessible **_retval)
{
nsCOMPtr<nsIDocument> document (do_QueryInterface(aDocument));
if (!document)
return NS_ERROR_FAILURE;
#ifdef DEBUG
PRInt32 shells = document->GetNumberOfShells();
NS_ASSERTION(shells > 0,"Error no shells!");
#endif
nsCOMPtr<nsIPresShell> tempShell;
document->GetShellAt(0, getter_AddRefs(tempShell));
nsCOMPtr<nsIWeakReference> weakShell = do_GetWeakReference(tempShell);
*_retval = new nsAccessible(aDOMNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateHTMLBlockAccessible(nsIDOMNode* aDOMNode, nsISupports* aDocument, nsIAccessible **_retval)
{
nsCOMPtr<nsIDocument> document (do_QueryInterface(aDocument));
if (!document)
return NS_ERROR_FAILURE;
#ifdef DEBUG
PRInt32 shells = document->GetNumberOfShells();
NS_ASSERTION(shells > 0,"Error no shells!");
#endif
nsCOMPtr<nsIPresShell> tempShell;
document->GetShellAt(0, getter_AddRefs(tempShell));
nsCOMPtr<nsIWeakReference> weakShell = do_GetWeakReference(tempShell);
*_retval = new nsAccessible(aDOMNode, weakShell);
if (! *_retval)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(*_retval);
return NS_OK;
}
NS_IMETHODIMP
nsAccessibilityService::CreateHTMLIFrameAccessible(nsIDOMNode* aDOMNode, nsISupports* aPresContext, nsIAccessible **_retval)
{
*_retval = nsnull;
nsCOMPtr<nsIContent> content(do_QueryInterface(aDOMNode));
NS_ASSERTION(content,"Error non nsIContent passed to accessible factory!!!");
nsCOMPtr<nsIPresContext> presContext(do_QueryInterface(aPresContext));
NS_ASSERTION(presContext,"Error non prescontext passed to accessible factory!!!");
nsCOMPtr<nsIPresShell> presShell;
presContext->GetShell(getter_AddRefs(presShell));
NS_ASSERTION(presShell,"Error non PresShell passed to accessible factory!!!");
nsCOMPtr<nsIWeakReference> weakRef = do_GetWeakReference(presShell);
nsCOMPtr<nsIDocument> doc;
if (NS_SUCCEEDED(content->GetDocument(*getter_AddRefs(doc))) && doc) {
nsCOMPtr<nsIPresShell> presShell;
doc->GetShellAt(0, getter_AddRefs(presShell));
if (presShell) {
nsCOMPtr<nsISupports> supps;
presShell->GetSubShellFor(content, getter_AddRefs(supps));
if (supps) {
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(supps));
if (docShell) {
nsCOMPtr<nsIPresShell> ps;
docShell->GetPresShell(getter_AddRefs(ps));
if (ps) {
nsCOMPtr<nsIWeakReference> wr = do_GetWeakReference(ps);
nsCOMPtr<nsIDocument> innerDoc;
ps->GetDocument(getter_AddRefs(innerDoc));
if (innerDoc) {
nsCOMPtr<nsIAccessible> root = new nsHTMLIFrameRootAccessible(aDOMNode, wr);
if ( root ) {
nsHTMLIFrameAccessible* frameAcc = new nsHTMLIFrameAccessible(aDOMNode, root, weakRef, innerDoc);
if ( frameAcc != nsnull ) {
*_retval = NS_STATIC_CAST(nsIAccessible*, frameAcc);
if ( *_retval ) {
NS_ADDREF(*_retval);
return NS_OK;
}
}
}
}
}
}
}
}
}
return NS_ERROR_FAILURE;
}
//-----------------------------------------------------------------------
// 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,225 @@
/* -*- 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 "nsISelectionController.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,154 @@
/* -*- 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 "nsString.h"
#include "nsAccessible.h"
#include "nsIAccessibilityService.h"
#include "nsIServiceManager.h"
#include "nsIDOMElement.h"
#include "nsIDOMHTMLAreaElement.h"
#include "nsGUIEvent.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("popupshowing"), this, PR_TRUE);
}
}
/** Inherit the ISupports impl from nsAccessible -- handle nsIDOMXULListener ourself */
NS_IMPL_ISUPPORTS_INHERITED(nsHTMLComboboxAccessible, nsAccessible, nsIDOMXULListener)
/**
* 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::PopupShowing(nsIDOMEvent* aEvent)
{
mOpen = PR_TRUE;
/* TBD send state change event */
return NS_OK;
}
/**
* Set our state to not open and (TDB) fire an event to MSAA saying
* our state has changed.
*/
NS_IMETHODIMP nsHTMLComboboxAccessible::PopupHiding(nsIDOMEvent* aEvent)
{
mOpen = PR_FALSE;
/* TBD send state change event */
return NS_OK;
}
/**
* Set our state to not open and (TDB) fire an event to MSAA saying
* our state has changed.
*/
NS_IMETHODIMP 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 "popupshowing" events on our DOM node. Set our
* state to registered, but don't notify MSAA as they
* don't need to know about this state.
*/
void
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("popupshowing"), 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,164 @@
/* -*- 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 "nsIDOMXULListener.h"
/*
* A class the represents the HTML Combobox widget.
*/
class nsHTMLComboboxAccessible : public nsAccessible,
public nsIAccessibleSelectable,
public nsIDOMXULListener
{
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 PopupShowing(nsIDOMEvent* aEvent);
NS_IMETHOD PopupShown(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD PopupHiding(nsIDOMEvent* aEvent);
NS_IMETHOD PopupHidden(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD Close(nsIDOMEvent* aEvent);
NS_IMETHOD Command(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD Broadcast(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD CommandUpdate(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent) { return NS_OK; }
virtual void SetupMenuListener();
protected:
PRBool mRegistered;
PRBool mOpen;
};
/*
* A class the represents the text field in the 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,467 @@
/* -*- 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 "nsString.h"
#include "nsAccessible.h"
#include "nsIFrame.h"
#include "nsIDOMHTMLLabelElement.h"
#include "nsIDOMHTMLFormElement.h"
#include "nsISelectionController.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,794 @@
/* -*- 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 "nsIDOMXULListener.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 nsIDOMXULListener
{
public:
NS_DECL_ISUPPORTS_INHERITED
nsMenuListenerAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsMenuListenerAccessible();
// popup listener
NS_IMETHOD PopupShowing(nsIDOMEvent* aEvent);
NS_IMETHOD PopupShown(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD PopupHiding(nsIDOMEvent* aEvent);
NS_IMETHOD PopupHidden(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD Close(nsIDOMEvent* aEvent);
NS_IMETHOD Command(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD Broadcast(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD CommandUpdate(nsIDOMEvent* aEvent) { return NS_OK; }
NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent) { return NS_OK; }
virtual void SetupMenuListener();
PRBool mRegistered;
PRBool mOpen;
};
NS_IMPL_ISUPPORTS_INHERITED(nsMenuListenerAccessible, nsAccessible, nsIDOMXULListener)
/**
* 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("popupshowing"), this, PR_TRUE);
}
}
NS_IMETHODIMP nsMenuListenerAccessible::PopupShowing(nsIDOMEvent* aEvent)
{
mOpen = PR_TRUE;
/* TBD send state change event */
return NS_OK;
}
NS_IMETHODIMP nsMenuListenerAccessible::PopupHiding(nsIDOMEvent* aEvent)
{
mOpen = PR_FALSE;
/* TBD send state change event */
return NS_OK;
}
NS_IMETHODIMP nsMenuListenerAccessible::Close(nsIDOMEvent* aEvent)
{
mOpen = PR_FALSE;
/* TBD send state change event */
return NS_OK;
}
void
nsMenuListenerAccessible::SetupMenuListener()
{
// 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("popupshowing"), 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,74 @@
/* -*- 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 "nsString.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/libIDL.m4)dnl
builtin(include, build/autoconf/nspr.m4)dnl
builtin(include, build/autoconf/pkg.m4)dnl
dnl
define(MOZ_TOPSRCDIR,.)dnl MOZ_TOPSRCDIR is used in altoptions.m4
builtin(include, build/autoconf/altoptions.m4)dnl

1170
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,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

View File

@@ -0,0 +1,94 @@
#! /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>
#
# mozconfig2client-mk - Translates .mozconfig into options for client.mk.
# Prints defines to stdout.
#
# See mozconfig2configure for more details
print_header() {
_mozconfig=${MOZCONFIG:-$HOME/.mozconfig}
cat >> $tmp_file <<EOF
# gmake
# This file is automatically generated for client.mk.
# Do not edit. Edit $_mozconfig instead.
# To create a new .mozconfig file, you can visit,
# http://webtools.mozilla.org/build/config.cgi
EOF
}
ac_add_options() {
echo "# $* is used by configure (not client.mk)" >> $tmp_file
}
mk_add_options() {
for _opt
do
# Escape shell characters, space, tab, dollar, quote, backslash,
# and substitute '@<word>@' with '$(<word>)'.
_opt=`echo "$_opt" | sed -e 's/\([\"\\]\)/\\\1/g; s/@\([^@]*\)@/\$(\1)/g;'`
echo $_opt;
opts="${opts:+$opts^}$_opt";
done >> $tmp_file
}
mk_echo_options() {
echo "Adding client.mk options from $MOZCONFIG:"
IFS=^
for _opt in $opts; do
echo " $_opt"
done
}
# Main
#--------------------------------------------------
scriptdir=`dirname $0`
topsrcdir=$1
out_file=$2
tmp_file="$out_file-tmp$$"
opts=""
trap "rm -f $tmp_file; exit 1" 1 2 15
MOZCONFIG=`$scriptdir/mozconfig-find $topsrcdir`
print_header > $tmp_file
# If the path changes, configure should be rerun
echo "# PATH=$PATH" >> $tmp_file
if [ "$MOZCONFIG" ]
then
. $MOZCONFIG
fi
if [ "$opts" ]; then
mk_echo_options
fi
if test -f $out_file && cmp -s $tmp_file $out_file; then
rm $tmp_file
else
mv -f $tmp_file $out_file
fi

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