Clarify RenderElement::adjustStyleDifference()
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Mar 2015 05:41:42 +0000 (05:41 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Mar 2015 05:41:42 +0000 (05:41 +0000)
commit84aaf13811a8f32a54ceb64881578dd13bafb2b4
tree07a367121601f65a1d6a842e1b242c998bce0f45
parentf74cb065ed68ee041bf86fc8788ea06e154a6523
Clarify RenderElement::adjustStyleDifference()
https://bugs.webkit.org/show_bug.cgi?id=142256

Reviewed by David Hyatt.

Make RenderElement::adjustStyleDifference() clearer in two ways.

First, replace lots of if (diff < X) diff = X with
diff = std::max(diff, X). I did this even in cases where diff was
being set unconditionally, because it's never correct to change the diff
to a lesser value.

Second the "set at least SimplifiedLayout, but if we have PositionedMovementOnly
set it to SimplifiedLayoutAndPositionedMovement" was confusingly written.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::adjustStyleDifference):

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