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

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

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
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 14 matching lines...) Expand all
25 25
26 26
27 #ifndef RenderMultiColumnSet_h 27 #ifndef RenderMultiColumnSet_h
28 #define RenderMultiColumnSet_h 28 #define RenderMultiColumnSet_h
29 29
30 #include "core/rendering/RenderRegionSet.h" 30 #include "core/rendering/RenderRegionSet.h"
31 #include "wtf/Vector.h" 31 #include "wtf/Vector.h"
32 32
33 namespace WebCore { 33 namespace WebCore {
34 34
35 // RenderMultiColumnSet represents a set of columns that all have the same width and height. By combining runs of same-size columns into a single 35 // RenderMultiColumnSet represents a set of columns that all have the same width and height. By
36 // object, we significantly reduce the number of unique RenderObjects required t o represent columns. 36 // combining runs of same-size columns into a single object, we significantly re duce the number of
37 // unique RenderObjects required to represent columns.
37 // 38 //
38 // A simple multi-column block will have exactly one RenderMultiColumnSet child. A simple paginated multi-column block will have three 39 // Column sets are inserted as anonymous children of the actual multicol contain er (i.e. the
39 // RenderMultiColumnSet children: one for the content at the bottom of the first page (whose columns will have a shorter height), one 40 // renderer whose style computes to non-auto column-count and/or column-width).
40 // for the 2nd to n-1 pages, and then one last column set that will hold the sho rter columns on the final page (that may have to be balanced
41 // as well).
42 // 41 //
43 // Column spans result in the creation of new column sets as well, since a spann ing region has to be placed in between the column sets that 42 // Being a "region", a column set has no children on its own, but is merely used to slice a portion
44 // come before and after the span. 43 // of the tall "single-column" flow thread into actual columns visually, to conv ert from flow thread
44 // coordinates to visual ones. It is in charge of both positioning columns corre ctly relatively to
45 // the parent multicol container, and to calculate the correct translation for e ach column's
46 // contents, and to paint any rules between them. RenderMultiColumnSet objects a re used for
47 // painting, hit testing, and any other type of operation that requires mapping from flow thread
48 // coordinates to visual coordinates.
49 //
50 // Column spans result in the creation of new column sets, since a spanning rend erer has to be
51 // placed in between the column sets that come before and after the span.
45 class RenderMultiColumnSet FINAL : public RenderRegionSet { 52 class RenderMultiColumnSet FINAL : public RenderRegionSet {
46 public: 53 public:
47 static RenderMultiColumnSet* createAnonymous(RenderFlowThread*); 54 static RenderMultiColumnSet* createAnonymous(RenderFlowThread*, RenderStyle* parentStyle);
48 55
49 virtual bool isRenderMultiColumnSet() const OVERRIDE { return true; } 56 virtual bool isRenderMultiColumnSet() const OVERRIDE { return true; }
50 57
51 RenderBlockFlow* multiColumnBlockFlow() const { return toRenderBlockFlow(par ent()); } 58 RenderBlockFlow* multiColumnBlockFlow() const { return toRenderBlockFlow(par ent()); }
52 RenderMultiColumnFlowThread* multiColumnFlowThread() const { return multiCol umnBlockFlow()->multiColumnFlowThread(); } 59 RenderMultiColumnFlowThread* multiColumnFlowThread() const { return multiCol umnBlockFlow()->multiColumnFlowThread(); }
60
61 RenderMultiColumnSet* nextSiblingMultiColumnSet() const;
62
53 unsigned computedColumnCount() const { return m_computedColumnCount; } 63 unsigned computedColumnCount() const { return m_computedColumnCount; }
54 LayoutUnit computedColumnWidth() const { return m_computedColumnWidth; } 64 LayoutUnit computedColumnWidth() const { return m_computedColumnWidth; }
55 LayoutUnit computedColumnHeight() const { return m_computedColumnHeight; } 65 LayoutUnit computedColumnHeight() const { return m_computedColumnHeight; }
56 66
57 void setComputedColumnWidthAndCount(LayoutUnit width, unsigned count) 67 void setComputedColumnWidthAndCount(LayoutUnit width, unsigned count)
58 { 68 {
59 m_computedColumnWidth = width; 69 m_computedColumnWidth = width;
60 m_computedColumnCount = count; 70 m_computedColumnCount = count;
61 } 71 }
62 72
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 }; 179 };
170 Vector<ContentRun, 1> m_contentRuns; 180 Vector<ContentRun, 1> m_contentRuns;
171 }; 181 };
172 182
173 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderMultiColumnSet, isRenderMultiColumnSet()); 183 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderMultiColumnSet, isRenderMultiColumnSet());
174 184
175 } // namespace WebCore 185 } // namespace WebCore
176 186
177 #endif // RenderMultiColumnSet_h 187 #endif // RenderMultiColumnSet_h
178 188
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderMultiColumnFlowThread.cpp ('k') | Source/core/rendering/RenderMultiColumnSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698