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

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

Issue 1868013002: Percent height in auto height containers no longer computes as auto (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@303728-6
Patch Set: Updated Created 4 years, 8 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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 } 518 }
519 p = p->parent(); 519 p = p->parent();
520 } 520 }
521 return offset; 521 return offset;
522 } 522 }
523 523
524 LayoutBlock* LayoutBoxModelObject::containingBlockForAutoHeightDetection(Length logicalHeight) const 524 LayoutBlock* LayoutBoxModelObject::containingBlockForAutoHeightDetection(Length logicalHeight) const
525 { 525 {
526 // For percentage heights: The percentage is calculated with respect to the height of the generated box's 526 // For percentage heights: The percentage is calculated with respect to the height of the generated box's
527 // containing block. If the height of the containing block is not specified explicitly (i.e., it depends 527 // containing block. If the height of the containing block is not specified explicitly (i.e., it depends
528 // on content height), and this element is not absolutely positioned, the va lue computes to 'auto'. 528 // on content height), and this element is not absolutely positioned, the u sed height is calculated
529 // as if 'auto' was specified.
529 if (!logicalHeight.hasPercent() || isOutOfFlowPositioned()) 530 if (!logicalHeight.hasPercent() || isOutOfFlowPositioned())
530 return nullptr; 531 return nullptr;
531 532
532 // Anonymous block boxes are ignored when resolving percentage values that w ould refer to it: 533 // Anonymous block boxes are ignored when resolving percentage values that w ould refer to it:
533 // the closest non-anonymous ancestor box is used instead. 534 // the closest non-anonymous ancestor box is used instead.
534 LayoutBlock* cb = containingBlock(); 535 LayoutBlock* cb = containingBlock();
535 while (cb->isAnonymous()) 536 while (cb->isAnonymous())
536 cb = cb->containingBlock(); 537 cb = cb->containingBlock();
537 538
538 // Matching LayoutBox::percentageLogicalHeightIsResolvableFromBlock() by 539 // Matching LayoutBox::percentageLogicalHeightIsResolvableFromBlock() by
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 if (rootElementStyle->hasBackground()) 970 if (rootElementStyle->hasBackground())
970 return false; 971 return false;
971 972
972 if (node() != document().firstBodyElement()) 973 if (node() != document().firstBodyElement())
973 return false; 974 return false;
974 975
975 return true; 976 return true;
976 } 977 }
977 978
978 } // namespace blink 979 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698