XBL <content> block doesn't allow to fully replace the default content

RESOLVED WONTFIX

Status

()

Core
XBL
RESOLVED WONTFIX
12 years ago
12 years ago

People

(Reporter: VK, Unassigned)

Tracking

Trunk
x86
Other
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

12 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2
Build Identifier: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2

XBL <content> block doesn't allow to fully replace the default content with anonymous one.

Reproducible: Always

Steps to Reproduce:
1. HTML file:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>Hello world!</title>
<style type="text/css">
p {
 -moz-binding: url(hello.xml#default);
}
</style>
</head>
<body

  ><p>Default content</p
  ><p>Default content</p
  ><p>Default content</p

></body>
</html>

2. hello.xml file :

<?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl">
  <binding id="default">
    <content><span>Hello world! </span><children/></content>
  </binding>
</bindings>

Actual Results:  
On attempt to remove <children/> element or set it to some non-matching tag like <children includes="none" /> the anonymous content is ignored. It also ignored on any change of <children/> syntax (no additional characters are allowed).

Expected Results:  
There mus be a way to have anonymous content fully replace the default content. It could be triggered by the absence of <children/> element in the <content> block or by some attribute like <children includes="all | none | {tag list}" />

I consider this feature as rather crucial because a regular usage of bindings is to replace some default interface (kept for non-capable UA's) by XBL-based widgets. Currently the only way I see is by letting the default content to be inserted and then remove it manually using <constructor> - which is awfully backward IMHO.

P.S. Also another feature is missing terribly in comparison of Microsoft behaviors is the ability to replace the bound element itself by the binding's <content>. Say one have a plain <textarea>, but for binding/behavior capable UA's it will be replaced by a rich text editor. So maybe drop the "includes" attribute for <children/> all together (it will be easy as it's not implemented anyway :-) but implement "includes" for <content> and add an extra flag?
<content
 includes="all | none | {tag list}"
 replaceBoundElement = "false | true">
where "all" "false" respectively are default?

And the absence of <children/> by itself means that only anonymous content is used  and the default children are skept?

Wishful thinking...
Please file any future xbl bugs in Core->XBL.

(In reply to comment #0)
> Actual Results:  
> On attempt to remove <children/> element or set it to some non-matching tag
> like <children includes="none" /> the anonymous content is ignored. It also
> ignored on any change of <children/> syntax (no additional characters are
> allowed).
Iirc, you needed to add a <children/> tag in the binding that matches something.
This is a bug in Mozilla, I think, but I can't find the bug number right now.

> I consider this feature as rather crucial because a regular usage of bindings
> is to replace some default interface (kept for non-capable UA's) by XBL-based
> widgets. Currently the only way I see is by letting the default content to be
> inserted and then remove it manually using <constructor> - which is awfully
> backward IMHO.
You could do something like this: <html:div style="display:none;"><children/></html:div>

> P.S. Also another feature is missing terribly in comparison of Microsoft
> behaviors is the ability to replace the bound element itself by the binding's
> <content>.
This was what bug 98712 was about. But for current xbl implementation this is a wontfix.
Not sure if xbl2 has something that would make this possible (I suspect not).
http://www.mozilla.org/projects/xbl/xbl2.htm
Assignee: nobody → general
Component: General → XBL
Product: Firefox → Core
QA Contact: general → ian
Version: unspecified → Trunk
(Reporter)

Comment 2

12 years ago
(In reply to comment #1)
> Please file any future xbl bugs in Core->XBL.

Oops... Sorry and thank you. I was always going from Firefox > and I did guess to look at Core. I'm still new on Bugzilla.

> You could do something like this: <html:div
> style="display:none;"><children/></html:div>

As a workaround yes.

> > P.S. Also another feature is missing terribly in comparison of Microsoft
> > behaviors is the ability to replace the bound element itself by 
> > the binding's <content>.
>
> This was what bug 98712 was about. But for current 
> xbl implementation this is a wontfix.
> Not sure if xbl2 has something that would make this possible (I suspect not).

Noop :-(
Status: UNCONFIRMED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → WONTFIX
(In reply to comment #2)
> Oops... Sorry and thank you. I was always going from Firefox > and I did guess
> to look at Core. I'm still new on Bugzilla.
Nothing to be sorry about. I'm just pointing it out to you, so you do it right the next time.
Only module owners are allowed to WONTFIX a bug, btw ;)


You need to log in before you can comment on or make changes to this bug.