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

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

Issue 2794663002: Fix inline outline in a corner case (Closed)
Patch Set: - Created 3 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) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2010. 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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 if (childrenInline()) 469 if (childrenInline())
470 toLayoutBlockFlow(this)->addOverflowFromInlineChildren(); 470 toLayoutBlockFlow(this)->addOverflowFromInlineChildren();
471 else 471 else
472 addOverflowFromBlockChildren(); 472 addOverflowFromBlockChildren();
473 } 473 }
474 474
475 DISABLE_CFI_PERF 475 DISABLE_CFI_PERF
476 void LayoutBlock::computeOverflow(LayoutUnit oldClientAfterEdge, bool) { 476 void LayoutBlock::computeOverflow(LayoutUnit oldClientAfterEdge, bool) {
477 m_overflow.reset(); 477 m_overflow.reset();
478 478
479 // Add overflow from children.
480 addOverflowFromChildren(); 479 addOverflowFromChildren();
481
482 // Add in the overflow from positioned objects.
483 addOverflowFromPositionedObjects(); 480 addOverflowFromPositionedObjects();
484 481
485 if (hasOverflowClip()) { 482 if (hasOverflowClip()) {
486 // When we have overflow clip, propagate the original spillout since it will 483 // When we have overflow clip, propagate the original spillout since it will
487 // include collapsed bottom margins and bottom padding. Set the axis we 484 // include collapsed bottom margins and bottom padding. Set the axis we
488 // don't care about to be 1, since we want this overflow to always be 485 // don't care about to be 1, since we want this overflow to always be
489 // considered reachable. 486 // considered reachable.
490 LayoutRect clientRect(noOverflowRect()); 487 LayoutRect clientRect(noOverflowRect());
491 LayoutRect rectToApply; 488 LayoutRect rectToApply;
492 if (isHorizontalWritingMode()) 489 if (isHorizontalWritingMode())
(...skipping 17 matching lines...) Expand all
510 // overflow it. 507 // overflow it.
511 PaintLayer* layer = enclosingLayer(); 508 PaintLayer* layer = enclosingLayer();
512 if (!needsLayout() && layer->hasCompositedLayerMapping() && 509 if (!needsLayout() && layer->hasCompositedLayerMapping() &&
513 !layer->visualRect().contains(visualOverflowRect())) 510 !layer->visualRect().contains(visualOverflowRect()))
514 layer->setNeedsCompositingInputsUpdate(); 511 layer->setNeedsCompositingInputsUpdate();
515 } 512 }
516 513
517 void LayoutBlock::addOverflowFromBlockChildren() { 514 void LayoutBlock::addOverflowFromBlockChildren() {
518 for (LayoutBox* child = firstChildBox(); child; 515 for (LayoutBox* child = firstChildBox(); child;
519 child = child->nextSiblingBox()) { 516 child = child->nextSiblingBox()) {
520 if (!child->isFloatingOrOutOfFlowPositioned() && !child->isColumnSpanAll()) 517 if (child->isFloatingOrOutOfFlowPositioned() || child->isColumnSpanAll())
521 addOverflowFromChild(child); 518 continue;
519
520 // If the child contains inline with outline and continuation, its
521 // visual overflow computed during its layout might be inaccurate because
522 // the layout of continuations might not be up-to-date at that time.
523 // Re-add overflow from inline children to ensure its overflow covers
524 // the outline which may enclose continuations.
525 if (child->isLayoutBlockFlow() &&
526 toLayoutBlockFlow(child)->containsInlineWithOutlineAndContinuation())
527 toLayoutBlockFlow(child)->addOverflowFromInlineChildren();
528
529 addOverflowFromChild(child);
522 } 530 }
523 } 531 }
524 532
525 void LayoutBlock::addOverflowFromPositionedObjects() { 533 void LayoutBlock::addOverflowFromPositionedObjects() {
526 TrackedLayoutBoxListHashSet* positionedDescendants = positionedObjects(); 534 TrackedLayoutBoxListHashSet* positionedDescendants = positionedObjects();
527 if (!positionedDescendants) 535 if (!positionedDescendants)
528 return; 536 return;
529 537
530 for (auto* positionedObject : *positionedDescendants) { 538 for (auto* positionedObject : *positionedDescendants) {
531 // Fixed positioned elements don't contribute to layout overflow, since they 539 // Fixed positioned elements don't contribute to layout overflow, since they
(...skipping 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after
2166 } 2174 }
2167 2175
2168 return availableHeight; 2176 return availableHeight;
2169 } 2177 }
2170 2178
2171 bool LayoutBlock::hasDefiniteLogicalHeight() const { 2179 bool LayoutBlock::hasDefiniteLogicalHeight() const {
2172 return availableLogicalHeightForPercentageComputation() != LayoutUnit(-1); 2180 return availableLogicalHeightForPercentageComputation() != LayoutUnit(-1);
2173 } 2181 }
2174 2182
2175 } // namespace blink 2183 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/inline/inline-focus-ring-under-absolute-enclosing-relative-div-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698