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

Unified Diff: sky/engine/core/rendering/RenderBlockFlow.cpp

Issue 698613002: Remove border-fit. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 | « sky/engine/core/rendering/RenderBlockFlow.h ('k') | sky/engine/core/rendering/RenderBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/RenderBlockFlow.cpp
diff --git a/sky/engine/core/rendering/RenderBlockFlow.cpp b/sky/engine/core/rendering/RenderBlockFlow.cpp
index 4de0580d0ac312a2cca9dd2f2949f9c05bf995b3..f1c8dedc928711d36b1f7bf0c84a41e300d2a826 100644
--- a/sky/engine/core/rendering/RenderBlockFlow.cpp
+++ b/sky/engine/core/rendering/RenderBlockFlow.cpp
@@ -226,8 +226,6 @@ void RenderBlockFlow::layoutBlock(bool relayoutChildren)
while (!done)
done = layoutBlockFlow(relayoutChildren, layoutScope);
- fitBorderToLinesIfNeeded();
-
updateLayerTransformAfterLayout();
// Update our scroll information if we're overflow:auto/scroll/hidden now that we know if
@@ -1274,58 +1272,6 @@ bool RenderBlockFlow::hitTestFloats(const HitTestRequest& request, HitTestResult
return false;
}
-void RenderBlockFlow::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 (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()) {
- toRenderBlockFlow(obj)->adjustForBorderFit(x + obj->x(), left, right);
- } else {
- // 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 RenderBlockFlow::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();
-}
-
LayoutUnit RenderBlockFlow::logicalLeftFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, LayoutUnit logicalHeight) const
{
// FIXME(sky): remove this.
« no previous file with comments | « sky/engine/core/rendering/RenderBlockFlow.h ('k') | sky/engine/core/rendering/RenderBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698