Opinion
ELIA, J.After a jury trial, appellant Linear Technology Corporation (Linear) lost its suit for breach of statutory warranty against respondents Novellus *1530Systems, Inc. (Novellus), and Tokyo Electron Limited (TEL). Linear’s motion for judgment notwithstanding the verdict was unsuccessful, and the trial court awarded respondents attorney fees. Linear appeals from both the judgment and the postjudgment order, contending that (1) it proved breach of statutory warranty as a matter of law, and (2) respondents were not entitled to attorney fees. We will affirm the judgment and the postjudgment order.
Background
Linear designs, manufactures, and sells semiconductors and integrated circuit products. Between July 1996 and August 2000 Linear purchased semiconductor processing equipment from Novellus and TEL, a Concept One machine from Novellus and a Mark Vz from TEL. During 2001 Texas Instruments, Inc. (TI), filed multiple lawsuits against Linear in the United States District Court, alleging patent infringement and seeking injunctive relief, damages, and attorney fees arising from the use and sale of products made by processes covered by TI’s patents. One of the lawsuits, filed in January of that year, pertained to TI’s “Head patents.” In that action, TI alleged infringement of the “’613 patent,” the “’168 patent,” and the “’674 patent.” TI noted in the complaint that a jury had already found the ’674 and ’613 patents to have been infringed by its prior lawsuit against Hyundai Electronics Industries Co., Ltd. (Hyundai), and the ’168 patent allegedly “originated from the same chain of applications.”
Linear filed third party complaints in federal court against Applied Materials, Inc., TEL, and Novellus, all suppliers of semiconductor wafer manufacturing equipment. The district court granted a defense motion to sever those claims from TI’s lawsuit, and in March 2002 Linear proceeded against these three defendants in superior court, alleging that its use of these companies’ tools in its manufacturing processes had led to the patent infringement claims by TI. The superior court sustained the defendants’ demurrers to Linear’s fifth amended complaint, dismissed claims of fraud and unfair competition, and dismissed the four contract-related causes of action on the ground that it lacked subject matter jurisdiction to adjudicate these claims. We reversed the judgment and remanded for further proceedings solely on the contract-related claims. (Linear Technology Corp. v. Applied Materials, Inc. (2007) 152 Cal.App.4th 115 [61 Cal.Rptr.3d 221].)
Meanwhile, in September 2002 TI’s lawsuits against Linear were settled. Linear agreed to pay TI $70 million and the parties agreed to grant access to each other’s patents.
*1531Trial began on Linear’s remaining claims against respondents TEL and Novellus in January 2010.1 The jury received special verdict forms asking whether each defendant had breached “the statutory warranty incorporated into its contract with Linear.” For both TEL and Novellus, the jury answered no to the first question and therefore did not reach the issues of harm and monetary damages. The verdict forms also asked whether each defendant had breached the covenant of good faith and fair dealing implied in its contract with Linear. The jury answered no to this question as well. On March 24, 2010, the court entered judgment for respondents.
Linear moved for judgment notwithstanding the verdict (JNOV) and for a new trial. In the JNOV motion, Linear argued that as a matter of law both respondents had breached the warranty provided by California Uniform Commercial Code section 2312, subdivision (3), because they had delivered tools that were subject to TI’s “rightful,” meritorious claim of infringement. According to Linear, there was no substantial evidence presented that TI’s claims against it were frivolous or meritless; in fact, Linear “proved” they were not. It was undisputed, Linear argued, that TI’s lawsuit arose from the use of the tools supplied by TEL and Novellus rather than Linear’s own processes or any specifications it had made for the products delivered. Indeed, “Linear’s evidence was unrebutted that it used the Novellus and TEL machines precisely in the manner in which they were built, delivered, and intended by defendants to operate.” In short, “the evidence was uncontroverted that at least some of [the TI litigation and settlement] was due to Novellus’ and TEL’s machines.” In addition, the Hyundai verdict “also demonstrate^] that TI’s infringement claims were rightful.”
The trial court, however, denied the motion on May 24, 2010. Linear filed its first notice of appeal on June 21, 2010. The court subsequently considered motions for attorney fees brought by respondents. Novellus sought $8,616,415.37, while TEL claimed $3,250,747 plus costs. On August 2, 2010, the court granted attorney fees of $5,200,931.62 to Novellus and $3,154,498 to TEL. Linear filed its notice of appeal from this order on August 16, 2010.
Discussion
On appeal, Linear renews its contention that it was entitled to JNOV because it presented “uncontested facts” at trial that established breach of statutory warranty as a matter of law, and because the jury lacked substantial evidence to find that the warranty had not been breached. Linear further contends that the grant of attorney fees to respondents was unauthorized by the parties’ contracts or Civil Code section 1717.
*15321. JNOV Motion
“A motion for judgment notwithstanding the verdict of a jury may properly be granted only if it appears from the evidence, viewed in the light most favorable to the party securing the verdict, that there is no substantial evidence to support the verdict.” (Brandenburg v. Pac. Gas & Elec. Co. (1946) 28 Cal.2d 282, 284 [169 P.2d 909].) “The trial judge cannot weigh the evidence [citation], or judge the credibility of witnesses. [Citation.] If the evidence is conflicting or if several reasonable inferences may be drawn, the motion for judgment notwithstanding the verdict should be denied.” (Hauter v. Zogarts (1975) 14 Cal.3d 104, 110 [120 Cal.Rptr. 681, 534 P.2d 377].) On appeal, we review the motion de novo. “[W]e determine whether substantial evidence supported the verdict, viewing the evidence in the light most favorable to the party who obtained the verdict. [Citation.] We resolve all conflicts in the evidence and draw all reasonable inferences in favor of the verdict, and do not weigh the evidence or judge the credibility of witnesses.” (Chicago Title Ins. Co. v. AMZ Ins. Services, Inc. (2010) 188 Cal.App.4th 401, 418 [115 Cal.Rptr.3d 707]; see Paykar Construction, Inc. v. Spilat Construction Corp. (2001) 92 Cal.App.4th 488, 493 [111 Cal.Rptr.2d 863]; Code Civ. Proc., § 629.)
Linear contends that it proved that TEL and Novellus breached the statutory warranty described by California Uniform Commercial Code section 2312, subdivision (3) (hereafter, section 2312(3)). This provision states: “Unless otherwise agreed a seller who is a merchant regularly dealing in goods of the kind warrants that the goods shall be delivered free of the rightful claim of any third person by way of infringement or the like but a buyer who furnishes specifications to the seller must hold the seller harmless against any such claim which arises out of compliance with the specifications.”
Linear’s primary argument is that the statutory warranty is applicable based on TI’s nonfrivolous, “rightful claim” against it in the prior litigation. “[A] rightful claim under section 2312(3) is a nonfrivolous claim of infringement that has any significant and adverse effect on the buyer’s ability to make use of the purchased goods.” (Pacific Sunwear of California, Inc. v. Olaes Enterprises, Inc. (2008) 167 Cal.App.4th 466, 470 [84 Cal.Rptr.3d 182] (Pacific Sunwear).) In Pacific Sunwear a clothing manufacturer named Pacific Sunwear of California (PacSun) and its subsidiary were sued in an action for trademark infringement after PacSun purchased and sold T-shirts bearing that trademark. The federal district court denied a preliminary injunction sought by the plaintiff, and those parties settled. In a subsequent lawsuit by PacSun against Olaes, which had supplied the T-shirts, Olaes obtained summary judgment on the ground that the clothing manufacturer’s *1533infringement claims had not been “rightful” within the meaning of section 2312(3). The Fourth District, Division One, reversed, defining “rightful claim” not as one that is meritorious or ultimately successful, but as “any nonfrivolous claim of infringement that significantly interferes with the buyer’s use of a purchased good.” (167 Cal.App.4th at p. 475.) Thus, for the warranty to apply it need not be shown that the underlying claim “ultimately lacks merit.” (Id. at p. 476.) Only “frivolous claims that are completely devoid of merit” are outside the scope of the term “rightful claim.” (Id. at p. 481.)
In holding summary judgment to have been erroneously granted, the Pacific Sunwear court emphasized that there was a triable issue of fact as to whether the underlying infringement claim was rightful. Here, too, Linear and the court recognized that whether TI’s claims in the prior litigation were “rightful” was a question of fact, and this issue was properly submitted to the jury. Linear argued to the jury, in the language of Pacific Sunwear, that Novellus’s product, the Concept One, and TEL’s product, the Clean Track Mark Vz, were not delivered free of rightful claims of infringement. Linear asserted, for example, that TI’s successful lawsuit against Hyundai arising from Hyundai’s use of the Concept One demonstrated that TI’s claim against Linear was not frivolous and therefore was a rightful claim. Likewise, Linear argued that TI’s infringement verdict in the Hyundai suit demonstrated a nonfrivolous (rightful) claim involving the TEL Mark 7 and Mark 8, which Linear asserted were similar to the TEL Mark Vz, which Linear had used.2
Novellus argued at trial that it had “stood behind its warranty” and that there was no “rightful claim” by TI against Linear with respect to the Concept One tool. TEL similarly argued that TI had asserted no rightful claim of infringement against Linear for the Mark Vz. TEL maintained that TI’s lawsuit against Linear did not even involve any alleged infringement by the Mark Vz, nor had the Hyundai verdict pertained to this tool either. TEL presented opinion testimony that the Mark Vz did not infringe the Head patents in any event. Both Novellus and TEL told the jury that the TI-Linear settlement was the product of Linear’s own business decision, and that they themselves were not invited to participate in any way.
The trial court instructed the jury in accordance with the language of section 2312(3), including definitions of “rightful claim” and “frivolous claim.” The court explained that a “rightful claim” is “one that has any significance and adverse effect on the buyer’s ability to make use of the purchased goods and is not frivolous.” The court defined “frivolous claim” as “one that is factually or legally devoid of merit.” The special verdicts did not specifically state *1534whether the jury found TI’s claims to be frivolous or instead to have had no significant adverse effect on Linear’s operations. The jury may have rejected Linear’s attempt to show the relevance of the Hyundai verdict to the claims TI had asserted against Linear, based on the distinctions in the way Hyundai used its machines. TEL apparently convinced the jury that none of Linear’s witnesses who had compared the Mark 7, Mark 8, and Mark Vz fully understood their composition and the differences each model presented, whereas TEL’s support manager was able to describe the difference in the manner in which the Mark Vz conveyed wafers. As for Novellus, the jury may have credited Novellus’s distinction between synchronous and asynchronous operations with respect to the function of the Concept One in Linear’s processes, along with other distinguishing features Novellus highlighted for the jury. It also may have accepted Novellus’s representation that it had cooperated with its indemnity obligations to the extent • defined by section 2312(3), which did not include a requirement that it provide a defense to Linear.
However it arrived at its ultimate conclusion, the jury apparently believed that respondents’ products were not responsible for any harm arising from the TI lawsuit against Linear. By finding no breach of the statutory warranty by either TEL or Novellus, the jury implicitly found either that Linear had failed to prove the merit of TI’s claims against Linear or that these claims had had no “significant and adverse effect” on Linear’s ability to use respondents’ machines. (Pacific Sunwear, supra, 167 Cal.App.4th at p. 470.)
Linear’s assertion of error in the denial of its JNOV motion can succeed only if we discredit or disregard the testimony of respondents’ witnesses and accept only that of Linear’s witnesses. Neither of these approaches to the evidence is consistent with our function on appeal. As noted earlier, we must view the evidence and resolve all factual conflicts in the light most favorable to the verdict, and we may not reweigh the evidence or judge the credibility of witnesses unless their testimony is “inherently improbable or clearly false.” (Crabtree v. Western Pac. R. Co. (1939) 33 Cal.App.2d 35, 41 [90 P.2d 835].) The record demonstrates that the essential facts were not uncontested, as Linear represents on appeal. Having reviewed the transcript of the trial, and recognizing that it was the exclusive province of the jury to determine the weight and sufficiency of the evidence, we cannot find a basis for overturning the verdict. The trial court did not err in denying the motion for JNOV.
2. Attorney Fees
Linear next contends that respondents were not entitled to attorney fees because there was no contract provision that would have allowed either side *1535to recover those fees upon prevailing in the action. Respondents maintain that if Linear had prevailed in its contract claims, it would have been entitled to attorney fees; consequently, fees were recoverable by respondents under the reciprocity principles expressed in Civil Code section 1717. We agree with respondents.
Civil Code section 1717 (section 1717), the dispositive statutory provision here, states, in pertinent part: “In 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.”
“The primary purpose of section 1717 is to ensure mutuality of remedy for attorney fee claims under contractual attorney fee provisions.” (Santisas v. Goodin (1998) 17 Cal.4th 599, 610 [71 Cal.Rptr.2d 830, 951 P.2d 399] (Santisas); see Sessions Payroll Management, Inc. v. Noble Construction Co. (2000) 84 Cal.App.4th 671, 678 [101 Cal.Rptr.2d 127] (Sessions).) “It is now settled that a party is entitled to attorney fees under section 1717 ‘even when the party prevails on grounds the contract is inapplicable, invalid, unenforceable or nonexistent, if the other party would have been entitled to attorney’s fees had it prevailed.’ [Citations.]” (Hsu v. Abbara (1995) 9 Cal.4th 863, 870 [39 Cal.Rptr.2d 824, 891 P.2d 804].) “If section 1717 did not apply in this situation, the right to attorney fees would be effectively unilateral— regardless of the reciprocal wording of the attorney fee provision allowing attorney fees to the prevailing attorney—because only the party seeking to affirm and enforce the agreement could invoke its attorney fee provision. To ensure mutuality of remedy in this situation, it has been consistently held that when a party litigant prevails in an action on a contract by establishing that the contract is invalid, inapplicable, unenforceable, or nonexistent, section 1717 permits that party’s recovery of attorney fees whenever the opposing parties would have been entitled to attorney fees under the contract had they prevailed.” (Santisas, supra, 17 Cal.4th at p. 611; see Hsu v. Abbara, supra, 9 Cal.4th at pp. 870-871.) Whether a legal basis exists for an award of attorney fees is a question of law, which the reviewing court examines de novo. (Sessions, supra, 84 Cal.App.4th at p. 677.)
Linear contends that it would not have been entitled to contractual attorney fees had it prevailed, because the parties had “stipulated” that certain standard terms in Linear’s purchase orders, including an attorney fees clause, were not a part of the parties’ contracts. According to respondents, however, had Linear prevailed, it would have recovered attorney fees because it requested them in its fifth amended complaint and sought to prove them at trial. Linear *1536nonetheless maintains that it makes no difference that it advanced that position; if it was in fact not entitled to the claimed fees, then neither it nor respondents could recover them.
The factual premise of Linear’s position is unsupported by the record: Linear did not stipulate to the nonexistence of the attorney fees clause. In its trial brief, Linear argued that there was no “battle of the forms” between it and respondents, and that Novellus had accepted the standard terms and conditions set forth in Linear’s purchase order, without any exclusion of the attorney fees clause in that purchase order.3 In opposition to respondents’ motion for nonsuit Linear argued that it was “for the trier of fact to determine whether the breaches of contract that are proven here justify an award of damages . ...” In response to the court’s question about whether the contracts contained indemnity provisions, Linear again stated that it was “for the jury to decide on what terms the parties agreed or not.” The court, however, observed that no evidence had been adduced relating to the parties’ understanding as to “whose terms and conditions would apply.”
At the conclusion of this discussion the court determined that “each side assumed . . . that their terms and conditions would apply.” At least with respect to Novellus, there had been “a classic battle of the forms” with certain terms and conditions in conflict. As to those terms and conditions, the court applied California Uniform Commercial Code section 2207 and ruled that where the parties’ versions disagreed, the affected terms “drop out.” The court later confirmed this determination before submitting the case to the jury. It further observed that the consensus of the parties appeared to be that “there was nothing in the forms that was relevant or material to this case that remained in.” As to the provision for attorney fees in Linear’s purchase order, the court stated that there was no such term in respondents’ version; “and therefore, there was no agreement or meeting of the minds as to the recovery of attorney’s fees by any party in the event of any dispute.” The parties all agreed that the jury would be so instructed; but counsel for Novellus qualified his acceptance by explaining that Novellus was retaining its claim for attorney fees should it prevail at trial. The court responded that it “just wanted to make clear that we’re not going to have a[n] argument down the road . . . that an attorney’s fees clause was a part of this contract.” The court subsequently instructed the jury that notwithstanding the testimony about *1537“standard terms and conditions each party proposed for the contracts,” none of those terms and conditions became part of the contract between either Novellus or TEL.4
In the discussion over the elimination of the conflicting contract terms, the court commented that whether respondents “might be entitled to attorney fees down the road because the plaintiff sued and plead[ed] a request for attorney’s fees is another question.” That question arose after trial, when both Novellus and TEL claimed attorney fees for their defense. Both argued that Linear would have obtained attorney fees if it had succeeded in showing that the terms of its purchase order became part of the contracts, and both claimed fees for all causes of action, even those alleging fraud and unfair competition.5 In the ensuing orders the court awarded fees for pretrial proceedings as well as for the trial and (for TEL) posttrial work. As noted earlier, TEL received $3,154,498, while Novellus received $5,200,931.62.6
Linear relies on this court’s decision in Blickman Turkus, LP v. MF Downtown Sunnyvale, LLC (2008) 162 Cal.App.4th 858 [76 Cal.Rptr.3d 325], but its reliance is misplaced. In Blickman, the prevailing defendant’s motion for fees was properly denied because the plaintiff, had it prevailed, would not have been entitled to fees. The only fee provision applied to litigation between the signatories to the contract, which were Mozart and its broker, CPS. The actual litigation, however, was between Blickman and Mozart; CPS was not a litigant. Because the fee clause did not apply to this litigation, Blickman could not have obtained attorney fees had he prevailed against Mozart, and the reciprocity function of section 1717 was inapplicable. In the case before us, however, the contract Linear sought to enforce did contain an attorney fee provision. There is no dispute here over the application of that provision to nonsignatories, as the term was part of the purchase order for each defendant in the litigation.
Brittalia Ventures v. Stuke Nursery Co., Inc. (2007) 153 Cal.App.4th 17 [62 Cal.Rptr.3d 467] is also distinguishable. There the plaintiff, a walnut farmer, prevailed in his contract action against a supplier who had sold it infected trees. The plaintiff was not entitled to the fees the court awarded it because the contract on which it sued did not contain an attorney fee clause. It is true that the plaintiff in Brittalia invoked a superficially similar rationale to that of respondents, by pointing out that had the defendant prevailed instead, the contract on which it relied did contain such a provision. But it was Brittalia, *1538the plaintiff, that brought the action, and the contract it sought to enforce would not have allowed it to recover fees. Had the defendant succeeded, there was no mutuality of remedy it could have invoked under section 1717. (153 Cal.App.4th at p. 31.) Here, by contrast, if Linear had prevailed, the contract on which it sought recovery did contain such a provision.
Linear’s assertion that there must be not merely an allegation of the right to fees but a showing that it “actually” and “clearly” would have been entitled to fees, diverts the analysis from its proper course. First, Linear went beyond merely praying for attorney fees in its complaint; it attempted to establish that the purchase order contained the terms of the parties’ contracts, and this purchase order included the fee provision. Second, the question before us is not whether Linear would have been able to prove that the attorney fee clause in the purchase order became part of the parties’ contract, but whether the contract it sought to enforce contained such a clause. Unquestionably it did. A prevailing defendant should not be required to undergo a minitrial to establish the merit of the losing plaintiff’s hypothetical fee claim under the contract on which the plaintiff sued.
M. Perez Co., Inc. v. Base Camp Condominiums Ass'n No. One (2003) 111 Cal.App.4th 456 [3 Cal.Rptr.3d 563] and Bear Creek Planning Committee v. Ferwerda (2011) 193 Cal.App.4th 1178 [122 Cal.Rptr.3d 304] (Ferwerda) do not instruct otherwise. In M. Perez the Third District reaffirmed the rule that a prevailing defendant may recover attorney fees only if it can demonstrate that it would have been hable for fees if the plaintiff had prevailed. (111 Cal.App.4th at p. 467.) The key point of inquiry is whether the dispute is over the existence or validity of tire contract or instead is over only the allegation of breach. In the latter case, where the defendant is not challenging the existence of an attorney fee provision but only disputes the allegation of breach, a prevailing party does not obtain fees if the contract contains no such provision. On the other hand, if the plaintiff relies on a contract that does contain a fee provision and the defendant successfully challenges the applicability of that contract or its fee clause, then that defendant is entitled to its fees, as the plaintiff would have been had it prevailed. In short, “[w]here a plaintiff claims breach of a contract containing an attorney fee provision and the defendant asserts there is no contract and wins, it will have established that there is no contract and, hence, no attorney fee provision. Nevertheless, since the plaintiff would have been entitled to attorney fees if the plaintiff had succeeded in proving there was a contract, courts have recognized a right of the defendant to recover attorney fees even if [the] defendant proves there was no contract, in order to further the purposes of Civil Code section 1717.” {Ibid.) The trial court’s grant of fees to Novellus and TEL is fully consistent with this reasoning.
*1539Ferwerda was decided by the same court as M. Perez. In Ferwerda the plaintiff sued a planning committee, his neighbors, and others for blocking construction of a home on his lot. Although he requested attorney fees in his complaint, there was no fee provision in the covenants, conditions and restrictions, nor was there anything in that document allowing the planning committee to authorize such fees by inserting new provisions in other homeowner materials. That the plaintiff asked for fees in his complaint did not in itself create a basis for a fee award to any prevailing party. Thus, unlike Linear, Ferwerda could not have obtained attorney fees even if he had prevailed, as there was no provision for them in any applicable documents.
Here, as we have discussed, the parties each litigated the scope of their respective contracts. Linear’s position that the purchase order defined the agreements, had it been successful, would have entitled Linear to attorney fees from respondents. The reciprocity principles underlying section 1717 require imposition of the same burden on Linear.
Disposition
The judgment and postjudgment order are affirmed.
Rushing, R J., and Premo, L, concurred.
A petition for a rehearing was denied December 19, 2011, and appellant’s petition for review by the Supreme Court was denied February 15, 2012, S199105.
Novellus represents that Linear settled with Applied Materials in 2008.
Linear has referred to the Mark 7/8, but the trial testimony indicates that there were two separate machines. The Mark Vz is a faster version of the Mark V.
The attorney fees provision on which Linear sought recovery stated: “In any suit or action brought to enforce any term, condition or covenant herein, or to recover damages arising from any breach of this contract, the losing party [shall pay] reasonable attorneys’ fees and all other costs and expenses which may be incurred by the prevailing party in any suit or action and in any reviews thereof and appeals therefrom.”
The court took the nonsuit motion under submission with respect to the causes of action for breach of contract and breach of the covenant of good faith and fair dealing.
Those were the claims for which we upheld the dismissal in Linear Technology Corp. v. Applied Materials, Inc., supra, 152 Cal.App.4th 115.
On appeal, Linear does not contest the amounts awarded to either of the respondents.