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

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

Issue 1848033004: Initialize child framesets when they become part of the parent frameset grid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/frames/expand-grid-with-zero-size-child-frameset-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) 2000 Simon Hausmann <hausmann@kde.org> 3 * (C) 2000 Simon Hausmann <hausmann@kde.org>
4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de)
5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. 5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 int borderThickness = frameSet()->border(); 411 int borderThickness = frameSet()->border();
412 LayoutSize size; 412 LayoutSize size;
413 LayoutPoint position; 413 LayoutPoint position;
414 for (int r = 0; r < rows; r++) { 414 for (int r = 0; r < rows; r++) {
415 position.setX(LayoutUnit()); 415 position.setX(LayoutUnit());
416 size.setHeight(LayoutUnit(m_rows.m_sizes[r])); 416 size.setHeight(LayoutUnit(m_rows.m_sizes[r]));
417 for (int c = 0; c < cols; c++) { 417 for (int c = 0; c < cols; c++) {
418 child->setLocation(position); 418 child->setLocation(position);
419 size.setWidth(LayoutUnit(m_cols.m_sizes[c])); 419 size.setWidth(LayoutUnit(m_cols.m_sizes[c]));
420 420
421 // has to be resized and itself resize its contents 421 // If we have a new size, we need to resize and layout the child. If the size is 0x0 we
422 if (size != child->size()) { 422 // also need to lay out, since this may mean that we're dealing with a child frameset
423 // that wasn't previously initialized properly, because it was previ ously hidden, but
424 // no longer is, because rows * cols may have increased.
425 if (size != child->size() || size.isEmpty()) {
mstensho (USE GERRIT) 2016/04/01 12:21:47 This is the simplest fix that I can think of. A sa
423 child->setSize(size); 426 child->setSize(size);
424 child->setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidation Reason::SizeChanged); 427 child->setNeedsLayoutAndFullPaintInvalidation(LayoutInvalidation Reason::SizeChanged);
425 child->layout(); 428 child->layout();
426 } 429 }
427 430
428 position.setX(position.x() + size.width() + borderThickness); 431 position.setX(position.x() + size.width() + borderThickness);
429 432
430 child = child->nextSiblingBox(); 433 child = child->nextSiblingBox();
431 if (!child) 434 if (!child)
432 return; 435 return;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 return SetCursor; 571 return SetCursor;
569 } 572 }
570 if (canResizeColumn(roundedPoint)) { 573 if (canResizeColumn(roundedPoint)) {
571 cursor = columnResizeCursor(); 574 cursor = columnResizeCursor();
572 return SetCursor; 575 return SetCursor;
573 } 576 }
574 return LayoutBox::getCursor(point, cursor); 577 return LayoutBox::getCursor(point, cursor);
575 } 578 }
576 579
577 } // namespace blink 580 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/frames/expand-grid-with-zero-size-child-frameset-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698