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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp

Issue 1656743002: Removing more implicit LayoutUnit construction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix additional test Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 // laid out inside the columns. In order to eventually end up with the desir ed column width, 855 // laid out inside the columns. In order to eventually end up with the desir ed column width,
856 // we need to convert them to values pertaining to the multicol container. 856 // we need to convert them to values pertaining to the multicol container.
857 const LayoutBlockFlow* multicolContainer = multiColumnBlockFlow(); 857 const LayoutBlockFlow* multicolContainer = multiColumnBlockFlow();
858 const ComputedStyle* multicolStyle = multicolContainer->style(); 858 const ComputedStyle* multicolStyle = multicolContainer->style();
859 int columnCount = multicolStyle->hasAutoColumnCount() ? 1 : multicolStyle->c olumnCount(); 859 int columnCount = multicolStyle->hasAutoColumnCount() ? 1 : multicolStyle->c olumnCount();
860 LayoutUnit columnWidth; 860 LayoutUnit columnWidth;
861 LayoutUnit gapExtra = LayoutUnit((columnCount - 1) * multicolContainer->colu mnGap()); 861 LayoutUnit gapExtra = LayoutUnit((columnCount - 1) * multicolContainer->colu mnGap());
862 if (multicolStyle->hasAutoColumnWidth()) { 862 if (multicolStyle->hasAutoColumnWidth()) {
863 m_minPreferredLogicalWidth = m_minPreferredLogicalWidth * columnCount + gapExtra; 863 m_minPreferredLogicalWidth = m_minPreferredLogicalWidth * columnCount + gapExtra;
864 } else { 864 } else {
865 columnWidth = multicolStyle->columnWidth(); 865 columnWidth = LayoutUnit(multicolStyle->columnWidth());
866 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, column Width); 866 m_minPreferredLogicalWidth = std::min(m_minPreferredLogicalWidth, column Width);
867 } 867 }
868 // Note that if column-count is auto here, we should resolve it to calculate the maximum 868 // Note that if column-count is auto here, we should resolve it to calculate the maximum
869 // intrinsic width, instead of pretending that it's 1. The only way to do th at is by performing 869 // intrinsic width, instead of pretending that it's 1. The only way to do th at is by performing
870 // a layout pass, but this is not an appropriate time or place for layout. T he good news is that 870 // a layout pass, but this is not an appropriate time or place for layout. T he good news is that
871 // if height is unconstrained and there are no explicit breaks, the resolved column-count really 871 // if height is unconstrained and there are no explicit breaks, the resolved column-count really
872 // should be 1. 872 // should be 1.
873 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, columnWidt h) * columnCount + gapExtra; 873 m_maxPreferredLogicalWidth = std::max(m_maxPreferredLogicalWidth, columnWidt h) * columnCount + gapExtra;
874 } 874 }
875 875
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 // the "mayBe"), if we're in an out-of-flow subtree and have an outer multic ol container that 925 // the "mayBe"), if we're in an out-of-flow subtree and have an outer multic ol container that
926 // doesn't affect us, but that's okay. We'll discover that further down the road when trying to 926 // doesn't affect us, but that's okay. We'll discover that further down the road when trying to
927 // locate our enclosing flow thread for real. 927 // locate our enclosing flow thread for real.
928 bool mayBeNested = multiColumnBlockFlow()->isInsideFlowThread() || view()->f ragmentationContext(); 928 bool mayBeNested = multiColumnBlockFlow()->isInsideFlowThread() || view()->f ragmentationContext();
929 if (!mayBeNested) 929 if (!mayBeNested)
930 return; 930 return;
931 appendNewFragmentainerGroupIfNeeded(logicalBottomInFlowThreadAfterPagination ); 931 appendNewFragmentainerGroupIfNeeded(logicalBottomInFlowThreadAfterPagination );
932 } 932 }
933 933
934 } // namespace blink 934 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutMeter.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698