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

Side by Side Diff: Source/core/rendering/RenderFlowThread.cpp

Issue 16033003: [CSSRegions] Constrain auto-height region computation in a different way (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 7 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
« no previous file with comments | « no previous file | no next file » | 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) 2011 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 if (region->hasAutoLogicalHeight()) { 965 if (region->hasAutoLogicalHeight()) {
966 // A forced break can appear only in an auto-height region that didn't h ave a forced break before. 966 // A forced break can appear only in an auto-height region that didn't h ave a forced break before.
967 // This ASSERT is a good-enough heuristic to verify the above condition. 967 // This ASSERT is a good-enough heuristic to verify the above condition.
968 ASSERT(region->maxPageLogicalHeight() == region->overrideLogicalContentH eight()); 968 ASSERT(region->maxPageLogicalHeight() == region->overrideLogicalContentH eight());
969 969
970 mapToUse.set(breakChild, region); 970 mapToUse.set(breakChild, region);
971 971
972 overrideLogicalContentHeightComputed = true; 972 overrideLogicalContentHeightComputed = true;
973 973
974 // Compute the region height pretending that the offsetBreakInCurrentReg ion is the logicalHeight for the auto-height region. 974 // Compute the region height pretending that the offsetBreakInCurrentReg ion is the logicalHeight for the auto-height region.
975 LayoutUnit regionOverrideLogicalContentHeight = region->computeReplacedL ogicalHeightRespectingMinMaxHeight(offsetBreakInCurrentRegion); 975 LayoutUnit regionOverrideLogicalContentHeight = region->constrainContent BoxLogicalHeightByMinMax(offsetBreakInCurrentRegion, -1);
976 976
977 // The new height of this region needs to be smaller than the initial va lue, the max height. A forced break is the only way to change the initial 977 // The new height of this region needs to be smaller than the initial va lue, the max height. A forced break is the only way to change the initial
978 // height of an auto-height region besides content ending. 978 // height of an auto-height region besides content ending.
979 ASSERT(regionOverrideLogicalContentHeight <= region->maxPageLogicalHeigh t()); 979 ASSERT(regionOverrideLogicalContentHeight <= region->maxPageLogicalHeigh t());
980 980
981 region->setOverrideLogicalContentHeight(regionOverrideLogicalContentHeig ht); 981 region->setOverrideLogicalContentHeight(regionOverrideLogicalContentHeig ht);
982 982
983 currentRegionOffsetInFlowThread += regionOverrideLogicalContentHeight; 983 currentRegionOffsetInFlowThread += regionOverrideLogicalContentHeight;
984 } else 984 } else
985 currentRegionOffsetInFlowThread += isHorizontalWritingMode() ? region->f lowThreadPortionRect().height() : region->flowThreadPortionRect().width(); 985 currentRegionOffsetInFlowThread += isHorizontalWritingMode() ? region->f lowThreadPortionRect().height() : region->flowThreadPortionRect().width();
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
1067 { 1067 {
1068 if (!m_renderFlowThread) 1068 if (!m_renderFlowThread)
1069 return; 1069 return;
1070 RenderView* view = m_renderFlowThread->view(); 1070 RenderView* view = m_renderFlowThread->view();
1071 ASSERT(view->flowThreadController()->currentRenderFlowThread() == m_renderFl owThread); 1071 ASSERT(view->flowThreadController()->currentRenderFlowThread() == m_renderFl owThread);
1072 view->flowThreadController()->setCurrentRenderFlowThread(m_previousRenderFlo wThread); 1072 view->flowThreadController()->setCurrentRenderFlowThread(m_previousRenderFlo wThread);
1073 } 1073 }
1074 1074
1075 1075
1076 } // namespace WebCore 1076 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698