| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 // get our true bounding box. | 1133 // get our true bounding box. |
| 1134 RenderFlowThread* enclosingFlowThread = toRenderFlowThread(paginationLay
er->renderer()); | 1134 RenderFlowThread* enclosingFlowThread = toRenderFlowThread(paginationLay
er->renderer()); |
| 1135 result = enclosingFlowThread->fragmentsBoundingBox(result); | 1135 result = enclosingFlowThread->fragmentsBoundingBox(result); |
| 1136 | 1136 |
| 1137 LayoutPoint rootLayerDelta; | 1137 LayoutPoint rootLayerDelta; |
| 1138 paginationLayer->convertToLayerCoords(rootLayer, rootLayerDelta); | 1138 paginationLayer->convertToLayerCoords(rootLayer, rootLayerDelta); |
| 1139 result.moveBy(rootLayerDelta); | 1139 result.moveBy(rootLayerDelta); |
| 1140 return result; | 1140 return result; |
| 1141 } | 1141 } |
| 1142 | 1142 |
| 1143 LayoutRect clipRect = layer->physicalBoundingBox(rootLayer); | 1143 LayoutRect clipRect = layer->fragmentsBoundingBox(rootLayer); |
| 1144 expandClipRectForDescendantsAndReflection(clipRect, layer, rootLayer, transp
arencyBehavior, subPixelAccumulation, paintBehavior); | 1144 expandClipRectForDescendantsAndReflection(clipRect, layer, rootLayer, transp
arencyBehavior, subPixelAccumulation, paintBehavior); |
| 1145 layer->renderer()->style()->filterOutsets().expandRect(clipRect); | 1145 layer->renderer()->style()->filterOutsets().expandRect(clipRect); |
| 1146 clipRect.move(subPixelAccumulation); | 1146 clipRect.move(subPixelAccumulation); |
| 1147 return clipRect; | 1147 return clipRect; |
| 1148 } | 1148 } |
| 1149 | 1149 |
| 1150 LayoutRect RenderLayer::paintingExtent(const RenderLayer* rootLayer, const Layou
tRect& paintDirtyRect, const LayoutSize& subPixelAccumulation, PaintBehavior pai
ntBehavior) | 1150 LayoutRect RenderLayer::paintingExtent(const RenderLayer* rootLayer, const Layou
tRect& paintDirtyRect, const LayoutSize& subPixelAccumulation, PaintBehavior pai
ntBehavior) |
| 1151 { | 1151 { |
| 1152 return intersection(transparencyClipBox(this, rootLayer, PaintingTransparenc
yClipBox, RootOfTransparencyClipBox, subPixelAccumulation, paintBehavior), paint
DirtyRect); | 1152 return intersection(transparencyClipBox(this, rootLayer, PaintingTransparenc
yClipBox, RootOfTransparencyClipBox, subPixelAccumulation, paintBehavior), paint
DirtyRect); |
| 1153 } | 1153 } |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1405 | 1405 |
| 1406 const RenderLayer* currLayer = this; | 1406 const RenderLayer* currLayer = this; |
| 1407 while (currLayer && currLayer != ancestorLayer) | 1407 while (currLayer && currLayer != ancestorLayer) |
| 1408 currLayer = accumulateOffsetTowardsAncestor(currLayer, ancestorLayer, lo
cation); | 1408 currLayer = accumulateOffsetTowardsAncestor(currLayer, ancestorLayer, lo
cation); |
| 1409 } | 1409 } |
| 1410 | 1410 |
| 1411 void RenderLayer::convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutR
ect& rect) const | 1411 void RenderLayer::convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutR
ect& rect) const |
| 1412 { | 1412 { |
| 1413 LayoutPoint delta; | 1413 LayoutPoint delta; |
| 1414 convertToLayerCoords(ancestorLayer, delta); | 1414 convertToLayerCoords(ancestorLayer, delta); |
| 1415 rect.move(-delta.x(), -delta.y()); | 1415 rect.moveBy(delta); |
| 1416 } | 1416 } |
| 1417 | 1417 |
| 1418 void RenderLayer::didUpdateNeedsCompositedScrolling() | 1418 void RenderLayer::didUpdateNeedsCompositedScrolling() |
| 1419 { | 1419 { |
| 1420 updateSelfPaintingLayer(); | 1420 updateSelfPaintingLayer(); |
| 1421 } | 1421 } |
| 1422 | 1422 |
| 1423 void RenderLayer::updateReflectionInfo(const RenderStyle* oldStyle) | 1423 void RenderLayer::updateReflectionInfo(const RenderStyle* oldStyle) |
| 1424 { | 1424 { |
| 1425 ASSERT(!oldStyle || !renderer()->style()->reflectionDataEquivalent(oldStyle)
); | 1425 ASSERT(!oldStyle || !renderer()->style()->reflectionDataEquivalent(oldStyle)
); |
| (...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2218 RenderBox* box = renderBox(); | 2218 RenderBox* box = renderBox(); |
| 2219 ASSERT(box); | 2219 ASSERT(box); |
| 2220 result = box->borderBoxRect(); | 2220 result = box->borderBoxRect(); |
| 2221 result.unite(box->visualOverflowRect()); | 2221 result.unite(box->visualOverflowRect()); |
| 2222 } | 2222 } |
| 2223 | 2223 |
| 2224 ASSERT(renderer()->view()); | 2224 ASSERT(renderer()->view()); |
| 2225 return result; | 2225 return result; |
| 2226 } | 2226 } |
| 2227 | 2227 |
| 2228 LayoutRect RenderLayer::physicalBoundingBox(const RenderLayer* ancestorLayer, co
nst LayoutPoint* offsetFromRoot) const | 2228 LayoutRect RenderLayer::flippedLogicalBoundingBox() const |
| 2229 { | 2229 { |
| 2230 LayoutRect result = logicalBoundingBox(); | 2230 LayoutRect result = logicalBoundingBox(); |
| 2231 if (m_renderer->isBox()) | 2231 if (m_renderer->isBox()) |
| 2232 renderBox()->flipForWritingMode(result); | 2232 renderBox()->flipForWritingMode(result); |
| 2233 else | 2233 else |
| 2234 m_renderer->containingBlock()->flipForWritingMode(result); | 2234 m_renderer->containingBlock()->flipForWritingMode(result); |
| 2235 | |
| 2236 LayoutPoint delta; | |
| 2237 if (offsetFromRoot) | |
| 2238 delta = *offsetFromRoot; | |
| 2239 else | |
| 2240 convertToLayerCoords(ancestorLayer, delta); | |
| 2241 | |
| 2242 result.moveBy(delta); | |
| 2243 return result; | 2235 return result; |
| 2244 } | 2236 } |
| 2245 | 2237 |
| 2238 LayoutRect RenderLayer::physicalBoundingBox(const RenderLayer* ancestorLayer, co
nst LayoutPoint* offsetFromRoot) const |
| 2239 { |
| 2240 LayoutRect result = flippedLogicalBoundingBox(); |
| 2241 if (offsetFromRoot) |
| 2242 result.moveBy(*offsetFromRoot); |
| 2243 else |
| 2244 convertToLayerCoords(ancestorLayer, result); |
| 2245 return result; |
| 2246 } |
| 2247 |
| 2248 LayoutRect RenderLayer::fragmentsBoundingBox(const RenderLayer* ancestorLayer) c
onst |
| 2249 { |
| 2250 if (!enclosingPaginationLayer()) |
| 2251 return physicalBoundingBox(ancestorLayer); |
| 2252 |
| 2253 LayoutRect result = flippedLogicalBoundingBox(); |
| 2254 |
| 2255 // Split our box up into the actual fragment boxes that render in the column
s/pages and unite those together to |
| 2256 // get our true bounding box. |
| 2257 LayoutPoint offsetWithinPaginationLayer; |
| 2258 convertToLayerCoords(enclosingPaginationLayer(), offsetWithinPaginationLayer
); |
| 2259 result.moveBy(offsetWithinPaginationLayer); |
| 2260 |
| 2261 RenderFlowThread* enclosingFlowThread = toRenderFlowThread(enclosingPaginati
onLayer()->renderer()); |
| 2262 result = enclosingFlowThread->fragmentsBoundingBox(result); |
| 2263 enclosingPaginationLayer()->convertToLayerCoords(ancestorLayer, result); |
| 2264 return result; |
| 2265 } |
| 2266 |
| 2246 static void expandRectForReflectionAndStackingChildren(const RenderLayer* ancest
orLayer, RenderLayer::CalculateBoundsOptions options, LayoutRect& result) | 2267 static void expandRectForReflectionAndStackingChildren(const RenderLayer* ancest
orLayer, RenderLayer::CalculateBoundsOptions options, LayoutRect& result) |
| 2247 { | 2268 { |
| 2248 if (ancestorLayer->reflectionInfo() && !ancestorLayer->reflectionInfo()->ref
lectionLayer()->hasCompositedLayerMapping()) | 2269 if (ancestorLayer->reflectionInfo() && !ancestorLayer->reflectionInfo()->ref
lectionLayer()->hasCompositedLayerMapping()) |
| 2249 result.unite(ancestorLayer->reflectionInfo()->reflectionLayer()->boundin
gBoxForCompositing(ancestorLayer)); | 2270 result.unite(ancestorLayer->reflectionInfo()->reflectionLayer()->boundin
gBoxForCompositing(ancestorLayer)); |
| 2250 | 2271 |
| 2251 ASSERT(ancestorLayer->stackingNode()->isStackingContext() || !ancestorLayer-
>stackingNode()->hasPositiveZOrderList()); | 2272 ASSERT(ancestorLayer->stackingNode()->isStackingContext() || !ancestorLayer-
>stackingNode()->hasPositiveZOrderList()); |
| 2252 | 2273 |
| 2253 #if ENABLE(ASSERT) | 2274 #if ENABLE(ASSERT) |
| 2254 LayerListMutationDetector mutationChecker(const_cast<RenderLayer*>(ancestorL
ayer)->stackingNode()); | 2275 LayerListMutationDetector mutationChecker(const_cast<RenderLayer*>(ancestorL
ayer)->stackingNode()); |
| 2255 #endif | 2276 #endif |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2851 } | 2872 } |
| 2852 } | 2873 } |
| 2853 | 2874 |
| 2854 void showLayerTree(const blink::RenderObject* renderer) | 2875 void showLayerTree(const blink::RenderObject* renderer) |
| 2855 { | 2876 { |
| 2856 if (!renderer) | 2877 if (!renderer) |
| 2857 return; | 2878 return; |
| 2858 showLayerTree(renderer->enclosingLayer()); | 2879 showLayerTree(renderer->enclosingLayer()); |
| 2859 } | 2880 } |
| 2860 #endif | 2881 #endif |
| OLD | NEW |