Closed Bug 306160 Opened 19 years ago Closed 19 years ago

nsIDOMXULMenuListElement::GetInputField does not work for editable <menulist>

Categories

(Core :: XUL, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: MatsPalmgren_bugz, Assigned: neil)

Details

(Keywords: testcase)

Attachments

(3 files)

Spawned off from bug 305840 comment 28.

STEPS TO REPRODUCE
1. Add the flollowing block of code at a suitable place, for exmple in
the XUL part of IsFocusable() in nsEventStateManager.cpp:

printf("XUL focusFrame=%p aContent=%p\n", focusFrame, aContent);
if (1) {
  printf(" ++++++++++++++++++++++++++++++++++++++++\n");
  nsIFrame* f = focusFrame->GetParent();
  nsIFrameDebug* fdbg;
  f->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**) &fdbg);
  if (fdbg)
    fdbg->List(f->GetPresContext(), stdout, 0);
  printf(" ----------------------------------------\n");
}

if (1) {
    nsCOMPtr<nsIDOMXULMenuListElement> menulist = do_QueryInterface(aContent);
    if (menulist) {
      printf("aContent implements nsIDOMXULMenuListElement\n");
      nsCOMPtr<nsIDOMXULTextBoxElement> textbox;
      menulist->GetInputField(getter_AddRefs(textbox));
      nsCOMPtr<nsIContent> input = do_QueryInterface(textbox);
      printf("menulist->GetInputField() => textbox=%p textbox.content=%p\n",
             textbox.get(), input.get());
    }
}

You need to include these too:
#include <nsIDOMXULMenuListElement.h>
#include <nsIFrameDebug.h>

2. Compile and then run the attached testcase and type ALT+M.

ACTUAL RESULTS
See attached trace file.

EXPECTED RESULTS
A non-null textbox.
Attached file Testcase
Attached file Trace log
Attached patch Proposed patchSplinter Review
Oddly enough, there are no consumers of this method to fix ;-)
Assignee: nobody → neil.parkwaycc.co.uk
Status: NEW → ASSIGNED
Attachment #194068 - Flags: superreview?(bzbarsky)
Attachment #194068 - Flags: review?(mats.palmgren)
Comment on attachment 194068 [details] [diff] [review]
Proposed patch

r=mats

Does nsIDOMXULTreeElement need the same fix?
Attachment #194068 - Flags: review?(mats.palmgren) → review+
Attachment #194068 - Flags: superreview?(bzbarsky) → superreview+
Fix checked in.

(In reply to comment #4)
>Does nsIDOMXULTreeElement need the same fix?
We'll find out if anyone ever implements it ...
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: