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

Side by Side Diff: Source/core/layout/LayoutInline.cpp

Issue 1278543002: Include the whole outline into visual overflow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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/layout/LayoutInline.h ('k') | Source/core/layout/LayoutObject.h » ('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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 return clippedOverflowRect(paintInvalidationContainer); 1056 return clippedOverflowRect(paintInvalidationContainer);
1057 } 1057 }
1058 1058
1059 LayoutRect LayoutInline::clippedOverflowRect(const LayoutBoxModelObject* paintIn validationContainer, const PaintInvalidationState* paintInvalidationState) const 1059 LayoutRect LayoutInline::clippedOverflowRect(const LayoutBoxModelObject* paintIn validationContainer, const PaintInvalidationState* paintInvalidationState) const
1060 { 1060 {
1061 const LayoutBoxModelObject* continuation = this->continuation(); 1061 const LayoutBoxModelObject* continuation = this->continuation();
1062 if ((!firstLineBoxIncludingCulling() && !continuation) || style()->visibilit y() != VISIBLE) 1062 if ((!firstLineBoxIncludingCulling() && !continuation) || style()->visibilit y() != VISIBLE)
1063 return LayoutRect(); 1063 return LayoutRect();
1064 1064
1065 LayoutRect overflowRect(linesVisualOverflowBoundingBox()); 1065 LayoutRect overflowRect(linesVisualOverflowBoundingBox());
1066 mapRectToPaintInvalidationBacking(paintInvalidationContainer, overflowRect, paintInvalidationState);
1067 1066
1068 LayoutUnit outlineOutset = style()->outlineOutsetExtent(); 1067 LayoutUnit outlineOutset = style()->outlineOutsetExtent();
1069 if (outlineOutset) { 1068 if (outlineOutset) {
1070 for (LayoutObject* curr = firstChild(); curr; curr = curr->nextSibling() ) { 1069 Vector<LayoutRect> rects;
1071 if (!curr->isText()) 1070 addOutlineRectsForChildrenAndContinuations(rects, LayoutPoint());
1072 overflowRect.unite(curr->rectWithOutlineForPaintInvalidation(pai ntInvalidationContainer, outlineOutset)); 1071 LayoutRect outlineRect = unionRect(rects);
1072 if (!outlineRect.isEmpty()) {
1073 outlineRect.inflate(outlineOutset);
1074 overflowRect.unite(outlineRect);
1073 } 1075 }
1074
1075 if (continuation && !continuation->isInline() && continuation->parent())
1076 overflowRect.unite(continuation->rectWithOutlineForPaintInvalidation (paintInvalidationContainer, outlineOutset));
1077 } 1076 }
1078 1077
1078 mapRectToPaintInvalidationBacking(paintInvalidationContainer, overflowRect, paintInvalidationState);
1079 return overflowRect; 1079 return overflowRect;
1080 } 1080 }
1081 1081
1082 LayoutRect LayoutInline::rectWithOutlineForPaintInvalidation(const LayoutBoxMode lObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalid ationState* paintInvalidationState) const
1083 {
1084 LayoutRect r(LayoutBoxModelObject::rectWithOutlineForPaintInvalidation(paint InvalidationContainer, outlineWidth, paintInvalidationState));
1085 for (LayoutObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
1086 if (!curr->isText())
1087 r.unite(curr->rectWithOutlineForPaintInvalidation(paintInvalidationC ontainer, outlineWidth, paintInvalidationState));
1088 }
1089 return r;
1090 }
1091
1092 void LayoutInline::mapRectToPaintInvalidationBacking(const LayoutBoxModelObject* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* pai ntInvalidationState) const 1082 void LayoutInline::mapRectToPaintInvalidationBacking(const LayoutBoxModelObject* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationState* pai ntInvalidationState) const
1093 { 1083 {
1094 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain tInvalidationContainer)) { 1084 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain tInvalidationContainer)) {
1095 if (style()->hasInFlowPosition() && layer()) 1085 if (style()->hasInFlowPosition() && layer())
1096 rect.move(layer()->offsetForInFlowPosition()); 1086 rect.move(layer()->offsetForInFlowPosition());
1097 rect.move(paintInvalidationState->paintOffset()); 1087 rect.move(paintInvalidationState->paintOffset());
1098 if (paintInvalidationState->isClipped()) 1088 if (paintInvalidationState->isClipped())
1099 rect.intersect(paintInvalidationState->clipRect()); 1089 rect.intersect(paintInvalidationState->clipRect());
1100 return; 1090 return;
1101 } 1091 }
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
1451 } 1441 }
1452 1442
1453 void LayoutInline::invalidateDisplayItemClients(const LayoutBoxModelObject& pain tInvalidationContainer) const 1443 void LayoutInline::invalidateDisplayItemClients(const LayoutBoxModelObject& pain tInvalidationContainer) const
1454 { 1444 {
1455 LayoutBoxModelObject::invalidateDisplayItemClients(paintInvalidationContaine r); 1445 LayoutBoxModelObject::invalidateDisplayItemClients(paintInvalidationContaine r);
1456 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) 1446 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
1457 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box); 1447 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box);
1458 } 1448 }
1459 1449
1460 } // namespace blink 1450 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutInline.h ('k') | Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698