OLD | NEW |
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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 } | 624 } |
625 // TODO(crbug.com/365897): we should get rid of detached layout subtrees, at | 625 // TODO(crbug.com/365897): we should get rid of detached layout subtrees, at |
626 // which point this code should not be reached. | 626 // which point this code should not be reached. |
627 return nullptr; | 627 return nullptr; |
628 } | 628 } |
629 | 629 |
630 bool LayoutObject::ScrollRectToVisible(const LayoutRect& rect, | 630 bool LayoutObject::ScrollRectToVisible(const LayoutRect& rect, |
631 const ScrollAlignment& align_x, | 631 const ScrollAlignment& align_x, |
632 const ScrollAlignment& align_y, | 632 const ScrollAlignment& align_y, |
633 ScrollType scroll_type, | 633 ScrollType scroll_type, |
634 bool make_visible_in_visual_viewport, | 634 bool make_visible_in_visual_viewport) { |
635 ScrollBehavior scroll_behavior) { | |
636 LayoutBox* enclosing_box = this->EnclosingBox(); | 635 LayoutBox* enclosing_box = this->EnclosingBox(); |
637 if (!enclosing_box) | 636 if (!enclosing_box) |
638 return false; | 637 return false; |
639 | 638 |
640 enclosing_box->ScrollRectToVisible(rect, align_x, align_y, scroll_type, | 639 enclosing_box->ScrollRectToVisible(rect, align_x, align_y, scroll_type, |
641 make_visible_in_visual_viewport, | 640 make_visible_in_visual_viewport); |
642 scroll_behavior); | |
643 return true; | 641 return true; |
644 } | 642 } |
645 | 643 |
646 LayoutBox* LayoutObject::EnclosingBox() const { | 644 LayoutBox* LayoutObject::EnclosingBox() const { |
647 LayoutObject* curr = const_cast<LayoutObject*>(this); | 645 LayoutObject* curr = const_cast<LayoutObject*>(this); |
648 while (curr) { | 646 while (curr) { |
649 if (curr->IsBox()) | 647 if (curr->IsBox()) |
650 return ToLayoutBox(curr); | 648 return ToLayoutBox(curr); |
651 curr = curr->Parent(); | 649 curr = curr->Parent(); |
652 } | 650 } |
(...skipping 2992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3645 const blink::LayoutObject* root = object1; | 3643 const blink::LayoutObject* root = object1; |
3646 while (root->Parent()) | 3644 while (root->Parent()) |
3647 root = root->Parent(); | 3645 root = root->Parent(); |
3648 root->ShowLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3646 root->ShowLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3649 } else { | 3647 } else { |
3650 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3648 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
3651 } | 3649 } |
3652 } | 3650 } |
3653 | 3651 |
3654 #endif | 3652 #endif |
OLD | NEW |