Bug 1372812 - stylo: Make nsListControlFrame::AboutToDropDown work in servo mode; r?emilio
MozReview-Commit-ID: JHzH6oqyu0K
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -1460,23 +1460,24 @@ nsListControlFrame::AboutToDropDown()
// get weird painting behaviour.
// We start looking for backgrounds above the combobox frame to avoid
// duplicating the combobox frame's background and compose each background
// color we find underneath until we have an opaque color, or run out of
// backgrounds. We compose with the PresContext default background color,
// which is always opaque, in case we don't end up with an opaque color.
// This gives us a very poor approximation of translucency.
nsIFrame* comboboxFrame = do_QueryFrame(mComboboxFrame);
- nsStyleContext* context = comboboxFrame->StyleContext()->GetParent();
+ nsIFrame* ancestor = comboboxFrame->GetParent();
mLastDropdownBackstopColor = NS_RGBA(0,0,0,0);
- while (NS_GET_A(mLastDropdownBackstopColor) < 255 && context) {
+ while (NS_GET_A(mLastDropdownBackstopColor) < 255 && ancestor) {
+ nsStyleContext* context = ancestor->StyleContext();
mLastDropdownBackstopColor =
NS_ComposeColors(context->StyleBackground()->BackgroundColor(context),
mLastDropdownBackstopColor);
- context = context->GetParent();
+ ancestor = ancestor->GetParent();
}
mLastDropdownBackstopColor =
NS_ComposeColors(PresContext()->DefaultBackgroundColor(),
mLastDropdownBackstopColor);
if (mIsAllContentHere && mIsAllFramesHere && mHasBeenInitialized) {
AutoWeakFrame weakFrame(this);
ScrollToIndex(GetSelectedIndex());