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

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

Issue 2228803003: There's no class A break point before or after a float. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « third_party/WebKit/LayoutTests/fast/multicol/balance-float-after-forced-break-expected.html ('k') | 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) 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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after
2019 2019
2020 EBreak LayoutBox::joinFragmentainerBreakValues(EBreak firstValue, EBreak secondV alue) 2020 EBreak LayoutBox::joinFragmentainerBreakValues(EBreak firstValue, EBreak secondV alue)
2021 { 2021 {
2022 if (fragmentainerBreakPrecedence(secondValue) >= fragmentainerBreakPrecedenc e(firstValue)) 2022 if (fragmentainerBreakPrecedence(secondValue) >= fragmentainerBreakPrecedenc e(firstValue))
2023 return secondValue; 2023 return secondValue;
2024 return firstValue; 2024 return firstValue;
2025 } 2025 }
2026 2026
2027 EBreak LayoutBox::classABreakPointValue(EBreak previousBreakAfterValue) const 2027 EBreak LayoutBox::classABreakPointValue(EBreak previousBreakAfterValue) const
2028 { 2028 {
2029 // First assert that we're at a class A break point.
2029 ASSERT(isBreakBetweenControllable(previousBreakAfterValue)); 2030 ASSERT(isBreakBetweenControllable(previousBreakAfterValue));
2031
2030 return joinFragmentainerBreakValues(previousBreakAfterValue, breakBefore()); 2032 return joinFragmentainerBreakValues(previousBreakAfterValue, breakBefore());
2031 } 2033 }
2032 2034
2033 bool LayoutBox::needsForcedBreakBefore(EBreak previousBreakAfterValue) const 2035 bool LayoutBox::needsForcedBreakBefore(EBreak previousBreakAfterValue) const
2034 { 2036 {
2035 return isForcedFragmentainerBreakValue(classABreakPointValue(previousBreakAf terValue)); 2037 // Forced break values are only honored when specified on in-flow objects, b ut floats and
2038 // out-of-flow positioned objects may be affected by a break-after value of the previous
2039 // in-flow object, even though we're not at a class A break point.
2040 EBreak breakValue = isFloatingOrOutOfFlowPositioned()
2041 ? previousBreakAfterValue : classABreakPointValue(previousBreakAfterValu e);
2042 return isForcedFragmentainerBreakValue(breakValue);
2036 } 2043 }
2037 2044
2038 bool LayoutBox::paintedOutputOfObjectHasNoEffect() const 2045 bool LayoutBox::paintedOutputOfObjectHasNoEffect() const
2039 { 2046 {
2040 // In case scrollbars got repositioned (which will typically happen if the b ox got 2047 // In case scrollbars got repositioned (which will typically happen if the b ox got
2041 // resized), we cannot skip invalidation. 2048 // resized), we cannot skip invalidation.
2042 if (hasNonCompositedScrollbars()) 2049 if (hasNonCompositedScrollbars())
2043 return false; 2050 return false;
2044 2051
2045 // Cannot skip paint invalidation if the box has real things to paint. 2052 // Cannot skip paint invalidation if the box has real things to paint.
(...skipping 2942 matching lines...) Expand 10 before | Expand all | Expand 10 after
4988 m_rareData->m_snapAreas->remove(&snapArea); 4995 m_rareData->m_snapAreas->remove(&snapArea);
4989 } 4996 }
4990 } 4997 }
4991 4998
4992 SnapAreaSet* LayoutBox::snapAreas() const 4999 SnapAreaSet* LayoutBox::snapAreas() const
4993 { 5000 {
4994 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; 5001 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr;
4995 } 5002 }
4996 5003
4997 } // namespace blink 5004 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/multicol/balance-float-after-forced-break-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698