Changeset 129530 in webkit
- Timestamp:
- Sep 25, 2012 11:22:39 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r129529 r129530 1 2012-09-25 Bear Travis <betravis@adobe.com> 2 3 [CSS Exclusions] Enable css exclusions for multiple blocks per element 4 https://bugs.webkit.org/show_bug.cgi?id=89993 5 6 Reviewed by Julien Chaffraix. 7 8 Adding tests to cover the case where a shape-inside affects block children's 9 inline content. 10 11 * fast/exclusions/shape-inside/shape-inside-multiple-blocks-expected.html: Added. 12 * fast/exclusions/shape-inside/shape-inside-multiple-blocks-vertical-expected.html: Added. 13 * fast/exclusions/shape-inside/shape-inside-multiple-blocks-vertical.html: Added. 14 * fast/exclusions/shape-inside/shape-inside-multiple-blocks.html: Added. 15 1 16 2012-09-24 Emil A Eklund <eae@chromium.org> 2 17 -
trunk/Source/WebCore/ChangeLog
r129529 r129530 1 2012-09-25 Bear Travis <betravis@adobe.com> 2 3 [CSS Exclusions] Enable css exclusions for multiple blocks per element 4 https://bugs.webkit.org/show_bug.cgi?id=89993 5 6 Reviewed by Julien Chaffraix. 7 8 Similar to multi-column layout, a parent RenderBlock's WrapShapeInfo may affect 9 the inline content of its children. This patch follows the example of ColumnInfo 10 and adds WrapShapeInfo to LayoutState, which tracks the current shape-inside that 11 inline content should respect. 12 13 Tests: fast/exclusions/shape-inside/shape-inside-multiple-blocks.html 14 fast/exclusions/shape-inside/shape-inside-multiple-blocks-vertical.html 15 16 * rendering/LayoutState.cpp: 17 (WebCore::LayoutState::LayoutState): Initialize m_wrapShapeInfo. 18 * rendering/LayoutState.h: 19 (WebCore): 20 (WebCore::LayoutState::LayoutState): Initialize m_wrapShapeInfo. 21 (LayoutState): 22 (WebCore::LayoutState::wrapShapeInfo): Getter for m_wrapShapeInfo. 23 * rendering/RenderBlockLineLayout.cpp: 24 (WebCore::LineWidth::LineWidth): Use LayoutState to lookup WrapShapeInfo. 25 (WebCore::RenderBlock::computeInlineDirectionPositionsForLine): Ditto. 26 (WebCore::RenderBlock::layoutRunsAndFloatsInRange): Ditto. 27 * rendering/RenderView.h: 28 (WebCore::RenderView::pushLayoutState): Push LayoutState if a WrapShapeInfo 29 is present. 30 1 31 2012-09-24 Emil A Eklund <eae@chromium.org> 2 32 -
trunk/Source/WebCore/rendering/LayoutState.cpp
r127267 r129530 43 43 , m_renderer(renderer) 44 44 #endif 45 #if ENABLE(CSS_EXCLUSIONS) 46 , m_wrapShapeInfo(0) 47 #endif 45 48 { 46 49 ASSERT(m_next); … … 108 111 m_columnInfo = m_next->m_columnInfo; 109 112 113 #if ENABLE(CSS_EXCLUSIONS) 114 if (renderer->isRenderBlock()) { 115 m_wrapShapeInfo = toRenderBlock(renderer)->wrapShapeInfo(); 116 if (!m_wrapShapeInfo) 117 m_wrapShapeInfo = m_next->m_wrapShapeInfo; 118 } 119 #endif 120 110 121 m_layoutDelta = m_next->m_layoutDelta; 111 122 … … 132 143 #ifndef NDEBUG 133 144 , m_renderer(root) 145 #endif 146 #if ENABLE(CSS_EXCLUSIONS) 147 , m_wrapShapeInfo(0) 134 148 #endif 135 149 { -
trunk/Source/WebCore/rendering/LayoutState.h
r127267 r129530 39 39 class RenderObject; 40 40 class RenderFlowThread; 41 #if ENABLE(CSS_EXCLUSIONS) 42 class WrapShapeInfo; 43 #endif 41 44 42 45 class LayoutState { … … 53 56 #ifndef NDEBUG 54 57 , m_renderer(0) 58 #endif 59 #if ENABLE(CSS_EXCLUSIONS) 60 , m_wrapShapeInfo(0) 55 61 #endif 56 62 { … … 89 95 bool needsBlockDirectionLocationSetBeforeLayout() const { return m_lineGrid || (m_isPaginated && m_pageLogicalHeight); } 90 96 97 #if ENABLE(CSS_EXCLUSIONS) 98 WrapShapeInfo* wrapShapeInfo() const { return m_wrapShapeInfo; } 99 #endif 91 100 private: 92 101 // The normal operator new is disallowed. … … 130 139 RenderObject* m_renderer; 131 140 #endif 141 #if ENABLE(CSS_EXCLUSIONS) 142 WrapShapeInfo* m_wrapShapeInfo; 143 #endif 132 144 }; 133 145 -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r129284 r129530 64 64 const unsigned cMaxLineDepth = 200; 65 65 66 #if ENABLE(CSS_EXCLUSIONS) 67 static inline WrapShapeInfo* layoutWrapShapeInfo(const RenderBlock* block) 68 { 69 return block->view()->layoutState()->wrapShapeInfo(); 70 } 71 #endif 72 66 73 class LineWidth { 67 74 public: … … 81 88 ASSERT(block); 82 89 #if ENABLE(CSS_EXCLUSIONS) 83 WrapShapeInfo* wrapShapeInfo = m_block->wrapShapeInfo();90 WrapShapeInfo* wrapShapeInfo = layoutWrapShapeInfo(m_block); 84 91 // FIXME: Bug 91878: Add support for multiple segments, currently we only support one 85 92 if (wrapShapeInfo && wrapShapeInfo->lineState() == WrapShapeInfo::LINE_INSIDE_SHAPE) { … … 805 812 float logicalRight = pixelSnappedLogicalRightOffsetForLine(logicalHeight(), firstLine, lineLogicalHeight); 806 813 #if ENABLE(CSS_EXCLUSIONS) 807 WrapShapeInfo* wrapShapeInfo = this->wrapShapeInfo();814 WrapShapeInfo* wrapShapeInfo = layoutWrapShapeInfo(this); 808 815 if (wrapShapeInfo && wrapShapeInfo->lineState() == WrapShapeInfo::LINE_INSIDE_SHAPE) { 809 816 logicalLeft = max<float>(roundToInt(wrapShapeInfo->segments()[0].logicalLeft), logicalLeft); … … 1297 1304 1298 1305 #if ENABLE(CSS_EXCLUSIONS) 1299 WrapShapeInfo* wrapShapeInfo = this->wrapShapeInfo(); 1300 // Move to the top of the shape inside to begin layout 1301 if (wrapShapeInfo && logicalHeight() < wrapShapeInfo->shapeLogicalTop()) 1302 setLogicalHeight(wrapShapeInfo->shapeLogicalTop()); 1306 LayoutUnit absoluteLogicalTop; 1307 WrapShapeInfo* wrapShapeInfo = layoutWrapShapeInfo(this); 1308 if (wrapShapeInfo) { 1309 if (wrapShapeInfo != this->wrapShapeInfo()) { 1310 // FIXME: If layout state is disabled, the offset will be incorrect. 1311 LayoutSize layoutOffset = view()->layoutState()->layoutOffset(); 1312 absoluteLogicalTop = logicalTop() + (isHorizontalWritingMode() ? layoutOffset.height() : layoutOffset.width()); 1313 } 1314 // Begin layout at the logical top of our shape inside. 1315 if (logicalHeight() + absoluteLogicalTop < wrapShapeInfo->shapeLogicalTop()) 1316 setLogicalHeight(wrapShapeInfo->shapeLogicalTop() - absoluteLogicalTop); 1317 } 1303 1318 #endif 1304 1319 … … 1322 1337 FloatingObject* lastFloatFromPreviousLine = (m_floatingObjects && !m_floatingObjects->set().isEmpty()) ? m_floatingObjects->set().last() : 0; 1323 1338 #if ENABLE(CSS_EXCLUSIONS) 1324 // FIXME: Bug 89993: If the wrap shape comes from a parent, we will need to adjust1325 // the height coordinate1326 1339 if (wrapShapeInfo) 1327 wrapShapeInfo->computeSegmentsForLine(logicalHeight() );1340 wrapShapeInfo->computeSegmentsForLine(logicalHeight() + absoluteLogicalTop); 1328 1341 #endif 1329 1342 end = lineBreaker.nextLineBreak(resolver, layoutState.lineInfo(), renderTextInfo, lastFloatFromPreviousLine, consecutiveHyphenatedLines); -
trunk/Source/WebCore/rendering/RenderView.h
r128468 r129530 224 224 // We push LayoutState even if layoutState is disabled because it stores layoutDelta too. 225 225 if (!doingFullRepaint() || m_layoutState->isPaginated() || renderer->hasColumns() || renderer->inRenderFlowThread() 226 || m_layoutState->lineGrid() || (renderer->style()->lineGrid() != RenderStyle::initialLineGrid() && renderer->isBlockFlow())) { 226 || m_layoutState->lineGrid() || (renderer->style()->lineGrid() != RenderStyle::initialLineGrid() && renderer->isBlockFlow()) 227 #if ENABLE(CSS_EXCLUSIONS) 228 || (renderer->isRenderBlock() && toRenderBlock(renderer)->wrapShapeInfo()) 229 #endif 230 ) { 227 231 m_layoutState = new (renderArena()) LayoutState(m_layoutState, renderer, offset, pageHeight, pageHeightChanged, colInfo); 228 232 return true;
Note: See TracChangeset
for help on using the changeset viewer.