Changeset 108111 in webkit
- Timestamp:
- Feb 17, 2012 1:10:42 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r108109 r108111 1 2012-01-23 Robert Hogan <robert@webkit.org> 2 3 REGRESSION: empty span creates renders with non-zero height 4 https://bugs.webkit.org/show_bug.cgi?id=76465 5 6 Reviewed by David Hyatt. 7 8 * fast/css/empty-span-expected.html: Added. 9 * fast/css/empty-span.html: Added. 10 * fast/css/non-empty-span.html: Added. 11 * platform/chromium/test_expectations.txt: Suppress result until rebaseline on MAC and WIN. 12 * platform/chromium-linux-x86/fast/css/non-empty-span-expected.png: Added. 13 * platform/chromium-linux-x86/fast/css/non-empty-span-expected.txt: Added. 14 1 15 2012-02-17 Abhishek Arya <inferno@chromium.org> 2 16 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r108088 r108111 4207 4207 // Started failing http://trac.webkit.org/log/?verbose=on&rev=107837&stop_rev=107836 4208 4208 BUGWK78755 : compositing/culling/scrolled-within-boxshadow.html = IMAGE 4209 4210 // Needs baselines for MAC and WIN. 4211 BUGWK76465 MAC WIN : fast/css/non-empty-span.html = IMAGE+TEXT -
trunk/Source/WebCore/ChangeLog
r108110 r108111 1 2012-01-23 Robert Hogan <robert@webkit.org> 2 3 REGRESSION: empty span creates renders with non-zero height 4 https://bugs.webkit.org/show_bug.cgi?id=76465 5 6 Reviewed by David Hyatt. 7 8 Tests: fast/css/empty-span.html 9 fast/css/non-empty-span.html 10 11 Empty inlines with line-height, vertical-alignment or font metrics should only get a linebox if there is some 12 other content in the line. So only create line boxes for such elements on lines that are not empty. 13 14 This patch fixes a regression where an empty inline with line-height was propagating its height to an empty line. 15 It also fixes cases where lines with content that had a leading empty inline element weren't respecting the 16 vertical alignment or font-height of the empty inline. 17 18 * rendering/RenderBlockLineLayout.cpp: 19 (WebCore::RenderBlock::constructLine): only create line boxes for lines that are not empty. 20 (WebCore::requiresLineBoxForContent): an inline flow with line-height, vertical-alignment, or font-size 21 will need a linebox if the rest of the line is not empty. 22 (WebCore): 23 (WebCore::alwaysRequiresLineBox): rename from inlineFlowRequiresLineBox. 24 (WebCore::requiresLineBox): 25 (WebCore::RenderBlock::LineBreaker::nextLineBreak): if the inline flow definitely requires a line, mark 26 the line non-empty - otherwise hold off. 27 1 28 2012-02-17 Raymond Toy <rtoy@google.com> 2 29 -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r107880 r108111 491 491 if (runCount == 2 && !r->m_object->isListMarker()) 492 492 isOnlyRun = (!style()->isLeftToRightDirection() ? bidiRuns.lastRun() : bidiRuns.firstRun())->m_object->isListMarker(); 493 494 if (lineInfo.isEmpty()) 495 continue; 493 496 494 497 InlineBox* box = createInlineBoxForRenderer(r->m_object, false, isOnlyRun); … … 1832 1835 } 1833 1836 1834 static bool inlineFlowRequiresLineBox(RenderInline* flow, const LineInfo& lineInfo) 1837 static bool requiresLineBoxForContent(RenderInline* flow, const LineInfo& lineInfo) 1838 { 1839 RenderObject* parent = flow->parent(); 1840 if (flow->document()->inNoQuirksMode() 1841 && (flow->style(lineInfo.isFirstLine())->lineHeight() != parent->style(lineInfo.isFirstLine())->lineHeight() 1842 || flow->style()->verticalAlign() != parent->style()->verticalAlign() 1843 || !parent->style()->font().fontMetrics().hasIdenticalAscentDescentAndLineGap(flow->style()->font().fontMetrics()))) 1844 return true; 1845 return false; 1846 } 1847 1848 static bool alwaysRequiresLineBox(RenderInline* flow, const LineInfo& lineInfo) 1835 1849 { 1836 1850 // FIXME: Right now, we only allow line boxes for inlines that are truly empty. 1837 1851 // We need to fix this, though, because at the very least, inlines containing only 1838 1852 // ignorable whitespace should should also have line boxes. 1839 if (!flow->document()->inQuirksMode() && flow->style(lineInfo.isFirstLine())->lineHeight() != flow->parent()->style(lineInfo.isFirstLine())->lineHeight())1840 return true;1841 1842 1853 return !flow->firstChild() && flow->hasInlineDirectionBordersPaddingOrMargin(); 1843 1854 } … … 1848 1859 return false; 1849 1860 1850 if (it.m_obj->isRenderInline() && ! inlineFlowRequiresLineBox(toRenderInline(it.m_obj), lineInfo))1861 if (it.m_obj->isRenderInline() && !alwaysRequiresLineBox(toRenderInline(it.m_obj), lineInfo) && !requiresLineBoxForContent(toRenderInline(it.m_obj), lineInfo)) 1851 1862 return false; 1852 1863 … … 2236 2247 // If this object is at the start of the line, we need to behave like list markers and 2237 2248 // start ignoring spaces. 2238 if (inlineFlowRequiresLineBox(flowBox, lineInfo)) { 2239 lineInfo.setEmpty(false, m_block, &width); 2249 bool requiresLineBox = alwaysRequiresLineBox(flowBox, lineInfo); 2250 if (requiresLineBox || requiresLineBoxForContent(flowBox, lineInfo)) { 2251 // An empty inline that only has line-height, vertical-align or font-metrics will only get a 2252 // line box to affect the height of the line if the rest of the line is not empty. 2253 if (requiresLineBox) 2254 lineInfo.setEmpty(false, m_block, &width); 2240 2255 if (ignoringSpaces) { 2241 2256 trailingObjects.clear();
Note: See TracChangeset
for help on using the changeset viewer.