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

Side by Side Diff: Source/core/rendering/RenderReplaced.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/RenderRegion.cpp ('k') | Source/core/rendering/RenderReplica.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 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org) 3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
5 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved.
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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 // Early exit if the element touches the edges. 197 // Early exit if the element touches the edges.
198 LayoutUnit top = adjustedPaintOffset.y() + visualOverflowRect().y(); 198 LayoutUnit top = adjustedPaintOffset.y() + visualOverflowRect().y();
199 LayoutUnit bottom = adjustedPaintOffset.y() + visualOverflowRect().maxY(); 199 LayoutUnit bottom = adjustedPaintOffset.y() + visualOverflowRect().maxY();
200 if (isSelected() && inlineBoxWrapper()) { 200 if (isSelected() && inlineBoxWrapper()) {
201 LayoutUnit selTop = paintOffset.y() + inlineBoxWrapper()->root().selecti onTop(); 201 LayoutUnit selTop = paintOffset.y() + inlineBoxWrapper()->root().selecti onTop();
202 LayoutUnit selBottom = paintOffset.y() + selTop + inlineBoxWrapper()->ro ot().selectionHeight(); 202 LayoutUnit selBottom = paintOffset.y() + selTop + inlineBoxWrapper()->ro ot().selectionHeight();
203 top = min(selTop, top); 203 top = min(selTop, top);
204 bottom = max(selBottom, bottom); 204 bottom = max(selBottom, bottom);
205 } 205 }
206 206
207 LayoutRect localRepaintRect = paintInfo.rect; 207 if (adjustedPaintOffset.x() + visualOverflowRect().x() >= paintInfo.rect.max X() || adjustedPaintOffset.x() + visualOverflowRect().maxX() <= paintInfo.rect.x ())
208 localRepaintRect.inflate(maximalOutlineSize(paintInfo.phase));
209 if (adjustedPaintOffset.x() + visualOverflowRect().x() >= localRepaintRect.m axX() || adjustedPaintOffset.x() + visualOverflowRect().maxX() <= localRepaintRe ct.x())
210 return false; 208 return false;
211 209
212 if (top >= localRepaintRect.maxY() || bottom <= localRepaintRect.y()) 210 if (top >= paintInfo.rect.maxY() || bottom <= paintInfo.rect.y())
213 return false; 211 return false;
214 212
215 return true; 213 return true;
216 } 214 }
217 215
218 static inline RenderBlock* firstContainingBlockWithLogicalWidth(const RenderRepl aced* replaced) 216 static inline RenderBlock* firstContainingBlockWithLogicalWidth(const RenderRepl aced* replaced)
219 { 217 {
220 // We have to lookup the containing block, which has an explicit width, whic h must not be equal to our direct containing block. 218 // We have to lookup the containing block, which has an explicit width, whic h must not be equal to our direct containing block.
221 // If the embedded document appears _after_ we performed the initial layout, our intrinsic size is 300x150. If our containing 219 // If the embedded document appears _after_ we performed the initial layout, our intrinsic size is 300x150. If our containing
222 // block doesn't provide an explicit width, it's set to the 300 default, com ing from the initial layout run. 220 // block doesn't provide an explicit width, it's set to the 300 default, com ing from the initial layout run.
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 // for repainting to avoid selection painting glitches. 628 // for repainting to avoid selection painting glitches.
631 LayoutRect r = unionRect(localSelectionRect(false), visualOverflowRect()); 629 LayoutRect r = unionRect(localSelectionRect(false), visualOverflowRect());
632 630
633 RenderView* v = view(); 631 RenderView* v = view();
634 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && v) { 632 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && v) {
635 // FIXME: layoutDelta needs to be applied in parts before/after transfor ms and 633 // FIXME: layoutDelta needs to be applied in parts before/after transfor ms and
636 // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308 634 // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308
637 r.move(v->layoutDelta()); 635 r.move(v->layoutDelta());
638 } 636 }
639 637
640 if (style()) {
641 if (v)
642 r.inflate(style()->outlineSize());
643 }
644 computeRectForRepaint(repaintContainer, r); 638 computeRectForRepaint(repaintContainer, r);
645 return r; 639 return r;
646 } 640 }
647 641
648 } 642 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderRegion.cpp ('k') | Source/core/rendering/RenderReplica.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698