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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2394053004: Clear scroll anchor on all parent scrollers from ScrollAnchor::clear (Closed)
Patch Set: review comments 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 /* 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 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 2692 matching lines...) Expand 10 before | Expand all | Expand 10 after
2703 2703
2704 if (RuntimeEnabledFeatures::scrollAnchoringEnabled() && 2704 if (RuntimeEnabledFeatures::scrollAnchoringEnabled() &&
2705 m_bitfields.isScrollAnchorObject()) { 2705 m_bitfields.isScrollAnchorObject()) {
2706 // Clear the bit first so that anchor.clear() doesn't recurse into 2706 // Clear the bit first so that anchor.clear() doesn't recurse into
2707 // findReferencingScrollAnchors. 2707 // findReferencingScrollAnchors.
2708 m_bitfields.setIsScrollAnchorObject(false); 2708 m_bitfields.setIsScrollAnchorObject(false);
2709 findReferencingScrollAnchors(this, Clear); 2709 findReferencingScrollAnchors(this, Clear);
2710 } 2710 }
2711 } 2711 }
2712 2712
2713 void LayoutObject::maybeClearIsScrollAnchorObject() { 2713 void LayoutObject::clearIsScrollAnchorObject(bool unconditionally) {
2714 if (m_bitfields.isScrollAnchorObject()) 2714 if (!m_bitfields.isScrollAnchorObject())
2715 m_bitfields.setIsScrollAnchorObject( 2715 return;
2716 findReferencingScrollAnchors(this, DontClear)); 2716
2717 if (unconditionally) {
2718 m_bitfields.setIsScrollAnchorObject(false);
2719 return;
2720 }
2721 m_bitfields.setIsScrollAnchorObject(
2722 findReferencingScrollAnchors(this, DontClear));
2717 } 2723 }
2718 2724
2719 void LayoutObject::removeFromLayoutFlowThread() { 2725 void LayoutObject::removeFromLayoutFlowThread() {
2720 if (!isInsideFlowThread()) 2726 if (!isInsideFlowThread())
2721 return; 2727 return;
2722 2728
2723 // Sometimes we remove the element from the flow, but it's not destroyed at 2729 // Sometimes we remove the element from the flow, but it's not destroyed at
2724 // that time. 2730 // that time.
2725 // It's only until later when we actually destroy it and remove all the 2731 // It's only until later when we actually destroy it and remove all the
2726 // children from it. 2732 // children from it.
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
3533 const blink::LayoutObject* root = object1; 3539 const blink::LayoutObject* root = object1;
3534 while (root->parent()) 3540 while (root->parent())
3535 root = root->parent(); 3541 root = root->parent();
3536 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3542 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3537 } else { 3543 } else {
3538 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3544 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3539 } 3545 }
3540 } 3546 }
3541 3547
3542 #endif 3548 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/layout/ScrollAnchor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698