Changeset 130663 in webkit
- Timestamp:
- Oct 8, 2012, 11:44:03 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/inline/bpm-inline-ancestors-expected.html (added)
-
LayoutTests/fast/inline/bpm-inline-ancestors.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/RenderBlockLineLayout.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r130662 r130663 1 2012-10-08 Robert Hogan <robert@webkit.org> 2 3 Border, margin and padding of an inline's inline ancestors counted twice 4 https://bugs.webkit.org/show_bug.cgi?id=63074 5 6 Reviewed by David Hyatt. 7 8 * fast/inline/bpm-inline-ancestors-expected.html: Added. 9 * fast/inline/bpm-inline-ancestors.html: Added. 10 1 11 2012-10-08 Sudarsana Nagineni <sudarsana.nagineni@intel.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r130657 r130663 1 2012-10-08 Robert Hogan <robert@webkit.org> 2 3 Border, margin and padding of an inline's inline ancestors counted twice 4 https://bugs.webkit.org/show_bug.cgi?id=63074 5 6 Reviewed by David Hyatt. 7 8 In a line such as '<span><span><img>Text' the border, padding and margin belonging 9 to the two spans was counted twice by RenderBlockLineLayout::nextLineBreak(): once 10 when adding the width of the <img> object to the line, and a second time when adding 11 the 'Text'. The result was that nextLineBreak() now had a length for the line that 12 exceeded the line's maximum length and inserted a bogus line break. 13 14 This all happened because the helper function that is used to add in the border etc. 15 from inline ancestors was crawling up the tree each time. It doesn't need to do that, it 16 should stop crawling up the tree when the current object is not the first or last sibling below a parent. 17 18 Test: fast/inline/bpm-inline-ancestors.html 19 20 * rendering/RenderBlockLineLayout.cpp: 21 (WebCore::shouldAddBorderPaddingMargin): Broke this check out into a helper function so that it 22 can help inlineLogicalWidth() return early and also treat empty RenderTexts the same as no previous/next 23 sibling on the line. This ensures that collapsed leading space does not interfere with the decision to 24 crawl up the ancestors accumulating border, padding, and margin. 25 (WebCore): 26 (WebCore::inlineLogicalWidth): Return early once the current child is no longer on the edge of its line - 27 this ensures the border, padding and margin of ancestors is not counted twice. 28 1 29 2012-10-08 Mike West <mkwst@chromium.org> 2 30 -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r130612 r130663 291 291 } 292 292 293 static bool shouldAddBorderPaddingMargin(RenderObject* child, bool &checkSide) 294 { 295 if (!child || (child->isText() && !toRenderText(child)->textLength())) 296 return true; 297 checkSide = false; 298 return checkSide; 299 } 300 293 301 static LayoutUnit inlineLogicalWidth(RenderObject* child, bool start = true, bool end = true) 294 302 { … … 298 306 while (parent->isRenderInline() && lineDepth++ < cMaxLineDepth) { 299 307 RenderInline* parentAsRenderInline = toRenderInline(parent); 300 if (start && !child->previousSibling())308 if (start && shouldAddBorderPaddingMargin(child->previousSibling(), start)) 301 309 extraWidth += borderPaddingMarginStart(parentAsRenderInline); 302 if (end && !child->nextSibling())310 if (end && shouldAddBorderPaddingMargin(child->nextSibling(), end)) 303 311 extraWidth += borderPaddingMarginEnd(parentAsRenderInline); 312 if (!start && !end) 313 return extraWidth; 304 314 child = parent; 305 315 parent = child->parent();
Note:
See TracChangeset
for help on using the changeset viewer.