From 85d85f741a8dde108447fea4417a5f4c063746fc Mon Sep 17 00:00:00 2001 From: Neil Deakin Date: Mon, 4 May 2009 10:55:41 -0400 Subject: [PATCH 1/3] Bug 488084, set mCurPos when slider frame is initialized, so that it is set properly, r+sr=neil --- layout/xul/base/src/nsSliderFrame.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/layout/xul/base/src/nsSliderFrame.cpp b/layout/xul/base/src/nsSliderFrame.cpp index cec7d707de10..bea60f99b2a4 100644 --- a/layout/xul/base/src/nsSliderFrame.cpp +++ b/layout/xul/base/src/nsSliderFrame.cpp @@ -120,6 +120,8 @@ nsSliderFrame::Init(nsIContent* aContent, gSnapMultiplier = nsContentUtils::GetIntPref("slider.snapMultiplier"); } + mCurPos = GetCurrentPosition(aContent); + CreateViewForFrame(PresContext(), this, GetStyleContext(), PR_TRUE); return rv; } From 473b9cecef6b9637d70ea4e28707a4c44d396e54 Mon Sep 17 00:00:00 2001 From: Neil Deakin Date: Mon, 4 May 2009 10:55:44 -0400 Subject: [PATCH 2/3] Bug 378893, xul template tests, r=smaug --- .../xul/templates/tests/chrome/Makefile.in | 203 ++++++++++++++++++ toolkit/toolkit-makefiles.sh | 2 + 2 files changed, 205 insertions(+) diff --git a/content/xul/templates/tests/chrome/Makefile.in b/content/xul/templates/tests/chrome/Makefile.in index 856c86b39d48..caae5e9f93d1 100644 --- a/content/xul/templates/tests/chrome/Makefile.in +++ b/content/xul/templates/tests/chrome/Makefile.in @@ -46,6 +46,209 @@ include $(topsrcdir)/config/rules.mk _TEST_FILES = \ test_bug476634.xul \ + templates_shared.js \ + animals.rdf \ + animals.xml \ + animals.sqlite \ + test_tmpl_bindingsextendedsyntax.xul \ + test_tmpl_bindingsmultiple.xul \ + test_tmpl_bindingsquerysyntax.xul \ + test_tmpl_bindingsreversed.xul \ + test_tmpl_bindingssameastriple.xul \ + test_tmpl_containerandmembervariablechanged.xul \ + test_tmpl_containervariablechanged.xul \ + test_tmpl_containmentattribute.xul \ + test_tmpl_defaultcontainervariableisuri.xul \ + test_tmpl_extendedsyntaxemptyconditions.xul \ + test_tmpl_extendedsyntaxotherrefvariable.xul \ + test_tmpl_extendedsyntaxremoveunmatched.xul \ + test_tmpl_extendedsyntaxsimplevariablesubstitution.xul \ + test_tmpl_extendedsyntaxtworulesrecurse.xul \ + test_tmpl_extendedsyntaxusinganinterveningcontainer.xul \ + test_tmpl_extendedsyntax.xul \ + test_tmpl_extendedvariablesubstitution.xul \ + test_tmpl_gridelement.xul \ + test_tmpl_htmlelementextendedsyntaxwithbinding.xul \ + test_tmpl_htmlelementquerysyntaxrecursive.xul \ + test_tmpl_htmlelementquerysyntaxwithmultiplerules.xul \ + test_tmpl_htmlelementsimplesyntaxusingatextnode.xul \ + test_tmpl_htmlelementsimplesyntax.xul \ + test_tmpl_listboxelement.xul \ + test_tmpl_literalasmember.xul \ + test_tmpl_membervariablechanged.xul \ + test_tmpl_membervariablesubstitution.xul \ + test_tmpl_menuelementrecursive.xul \ + test_tmpl_menuelement.xul \ + test_tmpl_menulistelement.xul \ + test_tmpl_mixedsyntaxiscontainerisempty.xul \ + test_tmpl_mixedsyntaxiscontainer.xul \ + test_tmpl_mixedsyntaxisempty.xul \ + test_tmpl_noactionuriattribute.xul \ + test_tmpl_noaction.xul \ + test_tmpl_parentconditions.xul \ + test_tmpl_parentcontenttag.xul \ + test_tmpl_parentsimplesyntax.xul \ + test_tmpl_query3tripleswherecontains.xul \ + test_tmpl_query3triples.xul \ + test_tmpl_querymember3tripleswhereequals.xul \ + test_tmpl_querymemberandtwotriples.xul \ + test_tmpl_querymembertriplemembertriple.xul \ + test_tmpl_queryresourcematch.xul \ + test_tmpl_queryreversetriple.xul \ + test_tmpl_queryselfwithtriple.xul \ + test_tmpl_querysetone.xul \ + test_tmpl_querysettwowithcondition.xul \ + test_tmpl_querysettwo.xul \ + test_tmpl_querysyntaxmultiplerulesfirstconditionall.xul \ + test_tmpl_querysyntaxmultiplerulestwoconditions.xul \ + test_tmpl_querysyntaxmultiplerules.xul \ + test_tmpl_querysyntax.xul \ + test_tmpl_querytripleandmembermerge.xul \ + test_tmpl_querytripleobjecttosubject.xul \ + test_tmpl_querytwomembersfiltered.xul \ + test_tmpl_querytwomembers.xul \ + test_tmpl_querytwotriples.xul \ + test_tmpl_queryupwardsmember.xul \ + test_tmpl_queryupwardsmembertripleandfilteringtriple.xul \ + test_tmpl_querywithemptyconditions.xul \ + test_tmpl_referenceasmember.xul \ + test_tmpl_selfgenerationextendedsyntax.xul \ + test_tmpl_selfgenerationsimplesyntax.xul \ + test_tmpl_simplesyntaxenclosedinacontainerwitharule.xul \ + test_tmpl_simplesyntaxenclosedinacontainer.xul \ + test_tmpl_simplesyntaxiteratingoverasinglevalue.xul \ + test_tmpl_simplesyntaxusinganinterveningcontainer.xul \ + test_tmpl_simplesyntaxusingatextnode.xul \ + test_tmpl_simplesyntaxusingcontainerasthegenerationelement.xul \ + test_tmpl_simplesyntaxusingdontrecurse.xul \ + test_tmpl_simplesyntaxusingrecursivegenerationagain.xul \ + test_tmpl_simplesyntaxusingrecursivegeneration.xul \ + test_tmpl_simplesyntaxwithtwovariablesused.xul \ + test_tmpl_simplevariablesubstitutioncaretsatbeginningandend.xul \ + test_tmpl_simplevariablesubstitutioncaretsubstitution.xul \ + test_tmpl_simplevariablesubstitutionnovariable.xul \ + test_tmpl_simplevariablesubstitutionquestionmarkaspartofvariable.xul \ + test_tmpl_simplevariablesubstitutionquestionmarksubstitution.xul \ + test_tmpl_simplevariablesubstitutiontextandvariable.xul \ + test_tmpl_simplevariablesubstitutionvariableandtextconcatenated.xul \ + test_tmpl_simplevariablesubstitutionvariablesconcatenated.xul \ + test_tmpl_simplesyntaxfilterwithmultiplerules.xul \ + test_tmpl_simplesyntaxfilterwithrule.xul \ + test_tmpl_simplesyntaxfilter.xul \ + test_tmpl_sortascendingquerysyntax.xul \ + test_tmpl_sortdescendingquerysyntax.xul \ + test_tmpl_sortunknownascendingquerysyntax.xul \ + test_tmpl_sortresourceascendingquerysyntax.xul \ + test_tmpl_sortresourcedescendingquerysyntax.xul \ + test_tmpl_sortresourcesettopredicateascendingquerysyntax.xul \ + test_tmpl_sortresourcesettopredicatedescendingquerysyntax.xul \ + test_tmpl_sortresource2settopredicateascendingquerysyntax.xul \ + test_tmpl_sortresource2settopredicatedescendingquerysyntax.xul \ + test_tmpl_sorttworesourcessettopredicateascendingquerysyntax.xul \ + test_tmpl_sorttworesourcesasstringsettopredicatedescendingquerysyntax.xul \ + test_tmpl_sorttwovariablesascendingquerysyntax.xul \ + test_tmpl_sorttwovariablesascendingsimplesyntax.xul \ + test_tmpl_sorttwovariablesdescendingquerysyntax.xul \ + test_tmpl_sortresource2descendingsimplesyntax.xul \ + test_tmpl_sortascendingtworulesquerysyntax.xul \ + test_tmpl_sortascendingtworuleswithcontainerquerysyntax.xul \ + test_tmpl_sortascendingtworuleswithdifferentcontainerquerysyntax.xul \ + test_tmpl_sortquerymemberandtwotriples.xul \ + test_tmpl_storage_baddatasource.xul \ + test_tmpl_storage_badquery.xul \ + test_tmpl_storage_dynamicparameters.xul \ + test_tmpl_storage_listbox.xul \ + test_tmpl_storage_multiqueries.xul \ + test_tmpl_storage_parameters.xul \ + test_tmpl_storage_rule.xul \ + test_tmpl_storage_simple.xul \ + test_tmpl_storage_sortintegerasc.xul \ + test_tmpl_storage_sortintegerdesc.xul \ + test_tmpl_storage_sortstringasc.xul \ + test_tmpl_storage_sortstringdesc.xul \ + test_tmpl_storage_tree.xul \ + test_tmpl_twogenerationnodes.xul \ + test_tmpl_treeelementquerysyntaxtreebuilder.xul \ + test_tmpl_treeelementquerysyntax.xul \ + test_tmpl_treeelementsimplesyntaxrecursivetreebuilder.xul \ + test_tmpl_treeelementsimplesyntaxrecursive.xul \ + test_tmpl_treeelementsimplesyntaxnotrecursivetreebuilder.xul \ + test_tmpl_treeelementsimplesyntaxnotrecursive.xul \ + test_tmpl_treeelementquerysyntaxrecursivetreebuilder.xul \ + test_tmpl_treeelementquerysyntaxrecursive.xul \ + test_tmpl_treeelementquerysyntaxnotrecursivetreebuilder.xul \ + test_tmpl_treeelementquerysyntaxnotrecursive.xul \ + test_tmpl_treeelementquerysyntaxrecursivemultiplerulestreebuilder.xul \ + test_tmpl_treeelementquerysyntaxrecursivemultiplerules.xul \ + test_tmpl_treeelementtreecell.xul \ + test_tmpl_treeelementtreecelltreebuilder.xul \ + test_tmpl_treeelementtreecellsortascending.xul \ + test_tmpl_treeelementtreecellsortascendingtreebuilder.xul \ + test_tmpl_treeelementtreeitemonly.xul \ + test_tmpl_treeelementtreeitemsortascending.xul \ + test_tmpl_whereequals.xul \ + test_tmpl_whereequalswrongcase.xul \ + test_tmpl_whereequalssamevariable.xul \ + test_tmpl_wheresubjectequalsvariable.xul \ + test_tmpl_wherestartswith.xul \ + test_tmpl_wherestartswithvariable.xul \ + test_tmpl_wherestartswithunknownvariable.xul \ + test_tmpl_wheresubjectstartswithvariable.xul \ + test_tmpl_whereendswith.xul \ + test_tmpl_wherecontains.xul \ + test_tmpl_wherebeforeuppercase.xul \ + test_tmpl_wherebeforelowercase.xul \ + test_tmpl_whereafteruppercase.xul \ + test_tmpl_whereafterlowercase.xul \ + test_tmpl_whereequalsignorecase.xul \ + test_tmpl_wherestartswithignorecase.xul \ + test_tmpl_whereendswithignorecase.xul \ + test_tmpl_wherecontainsignorecase.xul \ + test_tmpl_wherebeforeignorecase.xul \ + test_tmpl_whereafterignorecase.xul \ + test_tmpl_whereequalsmultiple.xul \ + test_tmpl_wherestartswithmultiple.xul \ + test_tmpl_whereequalsnegation.xul \ + test_tmpl_whereequalsnegationwrongcase.xul \ + test_tmpl_whereequalsnegationignorecase.xul \ + test_tmpl_whereequalsmultiplenegation.xul \ + test_tmpl_whereequalsmultiplenegationignorecase.xul \ + test_tmpl_wherestartswithnegation.xul \ + test_tmpl_whereendswithnegation.xul \ + test_tmpl_wherecontainsnegation.xul \ + test_tmpl_wherebeforenegation.xul \ + test_tmpl_whereafternegation.xul \ + test_tmpl_wherenorel.xul \ + test_tmpl_wherenovalue.xul \ + test_tmpl_wherenosubject.xul \ + test_tmpl_whereequalsresource.xul \ + test_tmpl_wherecontainsresource.xul \ + test_tmpl_wherecontainstwo.xul \ + test_tmpl_whereequalsothervariable.xul \ + test_tmpl_wheregreater.xul \ + test_tmpl_whereless.xul \ + test_tmpl_wheregreaternegation.xul \ + test_tmpl_wherelessnegation.xul \ + test_tmpl_whereequalsnumber.xul \ + test_tmpl_wherecontainsnumber.xul \ + test_tmpl_wheregreaterstring.xul \ + test_tmpl_wherelessstring.xul \ + test_tmpl_wheregreaternegationstring.xul \ + test_tmpl_wherelessnegationstring.xul \ + test_tmpl_wherecontainsnumberstring.xul \ + test_tmpl_xmlquerysimple.xul \ + test_tmpl_xmlquerywithdifferentmember.xul \ + test_tmpl_xmlquerywithassign.xul \ + test_tmpl_xmlquerywithassignmentandcondition.xul \ + test_tmpl_xmlquerywithassignmentandconditiondontrecurse.xul \ + test_tmpl_xmlquerywithbindinginbindings.xul \ + test_tmpl_xmlquerywithbindinginrule.xul \ + test_tmpl_xmlquerywithsort.xul \ + test_tmpl_xmlquerywithsortotherfield.xul \ + test_tmpl_xmlquerywithmultiplequeries.xul \ + test_tmpl_xmlquerywithothertypes.xul \ + test_tmpl_xmlquerywithinlinedata.xul \ + test_tmpl_xmlquerywithinlinedatawithmultiplequeries.xul \ $(NULL) libs:: $(_TEST_FILES) diff --git a/toolkit/toolkit-makefiles.sh b/toolkit/toolkit-makefiles.sh index 0bab4b0253db..1a038a3e6a03 100644 --- a/toolkit/toolkit-makefiles.sh +++ b/toolkit/toolkit-makefiles.sh @@ -222,6 +222,8 @@ MAKEFILES_content=" content/xul/document/src/Makefile content/xul/templates/public/Makefile content/xul/templates/src/Makefile + content/xul/templates/tests/Makefile + content/xul/templates/tests/chrome/Makefile content/xbl/Makefile content/xbl/public/Makefile content/xbl/src/Makefile From f66fc316264532c1dd409427590750994125767f Mon Sep 17 00:00:00 2001 From: Neil Deakin Date: Mon, 4 May 2009 10:55:47 -0400 Subject: [PATCH 3/3] Bug 374288, don't open tooltips on items in a menu when the listener is outside of it, r+sr=neil --- layout/xul/base/src/nsXULTooltipListener.cpp | 28 +++++++++++++++----- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/layout/xul/base/src/nsXULTooltipListener.cpp b/layout/xul/base/src/nsXULTooltipListener.cpp index 866e0c002551..bbe2d7d310c0 100644 --- a/layout/xul/base/src/nsXULTooltipListener.cpp +++ b/layout/xul/base/src/nsXULTooltipListener.cpp @@ -227,7 +227,7 @@ nsXULTooltipListener::MouseMove(nsIDOMEvent* aMouseEvent) nsCOMPtr eventTarget; aMouseEvent->GetCurrentTarget(getter_AddRefs(eventTarget)); - + nsCOMPtr sourceContent = do_QueryInterface(eventTarget); mSourceNode = do_GetWeakReference(sourceContent); #ifdef MOZ_XUL @@ -240,17 +240,33 @@ nsXULTooltipListener::MouseMove(nsIDOMEvent* aMouseEvent) // so that the delay is from when the mouse stops moving, not when it enters // the node. KillTooltipTimer(); - + // If the mouse moves while the tooltip is up, hide it. If nothing is // showing and the tooltip hasn't been displayed since the mouse entered // the node, then start the timer to show the tooltip. if (!currentTooltip && !mTooltipShownOnce) { + // don't show tooltips attached to elements outside of a menu popup + // when hovering over an element inside it. + nsCOMPtr eventTarget; + aMouseEvent->GetTarget(getter_AddRefs(eventTarget)); + nsCOMPtr targetContent = do_QueryInterface(eventTarget); + while (targetContent && targetContent != sourceContent) { + nsIAtom* tag = targetContent->Tag(); + if (targetContent->GetNameSpaceID() == kNameSpaceID_XUL && + (tag == nsGkAtoms::menupopup || + tag == nsGkAtoms::panel || + tag == nsGkAtoms::tooltip)) { + mSourceNode = nsnull; + return NS_OK; + } + + targetContent = targetContent->GetParent(); + } + mTooltipTimer = do_CreateInstance("@mozilla.org/timer;1"); if (mTooltipTimer) { - aMouseEvent->GetTarget(getter_AddRefs(eventTarget)); - nsCOMPtr targetNode = do_QueryInterface(eventTarget); - mTargetNode = do_GetWeakReference(targetNode); - if (targetNode) { + mTargetNode = do_GetWeakReference(eventTarget); + if (mTargetNode) { nsresult rv = mTooltipTimer->InitWithFuncCallback(sTooltipCallback, this, kTooltipShowTime, nsITimer::TYPE_ONE_SHOT); if (NS_FAILED(rv)) {