Malformed XBL makes stuff work

RESOLVED INVALID

Status

()

Core
XBL
RESOLVED INVALID
15 years ago
13 years ago

People

(Reporter: BenB, Assigned: David Hyatt)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

15 years ago
Reproduction:
1. Add to themes/modern/navigator/navigator.css:

tabs[closebutton="true"] tab {
/*  -moz-binding: url("chrome://navigator/skin/style.xml#tab-closebutton"); */
  -moz-binding: url("chrome://global/content/bindings/tabbox.xml#tab-closebutton");
}

2. Add to xpfe/global/resources/content/bindings/tabbox.xml:
  <binding id="tab-closebutton"
           extends="chrome://global/content/bindings/tabbox.xml#tab">
    <content>
      <xul:image class="tab-icon"
onclick="event.preventDefault();dump('oniconclick\n');"
xbl:inherits="validate,src=image"/>
      <xul:label class="tab-text"
xbl:inherits="value=label,accesskey,crop,disabled" flex="1"/>
      <xul:label onclick="event.preventDefault();dump('onlabelclick\n');"
value="foo"/>
    </content>
  </binding>

3. Compile, run, open tab
4. Click on label "foo" on the tab
5. In tabbox.xml, right before </bindings>, add "</fool>"#
6. Compile, run, open tab
7. Click on label "foo" on the tab

Actual result:
Step 4: No reaction on the console
Step 6: On the console, Mozilla complains about the malformed XML file
Step 7: You see "onlabelclick" on the console

Expected result:
Step 4: You see "onlabelclick" on the console
Step 6: On the console, Mozilla complains about the malformed XML file
Step 7: undefined

Additional Comments:
- If you add the binding to a skin, you don't see "onlabelclick" in any case.
- I found and filed many, many bugs, but that's one of the most freakiest bugs
I've ever seen.
- (And it costed me a few days so far.)
- The tab <chrome://global/content/bindings/tabbox.xml#tab> derives from xul:button

Comment 1

15 years ago
Ben, 

do you have your XUL cache enabled or disabled? Also, try !important; see if
that helps. I wonder if your skin/theme is selected, I mean, try adding that
blurb to classic as well, just wondering...
(Reporter)

Comment 3

15 years ago
> XBL should report XML parse errors.  It also should ensure that it doesn't use
> any of the XML file if there was a parser error

hm? It does report an error. It nevertheless uses the file. Strangely, the
results with the malformed file are better than with a correct file.

> do you have your XUL cache enabled or disabled?

I have no nglayout.debug.disable_xul_cache pref in about:config, so I assume
that it's enabled.

> Also, try !important; see if that helps.

IIRC, I did and it didn't help. I will try again.

> I wonder if your skin/theme is selected

It is, otherwise I wouldn't see the label "foo".
(Reporter)

Comment 4

13 years ago
Marking INVALID until further info
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.