
109 Cal.Rptr.2d 442 (2001)
90 Cal.App.4th 919
Phillip FAIRCHILD et al., Plaintiffs and Appellants,
v.
Young S. PARK, Defendant and Appellant.
No. B133570.
Court of Appeal, Second District, Division One.
July 19, 2001.
*443 Combs & Schaertel, Arthur T. Schaertel, Claremont, and William R. Lutz, Glendale, for Plaintiffs and Appellants.
Prestholt & Fidone, Brian D. Holmberg, Agoura Hills; Greines, Martin, Stein & Richland, Marc J. Poster, and Barbara W. Ravitz, Beverly Hills, for Defendant and Appellant.
MALLANO, J.
Tenants leased a single-family residence. The lease had an attorney's fees and costs provision. The landlord failed to provide a habitable dwelling. A fire resulted, destroying the tenants' personal property. At the time, the tenants were behind in their rent. This lawsuit ensued, and the tenants recovered damages for the loss of their property, and the landlord recovered the back rent.
The issue before us is whether the tenants can recover attorney's fees and expert witness fees and other litigation costs under Civil Code section 1717, notwithstanding their being in breach of the lease. We conclude that they can recover attorney's fees because the implied covenant of habitability contained in the lease is independent of the covenant to pay rent. But they are not entitled to expert witness fees and other litigation costs because the reciprocity provisions of Civil Code section 1717 do not permit a contractually broadened definition of costs.

BACKGROUND
In a prior appeal, we affirmed the judgment for the tenants on their claim against the landlord for breach of the implied warranty of habitability. (Fairchild v. Park (Apr. 17, 2000, B131806) [nonpub. opn.].)
In the present appeals, the tenants challenge the trial court's posttrial denial of *444 their motion for attorney's fees. In turn, the landlord disputes the trial court's posttrial award of expert witness fees and other litigation expenses to the tenants.
The pertinent facts, taken from our earlier opinion, are as follows. "[Tenants] Phillip and Veronica Fairchild and their children were living in a rental home owned by [landlord] Young S. Park. [Tenants], who were behind in their rent by about one year, were planning to move. Before they could do so, a fire broke out in the garage and spread throughout the house during the early morning hours of April 22, 1995. [Tenants], who were sleeping, managed to escape but lost their personal belongings." (Fairchild v. Park, supra, B131806, p. 2.)
The tenants brought this suit for breach of contract, breach of the implied warranty of habitability, negligence, and fraud. The landlord cross-complained for back rent. On the landlord's demurrer and motion to strike, the trial court dismissed the tenants' fraud claim and barred all tort relief on the claim for breach of the warranty of habitability.
The case was tried to the court. The trial court found for the tenants on the complaint, stating: "Even though the rent was not paid, it was a breach of the implied warranty of quiet use and enjoyment of the property to keep the electrical system in a state of proven disrepair. The covenants to pay rent by the tenant and maintain reasonably safe premises by the landlord are independent and not dependent covenants. Failure to pay rent was an unlawful detainer and [the landlord] had a speedy remedy at law to compel [the tenants] to pay rent or vacate the premises. He was never excused from keeping the property in an average reasonable state of repair." (Italics added.) The court awarded $89,000 to the tenants for their loss of personal property in the fire.[1]
With respect to the landlord's cross-complaint, the trial court found that the tenants were liable for $12,000 in back rent, which it awarded to the landlord.
In the judgment, the trial court recited that "[tenants] are the prevailing parties and under the rental agreement and Civil Code section 1717 entitled to reasonable attorney's fees." But later, when the tenants moved for attorney's fees, the court denied the motion, stating: "The court finds that [tenants'] attorney had a [contingent] fee agreement with his client and should recover his fees as per the contract and not from the [landlord]." The court awarded the tenants costs in the amount of $12,432, which consisted of $9,147 in expert witness fees and other litigation expenses such as photocopying, telephone calls, postage, and mileage.

DISCUSSION
We begin by addressing the tenants' contention that the trial court should have awarded them attorney's fees. We then discuss whether the trial court erred in awarding litigation expenses, including expert witness fees, to the tenants.


*445 1. The Tenants' Appeal
The tenants contend that they are entitled to attorney's fees under Civil Code section 1717 based on an attorney's fees provision in the written lease, notwithstanding that they breached the lease by nonpayment of rent. The lease provides that the tenants shall "pay [landlord] all costs and expenses, including attorney's fees in a reasonable sum, in any action brought by [landlord] to recover any rent due and unpaid hereunder, or for the breach of any of the covenants contained in this lease...."
While the lease does not state that the tenants could recover attorney's fees if they were the prevailing parties, Civil Code section 1717, subdivision (a) provides that "[i]n any action on a contract, where the contract specifically provides that attorney's fees and costs, which are incurred to enforce that contract, shall be awarded either to one of the parties or to the prevailing party, then the party who is determined to be the party prevailing on the contract, whether he or she is the party specified in the contract or not, shall be entitled to reasonable attorney's fees in addition to other costs." Subdivision (b)(1) of that section provides in pertinent part that "the party prevailing on the contract shall be the party who recovered a greater relief in the action on the contract." On appeal, the landlord does not challenge the trial court's determination that the tenants were the prevailing parties under the rental agreement.
The trial court initially stated that the tenants were entitled to reasonable attorney's fees under the lease pursuant to Civil Code section 1717. Subsequently, the court had a change of heart, concluding that the contingent fee agreement between the tenants and their attorney foreclosed such an award. The trial court was wrong in this regard and the landlord does not contend otherwise.
Under a "lease agreement permitting] recovery of reasonable attorney fees in an action between the parties!,] ... an interpretation which bars recovery to parties who have contingent fee agreements would create a great deal of inequity because although a party with a contingent fee agreement would be exposed to the risk of paying fees incurred by an opponent, he would have no opportunity to recover any portion of the fees he would in fact be required to pay if he were successful. Such disparity of treatment is to be avoided in interpreting and applying attorney fees provisions. [Citation.]" (Gonzales v. Personal Storage, Inc. (1997) 56 Cal. App.4th 464, 480, 65 Cal.Rptr.2d 473.)
The landlord contends that the tenants are not entitled to attorney's fees under the lease because they prevailed on a tort claim, not a contract claim. Arguably, the scope of the attorney's fee provision in the lease does not encompass tort claims. (See Exxess Electronixx v. Heger Realty Corp. (1998) 64 Cal.App.4th 698, 75 Cal.Rptr.2d 376.) But we conclude that the tenants are entitled to attorney's fees on a contract theory.
There is "a common law implied warranty of habitability in residential leases in California...." (Green v. Superior Court (1974) 10 Cal.3d 616, 619, 111 Cal. Rptr. 704, 517 P.2d 1168 (Green).) In the present case, the tenants "did assert a contractual cause of action: breach of the implied warranty of habitability." (Allstate Ins. Co. v. Loo (1996) 46 Cal. App.4th 1794, 1798, 54 Cal.Rptr.2d 541.) "An action by a tenant alleging a breach of the warranty of habitability is an action on the contract that authorizes the recovery of fees pursuant to an attorney fee provision in the rental agreement." (9 Miller & *446 Starr, Cal. Real Estate (2001 supp.) § 30:17, p. 383.)
Further, "[w]hether an action is based on contract or tort depends upon the nature of the right sued upon, not the form of the pleading or relief demanded. If based on breach of promise it is contractual; if based on breach of a noncontractual duty it is tortious.... If unclear the action will be considered based on contract rather than tort, [¶] In the final analysis we look to the pleading to determine the nature of plaintiffs claim." (Arthur L. Sachs, Inc. v. City of Oceanside (1984) 151 Cal.App.3d 315, 322, 198 Cal.Rptr. 483, citations omitted; accord, Voth v. Wasco Public Util. Dist. (1976) 56 Cal.App.3d 353, 356-357, 128 Cal.Rptr. 608.)
Here, the tenants' recovery was not based on a duty independent of the lease. The trial court expressly awarded damages based on the landlord's breach of the warranty of habitabilitya warranty that is implied in every lease. (See Green, supra, 10 Cal.3d at pp. 619, 627-629, 111 Cal.Rptr. 704, 517 P.2d 1168.) In addition, after the trial court ruled on the landlord's demurrer and motion to strike, the tenants were no longer seeking, or entitled to, tort relief on the habitability claim. We therefore see no basis for concluding that the landlord's liability was premised on a duty not arising out of the lease.
We acknowledge that a landlord has a statutory obligation under Civil Code section 1941 to keep residential property in "a condition fit for [human] occupation, and repair all subsequent dilapidations thereof." But in Green, supra, 10 Cal.3d 616, 111 Cal.Rptr. 704, 517 P.2d 1168, the Supreme Court made clear that Civil Code section 1941 does not affect a tenant's right to pursue a claim for violation of the warranty of habitability. In the words of the court, "we conclude that Civil Code section 1941 et seq. do not preclude the development of new common law principles in this area, and we now hold that a warranty of habitability is implied by law in residential leases in California." (Green, supra, 10 Cal.3d at p. 631, 111 Cal.Rptr. 704, 517 P.2d 1168, italics added.) And, as stated, the trial court in this case did not rely on section 1941, but instead based liability solely on the implied warranty of quiet use and enjoyment.
And, even assuming that the habitability claim was based on more than one theorycontract, statutory, or tortthe tenants would still be entitled to attorney's fees on the contract theory. As one Court of Appeal has explained in a similar situation:
"`[T]he same act may be both a breach of contract and a tort. Even where there is a contractual relationship between parties, a cause of action in tort may sometimes arise out of the negligent manner in which the contractual duty is performed....' ... Conversely, where a contract gives rise to a duty of care, negligence in the performance of the duty may give rise to a cause of action for breach of contract.... When such a hybrid cause of action arises, the plaintiff may pursue both legal theories of recovery until an occasion for an election of remedies arises....
"Here, the allegations of [the] complaint, while compacted in a single count, are adequate to tender both the tort and contract claims for relief.... [¶] ... [¶]
"Defendants' central argument concerning the pleading is that, because it alleges that they were negligent, it must present only a legal theory in tort. This argument is fundamentally flawed....
"The allegation of negligence is not an election of a tort remedy. An election does not occur by the assertion of an inconsistent allegation, but by the acceptance of an actual benefit from an alternative *447 theory which would render unfair [the] continued pursuit of the alternative.... Defendants have not identified any such benefit....
"Defendants make no argument which identifies a benefit received by [the plaintiff] peculiar to the tort remedy that warrants estoppel to pursue the contract remedy of attorney's fees. From all that appears the damages that [the plaintiff] received would be the same whether the theory were contract or tort. [The plaintiff] did not pursue nor, consequently, did the jury award, damages for personal injuries, a characteristic tort remedy.... [¶] ... [¶]
"... The question is whether plaintiff may pursue a breach of contract theory of remedy when defendants have negligently failed to adequately perform a contractual undertaking. Such an action is one to enforce the provisions of the contract.... [W]e hold that when the prevailing plaintiff in such an action has not elected a distinctive remedy in tort, such an action may be, and here is, `on a contract' within the meaning of [Civil Code] section 1717." Perry v. Robertson (1988) 201 Cal.App.3d 333, 340-344, 247 Cal.Rptr. 74 (Perry), italics in original.)
As noted by one leading authority, in Perry, "the plaintiffs complaint was based on both negligence and negligent performance of the contract, and both theories went to the jury. Since the measure of damages was the same under both theories, [the plaintiff] was not required to make an election of remedies, and after the jury verdict she was allowed to elect the contract theory in order to recover attorney fees." (9 Miller & Starr, Cal. Real Estate (2d ed.1990) § 30:2, p. 229, fn. 42, italics added; see id., § 30:17, p. 308, fn. 35 [discussing Perry].) As in Perry, the tenants in this case could elect, after the finding of liability, to go forward on a contract theory to recover attorney's fees.
Nor does the tenants' type of recovery matter. The landlord asserts that, because the tenants were awarded the market value of the lost property, they necessarily prevailed on a tort claim. We disagree. "Where the measure of damages turns on the value of property, whether liability sounds in tort or breach of contract, the normal standard is market value." (Glendale Fed. Sav. & Loan Assn. v. Marina View Heights Dev. Co. (1977) 66 Cal.App.3d 101, 141, 135 Cal.Rptr. 802, italics added, citing Bagdasarian v. Gragnon (1948) 31 Cal.2d 744, 752-753, 192 P.2d 935.)
The landlord also contends that, since the covenant of habitability is imposed by law, it must sound in tort. Not so. Just as the covenant of habitability is implied in a lease, the covenant of good faith and fair dealing is implied in all contracts, including a lease. (See, e.g., Locke v. Warner Bros., Inc. (1997) 57 Cal. App.4th 354, 363-367, 66 Cal.Rptr.2d 921; Sachs v. Exxon Co., U.S.A. (1992) 9 Cal. App.4th 1491, 1498, 12 Cal.Rptr.2d 237.) Yet, with the exception of bad faith insurance cases, a breach of the covenant of good faith and fair dealing permits a recovery solely in contract. (See Cates Construction, Inc. v. Talbot Partners (1999) 21 Cal.4th 28, 43-44, 86 Cal.Rptr.2d 855, 980 P.2d 407.)
Next, the landlord argues that the tenants did not recover on a contract cause of action because they were in breach of the lease by being in arrears in rent. We reject that argument on the ground that the implied covenant of habitability contained in the lease is independent of the covenant to pay rent.
As our Supreme Court has stated: "A covenant to repair on the part of the lessor *448 and a covenant to pay rent on the part of a lessee are usually considered as independent covenants, and unless the covenant to repair is expressly or impliedly made a condition precedent to the covenant to pay rent, the breach of the former does not justify the refusal on the part of the lessee to perform the latter." (Arnold v. Krigbaum (1915) 169 Cal. 143, 145, 146 P. 423, overruled on another point in Green, supra, 10 Cal.3d at pp. 622-623, 111 Cal. Rptr. 704, 517 P.2d 1168.) And as the high court later clarified: "[Covenants in leases are independent or dependent according to the nature of the obligations, their relation to each other, the intention of the parties as shown by the provisions of the governing lease, and the factual situation of each particular case...." (Medico-Dental Bldg. Co. v. Horton & Converse (1942) 21 Cal.2d 411, 424, 132 P.2d 457.) Here, the landlord does not contend that the implied covenant of habitability was expressly or impliedly made a condition precedent to the covenant to pay rent.
We conclude that the landlord's obligation to provide a habitable residence to the tenants is independent of the tenants' obligation to pay rent. In Green, supra, 10 Cal.3d 616, 111 Cal.Rptr. 704, 517 P.2d 1168, the Supreme Court tracedbeginning in the Middle Agesthe property law principle that a landlord had no duty to place leased premises in a habitable condition and no duty to repair based on the ancient doctrine of caveat emptor, or "let the buyer beware." The court discussed modern urbanization, the change in the contemporary housing market, modern legal decisions discarding the caveat emptor approach in order to protect consumers, and the widespread enactment of comprehensive housing codes throughout the nation. (Green, supra, 10 Cal.3d at pp. 622-627, 111 Cal.Rptr. 704, 517 P.2d 1168.)
The court stated: "In most significant respects, the modern urban tenant is in the same position as any other normal consumer of goods. [Citation.]" (Green, supra, 10 Cal.3d at p. 627, 111 Cal.Rptr. 704, 517 P.2d 1168.) Based on contemporary social conditions and modern legal values, Green recognized an implied warranty of habitability in residential leases in California.
Applying the rationale of Green to this case, we conclude that the nature of a landlord's obligation to provide habitable premises to its tenants is such that the tenants' right to enforce this duty should not be forfeited by an arrearage in rent. A landlord has a speedy remedy via unlawful detainer proceedings to deal with a tenant who is behind in rent. "[T]he covenant to pay rent usually is regarded as independent. In other words, the tenant's failure to pay rent does not justify the landlord's failure to perform his covenants, such as his covenant to repair." (6 Miller & Starr, Cal. Real Estate (2d ed.1989) § 18:41, pp. 86-87, fn. omitted.)

2. The Landlord's Appeal
The landlord contends that the trial court improperly awarded expert witness fees and other litigation expenses in the amount of $9,147. We agree.
The tenants described the $9,147 on their memorandum of costs as "[o]ther costs pursuant to contract." These costswhich include not only expert witness fees but also expenditures for photocopying, telephone calls, postage, and mileagewould not otherwise be allowable under Code of Civil Procedure section 1033.5. Indeed, section 1033.5 explicitly precludes their recovery. (Code Civ. Proc., § 1033.5, subd. (b)(1), (3).)
Nevertheless, the tenants claim that they are entitled to these costs "under the *449 contract" pursuant to the attorney's fee clause in the lease. That clause states that the tenants shall "pay [landlord] all costs and expenses ... in any action brought ... for the breach of any of the covenants contained in th[e] lease...." Thus, the tenants contend that the reciprocity provisions of Civil Code section 1717 entitle them, as the prevailing parties, to an award of "all costs and expenses."
The tenants argue that, because the lease uses the broad language, "all costs and expenses," they are entitled to expert witness fees and other litigation expenditures. The same language appears frequently in notes, deeds of trust and standard leases. Here the lease is captioned "standard lease" and is a "fill in the blanks" form.
We need not reach the question of whether the parties intended the words "all costs and expenses" to include items disallowed under section 1033.5 of the Code of Civil Procedure. Assuming that the parties so intended, the question is whether the scope of the term "costs" as used in Civil Code section 1717 can be enlarged by contract beyond the costs allowable under Code of Civil Procedure section 1033.5. We conclude that it cannot.
As we observed in Exxess Electronixx v. Heger Realty Corp., supra, 64 Cal.App.4th 698, 75 Cal.Rptr.2d 376, "the definition of `prevailing party' in Civil Code section 1717 is mandatory and cannot be altered or avoided by contract." (Id. at p. 707, 75 Cal.Rptr.2d 376, citing Santisas v. Goodin (1998) 17 Cal.4th 599, 615-617, 71 Cal. Rptr.2d 830, 951 P.2d 399 (Santisas).) "Contractual provisions that conflict with the `prevailing party' definition under section 1717 are void." (Exxess Electronixx v. Heger Realty Corp., supra, 64 Cal. App.4th at p. 707, 75 Cal.Rptr.2d 376, citing Santisas, supra, 17 Cal.4th at p. 617, 71 Cal.Rptr.2d 830, 951 P.2d 399.)
As the Supreme Court explained in Santisas: "[T]he legislative history of section 1717 ... generally reflects a legislative intent to establish uniform treatment of fee recoveries in actions on contracts containing attorney fee provisions and to eliminate distinctions based on whether recovery was authorized by statute or by contract. A holding that in contract actions there is still a separate contractual right to recover fees that is not governed by section 1717 would be contrary to this legislative intent." (17 Cal.4th at p. 616, 71 Cal.Rptr.2d 830, 951 P.2d 399.)
Just as Santisas precludes litigants from adopting a definition of "prevailing party" that differs from Civil Code section 1717, we conclude, for the same reasons, that litigants cannot expand the definition of "costs" in section 1717 to include items not permitted under section 1033.5 of the Code of Civil Procedure. It follows that the trial court's award of $9,147 for expert witnesses and other litigation expenses should be stricken.[2]
In arguing that they are entitled to expert witness fees, the tenants urge us to follow Bussey v. Affleck (1990) 225 Cal. App.3d 1162, 275 Cal.Rptr. 646 (Bussey). In that case, the court concluded: "[W]here a contract provides for payment of costs and attorney's fees, the court may *450 allow disbursements of counsel as attorney fees under section 1033.5, subdivision (a)(10), if they represent expenses ordinarily billed to a client[, including expert witness fees,] and are not included in the overhead component of counsel's hourly rate. An agreement for attorney's fees and costs would be less than effectual if it could not cover the actual costs of litigation, including disbursements of counsel, and a contrary conclusion would mean that the party prevailing on the contract could never be made whole." (Bussey, supra, 225 Cal.App.3d at p. 1166, 275 Cal.Rptr. 646.)
In contrast, the landlord in this case relies on Ripley v. Pappadopoulos (1994) 23 Cal.App.4th 1616, 28 Cal.Rptr.2d 878, which disagreed with Bussey and held that a general contract provision for recovery of attorney's fees and costs must be construed in light of Code of Civil Procedure section 1033.5 and does not include expert witness fees. (Id. at pp. at 1626-1627, 28 Cal.Rptr.2d 878 (Ripley).) As the court explained in Ripley:
"In Bussey the court attempted to avoid the statutory prohibition against the inclusion of expert witness fees in a cost award by equating expert witness fees and other nonallowable costs of litigation with attorney fees and by concluding that such costs may be included in an award of contractual attorney fees. We cannot adhere to that approach. In the absence of some specific provision of law otherwise, attorney fees and the expenses of litigation, whether termed costs, disbursements, outlays, or something else, are mutually exclusive, that is, attorney fees do not include such costs and costs do not include attorney fees.... In view of the clear distinction that has always been drawn between attorney fees and the expenses of litigation, we cannot disregard the Legislature's express prohibition against the inclusion of expert witness fees in a cost award by equating such expenses with attorney fees." (Ripley, supra, 23 Cal.App.4th at pp. 1625-1626, 28 Cal.Rptr.2d 878.)
In Davis v. KGO-T.V., Inc. (1998) 17 Cal.4th 436, 71 Cal.Rptr.2d 452, 950 P.2d 567, in connection with a contractual provision for shifting costs of litigation, the Supreme Court noted the conflict between Bussey and Ripley and then stated: "Our present analysis, which involves statutory construction, may not be dispositive in a matter involving the effect of a contractual agreement for shifting litigation costs, which turns on the intentions of the contracting parties." (Davis v. KGO-T.V., Inc., supra, at pp. 446-447, fn. 5, 71 Cal. Rptr.2d 452, 950 P.2d 567.)
Bussey is not on point because the trial court here did not award expert witness fees or other litigation expenses under the guise of "attorney's fees," which was the case in Bussey. Rather, the trial court in this case did not award attorney's fees at all.
And, Bussey is a decision of the First District Court of Appeal, Division Four. In Robert L. Cloud & Associates, Inc. v. Mikesell (1999) 69 Cal.App.4th 1141, 82 Cal.Rptr.2d 143, decided by Division Five of the First District, the court stated: "[Appellant] now urges this court to reject Bussey and to follow Ripley. His position is sound. For all the reasons stated in Ripley, the Bussey decision should not be followed. Instead, in light of the Legislature's express prohibition against inclusion of expert witness fees within a cost award (Code Civ. Proc., § 1033.5, subd. (b)(1)), we shall modify the judgment to delete the expert witness fees...." (Robert L. Cloud & Associates, supra, 69 Cal.App.4th at p. 1154, 82 Cal.Rptr.2d 143.)
We, too, find Ripley to be persuasive and therefore decline to follow Bussey.
*451 DISPOSITION
The order denying plaintiffs' motion for attorney's fees is reversed, and, on remand, the trial court shall award reasonable attorney's fees to plaintiff. The order denying defendant's motion to strike $9,147 in costs is reversed. The parties are to bear their own costs on appeal.
SPENCER, P.J., concurs.
ORTEGA, J., Concurring and Dissenting:
I concur in part and dissent in part. I agree with the reversal of the order denying defendant's motion to strike $9,147 in costs. I disagree, however, with the reversal of the order denying plaintiffs' motion for attorney fees. In my view, the breaching tenants who, without justification, had withheld rent for a year, may not enforce a contractual attorney fee clause against a landlord whose breach of the implied warranty of habitability caused the tenants to suffer property damage in an electrical fire. The landlord's breach did not, in this specific case, extinguish the tenants' duty to pay the back rent accrued during the year before the fire.[1]
The majority cite an unlawful detainer case, Green v. Superior Court, supra, 10 Cal.3d at p. 619, 111 Cal.Rptr. 704, 517 P.2d 1168, for the proposition that there is "a common law implied warranty of habitability in residential leases in California...." In general, I agree that a residential tenant who defeats an unlawful detainer action by asserting the landlord's breach of the implied covenant of habitability may, in addition to remaining in possession of the premises, recover attorney fees under the lease agreement, provided the landlord's breach has canceled the obligation to pay rent. "[A] landlord's breach of a warranty of habitability directly relates to whether any rent is `due and owing' by the tenant; hence such breach may be determinative of whether the landlord or tenant is entitled to possession of the premises upon nonpayment of rent. Accordingly, the tenant may properly raise the issue of warranty of habitability in an unlawful detainer action." (Green v. Superior Court, supra, 10 Cal.3d at p. 620, 111 Cal.Rptr. 704, 517 P.2d 1168.) "If the tenant can prove such a breach by the landlord, he may demonstrate that his nonpayment of rent was justified and that no rent is in fact `due *452 and owing' to the landlord." (Green v. Superior Court, supra, 10 Cal.3d at p. 635, 111 Cal.Rptr. 704, 517 P.2d 1168.)
The degree to which the landlord's breach of the implied warranty of habitability provides a defense to an unlawful detainer action depends entirely upon the extent of the damages caused by the landlord's breach. If the "landlord's breach of warranty is total, [such] that the tenant owes no rent whatsoever, the court should, of course, enter judgment for the tenant in the unlawful detainer action." (Green v. Superior Court, supra, 10 Cal.3d at p. 639, 111 Cal.Rptr. 704, 517 P.2d 1168.) On the other hand, "if the trial court finds that the landlord has not breached the warranty of habitability, it should immediately enter judgment in favor of the landlord." (Ibid.) Where the landlord's breach falls somewhere in between, such that the damages do not exceed the fair rental value, the trial court will assess the amount of rent owed: "If the court determines ... that the damages from the breach of warranty justify only a partial reduction in rent, the tenant may maintain possession of the premises only if he pays that portion of the back rent that is owing, as directed by the trial court. [Citations.] If the tenant fails to pay such sum, the landlord is entitled to a judgment for possession." (Ibid.)
If the landlord's breach is total, such that the tenant's nonpayment of rent is excused, I believe the tenant may enforce the attorney fee clause because the tenant has not breached the lease agreement. (See Greenwald & Asimow, Cal. Practice Guide: Cal. Real Property Transactions (The Rutter Group 2000) ¶ 11:55 ["A party's legally excused or justified failure to perform a material covenant of a contract is not a breach of contract and thus does not give the other party any affirmative cause of action." (Italics omitted.)].) That is not the case here, however. In this case, the trial court found the tenants owed $12,000 in back rent, a finding that is undisputed on appeal. Accordingly, the tenants were conclusively found to be in breach of a material term of the lease agreement.
The only reasonable inference to be drawn from the award of back rent in this case is that the tenants' failure to pay rent was not related to or excused by any defect in the condition of the premises. Had the condition of the premises been so poor as to justify nonpayment or a reduction of rent, the trial court would not have awarded the landlord $12,000 in back rent.[2]*453 Based on the award of back rent, I would infer the tenants' damages flowing from the landlord's breach of the implied warranty of habitability first occurred when the fire destroyed their personal property, and not earlier.
Under standard contract law principles, a party who has breached a contract without justification or excuse may not enforce the contract. "To state a cause of action for breach of contract, [a party] must plead the contract, his performance of the contract or excuse for nonperformance, [the other party's] breach and the resulting damage." (Otworth v. Southern Pac. Transportation Co. (1985) 166 Cal.App.3d 452, 458, 212 Cal.Rptr. 743.)
Although the tenants have proven their damages resulting from a breach of the implied warranty of habitability, they have failed to prove either their own performance (payment of rent) or excuse for nonperformance. We are bound by the finding, implicit in the award of $12,000 back rent, that the tenants' nonpayment of rent was unjustified. The tenants, having breached the contract without justification, may not enforce the attorney fee clause. (See Otworth v. Southern Pac. Transportation Co., supra, 166 Cal.App.3d at p. 458, 212 Cal.Rptr. 743.) This is not a case where the tenants' nonpayment of rent was justified by the uninhabitable condition of the premises.
Enforcing the attorney fees clause under these facts would only serve to warn other landlords not to tolerate a nonpayment of rent and to file unlawful detainer actions immediately, in every instance. Any ration al landlord will do so as a matter of self-protection. If by enforcing the attorney fee clause despite the tenants' unjustified material breach of contract, the majority seek to further the public policy of requiring landlords to maintain habitable dwellings, it is not necessary to punish this landlord to accomplish that goal. The law already protects holdover tenants by requiring landlords to maintain the premises in a habitable condition, despite the tenants' unjustified nonpayment of rent. (Civ.Code, § 1941 ["The lessor of a building intended for the occupation of human beings must, in the absence of an agreement to the contrary, put it into a condition fit for such occupation, and repair all subsequent dilapidations thereof, which render it untenantable, except such as are mentioned in section nineteen hundred and twenty-nine."].) Accordingly, although nonpayment of rent is a material breach that gives rise to a summary action for recovery of possession and back rent, it does not excuse the landlord from maintaining a habitable dwelling during the holdover period.
The fact that a landlord must maintain the premises in a habitable condition during the holdover period does not mean, however, that the attorney fee clause is suddenly resurrected if the landlord later breaches the implied warranty of habitability. The contractual obligation to pay attorney fees is not the same as the implied obligation to maintain a habitable dwelling. I know of no legal authority to support the proposition that a tenant's unjustified nonpayment of rent will be eradicated by the landlord's subsequent failure to maintain *454 the premises during the holdover period, such that the tenant may enforce the attorney fee clause against the landlord as though the tenant had not materially breached the contract. In my view, when a tenant's nonpayment of rent is unjustified, his remedies for the landlord's failure to maintain the premises should be no greater than the remedies available under a lease that does not contain an attorney fee clause. A non-breaching tenant with no such clause in the lease is on his own in retaining counsel to sue for breach of the habitability covenant.[3] Under the majority view, a breaching tenant who is lucky enough to have such a clause gets to have the landlord fund the tenant's lawsuit.
As a matter of public policy, a tenant can always enforce the habitability covenant. But I would not let a breaching landlord or tenant recover attorney fees.
In this case, the tenants' net monetary recovery made them, in the trial court's view, the prevailing party under Civil Code section 1717, a finding which the landlord does not dispute on appeal. On this record, however, the trial court should have refused to confer prevailing party status upon either party, given that the tenants' nonpayment of rent was independent of, and not excused by, the landlord's breach.
I agree with the majority that the trial court's stated reasons for denying attorney fees were wrong. Attorney fees nevertheless were properly denied because the tenants were in breach due to their unjustified nonpayment of rent. On that basis, I would affirm the order denying fees.
NOTES
[1]  The parties do not attach any significance to the difference in terminology between the complaintthe "covenant of habitability " and the trial court's memorandum of intended decisionthe "covenant of quiet use and enjoyment." This is understandable because "the implied covenant of quiet enjoyment is similar to, and sometimes overlapping with, the warranty of habitability." (Friedman et al., Cal. Practice Guide: Landlord-Tenant (The Rutter Group 2000) § 4.23, p. 4-8.1, rev. # 1, 2000.) "[T]he `line between' the landlord's interference with the tenant's quiet enjoyment and the landlord's failure to maintain the leased premises in a `tenantable' condition can be `blurred.'" (Id., § 4.7, p. 4-3, rev. # 1, 1999.)
[2]  In Arntz Contracting Co. v. St. Paul Fire & Marine Ins. Co. (1996) 47 Cal.App.4th 464, 54 Cal.Rptr.2d 888, the court interpreted a contractual cost provision that authorized the recovery of "all `costs, charges and expenses'...." (Id. at p. 492, 54 Cal.Rptr.2d 888.) The court found the provision to be valid even though it was broader than the statutory cost provisions in the Code of Civil Procedure. (Ibid.) Because Arntz was decided before Santisas, supra, 17 Cal.4th 599, 71 Cal.Rptr.2d 830, 951 P.2d 399, and did not consider the legislative history of Civil Code section 1717, we decline to follow it.
[1]  I recognize the trial court's finding that the landlord had kept the "electrical system in a state of proven disrepair" appears possibly inconsistent with a determination that the home was habitable before the fire. (See Civ.Code, § 1941.1, subd. (e) [a dwelling is untenantable if the electrical wiring is not maintained in good working order].) The issue is one of degree: Was the electrical wiring in such disrepair that the nonpayment of rent was justified? (See Green v. Superior Court (1974) 10 Cal.3d 616, 635, 111 Cal. Rptr. 704, 517 P.2d 1168.)

I can only infer from the trial court's award of $12,000 in back rent that the electrical wiring, before the fire, had caused no damages and did not justify the nonpayment of rent. "The principles of review which must guide us are elementary.... [A] `reviewing court is without power to substitute its deductions for those of the trial court.'... [`]"In brief, the appellate court ordinarily looks only at the evidence supporting the successful party, and disregards the contrary showing." [Citation.] All conflicts, therefore, must be resolved in favor of the respondent.' [ ... Citation.]" (Campbell v. Southern Pacific Co. (1978) 22 Cal.3d 51, 60, 148 Cal.Rptr. 596, 583 P.2d 121.) "All presumptions are in favor of the judgment. Trial judges and juries are the exclusive judges of credibility and may disbelieve any witness. Trial courts are designed and responsible for determining facts. Appellate courts are designed to review errors of law. Economy, efficiency, and practicality require recognition of those specialized roles." (Rivard v. Board of Pension Commisioners[Commissioners] (1985) 164 Cal.App.3d 405, 412, 210 Cal.Rptr. 509.)
[2]  The trial court arrived at the $12,000 figure by "compromis[ing] the amorphous sums testified to on both, sides to $12,000e[.]g. $6,000 admitted arrearage and half the $12,000 difference between $18,000 and $6,000 and determining] defendant is entitled to $12,000 credit for unpaid rental." The trial court said nothing about reducing the amount of back rent to compensate for any damages caused by the breach of the implied warranty of habitability. Accordingly, I infer the calculation of back rent had nothing to do with the condition of the premises before the fire.

In the earlier appeal, we noted the difficulty the trial court had in determining causation. We quoted the following from the statement of decision: "`No one was able with reasonable certainty to pinpoint the precise location and cause of the fire which caused the damage. After review of the so called expert testimony (viewed askance from both sides by the court for reasons expressed at the time of oral argument) the court is left unenlightened by the partisan bias of each side's witnesses and must infer from the circumstantial evidence that the fire started at or in the electric panel/lead in/(now contraband) aluminum wire(s) at or near the electric panel. The court does acknowledge both sides[`] `fire expert's' acknowledgement that the location of the start of the fire was in the corner of the garage in the vicinity of the elect[r]ic panel. The testimony on causation by both sides was found implausible and unreliable and has not been relied upon, therefore, by the court, as to causation and as to what made the fire break out, in the first place. The court concludes the fire was electrical in origin.'" (Fairchild v. Park (Apr. 17, 2000, B131806) [nonpub. opn.].)
Given the trial court's great difficulty in determining the cause of the fire, the trial court evidently did not believe a sufficient basis existed to reduce the amount of back rent owed to compensate for damages caused by a failure to maintain the premises before the fire. The trial court made no finding that any damages were caused by the failure to maintain the premises other than the personal property lost in the fire itself.
[3]  A tenant may recover attorney fees by statute under the conditions set forth in Civil Code section 1942.4, which do not apply here. One requirement of section 1942.4 is that a government official must have given the landlord written notice of the substandard condition, which did not occur in this case.
