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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.h

Issue 1648573002: Transition to explicit constructors in LayoutUnit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove int constructors for size/point... they result in incorrect conversions until LayoutUnit is … 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) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. 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 975 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 // without overflowing. This means that all the opportunities for wrapping 986 // without overflowing. This means that all the opportunities for wrapping
987 // have been taken. 987 // have been taken.
988 // 988 //
989 // See INTRINSIC SIZES / PREFERRED LOGICAL WIDTHS above. 989 // See INTRINSIC SIZES / PREFERRED LOGICAL WIDTHS above.
990 // 990 //
991 // CSS 2.1 calls this width the "preferred minimum width" (thus this name) 991 // CSS 2.1 calls this width the "preferred minimum width" (thus this name)
992 // and "minimum content width" (for table). 992 // and "minimum content width" (for table).
993 // However CSS 3 calls it the "min-content inline size". 993 // However CSS 3 calls it the "min-content inline size".
994 // https://drafts.csswg.org/css-sizing-3/#min-content-inline-size 994 // https://drafts.csswg.org/css-sizing-3/#min-content-inline-size
995 // TODO(jchaffraix): We will probably want to rename it to match CSS 3. 995 // TODO(jchaffraix): We will probably want to rename it to match CSS 3.
996 virtual LayoutUnit minPreferredLogicalWidth() const { return 0; } 996 virtual LayoutUnit minPreferredLogicalWidth() const { return LayoutUnit(); }
997 997
998 // This function returns the maximum logical width this object can have. 998 // This function returns the maximum logical width this object can have.
999 // 999 //
1000 // See INTRINSIC SIZES / PREFERRED LOGICAL WIDTHS above. 1000 // See INTRINSIC SIZES / PREFERRED LOGICAL WIDTHS above.
1001 // 1001 //
1002 // CSS 2.1 calls this width the "preferred width". However CSS 3 calls it 1002 // CSS 2.1 calls this width the "preferred width". However CSS 3 calls it
1003 // the "max-content inline size". 1003 // the "max-content inline size".
1004 // https://drafts.csswg.org/css-sizing-3/#max-content-inline-size 1004 // https://drafts.csswg.org/css-sizing-3/#max-content-inline-size
1005 // TODO(jchaffraix): We will probably want to rename it to match CSS 3. 1005 // TODO(jchaffraix): We will probably want to rename it to match CSS 3.
1006 virtual LayoutUnit maxPreferredLogicalWidth() const { return 0; } 1006 virtual LayoutUnit maxPreferredLogicalWidth() const { return LayoutUnit(); }
1007 1007
1008 const ComputedStyle* style() const { return m_style.get(); } 1008 const ComputedStyle* style() const { return m_style.get(); }
1009 ComputedStyle* mutableStyle() const { return m_style.get(); } 1009 ComputedStyle* mutableStyle() const { return m_style.get(); }
1010 1010
1011 // m_style can only be nullptr before the first style is set, thus most 1011 // m_style can only be nullptr before the first style is set, thus most
1012 // callers will never see a nullptr style and should use styleRef(). 1012 // callers will never see a nullptr style and should use styleRef().
1013 // FIXME: It would be better if style() returned a const reference. 1013 // FIXME: It would be better if style() returned a const reference.
1014 const ComputedStyle& styleRef() const { return mutableStyleRef(); } 1014 const ComputedStyle& styleRef() const { return mutableStyleRef(); }
1015 ComputedStyle& mutableStyleRef() const { ASSERT(m_style); return *m_style; } 1015 ComputedStyle& mutableStyleRef() const { ASSERT(m_style); return *m_style; }
1016 1016
(...skipping 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after
2105 void showTree(const blink::LayoutObject*); 2105 void showTree(const blink::LayoutObject*);
2106 void showLineTree(const blink::LayoutObject*); 2106 void showLineTree(const blink::LayoutObject*);
2107 void showLayoutTree(const blink::LayoutObject* object1); 2107 void showLayoutTree(const blink::LayoutObject* object1);
2108 // We don't make object2 an optional parameter so that showLayoutTree 2108 // We don't make object2 an optional parameter so that showLayoutTree
2109 // can be called from gdb easily. 2109 // can be called from gdb easily.
2110 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2); 2110 void showLayoutTree(const blink::LayoutObject* object1, const blink::LayoutObjec t* object2);
2111 2111
2112 #endif 2112 #endif
2113 2113
2114 #endif // LayoutObject_h 2114 #endif // LayoutObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698