Changeset 220112 in webkit
- Timestamp:
- Aug 1, 2017 2:42:28 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r220111 r220112 1 2017-08-01 Zalan Bujtas <zalan@apple.com> 2 3 REGRESSION (r217197): New Yorker website hangs for a long time on load, lots of blank tiles 4 https://bugs.webkit.org/show_bug.cgi?id=175009 5 <rdar://problem/33505791> 6 7 Reviewed by Simon Fraser. 8 9 * fast/frames/flattening/media-query-growing-content-expected.txt: Added. 10 * fast/frames/flattening/media-query-growing-content.html: Added. 11 * fast/frames/flattening/resources/media-query-min-height-with-flattening.html: Added. 12 1 13 2017-08-01 Youenn Fablet <youenn@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r220109 r220112 1 2017-08-01 Zalan Bujtas <zalan@apple.com> 2 3 REGRESSION (r217197): New Yorker website hangs for a long time on load, lots of blank tiles 4 https://bugs.webkit.org/show_bug.cgi?id=175009 5 <rdar://problem/33505791> 6 7 Reviewed by Simon Fraser. 8 9 This patch ensures that we report the desktop, non-frame-flattened frame size for media queries in subframes. 10 Some websites don't expect the iframes to be expanded to the size of the content and when the media query 11 callback mutates the content (triggering frame resize), they might end up getting into a never ending layout. 12 13 Test: fast/frames/flattening/media-query-growing-content.html 14 15 * css/MediaQueryEvaluator.cpp: 16 (WebCore::orientationEvaluate): 17 (WebCore::aspectRatioEvaluate): 18 (WebCore::heightEvaluate): 19 (WebCore::widthEvaluate): 20 * page/FrameView.cpp: 21 (WebCore::FrameView::layout): 22 (WebCore::FrameView::layoutSizeForMediaQuery const): 23 (WebCore::FrameView::evaluateMediaQueryList): 24 * page/FrameView.h: 25 1 26 2017-07-26 Jiewen Tan <jiewen_tan@apple.com> 2 27 -
trunk/Source/WebCore/css/MediaQueryEvaluator.cpp
r220090 r220112 305 305 return false; 306 306 307 auto width = view->layoutWidth(); 308 auto height = view->layoutHeight(); 309 307 auto viewSize = view->layoutSizeForMediaQuery(); 310 308 if (!is<CSSPrimitiveValue>(value)) { 311 309 // Expression (orientation) evaluates to true if width and height >= 0. 312 return height >= 0 && width>= 0;310 return viewSize.height() >= 0 && viewSize.width() >= 0; 313 311 } 314 312 315 313 auto keyword = downcast<CSSPrimitiveValue>(*value).valueID(); 316 if ( width > height) // Square viewport is portrait.314 if (viewSize.width() > viewSize.height()) // Square viewport is portrait. 317 315 return keyword == CSSValueLandscape; 318 316 return keyword == CSSValuePortrait; … … 325 323 if (!value) 326 324 return true; 327 328 325 FrameView* view = frame.view(); 329 326 if (!view) 330 327 return true; 331 332 return compareAspectRatioValue(value, view ->layoutWidth(), view->layoutHeight(), op);328 auto viewSize = view->layoutSizeForMediaQuery(); 329 return compareAspectRatioValue(value, viewSize.width(), viewSize.height(), op); 333 330 } 334 331 … … 446 443 if (!view) 447 444 return false; 448 int height = view->layout Height();445 int height = view->layoutSizeForMediaQuery().height(); 449 446 if (!value) 450 447 return height; … … 460 457 if (!view) 461 458 return false; 462 int width = view->layout Width();459 int width = view->layoutSizeForMediaQuery().width(); 463 460 if (!value) 464 461 return width; -
trunk/Source/WebCore/page/FrameView.cpp
r219876 r220112 1317 1317 1318 1318 if (inChildFrameLayoutWithFrameFlattening) { 1319 if (!m_frameFlatteningViewSizeForMediaQuery) 1320 m_frameFlatteningViewSizeForMediaQuery = ScrollView::layoutSize(); 1319 1321 startLayoutAtMainFrameViewIfNeeded(allowSubtree); 1320 1322 RenderElement* root = m_layoutRoot ? m_layoutRoot : frame().document()->renderView(); … … 1371 1373 InspectorInstrumentation::mediaQueryResultChanged(document); 1372 1374 } 1373 1374 1375 document.evaluateMediaQueryList(); 1375 1376 1376 // If there is any pagination to apply, it will affect the RenderView's style, so we should 1377 1377 // take care of that now. 1378 1378 applyPaginationToViewport(); 1379 1380 1379 // Always ensure our style info is up-to-date. This can happen in situations where 1381 1380 // the layout beats any sort of style recalc update that needs to occur. … … 5408 5407 return renderView() && renderView()->shouldPlaceBlockDirectionScrollbarOnLeft(); 5409 5408 } 5410 5409 5410 IntSize FrameView::layoutSizeForMediaQuery() const 5411 { 5412 return m_frameFlatteningViewSizeForMediaQuery.value_or(ScrollView::layoutSize()); 5413 } 5414 5411 5415 } // namespace WebCore -
trunk/Source/WebCore/page/FrameView.h
r219668 r220112 217 217 218 218 WEBCORE_EXPORT void adjustViewSize(); 219 219 IntSize layoutSizeForMediaQuery() const; 220 220 221 WEBCORE_EXPORT void setViewportSizeForCSSViewportUnits(IntSize); 221 222 IntSize viewportSizeForCSSViewportUnits() const; … … 891 892 // The intrinsic content size decided by autosizing. 892 893 IntSize m_autoSizeContentSize; 894 // Report the first computed frame view size to media queries. 895 std::optional<IntSize> m_frameFlatteningViewSizeForMediaQuery; 893 896 894 897 std::unique_ptr<ScrollableAreaSet> m_scrollableAreas;
Note: See TracChangeset
for help on using the changeset viewer.