XUL隐式元素 [英] XUL implicit elements

查看:113
本文介绍了XUL隐式元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在玩XUL中的按钮.我发现,当您将图像放在按钮上时,它会在该按钮内创建一个图像元素,我知道这一点,因为我可以使用CSS选择器按钮图像"为该图像设置样式.

I've been playing around with buttons in XUL. I discovered that when you put an image on a button it creates an image element inside that button, I know this, because I can style that image with the CSS selector 'button image'.

所以,我的问题是还有哪些其他隐式元素?我想要一个白色的菜单箭头,但无法弄清它的名字.

So, my question is what other implicit elements are there? I want to have a white menu arrow and I can't work out what its called.

推荐答案

它们被称为匿名节点",您可以在 document.getAnonymousNodes()document.getAnonymousElementByAttribute()会给你它们(常规" DOM方法不会,它们会忽略匿名节点).匿名节点通常是通过 XBL 创建的,例如在chrome://global/content/bindings/button.xml中可以找到按钮的默认XBL绑定(在<content>标记中定义了匿名节点).在Firefox 5中,它对应于omni.jar中的目录chrome/toolkit/content/global/bindings/-可以在该目录中随意浏览(绑定在chrome/toolkit/content/global/xul.css中分配).设置匿名节点样式时,请记住,匿名节点有时取决于操作系统(请参阅< dialog>绑定,请注意预处理器指令根据操作系统选择代码部分.

They are called "anonymous nodes" and you can see them in DOM Inspector for example. If you prefer to inspect them programmatically, document.getAnonymousNodes() or document.getAnonymousElementByAttribute() will give you them ("normal" DOM methods won't, they ignore anonymous nodes). Anonymous nodes are usually created via XBL, e.g. the default XBL bindings for buttons can be found in chrome://global/content/bindings/button.xml (anonymous nodes are defined in the <content> tag). In Firefox 5 this corresponds to the directory chrome/toolkit/content/global/bindings/ in omni.jar - feel free to browse around in this directory (the bindings are assigned in chrome/toolkit/content/global/xul.css). When styling anonymous nodes keep in mind that the anonymous nodes will sometimes depend on the operating system (see <dialog> binding for an example, note the preprocessor directives choosing code parts based on operating system).

这篇关于XUL隐式元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆