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

Side by Side Diff: Source/core/rendering/InlineBox.h

Issue 351213002: Change RenderObject::style(bool) to accept an enum instead (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Renamed enum to OwnOrFirstLineStyle, rebased and got rid of duplicate state on the stack in RootInl… Created 6 years, 5 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 | « no previous file | Source/core/rendering/InlineBox.cpp » ('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) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All r ights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All r ights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 ASSERT_NOT_REACHED(); 141 ASSERT_NOT_REACHED();
142 return FloatRect(); 142 return FloatRect();
143 } 143 }
144 144
145 bool isConstructed() { return m_bitfields.constructed(); } 145 bool isConstructed() { return m_bitfields.constructed(); }
146 virtual void setConstructed() { m_bitfields.setConstructed(true); } 146 virtual void setConstructed() { m_bitfields.setConstructed(true); }
147 147
148 void setExtracted(bool extracted = true) { m_bitfields.setExtracted(extracte d); } 148 void setExtracted(bool extracted = true) { m_bitfields.setExtracted(extracte d); }
149 149
150 void setFirstLineStyleBit(bool firstLine) { m_bitfields.setFirstLine(firstLi ne); } 150 void setFirstLineStyleBit(bool firstLine) { m_bitfields.setFirstLine(firstLi ne); }
151 bool isFirstLineStyle() const { return m_bitfields.firstLine(); } 151 OwnOrFirstLineStyle isFirstLineStyle() const { return m_bitfields.firstLine( ) ? FirstLineStyle : OwnStyle; }
152 152
153 void remove(MarkLineBoxes = MarkLineBoxesDirty); 153 void remove(MarkLineBoxes = MarkLineBoxesDirty);
154 154
155 InlineBox* nextOnLine() const { return m_next; } 155 InlineBox* nextOnLine() const { return m_next; }
156 InlineBox* prevOnLine() const { return m_prev; } 156 InlineBox* prevOnLine() const { return m_prev; }
157 void setNextOnLine(InlineBox* next) 157 void setNextOnLine(InlineBox* next)
158 { 158 {
159 ASSERT(m_parent || !next); 159 ASSERT(m_parent || !next);
160 m_next = next; 160 m_next = next;
161 } 161 }
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 virtual float placeEllipsisBox(bool ltr, float visibleLeftEdge, float visibl eRightEdge, float ellipsisWidth, float &truncatedWidth, bool&); 269 virtual float placeEllipsisBox(bool ltr, float visibleLeftEdge, float visibl eRightEdge, float ellipsisWidth, float &truncatedWidth, bool&);
270 270
271 #ifndef NDEBUG 271 #ifndef NDEBUG
272 void setHasBadParent(); 272 void setHasBadParent();
273 #endif 273 #endif
274 274
275 int expansion() const { return m_bitfields.expansion(); } 275 int expansion() const { return m_bitfields.expansion(); }
276 276
277 bool visibleToHitTestRequest(const HitTestRequest& request) const { return r enderer().visibleToHitTestRequest(request); } 277 bool visibleToHitTestRequest(const HitTestRequest& request) const { return r enderer().visibleToHitTestRequest(request); }
278 278
279 EVerticalAlign verticalAlign() const { return renderer().style(m_bitfields.f irstLine())->verticalAlign(); } 279 EVerticalAlign verticalAlign() const { return renderer().style(m_bitfields.f irstLine() ? FirstLineStyle : OwnStyle)->verticalAlign(); }
280 280
281 // Use with caution! The type is not checked! 281 // Use with caution! The type is not checked!
282 RenderBoxModelObject* boxModelObject() const 282 RenderBoxModelObject* boxModelObject() const
283 { 283 {
284 if (!renderer().isText()) 284 if (!renderer().isText())
285 return toRenderBoxModelObject(&renderer()); 285 return toRenderBoxModelObject(&renderer());
286 return 0; 286 return 0;
287 } 287 }
288 288
289 FloatPoint locationIncludingFlipping(); 289 FloatPoint locationIncludingFlipping();
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 440
441 } // namespace WebCore 441 } // namespace WebCore
442 442
443 #ifndef NDEBUG 443 #ifndef NDEBUG
444 // Outside the WebCore namespace for ease of invocation from gdb. 444 // Outside the WebCore namespace for ease of invocation from gdb.
445 void showTree(const WebCore::InlineBox*); 445 void showTree(const WebCore::InlineBox*);
446 void showLineTree(const WebCore::InlineBox*); 446 void showLineTree(const WebCore::InlineBox*);
447 #endif 447 #endif
448 448
449 #endif // InlineBox_h 449 #endif // InlineBox_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/InlineBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698