I’m writing because at present I am testing XBL on Firefox 3.5.4. At
the beginning, all worked fine. I defined my bindings and my rules in
CSS and binding’s content were bound into a XML element as long as it
matches the style rule. However, one of my bindings includes the HTML
iframe tag in its content and when I render the source file, the
iframe is not render. My code is as follows:
Source file:
<html>
<head>
<link type="text/css" rel="stylesheet" href="bindingrules.css">
<title>XBL Example</title>
</head>
<body>
<div class="only_for_testing_porposes"></div>
</body>
</html>
CSS file (bindingrules.css):
.only_for_testing_porposes {
-moz-binding: url("widgets.xml#mywidget");
}
Bindings files (widgets.xml):
<bindings xmlns="http://www.mozilla.org/xbl">
<binding id="mywidget">
<content>
<p>HELLO!</p>
<iframe src="http://..." scrolling="no" style="display:
block;" height="165px" frameborder="no" />
</content>
</binding>
</bindings>
When I render the source file, I can see the text “HELLO!” but not the
iframe content. What is going wrong? If I execute the following
javascript code:
document.getAnonymousNodes(document.getElementsByTagName("div")[0]);
I got a list containig the "p" HTML element and … the "iframe" HTML
element, that is, the iframe HTML element is being bound, but why
isn't it render?
Best Regards,
Sandy
><bindings xmlns="http://www.mozilla.org/xbl">
> <binding id="mywidget">
> <content>
> <p>HELLO!</p>
> <iframe src="http://..." scrolling="no" style="display:
>block;" height="165px" frameborder="no" />
>
>
This creates xbl <p> and <iframe> nodes! If you want HTML nodes, you
need to put them into the XHTML namespace. There are at least three ways
of doing this, so I won't bore you with the details in case you already
know at least one of them.
--
Warning: May contain traces of nuts.
Thank you very much. It solves my problem.
Best regards,
Sandy