| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, 2011 Nokia Corporation and/or its subsidiary(-ies) | 2 * Copyright (C) 2010, 2011 Nokia Corporation and/or its subsidiary(-ies) |
| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 void RenderDetailsMarker::paint(PaintInfo& paintInfo, const LayoutPoint& paintOf
fset) | 114 void RenderDetailsMarker::paint(PaintInfo& paintInfo, const LayoutPoint& paintOf
fset) |
| 115 { | 115 { |
| 116 if (paintInfo.phase != PaintPhaseForeground || style()->visibility() != VISI
BLE) { | 116 if (paintInfo.phase != PaintPhaseForeground || style()->visibility() != VISI
BLE) { |
| 117 RenderBlock::paint(paintInfo, paintOffset); | 117 RenderBlock::paint(paintInfo, paintOffset); |
| 118 return; | 118 return; |
| 119 } | 119 } |
| 120 | 120 |
| 121 LayoutPoint boxOrigin(paintOffset + location()); | 121 LayoutPoint boxOrigin(paintOffset + location()); |
| 122 LayoutRect overflowRect(visualOverflowRect()); | 122 LayoutRect overflowRect(visualOverflowRect()); |
| 123 overflowRect.moveBy(boxOrigin); | 123 overflowRect.moveBy(boxOrigin); |
| 124 overflowRect.inflate(maximalOutlineSize(paintInfo.phase)); | |
| 125 | 124 |
| 126 if (!paintInfo.rect.intersects(pixelSnappedIntRect(overflowRect))) | 125 if (!paintInfo.rect.intersects(pixelSnappedIntRect(overflowRect))) |
| 127 return; | 126 return; |
| 128 | 127 |
| 129 const Color color(resolveColor(CSSPropertyColor)); | 128 const Color color(resolveColor(CSSPropertyColor)); |
| 130 paintInfo.context->setStrokeColor(color); | 129 paintInfo.context->setStrokeColor(color); |
| 131 paintInfo.context->setStrokeStyle(SolidStroke); | 130 paintInfo.context->setStrokeStyle(SolidStroke); |
| 132 paintInfo.context->setStrokeThickness(1.0f); | 131 paintInfo.context->setStrokeThickness(1.0f); |
| 133 paintInfo.context->setFillColor(color); | 132 paintInfo.context->setFillColor(color); |
| 134 | 133 |
| 135 boxOrigin.move(borderLeft() + paddingLeft(), borderTop() + paddingTop()); | 134 boxOrigin.move(borderLeft() + paddingLeft(), borderTop() + paddingTop()); |
| 136 paintInfo.context->fillPath(getPath(boxOrigin)); | 135 paintInfo.context->fillPath(getPath(boxOrigin)); |
| 137 } | 136 } |
| 138 | 137 |
| 139 bool RenderDetailsMarker::isOpen() const | 138 bool RenderDetailsMarker::isOpen() const |
| 140 { | 139 { |
| 141 for (RenderObject* renderer = parent(); renderer; renderer = renderer->paren
t()) { | 140 for (RenderObject* renderer = parent(); renderer; renderer = renderer->paren
t()) { |
| 142 if (!renderer->node()) | 141 if (!renderer->node()) |
| 143 continue; | 142 continue; |
| 144 if (renderer->node()->hasTagName(detailsTag)) | 143 if (renderer->node()->hasTagName(detailsTag)) |
| 145 return !toElement(renderer->node())->getAttribute(openAttr).isNull()
; | 144 return !toElement(renderer->node())->getAttribute(openAttr).isNull()
; |
| 146 if (renderer->node()->hasTagName(inputTag)) | 145 if (renderer->node()->hasTagName(inputTag)) |
| 147 return true; | 146 return true; |
| 148 } | 147 } |
| 149 | 148 |
| 150 return false; | 149 return false; |
| 151 } | 150 } |
| 152 | 151 |
| 153 } | 152 } |
| OLD | NEW |