Don't rely on the fact that StaticPosition happens to be defined as 0
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Mar 2013 23:40:19 +0000 (23:40 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Mar 2013 23:40:19 +0000 (23:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=110123

Also made the expression slightly less convoluted.

Patch by Morten Stenshorne <mstensho@opera.com> on 2013-03-11
Reviewed by Alexey Proskuryakov.

No new tests. This is just code cleanup.

* rendering/RenderObject.cpp:
(WebCore::RenderObject::containingBlock):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@145428 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderObject.cpp

index fe30d1a..59a7914 100644 (file)
@@ -1,3 +1,17 @@
+2013-03-11  Morten Stenshorne  <mstensho@opera.com>
+
+        Don't rely on the fact that StaticPosition happens to be defined as 0
+        https://bugs.webkit.org/show_bug.cgi?id=110123
+
+        Also made the expression slightly less convoluted.
+
+        Reviewed by Alexey Proskuryakov.
+
+        No new tests. This is just code cleanup.
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::containingBlock):
+
 2013-03-11  Adam Barth  <abarth@webkit.org>
 
         Unreviewed attempt to fix build after http://trac.webkit.org/changeset/145421.
index c76b00a..706d1ec 100644 (file)
@@ -783,7 +783,7 @@ RenderBlock* RenderObject::containingBlock() const
             // list in all RenderInlines and lets us return a strongly-typed RenderBlock* result
             // from this method.  The container() method can actually be used to obtain the
             // inline directly.
-            if (!o->style()->position() == StaticPosition && !(o->isInline() && !o->isReplaced()))
+            if (o->style()->position() != StaticPosition && (!o->isInline() || o->isReplaced()))
                 break;
             if (o->isRenderView())
                 break;