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

Side by Side Diff: Source/core/layout/LayoutState.cpp

Issue 1162383003: C++11: Replace 0 with nullptr where applicable in layout code. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add one more file. Created 5 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
« no previous file with comments | « Source/core/layout/LayoutScrollbarPart.cpp ('k') | Source/core/layout/LayoutTable.h » ('j') | 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) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 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 18 matching lines...) Expand all
29 #include "core/layout/LayoutFlowThread.h" 29 #include "core/layout/LayoutFlowThread.h"
30 #include "core/layout/LayoutInline.h" 30 #include "core/layout/LayoutInline.h"
31 #include "core/layout/LayoutView.h" 31 #include "core/layout/LayoutView.h"
32 32
33 namespace blink { 33 namespace blink {
34 34
35 LayoutState::LayoutState(LayoutUnit pageLogicalHeight, bool pageLogicalHeightCha nged, LayoutView& view) 35 LayoutState::LayoutState(LayoutUnit pageLogicalHeight, bool pageLogicalHeightCha nged, LayoutView& view)
36 : m_isPaginated(pageLogicalHeight) 36 : m_isPaginated(pageLogicalHeight)
37 , m_pageLogicalHeightChanged(pageLogicalHeightChanged) 37 , m_pageLogicalHeightChanged(pageLogicalHeightChanged)
38 , m_containingBlockLogicalWidthChanged(false) 38 , m_containingBlockLogicalWidthChanged(false)
39 , m_flowThread(0) 39 , m_flowThread(nullptr)
40 , m_next(0) 40 , m_next(nullptr)
41 , m_pageLogicalHeight(pageLogicalHeight) 41 , m_pageLogicalHeight(pageLogicalHeight)
42 , m_layoutObject(view) 42 , m_layoutObject(view)
43 { 43 {
44 ASSERT(!view.layoutState()); 44 ASSERT(!view.layoutState());
45 view.pushLayoutState(*this); 45 view.pushLayoutState(*this);
46 } 46 }
47 47
48 LayoutState::LayoutState(LayoutBox& layoutObject, const LayoutSize& offset, Layo utUnit pageLogicalHeight, bool pageLogicalHeightChanged, bool containingBlockLog icalWidthChanged) 48 LayoutState::LayoutState(LayoutBox& layoutObject, const LayoutSize& offset, Layo utUnit pageLogicalHeight, bool pageLogicalHeightChanged, bool containingBlockLog icalWidthChanged)
49 : m_containingBlockLogicalWidthChanged(containingBlockLogicalWidthChanged) 49 : m_containingBlockLogicalWidthChanged(containingBlockLogicalWidthChanged)
50 , m_next(layoutObject.view()->layoutState()) 50 , m_next(layoutObject.view()->layoutState())
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 } 103 }
104 104
105 // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip if present. 105 // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip if present.
106 } 106 }
107 107
108 LayoutState::LayoutState(LayoutObject& root) 108 LayoutState::LayoutState(LayoutObject& root)
109 : m_isPaginated(false) 109 : m_isPaginated(false)
110 , m_pageLogicalHeightChanged(false) 110 , m_pageLogicalHeightChanged(false)
111 , m_containingBlockLogicalWidthChanged(false) 111 , m_containingBlockLogicalWidthChanged(false)
112 , m_flowThread(0) 112 , m_flowThread(nullptr)
113 , m_next(root.view()->layoutState()) 113 , m_next(root.view()->layoutState())
114 , m_pageLogicalHeight(0) 114 , m_pageLogicalHeight(0)
115 , m_layoutObject(root) 115 , m_layoutObject(root)
116 { 116 {
117 ASSERT(!m_next); 117 ASSERT(!m_next);
118 // We'll end up pushing in LayoutView itself, so don't bother adding it. 118 // We'll end up pushing in LayoutView itself, so don't bother adding it.
119 if (root.isLayoutView()) 119 if (root.isLayoutView())
120 return; 120 return;
121 121
122 root.view()->pushLayoutState(*this); 122 root.view()->pushLayoutState(*this);
(...skipping 18 matching lines...) Expand all
141 } 141 }
142 142
143 LayoutUnit LayoutState::pageLogicalOffset(const LayoutBox& child, const LayoutUn it& childLogicalOffset) const 143 LayoutUnit LayoutState::pageLogicalOffset(const LayoutBox& child, const LayoutUn it& childLogicalOffset) const
144 { 144 {
145 if (child.isHorizontalWritingMode()) 145 if (child.isHorizontalWritingMode())
146 return m_layoutOffset.height() + childLogicalOffset - m_pageOffset.heigh t(); 146 return m_layoutOffset.height() + childLogicalOffset - m_pageOffset.heigh t();
147 return m_layoutOffset.width() + childLogicalOffset - m_pageOffset.width(); 147 return m_layoutOffset.width() + childLogicalOffset - m_pageOffset.width();
148 } 148 }
149 149
150 } // namespace blink 150 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutScrollbarPart.cpp ('k') | Source/core/layout/LayoutTable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698