зеркало из https://github.com/mozilla/pjs.git
Adde code to return the nsListControlFrame frame when adding frames to the combobox. This fixes Bug #11693
This commit is contained in:
Родитель
d242922f1f
Коммит
a37214ea4b
|
@ -855,6 +855,7 @@ nsCSSFrameConstructor::CreateInputFrame(nsIPresContext *aPresContext,
|
||||||
rv = ConstructButtonControlFrame(aPresContext, aFrame);
|
rv = ConstructButtonControlFrame(aPresContext, aFrame);
|
||||||
}
|
}
|
||||||
else if (val.EqualsIgnoreCase("image")) {
|
else if (val.EqualsIgnoreCase("image")) {
|
||||||
|
//rv = NS_NewGfxImageControlFrame(&aFrame);
|
||||||
rv = NS_NewImageControlFrame(&aFrame);
|
rv = NS_NewImageControlFrame(&aFrame);
|
||||||
}
|
}
|
||||||
else if (val.EqualsIgnoreCase("password")) {
|
else if (val.EqualsIgnoreCase("password")) {
|
||||||
|
@ -4520,19 +4521,41 @@ nsCSSFrameConstructor::GetFrameFor(nsIPresShell* aPresShell,
|
||||||
aPresShell->GetPrimaryFrameFor(aContent, &frame);
|
aPresShell->GetPrimaryFrameFor(aContent, &frame);
|
||||||
|
|
||||||
if (nsnull != frame) {
|
if (nsnull != frame) {
|
||||||
// If the primary frame is a scroll frame, then get the scrolled frame.
|
// Check to see if the content is a select and
|
||||||
// That's the frame that gets the reflow command
|
// then if it has a drop down (thus making it a combobox)
|
||||||
const nsStyleDisplay* display;
|
// The drop down is a ListControlFrame derived from a
|
||||||
frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display);
|
// nsScrollFrame then get the area frame and
|
||||||
|
// that will be the parent
|
||||||
|
nsCOMPtr<nsIDOMHTMLSelectElement> selectElement;
|
||||||
|
nsresult res = aContent->QueryInterface(nsCOMTypeInfo<nsIDOMHTMLSelectElement>::GetIID(),
|
||||||
|
(void**)getter_AddRefs(selectElement));
|
||||||
|
if (NS_SUCCEEDED(res) && selectElement) {
|
||||||
|
nsIComboboxControlFrame * comboboxFrame;
|
||||||
|
res = frame->QueryInterface(nsCOMTypeInfo<nsIComboboxControlFrame>::GetIID(),
|
||||||
|
(void**)&comboboxFrame);
|
||||||
|
if (comboboxFrame) {
|
||||||
|
nsIFrame * listFrame;
|
||||||
|
comboboxFrame->GetDropDown(&listFrame);
|
||||||
|
if (nsnull != listFrame) {
|
||||||
|
listFrame->FirstChild(nsnull, &frame);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
if (display->IsBlockLevel() && IsScrollable(aPresContext, display)) {
|
// If the primary frame is a scroll frame, then get the scrolled frame.
|
||||||
frame->FirstChild(nsnull, &frame);
|
// That's the frame that gets the reflow command
|
||||||
}
|
const nsStyleDisplay* display;
|
||||||
// if we get an outer table frame use its 1st child which is a table inner frame
|
frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display);
|
||||||
// if we get a table cell frame use its 1st child which is an area frame
|
|
||||||
else if ((NS_STYLE_DISPLAY_TABLE == display->mDisplay) ||
|
if (display->IsBlockLevel() && IsScrollable(aPresContext, display)) {
|
||||||
(NS_STYLE_DISPLAY_TABLE_CELL == display->mDisplay)) {
|
frame->FirstChild(nsnull, &frame);
|
||||||
frame->FirstChild(nsnull, &frame);
|
}
|
||||||
|
// if we get an outer table frame use its 1st child which is a table inner frame
|
||||||
|
// if we get a table cell frame use its 1st child which is an area frame
|
||||||
|
else if ((NS_STYLE_DISPLAY_TABLE == display->mDisplay) ||
|
||||||
|
(NS_STYLE_DISPLAY_TABLE_CELL == display->mDisplay)) {
|
||||||
|
frame->FirstChild(nsnull, &frame);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -855,6 +855,7 @@ nsCSSFrameConstructor::CreateInputFrame(nsIPresContext *aPresContext,
|
||||||
rv = ConstructButtonControlFrame(aPresContext, aFrame);
|
rv = ConstructButtonControlFrame(aPresContext, aFrame);
|
||||||
}
|
}
|
||||||
else if (val.EqualsIgnoreCase("image")) {
|
else if (val.EqualsIgnoreCase("image")) {
|
||||||
|
//rv = NS_NewGfxImageControlFrame(&aFrame);
|
||||||
rv = NS_NewImageControlFrame(&aFrame);
|
rv = NS_NewImageControlFrame(&aFrame);
|
||||||
}
|
}
|
||||||
else if (val.EqualsIgnoreCase("password")) {
|
else if (val.EqualsIgnoreCase("password")) {
|
||||||
|
@ -4520,19 +4521,41 @@ nsCSSFrameConstructor::GetFrameFor(nsIPresShell* aPresShell,
|
||||||
aPresShell->GetPrimaryFrameFor(aContent, &frame);
|
aPresShell->GetPrimaryFrameFor(aContent, &frame);
|
||||||
|
|
||||||
if (nsnull != frame) {
|
if (nsnull != frame) {
|
||||||
// If the primary frame is a scroll frame, then get the scrolled frame.
|
// Check to see if the content is a select and
|
||||||
// That's the frame that gets the reflow command
|
// then if it has a drop down (thus making it a combobox)
|
||||||
const nsStyleDisplay* display;
|
// The drop down is a ListControlFrame derived from a
|
||||||
frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display);
|
// nsScrollFrame then get the area frame and
|
||||||
|
// that will be the parent
|
||||||
|
nsCOMPtr<nsIDOMHTMLSelectElement> selectElement;
|
||||||
|
nsresult res = aContent->QueryInterface(nsCOMTypeInfo<nsIDOMHTMLSelectElement>::GetIID(),
|
||||||
|
(void**)getter_AddRefs(selectElement));
|
||||||
|
if (NS_SUCCEEDED(res) && selectElement) {
|
||||||
|
nsIComboboxControlFrame * comboboxFrame;
|
||||||
|
res = frame->QueryInterface(nsCOMTypeInfo<nsIComboboxControlFrame>::GetIID(),
|
||||||
|
(void**)&comboboxFrame);
|
||||||
|
if (comboboxFrame) {
|
||||||
|
nsIFrame * listFrame;
|
||||||
|
comboboxFrame->GetDropDown(&listFrame);
|
||||||
|
if (nsnull != listFrame) {
|
||||||
|
listFrame->FirstChild(nsnull, &frame);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
if (display->IsBlockLevel() && IsScrollable(aPresContext, display)) {
|
// If the primary frame is a scroll frame, then get the scrolled frame.
|
||||||
frame->FirstChild(nsnull, &frame);
|
// That's the frame that gets the reflow command
|
||||||
}
|
const nsStyleDisplay* display;
|
||||||
// if we get an outer table frame use its 1st child which is a table inner frame
|
frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display);
|
||||||
// if we get a table cell frame use its 1st child which is an area frame
|
|
||||||
else if ((NS_STYLE_DISPLAY_TABLE == display->mDisplay) ||
|
if (display->IsBlockLevel() && IsScrollable(aPresContext, display)) {
|
||||||
(NS_STYLE_DISPLAY_TABLE_CELL == display->mDisplay)) {
|
frame->FirstChild(nsnull, &frame);
|
||||||
frame->FirstChild(nsnull, &frame);
|
}
|
||||||
|
// if we get an outer table frame use its 1st child which is a table inner frame
|
||||||
|
// if we get a table cell frame use its 1st child which is an area frame
|
||||||
|
else if ((NS_STYLE_DISPLAY_TABLE == display->mDisplay) ||
|
||||||
|
(NS_STYLE_DISPLAY_TABLE_CELL == display->mDisplay)) {
|
||||||
|
frame->FirstChild(nsnull, &frame);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче