[webkit-reviews] review granted: [Bug 131117] Tidy up isIsolatedInline() and highestContainingIsolateWithinRoot() : [Attachment 228411] Patch v1

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 7 23:54:58 PDT 2014


Daniel Bates <dbates at webkit.org> has granted David Kilzer (:ddkilzer)
<ddkilzer at webkit.org>'s request for review:
Bug 131117: Tidy up isIsolatedInline() and highestContainingIsolateWithinRoot()
https://bugs.webkit.org/show_bug.cgi?id=131117

Attachment 228411: Patch v1
https://bugs.webkit.org/attachment.cgi?id=228411&action=review

------- Additional Comments from Daniel Bates <dbates at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=228411&action=review


> Source/WebCore/rendering/InlineIterator.h:466
> +    for (RenderObject* root = iter.root(); object && object != root; object
= object->parent()) {

This is OK as-is. Notice that |object| isn't modified outside of the for-loop,
InlineIterator::{renderer, root}() are inline functions (since they are defined
in the class definition) and that we can take advantage of the for-loop
condition to handle the nullity check of |object| instead of performing an
explicit nullity check on line 463. We can write the body of this function so
as to read:

unsigned count = 0;
for (RenderObject* object = iter.renderer(), root = iter.root(); object &&
object != root; object = object->parent()) {
    if (isIsolatedInline(*object))
	++count;
}
return count;


More information about the webkit-reviews mailing list