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/rendering/RenderBlock.cpp

Issue 268833003: Refactor avoidsFloats() to reflect CSS2.1 spec more clearly (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 years, 6 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
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 1494 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 void RenderBlock::addVisualOverflowFromTheme() 1505 void RenderBlock::addVisualOverflowFromTheme()
1506 { 1506 {
1507 if (!style()->hasAppearance()) 1507 if (!style()->hasAppearance())
1508 return; 1508 return;
1509 1509
1510 IntRect inflatedRect = pixelSnappedBorderBoxRect(); 1510 IntRect inflatedRect = pixelSnappedBorderBoxRect();
1511 RenderTheme::theme().adjustRepaintRect(this, inflatedRect); 1511 RenderTheme::theme().adjustRepaintRect(this, inflatedRect);
1512 addVisualOverflow(inflatedRect); 1512 addVisualOverflow(inflatedRect);
1513 } 1513 }
1514 1514
1515 bool RenderBlock::createsBlockFormattingContext() const
1516 {
1517 return isInlineBlockOrInlineTable() || isFloatingOrOutOfFlowPositioned() || hasOverflowClip() || isFlexItemIncludingDeprecated()
1518 || style()->specifiesColumns() || isRenderFlowThread() || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot() || isDocumentElement( ) || style()->columnSpan();
1519 }
1520
1521 void RenderBlock::updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, R enderBox* child) 1515 void RenderBlock::updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, R enderBox* child)
1522 { 1516 {
1523 // FIXME: Technically percentage height objects only need a relayout if thei r percentage isn't going to be turned into 1517 // FIXME: Technically percentage height objects only need a relayout if thei r percentage isn't going to be turned into
1524 // an auto value. Add a method to determine this, so that we can avoid the r elayout. 1518 // an auto value. Add a method to determine this, so that we can avoid the r elayout.
1525 if (relayoutChildren || (child->hasRelativeLogicalHeight() && !isRenderView( ))) 1519 if (relayoutChildren || (child->hasRelativeLogicalHeight() && !isRenderView( )))
1526 child->setChildNeedsLayout(MarkOnlyThis); 1520 child->setChildNeedsLayout(MarkOnlyThis);
1527 1521
1528 // If relayoutChildren is set and the child has percentage padding or an emb edded content box, we also need to invalidate the childs pref widths. 1522 // If relayoutChildren is set and the child has percentage padding or an emb edded content box, we also need to invalidate the childs pref widths.
1529 if (relayoutChildren && child->needsPreferredWidthsRecalculation()) 1523 if (relayoutChildren && child->needsPreferredWidthsRecalculation())
1530 child->setPreferredLogicalWidthsDirty(MarkOnlyThis); 1524 child->setPreferredLogicalWidthsDirty(MarkOnlyThis);
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after
2758 afterLowest = lowestDirtyLine; 2752 afterLowest = lowestDirtyLine;
2759 lowestDirtyLine = lowestDirtyLine->prevRootBox(); 2753 lowestDirtyLine = lowestDirtyLine->prevRootBox();
2760 } 2754 }
2761 2755
2762 while (afterLowest && afterLowest != highest && (afterLowest->lineBottomWith Leading() >= logicalTop || afterLowest->lineBottomWithLeading() < 0)) { 2756 while (afterLowest && afterLowest != highest && (afterLowest->lineBottomWith Leading() >= logicalTop || afterLowest->lineBottomWithLeading() < 0)) {
2763 afterLowest->markDirty(); 2757 afterLowest->markDirty();
2764 afterLowest = afterLowest->prevRootBox(); 2758 afterLowest = afterLowest->prevRootBox();
2765 } 2759 }
2766 } 2760 }
2767 2761
2768 bool RenderBlock::avoidsFloats() const
2769 {
2770 // Floats can't intrude into our box if we have a non-auto column count or w idth.
2771 return RenderBox::avoidsFloats() || !style()->hasAutoColumnCount() || !style ()->hasAutoColumnWidth();
2772 }
2773
2774 bool RenderBlock::isPointInOverflowControl(HitTestResult& result, const LayoutPo int& locationInContainer, const LayoutPoint& accumulatedOffset) 2762 bool RenderBlock::isPointInOverflowControl(HitTestResult& result, const LayoutPo int& locationInContainer, const LayoutPoint& accumulatedOffset)
2775 { 2763 {
2776 if (!scrollsOverflow()) 2764 if (!scrollsOverflow())
2777 return false; 2765 return false;
2778 2766
2779 return layer()->scrollableArea()->hitTestOverflowControls(result, roundedInt Point(locationInContainer - toLayoutSize(accumulatedOffset))); 2767 return layer()->scrollableArea()->hitTestOverflowControls(result, roundedInt Point(locationInContainer - toLayoutSize(accumulatedOffset)));
2780 } 2768 }
2781 2769
2782 Node* RenderBlock::nodeForHitTest() const 2770 Node* RenderBlock::nodeForHitTest() const
2783 { 2771 {
(...skipping 2253 matching lines...) Expand 10 before | Expand all | Expand 10 after
5037 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 5025 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
5038 { 5026 {
5039 showRenderObject(); 5027 showRenderObject();
5040 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 5028 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
5041 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 5029 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
5042 } 5030 }
5043 5031
5044 #endif 5032 #endif
5045 5033
5046 } // namespace WebCore 5034 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698