text run at (0,36) width 326: "pixels of padding on the right side of the box stack. "
text run at (326,36) width 455: "The black box's top should be aligned with the end of the last line in this"
text run at (0,54) width 470: "parargaph and its left side should begin right after the end of this sentence. "
- RenderText {TEXT} at (470,54) size 4x18
- text run at (470,54) width 4: " "
- RenderText {TEXT} at (474,54) size 4x18
- text run at (474,54) width 4: " "
+ RenderText {TEXT} at (0,0) size 0x0
+ RenderText {TEXT} at (0,0) size 0x0
layer at (478,62) size 240x340
RenderBlock (positioned) {SPAN} at (478,62) size 240x340 [border: (20px solid #000000)]
RenderText {TEXT} at (0,0) size 0x0
text run at (14,0) width 770: "The black box's top should be aligned with the end of the last line in this parargaph and its left side should begin right after"
text run at (629,18) width 8: ". "
text run at (637,18) width 147: "the end of this sentence"
- RenderText {TEXT} at (625,18) size 4x18
- text run at (625,18) width 4: " "
+ RenderText {TEXT} at (0,0) size 0x0
layer at (397,96) size 240x340
RenderBlock (positioned) {SPAN} at (397,96) size 240x340 [border: (20px solid #000000)]
RenderText {TEXT} at (0,0) size 0x0
text run at (0,18) width 293: "checking to make sure overflow is done using "
text run at (293,18) width 446: "a containing block model, and that a fixed positioned element inside an"
text run at (0,36) width 353: "absolute positioned element is not considered overflow. "
- RenderText {TEXT} at (353,36) size 4x18
- text run at (353,36) width 4: " "
+ RenderText {TEXT} at (0,0) size 0x0
layer at (8,62) size 100x100
RenderBlock (positioned) {DIV} at (8,62) size 100x100
RenderText {TEXT} at (0,0) size 0x0
text run at (0,18) width 293: "checking to make sure overflow is done using "
text run at (293,18) width 446: "a containing block model, and that a fixed positioned element inside an"
text run at (0,36) width 353: "absolute positioned element is not considered overflow. "
- RenderText {TEXT} at (353,36) size 4x18
- text run at (353,36) width 4: " "
+ RenderText {TEXT} at (0,0) size 0x0
layer at (8,62) size 100x100
RenderBlock (positioned) {DIV} at (8,62) size 100x100
RenderText {TEXT} at (0,0) size 0x0
RenderText {TEXT} at (0,0) size 603x18
text run at (0,0) width 282: "Random tests of some bizarre combinations. "
text run at (282,0) width 321: "H2 should allow a form inside it, but p should not. "
- RenderText {TEXT} at (603,0) size 4x18
- text run at (603,0) width 4: " "
+ RenderText {TEXT} at (0,0) size 0x0
RenderBlock {FORM} at (0,18) size 784x22
RenderSelect {SELECT} at (2,2) size 39x18
RenderText {TEXT} at (0,0) size 0x0
+2004-03-30 David Hyatt <hyatt@apple.com>
+
+ Fix for 3604241, simple space collapsing results in a doubled character. Simplify the ignoring of
+ whitespace and make sure it works across absolutely positioned spans.
+
+ Reviewed by darin
+
+ * khtml/rendering/bidi.cpp:
+ (khtml::RenderBlock::findNextLineBreak):
+
2004-03-30 Darin Adler <darin@apple.com>
Reviewed by Dave.
* This file is part of the html renderer for KDE.
*
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2003 Apple Computer, Inc.
+ * Copyright (C) 2004 Apple Computer, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
// This variable is used only if whitespace isn't set to PRE, and it tells us whether
// or not we are currently ignoring whitespace.
bool ignoringSpaces = false;
+ BidiIterator ignoreStart;
// This variable tracks whether the very last character we saw was a space. We use
// this to detect when we encounter a second space so we know we have to terminate
// a run.
bool currentCharacterIsSpace = false;
RenderObject* trailingSpaceObject = 0;
-
- // The pos of the last whitespace char we saw, not to be confused with the lastSpace
- // variable below, which is really the last breakable char.
- int lastSpacePos = 0;
-
+
BidiIterator lBreak = start;
RenderObject *o = start.obj;
// then start ignoring spaces again.
if (needToSetStaticX || needToSetStaticY) {
trailingSpaceObject = 0;
+ ignoreStart.obj = o;
+ ignoreStart.pos = 0;
if (ignoringSpaces) {
- BidiIterator startMid( 0, o, 0 );
- BidiIterator stopMid ( 0, o, 1 );
- addMidpoint(startMid); // Stop ignoring spaces.
- addMidpoint(stopMid); // Start ignoring again.
+ addMidpoint(ignoreStart); // Stop ignoring spaces.
+ addMidpoint(ignoreStart); // Start ignoring again.
}
+
}
}
} else if (o->isInlineFlow()) {
isLineEmpty = false;
ignoringSpaces = false;
currentCharacterIsSpace = false;
- lastSpacePos = 0;
trailingSpaceObject = 0;
if (o->isListMarker() && o->style()->listStylePosition() == OUTSIDE) {
// Stop ignoring spaces and begin at this
// new point.
ignoringSpaces = false;
- lastSpacePos = 0;
lastSpace = pos; // e.g., "Foo goo", don't add in any of the ignored spaces.
BidiIterator startMid ( 0, o, pos );
addMidpoint(startMid);
}
}
- if (currentCharacterIsSpace && !previousCharacterIsSpace)
- lastSpacePos = pos;
tmpW += t->width(lastSpace, pos - lastSpace, f);
if (!appliedStartWidth) {
tmpW += inlineWidth(o, true, false);
// If we encounter a newline, or if we encounter a
// second space, we need to go ahead and break up this
// run and enter a mode where we start collapsing spaces.
- if (currentCharacterIsSpace && previousCharacterIsSpace){
+ if (currentCharacterIsSpace && previousCharacterIsSpace) {
ignoringSpaces = true;
- }
-
- if (ignoringSpaces) {
+
// We just entered a mode where we are ignoring
// spaces. Create a midpoint to terminate the run
// before the second space.
- BidiIterator endMid ( 0, trailingSpaceObject ? trailingSpaceObject : o, lastSpacePos );
- addMidpoint(endMid);
+ addMidpoint(ignoreStart);
lastSpace = pos;
}
}
// Stop ignoring spaces and begin at this
// new point.
ignoringSpaces = false;
- lastSpacePos = 0;
lastSpace = pos; // e.g., "Foo goo", don't add in any of the ignored spaces.
BidiIterator startMid ( 0, o, pos );
addMidpoint(startMid);
}
+
+ if (currentCharacterIsSpace && !previousCharacterIsSpace) {
+ ignoreStart.obj = o;
+ ignoreStart.pos = pos;
+ }
if (!isPre && currentCharacterIsSpace && !ignoringSpaces)
trailingSpaceObject = o;