Changeset 150642 in webkit
- Timestamp:
- May 24, 2013 9:18:16 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r150635 r150642 1 2013-05-24 Robert Hogan <robert@webkit.org> 2 3 Refactor shouldAddBorderPaddingMargin() 4 https://bugs.webkit.org/show_bug.cgi?id=98803 5 6 Reviewed by Ryosuke Niwa. 7 8 Make this helper function less clever-stupid in its misguided sacrifice of intelligibility 9 for the sake of concision. 10 11 No new tests, refactoring. 12 13 * rendering/RenderBlockLineLayout.cpp: 14 (WebCore::shouldAddBorderPaddingMargin): 15 (WebCore::inlineLogicalWidth): 16 1 17 2013-05-24 Xiaobo Wang <xiaobwang@blackberry.com> 2 18 -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r150602 r150642 349 349 } 350 350 351 static bool shouldAddBorderPaddingMargin(RenderObject* child, bool &checkSide) 352 { 353 if (!child || (child->isText() && !toRenderText(child)->textLength())) 354 return true; 355 checkSide = false; 356 return checkSide; 351 static inline bool shouldAddBorderPaddingMargin(RenderObject* child) 352 { 353 // When deciding whether we're at the edge of an inline, adjacent collapsed whitespace is the same as no sibling at all. 354 return !child || (child->isText() && !toRenderText(child)->textLength()); 357 355 } 358 356 … … 365 363 } 366 364 367 static LayoutUnit inlineLogicalWidth(RenderObject* child, bool start = true, bool end= true)365 static LayoutUnit inlineLogicalWidth(RenderObject* child, bool checkStartEdge = true, bool checkEndEdge = true) 368 366 { 369 367 unsigned lineDepth = 1; … … 373 371 RenderInline* parentAsRenderInline = toRenderInline(parent); 374 372 if (!isEmptyInline(parentAsRenderInline)) { 375 if (start && shouldAddBorderPaddingMargin(previousInFlowSibling(child), start)) 373 checkStartEdge = checkStartEdge && shouldAddBorderPaddingMargin(previousInFlowSibling(child)); 374 if (checkStartEdge) 376 375 extraWidth += borderPaddingMarginStart(parentAsRenderInline); 377 if (end && shouldAddBorderPaddingMargin(child->nextSibling(), end)) 376 checkEndEdge = checkEndEdge && shouldAddBorderPaddingMargin(child->nextSibling()); 377 if (checkEndEdge) 378 378 extraWidth += borderPaddingMarginEnd(parentAsRenderInline); 379 if (! start && !end)379 if (!checkStartEdge && !checkEndEdge) 380 380 return extraWidth; 381 381 }
Note: See TracChangeset
for help on using the changeset viewer.