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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
518 // Step 4: If |checkParent| is set, climb up to our parent and check its sib lings that | 518 // Step 4: If |checkParent| is set, climb up to our parent and check its sib lings that |
519 // follow us to see if we can locate a layer. | 519 // follow us to see if we can locate a layer. |
520 if (checkParent && parent()) | 520 if (checkParent && parent()) |
521 return parent()->findNextLayer(parentLayer, this, true); | 521 return parent()->findNextLayer(parentLayer, this, true); |
522 | 522 |
523 return 0; | 523 return 0; |
524 } | 524 } |
525 | 525 |
526 RenderLayer* RenderObject::enclosingLayer() const | 526 RenderLayer* RenderObject::enclosingLayer() const |
527 { | 527 { |
528 const RenderObject* curr = this; | 528 for (const RenderObject* current = this; current; current = current->parent( )) { |
529 while (curr) { | 529 if (current->hasLayer()) |
530 RenderLayer* layer = curr->hasLayer() ? toRenderLayerModelObject(curr)-> layer() : 0; | 530 return toRenderLayerModelObject(current)->layer(); |
531 if (layer) | |
532 return layer; | |
533 curr = curr->parent(); | |
534 } | 531 } |
532 ASSERT_NOT_REACHED(); | |
abarth-chromium
2014/03/26 05:24:22
Looks like this line can be reached. /me will inv
| |
535 return 0; | 533 return 0; |
536 } | 534 } |
537 | 535 |
538 bool RenderObject::scrollRectToVisible(const LayoutRect& rect, const ScrollAlign ment& alignX, const ScrollAlignment& alignY) | 536 bool RenderObject::scrollRectToVisible(const LayoutRect& rect, const ScrollAlign ment& alignX, const ScrollAlignment& alignY) |
539 { | 537 { |
540 RenderBox* enclosingBox = this->enclosingBox(); | 538 RenderBox* enclosingBox = this->enclosingBox(); |
541 if (!enclosingBox) | 539 if (!enclosingBox) |
542 return false; | 540 return false; |
543 | 541 |
544 enclosingBox->scrollRectToVisible(rect, alignX, alignY); | 542 enclosingBox->scrollRectToVisible(rect, alignX, alignY); |
(...skipping 2863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3408 { | 3406 { |
3409 if (object1) { | 3407 if (object1) { |
3410 const WebCore::RenderObject* root = object1; | 3408 const WebCore::RenderObject* root = object1; |
3411 while (root->parent()) | 3409 while (root->parent()) |
3412 root = root->parent(); | 3410 root = root->parent(); |
3413 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3411 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
3414 } | 3412 } |
3415 } | 3413 } |
3416 | 3414 |
3417 #endif | 3415 #endif |
OLD | NEW |