Closed Bug 697259 Opened 14 years ago Closed 13 years ago

Follow-up: e10s-friendly handling of sync link visibility on sync setup or unlink

Categories

(Firefox :: Sync, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: liuche, Assigned: liuche)

References

Details

(Whiteboard: [closeme-sync.next][sync:setup])

Attachments

(2 files, 2 obsolete files)

WIP patch for better handling of sync link visibility change. Follow-up to patch 2 of bug 675821. Successfully changes "Set Up Sync" link visibility in UI, listeners not firing in testing.
Attachment #569504 - Attachment is obsolete: true
Comment on attachment 569817 [details] [diff] [review] part 1, v1: async messages + tests (listener fails to fire) This part looks good. I'll attach a patch for test tweaks in a second.
Attachment #569817 - Flags: feedback?(gavin.sharp) → feedback+
Attached patch test fixes (obsolete) — Splinter Review
For some reason the content.js redeclaration error seems to only affect tests, I'm not sure why.
apply "2b, v1" and then part 2 on top of that. Test is browser_aboutHome.js, and fails on un-hiding setupSyncLink after unpairing (although the converse, hiding setupSyncLink after setup, *does* work and passes testing).
Attachment #570803 - Flags: feedback?
Attachment #569817 - Attachment description: 2b, v1: async messages + tests (listener fails to fire) → part 1, v1: async messages + tests (listener fails to fire)
Comment on attachment 570803 [details] [diff] [review] part 2, v1: changed elt.setAttr(hidden) to elt.hidden >diff --git a/browser/base/content/content.js b/browser/base/content/content.js >- if (hidden) >- item.setAttribute("hidden", "true"); >- else >- item.removeAttribute("hidden"); >+ if (hidden) { >+ item.hidden = true; >+ } else { >+ item.hidden = false; >+ } Why this change? Setting the attribute is generally more reliable (not all elements have the hidden attribute reflected as a DOM property). I think you should instead change the test to also check the attribute (rather than the property).
Attachment #570803 - Flags: feedback? → feedback-
(In reply to Gavin Sharp (use gavin@gavinsharp.com for email) from comment #5) > Why this change? I suggested this to liuche on IRC, based on this: "Using setAttribute() to modify certain attributes, most notably value in XUL, works inconsistently, as the attribute specifies the default value. To access or modify the current values, you should use the properties. For example, use elt.value instead of elt.setAttribute('value', val)." -- https://developer.mozilla.org/en/DOM/element.setAttribute This was a stab-in-the-dark suggestion, 'cos I'm still waiting for a build to finish so that I can give better advice :)
Ah, it turns out I was wrong - my advice holds for XUL, where the hidden attribute may not be reflected consistently, but in HTML it appears that .hidden is specced to apply to all elements, and we seem to implement that, so sticking to ".hidden" everywhere makes sense.
Comment on attachment 570803 [details] [diff] [review] part 2, v1: changed elt.setAttr(hidden) to elt.hidden you could simplify to item.hidden = hidden;, though
Attachment #570803 - Flags: feedback- → feedback+
Attachment #570410 - Attachment is obsolete: true
Blocks: 675821
No longer depends on: 675821
Assignee: nobody → liuche
Priority: -- → P5
Anyone feel strongly about landing this now?
Priority: P5 → --
Whiteboard: [closeme-sync.next][sync:setup]
No longer relevant with the current about:home.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
Component: Firefox Sync: UI → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: