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

Side by Side Diff: Source/core/layout/LayoutState.cpp

Issue 1131283004: Prevent SVG children from participating in an ancestor multicol context. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Initialize m_isPaginated and m_pageLogicalHeightChanged. Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutObject.cpp ('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) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 // If we establish a new page height, then cache the offset to the top of th e first page. 77 // If we establish a new page height, then cache the offset to the top of th e first page.
78 // We can compare this later on to figure out what part of the page we're ac tually on, 78 // We can compare this later on to figure out what part of the page we're ac tually on,
79 if (pageLogicalHeight || m_columnInfo || layoutObject.isLayoutFlowThread()) { 79 if (pageLogicalHeight || m_columnInfo || layoutObject.isLayoutFlowThread()) {
80 m_pageLogicalHeight = pageLogicalHeight; 80 m_pageLogicalHeight = pageLogicalHeight;
81 bool isFlipped = layoutObject.style()->isFlippedBlocksWritingMode(); 81 bool isFlipped = layoutObject.style()->isFlippedBlocksWritingMode();
82 m_pageOffset = LayoutSize(m_layoutOffset.width() + (!isFlipped ? layoutO bject.borderLeft() + layoutObject.paddingLeft() : layoutObject.borderRight() + l ayoutObject.paddingRight()), 82 m_pageOffset = LayoutSize(m_layoutOffset.width() + (!isFlipped ? layoutO bject.borderLeft() + layoutObject.paddingLeft() : layoutObject.borderRight() + l ayoutObject.paddingRight()),
83 m_layoutOffset.height() + (!isFlipped ? layoutObject.borderTop() + l ayoutObject.paddingTop() : layoutObject.borderBottom() + layoutObject.paddingBot tom())); 83 m_layoutOffset.height() + (!isFlipped ? layoutObject.borderTop() + l ayoutObject.paddingTop() : layoutObject.borderBottom() + layoutObject.paddingBot tom()));
84 m_pageLogicalHeightChanged = pageLogicalHeightChanged; 84 m_pageLogicalHeightChanged = pageLogicalHeightChanged;
85 m_isPaginated = true; 85 m_isPaginated = true;
86 } else if (m_layoutObject.isSVG() && !m_layoutObject.isSVGRoot()) {
87 // Pagination inside SVG is not allowed.
88 m_flowThread = nullptr;
89 m_pageLogicalHeightChanged = false;
90 m_isPaginated = false;
86 } else { 91 } else {
87 // If we don't establish a new page height, then propagate the old page height and offset down. 92 // If we don't establish a new page height, then propagate the old page height and offset down.
88 m_pageLogicalHeight = m_next->m_pageLogicalHeight; 93 m_pageLogicalHeight = m_next->m_pageLogicalHeight;
89 m_pageLogicalHeightChanged = m_next->m_pageLogicalHeightChanged; 94 m_pageLogicalHeightChanged = m_next->m_pageLogicalHeightChanged;
90 m_pageOffset = m_next->m_pageOffset; 95 m_pageOffset = m_next->m_pageOffset;
91 96
92 // Disable pagination for objects we don't support. For now this include s overflow:scroll/auto, inline blocks and 97 // Disable pagination for objects we don't support. For now this include s overflow:scroll/auto, inline blocks and
93 // writing mode roots. 98 // writing mode roots.
94 if (layoutObject.isUnsplittableForPagination()) { 99 if (layoutObject.isUnsplittableForPagination()) {
95 m_pageLogicalHeight = 0; 100 m_pageLogicalHeight = 0;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 } 155 }
151 156
152 void LayoutState::addForcedColumnBreak(const LayoutBox& child, const LayoutUnit& childLogicalOffset) 157 void LayoutState::addForcedColumnBreak(const LayoutBox& child, const LayoutUnit& childLogicalOffset)
153 { 158 {
154 if (!m_columnInfo || m_columnInfo->columnHeight()) 159 if (!m_columnInfo || m_columnInfo->columnHeight())
155 return; 160 return;
156 m_columnInfo->addForcedBreak(pageLogicalOffset(child, childLogicalOffset)); 161 m_columnInfo->addForcedBreak(pageLogicalOffset(child, childLogicalOffset));
157 } 162 }
158 163
159 } // namespace blink 164 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698