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

Side by Side Diff: third_party/WebKit/WebCore/rendering/InlineFlowBox.h

Issue 21184: WebKit merge 40722:40785 (part 1) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights 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 18 matching lines...) Expand all
29 class HitTestResult; 29 class HitTestResult;
30 class RenderLineBoxList; 30 class RenderLineBoxList;
31 31
32 class InlineFlowBox : public InlineRunBox { 32 class InlineFlowBox : public InlineRunBox {
33 public: 33 public:
34 InlineFlowBox(RenderObject* obj) 34 InlineFlowBox(RenderObject* obj)
35 : InlineRunBox(obj) 35 : InlineRunBox(obj)
36 , m_firstChild(0) 36 , m_firstChild(0)
37 , m_lastChild(0) 37 , m_lastChild(0)
38 , m_maxHorizontalVisualOverflow(0) 38 , m_maxHorizontalVisualOverflow(0)
39 , m_includeLeftEdge(false)
40 , m_includeRightEdge(false)
41 , m_hasTextChildren(true)
39 #ifndef NDEBUG 42 #ifndef NDEBUG
40 , m_hasBadChildList(false) 43 , m_hasBadChildList(false)
41 #endif 44 #endif
42 { 45 {
43 // Internet Explorer and Firefox always create a marker for list items, even when the list-style-type is none. We do not make a marker 46 // Internet Explorer and Firefox always create a marker for list items, even when the list-style-type is none. We do not make a marker
44 // in the list-style-type: none case, since it is wasteful to do so. Ho wever, in order to match other browsers we have to pretend like 47 // in the list-style-type: none case, since it is wasteful to do so. Ho wever, in order to match other browsers we have to pretend like
45 // an invisible marker exists. The side effect of having an invisible m arker is that the quirks mode behavior of shrinking lines with no 48 // an invisible marker exists. The side effect of having an invisible m arker is that the quirks mode behavior of shrinking lines with no
46 // text children must not apply. This change also means that gaps will exist between image bullet list items. Even when the list bullet 49 // text children must not apply. This change also means that gaps will exist between image bullet list items. Even when the list bullet
47 // is an image, the line is still considered to be immune from the quirk . 50 // is an image, the line is still considered to be immune from the quirk .
48 m_hasTextChildren = obj->style()->display() == LIST_ITEM; 51 m_hasTextChildren = obj->style()->display() == LIST_ITEM;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 virtual void paintTextDecorations(RenderObject::PaintInfo&, int tx, int ty, bool paintedChildren = false); 97 virtual void paintTextDecorations(RenderObject::PaintInfo&, int tx, int ty, bool paintedChildren = false);
95 virtual void paint(RenderObject::PaintInfo&, int tx, int ty); 98 virtual void paint(RenderObject::PaintInfo&, int tx, int ty);
96 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y , int tx, int ty); 99 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y , int tx, int ty);
97 100
98 virtual RenderLineBoxList* rendererLineBoxes() const; 101 virtual RenderLineBoxList* rendererLineBoxes() const;
99 102
100 int marginBorderPaddingLeft(); 103 int marginBorderPaddingLeft();
101 int marginBorderPaddingRight(); 104 int marginBorderPaddingRight();
102 int marginLeft(); 105 int marginLeft();
103 int marginRight(); 106 int marginRight();
104 int borderLeft() { if (includeLeftEdge()) return renderBox()->borderLeft(); return 0; } 107 int borderLeft() { if (includeLeftEdge()) return object()->style()->borderLe ftWidth(); return 0; }
105 int borderRight() { if (includeRightEdge()) return renderBox()->borderRight( ); return 0; } 108 int borderRight() { if (includeRightEdge()) return object()->style()->border RightWidth(); return 0; }
106 int paddingLeft() { if (includeLeftEdge()) return renderBox()->paddingLeft() ; return 0; } 109 int paddingLeft() { if (includeLeftEdge()) return boxModelObject()->paddingL eft(); return 0; }
107 int paddingRight() { if (includeRightEdge()) return renderBox()->paddingRigh t(); return 0; } 110 int paddingRight() { if (includeRightEdge()) return boxModelObject()->paddin gRight(); return 0; }
108 111
109 bool includeLeftEdge() { return m_includeLeftEdge; } 112 bool includeLeftEdge() { return m_includeLeftEdge; }
110 bool includeRightEdge() { return m_includeRightEdge; } 113 bool includeRightEdge() { return m_includeRightEdge; }
111 void setEdges(bool includeLeft, bool includeRight) 114 void setEdges(bool includeLeft, bool includeRight)
112 { 115 {
113 m_includeLeftEdge = includeLeft; 116 m_includeLeftEdge = includeLeft;
114 m_includeRightEdge = includeRight; 117 m_includeRightEdge = includeRight;
115 } 118 }
116 119
117 // Helper functions used during line construction and placement. 120 // Helper functions used during line construction and placement.
118 void determineSpacingForFlowBoxes(bool lastLine, RenderObject* endObject); 121 void determineSpacingForFlowBoxes(bool lastLine, RenderObject* endObject);
119 int getFlowSpacingWidth(); 122 int getFlowSpacingWidth();
120 bool onEndChain(RenderObject* endObject); 123 bool onEndChain(RenderObject* endObject);
121 virtual int placeBoxesHorizontally(int x, int& leftPosition, int& rightPosit ion, bool& needsWordSpacing); 124 virtual int placeBoxesHorizontally(int x, int& leftPosition, int& rightPosit ion, bool& needsWordSpacing);
122 virtual int verticallyAlignBoxes(int heightOfBlock); 125 virtual int verticallyAlignBoxes(int heightOfBlock);
123 void computeLogicalBoxHeights(int& maxPositionTop, int& maxPositionBottom, 126 void computeLogicalBoxHeights(int& maxPositionTop, int& maxPositionBottom,
124 int& maxAscent, int& maxDescent, bool strictMo de); 127 int& maxAscent, int& maxDescent, bool strictMo de);
125 void adjustMaxAscentAndDescent(int& maxAscent, int& maxDescent, 128 void adjustMaxAscentAndDescent(int& maxAscent, int& maxDescent,
126 int maxPositionTop, int maxPositionBottom); 129 int maxPositionTop, int maxPositionBottom);
127 void placeBoxesVertically(int y, int maxHeight, int maxAscent, bool strictMo de, 130 void placeBoxesVertically(int y, int maxHeight, int maxAscent, bool strictMo de,
128 int& topPosition, int& bottomPosition, int& select ionTop, int& selectionBottom); 131 int& topPosition, int& bottomPosition, int& select ionTop, int& selectionBottom);
129 void shrinkBoxesWithNoTextChildren(int topPosition, int bottomPosition); 132 void shrinkBoxesWithNoTextChildren(int topPosition, int bottomPosition);
130 133
131 virtual void setVerticalOverflowPositions(int /*top*/, int /*bottom*/) { } 134 virtual void setVerticalOverflowPositions(int /*top*/, int /*bottom*/) { }
132 virtual void setVerticalSelectionPositions(int /*top*/, int /*bottom*/) { } 135 virtual void setVerticalSelectionPositions(int /*top*/, int /*bottom*/) { }
133 int maxHorizontalVisualOverflow() const { return m_maxHorizontalVisualOverfl ow; } 136 short maxHorizontalVisualOverflow() const { return m_maxHorizontalVisualOver flow; }
134 137
135 void removeChild(InlineBox* child); 138 void removeChild(InlineBox* child);
136 139
137 virtual RenderObject::SelectionState selectionState(); 140 virtual RenderObject::SelectionState selectionState();
138 141
139 virtual bool canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWid th); 142 virtual bool canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWid th);
140 virtual int placeEllipsisBox(bool ltr, int blockEdge, int ellipsisWidth, boo l&); 143 virtual int placeEllipsisBox(bool ltr, int blockEdge, int ellipsisWidth, boo l&);
141 144
145 bool hasTextChildren() const { return m_hasTextChildren; }
146
142 void checkConsistency() const; 147 void checkConsistency() const;
143 void setHasBadChildList(); 148 void setHasBadChildList();
144 149
145 private: 150 private:
146 InlineBox* m_firstChild; 151 InlineBox* m_firstChild;
147 InlineBox* m_lastChild; 152 InlineBox* m_lastChild;
148 int m_maxHorizontalVisualOverflow; 153 short m_maxHorizontalVisualOverflow;
154
155 bool m_includeLeftEdge : 1;
156 bool m_includeRightEdge : 1;
157 bool m_hasTextChildren : 1;
149 158
150 #ifndef NDEBUG 159 #ifndef NDEBUG
151 bool m_hasBadChildList; 160 bool m_hasBadChildList;
152 #endif 161 #endif
153 }; 162 };
154 163
155 #ifdef NDEBUG 164 #ifdef NDEBUG
156 inline void InlineFlowBox::checkConsistency() const 165 inline void InlineFlowBox::checkConsistency() const
157 { 166 {
158 } 167 }
159 #endif 168 #endif
160 169
161 inline void InlineFlowBox::setHasBadChildList() 170 inline void InlineFlowBox::setHasBadChildList()
162 { 171 {
163 #ifndef NDEBUG 172 #ifndef NDEBUG
164 m_hasBadChildList = true; 173 m_hasBadChildList = true;
165 #endif 174 #endif
166 } 175 }
167 176
168 } // namespace WebCore 177 } // namespace WebCore
169 178
170 #ifndef NDEBUG 179 #ifndef NDEBUG
171 // Outside the WebCore namespace for ease of invocation from gdb. 180 // Outside the WebCore namespace for ease of invocation from gdb.
172 void showTree(const WebCore::InlineFlowBox*); 181 void showTree(const WebCore::InlineFlowBox*);
173 #endif 182 #endif
174 183
175 #endif // InlineFlowBox_h 184 #endif // InlineFlowBox_h
OLDNEW
« no previous file with comments | « third_party/WebKit/WebCore/rendering/InlineBox.h ('k') | third_party/WebKit/WebCore/rendering/InlineFlowBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698