Title: [154045] trunk/Source/WebCore
Revision
154045
Author
[email protected]
Date
2013-08-14 04:29:32 -0700 (Wed, 14 Aug 2013)

Log Message

ASSERT(m_frame->view() == this) fails
https://bugs.webkit.org/show_bug.cgi?id=119015

Reviewed by Simon Fraser.

Introduced the method fixedLayoutSizeChanged and made it chack if the view
is attached to the frame before issuing contentsResized.

* page/FrameView.cpp:
(WebCore::FrameView::fixedLayoutSizeChanged):
* page/FrameView.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::setFixedLayoutSize):
(WebCore::ScrollView::setUseFixedLayout):
(WebCore::ScrollView::fixedLayoutSizeChanged):
* platform/ScrollView.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (154044 => 154045)


--- trunk/Source/WebCore/ChangeLog	2013-08-14 10:40:40 UTC (rev 154044)
+++ trunk/Source/WebCore/ChangeLog	2013-08-14 11:29:32 UTC (rev 154045)
@@ -1,3 +1,22 @@
+2013-08-14  Allan Sandfeld Jensen  <[email protected]>
+
+        ASSERT(m_frame->view() == this) fails
+        https://bugs.webkit.org/show_bug.cgi?id=119015
+
+        Reviewed by Simon Fraser.
+
+        Introduced the method fixedLayoutSizeChanged and made it chack if the view
+        is attached to the frame before issuing contentsResized.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::fixedLayoutSizeChanged):
+        * page/FrameView.h:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::setFixedLayoutSize):
+        (WebCore::ScrollView::setUseFixedLayout):
+        (WebCore::ScrollView::fixedLayoutSizeChanged):
+        * platform/ScrollView.h:
+
 2013-08-13  Sergio Villar Senin  <[email protected]>
 
         [CSS Grid Layout] Align our grid-line handling with the updated specification

Modified: trunk/Source/WebCore/page/FrameView.cpp (154044 => 154045)


--- trunk/Source/WebCore/page/FrameView.cpp	2013-08-14 10:40:40 UTC (rev 154044)
+++ trunk/Source/WebCore/page/FrameView.cpp	2013-08-14 11:29:32 UTC (rev 154045)
@@ -2205,6 +2205,15 @@
     setNeedsLayout();
 }
 
+void FrameView::fixedLayoutSizeChanged()
+{
+    // Can be triggered before the view is set, see comment in FrameView::visibleContentsResized().
+    // An ASSERT is triggered when a view schedules a layout before being attached to a frame.
+    if (!frame()->view())
+        return;
+    ScrollView::fixedLayoutSizeChanged();
+}
+
 void FrameView::visibleContentsResized()
 {
     // We check to make sure the view is attached to a frame() as this method can

Modified: trunk/Source/WebCore/page/FrameView.h (154044 => 154045)


--- trunk/Source/WebCore/page/FrameView.h	2013-08-14 10:40:40 UTC (rev 154044)
+++ trunk/Source/WebCore/page/FrameView.h	2013-08-14 11:29:32 UTC (rev 154045)
@@ -478,6 +478,7 @@
     virtual void repaintContentRectangle(const IntRect&, bool immediate);
     virtual void contentsResized() OVERRIDE;
     virtual void visibleContentsResized();
+    virtual void fixedLayoutSizeChanged() OVERRIDE;
 
     virtual void delegatesScrollingDidChange();
 

Modified: trunk/Source/WebCore/platform/ScrollView.cpp (154044 => 154045)


--- trunk/Source/WebCore/platform/ScrollView.cpp	2013-08-14 10:40:40 UTC (rev 154044)
+++ trunk/Source/WebCore/platform/ScrollView.cpp	2013-08-14 11:29:32 UTC (rev 154045)
@@ -270,9 +270,8 @@
     if (fixedLayoutSize() == newSize)
         return;
     m_fixedLayoutSize = newSize;
-    updateScrollbars(scrollOffset());
     if (m_useFixedLayout)
-        contentsResized();
+        fixedLayoutSizeChanged();
 }
 
 bool ScrollView::useFixedLayout() const
@@ -285,6 +284,12 @@
     if (useFixedLayout() == enable)
         return;
     m_useFixedLayout = enable;
+    if (!m_fixedLayoutSize.isEmpty())
+        fixedLayoutSizeChanged();
+}
+
+void ScrollView::fixedLayoutSizeChanged()
+{
     updateScrollbars(scrollOffset());
     contentsResized();
 }

Modified: trunk/Source/WebCore/platform/ScrollView.h (154044 => 154045)


--- trunk/Source/WebCore/platform/ScrollView.h	2013-08-14 10:40:40 UTC (rev 154044)
+++ trunk/Source/WebCore/platform/ScrollView.h	2013-08-14 11:29:32 UTC (rev 154045)
@@ -163,7 +163,7 @@
     void setFixedLayoutSize(const IntSize&);
     bool useFixedLayout() const;
     void setUseFixedLayout(bool enable);
-    
+
     // Functions for getting/setting the size of the document contained inside the ScrollView (as an IntSize or as individual width and height
     // values).
     virtual IntSize contentsSize() const OVERRIDE; // Always at least as big as the visibleWidth()/visibleHeight().
@@ -312,6 +312,8 @@
 
     virtual void visibleContentsResized() = 0;
     virtual void delegatesScrollingDidChange() { }
+    virtual void fixedLayoutSizeChanged();
+
     // These functions are used to create/destroy scrollbars.
     void setHasHorizontalScrollbar(bool);
     void setHasVerticalScrollbar(bool);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to