Commit 0f89a82b authored by bratell@opera.com's avatar bratell@opera.com

Documents with many lines overallocated pagination info.

There is an object LineFragmentationData that is used for pagination
that is created on demand. That object was created for normal documents
and cost roughly 32 bytes per line, adding up to 3-5 MB on a big text
document (5% of all memory usage).

Testcase: http://norvig.com/big.txt - 3-10 MB RAM savings.

I don't know what I'm doing but this patch prevents the allocation and
saves the memory.

BUG=353993

Review URL: https://codereview.chromium.org/200053007

git-svn-id: svn://svn.chromium.org/blink/trunk@170497 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 8cbd5f25
......@@ -249,7 +249,8 @@ LayoutUnit RootInlineBox::alignBoxesInBlockDirection(LayoutUnit heightOfBlock, G
maxHeight = max<LayoutUnit>(0, maxHeight); // FIXME: Is this really necessary?
setLineTopBottomPositions(lineTop, lineBottom, heightOfBlock, heightOfBlock + maxHeight);
setPaginatedLineWidth(block().availableLogicalWidthForContent());
if (block().view()->layoutState()->isPaginated())
setPaginatedLineWidth(block().availableLogicalWidthForContent());
LayoutUnit annotationsAdjustment = beforeAnnotationsAdjustment();
if (annotationsAdjustment) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment