From 609f3449c846a73a16041dec106ea2962ce571f8 Mon Sep 17 00:00:00 2001 From: "joshmoz@gmail.com" Date: Tue, 22 May 2007 12:42:01 -0700 Subject: [PATCH] Don't paint the background for the text frame in comboboxes if the combobox is themed. b=381268 r/sr=roc --- layout/forms/nsComboboxControlFrame.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index 3b5ca356522..3d32f3c9371 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -1078,6 +1078,10 @@ public: const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); + NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder, + const nsRect& aDirtyRect, + const nsDisplayListSet& aLists); + protected: nsComboboxControlFrame* mComboBox; }; @@ -1111,6 +1115,26 @@ nsComboboxDisplayFrame::Reflow(nsPresContext* aPresContext, return nsBlockFrame::Reflow(aPresContext, aDesiredSize, state, aStatus); } +NS_IMETHODIMP +nsComboboxDisplayFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, + const nsRect& aDirtyRect, + const nsDisplayListSet& aLists) +{ + nsDisplayListCollection set; + nsresult rv = nsBlockFrame::BuildDisplayList(aBuilder, aDirtyRect, set); + if (NS_FAILED(rv)) + return rv; + + // remove background items if parent frame is themed + if (mComboBox->IsThemed()) { + set.BorderBackground()->DeleteAll(); + } + + set.MoveTo(aLists); + + return NS_OK; +} + nsIFrame* nsComboboxControlFrame::CreateFrameFor(nsIContent* aContent) {