Commit 89377f1a authored by hyatt's avatar hyatt
Browse files

Two fixes. Bugs are 3121024, which had to do with handling

	escaped characters in the CSS content property, and
	bug 3127375 (44854 in bugs.kde.org), which had to do with
	making sure table cells relayout properly when images load
	async.

        Reviewed by darin and john

        * khtml/css/cssparser.cpp:
        (StyleBaseImpl::parseContent):
        (StyleBaseImpl::isHexadecimal):
        * khtml/css/cssparser.h:
        * khtml/rendering/bidi.cpp:
        (RenderFlow::layoutInlineChildren):
        * khtml/rendering/render_flow.cpp:
        (RenderFlow::layout):
        * khtml/rendering/render_flow.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3039 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bdd26c11
2002-12-13 David Hyatt <hyatt@apple.com>
Two fixes. Bugs are 3121024, which had to do with handling
escaped characters in the CSS content property, and
bug 3127375 (44854 in bugs.kde.org), which had to do with
making sure table cells relayout properly when images load
async.
Reviewed by darin and john
* khtml/css/cssparser.cpp:
(StyleBaseImpl::parseContent):
(StyleBaseImpl::isHexadecimal):
* khtml/css/cssparser.h:
* khtml/rendering/bidi.cpp:
(RenderFlow::layoutInlineChildren):
* khtml/rendering/render_flow.cpp:
(RenderFlow::layout):
* khtml/rendering/render_flow.h:
2002-12-13 Darin Adler <darin@apple.com>
Reviewed by Trey.
......
2002-12-13 David Hyatt <hyatt@apple.com>
Two fixes. Bugs are 3121024, which had to do with handling
escaped characters in the CSS content property, and
bug 3127375 (44854 in bugs.kde.org), which had to do with
making sure table cells relayout properly when images load
async.
Reviewed by darin and john
* khtml/css/cssparser.cpp:
(StyleBaseImpl::parseContent):
(StyleBaseImpl::isHexadecimal):
* khtml/css/cssparser.h:
* khtml/rendering/bidi.cpp:
(RenderFlow::layoutInlineChildren):
* khtml/rendering/render_flow.cpp:
(RenderFlow::layout):
* khtml/rendering/render_flow.h:
2002-12-13 Darin Adler <darin@apple.com>
Reviewed by Trey.
......
......@@ -2420,14 +2420,38 @@ CSSValueImpl* StyleBaseImpl::parseContent(const QChar *curP, const QChar *endP)
QString strstr;
for (int i = 0; i < l; ++i) {
if (i < l - 1 && str[i] == '\\') {
if (str[i+1] == 'a')
strstr += '\n';
else
strstr += str[i+1];
++i;
continue;
QChar nextChar = str[i+1];
if (nextChar == '\n')
i++;
else if ( nextChar == '\r' ) {
i++;
if ( str[i+1] == '\n' )
i++;
}
else if ( isHexadecimal( nextChar ) )
{
int initial=i;
QString hex;
bool ok;
while ( i-initial<6 && i<l-1 && isHexadecimal( nextChar ) ) { hex += nextChar;
i++;
nextChar = str[i+1];
}
strstr += QChar( hex.toInt(&ok, 16) );
if ( i<l-1 && nextChar.isSpace() ) {
i++;
if ( nextChar == '\r' && str[i+1] == '\n' ) i++;
}
}
else {
++i;
strstr += nextChar;
}
}
strstr += str[i];
else if (str[i] != '\'' && str[i] != '"')
strstr += str[i];
}
parsedValue = new CSSPrimitiveValueImpl(DOMString(strstr), CSSPrimitiveValue::CSS_STRING);
}
......@@ -2441,6 +2465,10 @@ CSSValueImpl* StyleBaseImpl::parseContent(const QChar *curP, const QChar *endP)
return values;
}
bool StyleBaseImpl::isHexadecimal( const QChar &c )
{
return ( c >= '0' && c <= '9' ) || ( c >= 'a' && c <= 'f' ) || ( c >= 'A' && c <= 'F' );
}
QPtrList<QChar> StyleBaseImpl::splitShorthandProperties(const QChar *curP, const QChar *endP)
{
......
......@@ -167,6 +167,7 @@ public:
void setParsedValue(int propId, const CSSValueImpl *parsedValue);
void setParsedValue(int propId, const CSSValueImpl *parsedValue,
bool important, bool nonCSSHint, QPtrList<CSSProperty> *propList);
bool isHexadecimal( const QChar &c );
QPtrList<QChar> splitShorthandProperties(const QChar *curP, const QChar *endP);
bool parseBackgroundPosition(const QChar *curP, const QChar *&nextP, const QChar *endP);
......
......@@ -988,7 +988,7 @@ static void deleteMidpoints(RenderArena* arena, QPtrList<BidiIterator>* midpoint
}
}
void RenderFlow::layoutInlineChildren()
void RenderFlow::layoutInlineChildren(bool relayoutChildren)
{
m_overflowHeight = 0;
......@@ -1016,7 +1016,7 @@ void RenderFlow::layoutInlineChildren()
while ( o ) {
if(o->isReplaced() || o->isFloating() || o->isPositioned()) {
//kdDebug(6041) << "layouting replaced or floating child" << endl;
if (o->isReplaced() && (o->style()->width().isPercent() || o->style()->height().isPercent()))
if (relayoutChildren || o->style()->width().isPercent() || o->style()->height().isPercent())
o->setLayouted(false);
if( !o->layouted() )
o->layout();
......
......@@ -315,7 +315,7 @@ void RenderFlow::layout()
if(childrenInline()) {
// ### make bidi resumeable so that we can get rid of this ugly hack
if (!m_blockBidi)
layoutInlineChildren();
layoutInlineChildren( relayoutChildren );
}
else
layoutBlockChildren( relayoutChildren );
......
......@@ -127,7 +127,7 @@ protected:
virtual void newLine();
void layoutBlockChildren( bool relayoutChildren );
void layoutInlineChildren();
void layoutInlineChildren( bool relayoutChildren );
void layoutSpecialObjects( bool relayoutChildren );
public:
......
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