Changeset 180848 in webkit
- Timestamp:
- Feb 28, 2015 8:36:39 PM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r180847 r180848 1 2015-02-28 Simon Fraser <simon.fraser@apple.com> 2 3 Viewport units should not dirty style just before we do layout 4 https://bugs.webkit.org/show_bug.cgi?id=141682 5 6 Reviewed by Zalan Bujtas. 7 8 In documents using viewport units, we dirtied style every time layout changed 9 the size of the document. This is nonsensical, because viewport units depend on the 10 viewport size, not the document size. 11 12 Move the style dirtying from layout() into availableContentSizeChanged(). Hook 13 this up for WebKit1 by calling from -[WebFrameView _frameSizeChanged], and, 14 since that causes availableContentSizeChanged() to be called for WK1 for the first 15 time, protect the call to updateScrollbars() with a !platformWidget check. 16 17 Covered by existing viewport unit tests. 18 19 * page/FrameView.cpp: 20 (WebCore::FrameView::layout): 21 (WebCore::FrameView::availableContentSizeChanged): 22 (WebCore::FrameView::viewportSizeForCSSViewportUnits): Add a FIXME comment. Whether 23 scrollbars are ignored depends on the value of the overflow property on the root element. 24 * page/FrameView.h: 25 * platform/ScrollView.cpp: 26 (WebCore::ScrollView::availableContentSizeChanged): 27 1 28 2015-02-28 Andreas Kling <akling@apple.com> 2 29 -
trunk/Source/WebCore/page/FrameView.cpp
r180846 r180848 1289 1289 else if (rootRenderer && rootRenderer->stretchesToViewport()) 1290 1290 rootRenderer->setChildNeedsLayout(); 1291 1292 document.updateViewportUnitsOnResize();1293 1291 } 1294 1292 } … … 2292 2290 void FrameView::availableContentSizeChanged(AvailableSizeChangeReason reason) 2293 2291 { 2292 if (Document* document = frame().document()) 2293 document->updateViewportUnitsOnResize(); 2294 2294 2295 setNeedsLayout(); 2295 2296 ScrollView::availableContentSizeChanged(reason); … … 4727 4728 m_hasOverrideViewportSize = true; 4728 4729 4729 if (Document* document = m_frame->document()) 4730 if (Document* document = m_frame->document()) { 4731 // FIXME: this should probably be updateViewportUnitsOnResize(), but synchronously 4732 // dirtying style here causes assertions on iOS (rdar://problem/19998166). 4730 4733 document->styleResolverChanged(DeferRecalcStyle); 4734 } 4731 4735 } 4732 4736 … … 4736 4740 return m_overrideViewportSize; 4737 4741 4742 // FIXME: the value returned should take into account the value of the overflow 4743 // property on the root element. 4738 4744 return visibleContentRectIncludingScrollbars().size(); 4739 4745 } -
trunk/Source/WebCore/page/FrameView.h
r180615 r180848 489 489 WEBCORE_EXPORT virtual void willEndLiveResize() override; 490 490 491 WEBCORE_EXPORT virtual void availableContentSizeChanged(AvailableSizeChangeReason) override; 492 491 493 void addPaintPendingMilestones(LayoutMilestones); 492 494 void firePaintRelatedMilestonesIfNeeded(); … … 582 584 virtual void repaintContentRectangle(const IntRect&) override; 583 585 virtual void updateContentsSize() override; 584 virtual void availableContentSizeChanged(AvailableSizeChangeReason) override;585 586 virtual void addedOrRemovedScrollbar() override; 586 587 -
trunk/Source/WebCore/platform/ScrollView.cpp
r180615 r180848 367 367 { 368 368 ScrollableArea::availableContentSizeChanged(reason); 369 370 if (platformWidget()) 371 return; 372 369 373 if (reason != AvailableSizeChangeReason::ScrollbarsChanged) 370 374 updateScrollbars(scrollOffset()); -
trunk/Source/WebKit/mac/ChangeLog
r180704 r180848 1 2015-02-28 Simon Fraser <simon.fraser@apple.com> 2 3 Viewport units should not dirty style just before we do layout 4 https://bugs.webkit.org/show_bug.cgi?id=141682 5 6 Reviewed by Zalan Bujtas. 7 8 * WebView/WebFrameView.mm: 9 (-[WebFrameView _frameSizeChanged]): 10 1 11 2015-02-26 Chris Dumez <cdumez@apple.com> 2 12 -
trunk/Source/WebKit/mac/WebView/WebFrameView.mm
r179376 r180848 352 352 if (Frame* coreFrame = [self _web_frame]) { 353 353 if (FrameView* coreFrameView = coreFrame->view()) 354 coreFrameView-> setNeedsLayout();354 coreFrameView->availableContentSizeChanged(ScrollableArea::AvailableSizeChangeReason::AreaSizeChanged); 355 355 } 356 356 }
Note: See TracChangeset
for help on using the changeset viewer.