Changeset 112566 in webkit
- Timestamp:
- Mar 29, 2012 1:20:13 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r112564 r112566 1 2012-03-29 Ryosuke Niwa <rniwa@webkit.org> 2 3 Add a compile assert for the size of RenderBlock 4 https://bugs.webkit.org/show_bug.cgi?id=82586 5 6 Reviewed by Tony Chang. 7 8 Add compile asserts for the size of RenderBlock and RenderBlock::MarginValues. 9 We can't add asserts for FloatingObject and MarginInfo because they're private to RenderBlock. 10 11 * rendering/RenderBlock.cpp: 12 (SameSizeAsRenderBlock): 13 (WebCore): 14 (WebCore::RenderBlock::addOverflowFromFloats): 15 (WebCore::RenderBlock::repaintOverhangingFloats): 16 (WebCore::RenderBlock::paintFloats): 17 (WebCore::RenderBlock::insertFloatingObject): 18 (WebCore::RenderBlock::clearFloats): 19 (WebCore::RenderBlock::addOverhangingFloats): 20 (WebCore::RenderBlock::addIntrudingFloats): 21 (WebCore::RenderBlock::hitTestFloats): 22 (WebCore::RenderBlock::adjustForBorderFit): 23 * rendering/RenderBlock.h: 24 (WebCore::RenderBlock::FloatingObject::shouldPaint): 25 (WebCore::RenderBlock::FloatingObject::setShouldPaint): 26 (WebCore::RenderBlock::FloatingObject::isDescendant): 27 (WebCore::RenderBlock::FloatingObject::setIsDescendant): 28 (FloatingObject): 29 (RenderBlock): 30 1 31 2012-03-29 Gavin Barraclough <barraclough@apple.com> 2 32 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r112555 r112566 70 70 using namespace HTMLNames; 71 71 72 struct SameSizeAsRenderBlock : public RenderBox { 73 void* pointers[3]; 74 RenderObjectChildList children; 75 RenderLineBoxList lineBoxes; 76 uint32_t bitfields; 77 }; 78 79 COMPILE_ASSERT(sizeof(RenderBlock) == sizeof(SameSizeAsRenderBlock), RenderBlock_should_stay_small); 80 81 struct SameSizeAsFloatingObject { 82 void* pointers[2]; 83 LayoutRect rect; 84 int paginationStrut; 85 uint32_t bitfields : 8; 86 }; 87 88 COMPILE_ASSERT(sizeof(RenderBlock::MarginValues) == sizeof(LayoutUnit[4]), MarginValues_should_stay_small); 89 90 struct SameSizeAsMarginInfo { 91 uint32_t bitfields : 16; 92 LayoutUnit margins[2]; 93 }; 94 72 95 typedef WTF::HashMap<const RenderBox*, ColumnInfo*> ColumnInfoMap; 73 96 static ColumnInfoMap* gColumnInfoMap = 0; … … 182 205 { 183 206 setChildrenInline(true); 207 COMPILE_ASSERT(sizeof(RenderBlock::FloatingObject) == sizeof(SameSizeAsFloatingObject), FloatingObject_should_stay_small); 208 COMPILE_ASSERT(sizeof(RenderBlock::MarginInfo) == sizeof(SameSizeAsMarginInfo), MarginInfo_should_stay_small); 184 209 } 185 210 … … 1722 1747 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) { 1723 1748 FloatingObject* r = *it; 1724 if (r-> m_isDescendant&& !r->m_renderer->isPositioned())1749 if (r->isDescendant() && !r->m_renderer->isPositioned()) 1725 1750 addOverflowFromChild(r->m_renderer, IntSize(xPositionForFloatIncludingMargin(r), yPositionForFloatIncludingMargin(r))); 1726 1751 } … … 2629 2654 // is our responsibility to paint (m_shouldPaint is set). When paintAllDescendants is true, the latter 2630 2655 // condition is replaced with being a descendant of us. 2631 if (logicalBottomForFloat(r) > logicalHeight() && ((paintAllDescendants && r->m_renderer->isDescendantOf(this)) || r-> m_shouldPaint) && !r->m_renderer->hasSelfPaintingLayer()) {2656 if (logicalBottomForFloat(r) > logicalHeight() && ((paintAllDescendants && r->m_renderer->isDescendantOf(this)) || r->shouldPaint()) && !r->m_renderer->hasSelfPaintingLayer()) { 2632 2657 r->m_renderer->repaint(); 2633 2658 r->m_renderer->repaintOverhangingFloats(); … … 2988 3013 FloatingObject* r = *it; 2989 3014 // Only paint the object if our m_shouldPaint flag is set. 2990 if (r-> m_shouldPaint&& !r->m_renderer->hasSelfPaintingLayer()) {3015 if (r->shouldPaint() && !r->m_renderer->hasSelfPaintingLayer()) { 2991 3016 PaintInfo currentPaintInfo(paintInfo); 2992 3017 currentPaintInfo.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground; … … 3582 3607 setLogicalWidthForFloat(newObj, logicalWidthForChild(o) + marginStartForChild(o) + marginEndForChild(o)); 3583 3608 3584 newObj-> m_shouldPaint = !o->hasSelfPaintingLayer(); // If a layer exists, the float will paint itself.Otherwise someone else will.3585 newObj-> m_isDescendant = true;3609 newObj->setShouldPaint(!o->hasSelfPaintingLayer()); // If a layer exists, the float will paint itself. Otherwise someone else will. 3610 newObj->setIsDescendant(true); 3586 3611 newObj->m_renderer = o; 3587 3612 … … 4239 4264 for (RendererToFloatInfoMap::iterator it = floatMap.begin(); it != end; ++it) { 4240 4265 FloatingObject* floatingObject = (*it).second; 4241 if (!floatingObject-> m_isDescendant) {4266 if (!floatingObject->isDescendant()) { 4242 4267 changeLogicalTop = 0; 4243 4268 changeLogicalBottom = max(changeLogicalBottom, logicalBottomForFloat(floatingObject)); … … 4282 4307 // if we hit a self-painting layer boundary. 4283 4308 if (r->m_renderer->enclosingFloatPaintingLayer() == enclosingFloatPaintingLayer()) 4284 r-> m_shouldPaint = false;4309 r->setShouldPaint(false); 4285 4310 else 4286 floatingObj-> m_shouldPaint = false;4287 4288 floatingObj-> m_isDescendant = true;4311 floatingObj->setShouldPaint(false); 4312 4313 floatingObj->setIsDescendant(true); 4289 4314 4290 4315 // We create the floating object list lazily. … … 4295 4320 } 4296 4321 } else { 4297 if (makeChildPaintOtherFloats && !r-> m_shouldPaint && !r->m_renderer->hasSelfPaintingLayer() &&4298 r->m_renderer->isDescendantOf(child) && r->m_renderer->enclosingFloatPaintingLayer() == child->enclosingFloatPaintingLayer()) {4322 if (makeChildPaintOtherFloats && !r->shouldPaint() && !r->m_renderer->hasSelfPaintingLayer() 4323 && r->m_renderer->isDescendantOf(child) && r->m_renderer->enclosingFloatPaintingLayer() == child->enclosingFloatPaintingLayer()) { 4299 4324 // The float is not overhanging from this block, so if it is a descendant of the child, the child should 4300 4325 // paint it (the other case is that it is intruding into the child), unless it has its own layer or enclosing … … 4302 4327 // If makeChildPaintOtherFloats is false, it means that the child must already know about all the floats 4303 4328 // it should paint. 4304 r-> m_shouldPaint = true;4329 r->setShouldPaint(true); 4305 4330 } 4306 4331 4307 4332 // Since the float doesn't overhang, it didn't get put into our list. We need to go ahead and add its overflow in to the 4308 4333 // child now. 4309 if (r-> m_isDescendant)4334 if (r->isDescendant()) 4310 4335 child->addOverflowFromChild(r->m_renderer, LayoutSize(xPositionForFloatIncludingMargin(r), yPositionForFloatIncludingMargin(r))); 4311 4336 } … … 4358 4383 } 4359 4384 4360 floatingObj-> m_shouldPaint = false;// We are not in the direct inheritance chain for this float. We will never paint it.4385 floatingObj->setShouldPaint(false); // We are not in the direct inheritance chain for this float. We will never paint it. 4361 4386 floatingObj->m_renderer = r->m_renderer; 4362 4387 … … 4576 4601 --it; 4577 4602 FloatingObject* floatingObject = *it; 4578 if (floatingObject-> m_shouldPaint&& !floatingObject->m_renderer->hasSelfPaintingLayer()) {4603 if (floatingObject->shouldPaint() && !floatingObject->m_renderer->hasSelfPaintingLayer()) { 4579 4604 LayoutUnit xOffset = xPositionForFloatIncludingMargin(floatingObject) - floatingObject->m_renderer->x(); 4580 4605 LayoutUnit yOffset = yPositionForFloatIncludingMargin(floatingObject) - floatingObject->m_renderer->y(); … … 6307 6332 FloatingObject* r = *it; 6308 6333 // Only examine the object if our m_shouldPaint flag is set. 6309 if (r-> m_shouldPaint) {6334 if (r->shouldPaint()) { 6310 6335 LayoutUnit floatLeft = xPositionForFloatIncludingMargin(r) - r->m_renderer->x(); 6311 6336 LayoutUnit floatRight = floatLeft + r->m_renderer->width(); -
trunk/Source/WebCore/rendering/RenderBlock.h
r111217 r112566 621 621 #endif 622 622 623 bool shouldPaint() const { return m_shouldPaint; } 624 void setShouldPaint(bool shouldPaint) { m_shouldPaint = shouldPaint; } 625 bool isDescendant() const { return m_isDescendant; } 626 void setIsDescendant(bool isDescendant) { m_isDescendant = isDescendant; } 627 623 628 RenderBox* m_renderer; 624 629 RootInlineBox* m_originatingLine; 625 630 LayoutRect m_frameRect; 626 631 int m_paginationStrut; 632 633 private: 627 634 unsigned m_type : 3; // Type (left/right aligned or positioned) 628 boolm_shouldPaint : 1;629 boolm_isDescendant : 1;630 boolm_isPlaced : 1;635 unsigned m_shouldPaint : 1; 636 unsigned m_isDescendant : 1; 637 unsigned m_isPlaced : 1; 631 638 #ifndef NDEBUG 632 boolm_isInPlacedTree : 1;639 unsigned m_isInPlacedTree : 1; 633 640 #endif 634 641 }; … … 1128 1135 1129 1136 mutable signed m_lineHeight : 29; 1130 boolm_beingDestroyed : 1;1131 boolm_hasPositionedFloats : 1;1132 boolm_hasMarkupTruncation : 1;1137 unsigned m_beingDestroyed : 1; 1138 unsigned m_hasPositionedFloats : 1; 1139 unsigned m_hasMarkupTruncation : 1; 1133 1140 1134 1141 // RenderRubyBase objects need to be able to split and merge, moving their children around
Note: See TracChangeset
for help on using the changeset viewer.