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

Side by Side Diff: Source/core/layout/LayoutBlock.cpp

Issue 952273006: Make the constructor of a LayoutRect from an IntRect explicit. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayerScrollableArea.cpp ('k') | Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 1391
1392 bool LayoutBlock::updateImageLoadingPriorities() 1392 bool LayoutBlock::updateImageLoadingPriorities()
1393 { 1393 {
1394 Vector<ImageResource*> images; 1394 Vector<ImageResource*> images;
1395 appendImagesFromStyle(images, styleRef()); 1395 appendImagesFromStyle(images, styleRef());
1396 1396
1397 if (images.isEmpty()) 1397 if (images.isEmpty())
1398 return false; 1398 return false;
1399 1399
1400 LayoutRect viewBounds = viewRect(); 1400 LayoutRect viewBounds = viewRect();
1401 LayoutRect objectBounds = absoluteContentBox(); 1401 LayoutRect objectBounds(absoluteContentBox());
1402 // The object bounds might be empty right now, so intersects will fail since it doesn't deal 1402 // The object bounds might be empty right now, so intersects will fail since it doesn't deal
1403 // with empty rects. Use LayoutRect::contains in that case. 1403 // with empty rects. Use LayoutRect::contains in that case.
1404 bool isVisible; 1404 bool isVisible;
1405 if (!objectBounds.isEmpty()) 1405 if (!objectBounds.isEmpty())
1406 isVisible = viewBounds.intersects(objectBounds); 1406 isVisible = viewBounds.intersects(objectBounds);
1407 else 1407 else
1408 isVisible = viewBounds.contains(objectBounds); 1408 isVisible = viewBounds.contains(objectBounds);
1409 1409
1410 ResourceLoadPriorityOptimizer::VisibilityStatus status = isVisible ? 1410 ResourceLoadPriorityOptimizer::VisibilityStatus status = isVisible ?
1411 ResourceLoadPriorityOptimizer::Visible : ResourceLoadPriorityOptimizer:: NotVisible; 1411 ResourceLoadPriorityOptimizer::Visible : ResourceLoadPriorityOptimizer:: NotVisible;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1523 } 1523 }
1524 } 1524 }
1525 1525
1526 void LayoutBlock::addVisualOverflowFromTheme() 1526 void LayoutBlock::addVisualOverflowFromTheme()
1527 { 1527 {
1528 if (!style()->hasAppearance()) 1528 if (!style()->hasAppearance())
1529 return; 1529 return;
1530 1530
1531 IntRect inflatedRect = pixelSnappedBorderBoxRect(); 1531 IntRect inflatedRect = pixelSnappedBorderBoxRect();
1532 LayoutTheme::theme().adjustPaintInvalidationRect(this, inflatedRect); 1532 LayoutTheme::theme().adjustPaintInvalidationRect(this, inflatedRect);
1533 addVisualOverflow(inflatedRect); 1533 addVisualOverflow(LayoutRect(inflatedRect));
1534 } 1534 }
1535 1535
1536 bool LayoutBlock::createsNewFormattingContext() const 1536 bool LayoutBlock::createsNewFormattingContext() const
1537 { 1537 {
1538 return isInlineBlockOrInlineTable() || isFloatingOrOutOfFlowPositioned() || hasOverflowClip() || isFlexItemIncludingDeprecated() 1538 return isInlineBlockOrInlineTable() || isFloatingOrOutOfFlowPositioned() || hasOverflowClip() || isFlexItemIncludingDeprecated()
1539 || style()->specifiesColumns() || isLayoutFlowThread() || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot() 1539 || style()->specifiesColumns() || isLayoutFlowThread() || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot()
1540 || isDocumentElement() || (document().regionBasedColumnsEnabled() ? isCo lumnSpanAll() : style()->columnSpan()) || isGridItem(); 1540 || isDocumentElement() || (document().regionBasedColumnsEnabled() ? isCo lumnSpanAll() : style()->columnSpan()) || isGridItem();
1541 } 1541 }
1542 1542
1543 void LayoutBlock::updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, L ayoutBox& child) 1543 void LayoutBlock::updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, L ayoutBox& child)
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
2319 LayoutRect m_colRect; 2319 LayoutRect m_colRect;
2320 }; 2320 };
2321 2321
2322 bool LayoutBlock::hitTestColumns(const HitTestRequest& request, HitTestResult& r esult, const HitTestLocation& locationInContainer, const LayoutPoint& accumulate dOffset, HitTestAction hitTestAction) 2322 bool LayoutBlock::hitTestColumns(const HitTestRequest& request, HitTestResult& r esult, const HitTestLocation& locationInContainer, const LayoutPoint& accumulate dOffset, HitTestAction hitTestAction)
2323 { 2323 {
2324 // We need to do multiple passes, breaking up our hit testing into strips. 2324 // We need to do multiple passes, breaking up our hit testing into strips.
2325 if (!hasColumns()) 2325 if (!hasColumns())
2326 return false; 2326 return false;
2327 2327
2328 for (ColumnRectIterator it(*this); it.hasMore(); it.advance()) { 2328 for (ColumnRectIterator it(*this); it.hasMore(); it.advance()) {
2329 LayoutRect hitRect = locationInContainer.boundingBox(); 2329 LayoutRect hitRect = LayoutRect(locationInContainer.boundingBox());
2330 LayoutRect colRect = it.columnRect(); 2330 LayoutRect colRect = it.columnRect();
2331 colRect.moveBy(accumulatedOffset); 2331 colRect.moveBy(accumulatedOffset);
2332 if (locationInContainer.intersects(colRect)) { 2332 if (locationInContainer.intersects(colRect)) {
2333 // The point is inside this column. 2333 // The point is inside this column.
2334 // Adjust accumulatedOffset to change where we hit test. 2334 // Adjust accumulatedOffset to change where we hit test.
2335 LayoutSize offset; 2335 LayoutSize offset;
2336 it.adjust(offset); 2336 it.adjust(offset);
2337 LayoutPoint finalLocation = accumulatedOffset + offset; 2337 LayoutPoint finalLocation = accumulatedOffset + offset;
2338 if (!result.isRectBasedTest() || colRect.contains(hitRect)) 2338 if (!result.isRectBasedTest() || colRect.contains(hitRect))
2339 return hitTestContents(request, result, locationInContainer, fin alLocation, hitTestAction) || (hitTestAction == HitTestFloat && hitTestFloats(re quest, result, locationInContainer, finalLocation)); 2339 return hitTestContents(request, result, locationInContainer, fin alLocation, hitTestAction) || (hitTestAction == HitTestFloat && hitTestFloats(re quest, result, locationInContainer, finalLocation));
(...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after
3929 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const 3929 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const
3930 { 3930 {
3931 showLayoutObject(); 3931 showLayoutObject();
3932 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 3932 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
3933 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 3933 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
3934 } 3934 }
3935 3935
3936 #endif 3936 #endif
3937 3937
3938 } // namespace blink 3938 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayerScrollableArea.cpp ('k') | Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698