Description[FastTextAutosizer] Remove printing checks from enabled()
This is first of two patches to refactor our enabled() code for
understandability. This patch removes the document->printing() check
from enabled() and refactors updatePageInfo to reduce duplicated code.
When printing is enabled / disabled, updatePageInfo is always called
which is what enables this refactoring. Printing doesn't change often so
there's no reason to check it multiple times for each block :)
Cleanups:
1) enabled() has been merged into shouldHandleLayout() since all callers
always checked both.
2) We had duplicated logic for the two cases when we should reset
multipliers in updatePageInfo. These have been combined and changing
"m_hasAutosized" has been moved out of resetMultipliers and into
updatePageInfo so almost no PageInfo-related state is modified outside
updatePageInfo.
3) Unnecessary calls to m_document->page()->mainFrame() have been
removed in updatePageInfo.
This change is a little messy but I hope it's clear how much of this
will be cleaned up once enabled() goes away. Slimming down enabled()
will be a perf win as well.
BUG=367864
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=173020
Patch Set 1 #
Total comments: 8
Patch Set 2 : Update per reviewer comments #
Messages
Total messages: 6 (0 generated)
|