Changeset 152122 in webkit
- Timestamp:
- Jun 27, 2013 1:33:07 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 19 added
- 12 deleted
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r152105 r152122 1 2013-06-27 Bem Jones-Bey <bjonesbe@adobe.com> 2 3 [CSS Shapes] New positioning model: basic support for rectangle shape-outside 4 https://bugs.webkit.org/show_bug.cgi?id=118080 5 6 Reviewed by David Hyatt. 7 8 Added new tests for the new model. These tests are also spec tests, so 9 their canonical location is now in the CSS WG's repository. They have 10 been imported to WebKit using the import-w3c-tests script, and that's 11 why they live under the csswg directory. 12 13 The new tests replace the shape-outside-floats-simple-rectangle.html 14 test, which was anything but simple. 15 16 Tests that have not been rewritten yet have been marked as skipped. 17 Tests for the old positioning behavior that are not applicable to the 18 new behavior have been deleted. 19 20 * TestExpectations: Skip all the tests that need to be rewritten. 21 * csswg/submitted/shapes/shape-outside/shape-outside-floats-horizontal-rectangle-000-expected.html: Added. 22 * csswg/submitted/shapes/shape-outside/shape-outside-floats-horizontal-rectangle-000.html: Added. 23 * csswg/submitted/shapes/shape-outside/shape-outside-floats-horizontal-rectangle-001-expected.html: Added. 24 * csswg/submitted/shapes/shape-outside/shape-outside-floats-horizontal-rectangle-001.html: Added. 25 * csswg/submitted/shapes/shape-outside/shape-outside-floats-horizontal-rectangle-002-expected.html: Added. 26 * csswg/submitted/shapes/shape-outside/shape-outside-floats-horizontal-rectangle-002.html: Added. 27 * csswg/submitted/shapes/shape-outside/shape-outside-floats-square-000-expected.html: Added. 28 * csswg/submitted/shapes/shape-outside/shape-outside-floats-square-000.html: Added. 29 * csswg/submitted/shapes/shape-outside/shape-outside-floats-vertical-rectangle-000-expected.html: Added. 30 * csswg/submitted/shapes/shape-outside/shape-outside-floats-vertical-rectangle-000.html: Added. 31 * csswg/submitted/shapes/shape-outside/shape-outside-floats-vertical-rectangle-001-expected.html: Added. 32 * csswg/submitted/shapes/shape-outside/shape-outside-floats-vertical-rectangle-001.html: Added. 33 * csswg/submitted/shapes/shape-outside/shape-outside-floats-vertical-rectangle-002-expected.html: Added. 34 * csswg/submitted/shapes/shape-outside/shape-outside-floats-vertical-rectangle-002.html: Added. 35 * csswg/submitted/shapes/shape-outside/w3c-import.log: Added. 36 * fast/exclusions/shape-outside-floats/shape-outside-floats-margin-is-ignored-expected.html: Removed. 37 * fast/exclusions/shape-outside-floats/shape-outside-floats-margin-is-ignored.html: Removed. 38 * fast/exclusions/shape-outside-floats/shape-outside-floats-non-zero-y-expected.html: Removed. 39 * fast/exclusions/shape-outside-floats/shape-outside-floats-non-zero-y.html: Removed. 40 * fast/exclusions/shape-outside-floats/shape-outside-floats-overflow-hidden-expected.html: Removed. 41 * fast/exclusions/shape-outside-floats/shape-outside-floats-overflow-hidden.html: Removed. 42 * fast/exclusions/shape-outside-floats/shape-outside-floats-overhang-expected.html: Removed. 43 * fast/exclusions/shape-outside-floats/shape-outside-floats-overhang.html: Removed. 44 * fast/exclusions/shape-outside-floats/shape-outside-floats-positioning-expected.html: Removed. 45 * fast/exclusions/shape-outside-floats/shape-outside-floats-positioning.html: Removed. 46 * fast/exclusions/shape-outside-floats/shape-outside-floats-simple-rectangle-expected.html: Removed. 47 * fast/exclusions/shape-outside-floats/shape-outside-floats-simple-rectangle.html: Removed. 48 1 49 2013-06-27 Chris Fleizach <cfleizach@apple.com> 2 50 -
trunk/LayoutTests/TestExpectations
r151000 r152122 16 16 # media/W3C/video/networkState/networkState_during_progress.html is flaky 17 17 webkit.org/b/76280 media/W3C/video/networkState/networkState_during_progress.html [ Pass Failure ] 18 19 # The CSS Shapes spec has changed the positioning model for floats with shape-outside. 20 # Thus all of the tests need to be rewitten to work as the implementation of 21 # the new model is completed. 22 webkit.org/b/118088 fast/exclusions/shape-outside-floats/shape-outside-floats-diamond-margin-polygon.html [ Skip ] 23 webkit.org/b/118088 fast/exclusions/shape-outside-floats/shape-outside-floats-ellipse-margin-bottom.html [ Skip ] 24 webkit.org/b/118088 fast/exclusions/shape-outside-floats/shape-outside-floats-ellipse-margin-left.html [ Skip ] 25 webkit.org/b/118088 fast/exclusions/shape-outside-floats/shape-outside-floats-ellipse-margin-right.html [ Skip ] 26 webkit.org/b/118088 fast/exclusions/shape-outside-floats/shape-outside-floats-left-margin-polygon.html [ Skip ] 27 webkit.org/b/118088 fast/exclusions/shape-outside-floats/shape-outside-floats-right-margin-polygon.html [ Skip ] 28 29 webkit.org/b/118084 fast/exclusions/shape-outside-floats/shape-outside-floats-simple-circle.html [ Skip ] 30 webkit.org/b/118084 fast/exclusions/shape-outside-floats/shape-outside-floats-simple-ellipse.html [ Skip ] 31 32 webkit.org/b/118085 fast/exclusions/shape-outside-floats/shape-outside-floats-simple-polygon.html [ Skip ] 33 34 webkit.org/b/118086 fast/exclusions/shape-outside-floats/shape-outside-floats-simple-rectangle-percentage.html [ Skip ] 35 webkit.org/b/118086 fast/exclusions/shape-outside-floats/shape-outside-floats-simple-inset-rectangle-percentage.html [ Skip ] 36 37 webkit.org/b/118083 fast/exclusions/shape-outside-floats/shape-outside-floats-simple-rounded-inset-rectangle.html [ Skip ] 38 webkit.org/b/118083 fast/exclusions/shape-outside-floats/shape-outside-floats-simple-inset-rectangle.html [ Skip ] 39 40 webkit.org/b/118081 fast/exclusions/shape-outside-floats/shape-outside-floats-simple-rounded-rectangle-001.html [ Skip ] 41 webkit.org/b/118081 fast/exclusions/shape-outside-floats/shape-outside-floats-simple-rounded-rectangle-002.html [ Skip ] 42 webkit.org/b/118081 fast/exclusions/shape-outside-floats/shape-outside-floats-simple-rounded-rectangle-003.html [ Skip ] 43 webkit.org/b/118081 fast/exclusions/shape-outside-floats/shape-outside-floats-rounded-rectangle-large-radius.html [ Skip ] 44 45 webkit.org/b/118087 fast/exclusions/shape-outside-floats/shape-outside-floats-stacked.html [ Skip ] 46 webkit.org/b/118087 fast/exclusions/shape-outside-floats/shape-outside-floats-simple-rectangle-horizontal-multiple.html [ Skip ] -
trunk/Source/WebCore/ChangeLog
r152121 r152122 1 2013-06-27 Bem Jones-Bey <bjonesbe@adobe.com> 2 3 [CSS Shapes] New positioning model: basic support for rectangle shape-outside 4 https://bugs.webkit.org/show_bug.cgi?id=118080 5 6 Reviewed by David Hyatt. 7 8 With the latest Editor's Draft of the CSS Shapes specification, 9 shape-outside no longer affects the positioning of floats. This is the 10 first step in changing the implementation to reflect this 11 specification change. The bulk of this change is reverting the code 12 that was needed to position floats based on the bounding box of the 13 shape. 14 15 Tests: csswg/submitted/shapes/shape-outside/shape-outside-floats-horizontal-rectangle-000.html 16 csswg/submitted/shapes/shape-outside/shape-outside-floats-horizontal-rectangle-001.html 17 csswg/submitted/shapes/shape-outside/shape-outside-floats-horizontal-rectangle-002.html 18 csswg/submitted/shapes/shape-outside/shape-outside-floats-square-000.html 19 csswg/submitted/shapes/shape-outside/shape-outside-floats-vertical-rectangle-000.html 20 csswg/submitted/shapes/shape-outside/shape-outside-floats-vertical-rectangle-001.html 21 csswg/submitted/shapes/shape-outside/shape-outside-floats-vertical-rectangle-002.html 22 23 * rendering/LayoutState.cpp: 24 (WebCore::LayoutState::LayoutState): Revert changes to support float 25 positioning from shape-outside. 26 * rendering/RenderBlock.cpp: 27 (WebCore::RenderBlock::blockSelectionGaps): Ditto. 28 (WebCore::RenderBlock::insertFloatingObject): Ditto. 29 (WebCore::RenderBlock::positionNewFloats): Ditto. 30 (WebCore::RenderBlock::logicalLeftOffsetForLine): Instead of 31 converting to shape bounding box coordinates, convert to the 32 float's margin box coordinates. 33 (WebCore::RenderBlock::logicalRightOffsetForLine): Ditto. 34 (WebCore::positionForPointRespectingEditingBoundaries): Revert changes 35 to support float positioning from shape-outside. 36 * rendering/RenderBlock.h: 37 (WebCore::RenderBlock::xPositionForFloatIncludingMargin): Ditto. 38 (WebCore::RenderBlock::yPositionForFloatIncludingMargin): Ditto. 39 * rendering/RenderBlockLineLayout.cpp: 40 (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded): Instead 41 of converting to shape bounding box coordinates, convert to the 42 float's margin box coordinates. 43 * rendering/RenderBox.cpp: 44 (WebCore::RenderBox::mapLocalToContainer): Revert changes to support 45 float positioning from shape-outside. 46 (WebCore::RenderBox::offsetFromContainer): Ditto. 47 (WebCore::RenderBox::computeRectForRepaint): Ditto. 48 (WebCore::RenderBox::layoutOverflowRectForPropagation): Ditto. 49 * rendering/RenderBoxModelObject.cpp: Ditto. 50 * rendering/RenderBoxModelObject.h: Ditto. 51 * rendering/RenderInline.cpp: 52 (WebCore::RenderInline::clippedOverflowRectForRepaint): Ditto. 53 (WebCore::RenderInline::computeRectForRepaint): Ditto. 54 (WebCore::RenderInline::mapLocalToContainer): Ditto. 55 * rendering/RenderLayer.cpp: 56 (WebCore::RenderLayer::updateLayerPosition): Ditto. 57 (WebCore::RenderLayer::calculateClipRects): Ditto. 58 (WebCore::RenderLayer::shouldBeNormalFlowOnly): Ditto. 59 * rendering/RenderLayer.h: 60 (WebCore::RenderLayer::offsetForInFlowPosition): Ditto. 61 * rendering/RenderObject.h: Ditto. 62 * rendering/shapes/ShapeInfo.h: Make m_renderer protected, since we 63 now need it in the subclass to compute the segments. 64 * rendering/shapes/ShapeOutsideInfo.cpp: 65 (WebCore::ShapeOutsideInfo::computeSegmentsForLine): Update segment 66 computation to use the float's margin box instead of the shape's 67 bounding box for computing the deltas. 68 (WebCore::ShapeOutsideInfo::leftSegmentMarginBoxDelta): This used to 69 be leftSegmentShapeBoundingBoxDelta, which has been renamed in the 70 obvious way. 71 (WebCore::ShapeOutsideInfo::rightSegmentMarginBoxDelta): This used to 72 be rightSegmentShapeBoundingBoxDelta, which has been renamed in the 73 obvious way. 74 * rendering/shapes/ShapeOutsideInfo.h: Revert changes to support float 75 positioning from shape-outside. 76 * rendering/style/RenderStyle.h: Ditto. 77 1 78 2013-06-27 Antti Koivisto <antti@apple.com> 2 79 -
trunk/Source/WebCore/rendering/LayoutState.cpp
r151402 r152122 66 66 m_layoutOffset = m_paintOffset; 67 67 68 if (renderer-> hasPaintOffset() && renderer->hasLayer())69 m_paintOffset += renderer->layer()-> paintOffset();68 if (renderer->isInFlowPositioned() && renderer->hasLayer()) 69 m_paintOffset += renderer->layer()->offsetForInFlowPosition(); 70 70 71 71 m_clipped = !fixed && prev->m_clipped; -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r151997 r152122 3691 3691 continue; // We must be a normal flow object in order to even be considered. 3692 3692 3693 if (curr-> hasPaintOffset() && curr->hasLayer()) {3693 if (curr->isInFlowPositioned() && curr->hasLayer()) { 3694 3694 // If the relposition offset is anything other than 0, then treat this just like an absolute positioned element. 3695 3695 // Just disregard it completely. 3696 LayoutSize relOffset = curr->layer()-> paintOffset();3696 LayoutSize relOffset = curr->layer()->offsetForInFlowPosition(); 3697 3697 if (relOffset.width() || relOffset.height()) 3698 3698 continue; … … 4036 4036 } 4037 4037 4038 setLogicalWidthForFloat(newObj, logicalWidthForChild(o) + marginStartForChild(o) + marginEndForChild(o)); 4039 4038 4040 #if ENABLE(CSS_SHAPES) 4039 ShapeOutsideInfo* shapeOutside = o->shapeOutsideInfo(); 4040 if (shapeOutside) { 4041 shapeOutside->setShapeSize(o->logicalWidth(), o->logicalHeight()); 4042 // The CSS Shapes specification says that the margins are ignored 4043 // when a float has a shape outside. 4044 setLogicalWidthForFloat(newObj, shapeOutside->shapeLogicalWidth()); 4045 } else 4041 if (ShapeOutsideInfo* shapeOutside = o->shapeOutsideInfo()) 4042 shapeOutside->setShapeSize(logicalWidthForChild(o), logicalHeightForChild(o)); 4046 4043 #endif 4047 setLogicalWidthForFloat(newObj, logicalWidthForChild(o) + marginStartForChild(o) + marginEndForChild(o));4048 4044 4049 4045 newObj->setShouldPaint(!o->hasSelfPaintingLayer()); // If a layer exists, the float will paint itself. Otherwise someone else will. … … 4140 4136 LayoutUnit heightRemainingLeft = 1; 4141 4137 LayoutUnit heightRemainingRight = 1; 4142 floatLogicalLeft = logicalLeftOffsetForLine(logicalTopOffset, logicalLeftOffset, false, &heightRemainingLeft, 0, ShapeOutsideFloat BoundingBoxOffset);4143 while (logicalRightOffsetForLine(logicalTopOffset, logicalRightOffset, false, &heightRemainingRight, 0, ShapeOutsideFloat BoundingBoxOffset) - floatLogicalLeft < floatLogicalWidth) {4138 floatLogicalLeft = logicalLeftOffsetForLine(logicalTopOffset, logicalLeftOffset, false, &heightRemainingLeft, 0, ShapeOutsideFloatMarginBoxOffset); 4139 while (logicalRightOffsetForLine(logicalTopOffset, logicalRightOffset, false, &heightRemainingRight, 0, ShapeOutsideFloatMarginBoxOffset) - floatLogicalLeft < floatLogicalWidth) { 4144 4140 logicalTopOffset += min(heightRemainingLeft, heightRemainingRight); 4145 floatLogicalLeft = logicalLeftOffsetForLine(logicalTopOffset, logicalLeftOffset, false, &heightRemainingLeft, 0, ShapeOutsideFloat BoundingBoxOffset);4141 floatLogicalLeft = logicalLeftOffsetForLine(logicalTopOffset, logicalLeftOffset, false, &heightRemainingLeft, 0, ShapeOutsideFloatMarginBoxOffset); 4146 4142 if (insideFlowThread) { 4147 4143 // Have to re-evaluate all of our offsets, since they may have changed. … … 4155 4151 LayoutUnit heightRemainingLeft = 1; 4156 4152 LayoutUnit heightRemainingRight = 1; 4157 floatLogicalLeft = logicalRightOffsetForLine(logicalTopOffset, logicalRightOffset, false, &heightRemainingRight, 0, ShapeOutsideFloat BoundingBoxOffset);4158 while (floatLogicalLeft - logicalLeftOffsetForLine(logicalTopOffset, logicalLeftOffset, false, &heightRemainingLeft, 0, ShapeOutsideFloat BoundingBoxOffset) < floatLogicalWidth) {4153 floatLogicalLeft = logicalRightOffsetForLine(logicalTopOffset, logicalRightOffset, false, &heightRemainingRight, 0, ShapeOutsideFloatMarginBoxOffset); 4154 while (floatLogicalLeft - logicalLeftOffsetForLine(logicalTopOffset, logicalLeftOffset, false, &heightRemainingLeft, 0, ShapeOutsideFloatMarginBoxOffset) < floatLogicalWidth) { 4159 4155 logicalTopOffset += min(heightRemainingLeft, heightRemainingRight); 4160 floatLogicalLeft = logicalRightOffsetForLine(logicalTopOffset, logicalRightOffset, false, &heightRemainingRight, 0, ShapeOutsideFloat BoundingBoxOffset);4156 floatLogicalLeft = logicalRightOffsetForLine(logicalTopOffset, logicalRightOffset, false, &heightRemainingRight, 0, ShapeOutsideFloatMarginBoxOffset); 4161 4157 if (insideFlowThread) { 4162 4158 // Have to re-evaluate all of our offsets, since they may have changed. … … 4272 4268 4273 4269 setLogicalTopForFloat(floatingObject, floatLogicalLocation.y()); 4274 #if ENABLE(CSS_SHAPES) 4275 if (childBox->shapeOutsideInfo()) 4276 setLogicalHeightForFloat(floatingObject, childBox->shapeOutsideInfo()->shapeLogicalHeight()); 4277 else 4278 #endif 4279 setLogicalHeightForFloat(floatingObject, logicalHeightForChild(childBox) + marginBeforeForChild(childBox) + marginAfterForChild(childBox)); 4270 4271 setLogicalHeightForFloat(floatingObject, logicalHeightForChild(childBox) + marginBeforeForChild(childBox) + marginAfterForChild(childBox)); 4280 4272 4281 4273 m_floatingObjects->addPlacedObject(floatingObject); … … 4464 4456 if (offsetMode == ShapeOutsideFloatShapeOffset && lastFloat) { 4465 4457 if (ShapeOutsideInfo* shapeOutside = lastFloat->renderer()->shapeOutsideInfo()) { 4466 shapeOutside->computeSegmentsForLine(logicalTop - logicalTopForFloat(lastFloat) + shapeOutside->shapeLogicalTop(), logicalHeight);4467 left += shapeOutside->rightSegment ShapeBoundingBoxDelta();4458 shapeOutside->computeSegmentsForLine(logicalTop - logicalTopForFloat(lastFloat), logicalHeight); 4459 left += shapeOutside->rightSegmentMarginBoxDelta(); 4468 4460 } 4469 4461 } … … 4525 4517 if (offsetMode == ShapeOutsideFloatShapeOffset && lastFloat) { 4526 4518 if (ShapeOutsideInfo* shapeOutside = lastFloat->renderer()->shapeOutsideInfo()) { 4527 shapeOutside->computeSegmentsForLine(logicalTop - logicalTopForFloat(lastFloat) + shapeOutside->shapeLogicalTop(), logicalHeight);4528 rightFloatOffset += shapeOutside->leftSegment ShapeBoundingBoxDelta();4519 shapeOutside->computeSegmentsForLine(logicalTop - logicalTopForFloat(lastFloat), logicalHeight); 4520 rightFloatOffset += shapeOutside->leftSegmentMarginBoxDelta(); 4529 4521 } 4530 4522 } … … 5273 5265 { 5274 5266 LayoutPoint childLocation = child->location(); 5275 if (child-> hasPaintOffset())5276 childLocation += child-> paintOffset();5267 if (child->isInFlowPositioned()) 5268 childLocation += child->offsetForInFlowPosition(); 5277 5269 5278 5270 // FIXME: This is wrong if the child's writing-mode is different from the parent's. -
trunk/Source/WebCore/rendering/RenderBlock.h
r151997 r152122 73 73 enum CaretType { CursorCaret, DragCaret }; 74 74 enum ContainingBlockState { NewContainingBlock, SameContainingBlock }; 75 enum ShapeOutsideFloatOffsetMode { ShapeOutsideFloatShapeOffset, ShapeOutsideFloat BoundingBoxOffset };75 enum ShapeOutsideFloatOffsetMode { ShapeOutsideFloatShapeOffset, ShapeOutsideFloatMarginBoxOffset }; 76 76 77 77 enum TextRunFlag { … … 790 790 LayoutUnit xPositionForFloatIncludingMargin(const FloatingObject* child) const 791 791 { 792 #if ENABLE(CSS_SHAPES)793 ShapeOutsideInfo *shapeOutside = child->renderer()->shapeOutsideInfo();794 if (shapeOutside)795 return child->x();796 #endif797 798 792 if (isHorizontalWritingMode()) 799 793 return child->x() + child->renderer()->marginLeft(); … … 804 798 LayoutUnit yPositionForFloatIncludingMargin(const FloatingObject* child) const 805 799 { 806 #if ENABLE(CSS_SHAPES)807 ShapeOutsideInfo *shapeOutside = child->renderer()->shapeOutsideInfo();808 if (shapeOutside)809 return child->y();810 #endif811 812 800 if (isHorizontalWritingMode()) 813 801 return child->y() + marginBeforeForChild(child->renderer()); … … 1198 1186 // the outermost float on that line has a shape-outside, the inline 1199 1187 // content that butts up against that float must be positioned using 1200 // the contours of the shape, not the shape's bounding box. We save the1201 // last float encountered so that the offset can be computed correctly1202 // by the code using this adapter.1188 // the contours of the shape, not the margin box of the float. 1189 // We save the last float encountered so that the offset can be 1190 // computed correctly by the code using this adapter. 1203 1191 const FloatingObject* lastFloat() const { return m_last; } 1204 1192 #endif -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r151922 r152122 196 196 197 197 #if ENABLE(CSS_SHAPES) 198 // When floats with shape outside are stacked, the floats are positioned based on the bounding box of the shape,198 // When floats with shape outside are stacked, the floats are positioned based on the margin box of the float, 199 199 // not the shape's contour. Since we computed the width based on the shape contour when we added the float, 200 200 // when we add a subsequent float on the same line, we need to undo the shape delta in order to position 201 // based on the boundingbox. In order to do this, we need to walk back through the floating object list to find201 // based on the margin box. In order to do this, we need to walk back through the floating object list to find 202 202 // the first previous float that is on the same side as our newFloat. 203 203 ShapeOutsideInfo* lastShapeOutsideInfo = 0; … … 210 210 lastShapeOutsideInfo = lastFloat->renderer()->shapeOutsideInfo(); 211 211 if (lastShapeOutsideInfo) 212 lastShapeOutsideInfo->computeSegmentsForLine(m_block->logicalHeight() - m_block->logicalTopForFloat(lastFloat) + lastShapeOutsideInfo->shapeLogicalTop(), logicalHeightForLine(m_block, m_isFirstLine));212 lastShapeOutsideInfo->computeSegmentsForLine(m_block->logicalHeight() - m_block->logicalTopForFloat(lastFloat), logicalHeightForLine(m_block, m_isFirstLine)); 213 213 break; 214 214 } … … 217 217 ShapeOutsideInfo* shapeOutsideInfo = newFloat->renderer()->shapeOutsideInfo(); 218 218 if (shapeOutsideInfo) 219 shapeOutsideInfo->computeSegmentsForLine(m_block->logicalHeight() - m_block->logicalTopForFloat(newFloat) + shapeOutsideInfo->shapeLogicalTop(), logicalHeightForLine(m_block, m_isFirstLine));219 shapeOutsideInfo->computeSegmentsForLine(m_block->logicalHeight() - m_block->logicalTopForFloat(newFloat), logicalHeightForLine(m_block, m_isFirstLine)); 220 220 #endif 221 221 … … 224 224 #if ENABLE(CSS_SHAPES) 225 225 if (lastShapeOutsideInfo) 226 newLeft -= lastShapeOutsideInfo->rightSegment ShapeBoundingBoxDelta();226 newLeft -= lastShapeOutsideInfo->rightSegmentMarginBoxDelta(); 227 227 if (shapeOutsideInfo) 228 newLeft += shapeOutsideInfo->rightSegment ShapeBoundingBoxDelta();228 newLeft += shapeOutsideInfo->rightSegmentMarginBoxDelta(); 229 229 #endif 230 230 … … 236 236 #if ENABLE(CSS_SHAPES) 237 237 if (lastShapeOutsideInfo) 238 newRight -= lastShapeOutsideInfo->leftSegment ShapeBoundingBoxDelta();238 newRight -= lastShapeOutsideInfo->leftSegmentMarginBoxDelta(); 239 239 if (shapeOutsideInfo) 240 newRight += shapeOutsideInfo->leftSegment ShapeBoundingBoxDelta();240 newRight += shapeOutsideInfo->leftSegmentMarginBoxDelta(); 241 241 #endif 242 242 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r151799 r152122 1734 1734 LayoutState* layoutState = v->layoutState(); 1735 1735 LayoutSize offset = layoutState->m_paintOffset + locationOffset(); 1736 if (style()->has PaintOffset() && layer())1737 offset += layer()-> paintOffset();1736 if (style()->hasInFlowPosition() && layer()) 1737 offset += layer()->offsetForInFlowPosition(); 1738 1738 transformState.move(offset); 1739 1739 return; … … 1838 1838 1839 1839 LayoutSize offset; 1840 if ( hasPaintOffset())1841 offset += paintOffset();1840 if (isInFlowPositioned()) 1841 offset += offsetForInFlowPosition(); 1842 1842 1843 1843 if (!isInline() || isReplaced()) { … … 1979 1979 1980 1980 // We can't trust the bits on RenderObject, because this might be called while re-resolving style. 1981 if (styleToUse->has PaintOffset() && layer())1982 rect.move(layer()-> paintOffset());1981 if (styleToUse->hasInFlowPosition() && layer()) 1982 rect.move(layer()->offsetForInFlowPosition()); 1983 1983 1984 1984 rect.moveBy(location()); … … 2024 2024 if (position == AbsolutePosition && o->isInFlowPositioned() && o->isRenderInline()) 2025 2025 topLeft += toRenderInline(o)->offsetForInFlowPositionedInline(this); 2026 else if (styleToUse->has PaintOffset() && layer()) {2026 else if (styleToUse->hasInFlowPosition() && layer()) { 2027 2027 // Apply the relative position offset when invalidating a rectangle. The layer 2028 2028 // is translated, but the render box isn't, so we need to do this to get the 2029 2029 // right dirty rect. Since this is called from RenderObject::setStyle, the relative position 2030 2030 // flag on the RenderObject has been cleared, so use the one on the style(). 2031 topLeft += layer()-> paintOffset();2031 topLeft += layer()->offsetForInFlowPosition(); 2032 2032 } 2033 2033 … … 4380 4380 4381 4381 bool hasTransform = hasLayer() && layer()->transform(); 4382 if ( hasPaintOffset() || hasTransform) {4382 if (isInFlowPositioned() || hasTransform) { 4383 4383 // If we are relatively positioned or if we have a transform, then we have to convert 4384 4384 // this rectangle into physical coordinates, apply relative positioning and transforms … … 4389 4389 rect = layer()->currentTransform().mapRect(rect); 4390 4390 4391 if ( hasPaintOffset())4392 rect.move( paintOffset());4391 if (isInFlowPositioned()) 4392 rect.move(offsetForInFlowPosition()); 4393 4393 4394 4394 // Now we need to flip back. -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r151623 r152122 621 621 } 622 622 623 LayoutSize RenderBoxModelObject::paintOffset() const624 {625 LayoutSize offset = offsetForInFlowPosition();626 627 #if ENABLE(CSS_SHAPES)628 if (isBox() && isFloating())629 if (ShapeOutsideInfo* shapeOutside = toRenderBox(this)->shapeOutsideInfo())630 offset -= shapeOutside->shapeLogicalOffset();631 #endif632 633 return offset;634 }635 636 623 LayoutUnit RenderBoxModelObject::offsetLeft() const 637 624 { -
trunk/Source/WebCore/rendering/RenderBoxModelObject.h
r151623 r152122 72 72 73 73 LayoutSize offsetForInFlowPosition() const; 74 LayoutSize paintOffset() const;75 74 76 75 // IE extensions. Used to calculate offsetWidth/Height. Overridden by inlines (RenderFlow) -
trunk/Source/WebCore/rendering/RenderInline.cpp
r151946 r152122 1025 1025 } 1026 1026 if (inlineFlow->style()->hasInFlowPosition() && inlineFlow->hasLayer()) 1027 repaintRect.move(toRenderInline(inlineFlow)->layer()-> paintOffset());1027 repaintRect.move(toRenderInline(inlineFlow)->layer()->offsetForInFlowPosition()); 1028 1028 } 1029 1029 … … 1072 1072 LayoutState* layoutState = v->layoutState(); 1073 1073 if (style()->hasInFlowPosition() && layer()) 1074 rect.move(layer()-> paintOffset());1074 rect.move(layer()->offsetForInFlowPosition()); 1075 1075 rect.move(layoutState->m_paintOffset); 1076 1076 if (layoutState->m_clipped) … … 1105 1105 // right dirty rect. Since this is called from RenderObject::setStyle, the relative or sticky position 1106 1106 // flag on the RenderObject has been cleared, so use the one on the style(). 1107 topLeft += layer()-> paintOffset();1107 topLeft += layer()->offsetForInFlowPosition(); 1108 1108 } 1109 1109 … … 1159 1159 LayoutSize offset = layoutState->m_paintOffset; 1160 1160 if (style()->hasInFlowPosition() && layer()) 1161 offset += layer()-> paintOffset();1161 offset += layer()->offsetForInFlowPosition(); 1162 1162 transformState.move(offset); 1163 1163 return; -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r151761 r152122 1291 1291 1292 1292 bool positionOrOffsetChanged = false; 1293 if (renderer()-> hasPaintOffset()) {1294 LayoutSize newOffset = toRenderBoxModelObject(renderer())-> paintOffset();1295 positionOrOffsetChanged = newOffset != m_ paintOffset;1296 m_ paintOffset= newOffset;1297 localPoint.move(m_ paintOffset);1293 if (renderer()->isInFlowPositioned()) { 1294 LayoutSize newOffset = toRenderBoxModelObject(renderer())->offsetForInFlowPosition(); 1295 positionOrOffsetChanged = newOffset != m_offsetForInFlowPosition; 1296 m_offsetForInFlowPosition = newOffset; 1297 localPoint.move(m_offsetForInFlowPosition); 1298 1298 } else { 1299 m_ paintOffset= LayoutSize();1299 m_offsetForInFlowPosition = LayoutSize(); 1300 1300 } 1301 1301 … … 5084 5084 clipRects.setOverflowClipRect(clipRects.fixedClipRect()); 5085 5085 clipRects.setFixed(true); 5086 } else if (renderer()->style()->has PaintOffset())5086 } else if (renderer()->style()->hasInFlowPosition()) 5087 5087 clipRects.setPosClipRect(clipRects.overflowClipRect()); 5088 5088 else if (renderer()->style()->position() == AbsolutePosition) … … 5977 5977 && !isTransparent() 5978 5978 && !needsCompositedScrolling() 5979 #if ENABLE(CSS_SHAPES)5980 && !renderer()->isFloatingWithShapeOutside()5981 #endif5982 5979 ; 5983 5980 } -
trunk/Source/WebCore/rendering/RenderLayer.h
r151622 r152122 484 484 #endif 485 485 486 const LayoutSize& paintOffset() const { return m_paintOffset; }486 const LayoutSize& offsetForInFlowPosition() const { return m_offsetForInFlowPosition; } 487 487 488 488 void clearClipRectsIncludingDescendants(ClipRectsType typeToClear = AllClipRectTypes); … … 1221 1221 LayoutRect m_outlineBox; 1222 1222 1223 // Paint time offset only, it is used for properly paint relative / sticky positioned elements and exclusion boxes on floats.1224 LayoutSize m_ paintOffset;1223 // Our current relative position offset. 1224 LayoutSize m_offsetForInFlowPosition; 1225 1225 1226 1226 // Our (x,y) coordinates are in our parent layer's coordinate space. -
trunk/Source/WebCore/rendering/RenderObject.h
r152089 r152122 544 544 bool isOutOfFlowPositioned() const { return m_bitfields.isOutOfFlowPositioned(); } // absolute or fixed positioning 545 545 bool isInFlowPositioned() const { return m_bitfields.isRelPositioned() || m_bitfields.isStickyPositioned(); } // relative or sticky positioning 546 bool hasPaintOffset() const547 {548 bool positioned = isInFlowPositioned();549 #if ENABLE(CSS_SHAPES)550 // Shape outside on a float can reposition the float in much the551 // same way as relative positioning, so treat it as such.552 positioned = positioned || isFloatingWithShapeOutside();553 #endif554 return positioned;555 }556 546 bool isRelPositioned() const { return m_bitfields.isRelPositioned(); } // relative positioning 557 547 bool isStickyPositioned() const { return m_bitfields.isStickyPositioned(); } -
trunk/Source/WebCore/rendering/shapes/ShapeInfo.h
r151402 r152122 120 120 SegmentList m_segments; 121 121 122 const RenderType* m_renderer; 123 122 124 private: 123 125 mutable OwnPtr<Shape> m_shape; … … 125 127 LayoutUnit m_shapeLogicalWidth; 126 128 LayoutUnit m_shapeLogicalHeight; 127 const RenderType* m_renderer;128 129 }; 129 130 } -
trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp
r151402 r152122 47 47 if (shapeSizeDirty() || m_lineTop != lineTop || m_lineHeight != lineHeight) { 48 48 if (ShapeInfo<RenderBox, &RenderStyle::shapeOutside, &Shape::getExcludedIntervals>::computeSegmentsForLine(lineTop, lineHeight)) { 49 m_leftSegment ShapeBoundingBoxDelta = m_segments[0].logicalLeft - shapeLogicalLeft();50 m_rightSegment ShapeBoundingBoxDelta = m_segments[m_segments.size()-1].logicalRight - shapeLogicalRight();49 m_leftSegmentMarginBoxDelta = m_segments[0].logicalLeft + m_renderer->marginStart(); 50 m_rightSegmentMarginBoxDelta = m_segments[m_segments.size()-1].logicalRight - m_renderer->logicalWidth() - m_renderer->marginEnd(); 51 51 } else { 52 m_leftSegment ShapeBoundingBoxDelta = 0;53 m_rightSegment ShapeBoundingBoxDelta = 0;52 m_leftSegmentMarginBoxDelta = m_renderer->logicalWidth() + m_renderer->marginStart(); 53 m_rightSegmentMarginBoxDelta = -m_renderer->logicalWidth() - m_renderer->marginEnd(); 54 54 } 55 55 m_lineTop = lineTop; -
trunk/Source/WebCore/rendering/shapes/ShapeOutsideInfo.h
r151402 r152122 42 42 class ShapeOutsideInfo : public ShapeInfo<RenderBox, &RenderStyle::shapeOutside, &Shape::getExcludedIntervals>, public MappedInfo<RenderBox, ShapeOutsideInfo> { 43 43 public: 44 LayoutSize shapeLogicalOffset() const { return LayoutSize(shapeLogicalLeft(), shapeLogicalTop()); } 45 46 LayoutUnit leftSegmentShapeBoundingBoxDelta() const { return m_leftSegmentShapeBoundingBoxDelta; } 47 LayoutUnit rightSegmentShapeBoundingBoxDelta() const { return m_rightSegmentShapeBoundingBoxDelta; } 44 LayoutUnit leftSegmentMarginBoxDelta() const { return m_leftSegmentMarginBoxDelta; } 45 LayoutUnit rightSegmentMarginBoxDelta() const { return m_rightSegmentMarginBoxDelta; } 48 46 49 47 virtual bool computeSegmentsForLine(LayoutUnit lineTop, LayoutUnit lineHeight) OVERRIDE; … … 58 56 ShapeOutsideInfo(const RenderBox* renderer) : ShapeInfo<RenderBox, &RenderStyle::shapeOutside, &Shape::getExcludedIntervals>(renderer) { } 59 57 60 LayoutUnit m_leftSegment ShapeBoundingBoxDelta;61 LayoutUnit m_rightSegment ShapeBoundingBoxDelta;58 LayoutUnit m_leftSegmentMarginBoxDelta; 59 LayoutUnit m_rightSegmentMarginBoxDelta; 62 60 LayoutUnit m_lineTop; 63 61 }; -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r151622 r152122 461 461 bool hasOutOfFlowPosition() const { return position() == AbsolutePosition || position() == FixedPosition; } 462 462 bool hasInFlowPosition() const { return position() == RelativePosition || position() == StickyPosition; } 463 bool hasPaintOffset() const464 {465 bool paintOffset = hasInFlowPosition();466 #if ENABLE(CSS_SHAPES)467 paintOffset = paintOffset || (isFloating() && shapeOutside());468 #endif469 return paintOffset;470 }471 463 bool hasViewportConstrainedPosition() const { return position() == FixedPosition || position() == StickyPosition; } 472 464 EFloat floating() const { return static_cast<EFloat>(noninherited_flags._floating); }
Note: See TracChangeset
for help on using the changeset viewer.