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

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

Issue 148823002: *** DO NOT LAND *** Measure the size and complexity of the old multicol implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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
« no previous file with comments | « Source/core/rendering/RenderGeometryMap.cpp ('k') | Source/core/rendering/RenderLayer.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 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 if (inlineFlow->style()->hasInFlowPosition() && inlineFlow->hasLayer()) 1017 if (inlineFlow->style()->hasInFlowPosition() && inlineFlow->hasLayer())
1018 repaintRect.move(toRenderInline(inlineFlow)->layer()->offsetForInFlo wPosition()); 1018 repaintRect.move(toRenderInline(inlineFlow)->layer()->offsetForInFlo wPosition());
1019 } 1019 }
1020 1020
1021 LayoutUnit outlineSize = style()->outlineSize(); 1021 LayoutUnit outlineSize = style()->outlineSize();
1022 repaintRect.inflate(outlineSize); 1022 repaintRect.inflate(outlineSize);
1023 1023
1024 if (hitRepaintContainer || !cb) 1024 if (hitRepaintContainer || !cb)
1025 return repaintRect; 1025 return repaintRect;
1026 1026
1027 if (cb->hasColumns())
1028 cb->adjustRectForColumns(repaintRect);
1029
1030 if (cb->hasOverflowClip()) 1027 if (cb->hasOverflowClip())
1031 cb->applyCachedClipAndScrollOffsetForRepaint(repaintRect); 1028 cb->applyCachedClipAndScrollOffsetForRepaint(repaintRect);
1032 1029
1033 cb->computeRectForRepaint(repaintContainer, repaintRect); 1030 cb->computeRectForRepaint(repaintContainer, repaintRect);
1034 1031
1035 if (outlineSize) { 1032 if (outlineSize) {
1036 for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling() ) { 1033 for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling() ) {
1037 if (!curr->isText()) 1034 if (!curr->isText())
1038 repaintRect.unite(curr->rectWithOutlineForRepaint(repaintContain er, outlineSize)); 1035 repaintRect.unite(curr->rectWithOutlineForRepaint(repaintContain er, outlineSize));
1039 } 1036 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 if (repaintContainer == this) 1070 if (repaintContainer == this)
1074 return; 1071 return;
1075 1072
1076 bool containerSkipped; 1073 bool containerSkipped;
1077 RenderObject* o = container(repaintContainer, &containerSkipped); 1074 RenderObject* o = container(repaintContainer, &containerSkipped);
1078 if (!o) 1075 if (!o)
1079 return; 1076 return;
1080 1077
1081 LayoutPoint topLeft = rect.location(); 1078 LayoutPoint topLeft = rect.location();
1082 1079
1083 if (o->isRenderBlockFlow() && !style()->hasOutOfFlowPosition()) {
1084 RenderBlock* cb = toRenderBlock(o);
1085 if (cb->hasColumns()) {
1086 LayoutRect repaintRect(topLeft, rect.size());
1087 cb->adjustRectForColumns(repaintRect);
1088 topLeft = repaintRect.location();
1089 rect = repaintRect;
1090 }
1091 }
1092
1093 if (style()->hasInFlowPosition() && layer()) { 1080 if (style()->hasInFlowPosition() && layer()) {
1094 // Apply the in-flow position offset when invalidating a rectangle. The layer 1081 // Apply the in-flow position offset when invalidating a rectangle. The layer
1095 // is translated, but the render box isn't, so we need to do this to get the 1082 // is translated, but the render box isn't, so we need to do this to get the
1096 // right dirty rect. Since this is called from RenderObject::setStyle, t he relative or sticky position 1083 // right dirty rect. Since this is called from RenderObject::setStyle, t he relative or sticky position
1097 // flag on the RenderObject has been cleared, so use the one on the styl e(). 1084 // flag on the RenderObject has been cleared, so use the one on the styl e().
1098 topLeft += layer()->offsetForInFlowPosition(); 1085 topLeft += layer()->offsetForInFlowPosition();
1099 } 1086 }
1100 1087
1101 // FIXME: We ignore the lightweight clipping rect that controls use, since i f |o| is in mid-layout, 1088 // FIXME: We ignore the lightweight clipping rect that controls use, since i f |o| is in mid-layout,
1102 // its controlClipRect will be wrong. For overflow clip we use the values ca ched by the layer. 1089 // its controlClipRect will be wrong. For overflow clip we use the values ca ched by the layer.
(...skipping 16 matching lines...) Expand all
1119 } 1106 }
1120 1107
1121 LayoutSize RenderInline::offsetFromContainer(RenderObject* container, const Layo utPoint& point, bool* offsetDependsOnPoint) const 1108 LayoutSize RenderInline::offsetFromContainer(RenderObject* container, const Layo utPoint& point, bool* offsetDependsOnPoint) const
1122 { 1109 {
1123 ASSERT(container == this->container()); 1110 ASSERT(container == this->container());
1124 1111
1125 LayoutSize offset; 1112 LayoutSize offset;
1126 if (isInFlowPositioned()) 1113 if (isInFlowPositioned())
1127 offset += offsetForInFlowPosition(); 1114 offset += offsetForInFlowPosition();
1128 1115
1129 container->adjustForColumns(offset, point);
1130
1131 if (container->hasOverflowClip()) 1116 if (container->hasOverflowClip())
1132 offset -= toRenderBox(container)->scrolledContentOffset(); 1117 offset -= toRenderBox(container)->scrolledContentOffset();
1133 1118
1134 if (offsetDependsOnPoint) { 1119 if (offsetDependsOnPoint) {
1135 *offsetDependsOnPoint = container->hasColumns() 1120 *offsetDependsOnPoint = (container->isBox() && container->style()->isFli ppedBlocksWritingMode())
1136 || (container->isBox() && container->style()->isFlippedBlocksWriting Mode())
1137 || container->isRenderFlowThread(); 1121 || container->isRenderFlowThread();
1138 } 1122 }
1139 1123
1140 return offset; 1124 return offset;
1141 } 1125 }
1142 1126
1143 void RenderInline::mapLocalToContainer(const RenderLayerModelObject* repaintCont ainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed) const 1127 void RenderInline::mapLocalToContainer(const RenderLayerModelObject* repaintCont ainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed) const
1144 { 1128 {
1145 if (repaintContainer == this) 1129 if (repaintContainer == this)
1146 return; 1130 return;
(...skipping 10 matching lines...) Expand all
1157 } 1141 }
1158 1142
1159 bool containerSkipped; 1143 bool containerSkipped;
1160 RenderObject* o = container(repaintContainer, &containerSkipped); 1144 RenderObject* o = container(repaintContainer, &containerSkipped);
1161 if (!o) 1145 if (!o)
1162 return; 1146 return;
1163 1147
1164 if (mode & ApplyContainerFlip && o->isBox()) { 1148 if (mode & ApplyContainerFlip && o->isBox()) {
1165 if (o->style()->isFlippedBlocksWritingMode()) { 1149 if (o->style()->isFlippedBlocksWritingMode()) {
1166 IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint()) ; 1150 IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint()) ;
1167 transformState.move(toRenderBox(o)->flipForWritingModeIncludingColum ns(centerPoint) - centerPoint); 1151 transformState.move(LayoutPoint() - centerPoint);
1168 } 1152 }
1169 mode &= ~ApplyContainerFlip; 1153 mode &= ~ApplyContainerFlip;
1170 } 1154 }
1171 1155
1172 LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(trans formState.mappedPoint())); 1156 LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(trans formState.mappedPoint()));
1173 1157
1174 bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || styl e()->preserves3D()); 1158 bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || styl e()->preserves3D());
1175 if (mode & UseTransforms && shouldUseTransformFromContainer(o)) { 1159 if (mode & UseTransforms && shouldUseTransformFromContainer(o)) {
1176 TransformationMatrix t; 1160 TransformationMatrix t;
1177 getTransformFromContainer(o, containerOffset, t); 1161 getTransformFromContainer(o, containerOffset, t);
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
1574 container = this; 1558 container = this;
1575 1559
1576 FloatPoint absPos = container->localToAbsolute(); 1560 FloatPoint absPos = container->localToAbsolute();
1577 region.bounds.setX(absPos.x() + region.bounds.x()); 1561 region.bounds.setX(absPos.x() + region.bounds.x());
1578 region.bounds.setY(absPos.y() + region.bounds.y()); 1562 region.bounds.setY(absPos.y() + region.bounds.y());
1579 1563
1580 regions.append(region); 1564 regions.append(region);
1581 } 1565 }
1582 1566
1583 } // namespace WebCore 1567 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderGeometryMap.cpp ('k') | Source/core/rendering/RenderLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698