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

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: Created 4 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
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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 335
336 void PaintPropertyTreeBuilder::updateMainThreadScrollingReasons(const LayoutObje ct& object, PaintPropertyTreeBuilderContext& context) 336 void PaintPropertyTreeBuilder::updateMainThreadScrollingReasons(const LayoutObje ct& object, PaintPropertyTreeBuilderContext& context)
337 { 337 {
338 if (object.isBackgroundAttachmentFixedObject()) { 338 if (object.isBackgroundAttachmentFixedObject()) {
339 auto* scrollNode = context.current.scroll; 339 auto* scrollNode = context.current.scroll;
340 while (scrollNode && !scrollNode->hasMainThreadScrollingReasons(MainThre adScrollingReason::kHasBackgroundAttachmentFixedObjects)) { 340 while (scrollNode && !scrollNode->hasMainThreadScrollingReasons(MainThre adScrollingReason::kHasBackgroundAttachmentFixedObjects)) {
341 scrollNode->addMainThreadScrollingReasons(MainThreadScrollingReason: :kHasBackgroundAttachmentFixedObjects); 341 scrollNode->addMainThreadScrollingReasons(MainThreadScrollingReason: :kHasBackgroundAttachmentFixedObjects);
342 scrollNode = scrollNode->parent(); 342 scrollNode = scrollNode->parent();
343 } 343 }
344 } 344 }
345 if (object.styleRef().position() == StickyPosition) {
346 auto* scrollNode = context.current.scroll;
347 while (scrollNode && !scrollNode->hasMainThreadScrollingReasons(MainThre adScrollingReason::kHasStickyPositionObjects)) {
348 scrollNode->addMainThreadScrollingReasons(MainThreadScrollingReason: :kHasStickyPositionObjects);
349 scrollNode = scrollNode->parent();
350 }
351 }
345 } 352 }
346 353
347 void PaintPropertyTreeBuilder::updateOverflowClip(const LayoutObject& object, Pa intPropertyTreeBuilderContext& context) 354 void PaintPropertyTreeBuilder::updateOverflowClip(const LayoutObject& object, Pa intPropertyTreeBuilderContext& context)
348 { 355 {
349 if (!object.isBox()) 356 if (!object.isBox())
350 return; 357 return;
351 const LayoutBox& box = toLayoutBox(object); 358 const LayoutBox& box = toLayoutBox(object);
352 359
353 // The <input> elements can't have contents thus CSS overflow property doesn 't apply. 360 // The <input> elements can't have contents thus CSS overflow property doesn 't apply.
354 // However for layout purposes we do generate child layout objects for them, e.g. button label. 361 // 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
570 return; 577 return;
571 578
572 updateOverflowClip(object, context); 579 updateOverflowClip(object, context);
573 updatePerspective(object, context); 580 updatePerspective(object, context);
574 updateSvgLocalToBorderBoxTransform(object, context); 581 updateSvgLocalToBorderBoxTransform(object, context);
575 updateScrollAndScrollTranslation(object, context); 582 updateScrollAndScrollTranslation(object, context);
576 updateOutOfFlowContext(object, context); 583 updateOutOfFlowContext(object, context);
577 } 584 }
578 585
579 } // namespace blink 586 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698