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

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

Issue 2130843002: Fix crash with sticky html element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/sticky/sticky-html-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 FloatSize skippedContainersOffset; 628 FloatSize skippedContainersOffset;
629 LayoutBlock* containingBlock = this->containingBlock(); 629 LayoutBlock* containingBlock = this->containingBlock();
630 // Skip anonymous containing blocks. 630 // Skip anonymous containing blocks.
631 while (containingBlock->isAnonymous()) { 631 while (containingBlock->isAnonymous()) {
632 skippedContainersOffset += toFloatSize(FloatPoint(containingBlock->frame Rect().location())); 632 skippedContainersOffset += toFloatSize(FloatPoint(containingBlock->frame Rect().location()));
633 containingBlock = containingBlock->containingBlock(); 633 containingBlock = containingBlock->containingBlock();
634 } 634 }
635 LayoutBox* scrollAncestor = layer()->ancestorOverflowLayer()->isRootLayer() ? nullptr : toLayoutBox(layer()->ancestorOverflowLayer()->layoutObject()); 635 LayoutBox* scrollAncestor = layer()->ancestorOverflowLayer()->isRootLayer() ? nullptr : toLayoutBox(layer()->ancestorOverflowLayer()->layoutObject());
636 636
637 LayoutRect containerContentRect = containingBlock->layoutOverflowRect(); 637 LayoutRect containerContentRect = containingBlock->layoutOverflowRect();
638 LayoutUnit maxContainerWidth = containingBlock->containingBlockLogicalWidthF orContent(); 638 LayoutUnit maxContainerWidth = containingBlock->isLayoutView() ? containingB lock->logicalWidth() : containingBlock->containingBlockLogicalWidthForContent();
639 // Sticky positioned element ignore any override logical width on the contai ning block (as they don't call 639 // Sticky positioned element ignore any override logical width on the contai ning block (as they don't call
640 // containingBlockLogicalWidthForContent). It's unclear whether this is tota lly fine. 640 // containingBlockLogicalWidthForContent). It's unclear whether this is tota lly fine.
641 // Compute the container-relative area within which the sticky element is al lowed to move. 641 // Compute the container-relative area within which the sticky element is al lowed to move.
642 LayoutUnit maxWidth = containingBlock->availableLogicalWidth(); 642 LayoutUnit maxWidth = containingBlock->availableLogicalWidth();
643 643
644 // This is removing the padding of the containing block's overflow rect to g et the flow 644 // This is removing the padding of the containing block's overflow rect to g et the flow
645 // box rectangle and removing the margin of the sticky element to ensure tha t space between 645 // box rectangle and removing the margin of the sticky element to ensure tha t space between
646 // the sticky element and its containing flow box. It is an open issue wheth er the margin 646 // the sticky element and its containing flow box. It is an open issue wheth er the margin
647 // should collapse (See https://www.w3.org/TR/css-position-3/#sticky-pos). 647 // should collapse (See https://www.w3.org/TR/css-position-3/#sticky-pos).
648 containerContentRect.contractEdges( 648 containerContentRect.contractEdges(
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 if (rootElementStyle->hasBackground()) 1123 if (rootElementStyle->hasBackground())
1124 return false; 1124 return false;
1125 1125
1126 if (node() != document().firstBodyElement()) 1126 if (node() != document().firstBodyElement())
1127 return false; 1127 return false;
1128 1128
1129 return true; 1129 return true;
1130 } 1130 }
1131 1131
1132 } // namespace blink 1132 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/sticky/sticky-html-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698