haikuwebkit/LayoutTests/fast/css/negative-leading.html

24 lines
754 B
HTML
Raw Permalink Normal View History

https://bugs.webkit.org/show_bug.cgi?id=11004 Reviewed by Dan Bernstein. font-size:0 is ignored. Remove the minimum font size of 1 in CSSStyleSelector. Change the pref value for minimum font size from 1 to 0. Make sure to never use the NSFont's size, since it doesn't honor a size of 0. Instead pass the size in to the FontPlatformData(NSFont*) version of the constructor rather than using [NSFont pointSize]. https://bugs.webkit.org/show_bug.cgi?id=49582 Negative leading is not handled correctly. There are two bugs here. The first is that maxAscent and maxDescent can be negative, so we need a notion of whether or not we have set them before so that we can allow them to be < 0. The second issue is that we should understand where fonts will end up relative to our baseline (excluding line height), and only allow those boxes to impact ascent and descent if the actual font box (without factoring in line height) is above or below the root line box baseline. Added fast/css/negative-leading.html These two bug fixes have to land together to keep the Acid 3 test rendering correctly. WebCore: * WebCore.exp.in: * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize): * platform/graphics/cocoa/FontPlatformData.h: * platform/graphics/cocoa/FontPlatformDataCocoa.mm: (WebCore::FontPlatformData::FontPlatformData): * platform/graphics/mac/FontCacheMac.mm: (WebCore::FontCache::getFontDataForCharacters): (WebCore::FontCache::createFontPlatformData): * platform/graphics/mac/SimpleFontDataMac.mm: (WebCore::SimpleFontData::smallCapsFontData): * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::computeLogicalBoxHeights): * rendering/InlineFlowBox.h: * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::alignBoxesInBlockDirection): WebKit/mac: * Misc/WebKitNSStringExtras.mm: (-[NSString _web_drawAtPoint:font:textColor:allowingFontSmoothing:]): (-[NSString _web_widthWithFont:]): * Misc/WebStringTruncator.mm: (fontFromNSFont): * WebView/WebPreferences.mm: (+[WebPreferences initialize]): WebKit/win: * WebPreferences.cpp: (WebPreferences::initializeDefaultSettings): WebKit2: * Shared/WebPreferencesStore.cpp: (WebKit::WebPreferencesStore::WebPreferencesStore): LayoutTests: * fast/css/negative-leading.html: Added. * platform/mac/fast/compact/001-expected.checksum: * platform/mac/fast/compact/001-expected.png: * platform/mac/fast/compact/001-expected.txt: * platform/mac/fast/css/negative-leading-expected.checksum: Added. * platform/mac/fast/css/negative-leading-expected.png: Added. * platform/mac/fast/css/negative-leading-expected.txt: Added. * platform/mac/fast/forms/linebox-overflow-in-textarea-padding-expected.checksum: * platform/mac/fast/forms/linebox-overflow-in-textarea-padding-expected.png: * platform/mac/fast/forms/linebox-overflow-in-textarea-padding-expected.txt: * platform/mac/fast/parser/style-script-head-test-expected.png: Canonical link: https://commits.webkit.org/62608@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@72141 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-11-16 23:28:53 +00:00
<!doctype html>
<html>
<head>
<style>
div {
font-size: 48px;
font-family: arial;
width: 400px;
}
</style>
</head>
<body>
<p>The following two phrases should appear identical. The second line of text should overlap both the first line and the red border.</p>
<div style="border: 2px solid red; height: 100%; padding: 10px 10px 0px 10px">
<div style="line-height:19px">Lorem ipsum dolor sit amet</div>
</div>
<br>
<div style="border: 2px solid red; height: 100%; padding: 10px 10px 0px 10px">
<div style="line-height:40%">Lorem ipsum dolor sit amet</div>
</div>
</body>
</html>