惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threatpost
博客园 - 叶小钗
T
The Blog of Author Tim Ferriss
Recent Announcements
Recent Announcements
D
DataBreaches.Net
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
N
Netflix TechBlog - Medium
Microsoft Azure Blog
Microsoft Azure Blog
Microsoft Security Blog
Microsoft Security Blog
B
Blog
U
Unit 42
有赞技术团队
有赞技术团队
博客园 - 聂微东
GbyAI
GbyAI
宝玉的分享
宝玉的分享
F
Full Disclosure
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MyScale Blog
MyScale Blog
Jina AI
Jina AI
Martin Fowler
Martin Fowler
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
D
Docker
P
Proofpoint News Feed
A
About on SuperTechFans
I
InfoQ
博客园 - 【当耐特】
C
Check Point Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy & Cybersecurity Law Blog
T
Threat Research - Cisco Blogs
Y
Y Combinator Blog
Project Zero
Project Zero
WordPress大学
WordPress大学
小众软件
小众软件
AWS News Blog
AWS News Blog
博客园 - 司徒正美
T
The Exploit Database - CXSecurity.com
L
LINUX DO - 热门话题
I
Intezer
Engineering at Meta
Engineering at Meta
C
CXSECURITY Database RSS Feed - CXSecurity.com
J
Java Code Geeks
T
Tenable Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Last Week in AI
Last Week in AI
C
CERT Recently Published Vulnerability Notes

Henri Sivonen’s pages

Parin vuoden tutkimattomuus crates.io: Rust Package Registry Asiakirjatonta toimintaa It’s not wrong that "🤦🏼‍♂️".length == 7 Koulutartuntojen tilastointimenettely Perusteasiakirjoja hallussapitämättä ikärajoitettu Asiantuntijat ja nukkuva vallan vahtikoira Koronapassilausunto Suppealla tietopohjalla ohimeneväksi väitetty Text Encoding Menu in 2021 The Text Encoding Submenu Is Gone An HTML5 Conformance Checker Not Part of the Technology Stack Browser Technology Stack Bogo-XML Declaration Returns to Gecko A Look at Encoding Detection and Encoding Menu Telemetry from Firefox 86 Why Supporting Unlabeled UTF-8 in HTML on the Web Would Be Problematic Rust Target Names Aren’t Passed to LLVM Toimintamalli Activating Browser Modes with Doctype Johtopäätöksiä mallin rakenteesta Tehtävänmäärittelyä kirjoittamatta ja kuolemia laskematta laumasuojamallinnettu Character Encoding Menu in 2014 Erillissuosituksen tarpeettomuudesta yleissuosituksen poikkeukseksi? STM:n maskiaikajana Rust 2021 Oma-aloitteisesti mallinnettu Kokopinovaatimuksin kilpailutettu chardetng: A More Compact Character Encoding Detector for the Legacy Web Varauksia paisutellen tiedotettu Perusteasiakirjoitta tiedotettu Always Use UTF-8 & Always Label Your HTML Saying So IME Smoke Testing The Validator.nu HTML Parser About the Hiragino Fonts with CSS It’s Time to Stop Adding New Features for Non-Unicode Execution Encodings in C++ Rust 2020 The Last of the Parsing Quirks About about:blank Rust 2019 a Web-Compatible Character Encoding Library in Rust How I Wrote a Modern C++ Library in Rust Using cargo-fuzz to Transfer Code Review of Simple Safe Code to Complex Code that Uses unsafe A Rust Crate that Also Quacks Like a Modern C++ Library #Rust2018 No Namespaces in JSON, Please A Lecture about HTML5 Julkisesti luotettu varmenne ikidomainille TLS:ää (SSL:ää) varten -webkit-HTML5 Lists in Attribute Values The Sad Story of PNG Gamma “Correction” If You Want Software Freedom on Phones, You Should Work on Firefox OS, Custom Hardware and Web App Self-Hostablility HTML5 Parser Improvements ARIA in HTML5 Integration: Document Conformance (Draft, Take Two) Schema.org and Pre-Existing Communities Lowering memory requirements by replacing Schematron HTML5 Parsing in Gecko: A Build Introducing SAX Tree NVDL Support in Validator.nu HOWTO Avoid Being Called a Bozo When Producing XML An Unofficial Q&A about the Discontinuation of the XHTML2 WG Thoughts on HTML5 Becoming a W3C Recommendation Four Finnish Banks Training Users to Give Banking Credentials to Another Site Unimpressed by Leopard Sergeant Semantics The Content Sink Inheritance Diagram – 2006-06-30 What is EME? About Points and Pixels as Units The Performance Cost of the HTML Tree Builder Social Media Impression Management The spacer Element Is Gone Openmind 2006 Performance Mistake XHTML and Mobile Devices WebM-Enabled Browser Usage Share Exceeds H.264-Enabled Browser Usage Share on Desktop (in StatCounter Numbers) HTML5 Parser-Based View Source Syntax Highlighting Vendor Prefixes Are Hurting the Web Accept-Charset Is No More Dualroids Writing Structural Stylable Document in Mozilla Editor ISO-8859-15 on haitallinen Hourglass The Scientific Method According to Hixie Maemo Source Code Karpelan lukkovertaus ontuu Digitaalisesta arkistoinnista ARIA in HTML5 Integration: Document Conformance (Draft) XHTML—What’s the Point? (Draft, incomplete) Mac OS X Browser Comparison HOWTO Spot a Wannabe Web Standards Advocate An Idea About Intermediate Language Trees and Web UI Generation Thoughts on Using SSL/TLS Certificates as the Solution to Phishing Bureaucracy Meets the Web Europe Day HOWTO Establish a 100% Literacy Rate What to Do with All These Photos? Charmod Norm Checking Validator Web Service Interface Ideas DTDs Don’t Work on the Web EFFI’s Day in Court
Thoughts About a Print UI for Mozilla
Henri Sivonen · 2011-12-22 · via Henri Sivonen’s pages

This is not an UI spec. This is an incomplete collection of thoughts about what I would like to see in the printing UI.

The Page Setup / Print Model is Suboptimal for Web Browsers

The Page Setup / Print model was designed for apps where the user is the author of the document and works on the document in a constant print preview mode—ie. the app uses the WYSIWYG paper paradigm. With such an app, the user already knows what the page layout is going to be when (s)he selects print. Also, settings made in the Page Setup dialog are saved with the document.

With an app like a Web browser the user is not necessarily the author of the document and the document isn’t viewed in a constant print preview mode. When the user selects Print in Nav 4.x, (s)he does not know exactly how the document get paginated. That is bad.

Mozilla needs an “I wanna print” mode (hereinafter referred to as the “Print As window”). In that mode the browser would display a suggested paper page layout and the user could customize it. This way the user would know what to expect from the printer. I doesn’t make sense to display online documents with a paper page layout while browsing, but it makes a lot of sense to display them that way prior to printing.

The Commands in the File Menu

It doesn’t make sense to associate document-specific Page Setup information with online documents. Therefore, Mozilla shouldn’t extend the Page Setup dialog in any way. Ideally, if the printer driver defaults to the paper size the user always keeps in the printer’s paper tray and the Print As windows allows scaling of the page, access to the Page Setup dialog isn’t required at all in normal situations. This means that Mozilla doesn’t need a menu item called “Page Setup…”, either. The Page Setup dialog could be made accessible via the Print As window for the rare occasions when the Page Setup really needs to be accessed.

The only print-related menu item that is really needed is “Print As…”, which would open the Print As window. However, some users don’t want to spend time previewing and fine-tuning the page layout. They just want to print as fast as possible. If the implementation of the Print As window turned out to be slow, another menu item called “Print ” could be provided. This command would bypass the Print As window and proceed to the platform Print dialog with the default settings.

The Print As Window

The Print As window would provide the user with various settings affecting the print output and a preview displaying the effect of the settings on screen. Here is a list of possible settings:

  • Pop-up menu for choosing between different author style sheets (“Author’s Style”). (Defaulting to print style sheet if available)
  • Pop-up menu for choosing between different user style sheets (“My Style”).
  • Scaling setting for overriding the real meaning of physical units with an option to autoscale to fit.
  • Font zoom
  • Items for quickly creating an equivalent of a user !important style sheet:
    • Checkbox for removing background colors and images
    • Checkbox for forcing black text
  • Rulers above and next to the preview area with draggable margins (see below)
  • Cropping ability with snapping to possible <table> grid
  • Access to platform-provided Page setup dialog (rarely needed)

Style sheets

The CSS spec allows specifying multiple style sheets per document. These style sheets can be intented for different media and there can be alternative style sheets for a particular media. When the Print As window is opened, the default selection in the Author’s Style pop-up menu should be the primary author style sheet for the print media.

Print is not the only useful media type, however. Style sheets for the screen and projection media types should be selectable also. The user may want to have a hard copy that resembles the screen presentation as closely as feasible and the printing functionality can be used for printing transparencies or slides. The media type of each style sheet should be indicated in the menu.

User style sheets can be optionally cascaded in with the author styles. Users may want to override the authors choices for color for example. The default setting of the My Style pop-up menu should be a preference. (See below.)

Scaling Physical Units and Zooming Fonts

The author’s idea of suitable image size, spacing, etc. might not suit the user’s needs. This can be remedied with an ability to apply scaling to physical lengths and pixel lengths that are converted to physical lengths for the purpose of printing.

Experience shows that the font size is a very important aspect of readability of a document and also affects directly the number of paper sheets required for printing. For this reason, there is a need for an font zoom in addition to general scaling of units.

Margins

Margins are important in printing and some user will want to have a good control over them. Overly large margins waste paper. Small margins may cause problems with the restrictions on the imaging area of the printer or make the document hard to read.

While margins appear to be a trivial concept in word processors, the effective margins of a style HTML or XML document depend on many factors. The effective margin can consist of margins and padding on multiple boxes. <table>s can also be used to create margin-like empty areas. Ideally the UI would let the user modify the effective margin be dragging with the mouse in a way that would hide the details of the box areas that make up the effective margin.

When borders are not used or the borders are of the same color as the background, the inner edge of the effective left margin coincides with the left edge of the content area of the leftmost that has text or an image directly in it. Being able to change this effective margin would be user-friendly but non-trivial to implement. Ideally the effective margin would be indicated on the above-mentioned rulers in such a way that the user could change the effective margin with the mouse without knowing the details of boxes.

Related Preferences

A couple of additional preferences would be useful:

  • Initially chosen user style sheet (useful if the user always wants to apply a user style sheet)
  • Font size pref for the print media
  • Font size pref for the projection media

Generally, the optimal font size is different for different media. Therefore there should be different preferences for different media.

DOM Changes

Modification to style via the DOM causes problems with printing. It is straight-forward that images should be printed in the state of the DOM they are at the printing moment. However, style sheets can set different visibility and display properties for elements on different media. DOM applications typically modify these properties, too. Using the “correct” style in printing is a tricky issue if the style properties have been modified via the DOM and a print style sheet is used also.