Bug 1711064 - patch 1 - Add a pref to control whether linkifying Save-as-PDF output is enabled. r=dholbert

Differential Revision: https://phabricator.services.mozilla.com/D115514
This commit is contained in:
Jonathan Kew 2021-05-20 08:25:44 +00:00
Родитель 0ec9b5902e
Коммит 5e9a828adc
2 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -29,6 +29,7 @@
#include "mozilla/Sprintf.h"
#include "mozilla/StaticAnalysisFunctions.h"
#include "mozilla/StaticPrefs_layout.h"
#include "mozilla/StaticPrefs_print.h"
#include "mozilla/SVGMaskFrame.h"
#include "mozilla/SVGObserverUtils.h"
#include "mozilla/SVGTextFrame.h"
@ -4000,7 +4001,8 @@ void nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
// for the same destination that entirely overlap each other, which adds
// nothing useful to the final PDF.
Maybe<nsDisplayListBuilder::Linkifier> linkifier;
if (aBuilder->IsForPrinting()) {
if (StaticPrefs::print_save_as_pdf_links_enabled() &&
aBuilder->IsForPrinting()) {
linkifier.emplace(aBuilder, aChild);
linkifier->MaybeAppendLink(aBuilder, aChild, aLists.Content());
}

Просмотреть файл

@ -9837,6 +9837,12 @@
value: true
mirror: always
# Whether we attempt to generate links in Save As PDF output.
- name: print.save_as_pdf.links.enabled
type: RelaxedAtomicBool
value: true
mirror: always
# The default DPI for printing.
#
# For PDF-based output, DPI should ideally be irrelevant, but in fact it is not