Open Bug 306162 Opened 19 years ago Updated 2 years ago

disabled="false" disables an editable <menulist> or <textbox> partly

Categories

(Core :: XUL, defect)

x86
Linux
defect

Tracking

()

People

(Reporter: MatsPalmgren_bugz, Unassigned)

Details

(Keywords: testcase)

Attachments

(2 files, 1 obsolete file)

1.46 KB, text/plain
Details
2.69 KB, application/vnd.mozilla.xul+xml
Details
Somewhat related to bug 305840 since nsXULElement::IsFocusable() uses it: http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/content/xul/content/src/nsXULElement.cpp&rev=1.579&root=/cvsroot&mark=692-695#685 STEPS TO REPRODUCE 1. Add the flollowing block of code at a suitable place, for example 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<nsIDOMXULControlElement> xulControl = do_QueryInterface(aContent); if (xulControl) { PRBool disabled = PR_FALSE; xulControl->GetDisabled(&disabled); printf("aContent implements nsIDOMXULControlElement, disabled=%d\n", disabled); } } You need to include these too: #include <nsIDOMXULMenuListElement.h> #include <nsIFrameDebug.h> ACTUAL RESULTS See attached trace file. EXPECTED RESULTS disabled=1
Attached file Testcase (obsolete) —
Attached file Trace log
Oh, I see that disabled="disabled" is probably invalid, it should be disabled="true". I still think there is a problem here since disabled="disabled" does not affect the menulist but it does make the inner textbox disabled.
Summary: nsIDOMXULControlElement::GetDisabled does not work for <menulist> → disabled="disabled" (sic) disables an editable <menulist> partly
Presumably <textbox disabled="disabled"> mostly disables the textbox (I'm not sure it appears disabled but at least it thinks it's disabled).
I guess we just forward the disabled attribute to the inner html:input verbatim and since disabled="disabled" is valid HTML it has an effect there but not on the menulist. Maybe we shouldn't forward invalid attribute values? Feel free to resolve as INVALID/WONTFIX.
Essentially the same occurs for <textbox> -- the outer textbox is not disabled (and thus focusable) and vice versa for the inner html:input. It's a bit confusing for a XUL novice like myself :-)
Severity: normal → minor
Summary: disabled="disabled" (sic) disables an editable <menulist> partly → disabled="disabled" (sic) disables an editable <menulist> or <textbox> partly
So, we're agreed that <textbox disabled="true"/> and <menulist editable="true" disabled="true"/> work as expected? We can probably make <textbox disabled="disabled"> do the right thing, but <menulist editable="true" disabled="disabled"> won't work without some native theme code fixes.
Severity: minor → normal
(In reply to comment #7) > So, we're agreed that <textbox disabled="true"/> and <menulist editable="true" > disabled="true"/> work as expected? Yes. But the bug also occurs for disabled="false" which I assume should work the same as "not specified". > We can probably make <textbox disabled="disabled"> do the right thing, Which is? According to http://www.xulplanet.com/references/elemref/ref_textbox.html#attr_disabled this attribute is of type "boolean" which I would assume means "true" or "false" but the text then goes on to say: "To enable the textbox, leave the attribute out entirely as opposed to setting the value to false." which I think is wrong. One should be able to specify disabled="false" IMHO. (Is the text there a direct reflection of this bug?) In HTML4 the value for the 'disabled' attribute is implied, so what we need to do is to map <textbox disabled="true"> to disabled="disabled" (or any value really) for the inner html:input and any other value (including "disabled") to an unspecified value.
Keywords: testcase
Summary: disabled="disabled" (sic) disables an editable <menulist> or <textbox> partly → disabled="false" disables an editable <menulist> or <textbox> partly
Attached file Testcase #2
Attachment #194025 - Attachment is obsolete: true
I was thinking that we just had to ensure that the disabled property reflected reality, then it occurred to me that we have to ensure that the CSS reflects reality, then it occurred to me that we have to fix native theming too. Disabling the HTML input/textarea only when the textbox's disabled attribute is set to true is probably also a non-starter :-(
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: xptoolkit.xul → xptoolkit.widgets
This is insane, setting: <textbox disabled="false" /> in XUL will disable a textbox on Linux. Anyone have an idea for coming up with a fix to this?
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: