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

Unified Diff: Source/core/rendering/RenderBlock.cpp

Issue 404993002: Move fitBorderToLinesIfNeeded and most of deleteLineBoxTree into RenderBlockFlow. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/RenderBlockFlow.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBlock.cpp
diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp
index 0c49fcb0e7e603fc40180ac2d2795519e84c35c6..9c91ba9dbd7ac85bec2bf97c2704ce2edb638ffc 100644
--- a/Source/core/rendering/RenderBlock.cpp
+++ b/Source/core/rendering/RenderBlock.cpp
@@ -972,10 +972,7 @@ static void getInlineRun(RenderObject* start, RenderObject* boundary,
void RenderBlock::deleteLineBoxTree()
{
- m_lineBoxes.deleteLineBoxTree();
-
- if (AXObjectCache* cache = document().existingAXObjectCache())
- cache->recomputeIsIgnored(this);
+ ASSERT(!m_lineBoxes.firstLineBox());
leviw_travelin_and_unemployed 2014/07/21 18:36:45 Your subject line led me to believe this was going
}
void RenderBlock::makeChildrenNonInline(RenderObject *insertionPoint)
@@ -4300,60 +4297,6 @@ int RenderBlock::heightForLineCount(int l)
return getHeightForLineCount(this, l, true, count);
}
-void RenderBlock::adjustForBorderFit(LayoutUnit x, LayoutUnit& left, LayoutUnit& right) const
-{
- // We don't deal with relative positioning. Our assumption is that you shrink to fit the lines without accounting
- // for either overflow or translations via relative positioning.
- if (style()->visibility() == VISIBLE) {
- if (childrenInline()) {
- for (RootInlineBox* box = firstRootBox(); box; box = box->nextRootBox()) {
- if (box->firstChild())
- left = std::min(left, x + static_cast<LayoutUnit>(box->firstChild()->x()));
- if (box->lastChild())
- right = std::max(right, x + static_cast<LayoutUnit>(ceilf(box->lastChild()->logicalRight())));
- }
- } else {
- for (RenderBox* obj = firstChildBox(); obj; obj = obj->nextSiblingBox()) {
- if (!obj->isFloatingOrOutOfFlowPositioned()) {
- if (obj->isRenderBlockFlow() && !obj->hasOverflowClip())
- toRenderBlock(obj)->adjustForBorderFit(x + obj->x(), left, right);
- else if (obj->style()->visibility() == VISIBLE) {
- // We are a replaced element or some kind of non-block-flow object.
- left = std::min(left, x + obj->x());
- right = std::max(right, x + obj->x() + obj->width());
- }
- }
- }
- }
- }
-}
-
-void RenderBlock::fitBorderToLinesIfNeeded()
-{
- if (style()->borderFit() == BorderFitBorder || hasOverrideWidth())
- return;
-
- // Walk any normal flow lines to snugly fit.
- LayoutUnit left = LayoutUnit::max();
- LayoutUnit right = LayoutUnit::min();
- LayoutUnit oldWidth = contentWidth();
- adjustForBorderFit(0, left, right);
-
- // Clamp to our existing edges. We can never grow. We only shrink.
- LayoutUnit leftEdge = borderLeft() + paddingLeft();
- LayoutUnit rightEdge = leftEdge + oldWidth;
- left = std::min(rightEdge, std::max(leftEdge, left));
- right = std::max(left, std::min(rightEdge, right));
-
- LayoutUnit newContentWidth = right - left;
- if (newContentWidth == oldWidth)
- return;
-
- setOverrideLogicalContentWidth(newContentWidth);
- layoutBlock(false);
- clearOverrideLogicalContentWidth();
-}
-
void RenderBlock::clearTruncation()
{
if (style()->visibility() == VISIBLE) {
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/RenderBlockFlow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698