Commit dfd8dd58 authored by mitz@apple.com's avatar mitz@apple.com

WebCore:

        Reviewed by Oliver Hunt.

        - fix https://bugs.webkit.org/show_bug.cgi?id=18088
          <rdar://problem/6036232> white-space:nowrap; float:left; causing the misalignment issue

        Test: fast/block/basic/min-pref-width-nowrap-floats.html

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::calcInlinePrefWidths): Fixed a case where a
        float's width was added to the minimum preferred widths instead of just
        acting as a lower bound on the minimum preferred width (since the float
        can always be pushed down to be the only thing on the line).

LayoutTests:

        Reviewed by Oliver Hunt.

        - test for https://bugs.webkit.org/show_bug.cgi?id=18088
          <rdar://problem/6036232> white-space:nowrap; float:left; causing the misalignment issue

        * fast/block/basic/min-pref-width-nowrap-floats.html: Added.
        * platform/mac/fast/block/basic/min-pref-width-nowrap-floats-expected.checksum: Added.
        * platform/mac/fast/block/basic/min-pref-width-nowrap-floats-expected.png: Added.
        * platform/mac/fast/block/basic/min-pref-width-nowrap-floats-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8c272a8f
2008-07-12 Dan Bernstein <mitz@apple.com>
Reviewed by Oliver Hunt.
- test for https://bugs.webkit.org/show_bug.cgi?id=18088
<rdar://problem/6036232> white-space:nowrap; float:left; causing the misalignment issue
* fast/block/basic/min-pref-width-nowrap-floats.html: Added.
* platform/mac/fast/block/basic/min-pref-width-nowrap-floats-expected.checksum: Added.
* platform/mac/fast/block/basic/min-pref-width-nowrap-floats-expected.png: Added.
* platform/mac/fast/block/basic/min-pref-width-nowrap-floats-expected.txt: Added.
2008-07-11 Sam Weinig <sam@webkit.org>
Reviewed by Mark Rowe.
<title>Test for rdar://problem/6036232 https://bugs.webkit.org/show_bug.cgi?id=18088</title>
<style>
span { margin-left: 4px; float: left; white-space: nowrap; color: blue; }
</style>
<div style="position: relative; width: 0; height: 96px;">
<div style="background-color: lightblue; position: absolute; width: auto; top: 0; left: 0; font-family: Ahem;">
<span>float</span>
<span>floa</span>
word
<span>flo</span>
<span>fl</span>
</div>
</div>
<div style="position: relative; width: 0; height: 112px;">
<div style="background-color: lightblue; position: absolute; width: auto; top: 0; left: 0; font-family: Ahem;">
<span>float</span>
<span>floa</span>
longer word
<span>flo</span>
<span>fl</span>
</div>
</div>
0a22aaca78fab77933ef926a8690462f
\ No newline at end of file
layer at (0,0) size 800x600
RenderView 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
layer at (8,8) size 84x80
RenderBlock (positioned) {DIV} at (0,0) size 84x80 [bgcolor=#ADD8E6]
RenderBlock (floating) {SPAN} at (4,0) size 80x16 [color=#0000FF]
RenderText {#text} at (0,0) size 80x16
text run at (0,0) width 80: "float"
RenderBlock (floating) {SPAN} at (4,16) size 64x16 [color=#0000FF]
RenderText {#text} at (0,0) size 64x16
text run at (0,0) width 64: "floa"
RenderText {#text} at (0,32) size 64x16
text run at (0,32) width 64: "word"
RenderBlock (floating) {SPAN} at (4,48) size 48x16 [color=#0000FF]
RenderText {#text} at (0,0) size 48x16
text run at (0,0) width 48: "flo"
RenderText {#text} at (0,0) size 0x0
RenderBlock (floating) {SPAN} at (4,64) size 32x16 [color=#0000FF]
RenderText {#text} at (0,0) size 32x16
text run at (0,0) width 32: "fl"
RenderText {#text} at (0,0) size 0x0
layer at (8,104) size 96x80
RenderBlock (positioned) {DIV} at (0,0) size 96x80 [bgcolor=#ADD8E6]
RenderBlock (floating) {SPAN} at (4,0) size 80x16 [color=#0000FF]
RenderText {#text} at (0,0) size 80x16
text run at (0,0) width 80: "float"
RenderBlock (floating) {SPAN} at (4,16) size 64x16 [color=#0000FF]
RenderText {#text} at (0,0) size 64x16
text run at (0,0) width 64: "floa"
RenderText {#text} at (0,32) size 96x32
text run at (0,32) width 96: "longer"
text run at (0,48) width 64: "word"
RenderBlock (floating) {SPAN} at (4,64) size 48x16 [color=#0000FF]
RenderText {#text} at (0,0) size 48x16
text run at (0,0) width 48: "flo"
RenderText {#text} at (0,0) size 0x0
RenderBlock (floating) {SPAN} at (56,64) size 32x16 [color=#0000FF]
RenderText {#text} at (0,0) size 32x16
text run at (0,0) width 32: "fl"
RenderText {#text} at (0,0) size 0x0
2008-07-12 Dan Bernstein <mitz@apple.com>
Reviewed by Oliver Hunt.
- fix https://bugs.webkit.org/show_bug.cgi?id=18088
<rdar://problem/6036232> white-space:nowrap; float:left; causing the misalignment issue
Test: fast/block/basic/min-pref-width-nowrap-floats.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::calcInlinePrefWidths): Fixed a case where a
float's width was added to the minimum preferred widths instead of just
acting as a lower bound on the minimum preferred width (since the float
can always be pushed down to be the only thing on the line).
2008-07-12 David D. Kilzer <ddkilzer@webkit.org>
Bug 13067: Manually adding #hash to URL reloads entire page instead of jumping to #hash location in cached page
......@@ -3819,14 +3819,14 @@ void RenderBlock::calcInlinePrefWidths()
// Add our width to the max.
inlineMax += childMax;
if (!autoWrap || !canBreakReplacedElement)
inlineMin += childMin;
else
inlineMin = childMin;
if (autoWrap && canBreakReplacedElement) {
if (!autoWrap || !canBreakReplacedElement) {
if (child->isFloating())
m_minPrefWidth = max(childMin, m_minPrefWidth);
else
inlineMin += childMin;
} else {
// Now check our line.
m_minPrefWidth = max(inlineMin, m_minPrefWidth);
m_minPrefWidth = max(childMin, m_minPrefWidth);
// Now start a new line.
inlineMin = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment