diff --git a/layout/generic/nsLineBox.h b/layout/generic/nsLineBox.h
--- a/layout/generic/nsLineBox.h
+++ b/layout/generic/nsLineBox.h
@@ -790,16 +790,21 @@ class nsLineList_iterator {
 
     iterator_self_type operator++(int)
     {
       iterator_self_type rv(*this);
       mCurrent = mCurrent->_mNext;
       return rv;
     }
 
+    pointer peekNext()
+    {
+      return static_cast<pointer>(mCurrent->_mNext);
+    }
+
     iterator_self_type& operator--()
     {
       mCurrent = mCurrent->_mPrev;
       return *this;
     }
 
     iterator_self_type operator--(int)
     {
