[webkit-changes] cvs commit: WebCore/layout-tests/fast/inline-block
tricky-baseline-expected.txt tricky-baseline.html
David
hyatt at opensource.apple.com
Thu Aug 11 14:37:03 PDT 2005
hyatt 05/08/11 14:37:03
Modified: . ChangeLog
khtml/rendering render_block.cpp
Added: layout-tests/fast/inline-block tricky-baseline-expected.txt
tricky-baseline.html
Log:
Refine the baseline alignment rule for inline blocks to cover for a hole in the spec. The spec doesnt say what to do
for overflow cases, e.g., when the last line is clipped, when the overflow box is scrolled, or even when overflow is
visible but the last line is outside your content box. We just revert to the old behavior in those cases. Hopefully
the spec will be clarified to explain what the right behavior is.
Reviewed by beth
Test cases added: fast/inline-block/tricky-baseline.html
* khtml/rendering/render_block.cpp:
(khtml::RenderBlock::baselinePosition):
Revision Changes Path
1.4563 +14 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.4562
retrieving revision 1.4563
diff -u -r1.4562 -r1.4563
--- ChangeLog 11 Aug 2005 18:58:31 -0000 1.4562
+++ ChangeLog 11 Aug 2005 21:36:58 -0000 1.4563
@@ -1,3 +1,17 @@
+2005-08-11 David Hyatt <hyatt at apple.com>
+
+ Refine the baseline alignment rule for inline blocks to cover for a hole in the spec. The spec doesnt say what to do
+ for overflow cases, e.g., when the last line is clipped, when the overflow box is scrolled, or even when overflow is
+ visible but the last line is outside your content box. We just revert to the old behavior in those cases. Hopefully
+ the spec will be clarified to explain what the right behavior is.
+
+ Reviewed by beth
+
+ Test cases added: fast/inline-block/tricky-baseline.html
+
+ * khtml/rendering/render_block.cpp:
+ (khtml::RenderBlock::baselinePosition):
+
2005-08-11 Eric Seidel <eseidel at apple.com>
Reviewed by darin.
1.197 +5 -2 WebCore/khtml/rendering/render_block.cpp
Index: render_block.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_block.cpp,v
retrieving revision 1.196
retrieving revision 1.197
diff -u -r1.196 -r1.197
--- render_block.cpp 9 Aug 2005 20:58:27 -0000 1.196
+++ render_block.cpp 11 Aug 2005 21:37:02 -0000 1.197
@@ -3197,8 +3197,11 @@
// CSS2.1 states that the baseline of an inline block is the baseline of the last line box in
// the normal flow. We make an exception for marquees, since their baselines are meaningless
// (the content inside them moves). This matches WinIE as well, which just bottom-aligns them.
- int baselinePos = (m_layer && m_layer->marquee()) ? -1 : getBaselineOfLastLineBox();
- if (baselinePos != -1)
+ // We also give up on finding a baseline if we have a vertical scrollbar, or if we are scrolled
+ // vertically (e.g., an overflow:hidden block that has had scrollTop moved) or if the baseline is outside
+ // of our content box.
+ int baselinePos = (m_layer && (m_layer->marquee() || m_layer->verticalScrollbar() || m_layer->scrollYOffset() != 0)) ? -1 : getBaselineOfLastLineBox();
+ if (baselinePos != -1 && baselinePos <= borderTop() + paddingTop() + contentHeight())
return marginTop() + baselinePos;
return height() + marginTop() + marginBottom();
}
1.1 WebCore/layout-tests/fast/inline-block/tricky-baseline-expected.txt
Index: tricky-baseline-expected.txt
===================================================================
layer at (0,0) size 800x600
RenderCanvas at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderText {TEXT} at (0,0) size 736x36
text run at (0,0) width 736: "It is not clear what the right behavior is here. The CSS2.1 draft is currently ambiguous about how to handle overflow"
text run at (0,18) width 45: "blocks."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (104,254) size 4x18
text run at (104,254) width 4: " "
RenderText {TEXT} at (0,0) size 0x0
RenderText {TEXT} at (0,0) size 0x0
layer at (8,72) size 104x204 clip at (10,74) size 85x200 scrollHeight 468
RenderBlock {DIV} at (0,64) size 104x204 [border: (2px solid #800080)]
RenderText {TEXT} at (2,2) size 79x36
text run at (2,2) width 79: "This is some"
text run at (2,20) width 27: "text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,38) size 79x36
text run at (2,38) width 79: "This is some"
text run at (2,56) width 27: "text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,74) size 79x36
text run at (2,74) width 79: "This is some"
text run at (2,92) width 27: "text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,110) size 79x36
text run at (2,110) width 79: "This is some"
text run at (2,128) width 27: "text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,146) size 79x36
text run at (2,146) width 79: "This is some"
text run at (2,164) width 27: "text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,182) size 79x36
text run at (2,182) width 79: "This is some"
text run at (2,200) width 27: "text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,218) size 79x36
text run at (2,218) width 79: "This is some"
text run at (2,236) width 27: "text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,254) size 79x36
text run at (2,254) width 79: "This is some"
text run at (2,272) width 27: "text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,290) size 79x36
text run at (2,290) width 79: "This is some"
text run at (2,308) width 27: "text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,326) size 79x36
text run at (2,326) width 79: "This is some"
text run at (2,344) width 27: "text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,362) size 79x36
text run at (2,362) width 79: "This is some"
text run at (2,380) width 27: "text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,398) size 79x36
text run at (2,398) width 79: "This is some"
text run at (2,416) width 27: "text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,434) size 79x36
text run at (2,434) width 79: "This is some"
text run at (2,452) width 27: "text."
RenderBR {BR} at (0,0) size 0x0
layer at (116,44) size 204x404 clip at (118,46) size 200x400
RenderBlock {DIV} at (108,36) size 204x404 [border: (2px solid #000000)]
RenderText {TEXT} at (2,2) size 110x18
text run at (2,2) width 110: "This is some text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,20) size 110x18
text run at (2,20) width 110: "This is some text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,38) size 110x18
text run at (2,38) width 110: "This is some text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,56) size 110x18
text run at (2,56) width 110: "This is some text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,74) size 110x18
text run at (2,74) width 110: "This is some text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,92) size 110x18
text run at (2,92) width 110: "This is some text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,110) size 110x18
text run at (2,110) width 110: "This is some text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,128) size 110x18
text run at (2,128) width 110: "This is some text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,146) size 110x18
text run at (2,146) width 110: "This is some text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,164) size 110x18
text run at (2,164) width 110: "This is some text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,182) size 110x18
text run at (2,182) width 110: "This is some text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,200) size 110x18
text run at (2,200) width 110: "This is some text."
RenderBR {BR} at (0,0) size 0x0
RenderText {TEXT} at (2,218) size 110x18
text run at (2,218) width 110: "This is some text."
RenderBR {BR} at (0,0) size 0x0
1.1 WebCore/layout-tests/fast/inline-block/tricky-baseline.html
Index: tricky-baseline.html
===================================================================
<html>
<head>
<style>
.one
{
display: inline-block;
height: 200px;
width:100px;
overflow:auto;
border: 2px solid purple;
}
.two
{
display: inline-block;
height:400px;
width:200px;
overflow:auto;
border:2px solid black;
}
</style>
</head>
<body>
It is not clear what the right behavior is here. The CSS2.1 draft is currently ambiguous about how to handle overflow blocks.<br>
<div class="one">
This is some text.<br>
This is some text.<br>
This is some text.<br>
This is some text.<br>
This is some text.<br>
This is some text.<br>
This is some text.<br>
This is some text.<br>
This is some text.<br>
This is some text.<br>
This is some text.<br>
This is some text.<br>
This is some text.<br>
</div>
<div class="two">
This is some text.<br>
This is some text.<br>
This is some text.<br>
This is some text.<br>
This is some text.<br>
This is some text.<br>
This is some text.<br>
This is some text.<br>
This is some text.<br>
This is some text.<br>
This is some text.<br>
This is some text.<br>
This is some text.<br>
</div>
</body>
</html>
More information about the webkit-changes
mailing list