Fix access to m_markupBox in WebCore::EllipsisBox::paint
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Aug 2012 02:14:23 +0000 (02:14 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Aug 2012 02:14:23 +0000 (02:14 +0000)
commitc5f94570f6144aafed76f7a832df83bfd67f9873
treee7dbac66507e920964fe13044a8063e155f66399
parentdaf90150b8a84223b802cb58d68697e2f1e86371
Fix access to m_markupBox in WebCore::EllipsisBox::paint
https://bugs.webkit.org/show_bug.cgi?id=91138

Reviewed by Abhishek Arya.

Source/WebCore:

EllipsisBox would hold on to m_markupBox, which would then get destroyed during
the followup layoutIfNeeded in layoutVerticalBox. Instead, have EllipsisBox
dynamically grab to pointer to the markup box during paint since there's no
straightforward way to notify the EllipsisBox that the markupBox has been destroyed
and/or point it at the new markupBox.

Test: fast/overflow/line-clamp-and-columns.html

* rendering/EllipsisBox.cpp:
(WebCore::EllipsisBox::paint):
(WebCore):
(WebCore::EllipsisBox::paintMarkupBox):
* rendering/EllipsisBox.h:
(WebCore::EllipsisBox::EllipsisBox):
Just store a boolean that we have a markup box that needs painting.
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
Clearing the override size right after setting it was incorrect because
there are cases where we'll do a followup layout in layoutVerticalBox, at which
point we'll still need the override size.
(WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):
Clear the override size here to handle cases where line clamp is removed since
we don't call applyLineClamp in those cases.

LayoutTests:

* fast/overflow/line-clamp-and-columns-expected.html: Added.
* fast/overflow/line-clamp-and-columns.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125635 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/overflow/line-clamp-and-columns-expected.html [new file with mode: 0644]
LayoutTests/fast/overflow/line-clamp-and-columns.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/EllipsisBox.cpp
Source/WebCore/rendering/EllipsisBox.h
Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp