Roll r96070 back in now that the crash has been fixed in r96130.
Source/WebCore:
Reviewed by Darin Adler.
When non-overlay scrollbars are hidden on a composited iframe, nothing invalidated
the scrollbar areas or the scroll corner, so the scrollbars appear to remain.
Fix by invalidating the scrollbars and scroll corner when they are removed. Invalidation
on scrollbar creation appears to happen via updating the scrollbar style.
Tested by compositing/iframes/repaint-after-losing-scrollbars.html which no longer shows
stale scrollbars when run manually, even though the green squares are missing from the
pixel result (bug 67878).
* page/FrameView.cpp:
(WebCore::FrameView::updateScrollCorner): Pass the corner rect into invalidateScrollCorner().
* platform/ScrollView.cpp:
(WebCore::ScrollView::setHasHorizontalScrollbar): Invalidate the scrollbar area if hiding it.
(WebCore::ScrollView::setHasVerticalScrollbar): Ditto.
(WebCore::ScrollView::updateScrollbars): In the case where both scrollbars are going away,
compute the scroll corner rect while we still have scrollbars, and then invalidate it
explicitly. (updateScrollCorner() doesn't, because it doesn't have access to the old corner
rect.)
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::invalidateScrollCorner): Pass the rect in, because we can't
compute it in the case where the scrollbars are going away.
* platform/ScrollableArea.h: Pass in a rect to invalidateScrollCorner(), which matches
invalidateScrollbar().
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::destroyRootLayer): Pass the corner rect into invalidateScrollCorner().
* rendering/RenderScrollbarPart.cpp: Ditto.
(WebCore::RenderScrollbarPart::imageChanged): Ditto.
LayoutTests:
* compositing/iframes/repaint-after-losing-scrollbars-expected.png:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96138
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-09-27 Simon Fraser <simon.fraser@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=67858
+
+ Roll r96070 back in now that the crash has been fixed in r96130.
+
+ * compositing/iframes/repaint-after-losing-scrollbars-expected.png:
+
2011-09-27 Kaustubh Atrawalkar <kaustubh@motorola.com>
Autofocus on readonly inputs does not focus the element.
+2011-09-27 Simon Fraser <simon.fraser@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=67858
+
+ Roll r96070 back in now that the crash has been fixed in r96130.
+
+ Reviewed by Darin Adler.
+
+ When non-overlay scrollbars are hidden on a composited iframe, nothing invalidated
+ the scrollbar areas or the scroll corner, so the scrollbars appear to remain.
+
+ Fix by invalidating the scrollbars and scroll corner when they are removed. Invalidation
+ on scrollbar creation appears to happen via updating the scrollbar style.
+
+ Tested by compositing/iframes/repaint-after-losing-scrollbars.html which no longer shows
+ stale scrollbars when run manually, even though the green squares are missing from the
+ pixel result (bug 67878).
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::updateScrollCorner): Pass the corner rect into invalidateScrollCorner().
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::setHasHorizontalScrollbar): Invalidate the scrollbar area if hiding it.
+ (WebCore::ScrollView::setHasVerticalScrollbar): Ditto.
+ (WebCore::ScrollView::updateScrollbars): In the case where both scrollbars are going away,
+ compute the scroll corner rect while we still have scrollbars, and then invalidate it
+ explicitly. (updateScrollCorner() doesn't, because it doesn't have access to the old corner
+ rect.)
+ * platform/ScrollableArea.cpp:
+ (WebCore::ScrollableArea::invalidateScrollCorner): Pass the rect in, because we can't
+ compute it in the case where the scrollbars are going away.
+ * platform/ScrollableArea.h: Pass in a rect to invalidateScrollCorner(), which matches
+ invalidateScrollbar().
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::destroyRootLayer): Pass the corner rect into invalidateScrollCorner().
+ * rendering/RenderScrollbarPart.cpp: Ditto.
+ (WebCore::RenderScrollbarPart::imageChanged): Ditto.
+
2011-09-27 Mihai Parparita <mihaip@chromium.org>
Fix Chromium Mac build after r96130.
{
RenderObject* renderer = 0;
RefPtr<RenderStyle> cornerStyle;
+ IntRect cornerRect = scrollCornerRect();
- if (!scrollCornerRect().isEmpty()) {
+ if (!cornerRect.isEmpty()) {
// Try the <body> element first as a scroll corner source.
Document* doc = m_frame->document();
Element* body = doc ? doc->body() : 0;
if (!m_scrollCorner)
m_scrollCorner = new (renderer->renderArena()) RenderScrollbarPart(renderer->document());
m_scrollCorner->setStyle(cornerStyle.release());
- invalidateScrollCorner();
+ invalidateScrollCorner(cornerRect);
} else if (m_scrollCorner) {
m_scrollCorner->destroy();
m_scrollCorner = 0;
didAddHorizontalScrollbar(m_horizontalScrollbar.get());
m_horizontalScrollbar->styleChanged();
} else if (!hasBar && m_horizontalScrollbar) {
+ m_horizontalScrollbar->invalidate();
willRemoveHorizontalScrollbar(m_horizontalScrollbar.get());
removeChild(m_horizontalScrollbar.get());
m_horizontalScrollbar = 0;
didAddVerticalScrollbar(m_verticalScrollbar.get());
m_verticalScrollbar->styleChanged();
} else if (!hasBar && m_verticalScrollbar) {
+ m_verticalScrollbar->invalidate();
willRemoveVerticalScrollbar(m_verticalScrollbar.get());
removeChild(m_verticalScrollbar.get());
m_verticalScrollbar = 0;
m_inUpdateScrollbars = false;
}
+ IntRect oldScrollCornerRect = scrollCornerRect();
+
bool hasHorizontalScrollbar = m_horizontalScrollbar;
bool hasVerticalScrollbar = m_verticalScrollbar;
frameRectsChanged();
positionScrollbarLayers();
updateScrollCorner();
+ if (!m_horizontalScrollbar && !m_verticalScrollbar)
+ invalidateScrollCornerRect(oldScrollCornerRect);
}
IntPoint scrollPoint = adjustScrollPositionWithinRange(IntPoint(desiredOffset)) + IntSize(m_scrollOrigin.x(), m_scrollOrigin.y());
invalidateScrollbarRect(scrollbar, rect);
}
-void ScrollableArea::invalidateScrollCorner()
+void ScrollableArea::invalidateScrollCorner(const IntRect& rect)
{
#if USE(ACCELERATED_COMPOSITING)
if (GraphicsLayer* graphicsLayer = layerForScrollCorner()) {
return;
}
#endif
- invalidateScrollCornerRect(scrollCornerRect());
+ invalidateScrollCornerRect(rect);
}
bool ScrollableArea::hasLayerForHorizontalScrollbar() const
void invalidateScrollbar(Scrollbar*, const IntRect&);
virtual bool isScrollCornerVisible() const = 0;
virtual IntRect scrollCornerRect() const = 0;
- void invalidateScrollCorner();
+ void invalidateScrollCorner(const IntRect&);
virtual void getTickmarks(Vector<IntRect>&) const { }
// This function should be overriden by subclasses to perform the actual
if (m_layerForScrollCorner) {
m_layerForScrollCorner = nullptr;
- m_renderView->frameView()->invalidateScrollCorner();
+ m_renderView->frameView()->invalidateScrollCorner(m_renderView->frameView()->scrollCornerRect());
}
if (m_overflowControlsHostLayer) {
else {
if (FrameView* frameView = view()->frameView()) {
if (frameView->isFrameViewScrollCorner(this)) {
- frameView->invalidateScrollCorner();
+ frameView->invalidateScrollCorner(frameView->scrollCornerRect());
return;
}
}