Improve -webkit-text-underline-position memory usage.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 May 2013 15:11:10 +0000 (15:11 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 May 2013 15:11:10 +0000 (15:11 +0000)
commit1e4e9522ba45193564d8be9a25eeab27cd261d07
tree11ac9ad5f9d455949dda581fa9c8e99c1dcf67b1
parentbb65938d9a6ef37593b4d44c01ebd1cf901ca86a
Improve -webkit-text-underline-position memory usage.
https://bugs.webkit.org/show_bug.cgi?id=116108

Patch by Lamarque V. Souza <Lamarque.Souza@basyskom.com> on 2013-05-17
Reviewed by Benjamin Poulain.

Remove m_maxLogicalTop private variable from RootInlineBox to reduce
the overall memory used to render RootInlineBoxes (eight bytes per RootInlineBox
instance in a 64-bit machine). RootInline::maxLogicalTop() now computes
the maxLogicalTop value everytime it is called. In a typical page
computeMaxLogicalTop is called less than 10 times for each
InlineTextBox that uses -webkit-text-underline-position. That is a small
price users of -webkit-text-underline-position will pay so that
everybody can benefit from the memory reduction in RootInlineBox.

No new tests, no change in behavior.

* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::computeMaxLogicalTop): Make it const.
* rendering/InlineFlowBox.h:
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::RootInlineBox): Remove m_maxLogicalTop.
(WebCore::RootInlineBox::alignBoxesInBlockDirection): Remove
computeMaxLogicalTop call and obsolete comment.
(WebCore):
(WebCore::RootInlineBox::maxLogicalTop): Compute maxLogicalTop before
returning its value.
* rendering/RootInlineBox.h:
(RootInlineBox):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@150258 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/InlineFlowBox.cpp
Source/WebCore/rendering/InlineFlowBox.h
Source/WebCore/rendering/RootInlineBox.cpp
Source/WebCore/rendering/RootInlineBox.h