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

Side by Side Diff: Source/core/rendering/RenderFieldset.cpp

Issue 163513002: Have RenderBlockFlow sub-classes' methods call their super-class method properly. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | Source/core/rendering/RenderFileUploadControl.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) 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) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. 5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 25 matching lines...) Expand all
36 36
37 using namespace HTMLNames; 37 using namespace HTMLNames;
38 38
39 RenderFieldset::RenderFieldset(Element* element) 39 RenderFieldset::RenderFieldset(Element* element)
40 : RenderBlockFlow(element) 40 : RenderBlockFlow(element)
41 { 41 {
42 } 42 }
43 43
44 void RenderFieldset::computePreferredLogicalWidths() 44 void RenderFieldset::computePreferredLogicalWidths()
45 { 45 {
46 RenderBlock::computePreferredLogicalWidths(); 46 RenderBlockFlow::computePreferredLogicalWidths();
47 if (RenderBox* legend = findLegend()) { 47 if (RenderBox* legend = findLegend()) {
48 int legendMinWidth = legend->minPreferredLogicalWidth(); 48 int legendMinWidth = legend->minPreferredLogicalWidth();
49 49
50 Length legendMarginLeft = legend->style()->marginLeft(); 50 Length legendMarginLeft = legend->style()->marginLeft();
51 Length legendMarginRight = legend->style()->marginLeft(); 51 Length legendMarginRight = legend->style()->marginLeft();
52 52
53 if (legendMarginLeft.isFixed()) 53 if (legendMarginLeft.isFixed())
54 legendMinWidth += legendMarginLeft.value(); 54 legendMinWidth += legendMarginLeft.value();
55 55
56 if (legendMarginRight.isFixed()) 56 if (legendMarginRight.isFixed())
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 } 136 }
137 137
138 void RenderFieldset::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint & paintOffset) 138 void RenderFieldset::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint & paintOffset)
139 { 139 {
140 if (!paintInfo.shouldPaintWithinRoot(this)) 140 if (!paintInfo.shouldPaintWithinRoot(this))
141 return; 141 return;
142 142
143 LayoutRect paintRect(paintOffset, size()); 143 LayoutRect paintRect(paintOffset, size());
144 RenderBox* legend = findLegend(); 144 RenderBox* legend = findLegend();
145 if (!legend) 145 if (!legend)
146 return RenderBlock::paintBoxDecorations(paintInfo, paintOffset); 146 return RenderBlockFlow::paintBoxDecorations(paintInfo, paintOffset);
147 147
148 // FIXME: We need to work with "rl" and "bt" block flow directions. In thos e 148 // FIXME: We need to work with "rl" and "bt" block flow directions. In thos e
149 // cases the legend is embedded in the right and bottom borders respectively . 149 // cases the legend is embedded in the right and bottom borders respectively .
150 // https://bugs.webkit.org/show_bug.cgi?id=47236 150 // https://bugs.webkit.org/show_bug.cgi?id=47236
151 if (style()->isHorizontalWritingMode()) { 151 if (style()->isHorizontalWritingMode()) {
152 LayoutUnit yOff = (legend->y() > 0) ? LayoutUnit() : (legend->height() - borderTop()) / 2; 152 LayoutUnit yOff = (legend->y() > 0) ? LayoutUnit() : (legend->height() - borderTop()) / 2;
153 paintRect.setHeight(paintRect.height() - yOff); 153 paintRect.setHeight(paintRect.height() - yOff);
154 paintRect.setY(paintRect.y() + yOff); 154 paintRect.setY(paintRect.y() + yOff);
155 } else { 155 } else {
156 LayoutUnit xOff = (legend->x() > 0) ? LayoutUnit() : (legend->width() - borderLeft()) / 2; 156 LayoutUnit xOff = (legend->x() > 0) ? LayoutUnit() : (legend->width() - borderLeft()) / 2;
(...skipping 30 matching lines...) Expand all
187 } 187 }
188 188
189 void RenderFieldset::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOff set) 189 void RenderFieldset::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOff set)
190 { 190 {
191 if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask) 191 if (style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
192 return; 192 return;
193 193
194 LayoutRect paintRect = LayoutRect(paintOffset, size()); 194 LayoutRect paintRect = LayoutRect(paintOffset, size());
195 RenderBox* legend = findLegend(); 195 RenderBox* legend = findLegend();
196 if (!legend) 196 if (!legend)
197 return RenderBlock::paintMask(paintInfo, paintOffset); 197 return RenderBlockFlow::paintMask(paintInfo, paintOffset);
198 198
199 // FIXME: We need to work with "rl" and "bt" block flow directions. In thos e 199 // FIXME: We need to work with "rl" and "bt" block flow directions. In thos e
200 // cases the legend is embedded in the right and bottom borders respectively . 200 // cases the legend is embedded in the right and bottom borders respectively .
201 // https://bugs.webkit.org/show_bug.cgi?id=47236 201 // https://bugs.webkit.org/show_bug.cgi?id=47236
202 if (style()->isHorizontalWritingMode()) { 202 if (style()->isHorizontalWritingMode()) {
203 LayoutUnit yOff = (legend->y() > 0) ? LayoutUnit() : (legend->height() - borderTop()) / 2; 203 LayoutUnit yOff = (legend->y() > 0) ? LayoutUnit() : (legend->height() - borderTop()) / 2;
204 paintRect.expand(0, -yOff); 204 paintRect.expand(0, -yOff);
205 paintRect.move(0, yOff); 205 paintRect.move(0, yOff);
206 } else { 206 } else {
207 LayoutUnit xOff = (legend->x() > 0) ? LayoutUnit() : (legend->width() - borderLeft()) / 2; 207 LayoutUnit xOff = (legend->x() > 0) ? LayoutUnit() : (legend->width() - borderLeft()) / 2;
208 paintRect.expand(-xOff, 0); 208 paintRect.expand(-xOff, 0);
209 paintRect.move(xOff, 0); 209 paintRect.move(xOff, 0);
210 } 210 }
211 211
212 paintMaskImages(paintInfo, paintRect); 212 paintMaskImages(paintInfo, paintRect);
213 } 213 }
214 214
215 } // namespace WebCore 215 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/RenderFileUploadControl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698