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

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

Issue 2370673002: Changed EDisplay to an enum class and renamed its members to be keywords (Closed)
Patch Set: Comment Created 4 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 unified diff | Download patch
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) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 1739 matching lines...) Expand 10 before | Expand all | Expand 10 after
1750 { 1750 {
1751 ASSERT_NOT_REACHED(); 1751 ASSERT_NOT_REACHED();
1752 return "LayoutBlock"; 1752 return "LayoutBlock";
1753 } 1753 }
1754 1754
1755 LayoutBlock* LayoutBlock::createAnonymousWithParentAndDisplay(const LayoutObject * parent, EDisplay display) 1755 LayoutBlock* LayoutBlock::createAnonymousWithParentAndDisplay(const LayoutObject * parent, EDisplay display)
1756 { 1756 {
1757 // FIXME: Do we need to convert all our inline displays to block-type in the anonymous logic ? 1757 // FIXME: Do we need to convert all our inline displays to block-type in the anonymous logic ?
1758 EDisplay newDisplay; 1758 EDisplay newDisplay;
1759 LayoutBlock* newBox = nullptr; 1759 LayoutBlock* newBox = nullptr;
1760 if (display == FLEX || display == INLINE_FLEX) { 1760 if (display == EDisplay::Flex || display == EDisplay::InlineFlex) {
1761 newBox = LayoutFlexibleBox::createAnonymous(&parent->document()); 1761 newBox = LayoutFlexibleBox::createAnonymous(&parent->document());
1762 newDisplay = FLEX; 1762 newDisplay = EDisplay::Flex;
1763 } else if (display == GRID || display == INLINE_GRID) { 1763 } else if (display == EDisplay::Grid || display == EDisplay::InlineGrid) {
1764 newBox = LayoutGrid::createAnonymous(&parent->document()); 1764 newBox = LayoutGrid::createAnonymous(&parent->document());
1765 newDisplay = GRID; 1765 newDisplay = EDisplay::Grid;
1766 } else { 1766 } else {
1767 newBox = LayoutBlockFlow::createAnonymous(&parent->document()); 1767 newBox = LayoutBlockFlow::createAnonymous(&parent->document());
1768 newDisplay = BLOCK; 1768 newDisplay = EDisplay::Block;
1769 } 1769 }
1770 1770
1771 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp lay(parent->styleRef(), newDisplay); 1771 RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisp lay(parent->styleRef(), newDisplay);
1772 parent->updateAnonymousChildStyle(*newBox, *newStyle); 1772 parent->updateAnonymousChildStyle(*newBox, *newStyle);
1773 newBox->setStyle(newStyle.release()); 1773 newBox->setStyle(newStyle.release());
1774 return newBox; 1774 return newBox;
1775 } 1775 }
1776 1776
1777 bool LayoutBlock::recalcNormalFlowChildOverflowIfNeeded(LayoutObject* layoutObje ct) 1777 bool LayoutBlock::recalcNormalFlowChildOverflowIfNeeded(LayoutObject* layoutObje ct)
1778 { 1778 {
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1948 1948
1949 return availableHeight; 1949 return availableHeight;
1950 } 1950 }
1951 1951
1952 bool LayoutBlock::hasDefiniteLogicalHeight() const 1952 bool LayoutBlock::hasDefiniteLogicalHeight() const
1953 { 1953 {
1954 return availableLogicalHeightForPercentageComputation() != LayoutUnit(-1); 1954 return availableLogicalHeightForPercentageComputation() != LayoutUnit(-1);
1955 } 1955 }
1956 1956
1957 } // namespace blink 1957 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.h ('k') | third_party/WebKit/Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698