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

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

Issue 2913093002: Revert of [css-align] Don't resolve 'auto' values for computed style. (Closed)
Patch Set: Created 3 years, 6 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) 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. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2865 matching lines...) Expand 10 before | Expand all | Expand 10 after
2876 if (!style.LogicalWidth().IsAuto() || style.MarginStart().IsAuto() || 2876 if (!style.LogicalWidth().IsAuto() || style.MarginStart().IsAuto() ||
2877 style.MarginEnd().IsAuto()) 2877 style.MarginEnd().IsAuto())
2878 return false; 2878 return false;
2879 LayoutBlock* cb = ContainingBlock(); 2879 LayoutBlock* cb = ContainingBlock();
2880 if (!cb) { 2880 if (!cb) {
2881 // We are evaluating align-self/justify-self, which default to 'normal' for 2881 // We are evaluating align-self/justify-self, which default to 'normal' for
2882 // the root element. The 'normal' value behaves like 'start' except for 2882 // the root element. The 'normal' value behaves like 'start' except for
2883 // Flexbox Items, which obviously should have a container. 2883 // Flexbox Items, which obviously should have a container.
2884 return false; 2884 return false;
2885 } 2885 }
2886 const ComputedStyle* parent_style = IsAnonymous() ? cb->Style() : nullptr;
2886 if (cb->IsHorizontalWritingMode() != IsHorizontalWritingMode()) 2887 if (cb->IsHorizontalWritingMode() != IsHorizontalWritingMode())
2887 return style 2888 return style
2888 .ResolvedAlignSelf(cb->SelfAlignmentNormalBehavior(this), 2889 .ResolvedAlignSelf(cb->SelfAlignmentNormalBehavior(this),
2889 cb->Style()) 2890 parent_style)
2890 .GetPosition() == kItemPositionStretch; 2891 .GetPosition() == kItemPositionStretch;
2891 return style 2892 return style
2892 .ResolvedJustifySelf(cb->SelfAlignmentNormalBehavior(this), 2893 .ResolvedJustifySelf(cb->SelfAlignmentNormalBehavior(this),
2893 cb->Style()) 2894 parent_style)
2894 .GetPosition() == kItemPositionStretch; 2895 .GetPosition() == kItemPositionStretch;
2895 } 2896 }
2896 2897
2897 bool LayoutBox::SizesLogicalWidthToFitContent( 2898 bool LayoutBox::SizesLogicalWidthToFitContent(
2898 const Length& logical_width) const { 2899 const Length& logical_width) const {
2899 if (IsFloating() || IsInlineBlockOrInlineTable() || 2900 if (IsFloating() || IsInlineBlockOrInlineTable() ||
2900 StyleRef().HasOutOfFlowPosition()) 2901 StyleRef().HasOutOfFlowPosition())
2901 return true; 2902 return true;
2902 2903
2903 if (IsGridItem()) 2904 if (IsGridItem())
(...skipping 2988 matching lines...) Expand 10 before | Expand all | Expand 10 after
5892 void LayoutBox::MutableForPainting:: 5893 void LayoutBox::MutableForPainting::
5893 SavePreviousContentBoxSizeAndLayoutOverflowRect() { 5894 SavePreviousContentBoxSizeAndLayoutOverflowRect() {
5894 auto& rare_data = GetLayoutBox().EnsureRareData(); 5895 auto& rare_data = GetLayoutBox().EnsureRareData();
5895 rare_data.has_previous_content_box_size_and_layout_overflow_rect_ = true; 5896 rare_data.has_previous_content_box_size_and_layout_overflow_rect_ = true;
5896 rare_data.previous_content_box_size_ = GetLayoutBox().ContentBoxRect().Size(); 5897 rare_data.previous_content_box_size_ = GetLayoutBox().ContentBoxRect().Size();
5897 rare_data.previous_layout_overflow_rect_ = 5898 rare_data.previous_layout_overflow_rect_ =
5898 GetLayoutBox().LayoutOverflowRect(); 5899 GetLayoutBox().LayoutOverflowRect();
5899 } 5900 }
5900 5901
5901 } // namespace blink 5902 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698