The basic principle behind this preference is that we don't want to use
font size inflation when all the text that we would have inflated would
fit within a line or two. We're better off preserving the layout than
inflating a small amount of text. However, we don't want the inflation
decision to vary between adjacent paragraphs, so this decision needs to
be made once for each block formatting context.
Once the later patches for this bug cause this preference to be honored,
this will be a change in behavior. The old behavior can be obtained by
setting the preference to 0.
This is the third of three patches to rework the way we handle getting
the font inflation container and width data during reflow, which are
needed so that we can sometimes honor inflation during intrinsic width
calculation (which we need to do to make some form controls inflate
correctly).
This is the first of two patches to honor inflation during intrinsic
width calculation (which we need to do to make some form controls
inflate correctly).
This moves the logic currently in
nsLayoutUtils::IsContainerForFontSizeInflation into frame initialization
so that we can (later, for bug 706193) make that logic more complicated.
Add an extra change hint, UpdateOverflow, that can be used to specify that
a frame's overflow areas may have changed and that they need to be recalculated.
When a transform on a frame changes, instead of marking it for reflow, set this
hint instead.
There is an added virtual function on nsIFrame, UpdateOverflow, which is called
recursively on a frame when the corresponding hint is set, to allow it to
update its overflow areas.
This implements computation of the font size inflation factor for a
given frame. Since Fennec does layout using a fake viewport whose width
represents a typical viewport width on the desktop and then allows users
to pan and zoom, fonts are not always readable even when zoomed. The
goal of this font size inflation is to ensure that when a block of text
is zoomed to fill the width of the device, the fonts are large enough to
read. We do this by increasing the font sizes in the page. Since this
increase is a function of the width of the text's container, the
inflation must be performed (in later patches in this series) after
style data computation and after intrinsic width computation.
The font size inflation factor does not vary *within* a block.
Since sync uses a whitelist (the services.sync.prefs.sync.* prefs) for
preferences (i.e., preferences are not synced by default), this patch
does not make any changes relating to sync, since we do not want the
inflation preferences synced across devices (since preferred settings
are likely to be device-specific).
There was nothing wrong with SetFontFromStyle, except that it's just one
more API to think about (and one more API to audit and modify for font
inflation work to happen in bug 627842).