Changeset 129787 in webkit
- Timestamp:
- Sep 27, 2012 12:23:40 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r129786 r129787 1 2012-09-27 Bear Travis <betravis@adobe.com> 2 3 [CSS Exclusions] Rename RenderStyle::wrapShapeInside/Outside to shapeInside/Outside 4 https://bugs.webkit.org/show_bug.cgi?id=97707 5 6 Reviewed by Antti Koivisto. 7 8 The exclusions specification has renamed wrap-shape-inside and wrap-shape-outside 9 to shape-inside and shape-outside. We should rename the getter/setter functions 10 in RenderStyle, and update the derived variable and function names accordingly. 11 For more information, see: http://dev.w3.org/csswg/css3-exclusions/#declaring-shapes 12 13 Covered by existing tests. No new functionality. 14 15 * css/CSSComputedStyleDeclaration.cpp: 16 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): 17 * css/StyleBuilder.cpp: 18 (WebCore::ApplyPropertyExclusionShape::applyValue): 19 (WebCore::StyleBuilder::StyleBuilder): 20 * rendering/ExclusionShapeInsideInfo.cpp: 21 (WebCore::ExclusionShapeInsideInfo::exclusionShapeInsideInfoForRenderBlock): 22 (WebCore::ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock): 23 (WebCore::ExclusionShapeInsideInfo::removeExclusionShapeInsideInfoForRenderBlock): 24 (WebCore::ExclusionShapeInsideInfo::computeShapeSize): 25 * rendering/RenderBlock.cpp: 26 (WebCore::RenderBlock::styleDidChange): 27 (WebCore::RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange): 28 * rendering/RenderBlock.h: 29 (WebCore::RenderBlock::exclusionShapeInsideInfo): 30 * rendering/style/RenderStyle.cpp: 31 (WebCore::RenderStyle::diff): 32 * rendering/style/RenderStyle.h: 33 * rendering/style/StyleRareNonInheritedData.cpp: 34 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): 35 (WebCore::StyleRareNonInheritedData::operator==): 36 (WebCore::StyleRareNonInheritedData::reportMemoryUsage): 37 * rendering/style/StyleRareNonInheritedData.h: 38 (StyleRareNonInheritedData): 39 1 40 2012-09-27 Michael Saboff <msaboff@apple.com> 2 41 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r129018 r129787 2444 2444 return cssValuePool().createValue(style->wrapPadding()); 2445 2445 case CSSPropertyWebkitShapeInside: 2446 if (!style-> wrapShapeInside())2446 if (!style->shapeInside()) 2447 2447 return cssValuePool().createIdentifierValue(CSSValueAuto); 2448 return valueForBasicShape(style-> wrapShapeInside());2448 return valueForBasicShape(style->shapeInside()); 2449 2449 case CSSPropertyWebkitShapeOutside: 2450 if (!style-> wrapShapeOutside())2450 if (!style->shapeOutside()) 2451 2451 return cssValuePool().createIdentifierValue(CSSValueAuto); 2452 return valueForBasicShape(style-> wrapShapeOutside());2452 return valueForBasicShape(style->shapeOutside()); 2453 2453 case CSSPropertyWebkitWrapThrough: 2454 2454 return cssValuePool().createValue(style->wrapThrough()); -
trunk/Source/WebCore/css/StyleBuilder.cpp
r128700 r129787 1710 1710 #if ENABLE(CSS_EXCLUSIONS) 1711 1711 template <BasicShape* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<BasicShape>), BasicShape* (*initialFunction)()> 1712 class ApplyProperty WrapShape {1712 class ApplyPropertyExclusionShape { 1713 1713 public: 1714 1714 static void setValue(RenderStyle* style, PassRefPtr<BasicShape> value) { (style->*setterFunction)(value); } … … 1720 1720 setValue(styleResolver->style(), 0); 1721 1721 else if (primitiveValue->isShape()) { 1722 RefPtr<BasicShape> wrapShape = basicShapeForValue(styleResolver, primitiveValue->getShapeValue());1723 setValue(styleResolver->style(), wrapShape.release());1722 RefPtr<BasicShape> shape = basicShapeForValue(styleResolver, primitiveValue->getShapeValue()); 1723 setValue(styleResolver->style(), shape.release()); 1724 1724 } 1725 1725 } … … 2061 2061 setPropertyHandler(CSSPropertyWebkitWrapPadding, ApplyPropertyLength<&RenderStyle::wrapPadding, &RenderStyle::setWrapPadding, &RenderStyle::initialWrapPadding>::createHandler()); 2062 2062 setPropertyHandler(CSSPropertyWebkitWrapThrough, ApplyPropertyDefault<WrapThrough, &RenderStyle::wrapThrough, WrapThrough, &RenderStyle::setWrapThrough, WrapThrough, &RenderStyle::initialWrapThrough>::createHandler()); 2063 setPropertyHandler(CSSPropertyWebkitShapeInside, ApplyProperty WrapShape<&RenderStyle::wrapShapeInside, &RenderStyle::setWrapShapeInside, &RenderStyle::initialWrapShapeInside>::createHandler());2064 setPropertyHandler(CSSPropertyWebkitShapeOutside, ApplyProperty WrapShape<&RenderStyle::wrapShapeOutside, &RenderStyle::setWrapShapeOutside, &RenderStyle::initialWrapShapeOutside>::createHandler());2063 setPropertyHandler(CSSPropertyWebkitShapeInside, ApplyPropertyExclusionShape<&RenderStyle::shapeInside, &RenderStyle::setShapeInside, &RenderStyle::initialShapeInside>::createHandler()); 2064 setPropertyHandler(CSSPropertyWebkitShapeOutside, ApplyPropertyExclusionShape<&RenderStyle::shapeOutside, &RenderStyle::setShapeOutside, &RenderStyle::initialShapeOutside>::createHandler()); 2065 2065 #endif 2066 2066 setPropertyHandler(CSSPropertyWhiteSpace, ApplyPropertyDefault<EWhiteSpace, &RenderStyle::whiteSpace, EWhiteSpace, &RenderStyle::setWhiteSpace, EWhiteSpace, &RenderStyle::initialWhiteSpace>::createHandler()); -
trunk/Source/WebCore/rendering/ExclusionShapeInsideInfo.cpp
r129689 r129787 66 66 ExclusionShapeInsideInfo* ExclusionShapeInsideInfo::exclusionShapeInsideInfoForRenderBlock(const RenderBlock* block) 67 67 { 68 ASSERT(block->style()-> wrapShapeInside());68 ASSERT(block->style()->shapeInside()); 69 69 return exclusionShapeInsideInfoMap().get(block); 70 70 } … … 73 73 { 74 74 // FIXME: Bug 89707: Enable shape inside for non-rectangular shapes 75 BasicShape* shape = block->style()-> wrapShapeInside();75 BasicShape* shape = block->style()->shapeInside(); 76 76 return (shape && shape->type() == BasicShape::BASIC_SHAPE_RECTANGLE); 77 77 } … … 79 79 void ExclusionShapeInsideInfo::removeExclusionShapeInsideInfoForRenderBlock(const RenderBlock* block) 80 80 { 81 if (!block->style() || !block->style()-> wrapShapeInside())81 if (!block->style() || !block->style()->shapeInside()) 82 82 return; 83 83 exclusionShapeInsideInfoMap().remove(block); … … 94 94 95 95 // FIXME: Bug 89993: The wrap shape may come from the parent object 96 BasicShape* shape = m_block->style()-> wrapShapeInside();96 BasicShape* shape = m_block->style()->shapeInside(); 97 97 ASSERT(shape); 98 98 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r129689 r129787 331 331 // FIXME: Bug 89993: Style changes should affect the ExclusionShapeInsideInfos for other render blocks that 332 332 // share the same ExclusionShapeInsideInfo 333 updateExclusionShapeInsideInfoAfterStyleChange(style()-> wrapShapeInside(), oldStyle ? oldStyle->wrapShapeInside() : 0);333 updateExclusionShapeInsideInfoAfterStyleChange(style()->shapeInside(), oldStyle ? oldStyle->shapeInside() : 0); 334 334 #endif 335 335 … … 1381 1381 1382 1382 #if ENABLE(CSS_EXCLUSIONS) 1383 void RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange(const BasicShape* wrapShape, const BasicShape* oldWrapShape)1383 void RenderBlock::updateExclusionShapeInsideInfoAfterStyleChange(const BasicShape* shapeInside, const BasicShape* oldShapeInside) 1384 1384 { 1385 1385 // FIXME: A future optimization would do a deep comparison for equality. 1386 if ( wrapShape == oldWrapShape)1387 return; 1388 1389 if ( wrapShape) {1386 if (shapeInside == oldShapeInside) 1387 return; 1388 1389 if (shapeInside) { 1390 1390 ExclusionShapeInsideInfo* exclusionShapeInsideInfo = ExclusionShapeInsideInfo::ensureExclusionShapeInsideInfoForRenderBlock(this); 1391 1391 exclusionShapeInsideInfo->dirtyShapeSize(); -
trunk/Source/WebCore/rendering/RenderBlock.h
r129689 r129787 405 405 ExclusionShapeInsideInfo* exclusionShapeInsideInfo() const 406 406 { 407 return style()-> wrapShapeInside() && ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock(this) ? ExclusionShapeInsideInfo::exclusionShapeInsideInfoForRenderBlock(this) : 0;407 return style()->shapeInside() && ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock(this) ? ExclusionShapeInsideInfo::exclusionShapeInsideInfoForRenderBlock(this) : 0; 408 408 } 409 409 #endif -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r129466 r129787 459 459 460 460 #if ENABLE(CSS_EXCLUSIONS) 461 if (rareNonInheritedData->m_ wrapShapeInside != other->rareNonInheritedData->m_wrapShapeInside)461 if (rareNonInheritedData->m_shapeInside != other->rareNonInheritedData->m_shapeInside) 462 462 return StyleDifferenceLayout; 463 463 #endif … … 680 680 // to avoid having diff() == StyleDifferenceEqual where wrap-shapes actually differ. 681 681 // Tracking bug: https://bugs.webkit.org/show_bug.cgi?id=62991 682 if (rareNonInheritedData->m_ wrapShapeOutside != other->rareNonInheritedData->m_wrapShapeOutside)682 if (rareNonInheritedData->m_shapeOutside != other->rareNonInheritedData->m_shapeOutside) 683 683 return StyleDifferenceRepaint; 684 684 -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r128700 r129787 1446 1446 #endif 1447 1447 1448 void set WrapShapeInside(PassRefPtr<BasicShape> shape)1449 { 1450 if (rareNonInheritedData->m_ wrapShapeInside != shape)1451 rareNonInheritedData.access()->m_ wrapShapeInside = shape;1452 } 1453 BasicShape* wrapShapeInside() const { return rareNonInheritedData->m_wrapShapeInside.get(); }1454 1455 void set WrapShapeOutside(PassRefPtr<BasicShape> shape)1456 { 1457 if (rareNonInheritedData->m_ wrapShapeOutside != shape)1458 rareNonInheritedData.access()->m_ wrapShapeOutside = shape;1459 } 1460 BasicShape* wrapShapeOutside() const { return rareNonInheritedData->m_wrapShapeOutside.get(); }1461 1462 static BasicShape* initial WrapShapeInside() { return 0; }1463 static BasicShape* initial WrapShapeOutside() { return 0; }1448 void setShapeInside(PassRefPtr<BasicShape> shape) 1449 { 1450 if (rareNonInheritedData->m_shapeInside != shape) 1451 rareNonInheritedData.access()->m_shapeInside = shape; 1452 } 1453 BasicShape* shapeInside() const { return rareNonInheritedData->m_shapeInside.get(); } 1454 1455 void setShapeOutside(PassRefPtr<BasicShape> shape) 1456 { 1457 if (rareNonInheritedData->m_shapeOutside != shape) 1458 rareNonInheritedData.access()->m_shapeOutside = shape; 1459 } 1460 BasicShape* shapeOutside() const { return rareNonInheritedData->m_shapeOutside.get(); } 1461 1462 static BasicShape* initialShapeInside() { return 0; } 1463 static BasicShape* initialShapeOutside() { return 0; } 1464 1464 1465 1465 void setClipPath(PassRefPtr<ClipPathOperation> operation) -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
r129466 r129787 46 46 , m_mask(FillLayer(MaskFillLayer)) 47 47 , m_pageSize() 48 , m_ wrapShapeInside(RenderStyle::initialWrapShapeInside())49 , m_ wrapShapeOutside(RenderStyle::initialWrapShapeOutside())48 , m_shapeInside(RenderStyle::initialShapeInside()) 49 , m_shapeOutside(RenderStyle::initialShapeOutside()) 50 50 , m_wrapMargin(RenderStyle::initialWrapMargin()) 51 51 , m_wrapPadding(RenderStyle::initialWrapPadding()) … … 117 117 , m_maskBoxImage(o.m_maskBoxImage) 118 118 , m_pageSize(o.m_pageSize) 119 , m_ wrapShapeInside(o.m_wrapShapeInside)120 , m_ wrapShapeOutside(o.m_wrapShapeOutside)119 , m_shapeInside(o.m_shapeInside) 120 , m_shapeOutside(o.m_shapeOutside) 121 121 , m_wrapMargin(o.m_wrapMargin) 122 122 , m_wrapPadding(o.m_wrapPadding) … … 199 199 && m_maskBoxImage == o.m_maskBoxImage 200 200 && m_pageSize == o.m_pageSize 201 && m_ wrapShapeInside == o.m_wrapShapeInside202 && m_ wrapShapeOutside == o.m_wrapShapeOutside201 && m_shapeInside == o.m_shapeInside 202 && m_shapeOutside == o.m_shapeOutside 203 203 && m_wrapMargin == o.m_wrapMargin 204 204 && m_wrapPadding == o.m_wrapPadding … … 326 326 info.addMember(m_animations); 327 327 info.addMember(m_transitions); 328 info.addMember(m_ wrapShapeInside);329 info.addMember(m_ wrapShapeOutside);328 info.addMember(m_shapeInside); 329 info.addMember(m_shapeOutside); 330 330 info.addMember(m_clipPath); 331 331 info.addMember(m_flowThread); -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
r128700 r129787 135 135 LengthSize m_pageSize; 136 136 137 RefPtr<BasicShape> m_ wrapShapeInside;138 RefPtr<BasicShape> m_ wrapShapeOutside;137 RefPtr<BasicShape> m_shapeInside; 138 RefPtr<BasicShape> m_shapeOutside; 139 139 Length m_wrapMargin; 140 140 Length m_wrapPadding;
Note: See TracChangeset
for help on using the changeset viewer.