| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * | 4 * |
| 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 6 * | 6 * |
| 7 * Other contributors: | 7 * Other contributors: |
| 8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
| 10 * Christian Biesinger <cbiesinger@web.de> | 10 * Christian Biesinger <cbiesinger@web.de> |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 | 331 |
| 332 bool PaintLayer::sticksToViewport() const { | 332 bool PaintLayer::sticksToViewport() const { |
| 333 if (layoutObject().style()->position() != EPosition::kFixed && | 333 if (layoutObject().style()->position() != EPosition::kFixed && |
| 334 layoutObject().style()->position() != EPosition::kSticky) | 334 layoutObject().style()->position() != EPosition::kSticky) |
| 335 return false; | 335 return false; |
| 336 | 336 |
| 337 // TODO(pdr): This approach of calculating the nearest scroll node is O(n). | 337 // TODO(pdr): This approach of calculating the nearest scroll node is O(n). |
| 338 // An option for improving this is to cache the nearest scroll node in | 338 // An option for improving this is to cache the nearest scroll node in |
| 339 // the local border box properties. | 339 // the local border box properties. |
| 340 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 340 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 341 const auto* viewProperties = layoutObject().view()->paintProperties(); | 341 const auto* viewBorderBoxProperties = |
| 342 layoutObject().view()->localBorderBoxProperties(); |
| 342 const ScrollPaintPropertyNode* ancestorTargetScrollNode; | 343 const ScrollPaintPropertyNode* ancestorTargetScrollNode; |
| 343 if (layoutObject().style()->position() == EPosition::kFixed) { | 344 if (layoutObject().style()->position() == EPosition::kFixed) { |
| 344 ancestorTargetScrollNode = viewProperties->localBorderBoxProperties() | 345 ancestorTargetScrollNode = |
| 345 ->transform() | 346 viewBorderBoxProperties->transform()->findEnclosingScrollNode(); |
| 346 ->findEnclosingScrollNode(); | |
| 347 } else { | 347 } else { |
| 348 ancestorTargetScrollNode = viewProperties->contentsProperties() | 348 ancestorTargetScrollNode = layoutObject() |
| 349 .view() |
| 350 ->contentsProperties() |
| 349 ->transform() | 351 ->transform() |
| 350 ->findEnclosingScrollNode(); | 352 ->findEnclosingScrollNode(); |
| 351 } | 353 } |
| 352 | 354 |
| 353 const auto* properties = layoutObject().paintProperties(); | 355 const auto* transform = |
| 354 const auto* transform = properties->localBorderBoxProperties()->transform(); | 356 layoutObject().localBorderBoxProperties()->transform(); |
| 355 return transform->findEnclosingScrollNode() == ancestorTargetScrollNode; | 357 return transform->findEnclosingScrollNode() == ancestorTargetScrollNode; |
| 356 } | 358 } |
| 357 | 359 |
| 358 return (layoutObject().style()->position() == EPosition::kFixed && | 360 return (layoutObject().style()->position() == EPosition::kFixed && |
| 359 layoutObject().containerForFixedPosition() == | 361 layoutObject().containerForFixedPosition() == |
| 360 layoutObject().view()) || | 362 layoutObject().view()) || |
| 361 (layoutObject().style()->position() == EPosition::kSticky && | 363 (layoutObject().style()->position() == EPosition::kSticky && |
| 362 (!ancestorScrollingLayer() || ancestorScrollingLayer() == root())); | 364 (!ancestorScrollingLayer() || ancestorScrollingLayer() == root())); |
| 363 } | 365 } |
| 364 | 366 |
| (...skipping 2873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3238 } | 3240 } |
| 3239 | 3241 |
| 3240 void showLayerTree(const blink::LayoutObject* layoutObject) { | 3242 void showLayerTree(const blink::LayoutObject* layoutObject) { |
| 3241 if (!layoutObject) { | 3243 if (!layoutObject) { |
| 3242 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; | 3244 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; |
| 3243 return; | 3245 return; |
| 3244 } | 3246 } |
| 3245 showLayerTree(layoutObject->enclosingLayer()); | 3247 showLayerTree(layoutObject->enclosingLayer()); |
| 3246 } | 3248 } |
| 3247 #endif | 3249 #endif |
| OLD | NEW |