Closed Bug 1440491 Opened 6 years ago Closed 6 years ago

There are [persist] attributes on three elements in browser.xul that don't have IDs

Categories

(Firefox :: General, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 60
Tracking Status
firefox60 --- fixed

People

(Reporter: bgrins, Assigned: bgrins)

References

Details

Attachments

(1 file)

I was looking at a profile's xulstore.json file and saw this inside it:

"chrome://browser/content/browser.xul": {
  [snip]

  "": {
     "width": "54"
   }
}

Went to figure out why and found these two <hbox.titlebar-placeholder> elements: 
- https://searchfox.org/mozilla-central/rev/bd05e3853c6e982e2a35c1cc404b987b2bc914d6/browser/base/content/browser.xul#623 - https://searchfox.org/mozilla-central/source/browser/base/content/browser.xul#705

The XULStore is keyed on ID so setting [persist] on an element without an ID seems invalid. I think we can remove the attribute from these two elements.
There's actually three, the two above and https://searchfox.org/mozilla-central/source/browser/base/content/browser.xul#697
Summary: There are [persist] attributes on two elements in browser.xul that don't have IDs → There are [persist] attributes on three elements in browser.xul that don't have IDs
Comment on attachment 8953261 [details]
Bug 1440491 - Remove [persist] attribute from elements without IDs in browser.xul;

Gijs, is there any reason not to do this? AFAICT having these here will just end up writing an empty string into XULStore for the ID (https://searchfox.org/mozilla-central/rev/9a8d3f8191b15cdca89a7ce044c7bea2dd0462dc/dom/xul/XULDocument.cpp#1173)
Attachment #8953261 - Flags: review?(gijskruitbosch+bugs)
(In reply to Brian Grinstead [:bgrins] from comment #3)
> Comment on attachment 8953261 [details]
> Bug 1440491 - Remove [persist] attribute from elements without IDs in
> browser.xul;
> 
> Gijs, is there any reason not to do this? AFAICT having these here will just
> end up writing an empty string into XULStore for the ID
> (https://searchfox.org/mozilla-central/rev/
> 9a8d3f8191b15cdca89a7ce044c7bea2dd0462dc/dom/xul/XULDocument.cpp#1173)

Looks like this regressed because of bug 1390025 removing the ID from these. Dão, do you know if keeping these persisted gains us anything?
Blocks: 1390025
Flags: needinfo?(dao+bmo)
Comment on attachment 8953261 [details]
Bug 1440491 - Remove [persist] attribute from elements without IDs in browser.xul;

Going to clear review while waiting for Dão.
Attachment #8953261 - Flags: review?(gijskruitbosch+bugs)
(In reply to :Gijs from comment #4)
> (In reply to Brian Grinstead [:bgrins] from comment #3)
> > Comment on attachment 8953261 [details]
> > Bug 1440491 - Remove [persist] attribute from elements without IDs in
> > browser.xul;
> > 
> > Gijs, is there any reason not to do this? AFAICT having these here will just
> > end up writing an empty string into XULStore for the ID
> > (https://searchfox.org/mozilla-central/rev/
> > 9a8d3f8191b15cdca89a7ce044c7bea2dd0462dc/dom/xul/XULDocument.cpp#1173)
> 
> Looks like this regressed because of bug 1390025 removing the ID from these.
> Dão, do you know if keeping these persisted gains us anything?

https://hg.mozilla.org/mozilla-central/rev/738845c4c146fdb65dd3d18413b41425bf570f31#l1.10 made it ineffective from another angle so I guess we can remove this.
Flags: needinfo?(dao+bmo)
Comment on attachment 8953261 [details]
Bug 1440491 - Remove [persist] attribute from elements without IDs in browser.xul;

https://reviewboard.mozilla.org/r/222548/#review228598

Thanks, Dão. Yeah, let's just remove this then.
Attachment #8953261 - Flags: review+
How bad is the bad data? Is it worth cleaning up in a migration or something? I don't think so, but just making sure we've considered that...
Assignee: nobody → bgrinstead
Status: NEW → ASSIGNED
Pushed by bgrinstead@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d49f13abd54a
Remove [persist] attribute from elements without IDs in browser.xul; r=Gijs
https://hg.mozilla.org/mozilla-central/rev/d49f13abd54a
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 60
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: