Title: [184304] trunk/Source/WebCore
- Revision
- 184304
- Author
- [email protected]
- Date
- 2015-05-13 13:51:37 -0700 (Wed, 13 May 2015)
Log Message
Going back after resizing causes scroll knob to appear in the middle of the page
https://bugs.webkit.org/show_bug.cgi?id=144968
<rdar://problem/18299827>
Reviewed by Beth Dakin.
* history/CachedPage.cpp:
(WebCore::CachedPage::restore):
(WebCore::CachedPage::clear):
* history/CachedPage.h:
(WebCore::CachedPage::markForContentsSizeChanged):
* history/PageCache.cpp:
(WebCore::PageCache::markPagesForContentsSizeChanged):
* history/PageCache.h:
Add a flag that will cause us to call updateContentsSize() after a page
comes out of the page cache, if necessary.
* page/FrameView.cpp:
(WebCore::FrameView::setContentsSize):
* page/FrameView.h:
Mark all cached pages for this frame as needing updateContentsSize()
when setContentsSize happens. This will ensure that scrollbar layers
are repositioned when coming out of the page cache.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (184303 => 184304)
--- trunk/Source/WebCore/ChangeLog 2015-05-13 20:42:18 UTC (rev 184303)
+++ trunk/Source/WebCore/ChangeLog 2015-05-13 20:51:37 UTC (rev 184304)
@@ -1,3 +1,29 @@
+2015-05-13 Timothy Horton <[email protected]>
+
+ Going back after resizing causes scroll knob to appear in the middle of the page
+ https://bugs.webkit.org/show_bug.cgi?id=144968
+ <rdar://problem/18299827>
+
+ Reviewed by Beth Dakin.
+
+ * history/CachedPage.cpp:
+ (WebCore::CachedPage::restore):
+ (WebCore::CachedPage::clear):
+ * history/CachedPage.h:
+ (WebCore::CachedPage::markForContentsSizeChanged):
+ * history/PageCache.cpp:
+ (WebCore::PageCache::markPagesForContentsSizeChanged):
+ * history/PageCache.h:
+ Add a flag that will cause us to call updateContentsSize() after a page
+ comes out of the page cache, if necessary.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::setContentsSize):
+ * page/FrameView.h:
+ Mark all cached pages for this frame as needing updateContentsSize()
+ when setContentsSize happens. This will ensure that scrollbar layers
+ are repositioned when coming out of the page cache.
+
2015-05-13 Beth Dakin <[email protected]>
Need SPI to set the overlay scroll bar style
Modified: trunk/Source/WebCore/history/CachedPage.cpp (184303 => 184304)
--- trunk/Source/WebCore/history/CachedPage.cpp 2015-05-13 20:42:18 UTC (rev 184303)
+++ trunk/Source/WebCore/history/CachedPage.cpp 2015-05-13 20:51:37 UTC (rev 184304)
@@ -116,6 +116,11 @@
page.captionPreferencesChanged();
#endif
+ if (m_needsUpdateContentsSize) {
+ if (FrameView* frameView = page.mainFrame().view())
+ frameView->updateContentsSize();
+ }
+
clear();
}
@@ -130,6 +135,7 @@
m_needsCaptionPreferencesChanged = false;
#endif
m_needsDeviceOrPageScaleChanged = false;
+ m_needsUpdateContentsSize = false;
}
bool CachedPage::hasExpired() const
Modified: trunk/Source/WebCore/history/CachedPage.h (184303 => 184304)
--- trunk/Source/WebCore/history/CachedPage.h 2015-05-13 20:42:18 UTC (rev 184303)
+++ trunk/Source/WebCore/history/CachedPage.h 2015-05-13 20:51:37 UTC (rev 184304)
@@ -57,6 +57,8 @@
void markForDeviceOrPageScaleChanged() { m_needsDeviceOrPageScaleChanged = true; }
+ void markForContentsSizeChanged() { m_needsUpdateContentsSize = true; }
+
private:
double m_expirationTime;
std::unique_ptr<CachedFrame> m_cachedMainFrame;
@@ -66,6 +68,7 @@
bool m_needsCaptionPreferencesChanged { false };
#endif
bool m_needsDeviceOrPageScaleChanged { false };
+ bool m_needsUpdateContentsSize { false };
};
} // namespace WebCore
Modified: trunk/Source/WebCore/history/PageCache.cpp (184303 => 184304)
--- trunk/Source/WebCore/history/PageCache.cpp 2015-05-13 20:42:18 UTC (rev 184303)
+++ trunk/Source/WebCore/history/PageCache.cpp 2015-05-13 20:51:37 UTC (rev 184304)
@@ -399,6 +399,15 @@
}
}
+void PageCache::markPagesForContentsSizeChanged(Page& page)
+{
+ for (auto& item : m_items) {
+ CachedPage& cachedPage = *item->m_cachedPage;
+ if (&page.mainFrame() == &cachedPage.cachedMainFrame()->view()->frame())
+ cachedPage.markForContentsSizeChanged();
+ }
+}
+
#if ENABLE(VIDEO_TRACK)
void PageCache::markPagesForCaptionPreferencesChanged()
{
Modified: trunk/Source/WebCore/history/PageCache.h (184303 => 184304)
--- trunk/Source/WebCore/history/PageCache.h 2015-05-13 20:42:18 UTC (rev 184303)
+++ trunk/Source/WebCore/history/PageCache.h 2015-05-13 20:51:37 UTC (rev 184304)
@@ -65,6 +65,7 @@
// Will mark all cached pages associated with the given page as needing style recalc.
void markPagesForFullStyleRecalc(Page&);
void markPagesForDeviceOrPageScaleChanged(Page&);
+ void markPagesForContentsSizeChanged(Page&);
#if ENABLE(VIDEO_TRACK)
void markPagesForCaptionPreferencesChanged();
#endif
Modified: trunk/Source/WebCore/page/FrameView.cpp (184303 => 184304)
--- trunk/Source/WebCore/page/FrameView.cpp 2015-05-13 20:42:18 UTC (rev 184303)
+++ trunk/Source/WebCore/page/FrameView.cpp 2015-05-13 20:51:37 UTC (rev 184304)
@@ -61,6 +61,7 @@
#include "MemoryCache.h"
#include "MemoryPressureHandler.h"
#include "OverflowEvent.h"
+#include "PageCache.h"
#include "PageOverlayController.h"
#include "ProgressTracker.h"
#include "RenderEmbeddedObject.h"
@@ -583,8 +584,10 @@
page->chrome().contentsSizeChanged(&frame(), size); // Notify only.
- if (frame().isMainFrame())
+ if (frame().isMainFrame()) {
frame().mainFrame().pageOverlayController().didChangeDocumentSize();
+ PageCache::singleton().markPagesForContentsSizeChanged(*page);
+ }
ASSERT(m_deferSetNeedsLayoutCount);
m_deferSetNeedsLayoutCount--;
Modified: trunk/Source/WebCore/page/FrameView.h (184303 => 184304)
--- trunk/Source/WebCore/page/FrameView.h 2015-05-13 20:42:18 UTC (rev 184303)
+++ trunk/Source/WebCore/page/FrameView.h 2015-05-13 20:51:37 UTC (rev 184304)
@@ -104,6 +104,7 @@
virtual bool avoidScrollbarCreation() const override;
virtual void setContentsSize(const IntSize&) override;
+ virtual void updateContentsSize() override;
void layout(bool allowSubtree = true);
WEBCORE_EXPORT bool didFirstLayout() const;
@@ -606,7 +607,6 @@
WEBCORE_EXPORT void adjustTiledBackingCoverage();
virtual void repaintContentRectangle(const IntRect&) override;
- virtual void updateContentsSize() override;
virtual void addedOrRemovedScrollbar() override;
virtual void delegatesScrollingDidChange() override;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes