зеркало из https://github.com/mozilla/gecko-dev.git
part 2 of fix for bug #25073, r=pink,evaughan, a=jevering
This commit is contained in:
Родитель
220a9eb77d
Коммит
c6871d4b8e
|
@ -309,14 +309,15 @@ nsMenuFrame::HandleEvent(nsIPresContext* aPresContext,
|
|||
// an un-checked radio menu
|
||||
if (mType == eMenuType_Checkbox ||
|
||||
(mType == eMenuType_Radio && !mChecked)) {
|
||||
nsAutoString checked;
|
||||
|
||||
if (mChecked)
|
||||
checked = "false";
|
||||
else
|
||||
checked = "true";
|
||||
mContent->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::checked, checked,
|
||||
if (mChecked) {
|
||||
mContent->UnsetAttribute(kNameSpaceID_None, nsHTMLAtoms::checked,
|
||||
PR_TRUE);
|
||||
}
|
||||
else {
|
||||
mContent->SetAttribute(kNameSpaceID_None, nsHTMLAtoms::checked, nsAutoString("true"),
|
||||
PR_TRUE);
|
||||
}
|
||||
|
||||
/* the AttributeChanged code will update all the internal state */
|
||||
}
|
||||
|
||||
|
@ -494,26 +495,6 @@ nsMenuFrame::AttributeChanged(nsIPresContext* aPresContext,
|
|||
} else if ( aAttribute == nsHTMLAtoms::type || aAttribute == nsHTMLAtoms::name )
|
||||
UpdateMenuType(aPresContext);
|
||||
|
||||
/* we need to reflow, if these change */
|
||||
if (aAttribute == nsHTMLAtoms::value ||
|
||||
aAttribute == nsXULAtoms::acceltext ||
|
||||
aAttribute == nsHTMLAtoms::type ||
|
||||
aAttribute == nsHTMLAtoms::checked) {
|
||||
|
||||
nsCOMPtr<nsIPresShell> shell;
|
||||
nsresult rv = aPresContext->GetShell(getter_AddRefs(shell));
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
nsCOMPtr<nsIReflowCommand> reflowCmd;
|
||||
rv = NS_NewHTMLReflowCommand(getter_AddRefs(reflowCmd), this,
|
||||
nsIReflowCommand::StyleChanged);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
shell->AppendReflowCommand(reflowCmd);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -684,7 +684,7 @@ nsMenuPopupFrame::SyncViewWithFrame(nsIPresContext* aPresContext,
|
|||
|
||||
nsAutoString shouldDisplay, menuActive;
|
||||
mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::menuactive, menuActive);
|
||||
if ( !menuActive.Equals("true") ) {
|
||||
if (menuActive != "true") {
|
||||
mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::menutobedisplayed, shouldDisplay);
|
||||
if ( shouldDisplay.Equals("true") )
|
||||
mContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::menuactive, "true", PR_TRUE);
|
||||
|
|
Загрузка…
Ссылка в новой задаче