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

Side by Side Diff: Source/core/rendering/RenderMultiColumnSet.cpp

Issue 246403015: [New Multicolumn] Create RenderMultiColumnSet during renderer creation, not during layout. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase master Created 6 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 | « Source/core/rendering/RenderMultiColumnSet.h ('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) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 27 matching lines...) Expand all
38 : RenderRegionSet(0, flowThread) 38 : RenderRegionSet(0, flowThread)
39 , m_computedColumnCount(1) 39 , m_computedColumnCount(1)
40 , m_computedColumnWidth(0) 40 , m_computedColumnWidth(0)
41 , m_computedColumnHeight(0) 41 , m_computedColumnHeight(0)
42 , m_maxColumnHeight(RenderFlowThread::maxLogicalHeight()) 42 , m_maxColumnHeight(RenderFlowThread::maxLogicalHeight())
43 , m_minSpaceShortage(RenderFlowThread::maxLogicalHeight()) 43 , m_minSpaceShortage(RenderFlowThread::maxLogicalHeight())
44 , m_minimumColumnHeight(0) 44 , m_minimumColumnHeight(0)
45 { 45 {
46 } 46 }
47 47
48 RenderMultiColumnSet* RenderMultiColumnSet::createAnonymous(RenderFlowThread* fl owThread) 48 RenderMultiColumnSet* RenderMultiColumnSet::createAnonymous(RenderFlowThread* fl owThread, RenderStyle* parentStyle)
49 { 49 {
50 Document& document = flowThread->document(); 50 Document& document = flowThread->document();
51 RenderMultiColumnSet* renderer = new RenderMultiColumnSet(flowThread); 51 RenderMultiColumnSet* renderer = new RenderMultiColumnSet(flowThread);
52 renderer->setDocumentForAnonymous(&document); 52 renderer->setDocumentForAnonymous(&document);
53 renderer->setStyle(RenderStyle::createAnonymousStyleWithDisplay(parentStyle, BLOCK));
53 return renderer; 54 return renderer;
54 } 55 }
55 56
57 RenderMultiColumnSet* RenderMultiColumnSet::nextSiblingMultiColumnSet() const
58 {
59 for (RenderObject* sibling = nextSibling(); sibling; sibling = sibling->next Sibling()) {
60 if (sibling->isRenderMultiColumnSet())
61 return toRenderMultiColumnSet(sibling);
62 }
63 return 0;
64 }
65
56 LayoutUnit RenderMultiColumnSet::heightAdjustedForSetOffset(LayoutUnit height) c onst 66 LayoutUnit RenderMultiColumnSet::heightAdjustedForSetOffset(LayoutUnit height) c onst
57 { 67 {
58 RenderBlockFlow* multicolBlock = multiColumnBlockFlow(); 68 RenderBlockFlow* multicolBlock = multiColumnBlockFlow();
59 LayoutUnit contentLogicalTop = logicalTop() - multicolBlock->borderBefore() - multicolBlock->paddingBefore(); 69 LayoutUnit contentLogicalTop = logicalTop() - multicolBlock->borderBefore() - multicolBlock->paddingBefore();
60 70
61 height -= contentLogicalTop; 71 height -= contentLogicalTop;
62 return max(height, LayoutUnit(1)); // Let's avoid zero height, as that would probably cause an infinite amount of columns to be created. 72 return max(height, LayoutUnit(1)); // Let's avoid zero height, as that would probably cause an infinite amount of columns to be created.
63 } 73 }
64 74
65 LayoutUnit RenderMultiColumnSet::pageLogicalTopForOffset(LayoutUnit offset) cons t 75 LayoutUnit RenderMultiColumnSet::pageLogicalTopForOffset(LayoutUnit offset) cons t
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 fragments.append(fragment); 594 fragments.append(fragment);
585 } 595 }
586 } 596 }
587 597
588 const char* RenderMultiColumnSet::renderName() const 598 const char* RenderMultiColumnSet::renderName() const
589 { 599 {
590 return "RenderMultiColumnSet"; 600 return "RenderMultiColumnSet";
591 } 601 }
592 602
593 } 603 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderMultiColumnSet.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698