Page MenuHomePhabricator

DismissableSiteNotice's close link is shown even when JavaScript is disabled
Closed, ResolvedPublic

Description

In rEDSNcf419da8020c79cb, I decided to use CSS to hide the close link for non-JavaScript browsers. However, I added it to the same module as the JavaScript code. This means that CSS is not loaded unless the JavaScript is, so the close link not only appears in the wrong place but also is nonfunctional. It's a little surprising that after nearly two years, no one had filed a bug report for this.

Possible fixes:

  1. Move the styles into a separate module loaded using addModuleStyles(). To not break cached pages, the existing module (the one used for the JavaScript) would continue to include the styles for about a month or so.
  2. Set display: none on the close link using a generic CSS class from core (rather than from the extension). The extension's stylesheet would override this. I don't know whether a suitable class already exists in core CSS.
  3. Variation on #2: use client-nojs, similarly to how it is used for the enhanced changes list. This would require a core change (unless, of course, the extension were to use addModuleStyles() as in #1).
  4. Fix T50815: reserve a fixed amount of space for the close link (possibly changing it to an icon) and add it to the document from JS.

See Also: T94536: "[dismiss]" shown on all desktop/mobile pages regardless of the wiki having any sitenotice at the time

Event Timeline

PleaseStand raised the priority of this task from to Needs Triage.
PleaseStand updated the task description. (Show Details)
PleaseStand added subscribers: PleaseStand, Krinkle.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 30 2015, 12:10 AM
Krinkle triaged this task as High priority.Mar 31 2015, 5:49 AM
Krinkle added a project: Regression.
Krinkle set Security to None.
PleaseStand closed this task as Resolved.Dec 31 2015, 1:42 AM
PleaseStand assigned this task to kaldari.

Option #1 was implemented in 4479c9f309c0.