XUL 文本框不可编辑或可见

XUL textbox is not editable or visible

在最新版本的 Firefox 中使用 XUL <textbox> 元素时,我无法聚焦该元素并向其中写入内容。它适用于旧版本,例如 33。使用 html:textarea 似乎可行。但是,我很乐意在我的应用程序中保留原始 XUL 元素,并想了解这里出了什么问题。

<textbox> 元素上使用 multiline 属性时,该元素根本不可见!

任何提示或解释都会很棒。

这是我的小test.xul文件内容:

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>

<window
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  xmlns:html = "http://www.w3.org/1999/xhtml"
  width="800"
  height="800">

<textbox flex="1" />
<html:textarea flex="1" />

</window>

找到问题了。 我的 chrome.manifest 文件中有一个覆盖规则,如下所示:

override chrome://global/locale/textcontext.dtd 
         chrome://myapp/locale/xulrunner_global_textcontext.dtd

该文件已针对 firefox 38 进行了更改,并添加了一个未在我的文件中定义的附加实体。添加缺失的 ENTITY 解决了所有问题。

感谢 Makyen 的测试和启发。

感兴趣的人的变化: https://hg.mozilla.org/releases/l10n/mozilla-beta/de/diff/6f25b6d2dcf5/toolkit/chrome/global/textcontext.dtd