Page MenuHomePhabricator

Deprecate printable version mode
Closed, ResolvedPublic3 Estimated Story Points

Description

Printable version had one main purpose: Support browsers that didn't support media queries yet.
That purpose is no longer relevant, as the last browser (IE 5.5/6.0) that required it, is no longer supported.

A secondary purpose has been identified, which was that people didn't really know how to print a web page (ctrl-p or file->print). To slightly accommodate that use case, while not relying on printable version, this link was recently adapted to trigger the print dialog using Javascript.

A 3rd use has been to check how a page will look in print. Many browser's web inspectors have a mode to do this, and for the general public, most operating systems provide a "print preview" feature.

As the printable version feature is not well maintained, has a few quirks and adds complexity that is avoidable, I suggest we start fully removing support for printable version.

Acceptance criteria

  • Deprecate printableversion (per 1.35)

QA Results - Beta

QA Results - Prod

Sign off

Removal continues in T259141: Remove printableversion mode

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Krinkle lowered the priority of this task from High to Medium.Aug 23 2019, 2:11 PM
Krinkle moved this task from Inbox to Backlog on the MediaWiki-ResourceLoader board.

The ResourceLoader-code that existed for printable and handheld parmeters looked unused, but I was wrong. It is used in the following way:

  • Sidebar links to "Printable view" (example: index.php?title…&printable=yes)
  • OutputPage arbirtrarily forwards printable parameter to ResourceLoader for use in any of its embedded load.php URLs.
  • There is nothing in ResourceLoader or ResourceLoaderContext that reads or varies its logic by this in any way. Hence my assumption that it is only a Skin-level thing.
  • But behold, when ResourceLoader::makeModuleResponse is concatenating the result of various modules in the main styles-only request, there is a call to OutputPage::transformCssMedia which gets its hands on the internal RL state (after reading and processing of LESS/CSS, but before concatenating), and changes any top-level media block (those defined in Resources.php/skin.json) for "print" to "" so that it applies on screen, and discards any top-level block for "only screen".
    • It does this based on reading out wgRequest directly, thus bypassing ResourceLoaderContext, but relying on wgRequest working inside a load.php request, kind of.

Pratically speaking, this means:

  • mediawiki.toc.styles is loaded in a way where its screen.less is removed and print.css unwrapped in its stead.
  • mediawiki.page.gallery.styles is loaded with its print.css unwrapped.
  • ResourceLoaderSkinModule loads legacy-print unwrapped and omits most of its other stuff.

That's pretty much it. It does potentially have other random impact depending on how extensions have written their styles. I imagine they generally don't have print.css as a separate extension.json entry with "print" as media key though, so I assume the above is the 99% that matters.

What are the blockers for deprecating this in 1.35?
This is causing some real problems in the desktop improvements project - the new Vector breaks in this mode (see T253842) and we currently don't have plans to fix that.

Change 610323 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/core@master] Deprecate printableversion=yes

https://gerrit.wikimedia.org/r/610323

I propose adding a banner like so:

and changing the sidebar link as part of the 1.35 release.

As we update Vector we have no interest in fixing the following:

Given this is a performance recommendation, I think now is the time to deprecate this.

Jdlrobson renamed this task from Remove printable version mode to Deprecate and remove printable version mode.Jul 8 2020, 9:33 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson added a subscriber: ovasileva.

@ovasileva super sorry for the late sprint entry but given my recent analysis of the print mode in T253842, I think it's essential we set the intention that this is not supported and aim for a deprecation in for 1.35 (which is cut on 14 July 2020 at 02:00 UTC.)

@ovasileva super sorry for the late sprint entry but given my recent analysis of the print mode in T253842, I think it's essential we set the intention that this is not supported and aim for a deprecation in for 1.35 (which is cut on 14 July 2020 at 02:00 UTC.)

That sounds good, but let me discuss it with Szymon as well - will get back to you later today

@Jdlrobson - does this mean that the link would still exist but it would just trigger the browser print (i.e. all we're removing is the page like https://en.wikipedia.org/w/index.php?title=1937_Fox_vault_fire&printable=yes)

@Jdlrobson - does this mean that the link would still exist but it would just trigger the browser print (i.e. all we're removing is the page like https://en.wikipedia.org/w/index.php?title=1937_Fox_vault_fire&printable=yes)

The link would exist yes and point to browser print. If there is no JavaScript it will be hidden. The page would also exist but have a banner saying it is no longer supported.

@Jdlrobson - does this mean that the link would still exist but it would just trigger the browser print (i.e. all we're removing is the page like https://en.wikipedia.org/w/index.php?title=1937_Fox_vault_fire&printable=yes)

Note that the "Printable version" link already triggers the browser print in production today.

The printable=yet URL comes in when e.g. we're in Grade C mode, or when one chooses to share the link or open it in a new tab. Those capabilities would no longer be supported.

Jdlrobson raised the priority of this task from Medium to High.Jul 13 2020, 9:20 PM

Branch cut is tomorrow so reflecting reality here.

ovasileva set the point value for this task to 3.Jul 15 2020, 4:26 PM

Change 613171 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/core@REL1_35] Deprecate printableversion=yes

https://gerrit.wikimedia.org/r/613171

Change 610323 merged by jenkins-bot:
[mediawiki/core@master] Deprecate printableversion=yes

https://gerrit.wikimedia.org/r/610323

Change 613171 merged by jenkins-bot:
[mediawiki/core@REL1_35] Deprecate printableversion=yes

https://gerrit.wikimedia.org/r/613171

Edtadros added a subscriber: Edtadros.

Test Result - Beta

Status: ❓ Need More Info
Environment: beta
OS: macOS Catalina
Browser: Chrome
Device: MBP
Emulated Device: NA
Test Artifact(s):

QA steps

❓ AC1: The printable=yes URL comes in when e.g. we're in Grade C mode. The page would also exist but have a banner saying it is no longer supported.
@Jdlrobson, I tried a few Grade C browsers. I could not get the "Printable version" link to appear even with Javascript enabled. Is this as expected? Here is IE 9


✅ AC2: or when one chooses to share the link or open it in a new tab. The page would also exist but have a banner saying it is no longer supported.

✅ AC3: The link would exist yes and point to browser print.

✅ AC4: If there is no JavaScript it will be hidden.

@Jdlrobson, I tried a few Grade C browsers. I could not get the "Printable version" link to appear even with Javascript enabled. Is this as expected? Here is IE 9

Yep expected! If there's no link showing that's good

The bits of this that need to be done by 1.35 are now done (and merged into REL1_35), right? In that case, maybe let's drop the tag saying this is a blocker for 1.35 for the rest of the work?

Jdlrobson renamed this task from Deprecate and remove printable version mode to Deprecate printable version mode.Jul 29 2020, 3:30 PM
Jdlrobson awarded a token.
Jdlrobson updated the task description. (Show Details)

Made a new task for the actual removal since we're doing some QA right now. T259141

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Catalina
Browser: Chrome
Device: MBP
Emulated Device: NA
Test Artifact(s):

QA steps

✅ AC1: The printable=yes URL comes in when e.g. we're in Grade C mode. The page would also exist but have a banner saying it is no longer supported.
Here is IE 9


Per T167956#6337927 the missing "Printable Version" link is expected behavior.

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Catalina
Browser: Chrome
Device: MBP
Emulated Device: NA
Test Artifact(s):

QA steps

✅ AC1: The printable=yes URL comes in when e.g. we're in Grade C mode. The page would also exist but have a banner saying it is no longer supported.
On IE9 The link is not present as expected. When adding the URL parameter above, it displays the banner.


✅ AC2: or when one chooses to share the link or open it in a new tab. The page would also exist but have a banner saying it is no longer supported.

✅ AC3: The link would exist yes and point to browser print.

✅ AC4: If there is no JavaScript it will be hidden.