From a5f20f7106697a405f26b558098426f8d4452f4a Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 28 Sep 2020 09:17:52 -0700 Subject: [PATCH] When printing, wrap all content in Remarkup tables more aggressively Summary: Ref T13564. See PHI1798. Earlier efforts here (see D21439) still leave us with: - Incorrect behavior for long URIs, like `http://www.example.com/MMMMM...`. - Incorrect beahvior for long text blocks, like `MMMMMM...`. - Undesirable behavior for monospaced text in non-printing contexts (it wraps when we'd prefer it not wrap). Apply the wrapping rules to all "" content to resolve these three prongs. Test Plan: - Viewed long URIs, text blocks, and monospaced text in and out of tables, while printed and not printed, in Safari, Firefox, and Chrome. - All browser behavior now appears to be correct ("all content is preserved in printed document"). - Some browser behavior when making wrapping choices is questionable, but I can't find an automatic solution for that. Maniphest Tasks: T13564 Differential Revision: https://secure.phabricator.com/D21472 --- resources/celerity/map.php | 6 +++--- webroot/rsrc/css/core/remarkup.css | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index de3a9627ff..ffa1e95405 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -9,7 +9,7 @@ return array( 'names' => array( 'conpherence.pkg.css' => '0e3cf785', 'conpherence.pkg.js' => '020aebcf', - 'core.pkg.css' => 'bd937962', + 'core.pkg.css' => '937616c0', 'core.pkg.js' => 'adc34883', 'dark-console.pkg.js' => '187792c2', 'differential.pkg.css' => '5c459f92', @@ -114,7 +114,7 @@ return array( 'rsrc/css/application/tokens/tokens.css' => 'ce5a50bd', 'rsrc/css/application/uiexample/example.css' => 'b4795059', 'rsrc/css/core/core.css' => 'b3ebd90d', - 'rsrc/css/core/remarkup.css' => '94c3d777', + 'rsrc/css/core/remarkup.css' => '24d48a73', 'rsrc/css/core/syntax.css' => '548567f6', 'rsrc/css/core/z-index.css' => 'ac3bfcd4', 'rsrc/css/diviner/diviner-shared.css' => '4bd263b0', @@ -806,7 +806,7 @@ return array( 'phabricator-object-selector-css' => 'ee77366f', 'phabricator-phtize' => '2f1db1ed', 'phabricator-prefab' => '5793d835', - 'phabricator-remarkup-css' => '94c3d777', + 'phabricator-remarkup-css' => '24d48a73', 'phabricator-search-results-css' => '9ea70ace', 'phabricator-shaped-request' => '995f5102', 'phabricator-slowvote-css' => '1694baed', diff --git a/webroot/rsrc/css/core/remarkup.css b/webroot/rsrc/css/core/remarkup.css index 5bee3e373d..bb698f3ac1 100644 --- a/webroot/rsrc/css/core/remarkup.css +++ b/webroot/rsrc/css/core/remarkup.css @@ -86,11 +86,6 @@ padding: 1px 4px; border-radius: 3px; white-space: pre-wrap; - - /* See T13564. This is a narrow control for PDF printing behavior in - Chrome. */ - line-break: anywhere; - overflow-wrap: anywhere; } /* NOTE: You can currently produce this with [[link | `name`]]. Restore the @@ -499,6 +494,10 @@ video.phabricator-media { overflow-x: auto; } +!print .phabricator-remarkup .remarkup-table-wrap { + overflow-x: hidden; +} + .phabricator-remarkup table.remarkup-table { border-collapse: separate; border-spacing: 1px; @@ -518,6 +517,14 @@ video.phabricator-media { padding: 3px 6px; } +!print .phabricator-remarkup table.remarkup-table td { + /* See T13564. This is a narrow control for PDF printing behavior in + Chrome. */ + + line-break: anywhere; + overflow-wrap: anywhere; +} + body div.phabricator-remarkup.remarkup-has-toc .phabricator-remarkup-toc + .remarkup-header { margin-top: 0; -- 2.11.4.GIT