Optimize relativePositionOffset() to avoid doing unnecessary work
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 May 2015 18:37:51 +0000 (18:37 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 May 2015 18:37:51 +0000 (18:37 +0000)
commit2c26760edca9ec4056d4ff614c4919082a0ea5cd
treecaf41f749e12098e21d13ab1a7c72fbcad0fad87
parent9e4a420993586db9496e8581292113b25c54ae8e
Optimize relativePositionOffset() to avoid doing unnecessary work
https://bugs.webkit.org/show_bug.cgi?id=144698

Reviewed by Simon Fraser.

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::relativePositionOffset):

Patch relativePositionOffset to avoid doing unnecessary work in the common case where
all values of top/left/right/bottom are either auto or fixed. We no longer fetch
containingBlock() into a local always, but instead just invoke the function only
when necessary.

Also avoid computing the percentage-relative maximum for the top/right/bottom/left lengths
when they are fixed values, since that maximum won't be examined at all.

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