mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-08 12:22:34 +00:00
Bug 899931 - Part i: Inline nsListControlFrame::GetSizeAttribute; r=dzbarsky
This commit is contained in:
parent
6e35ea5ed5
commit
e56febfa3e
@ -931,20 +931,6 @@ nsListControlFrame::SetInitialChildList(ChildListID aListID,
|
||||
return rv;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------
|
||||
nsresult
|
||||
nsListControlFrame::GetSizeAttribute(uint32_t *aSize) {
|
||||
nsresult rv = NS_OK;
|
||||
nsIDOMHTMLSelectElement* selectElement;
|
||||
rv = mContent->QueryInterface(NS_GET_IID(nsIDOMHTMLSelectElement),(void**) &selectElement);
|
||||
if (mContent && NS_SUCCEEDED(rv)) {
|
||||
rv = selectElement->GetSize(aSize);
|
||||
NS_RELEASE(selectElement);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------
|
||||
void
|
||||
nsListControlFrame::Init(nsIContent* aContent,
|
||||
@ -1543,8 +1529,13 @@ nsListControlFrame::CalcIntrinsicHeight(nscoord aHeightOfARow,
|
||||
NS_PRECONDITION(!IsInDropDownMode(),
|
||||
"Shouldn't be in dropdown mode when we call this");
|
||||
|
||||
mNumDisplayRows = 1;
|
||||
GetSizeAttribute(&mNumDisplayRows);
|
||||
dom::HTMLSelectElement* select =
|
||||
dom::HTMLSelectElement::FromContentOrNull(mContent);
|
||||
if (select) {
|
||||
mNumDisplayRows = select->Size();
|
||||
} else {
|
||||
mNumDisplayRows = 1;
|
||||
}
|
||||
|
||||
if (mNumDisplayRows < 1) {
|
||||
mNumDisplayRows = 4;
|
||||
|
@ -305,9 +305,6 @@ protected:
|
||||
nsListControlFrame(nsIPresShell* aShell, nsIDocument* aDocument, nsStyleContext* aContext);
|
||||
virtual ~nsListControlFrame();
|
||||
|
||||
// Utility methods
|
||||
nsresult GetSizeAttribute(uint32_t *aSize);
|
||||
|
||||
/**
|
||||
* Sets the mSelectedIndex and mOldSelectedIndex from figuring out what
|
||||
* item was selected using content
|
||||
|
Loading…
Reference in New Issue
Block a user