Changeset 73117 in webkit
- Timestamp:
- Dec 2, 2010 2:12:27 AM (13 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r73116 r73117 1 2010-12-02 Mike Lawther <mikelawther@chromium.org> 2 3 Reviewed by David Hyatt. 4 5 Clean up of iframe scrollbar mode code 6 https://bugs.webkit.org/show_bug.cgi?id=47797 7 8 Pull setChildNeedsLayout/setNeedsLayout calls out of scrollbar mode 9 calculation method and put back into main layout function. 10 Early exit from the scrollbar calc when scrollbars are turned off. 11 12 * page/FrameView.cpp: 13 (WebCore::FrameView::calculateScrollbarModesForLayout): 14 (WebCore::FrameView::layout): 15 1 16 2010-12-02 Hironori Bono <hbono@chromium.org> 2 17 -
trunk/WebCore/page/FrameView.cpp
r73063 r73117 484 484 void FrameView::calculateScrollbarModesForLayout(ScrollbarMode& hMode, ScrollbarMode& vMode) 485 485 { 486 const HTMLFrameOwnerElement* owner = m_frame->ownerElement(); 487 if (owner && (owner->scrollingMode() == ScrollbarAlwaysOff)) { 488 hMode = ScrollbarAlwaysOff; 489 vMode = ScrollbarAlwaysOff; 490 return; 491 } 492 486 493 if (m_canHaveScrollbars) { 487 494 hMode = ScrollbarAuto; … … 499 506 if (body && body->renderer()) { 500 507 if (body->hasTagName(framesetTag) && m_frame->settings() && !m_frame->settings()->frameFlatteningEnabled()) { 501 body->renderer()->setChildNeedsLayout(true);502 508 vMode = ScrollbarAlwaysOff; 503 509 hMode = ScrollbarAlwaysOff; … … 510 516 } else if (rootRenderer) { 511 517 #if ENABLE(SVG) 512 if (documentElement->isSVGElement()) { 513 if (!m_firstLayout && (m_size.width() != layoutWidth() || m_size.height() != layoutHeight())) 514 rootRenderer->setChildNeedsLayout(true); 515 } else 518 if (!documentElement->isSVGElement()) { 516 519 applyOverflowToViewport(rootRenderer, hMode, vMode); 517 520 #else … … 519 522 #endif 520 523 } 521 #ifdef INSTRUMENT_LAYOUT_SCHEDULING 522 if (m_firstLayout && !document->ownerElement()) 523 printf("Elapsed time before first layout: %d\n", document->elapsedTime()); 524 #endif 525 } 526 527 HTMLFrameOwnerElement* owner = m_frame->ownerElement(); 528 if (owner && (owner->scrollingMode() == ScrollbarAlwaysOff)) { 529 hMode = ScrollbarAlwaysOff; 530 vMode = ScrollbarAlwaysOff; 531 } 524 } 525 } 532 526 } 533 527 … … 755 749 m_nestedLayoutCount++; 756 750 751 if (!m_layoutRoot) { 752 Document* document = m_frame->document(); 753 Node* documentElement = document->documentElement(); 754 RenderObject* rootRenderer = documentElement ? documentElement->renderer() : 0; 755 Node* body = document->body(); 756 if (body && body->renderer()) { 757 if (body->hasTagName(framesetTag) && m_frame->settings() && !m_frame->settings()->frameFlatteningEnabled()) { 758 body->renderer()->setChildNeedsLayout(true); 759 } else if (body->hasTagName(bodyTag)) { 760 if (!m_firstLayout && m_size.height() != layoutHeight() && body->renderer()->enclosingBox()->stretchesToViewport()) 761 body->renderer()->setChildNeedsLayout(true); 762 } 763 } else if (rootRenderer) { 764 #if ENABLE(SVG) 765 if (documentElement->isSVGElement()) { 766 if (!m_firstLayout && (m_size.width() != layoutWidth() || m_size.height() != layoutHeight())) 767 rootRenderer->setChildNeedsLayout(true); 768 } 769 #endif 770 } 771 772 #ifdef INSTRUMENT_LAYOUT_SCHEDULING 773 if (m_firstLayout && !document->ownerElement()) 774 printf("Elapsed time before first layout: %d\n", document->elapsedTime()); 775 #endif 776 } 777 757 778 ScrollbarMode hMode; 758 ScrollbarMode vMode; 759 779 ScrollbarMode vMode; 760 780 calculateScrollbarModesForLayout(hMode, vMode); 761 781
Note: See TracChangeset
for help on using the changeset viewer.