Chromium Code Reviews| 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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 790 o->m_bitfields.setPreferredLogicalWidthsDirty(true); | 790 o->m_bitfields.setPreferredLogicalWidthsDirty(true); |
| 791 if (o->style()->hasOutOfFlowPosition()) { | 791 if (o->style()->hasOutOfFlowPosition()) { |
| 792 // A positioned object has no effect on the min/max width of its con taining block ever. | 792 // A positioned object has no effect on the min/max width of its con taining block ever. |
| 793 // We can optimize this case and not go up any further. | 793 // We can optimize this case and not go up any further. |
| 794 break; | 794 break; |
| 795 } | 795 } |
| 796 o = container; | 796 o = container; |
| 797 } | 797 } |
| 798 } | 798 } |
| 799 | 799 |
| 800 void LayoutObject::minMaxPreferredLogicalWidthForParent(LayoutUnit& minPreferred LogicalWidth, LayoutUnit& maxPreferredLogicalWidth) const | |
| 801 { | |
| 802 if (isBox() && toLayoutBox(this)->isWritingModeOrthogonalToParent()) { | |
| 803 const_cast<LayoutObject*>(this)->layoutIfNeeded(); | |
|
eae
2015/05/04 00:06:59
I'd rather try to avoid calling layout during pref
| |
| 804 minPreferredLogicalWidth = maxPreferredLogicalWidth = toLayoutBox(this)- >logicalHeight(); | |
| 805 return; | |
| 806 } | |
| 807 minPreferredLogicalWidth = this->minPreferredLogicalWidth(); | |
| 808 maxPreferredLogicalWidth = this->maxPreferredLogicalWidth(); | |
| 809 } | |
| 810 | |
| 800 LayoutBlock* LayoutObject::containerForFixedPosition(const LayoutBoxModelObject* paintInvalidationContainer, bool* paintInvalidationContainerSkipped) const | 811 LayoutBlock* LayoutObject::containerForFixedPosition(const LayoutBoxModelObject* paintInvalidationContainer, bool* paintInvalidationContainerSkipped) const |
| 801 { | 812 { |
| 802 ASSERT(!paintInvalidationContainerSkipped || !*paintInvalidationContainerSki pped); | 813 ASSERT(!paintInvalidationContainerSkipped || !*paintInvalidationContainerSki pped); |
| 803 ASSERT(!isText()); | 814 ASSERT(!isText()); |
| 804 ASSERT(style()->position() == FixedPosition); | 815 ASSERT(style()->position() == FixedPosition); |
| 805 | 816 |
| 806 LayoutObject* ancestor = parent(); | 817 LayoutObject* ancestor = parent(); |
| 807 for (; ancestor && !ancestor->canContainFixedPositionObjects(); ancestor = a ncestor->parent()) { | 818 for (; ancestor && !ancestor->canContainFixedPositionObjects(); ancestor = a ncestor->parent()) { |
| 808 if (paintInvalidationContainerSkipped && ancestor == paintInvalidationCo ntainer) | 819 if (paintInvalidationContainerSkipped && ancestor == paintInvalidationCo ntainer) |
| 809 *paintInvalidationContainerSkipped = true; | 820 *paintInvalidationContainerSkipped = true; |
| (...skipping 2529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3339 { | 3350 { |
| 3340 if (object1) { | 3351 if (object1) { |
| 3341 const blink::LayoutObject* root = object1; | 3352 const blink::LayoutObject* root = object1; |
| 3342 while (root->parent()) | 3353 while (root->parent()) |
| 3343 root = root->parent(); | 3354 root = root->parent(); |
| 3344 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3355 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
| 3345 } | 3356 } |
| 3346 } | 3357 } |
| 3347 | 3358 |
| 3348 #endif | 3359 #endif |
| OLD | NEW |