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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp

Issue 2353843002: Add position sticky main thread scrolling reason [spv2] (Closed)
Patch Set: Embrace the rebase Created 4 years, 2 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/PaintPropertyTreeBuilder.h" 5 #include "core/paint/PaintPropertyTreeBuilder.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/layout/LayoutInline.h" 10 #include "core/layout/LayoutInline.h"
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 if (context.current.scroll && !object.document().settings()->threadedScrolli ngEnabled()) 338 if (context.current.scroll && !object.document().settings()->threadedScrolli ngEnabled())
339 context.current.scroll->addMainThreadScrollingReasons(MainThreadScrollin gReason::kThreadedScrollingDisabled); 339 context.current.scroll->addMainThreadScrollingReasons(MainThreadScrollin gReason::kThreadedScrollingDisabled);
340 340
341 if (object.isBackgroundAttachmentFixedObject()) { 341 if (object.isBackgroundAttachmentFixedObject()) {
342 auto* scrollNode = context.current.scroll; 342 auto* scrollNode = context.current.scroll;
343 while (scrollNode && !scrollNode->hasMainThreadScrollingReasons(MainThre adScrollingReason::kHasBackgroundAttachmentFixedObjects)) { 343 while (scrollNode && !scrollNode->hasMainThreadScrollingReasons(MainThre adScrollingReason::kHasBackgroundAttachmentFixedObjects)) {
344 scrollNode->addMainThreadScrollingReasons(MainThreadScrollingReason: :kHasBackgroundAttachmentFixedObjects); 344 scrollNode->addMainThreadScrollingReasons(MainThreadScrollingReason: :kHasBackgroundAttachmentFixedObjects);
345 scrollNode = scrollNode->parent(); 345 scrollNode = scrollNode->parent();
346 } 346 }
347 } 347 }
348 if (object.styleRef().position() == StickyPosition) {
349 auto* scrollNode = context.current.scroll;
350 while (scrollNode && !scrollNode->hasMainThreadScrollingReasons(MainThre adScrollingReason::kHasStickyPositionObjects)) {
351 scrollNode->addMainThreadScrollingReasons(MainThreadScrollingReason: :kHasStickyPositionObjects);
352 scrollNode = scrollNode->parent();
353 }
354 }
348 } 355 }
349 356
350 void PaintPropertyTreeBuilder::updateOverflowClip(const LayoutObject& object, Pa intPropertyTreeBuilderContext& context) 357 void PaintPropertyTreeBuilder::updateOverflowClip(const LayoutObject& object, Pa intPropertyTreeBuilderContext& context)
351 { 358 {
352 if (!object.isBox()) 359 if (!object.isBox())
353 return; 360 return;
354 const LayoutBox& box = toLayoutBox(object); 361 const LayoutBox& box = toLayoutBox(object);
355 362
356 // The <input> elements can't have contents thus CSS overflow property doesn 't apply. 363 // The <input> elements can't have contents thus CSS overflow property doesn 't apply.
357 // However for layout purposes we do generate child layout objects for them, e.g. button label. 364 // However for layout purposes we do generate child layout objects for them, e.g. button label.
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 return; 580 return;
574 581
575 updateOverflowClip(object, context); 582 updateOverflowClip(object, context);
576 updatePerspective(object, context); 583 updatePerspective(object, context);
577 updateSvgLocalToBorderBoxTransform(object, context); 584 updateSvgLocalToBorderBoxTransform(object, context);
578 updateScrollAndScrollTranslation(object, context); 585 updateScrollAndScrollTranslation(object, context);
579 updateOutOfFlowContext(object, context); 586 updateOutOfFlowContext(object, context);
580 } 587 }
581 588
582 } // namespace blink 589 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698