Closed Bug 888778 Opened 11 years ago Closed 11 years ago

Custom binding not applied to inline settings

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: darktrojan, Assigned: darktrojan)

References

Details

Attachments

(1 file, 1 obsolete file)

If an options.xul file contains:

<setting type="mytype"
         style="display: -moz-grid-line; -moz-binding: url('chrome://inlinesettings/content/binding.xml#mytype');"
         title="Custom Setting" />

the binding is not applied. It is applied if the style attribute changes after the page is loaded (e.g. adding a space to the end). Investigating further.
Are you sure it's that the binding isn't applied? I mean, simply setting "display: -moz-grid-line" in javascript makes it show up as if it were always there to begin with. To me this looks like a CSS engine problem. I was reading another bug report today about working progress on the CSS3 grid line property. Perhaps something that they've been doing with that has affected the original implementation of -moz-grid-line as it was when the <setting> bindings were created? I think that's the most reasonable explaination.

According to https://developer.mozilla.org/en-US/docs/Web/CSS/CSS3 the CSS3 grid propery is in a "Working Draft" status. Whether or not that means it's avaialable in already-released versions, I do not know. But if it is, I'd say it's a likely candidate to have made changes to -moz-grid-line -- perhaps just for inline code or something.

Some clarification on the behavior:

A custom setting does not display and has initial box dimensions of 0x0.

Setting the display property subsequently with JavaScript displays the <setting> as it should

The workaround I made for this was using an observer to observe addon-options-displayed and then set style.display on the element to display it.

I also tried using "display: -moz-grid-line !important" in the XUL to no avail.

Reordering the CSS properties also does not change anything (I got to my wits end with this and tried pretty much everything I could possibly think of).
Attached patch v1 (obsolete) — Splinter Review
The patch itself adds a call to importNode that should've been there from when I first wrote this. It also removes and reapplies the style attribute, (it seems to do nothing unless it's modified currently, for reasons I can't explain).

The test also includes a simple test for localizing an options.xul, since we should test that, and we don't.
Assignee: nobody → geoff
Status: NEW → ASSIGNED
Attachment #770133 - Flags: review?(bmcbride)
Comment on attachment 770133 [details] [diff] [review]
v1

Review of attachment 770133 [details] [diff] [review]:
-----------------------------------------------------------------

Sorry for the delay.
Attachment #770133 - Flags: review?(bmcbride) → review+
Backed out (https://hg.mozilla.org/integration/fx-team/rev/5e3890536f45) because it busted browser_inlinesettings.js. I remember now why there's no importNode call, it breaks an assortment of other settings types. But without it, this patch is broken. Hmm.
Attached patch 888778-2.diffSplinter Review
This is the same as the previous version, except the importNode call is lower down. This appears to fix both problems.
Attachment #770133 - Attachment is obsolete: true
Attachment #784352 - Flags: review?(bmcbride)
Attachment #784352 - Flags: review?(bmcbride) → review+
https://hg.mozilla.org/mozilla-central/rev/df15e6a39478
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Depends on: 901341
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: