I have had the same problem. what i did was copy a "web form password" entry that was created for google, and changed it for yahoo.
You have to have two keychains in order to do this. In Keychain Access, you normally just have one login keychain where all entries go. but if you can create a second keychain, you can copy a "web form password" and then paste a copy into the second keychain. you can't create a duplicate in the same keychain for some reason.
anyway, i copied an entry for google from my login keychain into the second keychain.it looks something like:
Name: accounts.google.com (<your username>)
Kind: Web form password
Account: <your username>
Where: https://accounts.google.com
after you create the copy in the second keychain, modify it to look like this:
Name: accounts.yahoo.com (<your username>)
Kind: Web form password
Account: <your username>
Where: https://login.yahoo.com
and then of course, change the password accordingly and save.
Then copy this entry back into your login keychain.
Anyway, this is a total hack, and im not sure if this is the best way to do this, but it's worked for me without any problems.
BTW, this only became a problem for me in the last two months, with the safari 5.1.5 upgrade and the current yahoo page. before, the user/password autofill always just worked, but after 2 weeks of, i did a little a digging. not sure this applies to all people.
Does anyone else know how to create an empty "web form password" ?