Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 1653673002: Even more explicit LayoutUnit conversion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@moarConstructors
Patch Set: address comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 setScrollbarsSuppressed(false); 995 setScrollbarsSuppressed(false);
996 } else if (hMode != currentHMode || vMode != currentVMode) { 996 } else if (hMode != currentHMode || vMode != currentVMode) {
997 setScrollbarModes(hMode, vMode); 997 setScrollbarModes(hMode, vMode);
998 } 998 }
999 999
1000 if (needsScrollbarReconstruction()) 1000 if (needsScrollbarReconstruction())
1001 updateScrollbars(scrollOffsetDouble()); 1001 updateScrollbars(scrollOffsetDouble());
1002 1002
1003 LayoutSize oldSize = m_size; 1003 LayoutSize oldSize = m_size;
1004 1004
1005 m_size = LayoutSize(layoutSize().width(), layoutSize().height()); 1005 m_size = LayoutSize(layoutSize());
1006 1006
1007 if (oldSize != m_size && !m_firstLayout) { 1007 if (oldSize != m_size && !m_firstLayout) {
1008 LayoutBox* rootLayoutObject = document->documentElement() ? docu ment->documentElement()->layoutBox() : 0; 1008 LayoutBox* rootLayoutObject = document->documentElement() ? docu ment->documentElement()->layoutBox() : 0;
1009 LayoutBox* bodyLayoutObject = rootLayoutObject && document->body () ? document->body()->layoutBox() : 0; 1009 LayoutBox* bodyLayoutObject = rootLayoutObject && document->body () ? document->body()->layoutBox() : 0;
1010 if (bodyLayoutObject && bodyLayoutObject->stretchesToViewport()) 1010 if (bodyLayoutObject && bodyLayoutObject->stretchesToViewport())
1011 bodyLayoutObject->setChildNeedsLayout(); 1011 bodyLayoutObject->setChildNeedsLayout();
1012 else if (rootLayoutObject && rootLayoutObject->stretchesToViewpo rt()) 1012 else if (rootLayoutObject && rootLayoutObject->stretchesToViewpo rt())
1013 rootLayoutObject->setChildNeedsLayout(); 1013 rootLayoutObject->setChildNeedsLayout();
1014 } 1014 }
1015 1015
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
1409 IntRect updateRect = visibleContentRect(); 1409 IntRect updateRect = visibleContentRect();
1410 ASSERT(layoutView()); 1410 ASSERT(layoutView());
1411 // FIXME: We should not allow paint invalidation out of paint invalidati on state. crbug.com/457415 1411 // FIXME: We should not allow paint invalidation out of paint invalidati on state. crbug.com/457415
1412 DisablePaintInvalidationStateAsserts disabler; 1412 DisablePaintInvalidationStateAsserts disabler;
1413 layoutView()->invalidatePaintRectangle(LayoutRect(updateRect)); 1413 layoutView()->invalidatePaintRectangle(LayoutRect(updateRect));
1414 } 1414 }
1415 if (LayoutPart* frameLayoutObject = m_frame->ownerLayoutObject()) { 1415 if (LayoutPart* frameLayoutObject = m_frame->ownerLayoutObject()) {
1416 if (isEnclosedInCompositingLayer()) { 1416 if (isEnclosedInCompositingLayer()) {
1417 LayoutRect rect(frameLayoutObject->borderLeft() + frameLayoutObject- >paddingLeft(), 1417 LayoutRect rect(frameLayoutObject->borderLeft() + frameLayoutObject- >paddingLeft(),
1418 frameLayoutObject->borderTop() + frameLayoutObject->paddingTop() , 1418 frameLayoutObject->borderTop() + frameLayoutObject->paddingTop() ,
1419 visibleWidth(), visibleHeight()); 1419 LayoutUnit(visibleWidth()), LayoutUnit(visibleHeight()));
1420 // FIXME: We should not allow paint invalidation out of paint invali dation state. crbug.com/457415 1420 // FIXME: We should not allow paint invalidation out of paint invali dation state. crbug.com/457415
1421 DisablePaintInvalidationStateAsserts disabler; 1421 DisablePaintInvalidationStateAsserts disabler;
1422 frameLayoutObject->invalidatePaintRectangle(rect); 1422 frameLayoutObject->invalidatePaintRectangle(rect);
1423 return; 1423 return;
1424 } 1424 }
1425 } 1425 }
1426 1426
1427 hostWindow()->invalidateRect(updateRect); 1427 hostWindow()->invalidateRect(updateRect);
1428 } 1428 }
1429 1429
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after
2710 flooredPageLogicalHeight = static_cast<LayoutUnit>(pageLogicalHeight ); 2710 flooredPageLogicalHeight = static_cast<LayoutUnit>(pageLogicalHeight );
2711 layoutView->setLogicalWidth(flooredPageLogicalWidth); 2711 layoutView->setLogicalWidth(flooredPageLogicalWidth);
2712 layoutView->setPageLogicalHeight(flooredPageLogicalHeight); 2712 layoutView->setPageLogicalHeight(flooredPageLogicalHeight);
2713 layoutView->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidatio n(LayoutInvalidationReason::PrintingChanged); 2713 layoutView->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidatio n(LayoutInvalidationReason::PrintingChanged);
2714 layout(); 2714 layout();
2715 2715
2716 const LayoutRect& updatedDocumentRect = LayoutRect(layoutView->docum entRect()); 2716 const LayoutRect& updatedDocumentRect = LayoutRect(layoutView->docum entRect());
2717 LayoutUnit docLogicalHeight = horizontalWritingMode ? updatedDocumen tRect.height() : updatedDocumentRect.width(); 2717 LayoutUnit docLogicalHeight = horizontalWritingMode ? updatedDocumen tRect.height() : updatedDocumentRect.width();
2718 LayoutUnit docLogicalTop = horizontalWritingMode ? updatedDocumentRe ct.y() : updatedDocumentRect.x(); 2718 LayoutUnit docLogicalTop = horizontalWritingMode ? updatedDocumentRe ct.y() : updatedDocumentRect.x();
2719 LayoutUnit docLogicalRight = horizontalWritingMode ? updatedDocument Rect.maxX() : updatedDocumentRect.maxY(); 2719 LayoutUnit docLogicalRight = horizontalWritingMode ? updatedDocument Rect.maxX() : updatedDocumentRect.maxY();
2720 LayoutUnit clippedLogicalLeft = 0; 2720 LayoutUnit clippedLogicalLeft;
2721 if (!layoutView->style()->isLeftToRightDirection()) 2721 if (!layoutView->style()->isLeftToRightDirection())
2722 clippedLogicalLeft = docLogicalRight - pageLogicalWidth; 2722 clippedLogicalLeft = docLogicalRight - pageLogicalWidth;
2723 LayoutRect overflow(clippedLogicalLeft, docLogicalTop, pageLogicalWi dth, docLogicalHeight); 2723 LayoutRect overflow(clippedLogicalLeft, docLogicalTop, pageLogicalWi dth, docLogicalHeight);
2724 2724
2725 if (!horizontalWritingMode) 2725 if (!horizontalWritingMode)
2726 overflow = overflow.transposedRect(); 2726 overflow = overflow.transposedRect();
2727 layoutView->clearLayoutOverflow(); 2727 layoutView->clearLayoutOverflow();
2728 layoutView->addLayoutOverflow(overflow); // This is how we clip in c ase we overflow again. 2728 layoutView->addLayoutOverflow(overflow); // This is how we clip in c ase we overflow again.
2729 } 2729 }
2730 } 2730 }
(...skipping 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after
4054 return m_hiddenForThrottling && m_crossOriginForThrottling; 4054 return m_hiddenForThrottling && m_crossOriginForThrottling;
4055 } 4055 }
4056 4056
4057 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const 4057 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const
4058 { 4058 {
4059 ASSERT(layoutView()); 4059 ASSERT(layoutView());
4060 return *layoutView(); 4060 return *layoutView();
4061 } 4061 }
4062 4062
4063 } // namespace blink 4063 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698