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. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 { | 611 { |
612 for (const LayoutObject* current = this; current; current = current->parent(
)) { | 612 for (const LayoutObject* current = this; current; current = current->parent(
)) { |
613 if (current->hasLayer()) | 613 if (current->hasLayer()) |
614 return toLayoutBoxModelObject(current)->layer(); | 614 return toLayoutBoxModelObject(current)->layer(); |
615 } | 615 } |
616 // FIXME: we should get rid of detached layout subtrees, at which point this
code should | 616 // FIXME: we should get rid of detached layout subtrees, at which point this
code should |
617 // not be reached. crbug.com/411429 | 617 // not be reached. crbug.com/411429 |
618 return nullptr; | 618 return nullptr; |
619 } | 619 } |
620 | 620 |
621 bool LayoutObject::scrollRectToVisible(const LayoutRect& rect, const ScrollAlign
ment& alignX, const ScrollAlignment& alignY) | 621 bool LayoutObject::scrollRectToVisible(const LayoutRect& rect, const ScrollAlign
ment& alignX, const ScrollAlignment& alignY, ScrollType scrollType) |
622 { | 622 { |
623 LayoutBox* enclosingBox = this->enclosingBox(); | 623 LayoutBox* enclosingBox = this->enclosingBox(); |
624 if (!enclosingBox) | 624 if (!enclosingBox) |
625 return false; | 625 return false; |
626 | 626 |
627 enclosingBox->scrollRectToVisible(rect, alignX, alignY); | 627 enclosingBox->scrollRectToVisible(rect, alignX, alignY, scrollType); |
628 return true; | 628 return true; |
629 } | 629 } |
630 | 630 |
631 LayoutBox* LayoutObject::enclosingBox() const | 631 LayoutBox* LayoutObject::enclosingBox() const |
632 { | 632 { |
633 LayoutObject* curr = const_cast<LayoutObject*>(this); | 633 LayoutObject* curr = const_cast<LayoutObject*>(this); |
634 while (curr) { | 634 while (curr) { |
635 if (curr->isBox()) | 635 if (curr->isBox()) |
636 return toLayoutBox(curr); | 636 return toLayoutBox(curr); |
637 curr = curr->parent(); | 637 curr = curr->parent(); |
(...skipping 2756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3394 const blink::LayoutObject* root = object1; | 3394 const blink::LayoutObject* root = object1; |
3395 while (root->parent()) | 3395 while (root->parent()) |
3396 root = root->parent(); | 3396 root = root->parent(); |
3397 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3397 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3398 } else { | 3398 } else { |
3399 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); | 3399 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); |
3400 } | 3400 } |
3401 } | 3401 } |
3402 | 3402 |
3403 #endif | 3403 #endif |
OLD | NEW |