| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |