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

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

Issue 176953008: Include the outline into the visual overflow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed dumb bug caught by Mac. Created 6 years, 9 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
« no previous file with comments | « Source/core/rendering/RenderBox.cpp ('k') | Source/core/rendering/RenderLayer.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) 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 void RenderDetailsMarker::paint(PaintInfo& paintInfo, const LayoutPoint& paintOf fset) 115 void RenderDetailsMarker::paint(PaintInfo& paintInfo, const LayoutPoint& paintOf fset)
116 { 116 {
117 if (paintInfo.phase != PaintPhaseForeground || style()->visibility() != VISI BLE) { 117 if (paintInfo.phase != PaintPhaseForeground || style()->visibility() != VISI BLE) {
118 RenderBlock::paint(paintInfo, paintOffset); 118 RenderBlock::paint(paintInfo, paintOffset);
119 return; 119 return;
120 } 120 }
121 121
122 LayoutPoint boxOrigin(paintOffset + location()); 122 LayoutPoint boxOrigin(paintOffset + location());
123 LayoutRect overflowRect(visualOverflowRect()); 123 LayoutRect overflowRect(visualOverflowRect());
124 overflowRect.moveBy(boxOrigin); 124 overflowRect.moveBy(boxOrigin);
125 overflowRect.inflate(maximalOutlineSize(paintInfo.phase));
126 125
127 if (!paintInfo.rect.intersects(pixelSnappedIntRect(overflowRect))) 126 if (!paintInfo.rect.intersects(pixelSnappedIntRect(overflowRect)))
128 return; 127 return;
129 128
130 const Color color(resolveColor(CSSPropertyColor)); 129 const Color color(resolveColor(CSSPropertyColor));
131 paintInfo.context->setStrokeColor(color); 130 paintInfo.context->setStrokeColor(color);
132 paintInfo.context->setStrokeStyle(SolidStroke); 131 paintInfo.context->setStrokeStyle(SolidStroke);
133 paintInfo.context->setStrokeThickness(1.0f); 132 paintInfo.context->setStrokeThickness(1.0f);
134 paintInfo.context->setFillColor(color); 133 paintInfo.context->setFillColor(color);
135 134
136 boxOrigin.move(borderLeft() + paddingLeft(), borderTop() + paddingTop()); 135 boxOrigin.move(borderLeft() + paddingLeft(), borderTop() + paddingTop());
137 paintInfo.context->fillPath(getPath(boxOrigin)); 136 paintInfo.context->fillPath(getPath(boxOrigin));
138 } 137 }
139 138
140 bool RenderDetailsMarker::isOpen() const 139 bool RenderDetailsMarker::isOpen() const
141 { 140 {
142 for (RenderObject* renderer = parent(); renderer; renderer = renderer->paren t()) { 141 for (RenderObject* renderer = parent(); renderer; renderer = renderer->paren t()) {
143 if (!renderer->node()) 142 if (!renderer->node())
144 continue; 143 continue;
145 if (isHTMLDetailsElement(*renderer->node())) 144 if (isHTMLDetailsElement(*renderer->node()))
146 return !toElement(renderer->node())->getAttribute(openAttr).isNull() ; 145 return !toElement(renderer->node())->getAttribute(openAttr).isNull() ;
147 if (isHTMLInputElement(*renderer->node())) 146 if (isHTMLInputElement(*renderer->node()))
148 return true; 147 return true;
149 } 148 }
150 149
151 return false; 150 return false;
152 } 151 }
153 152
154 } 153 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.cpp ('k') | Source/core/rendering/RenderLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698