[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

hyatt hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:46:23 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 851816beea41780bb8e6ddc5e61c886bec47a5a1
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jul 8 07:54:17 2003 +0000

    	Implementation of inline-block and a prototype of the XUL
    	box model.
    
    	Fix for min-font size issues that prevented us from having
    	a min font size.  The primary fix is to store the original
    	specified CSS size as a separate value (distinct from the
    	computed rendering size).  This allows that size to be computed
    	without the application of integer rounding or zoom factors
    	or minimum font size corrections.
    
    	Fix for table crasher, bug #3296552.
    
            Reviewed by john (table crasher, inline-block, XUL box model) and
    	darin (font size fixes).
    
            * WebCore.pbproj/project.pbxproj:
            * khtml/css/css_valueimpl.cpp:
            (CSSPrimitiveValueImpl::computeLength):
            (CSSPrimitiveValueImpl::computeLengthFloat):
            * khtml/css/css_valueimpl.h:
            * khtml/css/cssparser.cpp:
            (CSSParser::parseValue):
            * khtml/css/cssproperties.c:
            (hash_prop):
            (findProp):
            * khtml/css/cssproperties.h:
            * khtml/css/cssproperties.in:
            * khtml/css/cssstyleselector.cpp:
            * khtml/css/cssstyleselector.h:
            * khtml/css/cssvalues.c:
            (hash_val):
            (findValue):
            * khtml/css/cssvalues.h:
            * khtml/css/cssvalues.in:
            * khtml/khtml_part.cpp:
            (KHTMLPart::setZoomFactor):
            * khtml/khtmlview.cpp:
            (KHTMLView::print):
            * khtml/rendering/bidi.cpp:
            * khtml/rendering/font.cpp:
            (Font::update):
            * khtml/rendering/font.h:
            * khtml/rendering/render_block.cpp:
            * khtml/rendering/render_block.h:
            * khtml/rendering/render_box.cpp:
            (RenderBox::setStyle):
            (RenderBox::contentHeight):
            (RenderBox::containingBlockWidth):
            (RenderBox::calcWidth):
            (RenderBox::calcHeight):
            * khtml/rendering/render_container.cpp:
            (RenderContainer::addChild):
            * khtml/rendering/render_flexbox.cpp: Added.
            * khtml/rendering/render_flexbox.h: Added.
            * khtml/rendering/render_object.cpp:
            (RenderObject::createObject):
            (RenderObject::sizesToMaxWidth):
            (RenderObject::handleDynamicFloatPositionChange):
            * khtml/rendering/render_object.h:
            * khtml/rendering/render_replaced.cpp:
            (RenderReplaced::paint):
            * khtml/rendering/render_style.cpp:
            (StyleFlexibleBoxData::StyleFlexibleBoxData):
            (StyleFlexibleBoxData::operator==):
            (RenderStyle::RenderStyle):
            (RenderStyle::operator==):
            (RenderStyle::diff):
            * khtml/rendering/render_style.h:
            * khtml/rendering/table_layout.cpp:
            (FixedTableLayout::calcWidthArray):
            * khtml/xml/dom_docimpl.cpp:
            (DocumentImpl::recalcStyle):
            (DocumentImpl::attach):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4601 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 2d99201..c38c72a 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,79 @@
+2003-07-08  Dave Hyatt  <hyatt at apple.com>
+
+	Implementation of inline-block and a prototype of the XUL
+	box model.
+
+	Fix for min-font size issues that prevented us from having
+	a min font size.  The primary fix is to store the original
+	specified CSS size as a separate value (distinct from the
+	computed rendering size).  This allows that size to be computed
+	without the application of integer rounding or zoom factors
+	or minimum font size corrections.
+
+	Fix for table crasher, bug #3296552.
+
+        Reviewed by john (table crasher, inline-block, XUL box model) and
+	darin (font size fixes).
+
+        * WebCore.pbproj/project.pbxproj:
+        * khtml/css/css_valueimpl.cpp:
+        (CSSPrimitiveValueImpl::computeLength):
+        (CSSPrimitiveValueImpl::computeLengthFloat):
+        * khtml/css/css_valueimpl.h:
+        * khtml/css/cssparser.cpp:
+        (CSSParser::parseValue):
+        * khtml/css/cssproperties.c:
+        (hash_prop):
+        (findProp):
+        * khtml/css/cssproperties.h:
+        * khtml/css/cssproperties.in:
+        * khtml/css/cssstyleselector.cpp:
+        * khtml/css/cssstyleselector.h:
+        * khtml/css/cssvalues.c:
+        (hash_val):
+        (findValue):
+        * khtml/css/cssvalues.h:
+        * khtml/css/cssvalues.in:
+        * khtml/khtml_part.cpp:
+        (KHTMLPart::setZoomFactor):
+        * khtml/khtmlview.cpp:
+        (KHTMLView::print):
+        * khtml/rendering/bidi.cpp:
+        * khtml/rendering/font.cpp:
+        (Font::update):
+        * khtml/rendering/font.h:
+        * khtml/rendering/render_block.cpp:
+        * khtml/rendering/render_block.h:
+        * khtml/rendering/render_box.cpp:
+        (RenderBox::setStyle):
+        (RenderBox::contentHeight):
+        (RenderBox::containingBlockWidth):
+        (RenderBox::calcWidth):
+        (RenderBox::calcHeight):
+        * khtml/rendering/render_container.cpp:
+        (RenderContainer::addChild):
+        * khtml/rendering/render_flexbox.cpp: Added.
+        * khtml/rendering/render_flexbox.h: Added.
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::createObject):
+        (RenderObject::sizesToMaxWidth):
+        (RenderObject::handleDynamicFloatPositionChange):
+        * khtml/rendering/render_object.h:
+        * khtml/rendering/render_replaced.cpp:
+        (RenderReplaced::paint):
+        * khtml/rendering/render_style.cpp:
+        (StyleFlexibleBoxData::StyleFlexibleBoxData):
+        (StyleFlexibleBoxData::operator==):
+        (RenderStyle::RenderStyle):
+        (RenderStyle::operator==):
+        (RenderStyle::diff):
+        * khtml/rendering/render_style.h:
+        * khtml/rendering/table_layout.cpp:
+        (FixedTableLayout::calcWidthArray):
+        * khtml/xml/dom_docimpl.cpp:
+        (DocumentImpl::recalcStyle):
+        (DocumentImpl::attach):
+
 2003-07-07  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by John.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 2d99201..c38c72a 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,79 @@
+2003-07-08  Dave Hyatt  <hyatt at apple.com>
+
+	Implementation of inline-block and a prototype of the XUL
+	box model.
+
+	Fix for min-font size issues that prevented us from having
+	a min font size.  The primary fix is to store the original
+	specified CSS size as a separate value (distinct from the
+	computed rendering size).  This allows that size to be computed
+	without the application of integer rounding or zoom factors
+	or minimum font size corrections.
+
+	Fix for table crasher, bug #3296552.
+
+        Reviewed by john (table crasher, inline-block, XUL box model) and
+	darin (font size fixes).
+
+        * WebCore.pbproj/project.pbxproj:
+        * khtml/css/css_valueimpl.cpp:
+        (CSSPrimitiveValueImpl::computeLength):
+        (CSSPrimitiveValueImpl::computeLengthFloat):
+        * khtml/css/css_valueimpl.h:
+        * khtml/css/cssparser.cpp:
+        (CSSParser::parseValue):
+        * khtml/css/cssproperties.c:
+        (hash_prop):
+        (findProp):
+        * khtml/css/cssproperties.h:
+        * khtml/css/cssproperties.in:
+        * khtml/css/cssstyleselector.cpp:
+        * khtml/css/cssstyleselector.h:
+        * khtml/css/cssvalues.c:
+        (hash_val):
+        (findValue):
+        * khtml/css/cssvalues.h:
+        * khtml/css/cssvalues.in:
+        * khtml/khtml_part.cpp:
+        (KHTMLPart::setZoomFactor):
+        * khtml/khtmlview.cpp:
+        (KHTMLView::print):
+        * khtml/rendering/bidi.cpp:
+        * khtml/rendering/font.cpp:
+        (Font::update):
+        * khtml/rendering/font.h:
+        * khtml/rendering/render_block.cpp:
+        * khtml/rendering/render_block.h:
+        * khtml/rendering/render_box.cpp:
+        (RenderBox::setStyle):
+        (RenderBox::contentHeight):
+        (RenderBox::containingBlockWidth):
+        (RenderBox::calcWidth):
+        (RenderBox::calcHeight):
+        * khtml/rendering/render_container.cpp:
+        (RenderContainer::addChild):
+        * khtml/rendering/render_flexbox.cpp: Added.
+        * khtml/rendering/render_flexbox.h: Added.
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::createObject):
+        (RenderObject::sizesToMaxWidth):
+        (RenderObject::handleDynamicFloatPositionChange):
+        * khtml/rendering/render_object.h:
+        * khtml/rendering/render_replaced.cpp:
+        (RenderReplaced::paint):
+        * khtml/rendering/render_style.cpp:
+        (StyleFlexibleBoxData::StyleFlexibleBoxData):
+        (StyleFlexibleBoxData::operator==):
+        (RenderStyle::RenderStyle):
+        (RenderStyle::operator==):
+        (RenderStyle::diff):
+        * khtml/rendering/render_style.h:
+        * khtml/rendering/table_layout.cpp:
+        (FixedTableLayout::calcWidthArray):
+        * khtml/xml/dom_docimpl.cpp:
+        (DocumentImpl::recalcStyle):
+        (DocumentImpl::attach):
+
 2003-07-07  Maciej Stachowiak  <mjs at apple.com>
 
         Reviewed by John.
diff --git a/WebCore/WebCore.pbproj/project.pbxproj b/WebCore/WebCore.pbproj/project.pbxproj
index 24d889f..6337e95 100644
--- a/WebCore/WebCore.pbproj/project.pbxproj
+++ b/WebCore/WebCore.pbproj/project.pbxproj
@@ -506,6 +506,7 @@
 				F587871502DE3B8601EA4122,
 				BC7B2AFA0450824100A8000F,
 				BC80A6960468B78100DBCC9C,
+				BC32C2EF048BF95C00A8000B,
 			);
 			isa = PBXHeadersBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -753,6 +754,7 @@
 				9325AABA041D0E9A00A9CAC5,
 				BC7B2AFB0450824100A8000F,
 				BC80A6950468B78100DBCC9C,
+				BC32C2EE048BF95C00A8000B,
 			);
 			isa = PBXSourcesBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -1600,6 +1602,30 @@
 //BC2
 //BC3
 //BC4
+		BC32C2EC048BF95C00A8000B = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			path = render_flexbox.cpp;
+			refType = 4;
+		};
+		BC32C2ED048BF95C00A8000B = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			path = render_flexbox.h;
+			refType = 4;
+		};
+		BC32C2EE048BF95C00A8000B = {
+			fileRef = BC32C2EC048BF95C00A8000B;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		BC32C2EF048BF95C00A8000B = {
+			fileRef = BC32C2ED048BF95C00A8000B;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
 		BC7294F703804B3C00A80166 = {
 			expectedFileType = sourcecode.cpp.cpp;
 			fileEncoding = 30;
@@ -4932,6 +4958,8 @@
 				BC7294FC03804B5600A80166,
 				BCF0192403D3802200B2D04D,
 				BCF0192503D3802200B2D04D,
+				BC32C2EC048BF95C00A8000B,
+				BC32C2ED048BF95C00A8000B,
 			);
 			isa = PBXGroup;
 			path = rendering;
diff --git a/WebCore/khtml/css/css_valueimpl.cpp b/WebCore/khtml/css/css_valueimpl.cpp
index 02d8301..1c26b00 100644
--- a/WebCore/khtml/css/css_valueimpl.cpp
+++ b/WebCore/khtml/css/css_valueimpl.cpp
@@ -30,6 +30,7 @@
 #include "css/cssparser.h"
 #include "css/cssproperties.h"
 #include "css/cssvalues.h"
+#include "css/cssstyleselector.h"
 
 #include "xml/dom_stringimpl.h"
 #include "xml/dom_docimpl.h"
@@ -48,6 +49,7 @@
 extern DOM::DOMString getPropertyName(unsigned short id);
 
 using khtml::FontDef;
+using khtml::CSSStyleSelector;
 
 using namespace DOM;
 
@@ -498,9 +500,10 @@ void CSSPrimitiveValueImpl::cleanup()
     m_type = 0;
 }
 
-int CSSPrimitiveValueImpl::computeLength( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics )
+int CSSPrimitiveValueImpl::computeLength( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics,
+                                          khtml::CSSStyleSelector* selector )
 {
-    double result = computeLengthFloat( style, devMetrics );
+    double result = computeLengthFloat( style, devMetrics, selector );
 #if APPLE_CHANGES
     // This conversion is imprecise, often resulting in values of, e.g., 44.99998.  We
     // need to go ahead and round if we're really close to the next integer value.
@@ -508,12 +511,13 @@ int CSSPrimitiveValueImpl::computeLength( khtml::RenderStyle *style, QPaintDevic
 #else
     int intResult = (int)result;
 #endif
-    return intResult;
+    return intResult;    
 }
 
-int CSSPrimitiveValueImpl::computeLength( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics, double multiplier )
+int CSSPrimitiveValueImpl::computeLength( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics, 
+                                          khtml::CSSStyleSelector* selector, double multiplier )
 {
-    double result = multiplier * computeLengthFloat( style, devMetrics );
+    double result = multiplier * computeLengthFloat( style, devMetrics, selector );
 #if APPLE_CHANGES
     // This conversion is imprecise, often resulting in values of, e.g., 44.99998.  We
     // need to go ahead and round if we're really close to the next integer value.
@@ -521,10 +525,11 @@ int CSSPrimitiveValueImpl::computeLength( khtml::RenderStyle *style, QPaintDevic
 #else
     int intResult = (int)result;
 #endif
-    return intResult;
+    return intResult;    
 }
 
-double CSSPrimitiveValueImpl::computeLengthFloat( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics )
+double CSSPrimitiveValueImpl::computeLengthFloat( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics,
+                                                  khtml::CSSStyleSelector* selector, bool applyZoomFactor )
 {
     unsigned short type = primitiveType();
 
@@ -538,9 +543,12 @@ double CSSPrimitiveValueImpl::computeLengthFloat( khtml::RenderStyle *style, QPa
     switch(type)
     {
     case CSSPrimitiveValue::CSS_EMS:
-        factor = style->htmlFont().getFontDef().floatSize();
+        factor = style->htmlFont().getFontDef().specifiedSize;
         break;
     case CSSPrimitiveValue::CSS_EXS:
+        // FIXME: We have a bug right now where the zoom will be applied multiple times to EX units.
+        // We really need to compute EX using fontMetrics for the original specifiedSize and not use
+        // our actual constructed rendering font.
 	{
         QFontMetrics fm = style->fontMetrics();
 #if APPLE_CHANGES
@@ -573,7 +581,13 @@ double CSSPrimitiveValueImpl::computeLengthFloat( khtml::RenderStyle *style, QPa
         return -1;
     }
 
-    return getFloatValue(type)*factor;
+    float result = getFloatValue(type)*factor;
+    // FIXME: Will need to do this for EX units eventually as well, once they're patched
+    // to use specifiedSize and not a computed font size above.
+    // Need to adjust for the zoom and for the minimum font size.    
+    if (type == CSSPrimitiveValue::CSS_EMS && selector && applyZoomFactor)
+        selector->getComputedSizeFromSpecifiedSize(style->htmlFont().getFontDef().isAbsoluteSize, result);
+    return result;
 }
 
 void CSSPrimitiveValueImpl::setFloatValue( unsigned short unitType, double floatValue, int &exceptioncode )
diff --git a/WebCore/khtml/css/css_valueimpl.h b/WebCore/khtml/css/css_valueimpl.h
index fca6fd1..d790636 100644
--- a/WebCore/khtml/css/css_valueimpl.h
+++ b/WebCore/khtml/css/css_valueimpl.h
@@ -35,6 +35,7 @@
 namespace khtml {
     class RenderStyle;
     class CachedImage;
+    class CSSStyleSelector;
 }
 
 namespace DOM {
@@ -44,7 +45,6 @@ class CSSValueImpl;
 class NodeImpl;
 class CounterImpl;
 
-
 class CSSStyleDeclarationImpl : public StyleBaseImpl
 {
 public:
@@ -177,9 +177,12 @@ public:
      * this is screen/printer dependent, so we probably need a config option for this,
      * and some tool to calibrate.
      */
-    int computeLength( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics );
-    int computeLength( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics, double multiplier );
-    double computeLengthFloat( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics );
+    int computeLength( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics,
+                       khtml::CSSStyleSelector* selector );
+    int computeLength( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics, 
+                       khtml::CSSStyleSelector* selector, double multiplier );
+    double computeLengthFloat( khtml::RenderStyle *style, QPaintDeviceMetrics *devMetrics,
+                               khtml::CSSStyleSelector* selector, bool applyZoomFactor = true );
 
     // use with care!!!
     void setPrimitiveType(unsigned short type) { m_type = type; }
diff --git a/WebCore/khtml/css/cssparser.cpp b/WebCore/khtml/css/cssparser.cpp
index 2f51aa0..6eff8d2 100644
--- a/WebCore/khtml/css/cssparser.cpp
+++ b/WebCore/khtml/css/cssparser.cpp
@@ -526,8 +526,8 @@ bool CSSParser::parseValue( int propId, bool important )
     case CSS_PROP_DISPLAY:
         // inline | block | list-item | run-in | inline-block | -konq-ruler | table |
         // inline-table | table-row-group | table-header-group | table-footer-group | table-row |
-        // table-column-group | table-column | table-cell | table-caption | none | inherit
-	if ((id >= CSS_VAL_INLINE && id <= CSS_VAL_TABLE_CAPTION) || id == CSS_VAL_NONE)
+        // table-column-group | table-column | table-cell | table-caption | box | inline-box | none | inherit
+	if ((id >= CSS_VAL_INLINE && id <= CSS_VAL_INLINE_BOX) || id == CSS_VAL_NONE)
 	    valid_primitive = true;
 	break;
 
@@ -971,6 +971,38 @@ bool CSSParser::parseValue( int propId, bool important )
 	    valid_primitive = true;
 	break;
 
+    /* CSS3 properties */
+    case CSS_PROP_BOX_ALIGN:
+        if (id == CSS_VAL_STRETCH || id == CSS_VAL_START || id == CSS_VAL_END ||
+            id == CSS_VAL_CENTER || id == CSS_VAL_BASELINE)
+            valid_primitive = true;
+        break;
+    case CSS_PROP_BOX_DIRECTION:
+        if (id == CSS_VAL_NORMAL || id == CSS_VAL_REVERSE)
+            valid_primitive = true;
+        break;
+    case CSS_PROP_BOX_LINES:
+        if (id == CSS_VAL_SINGLE || id == CSS_VAL_MULTIPLE)
+            valid_primitive = true;
+        break;
+    case CSS_PROP_BOX_ORIENT:
+        if (id == CSS_VAL_HORIZONTAL || id == CSS_VAL_VERTICAL ||
+            id == CSS_VAL_INLINE_AXIS || id == CSS_VAL_BLOCK_AXIS)
+            valid_primitive = true;
+        break;
+    case CSS_PROP_BOX_PACK:
+        if (id == CSS_VAL_START || id == CSS_VAL_END ||
+            id == CSS_VAL_CENTER || id == CSS_VAL_JUSTIFY)
+            valid_primitive = true;
+        break;
+    case CSS_PROP_BOX_FLEX:
+        valid_primitive = validUnit(value, FNumber, strict);
+        break;
+    case CSS_PROP_BOX_FLEX_GROUP:
+    case CSS_PROP_BOX_ORDINAL_GROUP:
+        valid_primitive = validUnit(value, FInteger|FNonNeg, true);
+        break;
+    
 	/* shorthand properties */
     case CSS_PROP_BACKGROUND:
     	// ['background-color' || 'background-image' ||'background-repeat' ||
diff --git a/WebCore/khtml/css/cssproperties.c b/WebCore/khtml/css/cssproperties.c
index 73b4a34..11b06e2 100644
--- a/WebCore/khtml/css/cssproperties.c
+++ b/WebCore/khtml/css/cssproperties.c
@@ -7,7 +7,7 @@ struct props {
     const char *name;
     int id;
 };
-/* maximum key range = 742, duplicates = 0 */
+/* maximum key range = 894, duplicates = 0 */
 
 #ifdef __GNUC__
 __inline
@@ -21,32 +21,32 @@ hash_prop (register const char *str, register unsigned int len)
 {
   static const unsigned short asso_values[] =
     {
-      747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747,   0, 747, 747, 747, 747,
-      747,   0, 747, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747, 747, 747,  10,  40,   0,
-        0,   0,  30,   0,  15,   0,   5, 150,   0,  55,
-       45,   0,  80,   5,   0, 145,   0,   5,  10, 135,
-      205,  75,   0, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747, 747, 747, 747, 747, 747,
-      747, 747, 747, 747, 747, 747
+      897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897,   0, 897, 897, 897, 897,
+      897,   5, 897, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897, 897, 897,  15, 230,   0,
+        0,   0,  75,   0,  45,   0,  10,  65,   0,  70,
+      120,   0,   0,  10,   0, 130,   0,  35,   0, 145,
+       35, 160,  10, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
+      897, 897, 897, 897, 897, 897
     };
   register int hval = len;
 
@@ -118,206 +118,229 @@ findProp (register const char *str, register unsigned int len)
 {
   enum
     {
-      TOTAL_KEYWORDS = 112,
+      TOTAL_KEYWORDS = 120,
       MIN_WORD_LENGTH = 3,
       MAX_WORD_LENGTH = 26,
-      MIN_HASH_VALUE = 5,
-      MAX_HASH_VALUE = 746
+      MIN_HASH_VALUE = 3,
+      MAX_HASH_VALUE = 896
     };
 
   static const struct props wordlist_prop[] =
     {
+      {"top", CSS_PROP_TOP},
+      {"clip", CSS_PROP_CLIP},
       {"color", CSS_PROP_COLOR},
+      {"page", CSS_PROP_PAGE},
       {"clear", CSS_PROP_CLEAR},
       {"right", CSS_PROP_RIGHT},
       {"left", CSS_PROP_LEFT},
-      {"height", CSS_PROP_HEIGHT},
       {"float", CSS_PROP_FLOAT},
-      {"border", CSS_PROP_BORDER},
-      {"border-color", CSS_PROP_BORDER_COLOR},
+      {"height", CSS_PROP_HEIGHT},
       {"direction", CSS_PROP_DIRECTION},
+      {"padding", CSS_PROP_PADDING},
+      {"size", CSS_PROP_SIZE},
+      {"padding-top", CSS_PROP_PADDING_TOP},
       {"outline", CSS_PROP_OUTLINE},
+      {"vertical-align", CSS_PROP_VERTICAL_ALIGN},
       {"outline-color", CSS_PROP_OUTLINE_COLOR},
-      {"border-right", CSS_PROP_BORDER_RIGHT},
-      {"border-right-color", CSS_PROP_BORDER_RIGHT_COLOR},
+      {"cursor", CSS_PROP_CURSOR},
+      {"z-index", CSS_PROP_Z_INDEX},
+      {"text-align", CSS_PROP_TEXT_ALIGN},
+      {"quotes", CSS_PROP_QUOTES},
+      {"text-decoration", CSS_PROP_TEXT_DECORATION},
+      {"text-decoration-color", CSS_PROP_TEXT_DECORATION_COLOR},
+      {"padding-right", CSS_PROP_PADDING_RIGHT},
+      {"width", CSS_PROP_WIDTH},
       {"font", CSS_PROP_FONT},
-      {"border-left", CSS_PROP_BORDER_LEFT},
-      {"top", CSS_PROP_TOP},
-      {"clip", CSS_PROP_CLIP},
-      {"line-height", CSS_PROP_LINE_HEIGHT},
-      {"border-left-color", CSS_PROP_BORDER_LEFT_COLOR},
-      {"vertical-align", CSS_PROP_VERTICAL_ALIGN},
-      {"page", CSS_PROP_PAGE},
-      {"content", CSS_PROP_CONTENT},
-      {"bottom", CSS_PROP_BOTTOM},
-      {"unicode-bidi", CSS_PROP_UNICODE_BIDI},
       {"margin", CSS_PROP_MARGIN},
+      {"margin-top", CSS_PROP_MARGIN_TOP},
+      {"max-height", CSS_PROP_MAX_HEIGHT},
+      {"line-height", CSS_PROP_LINE_HEIGHT},
+      {"padding-left", CSS_PROP_PADDING_LEFT},
+      {"overflow", CSS_PROP_OVERFLOW},
+      {"border", CSS_PROP_BORDER},
       {"border-top", CSS_PROP_BORDER_TOP},
+      {"border-color", CSS_PROP_BORDER_COLOR},
       {"border-top-color", CSS_PROP_BORDER_TOP_COLOR},
+      {"content", CSS_PROP_CONTENT},
+      {"position", CSS_PROP_POSITION},
       {"margin-right", CSS_PROP_MARGIN_RIGHT},
+      {"caption-side", CSS_PROP_CAPTION_SIDE},
+      {"letter-spacing", CSS_PROP_LETTER_SPACING},
+      {"text-indent", CSS_PROP_TEXT_INDENT},
+      {"border-right", CSS_PROP_BORDER_RIGHT},
       {"min-height", CSS_PROP_MIN_HEIGHT},
-      {"padding", CSS_PROP_PADDING},
-      {"border-bottom", CSS_PROP_BORDER_BOTTOM},
-      {"size", CSS_PROP_SIZE},
       {"margin-left", CSS_PROP_MARGIN_LEFT},
-      {"table-layout", CSS_PROP_TABLE_LAYOUT},
-      {"border-bottom-color", CSS_PROP_BORDER_BOTTOM_COLOR},
-      {"width", CSS_PROP_WIDTH},
-      {"cursor", CSS_PROP_CURSOR},
-      {"quotes", CSS_PROP_QUOTES},
-      {"font-variant", CSS_PROP_FONT_VARIANT},
-      {"padding-right", CSS_PROP_PADDING_RIGHT},
-      {"padding-left", CSS_PROP_PADDING_LEFT},
-      {"overflow", CSS_PROP_OVERFLOW},
-      {"margin-top", CSS_PROP_MARGIN_TOP},
-      {"border-width", CSS_PROP_BORDER_WIDTH},
+      {"border-right-color", CSS_PROP_BORDER_RIGHT_COLOR},
       {"counter-reset", CSS_PROP_COUNTER_RESET},
-      {"counter-increment", CSS_PROP_COUNTER_INCREMENT},
-      {"outline-width", CSS_PROP_OUTLINE_WIDTH},
-      {"margin-bottom", CSS_PROP_MARGIN_BOTTOM},
-      {"border-right-width", CSS_PROP_BORDER_RIGHT_WIDTH},
-      {"padding-top", CSS_PROP_PADDING_TOP},
+      {"bottom", CSS_PROP_BOTTOM},
+      {"display", CSS_PROP_DISPLAY},
+      {"border-left", CSS_PROP_BORDER_LEFT},
+      {"orphans", CSS_PROP_ORPHANS},
+      {"max-width", CSS_PROP_MAX_WIDTH},
+      {"border-left-color", CSS_PROP_BORDER_LEFT_COLOR},
       {"font-size", CSS_PROP_FONT_SIZE},
-      {"scrollbar-3dlight-color", CSS_PROP_SCROLLBAR_3DLIGHT_COLOR},
-      {"font-weight", CSS_PROP_FONT_WEIGHT},
-      {"border-left-width", CSS_PROP_BORDER_LEFT_WIDTH},
-      {"padding-bottom", CSS_PROP_PADDING_BOTTOM},
+      {"white-space", CSS_PROP_WHITE_SPACE},
+      {"box-pack", CSS_PROP_BOX_PACK},
+      {"font-variant", CSS_PROP_FONT_VARIANT},
+      {"outline-width", CSS_PROP_OUTLINE_WIDTH},
+      {"empty-cells", CSS_PROP_EMPTY_CELLS},
+      {"text-shadow", CSS_PROP_TEXT_SHADOW},
       {"font-stretch", CSS_PROP_FONT_STRETCH},
-      {"scrollbar-face-color", CSS_PROP_SCROLLBAR_FACE_COLOR},
-      {"font-family", CSS_PROP_FONT_FAMILY},
-      {"z-index", CSS_PROP_Z_INDEX},
+      {"box-flex", CSS_PROP_BOX_FLEX},
       {"min-width", CSS_PROP_MIN_WIDTH},
+      {"border-collapse", CSS_PROP_BORDER_COLLAPSE},
+      {"box-orient", CSS_PROP_BOX_ORIENT},
+      {"font-weight", CSS_PROP_FONT_WEIGHT},
+      {"unicode-bidi", CSS_PROP_UNICODE_BIDI},
+      {"box-direction", CSS_PROP_BOX_DIRECTION},
+      {"box-align", CSS_PROP_BOX_ALIGN},
+      {"word-spacing", CSS_PROP_WORD_SPACING},
+      {"box-flex-group", CSS_PROP_BOX_FLEX_GROUP},
+      {"widows", CSS_PROP_WIDOWS},
+      {"list-style", CSS_PROP_LIST_STYLE},
+      {"page-break-after", CSS_PROP_PAGE_BREAK_AFTER},
+      {"border-width", CSS_PROP_BORDER_WIDTH},
+      {"border-top-width", CSS_PROP_BORDER_TOP_WIDTH},
+      {"marker-offset", CSS_PROP_MARKER_OFFSET},
+      {"scrollbar-3dlight-color", CSS_PROP_SCROLLBAR_3DLIGHT_COLOR},
+      {"padding-bottom", CSS_PROP_PADDING_BOTTOM},
+      {"box-ordinal-group", CSS_PROP_BOX_ORDINAL_GROUP},
+      {"outline-style", CSS_PROP_OUTLINE_STYLE},
+      {"text-transform", CSS_PROP_TEXT_TRANSFORM},
+      {"table-layout", CSS_PROP_TABLE_LAYOUT},
       {"background", CSS_PROP_BACKGROUND},
-      {"scrollbar-highlight-color", CSS_PROP_SCROLLBAR_HIGHLIGHT_COLOR},
+      {"scrollbar-track-color", CSS_PROP_SCROLLBAR_TRACK_COLOR},
       {"background-color", CSS_PROP_BACKGROUND_COLOR},
-      {"text-align", CSS_PROP_TEXT_ALIGN},
-      {"border-style", CSS_PROP_BORDER_STYLE},
-      {"text-decoration", CSS_PROP_TEXT_DECORATION},
-      {"position", CSS_PROP_POSITION},
-      {"visibility", CSS_PROP_VISIBILITY},
-      {"text-decoration-color", CSS_PROP_TEXT_DECORATION_COLOR},
-      {"outline-style", CSS_PROP_OUTLINE_STYLE},
-      {"border-top-width", CSS_PROP_BORDER_TOP_WIDTH},
-      {"border-collapse", CSS_PROP_BORDER_COLLAPSE},
-      {"caption-side", CSS_PROP_CAPTION_SIDE},
-      {"border-right-style", CSS_PROP_BORDER_RIGHT_STYLE},
-      {"letter-spacing", CSS_PROP_LETTER_SPACING},
-      {"orphans", CSS_PROP_ORPHANS},
-      {"border-bottom-width", CSS_PROP_BORDER_BOTTOM_WIDTH},
+      {"counter-increment", CSS_PROP_COUNTER_INCREMENT},
+      {"border-right-width", CSS_PROP_BORDER_RIGHT_WIDTH},
+      {"scrollbar-face-color", CSS_PROP_SCROLLBAR_FACE_COLOR},
       {"font-style", CSS_PROP_FONT_STYLE},
-      {"text-indent", CSS_PROP_TEXT_INDENT},
-      {"border-left-style", CSS_PROP_BORDER_LEFT_STYLE},
-      {"max-height", CSS_PROP_MAX_HEIGHT},
-      {"display", CSS_PROP_DISPLAY},
-      {"background-image", CSS_PROP_BACKGROUND_IMAGE},
-      {"border-spacing", CSS_PROP_BORDER_SPACING},
-      {"page-break-after", CSS_PROP_PAGE_BREAK_AFTER},
-      {"border-top-style", CSS_PROP_BORDER_TOP_STYLE},
       {"background-repeat", CSS_PROP_BACKGROUND_REPEAT},
-      {"scrollbar-arrow-color", CSS_PROP_SCROLLBAR_ARROW_COLOR},
-      {"empty-cells", CSS_PROP_EMPTY_CELLS},
-      {"border-bottom-style", CSS_PROP_BORDER_BOTTOM_STYLE},
-      {"list-style", CSS_PROP_LIST_STYLE},
-      {"scrollbar-track-color", CSS_PROP_SCROLLBAR_TRACK_COLOR},
-      {"page-break-before", CSS_PROP_PAGE_BREAK_BEFORE},
-      {"white-space", CSS_PROP_WHITE_SPACE},
-      {"font-size-adjust", CSS_PROP_FONT_SIZE_ADJUST},
-      {"background-attachment", CSS_PROP_BACKGROUND_ATTACHMENT},
-      {"widows", CSS_PROP_WIDOWS},
-      {"word-spacing", CSS_PROP_WORD_SPACING},
-      {"max-width", CSS_PROP_MAX_WIDTH},
-      {"marker-offset", CSS_PROP_MARKER_OFFSET},
       {"-konq-flow-mode", CSS_PROP__KONQ_FLOW_MODE},
+      {"border-spacing", CSS_PROP_BORDER_SPACING},
+      {"border-left-width", CSS_PROP_BORDER_LEFT_WIDTH},
+      {"margin-bottom", CSS_PROP_MARGIN_BOTTOM},
       {"list-style-image", CSS_PROP_LIST_STYLE_IMAGE},
+      {"box-lines", CSS_PROP_BOX_LINES},
+      {"font-family", CSS_PROP_FONT_FAMILY},
+      {"visibility", CSS_PROP_VISIBILITY},
+      {"border-style", CSS_PROP_BORDER_STYLE},
+      {"scrollbar-highlight-color", CSS_PROP_SCROLLBAR_HIGHLIGHT_COLOR},
+      {"border-top-style", CSS_PROP_BORDER_TOP_STYLE},
+      {"font-size-adjust", CSS_PROP_FONT_SIZE_ADJUST},
+      {"border-bottom", CSS_PROP_BORDER_BOTTOM},
+      {"border-bottom-color", CSS_PROP_BORDER_BOTTOM_COLOR},
+      {"scrollbar-arrow-color", CSS_PROP_SCROLLBAR_ARROW_COLOR},
+      {"background-image", CSS_PROP_BACKGROUND_IMAGE},
+      {"border-right-style", CSS_PROP_BORDER_RIGHT_STYLE},
       {"page-break-inside", CSS_PROP_PAGE_BREAK_INSIDE},
-      {"text-transform", CSS_PROP_TEXT_TRANSFORM},
-      {"text-shadow", CSS_PROP_TEXT_SHADOW},
-      {"scrollbar-shadow-color", CSS_PROP_SCROLLBAR_SHADOW_COLOR},
       {"list-style-type", CSS_PROP_LIST_STYLE_TYPE},
-      {"background-position", CSS_PROP_BACKGROUND_POSITION},
-      {"background-position-y", CSS_PROP_BACKGROUND_POSITION_Y},
+      {"border-left-style", CSS_PROP_BORDER_LEFT_STYLE},
+      {"page-break-before", CSS_PROP_PAGE_BREAK_BEFORE},
       {"list-style-position", CSS_PROP_LIST_STYLE_POSITION},
+      {"scrollbar-shadow-color", CSS_PROP_SCROLLBAR_SHADOW_COLOR},
+      {"background-position", CSS_PROP_BACKGROUND_POSITION},
+      {"border-bottom-width", CSS_PROP_BORDER_BOTTOM_WIDTH},
+      {"background-attachment", CSS_PROP_BACKGROUND_ATTACHMENT},
+      {"background-position-x", CSS_PROP_BACKGROUND_POSITION_X},
       {"scrollbar-darkshadow-color", CSS_PROP_SCROLLBAR_DARKSHADOW_COLOR},
-      {"background-position-x", CSS_PROP_BACKGROUND_POSITION_X}
+      {"border-bottom-style", CSS_PROP_BORDER_BOTTOM_STYLE},
+      {"background-position-y", CSS_PROP_BACKGROUND_POSITION_Y}
     };
 
   static const signed char lookup[] =
     {
-       -1,  -1,  -1,  -1,  -1,   0,  -1,  -1,  -1,  -1,
-       -1,  -1,  -1,  -1,  -1,   1,  -1,  -1,  -1,  -1,
-        2,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
-       -1,  -1,  -1,  -1,   3,  -1,   4,  -1,  -1,  -1,
-       -1,  -1,  -1,  -1,  -1,   5,   6,  -1,  -1,  -1,
-       -1,  -1,   7,  -1,   8,  -1,  -1,   9,  -1,  -1,
-       -1,  -1,  -1,  10,  -1,  -1,  -1,  11,  -1,  -1,
-       -1,  -1,  -1,  12,  -1,  -1,  -1,  -1,  -1,  13,
-       -1,  14,  -1,  15,  16,  -1,  17,  18,  -1,  19,
-       -1,  -1,  -1,  -1,  20,  -1,  -1,  21,  -1,  -1,
-       -1,  22,  23,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
-       -1,  -1,  -1,  -1,  -1,  -1,  24,  -1,  -1,  -1,
+       -1,  -1,  -1,   0,   1,   2,  -1,  -1,  -1,  -1,
+       -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   3,
+        4,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
+       -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
+       -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
+        5,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
+       -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
+       -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   6,
+       -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
+       -1,  -1,  -1,  -1,  -1,   7,   8,  -1,  -1,  -1,
+       -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
+       -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
+       -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   9,
+       -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
+       -1,  -1,  10,  -1,  11,  -1,  12,  -1,  -1,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
-       25,  -1,  -1,  -1,  -1,  -1,  26,  27,  -1,  -1,
-       28,  -1,  29,  -1,  -1,  -1,  -1,  -1,  30,  31,
-       -1,  32,  33,  -1,  34,  35,  36,  -1,  -1,  -1,
-       -1,  37,  38,  39,  -1,  -1,  -1,  -1,  -1,  -1,
-       -1,  -1,  -1,  -1,  -1,  -1,  -1,  40,  -1,  -1,
-       -1,  -1,  -1,  41,  -1,  -1,  -1,  -1,  -1,  -1,
+       -1,  -1,  13,  -1,  14,  -1,  -1,  -1,  15,  -1,
+       -1,  16,  17,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
+       18,  19,  -1,  -1,  -1,  20,  -1,  -1,  -1,  -1,
+       -1,  21,  -1,  22,  -1,  23,  -1,  -1,  -1,  24,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
-       42,  -1,  43,  -1,  -1,  -1,  -1,  -1,  44,  -1,
-       -1,  -1,  45,  46,  -1,  -1,  -1,  -1,  47,  -1,
-       -1,  -1,  -1,  48,  -1,  -1,  49,  -1,  -1,  50,
-       -1,  -1,  -1,  51,  -1,  -1,  52,  53,  -1,  -1,
-       -1,  -1,  -1,  -1,  54,  -1,  -1,  55,  -1,  -1,
-       -1,  -1,  -1,  -1,  -1,  56,  57,  58,  -1,  59,
-       60,  -1,  -1,  -1,  -1,  61,  62,  -1,  -1,  -1,
-       63,  -1,  64,  -1,  -1,  65,  -1,  -1,  66,  -1,
-       67,  68,  -1,  69,  -1,  -1,  70,  -1,  -1,  -1,
-       71,  -1,  72,  73,  74,  -1,  -1,  -1,  -1,  -1,
-       -1,  -1,  75,  -1,  76,  77,  78,  79,  -1,  -1,
-       80,  -1,  -1,  -1,  -1,  -1,  -1,  81,  -1,  -1,
+       -1,  25,  -1,  -1,  -1,  26,  -1,  -1,  -1,  -1,
+       27,  28,  29,  -1,  -1,  -1,  -1,  -1,  30,  -1,
+       -1,  -1,  -1,  -1,  -1,  -1,  31,  -1,  -1,  -1,
+       32,  -1,  33,  -1,  -1,  -1,  34,  35,  -1,  -1,
+       -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  36,  -1,
+       -1,  -1,  37,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
+       -1,  -1,  -1,  -1,  -1,  -1,  -1,  38,  -1,  39,
+       -1,  -1,  -1,  -1,  -1,  -1,  40,  41,  -1,  -1,
+       42,  43,  -1,  44,  -1,  -1,  -1,  -1,  45,  -1,
+       -1,  -1,  -1,  -1,  -1,  -1,  46,  -1,  -1,  -1,
+       -1,  -1,  47,  -1,  -1,  -1,  48,  49,  -1,  50,
+       -1,  -1,  51,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
-       -1,  82,  -1,  -1,  83,  -1,  -1,  -1,  -1,  -1,
-       -1,  -1,  -1,  -1,  -1,  -1,  84,  -1,  -1,  -1,
-       -1,  -1,  -1,  -1,  -1,  -1,  85,  86,  -1,  -1,
-       -1,  87,  -1,  -1,  -1,  -1,  88,  -1,  -1,  -1,
-       -1,  -1,  -1,  -1,  89,  90,  91,  92,  -1,  -1,
+       -1,  -1,  -1,  -1,  52,  -1,  53,  -1,  -1,  -1,
+       -1,  -1,  -1,  54,  -1,  -1,  -1,  55,  56,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
-       -1,  -1,  -1,  -1,  -1,  -1,  93,  -1,  -1,  -1,
-       -1,  94,  -1,  -1,  -1,  -1,  95,  -1,  -1,  -1,
+       -1,  57,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
+       -1,  58,  59,  60,  -1,  -1,  -1,  -1,  -1,  61,
+       62,  -1,  -1,  -1,  -1,  63,  64,  65,  66,  -1,
+       -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  67,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
-       -1,  96,  -1,  -1,  -1,  -1,  -1,  97,  -1,  98,
-       -1,  -1,  -1,  99,  -1, 100,  -1,  -1,  -1,  -1,
-       -1,  -1,  -1,  -1,  -1,  -1, 101,  -1,  -1,  -1,
+       -1,  -1,  68,  -1,  69,  -1,  70,  -1,  -1,  -1,
+       71,  72,  73,  -1,  -1,  -1,  74,  -1,  -1,  -1,
+       -1,  -1,  -1,  75,  -1,  -1,  -1,  -1,  76,  77,
+       -1,  -1,  78,  -1,  -1,  -1,  -1,  -1,  79,  80,
+       -1,  -1,  -1,  -1,  -1,  -1,  -1,  81,  -1,  -1,
+       -1,  -1,  -1,  -1,  -1,  82,  83,  -1,  -1,  -1,
+       -1,  84,  85,  86,  -1,  87,  -1,  -1,  -1,  -1,
+       -1,  -1,  -1,  -1,  -1,  88,  -1,  89,  -1,  -1,
+       90,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  91,
+       -1,  -1,  92,  -1,  -1,  -1,  -1,  -1,  93,  -1,
+       -1,  94,  -1,  -1,  95,  -1,  96,  -1,  -1,  -1,
+       97,  -1,  98,  -1,  -1,  99, 100,  -1,  -1,  -1,
+       -1, 101,  -1, 102,  -1,  -1,  -1,  -1,  -1, 103,
+       -1,  -1,  -1,  -1,  -1,  -1, 104,  -1,  -1,  -1,
+       -1,  -1,  -1,  -1,  -1,  -1, 105,  -1,  -1,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
+       -1,  -1,  -1, 106,  -1,  -1,  -1,  -1,  -1,  -1,
+       -1,  -1, 107,  -1,  -1, 108,  -1,  -1,  -1,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
+       -1,  -1, 109,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
-       -1,  -1,  -1,  -1,  -1,  -1,  -1, 102,  -1,  -1,
-       -1,  -1,  -1,  -1, 103,  -1,  -1,  -1,  -1,  -1,
+       -1,  -1,  -1,  -1,  -1,  -1,  -1, 110,  -1,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
-       -1, 104, 105,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
-       -1,  -1,  -1,  -1,  -1, 106,  -1,  -1,  -1, 107,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
+       -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1, 111,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
+       -1,  -1, 112,  -1, 113,  -1,  -1,  -1,  -1, 114,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
-       -1,  -1,  -1,  -1,  -1,  -1, 108,  -1,  -1,  -1,
+       -1, 115,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
+       -1, 116,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
-       -1,  -1,  -1,  -1, 109,  -1,  -1,  -1,  -1,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
+       -1,  -1,  -1,  -1,  -1,  -1, 117,  -1,  -1,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
-       -1,  -1,  -1,  -1,  -1,  -1, 110,  -1,  -1,  -1,
+       -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1, 118,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
        -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,
-       -1,  -1,  -1,  -1,  -1,  -1, 111
+       -1,  -1,  -1,  -1,  -1,  -1, 119
     };
 
   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
@@ -363,6 +386,14 @@ static const char * const propertyList[] = {
 "border-bottom-width", 
 "border-left-width", 
 "bottom", 
+"box-align", 
+"box-direction", 
+"box-flex", 
+"box-flex-group", 
+"box-lines", 
+"box-ordinal-group", 
+"box-orient", 
+"box-pack", 
 "caption-side", 
 "clear", 
 "clip", 
diff --git a/WebCore/khtml/css/cssproperties.h b/WebCore/khtml/css/cssproperties.h
index 588973c..a7e2a02 100644
--- a/WebCore/khtml/css/cssproperties.h
+++ b/WebCore/khtml/css/cssproperties.h
@@ -29,98 +29,106 @@
 #define CSS_PROP_BORDER_BOTTOM_WIDTH 20
 #define CSS_PROP_BORDER_LEFT_WIDTH 21
 #define CSS_PROP_BOTTOM 22
-#define CSS_PROP_CAPTION_SIDE 23
-#define CSS_PROP_CLEAR 24
-#define CSS_PROP_CLIP 25
-#define CSS_PROP_COLOR 26
-#define CSS_PROP_CONTENT 27
-#define CSS_PROP_COUNTER_INCREMENT 28
-#define CSS_PROP_COUNTER_RESET 29
-#define CSS_PROP_CURSOR 30
-#define CSS_PROP_DIRECTION 31
-#define CSS_PROP_DISPLAY 32
-#define CSS_PROP_EMPTY_CELLS 33
-#define CSS_PROP_FLOAT 34
-#define CSS_PROP_FONT_FAMILY 35
-#define CSS_PROP_FONT_SIZE 36
-#define CSS_PROP_FONT_SIZE_ADJUST 37
-#define CSS_PROP_FONT_STRETCH 38
-#define CSS_PROP_FONT_STYLE 39
-#define CSS_PROP_FONT_VARIANT 40
-#define CSS_PROP_FONT_WEIGHT 41
-#define CSS_PROP_HEIGHT 42
-#define CSS_PROP_LEFT 43
-#define CSS_PROP_LETTER_SPACING 44
-#define CSS_PROP_LINE_HEIGHT 45
-#define CSS_PROP_LIST_STYLE_IMAGE 46
-#define CSS_PROP_LIST_STYLE_POSITION 47
-#define CSS_PROP_LIST_STYLE_TYPE 48
-#define CSS_PROP_MARGIN_TOP 49
-#define CSS_PROP_MARGIN_RIGHT 50
-#define CSS_PROP_MARGIN_BOTTOM 51
-#define CSS_PROP_MARGIN_LEFT 52
-#define CSS_PROP_MARKER_OFFSET 53
-#define CSS_PROP_MAX_HEIGHT 54
-#define CSS_PROP_MAX_WIDTH 55
-#define CSS_PROP_MIN_HEIGHT 56
-#define CSS_PROP_MIN_WIDTH 57
-#define CSS_PROP_ORPHANS 58
-#define CSS_PROP_OUTLINE_COLOR 59
-#define CSS_PROP_OUTLINE_STYLE 60
-#define CSS_PROP_OUTLINE_WIDTH 61
-#define CSS_PROP_OVERFLOW 62
-#define CSS_PROP_PADDING_TOP 63
-#define CSS_PROP_PADDING_RIGHT 64
-#define CSS_PROP_PADDING_BOTTOM 65
-#define CSS_PROP_PADDING_LEFT 66
-#define CSS_PROP_PAGE 67
-#define CSS_PROP_PAGE_BREAK_AFTER 68
-#define CSS_PROP_PAGE_BREAK_BEFORE 69
-#define CSS_PROP_PAGE_BREAK_INSIDE 70
-#define CSS_PROP_POSITION 71
-#define CSS_PROP_QUOTES 72
-#define CSS_PROP_RIGHT 73
-#define CSS_PROP_SIZE 74
-#define CSS_PROP_TABLE_LAYOUT 75
-#define CSS_PROP_TEXT_ALIGN 76
-#define CSS_PROP_TEXT_DECORATION 77
-#define CSS_PROP_TEXT_DECORATION_COLOR 78
-#define CSS_PROP_TEXT_INDENT 79
-#define CSS_PROP_TEXT_SHADOW 80
-#define CSS_PROP_TEXT_TRANSFORM 81
-#define CSS_PROP_TOP 82
-#define CSS_PROP_UNICODE_BIDI 83
-#define CSS_PROP_VERTICAL_ALIGN 84
-#define CSS_PROP_VISIBILITY 85
-#define CSS_PROP_WHITE_SPACE 86
-#define CSS_PROP_WIDOWS 87
-#define CSS_PROP_WIDTH 88
-#define CSS_PROP_WORD_SPACING 89
-#define CSS_PROP_Z_INDEX 90
-#define CSS_PROP_BACKGROUND 91
-#define CSS_PROP_BORDER 92
-#define CSS_PROP_BORDER_COLOR 93
-#define CSS_PROP_BORDER_STYLE 94
-#define CSS_PROP_BORDER_TOP 95
-#define CSS_PROP_BORDER_RIGHT 96
-#define CSS_PROP_BORDER_BOTTOM 97
-#define CSS_PROP_BORDER_LEFT 98
-#define CSS_PROP_BORDER_WIDTH 99
-#define CSS_PROP_FONT 100
-#define CSS_PROP_LIST_STYLE 101
-#define CSS_PROP_MARGIN 102
-#define CSS_PROP_OUTLINE 103
-#define CSS_PROP_PADDING 104
-#define CSS_PROP_SCROLLBAR_FACE_COLOR 105
-#define CSS_PROP_SCROLLBAR_SHADOW_COLOR 106
-#define CSS_PROP_SCROLLBAR_HIGHLIGHT_COLOR 107
-#define CSS_PROP_SCROLLBAR_3DLIGHT_COLOR 108
-#define CSS_PROP_SCROLLBAR_DARKSHADOW_COLOR 109
-#define CSS_PROP_SCROLLBAR_TRACK_COLOR 110
-#define CSS_PROP_SCROLLBAR_ARROW_COLOR 111
-#define CSS_PROP__KONQ_FLOW_MODE 112
+#define CSS_PROP_BOX_ALIGN 23
+#define CSS_PROP_BOX_DIRECTION 24
+#define CSS_PROP_BOX_FLEX 25
+#define CSS_PROP_BOX_FLEX_GROUP 26
+#define CSS_PROP_BOX_LINES 27
+#define CSS_PROP_BOX_ORDINAL_GROUP 28
+#define CSS_PROP_BOX_ORIENT 29
+#define CSS_PROP_BOX_PACK 30
+#define CSS_PROP_CAPTION_SIDE 31
+#define CSS_PROP_CLEAR 32
+#define CSS_PROP_CLIP 33
+#define CSS_PROP_COLOR 34
+#define CSS_PROP_CONTENT 35
+#define CSS_PROP_COUNTER_INCREMENT 36
+#define CSS_PROP_COUNTER_RESET 37
+#define CSS_PROP_CURSOR 38
+#define CSS_PROP_DIRECTION 39
+#define CSS_PROP_DISPLAY 40
+#define CSS_PROP_EMPTY_CELLS 41
+#define CSS_PROP_FLOAT 42
+#define CSS_PROP_FONT_FAMILY 43
+#define CSS_PROP_FONT_SIZE 44
+#define CSS_PROP_FONT_SIZE_ADJUST 45
+#define CSS_PROP_FONT_STRETCH 46
+#define CSS_PROP_FONT_STYLE 47
+#define CSS_PROP_FONT_VARIANT 48
+#define CSS_PROP_FONT_WEIGHT 49
+#define CSS_PROP_HEIGHT 50
+#define CSS_PROP_LEFT 51
+#define CSS_PROP_LETTER_SPACING 52
+#define CSS_PROP_LINE_HEIGHT 53
+#define CSS_PROP_LIST_STYLE_IMAGE 54
+#define CSS_PROP_LIST_STYLE_POSITION 55
+#define CSS_PROP_LIST_STYLE_TYPE 56
+#define CSS_PROP_MARGIN_TOP 57
+#define CSS_PROP_MARGIN_RIGHT 58
+#define CSS_PROP_MARGIN_BOTTOM 59
+#define CSS_PROP_MARGIN_LEFT 60
+#define CSS_PROP_MARKER_OFFSET 61
+#define CSS_PROP_MAX_HEIGHT 62
+#define CSS_PROP_MAX_WIDTH 63
+#define CSS_PROP_MIN_HEIGHT 64
+#define CSS_PROP_MIN_WIDTH 65
+#define CSS_PROP_ORPHANS 66
+#define CSS_PROP_OUTLINE_COLOR 67
+#define CSS_PROP_OUTLINE_STYLE 68
+#define CSS_PROP_OUTLINE_WIDTH 69
+#define CSS_PROP_OVERFLOW 70
+#define CSS_PROP_PADDING_TOP 71
+#define CSS_PROP_PADDING_RIGHT 72
+#define CSS_PROP_PADDING_BOTTOM 73
+#define CSS_PROP_PADDING_LEFT 74
+#define CSS_PROP_PAGE 75
+#define CSS_PROP_PAGE_BREAK_AFTER 76
+#define CSS_PROP_PAGE_BREAK_BEFORE 77
+#define CSS_PROP_PAGE_BREAK_INSIDE 78
+#define CSS_PROP_POSITION 79
+#define CSS_PROP_QUOTES 80
+#define CSS_PROP_RIGHT 81
+#define CSS_PROP_SIZE 82
+#define CSS_PROP_TABLE_LAYOUT 83
+#define CSS_PROP_TEXT_ALIGN 84
+#define CSS_PROP_TEXT_DECORATION 85
+#define CSS_PROP_TEXT_DECORATION_COLOR 86
+#define CSS_PROP_TEXT_INDENT 87
+#define CSS_PROP_TEXT_SHADOW 88
+#define CSS_PROP_TEXT_TRANSFORM 89
+#define CSS_PROP_TOP 90
+#define CSS_PROP_UNICODE_BIDI 91
+#define CSS_PROP_VERTICAL_ALIGN 92
+#define CSS_PROP_VISIBILITY 93
+#define CSS_PROP_WHITE_SPACE 94
+#define CSS_PROP_WIDOWS 95
+#define CSS_PROP_WIDTH 96
+#define CSS_PROP_WORD_SPACING 97
+#define CSS_PROP_Z_INDEX 98
+#define CSS_PROP_BACKGROUND 99
+#define CSS_PROP_BORDER 100
+#define CSS_PROP_BORDER_COLOR 101
+#define CSS_PROP_BORDER_STYLE 102
+#define CSS_PROP_BORDER_TOP 103
+#define CSS_PROP_BORDER_RIGHT 104
+#define CSS_PROP_BORDER_BOTTOM 105
+#define CSS_PROP_BORDER_LEFT 106
+#define CSS_PROP_BORDER_WIDTH 107
+#define CSS_PROP_FONT 108
+#define CSS_PROP_LIST_STYLE 109
+#define CSS_PROP_MARGIN 110
+#define CSS_PROP_OUTLINE 111
+#define CSS_PROP_PADDING 112
+#define CSS_PROP_SCROLLBAR_FACE_COLOR 113
+#define CSS_PROP_SCROLLBAR_SHADOW_COLOR 114
+#define CSS_PROP_SCROLLBAR_HIGHLIGHT_COLOR 115
+#define CSS_PROP_SCROLLBAR_3DLIGHT_COLOR 116
+#define CSS_PROP_SCROLLBAR_DARKSHADOW_COLOR 117
+#define CSS_PROP_SCROLLBAR_TRACK_COLOR 118
+#define CSS_PROP_SCROLLBAR_ARROW_COLOR 119
+#define CSS_PROP__KONQ_FLOW_MODE 120
 
 #define CSS_PROP_MAX CSS_PROP_Z_INDEX
-#define CSS_PROP_TOTAL 113
+#define CSS_PROP_TOTAL 121
 #endif
 
diff --git a/WebCore/khtml/css/cssproperties.in b/WebCore/khtml/css/cssproperties.in
index 91b7886..3ac2555 100644
--- a/WebCore/khtml/css/cssproperties.in
+++ b/WebCore/khtml/css/cssproperties.in
@@ -37,6 +37,14 @@ border-right-width
 border-bottom-width
 border-left-width
 bottom
+box-align
+box-direction
+box-flex
+box-flex-group
+box-lines
+box-ordinal-group
+box-orient
+box-pack
 caption-side
 clear
 clip
diff --git a/WebCore/khtml/css/cssstyleselector.cpp b/WebCore/khtml/css/cssstyleselector.cpp
index 7e78693..cd235bc 100644
--- a/WebCore/khtml/css/cssstyleselector.cpp
+++ b/WebCore/khtml/css/cssstyleselector.cpp
@@ -87,7 +87,7 @@ CSSStyleSelector::CSSStyleSelector( DocumentImpl* doc, QString userStyleSheet, S
 {
     init();
 
-    KHTMLView* view = doc->view();
+    view = doc->view();
     strictParsing = _strictParsing;
     settings = view ? view->part()->settings() : 0;
     if(!defaultStyle) loadDefaultStyle(settings);
@@ -100,8 +100,8 @@ CSSStyleSelector::CSSStyleSelector( DocumentImpl* doc, QString userStyleSheet, S
     userSheet = 0;
     paintDeviceMetrics = doc->paintDeviceMetrics();
 
-	if(paintDeviceMetrics) // this may be null, not everyone uses khtmlview (Niko)
-	    computeFontSizes(paintDeviceMetrics, view ? view->part()->zoomFactor() : 100);
+    if (paintDeviceMetrics) // this may be null, not everyone uses khtmlview (Niko)
+        computeFontSizes(paintDeviceMetrics);
         
     if ( !userStyleSheet.isEmpty() ) {
         userSheet = new DOM::CSSStyleSheetImpl(doc);
@@ -251,13 +251,7 @@ void CSSStyleSelector::clear()
 
 #define MAXFONTSIZES 15
 
-void CSSStyleSelector::computeFontSizes(QPaintDeviceMetrics* paintDeviceMetrics,  int zoomFactor)
-{
-    computeFontSizesFor(paintDeviceMetrics, zoomFactor, m_fontSizes, false);
-    computeFontSizesFor(paintDeviceMetrics, zoomFactor, m_fixedFontSizes, true);
-}
-
-void CSSStyleSelector::computeFontSizesFor(QPaintDeviceMetrics* paintDeviceMetrics, int zoomFactor, QValueList<int>& fontSizes, bool isFixed)
+void CSSStyleSelector::computeFontSizes(QPaintDeviceMetrics* paintDeviceMetrics)
 {
 #if APPLE_CHANGES
     // We don't want to scale the settings by the dpi.
@@ -268,27 +262,25 @@ void CSSStyleSelector::computeFontSizesFor(QPaintDeviceMetrics* paintDeviceMetri
     if (toPix  < 96./72.) toPix = 96./72.;
 #endif
 
-    fontSizes.clear();
+    m_fontSizes.clear();
     const float factor = 1.2;
     float scale = 1.0 / (factor*factor*factor);
     float mediumFontSize;
     float minFontSize;
     if (!khtml::printpainter) {
-        scale *= zoomFactor / 100.0;
-	if (isFixed)
-	    mediumFontSize = settings->mediumFixedFontSize() * toPix;
-	else
-	    mediumFontSize = settings->mediumFontSize() * toPix;
-        minFontSize = settings->minFontSize() * toPix;
+        mediumFontSize = settings->mediumFontSize() * toPix;
+        minFontSize = toPix;
+        m_fixedScaleFactor = (settings->mediumFixedFontSize() * toPix) / mediumFontSize;
     }
     else {
         // ## depending on something / configurable ?
         mediumFontSize = 12;
-        minFontSize = 6;
+        minFontSize = 1;
+        m_fixedScaleFactor = 1.0;
     }
 
     for ( int i = 0; i < MAXFONTSIZES; i++ ) {
-        fontSizes << int(KMAX( mediumFontSize * scale + 0.5f, minFontSize));
+        m_fontSizes << int(KMAX( mediumFontSize * scale + 0.5f, minFontSize));
         scale *= factor;
     }
 }
@@ -477,10 +469,12 @@ RenderStyle *CSSStyleSelector::styleForElement(ElementImpl *e)
     // may be needed for positioned elements that have to compute their static normal flow
     // positions.
     style->setOriginalDisplay(style->display());
-    if (style->display() != NONE && style->display() != BLOCK && style->display() != TABLE &&
+    if (style->display() != NONE && style->display() != BLOCK && style->display() != TABLE && style->display() != BOX &&
         (style->position() == ABSOLUTE || style->position() == FIXED || style->floating() != FNONE)) {
         if (style->display() == INLINE_TABLE)
             style->setDisplay(TABLE);
+        else if (style->display() == INLINE_BOX)
+            style->setDisplay(BOX);
         else if (style->display() == LIST_ITEM) {
             // It is a WinIE bug that floated list items lose their bullets, so we'll emulate the quirk,
             // but only in quirks mode.
@@ -1324,7 +1318,7 @@ void CSSOrderedPropertyList::append(DOM::CSSStyleDeclarationImpl *decl, uint sel
 // -------------------------------------------------------------------------------------
 // this is mostly boring stuff on how to apply a certain rule to the renderstyle...
 
-static Length convertToLength( CSSPrimitiveValueImpl *primitiveValue, RenderStyle *style, QPaintDeviceMetrics *paintDeviceMetrics, bool *ok = 0 )
+static Length convertToLength( CSSPrimitiveValueImpl *primitiveValue, RenderStyle *style, QPaintDeviceMetrics *paintDeviceMetrics, CSSStyleSelector* selector, bool *ok = 0 )
 {
     Length l;
     if ( !primitiveValue ) {
@@ -1333,7 +1327,7 @@ static Length convertToLength( CSSPrimitiveValueImpl *primitiveValue, RenderStyl
     } else {
 	int type = primitiveValue->primitiveType();
 	if(type > CSSPrimitiveValue::CSS_PERCENTAGE && type < CSSPrimitiveValue::CSS_DEG)
-	    l = Length(primitiveValue->computeLength(style, paintDeviceMetrics), Fixed);
+	    l = Length(primitiveValue->computeLength(style, paintDeviceMetrics, selector), Fixed);
 	else if(type == CSSPrimitiveValue::CSS_PERCENTAGE)
 	    l = Length(int(primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_PERCENTAGE)), Percent);
 	else if(type == CSSPrimitiveValue::CSS_NUMBER)
@@ -1702,14 +1696,10 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
         if(!primitiveValue) break;
 	int id = primitiveValue->getIdent();
 	EDisplay d;
-	if ( id == CSS_VAL_NONE) {
+	if (id == CSS_VAL_NONE)
 	    d = NONE;
-	} else if ( id == CSS_VAL_INLINE_BLOCK ) {
-	    // inline-block is not supported at the moment, so we just ignore it.
-	    return;
-	} else {
+	else
 	    d = EDisplay(primitiveValue->getIdent() - CSS_VAL_INLINE);
-	}
 
         style->setDisplay(d);
         //kdDebug( 6080 ) << "setting display to " << d << endl;
@@ -2077,7 +2067,7 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
       Length l;
       int type = primitiveValue->primitiveType();
       if(type > CSSPrimitiveValue::CSS_PERCENTAGE && type < CSSPrimitiveValue::CSS_DEG)
-	l = Length(primitiveValue->computeLength(style, paintDeviceMetrics), Fixed);
+	l = Length(primitiveValue->computeLength(style, paintDeviceMetrics, this), Fixed);
       else if(type == CSSPrimitiveValue::CSS_PERCENTAGE)
 	l = Length((int)primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
       else
@@ -2091,7 +2081,7 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
       Length l;
       int type = primitiveValue->primitiveType();
       if(type > CSSPrimitiveValue::CSS_PERCENTAGE && type < CSSPrimitiveValue::CSS_DEG)
-	l = Length(primitiveValue->computeLength(style, paintDeviceMetrics), Fixed);
+	l = Length(primitiveValue->computeLength(style, paintDeviceMetrics, this), Fixed);
       else if(type == CSSPrimitiveValue::CSS_PERCENTAGE)
 	l = Length((int)primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
       else
@@ -2103,7 +2093,7 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
         {
         if(!primitiveValue) break;
         short spacing = 0;
-        spacing =  primitiveValue->computeLength(style, paintDeviceMetrics);
+        spacing =  primitiveValue->computeLength(style, paintDeviceMetrics, this);
         style->setBorderSpacing(spacing);
         break;
         }
@@ -2321,7 +2311,7 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
             width = 5;
             break;
         case CSS_VAL_INVALID:
-            width = primitiveValue->computeLength(style, paintDeviceMetrics);
+            width = primitiveValue->computeLength(style, paintDeviceMetrics, this);
             break;
         default:
             return;
@@ -2376,7 +2366,7 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
             width = 0;
         } else {
 	    if(!primitiveValue) return;
-	    width = primitiveValue->computeLength(style, paintDeviceMetrics);
+	    width = primitiveValue->computeLength(style, paintDeviceMetrics, this);
 	}
         switch(id)
         {
@@ -2466,7 +2456,7 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
             int type = primitiveValue->primitiveType();
             if(type > CSSPrimitiveValue::CSS_PERCENTAGE && type < CSSPrimitiveValue::CSS_DEG)
                 // Handle our quirky margin units if we have them.
-                l = Length(primitiveValue->computeLength(style, paintDeviceMetrics), Fixed, 
+                l = Length(primitiveValue->computeLength(style, paintDeviceMetrics, this), Fixed, 
                            primitiveValue->isQuirkValue());
             else if(type == CSSPrimitiveValue::CSS_PERCENTAGE)
                 l = Length((int)primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
@@ -2552,7 +2542,7 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
         {
             int type = primitiveValue->primitiveType();
             if(type > CSSPrimitiveValue::CSS_PERCENTAGE && type < CSSPrimitiveValue::CSS_DEG)
-                l = Length(primitiveValue->computeLength(style, paintDeviceMetrics), Fixed);
+                l = Length(primitiveValue->computeLength(style, paintDeviceMetrics, this), Fixed);
             else if(type == CSSPrimitiveValue::CSS_PERCENTAGE)
             {
                 // ### compute from parents height!!!
@@ -2619,7 +2609,7 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
 	  int type = primitiveValue->primitiveType();
 	  Length l;
 	  if(type > CSSPrimitiveValue::CSS_PERCENTAGE && type < CSSPrimitiveValue::CSS_DEG)
-	    l = Length(primitiveValue->computeLength(style, paintDeviceMetrics), Fixed );
+	    l = Length(primitiveValue->computeLength(style, paintDeviceMetrics, this), Fixed );
 	  else if(type == CSSPrimitiveValue::CSS_PERCENTAGE)
 	    l = Length( int( primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_PERCENTAGE) ), Percent );
 
@@ -2633,33 +2623,30 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
         FontDef fontDef = style->htmlFont().fontDef;
         float oldSize;
         float size = 0;
-        int minFontSize = settings->minFontSize();
-
-        if(parentNode) {
-            oldSize = parentStyle->htmlFont().fontDef.floatSize();
-        } else
+        
+        bool parentIsAbsoluteSize = false;
+        if (parentNode) {
+            oldSize = parentStyle->htmlFont().fontDef.specifiedSize;
+            parentIsAbsoluteSize = parentStyle->htmlFont().fontDef.isAbsoluteSize;
+        }
+        else
             oldSize = m_fontSizes[3];
 
-        if (value->cssValueType() == CSSValue::CSS_INHERIT) {
+        if (value->cssValueType() == CSSValue::CSS_INHERIT)
             size = oldSize;
-        } else if (primitiveValue->getIdent()) {
-	    // keywords are being used.  Pick the correct default
-	    // based off the font family.
-	    QValueList<int>& fontSizes = (fontDef.genericFamily == FontDef::eMonospace) ?
-					 m_fixedFontSizes : m_fontSizes;
-	   
-            switch(primitiveValue->getIdent())
-            {
-            case CSS_VAL_XX_SMALL: size = fontSizes[0]; break;
-            case CSS_VAL_X_SMALL:  size = fontSizes[1]; break;
-            case CSS_VAL_SMALL:    size = fontSizes[2]; break;
-            case CSS_VAL_MEDIUM:   size = fontSizes[3]; break;
-            case CSS_VAL_LARGE:    size = fontSizes[4]; break;
-            case CSS_VAL_X_LARGE:  size = fontSizes[5]; break;
-            case CSS_VAL_XX_LARGE: size = fontSizes[6]; break;
-            case CSS_VAL__KONQ_XXX_LARGE:  size = ( fontSizes[6]*5 )/3; break;
+        else if (primitiveValue->getIdent()) {
+            // keywords are being used.  Pick the correct default
+            // based off the font family.
+            switch (primitiveValue->getIdent()) {
+            case CSS_VAL_XX_SMALL: size = m_fontSizes[0]; break;
+            case CSS_VAL_X_SMALL:  size = m_fontSizes[1]; break;
+            case CSS_VAL_SMALL:    size = m_fontSizes[2]; break;
+            case CSS_VAL_MEDIUM:   size = m_fontSizes[3]; break;
+            case CSS_VAL_LARGE:    size = m_fontSizes[4]; break;
+            case CSS_VAL_X_LARGE:  size = m_fontSizes[5]; break;
+            case CSS_VAL_XX_LARGE: size = m_fontSizes[6]; break;
+            case CSS_VAL__KONQ_XXX_LARGE:  size = ( m_fontSizes[6]*5 )/3; break;
             case CSS_VAL_LARGER:
-                // FIXME: Larger/smaller should actually apply a scale to the logical size.  It 		// should not simply be transforming the current size.
                 size = oldSize * 1.2;
                 break;
             case CSS_VAL_SMALLER:
@@ -2669,43 +2656,29 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
                 return;
             }
 
-            // This is a "logical" font size in the sense that it is relative to some UA default.
-            // Since the UA default can vary depending on the font family (e.g., monospace could be 11pt
-            // but serif could be 20pt), we don't set our size specified bit.
-            if (primitiveValue->getIdent() != CSS_VAL_LARGER &&
-                primitiveValue->getIdent() != CSS_VAL_SMALLER) {
-                // FIXME: Technically this should be logical too and apply a scale
-                // to logical sizes when no explicit size is specified,
-                // but until the above simplistic 1.2 mult/division calculation is
-                // improved, we have to ignore these cases. 
-                fontDef.sizeSpecified = false;
-                fontDef.logicalSize = primitiveValue->getIdent() - CSS_VAL_XX_SMALL;
-            }
-            else
-                fontDef.sizeSpecified = true;
-
+            fontDef.isAbsoluteSize = parentIsAbsoluteSize && 
+                                    (primitiveValue->getIdent() == CSS_VAL_LARGER ||
+                                     primitiveValue->getIdent() == CSS_VAL_SMALLER);
         } else {
-            fontDef.sizeSpecified = true;
             int type = primitiveValue->primitiveType();
-            if(type > CSSPrimitiveValue::CSS_PERCENTAGE && type < CSSPrimitiveValue::CSS_DEG) {
-                size = primitiveValue->computeLengthFloat(parentStyle, paintDeviceMetrics);
-                if (!khtml::printpainter && element && element->getDocument()->view())
-                    size *= element->getDocument()->view()->part()->zoomFactor() / 100.0;
-            } else if(type == CSSPrimitiveValue::CSS_PERCENTAGE)
+            fontDef.isAbsoluteSize = parentIsAbsoluteSize ||
+                                          (type != CSSPrimitiveValue::CSS_PERCENTAGE &&
+                                           type != CSSPrimitiveValue::CSS_EMS && 
+                                           type != CSSPrimitiveValue::CSS_EXS);
+            if (type > CSSPrimitiveValue::CSS_PERCENTAGE && type < CSSPrimitiveValue::CSS_DEG)
+                size = primitiveValue->computeLengthFloat(parentStyle, paintDeviceMetrics, this, false);
+            else if(type == CSSPrimitiveValue::CSS_PERCENTAGE)
                 size = (primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_PERCENTAGE)
                         * oldSize) / 100;
             else
                 return;
         }
 
-        if(size <= 0) return;
-
-        // we never want to get smaller than the minimum font size to keep fonts readable
-        if(size < minFontSize ) size = minFontSize;
+        if (size <= 0) return;
 
         //kdDebug( 6080 ) << "computed raw font size: " << size << endl;
 
-        fontDef.setSize(size);
+        setFontSize(fontDef, size);
         if (style->setFontDef( fontDef ))
 	    fontDirty = true;
         return;
@@ -2768,7 +2741,8 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
                 if (type != CSSPrimitiveValue::CSS_EMS && type != CSSPrimitiveValue::CSS_EXS && view && view->part()) {
                     multiplier = view->part()->zoomFactor() / 100.0;
                 }
-                lineHeight = Length(primitiveValue->computeLength(style, paintDeviceMetrics, multiplier), Fixed);
+                lineHeight = Length(primitiveValue->computeLength(style, paintDeviceMetrics, 
+                                                                  this, multiplier), Fixed);
             } else if(type == CSSPrimitiveValue::CSS_PERCENTAGE)
                 lineHeight = Length( ( style->font().pixelSize() * int(primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_PERCENTAGE)) ) / 100, Fixed );
             else if(type == CSSPrimitiveValue::CSS_NUMBER)
@@ -2820,10 +2794,10 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
 	    RectImpl *rect = primitiveValue->getRectValue();
 	    if ( !rect )
 		break;
-	    top = convertToLength( rect->top(), style, paintDeviceMetrics );
-	    right = convertToLength( rect->right(), style, paintDeviceMetrics );
-	    bottom = convertToLength( rect->bottom(), style, paintDeviceMetrics );
-	    left = convertToLength( rect->left(), style, paintDeviceMetrics );
+	    top = convertToLength( rect->top(), style, paintDeviceMetrics, this );
+	    right = convertToLength( rect->right(), style, paintDeviceMetrics, this );
+	    bottom = convertToLength( rect->bottom(), style, paintDeviceMetrics, this );
+	    left = convertToLength( rect->left(), style, paintDeviceMetrics, this );
 
 	} else if ( primitiveValue->getIdent() != CSS_VAL_AUTO ) {
 	    break;
@@ -3126,6 +3100,126 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
     case CSS_PROP_OUTLINE:
 //    case CSS_PROP_PAUSE:
         break;
+
+    // CSS3 Properties
+    case CSS_PROP_BOX_ALIGN:
+        if (value->cssValueType() == CSSValue::CSS_INHERIT) {
+            if(!parentNode) return;
+            style->setBoxAlign(parentStyle->boxAlign());
+            return;
+        }
+        if (!primitiveValue) return;
+        switch (primitiveValue->getIdent()) {
+            case CSS_VAL_STRETCH:
+                style->setBoxAlign(BSTRETCH);
+                break;
+            case CSS_VAL_START:
+                style->setBoxAlign(BSTART);
+                break;
+            case CSS_VAL_END:
+                style->setBoxAlign(BEND);
+                break;
+            case CSS_VAL_CENTER:
+                style->setBoxAlign(BCENTER);
+                break;
+            case CSS_VAL_BASELINE:
+                style->setBoxAlign(BBASELINE);
+                break;
+            default:
+                return;
+        }
+        return;        
+    case CSS_PROP_BOX_DIRECTION:
+        if (value->cssValueType() == CSSValue::CSS_INHERIT) {
+            if(!parentNode) return;
+            style->setBoxDirection(parentStyle->boxDirection());
+            return;
+        }
+        if (!primitiveValue) return;
+        if (primitiveValue->getIdent() == CSS_VAL_NORMAL)
+            style->setBoxDirection(BNORMAL);
+        else
+            style->setBoxDirection(BREVERSE);
+        return;        
+    case CSS_PROP_BOX_LINES:
+        if (value->cssValueType() == CSSValue::CSS_INHERIT) {
+            if(!parentNode) return;
+            style->setBoxLines(parentStyle->boxLines());
+            return;
+        }
+        if(!primitiveValue) return;
+        if (primitiveValue->getIdent() == CSS_VAL_SINGLE)
+            style->setBoxLines(SINGLE);
+        else
+            style->setBoxLines(MULTIPLE);
+        return;     
+    case CSS_PROP_BOX_ORIENT:
+        if (value->cssValueType() == CSSValue::CSS_INHERIT) {
+            if(!parentNode) return;
+            style->setBoxOrient(parentStyle->boxOrient());
+            return;
+        }
+        if (!primitiveValue) return;
+        if (primitiveValue->getIdent() == CSS_VAL_HORIZONTAL ||
+            primitiveValue->getIdent() == CSS_VAL_INLINE_AXIS)
+            style->setBoxOrient(HORIZONTAL);
+        else
+            style->setBoxOrient(VERTICAL);
+        return;     
+    case CSS_PROP_BOX_PACK:
+        if (value->cssValueType() == CSSValue::CSS_INHERIT) {
+            if(!parentNode) return;
+            style->setBoxPack(parentStyle->boxPack());
+            return;
+        }
+        if (!primitiveValue) return;
+        switch (primitiveValue->getIdent()) {
+            case CSS_VAL_START:
+                style->setBoxPack(BSTART);
+                break;
+            case CSS_VAL_END:
+                style->setBoxPack(BEND);
+                break;
+            case CSS_VAL_CENTER:
+                style->setBoxPack(BCENTER);
+                break;
+            case CSS_VAL_JUSTIFY:
+                style->setBoxPack(BJUSTIFY);
+                break;
+            default:
+                return;
+        }
+        return;        
+    case CSS_PROP_BOX_FLEX:
+        if (value->cssValueType() == CSSValue::CSS_INHERIT) {
+            if(!parentNode) return;
+            style->setBoxFlex(parentStyle->boxFlex());
+            return;
+        }
+        if (!primitiveValue || primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_NUMBER)
+            return; // Error case.
+        style->setBoxFlex(primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_NUMBER));
+        return;
+    case CSS_PROP_BOX_FLEX_GROUP:
+        if (value->cssValueType() == CSSValue::CSS_INHERIT) {
+            if(!parentNode) return;
+            style->setBoxFlexGroup(parentStyle->boxFlexGroup());
+            return;
+        }
+        if (!primitiveValue || primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_NUMBER)
+            return; // Error case.
+        style->setBoxFlexGroup((unsigned int)(primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_NUMBER)));
+        return;        
+    case CSS_PROP_BOX_ORDINAL_GROUP:
+        if (value->cssValueType() == CSSValue::CSS_INHERIT) {
+            if(!parentNode) return;
+            style->setBoxOrdinalGroup(parentStyle->boxOrdinalGroup());
+            return;
+        }
+        if (!primitiveValue || primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_NUMBER)
+            return; // Error case.
+        style->setBoxOrdinalGroup((unsigned int)(primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_NUMBER)));
+        return;      
     default:
         return;
     }
@@ -3136,7 +3230,7 @@ void CSSStyleSelector::checkForGenericFamilyChange(RenderStyle* aStyle, RenderSt
 {
   const FontDef& childFont = aStyle->htmlFont().fontDef;
   
-  if (childFont.sizeSpecified || !aParentStyle)
+  if (childFont.isAbsoluteSize || !aParentStyle)
     return;
 
   const FontDef& parentFont = aParentStyle->htmlFont().fontDef;
@@ -3150,23 +3244,42 @@ void CSSStyleSelector::checkForGenericFamilyChange(RenderStyle* aStyle, RenderSt
     return;
 
   // We know the parent is monospace or the child is monospace, and that font
-  // size was unspecified.  We want to alter our font size to use the correct
-  // logicalSize font for our family.
-  int minFontSize = settings->minFontSize();
-  const QValueList<int>& fontSizes = (childFont.genericFamily == FontDef::eMonospace) ? m_fixedFontSizes : m_fontSizes;
-  int size = 0;
-  if (childFont.logicalSize < 0 || childFont.logicalSize > 7) // Should never happen; I'm being paranoid.
-      size = fontSizes[3]; 
-  if (childFont.logicalSize == 7) // KONQ_XX_LARGE
-      size = (fontSizes[6]*5)/3;
-  else
-      size = fontSizes[childFont.logicalSize]; 
-  if (size < minFontSize)
-    size = minFontSize;
+  // size was unspecified.  We want to scale our font size as appropriate.
+  float size = (parentFont.genericFamily == FontDef::eMonospace) ? 
+      childFont.specifiedSize/m_fixedScaleFactor :
+      childFont.specifiedSize*m_fixedScaleFactor;
   
   FontDef newFontDef(childFont);
-  newFontDef.setSize(size);
+  setFontSize(newFontDef, size);
   aStyle->setFontDef(newFontDef);
 }
 
+void CSSStyleSelector::setFontSize(FontDef& fontDef, float size)
+{
+    fontDef.specifiedSize = size;
+    fontDef.computedSize = getComputedSizeFromSpecifiedSize(fontDef.isAbsoluteSize, size);
+}
+
+float CSSStyleSelector::getComputedSizeFromSpecifiedSize(bool isAbsoluteSize, float specifiedSize)
+{
+    // We never want to get smaller than the minimum font size to keep fonts readable
+    // however we always allow the page to set an explicit pixel size that is smaller,
+    // since sites will mis-render otherwise (e.g., http://www.gamespot.com with a 9px minimum).
+    // Note to Konq folks: you may not like this interpretation of minimum font size, since you
+    // expose the pref in your GUI.  I have used APPLE_CHANGES to preserve the old behavior of
+    // always enforcing a minimum font size. -dwh
+    int minSize = settings->minFontSize();
+    float zoomPercent = (!khtml::printpainter && view) ? view->part()->zoomFactor()/100.0f : 1.0f;
+    float zoomedSize = specifiedSize * zoomPercent;
+#if APPLE_CHANGES
+    if (zoomedSize < minSize && (specifiedSize >= minSize || !isAbsoluteSize))
+        zoomedSize = minSize;
+#else
+    if (zoomedSize < minSize)
+        zoomedSize = minSize;
+#endif
+    
+    return KMAX(zoomedSize, 1.0f);
+}
+
 } // namespace khtml
diff --git a/WebCore/khtml/css/cssstyleselector.h b/WebCore/khtml/css/cssstyleselector.h
index 0ef6056..b5ff308 100644
--- a/WebCore/khtml/css/cssstyleselector.h
+++ b/WebCore/khtml/css/cssstyleselector.h
@@ -128,8 +128,7 @@ namespace khtml
 	RenderStyle *styleForElement(DOM::ElementImpl *e);
 
         QValueList<int> fontSizes() const { return m_fontSizes; }
-	QValueList<int> fixedFontSizes() const { return m_fixedFontSizes; }
-
+	
 	bool strictParsing;
 	struct Encodedurl {
 	    QString host; //also contains protocol
@@ -137,9 +136,10 @@ namespace khtml
 	    QString file;
 	} encodedurl;
 
-        void computeFontSizes(QPaintDeviceMetrics* paintDeviceMetrics, int zoomFactor);
-	void computeFontSizesFor(QPaintDeviceMetrics* paintDeviceMetrics, int zoomFactor, QValueList<int>& fontSizes, bool isFixed);
-
+        void computeFontSizes(QPaintDeviceMetrics* paintDeviceMetrics);
+        void setFontSize(FontDef& fontDef, float size);
+        float getComputedSizeFromSpecifiedSize(bool isAbsoluteSize, float specifiedSize);
+        
     protected:
 
 	/* checks if the complete selector (which can be build up from a few CSSSelector's
@@ -156,9 +156,9 @@ namespace khtml
 	void buildLists();
 	void clearLists();
 
-        unsigned int addInlineDeclarations(DOM::ElementImpl* e, DOM::CSSStyleDeclarationImpl *decl,
-				   unsigned int numProps);
-
+    unsigned int addInlineDeclarations(DOM::ElementImpl* e, DOM::CSSStyleDeclarationImpl *decl,
+                                       unsigned int numProps);
+    
 	static DOM::CSSStyleSheetImpl *defaultSheet;
         static DOM::CSSStyleSheetImpl *quirksSheet;
 	static CSSStyleSelectorList *defaultStyle;
@@ -225,8 +225,8 @@ public:
 	const KHTMLSettings *settings;
 	QPaintDeviceMetrics *paintDeviceMetrics;
         QValueList<int>     m_fontSizes;
-	QValueList<int>     m_fixedFontSizes;
-
+        float m_fixedScaleFactor; // Used when converting from proportional to fixed and vice
+                                  // versa.
 	bool fontDirty;
         bool isXMLDoc;
         
diff --git a/WebCore/khtml/css/cssvalues.c b/WebCore/khtml/css/cssvalues.c
index 36b68da..c853b70 100644
--- a/WebCore/khtml/css/cssvalues.c
+++ b/WebCore/khtml/css/cssvalues.c
@@ -7,7 +7,7 @@ struct css_value {
     const char *name;
     int id;
 };
-/* maximum key range = 1430, duplicates = 1 */
+/* maximum key range = 1909, duplicates = 1 */
 
 #ifdef __GNUC__
 __inline
@@ -21,32 +21,32 @@ hash_val (register const char *str, register unsigned int len)
 {
   static const unsigned short asso_values[] =
     {
-      1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430,    0, 1430, 1430,    0,    5,
-        10,   15,   20,   25,   30,   35,   40,    0, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430, 1430, 1430,    0,  188,   34,
-        78,  170,  185,  230,   55,    0,    5,   34,   20,   79,
-        80,   35,   14,  195,   25,    5,    0,  160,  213,  240,
-       210,  149,  240, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430, 1430,
-      1430, 1430, 1430, 1430, 1430, 1430
+      1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909,  249, 1909, 1909,    0,    5,
+        10,   15,   20,   35,   50,   55,   60,    0, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909, 1909, 1909,    0,  207,   20,
+        27,  110,   25,  229,   29,    0,    0,   29,   20,   16,
+        95,   35,  245,  255,   25,    5,    0,  135,    3,  160,
+        98,  105,   34, 1909, 1909, 1909, 1909, 1909, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909, 1909,
+      1909, 1909, 1909, 1909, 1909, 1909
     };
   register int hval = 0;
 
@@ -108,11 +108,11 @@ findValue (register const char *str, register unsigned int len)
 {
   enum
     {
-      TOTAL_KEYWORDS = 228,
+      TOTAL_KEYWORDS = 240,
       MIN_WORD_LENGTH = 3,
       MAX_WORD_LENGTH = 21,
       MIN_HASH_VALUE = 0,
-      MAX_HASH_VALUE = 1429
+      MAX_HASH_VALUE = 1908
     };
 
   static const struct css_value wordlist_value[] =
@@ -122,229 +122,241 @@ findValue (register const char *str, register unsigned int len)
       {"200", CSS_VAL_200},
       {"300", CSS_VAL_300},
       {"400", CSS_VAL_400},
-      {"500", CSS_VAL_500},
-      {"600", CSS_VAL_600},
-      {"700", CSS_VAL_700},
       {"static", CSS_VAL_STATIC},
-      {"800", CSS_VAL_800},
+      {"start", CSS_VAL_START},
+      {"500", CSS_VAL_500},
+      {"italic", CSS_VAL_ITALIC},
       {"ltr", CSS_VAL_LTR},
       {"rtl", CSS_VAL_RTL},
-      {"top", CSS_VAL_TOP},
-      {"italic", CSS_VAL_ITALIC},
-      {"portrait", CSS_VAL_PORTRAIT},
-      {"cross", CSS_VAL_CROSS},
-      {"crop", CSS_VAL_CROP},
+      {"600", CSS_VAL_600},
       {"disc", CSS_VAL_DISC},
-      {"thick", CSS_VAL_THICK},
+      {"700", CSS_VAL_700},
+      {"800", CSS_VAL_800},
       {"small", CSS_VAL_SMALL},
-      {"thin", CSS_VAL_THIN},
+      {"avoid", CSS_VAL_AVOID},
+      {"thick", CSS_VAL_THICK},
       {"solid", CSS_VAL_SOLID},
+      {"cross", CSS_VAL_CROSS},
+      {"mix", CSS_VAL_MIX},
+      {"thin", CSS_VAL_THIN},
       {"scroll", CSS_VAL_SCROLL},
-      {"katakana", CSS_VAL_KATAKANA},
-      {"icon", CSS_VAL_ICON},
-      {"caption", CSS_VAL_CAPTION},
-      {"small-caps", CSS_VAL_SMALL_CAPS},
-      {"crosshair", CSS_VAL_CROSSHAIR},
       {"teal", CSS_VAL_TEAL},
-      {"auto", CSS_VAL_AUTO},
-      {"compact", CSS_VAL_COMPACT},
-      {"pre", CSS_VAL_PRE},
+      {"crosshair", CSS_VAL_CROSSHAIR},
+      {"lime", CSS_VAL_LIME},
+      {"icon", CSS_VAL_ICON},
       {"hand", CSS_VAL_HAND},
-      {"normal", CSS_VAL_NORMAL},
+      {"katakana", CSS_VAL_KATAKANA},
+      {"left", CSS_VAL_LEFT},
       {"wait", CSS_VAL_WAIT},
-      {"maroon", CSS_VAL_MAROON},
-      {"inset", CSS_VAL_INSET},
-      {"help", CSS_VAL_HELP},
-      {"katakana-iroha", CSS_VAL_KATAKANA_IROHA},
-      {"lime", CSS_VAL_LIME},
       {"red", CSS_VAL_RED},
-      {"list-item", CSS_VAL_LIST_ITEM},
-      {"black", CSS_VAL_BLACK},
-      {"both", CSS_VAL_BOTH},
+      {"silver", CSS_VAL_SILVER},
+      {"move", CSS_VAL_MOVE},
+      {"serif", CSS_VAL_SERIF},
+      {"hide", CSS_VAL_HIDE},
+      {"olive", CSS_VAL_OLIVE},
+      {"auto", CSS_VAL_AUTO},
+      {"vertical", CSS_VAL_VERTICAL},
+      {"stretch", CSS_VAL_STRETCH},
+      {"normal", CSS_VAL_NORMAL},
+      {"decimal", CSS_VAL_DECIMAL},
       {"circle", CSS_VAL_CIRCLE},
-      {"small-caption", CSS_VAL_SMALL_CAPTION},
-      {"mix", CSS_VAL_MIX},
+      {"smaller", CSS_VAL_SMALLER},
+      {"dashed", CSS_VAL_DASHED},
+      {"dotted", CSS_VAL_DOTTED},
+      {"middle", CSS_VAL_MIDDLE},
+      {"navy", CSS_VAL_NAVY},
+      {"maroon", CSS_VAL_MAROON},
+      {"text", CSS_VAL_TEXT},
+      {"inset", CSS_VAL_INSET},
+      {"fuchsia", CSS_VAL_FUCHSIA},
       {"loud", CSS_VAL_LOUD},
-      {"collapse", CSS_VAL_COLLAPSE},
-      {"hide", CSS_VAL_HIDE},
+      {"show", CSS_VAL_SHOW},
+      {"fantasy", CSS_VAL_FANTASY},
+      {"end", CSS_VAL_END},
+      {"invert", CSS_VAL_INVERT},
+      {"inside", CSS_VAL_INSIDE},
+      {"inherit", CSS_VAL_INHERIT},
+      {"fixed", CSS_VAL_FIXED},
+      {"level", CSS_VAL_LEVEL},
+      {"relative", CSS_VAL_RELATIVE},
+      {"justify", CSS_VAL_JUSTIFY},
+      {"both", CSS_VAL_BOTH},
+      {"horizontal", CSS_VAL_HORIZONTAL},
+      {"black", CSS_VAL_BLACK},
+      {"top", CSS_VAL_TOP},
       {"right", CSS_VAL_RIGHT},
-      {"block", CSS_VAL_BLOCK},
-      {"smaller", CSS_VAL_SMALLER},
+      {"outset", CSS_VAL_OUTSET},
+      {"hidden", CSS_VAL_HIDDEN},
       {"bold", CSS_VAL_BOLD},
-      {"blink", CSS_VAL_BLINK},
-      {"pointer", CSS_VAL_POINTER},
-      {"avoid", CSS_VAL_AVOID},
-      {"inherit", CSS_VAL_INHERIT},
-      {"inside", CSS_VAL_INSIDE},
-      {"x-small", CSS_VAL_X_SMALL},
-      {"show", CSS_VAL_SHOW},
+      {"always", CSS_VAL_ALWAYS},
       {"bottom", CSS_VAL_BOTTOM},
-      {"run-in", CSS_VAL_RUN_IN},
+      {"cursive", CSS_VAL_CURSIVE},
+      {"white", CSS_VAL_WHITE},
+      {"medium", CSS_VAL_MEDIUM},
+      {"block", CSS_VAL_BLOCK},
+      {"outside", CSS_VAL_OUTSIDE},
+      {"default", CSS_VAL_DEFAULT},
       {"inline", CSS_VAL_INLINE},
-      {"scrollbar", CSS_VAL_SCROLLBAR},
-      {"sub", CSS_VAL_SUB},
-      {"aqua", CSS_VAL_AQUA},
-      {"dotted", CSS_VAL_DOTTED},
+      {"wider", CSS_VAL_WIDER},
+      {"crop", CSS_VAL_CROP},
+      {"portrait", CSS_VAL_PORTRAIT},
       {"none", CSS_VAL_NONE},
-      {"outset", CSS_VAL_OUTSET},
-      {"super", CSS_VAL_SUPER},
-      {"left", CSS_VAL_LEFT},
+      {"compact", CSS_VAL_COMPACT},
       {"table", CSS_VAL_TABLE},
-      {"repeat", CSS_VAL_REPEAT},
-      {"text", CSS_VAL_TEXT},
-      {"decimal", CSS_VAL_DECIMAL},
-      {"status-bar", CSS_VAL_STATUS_BAR},
-      {"separate", CSS_VAL_SEPARATE},
-      {"serif", CSS_VAL_SERIF},
-      {"dashed", CSS_VAL_DASHED},
-      {"hiragana", CSS_VAL_HIRAGANA},
-      {"nowrap", CSS_VAL_NOWRAP},
-      {"transparent", CSS_VAL_TRANSPARENT},
-      {"landscape", CSS_VAL_LANDSCAPE},
-      {"purple", CSS_VAL_PURPLE},
-      {"gray", CSS_VAL_GRAY},
-      {"always", CSS_VAL_ALWAYS},
-      {"fantasy", CSS_VAL_FANTASY},
-      {"middle", CSS_VAL_MIDDLE},
-      {"text-top", CSS_VAL_TEXT_TOP},
-      {"silver", CSS_VAL_SILVER},
+      {"box", CSS_VAL_BOX},
       {"armenian", CSS_VAL_ARMENIAN},
-      {"olive", CSS_VAL_OLIVE},
-      {"fuchsia", CSS_VAL_FUCHSIA},
-      {"navy", CSS_VAL_NAVY},
+      {"visible", CSS_VAL_VISIBLE},
+      {"sub", CSS_VAL_SUB},
+      {"lower", CSS_VAL_LOWER},
+      {"blink", CSS_VAL_BLINK},
+      {"above", CSS_VAL_ABOVE},
+      {"menu", CSS_VAL_MENU},
+      {"scrollbar", CSS_VAL_SCROLLBAR},
+      {"gray", CSS_VAL_GRAY},
+      {"center", CSS_VAL_CENTER},
+      {"infotext", CSS_VAL_INFOTEXT},
+      {"hiragana", CSS_VAL_HIRAGANA},
+      {"pre", CSS_VAL_PRE},
       {"large", CSS_VAL_LARGE},
-      {"outside", CSS_VAL_OUTSIDE},
-      {"monospace", CSS_VAL_MONOSPACE},
-      {"hidden", CSS_VAL_HIDDEN},
-      {"white", CSS_VAL_WHITE},
+      {"reverse", CSS_VAL_REVERSE},
+      {"aqua", CSS_VAL_AQUA},
+      {"ridge", CSS_VAL_RIDGE},
+      {"caption", CSS_VAL_CAPTION},
+      {"overline", CSS_VAL_OVERLINE},
+      {"list-item", CSS_VAL_LIST_ITEM},
+      {"help", CSS_VAL_HELP},
+      {"x-small", CSS_VAL_X_SMALL},
       {"larger", CSS_VAL_LARGER},
-      {"upper-alpha", CSS_VAL_UPPER_ALPHA},
-      {"sans-serif", CSS_VAL_SANS_SERIF},
-      {"capitalize", CSS_VAL_CAPITALIZE},
-      {"center", CSS_VAL_CENTER},
-      {"upper-latin", CSS_VAL_UPPER_LATIN},
-      {"invert", CSS_VAL_INVERT},
-      {"menu", CSS_VAL_MENU},
-      {"lower", CSS_VAL_LOWER},
-      {"no-repeat", CSS_VAL_NO_REPEAT},
-      {"move", CSS_VAL_MOVE},
       {"lighter", CSS_VAL_LIGHTER},
-      {"ridge", CSS_VAL_RIDGE},
-      {"justify", CSS_VAL_JUSTIFY},
-      {"hiragana-iroha", CSS_VAL_HIRAGANA_IROHA},
-      {"progress", CSS_VAL_PROGRESS},
-      {"wider", CSS_VAL_WIDER},
-      {"bolder", CSS_VAL_BOLDER},
-      {"repeat-y", CSS_VAL_REPEAT_Y},
       {"higher", CSS_VAL_HIGHER},
+      {"bolder", CSS_VAL_BOLDER},
+      {"capitalize", CSS_VAL_CAPITALIZE},
+      {"groove", CSS_VAL_GROOVE},
+      {"yellow", CSS_VAL_YELLOW},
+      {"collapse", CSS_VAL_COLLAPSE},
+      {"threedface", CSS_VAL_THREEDFACE},
+      {"single", CSS_VAL_SINGLE},
+      {"grey", CSS_VAL_GREY},
+      {"embed", CSS_VAL_EMBED},
       {"blue", CSS_VAL_BLUE},
-      {"-konq-auto", CSS_VAL__KONQ_AUTO},
+      {"narrower", CSS_VAL_NARROWER},
+      {"window", CSS_VAL_WINDOW},
+      {"lowercase", CSS_VAL_LOWERCASE},
+      {"repeat", CSS_VAL_REPEAT},
+      {"katakana-iroha", CSS_VAL_KATAKANA_IROHA},
       {"orange", CSS_VAL_ORANGE},
-      {"table-caption", CSS_VAL_TABLE_CAPTION},
-      {"captiontext", CSS_VAL_CAPTIONTEXT},
+      {"separate", CSS_VAL_SEPARATE},
       {"xx-small", CSS_VAL_XX_SMALL},
-      {"square", CSS_VAL_SQUARE},
-      {"medium", CSS_VAL_MEDIUM},
-      {"grey", CSS_VAL_GREY},
+      {"pointer", CSS_VAL_POINTER},
       {"absolute", CSS_VAL_ABSOLUTE},
-      {"lower-alpha", CSS_VAL_LOWER_ALPHA},
+      {"sans-serif", CSS_VAL_SANS_SERIF},
+      {"super", CSS_VAL_SUPER},
+      {"landscape", CSS_VAL_LANDSCAPE},
+      {"condensed", CSS_VAL_CONDENSED},
       {"activecaption", CSS_VAL_ACTIVECAPTION},
-      {"-konq-normal", CSS_VAL__KONQ_NORMAL},
-      {"appworkspace", CSS_VAL_APPWORKSPACE},
-      {"repeat-x", CSS_VAL_REPEAT_X},
-      {"lower-latin", CSS_VAL_LOWER_LATIN},
-      {"uppercase", CSS_VAL_UPPERCASE},
-      {"level", CSS_VAL_LEVEL},
-      {"visible", CSS_VAL_VISIBLE},
-      {"relative", CSS_VAL_RELATIVE},
-      {"narrower", CSS_VAL_NARROWER},
-      {"upper-roman", CSS_VAL_UPPER_ROMAN},
-      {"above", CSS_VAL_ABOVE},
-      {"cursive", CSS_VAL_CURSIVE},
-      {"default", CSS_VAL_DEFAULT},
+      {"square", CSS_VAL_SQUARE},
+      {"below", CSS_VAL_BELOW},
+      {"double", CSS_VAL_DOUBLE},
       {"s-resize", CSS_VAL_S_RESIZE},
-      {"table-cell", CSS_VAL_TABLE_CELL},
+      {"multiple", CSS_VAL_MULTIPLE},
       {"baseline", CSS_VAL_BASELINE},
-      {"yellow", CSS_VAL_YELLOW},
-      {"fixed", CSS_VAL_FIXED},
+      {"threedshadow", CSS_VAL_THREEDSHADOW},
+      {"nowrap", CSS_VAL_NOWRAP},
+      {"monospace", CSS_VAL_MONOSPACE},
+      {"activeborder", CSS_VAL_ACTIVEBORDER},
+      {"menutext", CSS_VAL_MENUTEXT},
       {"highlight", CSS_VAL_HIGHLIGHT},
-      {"double", CSS_VAL_DOUBLE},
-      {"below", CSS_VAL_BELOW},
-      {"x-large", CSS_VAL_X_LARGE},
-      {"inactivecaption", CSS_VAL_INACTIVECAPTION},
-      {"inline-block", CSS_VAL_INLINE_BLOCK},
-      {"window", CSS_VAL_WINDOW},
+      {"graytext", CSS_VAL_GRAYTEXT},
       {"green", CSS_VAL_GREEN},
-      {"table-row", CSS_VAL_TABLE_ROW},
-      {"infotext", CSS_VAL_INFOTEXT},
-      {"embed", CSS_VAL_EMBED},
+      {"small-caps", CSS_VAL_SMALL_CAPS},
+      {"run-in", CSS_VAL_RUN_IN},
+      {"transparent", CSS_VAL_TRANSPARENT},
+      {"captiontext", CSS_VAL_CAPTIONTEXT},
+      {"underline", CSS_VAL_UNDERLINE},
+      {"inactivecaption", CSS_VAL_INACTIVECAPTION},
+      {"status-bar", CSS_VAL_STATUS_BAR},
+      {"buttonface", CSS_VAL_BUTTONFACE},
       {"n-resize", CSS_VAL_N_RESIZE},
-      {"lowercase", CSS_VAL_LOWERCASE},
-      {"groove", CSS_VAL_GROOVE},
-      {"lower-roman", CSS_VAL_LOWER_ROMAN},
-      {"overline", CSS_VAL_OVERLINE},
-      {"cjk-ideographic", CSS_VAL_CJK_IDEOGRAPHIC},
-      {"text-bottom", CSS_VAL_TEXT_BOTTOM},
-      {"-konq-text", CSS_VAL__KONQ_TEXT},
-      {"inline-table", CSS_VAL_INLINE_TABLE},
-      {"condensed", CSS_VAL_CONDENSED},
-      {"-konq-nowrap", CSS_VAL__KONQ_NOWRAP},
-      {"oblique", CSS_VAL_OBLIQUE},
-      {"georgian", CSS_VAL_GEORGIAN},
+      {"threeddarkshadow", CSS_VAL_THREEDDARKSHADOW},
+      {"hebrew", CSS_VAL_HEBREW},
       {"e-resize", CSS_VAL_E_RESIZE},
-      {"underline", CSS_VAL_UNDERLINE},
-      {"graytext", CSS_VAL_GRAYTEXT},
       {"se-resize", CSS_VAL_SE_RESIZE},
-      {"table-column", CSS_VAL_TABLE_COLUMN},
-      {"-konq-body", CSS_VAL__KONQ_BODY},
-      {"expanded", CSS_VAL_EXPANDED},
-      {"-konq-center", CSS_VAL__KONQ_CENTER},
-      {"close-quote", CSS_VAL_CLOSE_QUOTE},
-      {"line-through", CSS_VAL_LINE_THROUGH},
+      {"windowframe", CSS_VAL_WINDOWFRAME},
+      {"inactiveborder", CSS_VAL_INACTIVEBORDER},
+      {"block-axis", CSS_VAL_BLOCK_AXIS},
+      {"inline-axis", CSS_VAL_INLINE_AXIS},
+      {"progress", CSS_VAL_PROGRESS},
       {"buttontext", CSS_VAL_BUTTONTEXT},
-      {"hebrew", CSS_VAL_HEBREW},
+      {"windowtext", CSS_VAL_WINDOWTEXT},
       {"w-resize", CSS_VAL_W_RESIZE},
-      {"buttonface", CSS_VAL_BUTTONFACE},
       {"sw-resize", CSS_VAL_SW_RESIZE},
-      {"open-quote", CSS_VAL_OPEN_QUOTE},
+      {"small-caption", CSS_VAL_SMALL_CAPTION},
+      {"expanded", CSS_VAL_EXPANDED},
+      {"lower-latin", CSS_VAL_LOWER_LATIN},
+      {"hiragana-iroha", CSS_VAL_HIRAGANA_IROHA},
+      {"georgian", CSS_VAL_GEORGIAN},
+      {"buttonshadow", CSS_VAL_BUTTONSHADOW},
+      {"x-large", CSS_VAL_X_LARGE},
+      {"text-top", CSS_VAL_TEXT_TOP},
       {"ne-resize", CSS_VAL_NE_RESIZE},
+      {"text-bottom", CSS_VAL_TEXT_BOTTOM},
+      {"table-cell", CSS_VAL_TABLE_CELL},
+      {"oblique", CSS_VAL_OBLIQUE},
+      {"lower-roman", CSS_VAL_LOWER_ROMAN},
+      {"highlighttext", CSS_VAL_HIGHLIGHTTEXT},
+      {"purple", CSS_VAL_PURPLE},
+      {"nw-resize", CSS_VAL_NW_RESIZE},
       {"background", CSS_VAL_BACKGROUND},
+      {"table-row", CSS_VAL_TABLE_ROW},
+      {"bidi-override", CSS_VAL_BIDI_OVERRIDE},
       {"xx-large", CSS_VAL_XX_LARGE},
-      {"menutext", CSS_VAL_MENUTEXT},
-      {"buttonshadow", CSS_VAL_BUTTONSHADOW},
-      {"threedface", CSS_VAL_THREEDFACE},
-      {"threedshadow", CSS_VAL_THREEDSHADOW},
-      {"nw-resize", CSS_VAL_NW_RESIZE},
+      {"inactivecaptiontext", CSS_VAL_INACTIVECAPTIONTEXT},
+      {"threedlightshadow", CSS_VAL_THREEDLIGHTSHADOW},
+      {"repeat-x", CSS_VAL_REPEAT_X},
+      {"repeat-y", CSS_VAL_REPEAT_Y},
+      {"threedhighlight", CSS_VAL_THREEDHIGHLIGHT},
+      {"no-repeat", CSS_VAL_NO_REPEAT},
+      {"inline-block", CSS_VAL_INLINE_BLOCK},
+      {"lower-alpha", CSS_VAL_LOWER_ALPHA},
+      {"uppercase", CSS_VAL_UPPERCASE},
+      {"semi-condensed", CSS_VAL_SEMI_CONDENSED},
+      {"inline-table", CSS_VAL_INLINE_TABLE},
+      {"table-column", CSS_VAL_TABLE_COLUMN},
+      {"inline-box", CSS_VAL_INLINE_BOX},
       {"ultra-condensed", CSS_VAL_ULTRA_CONDENSED},
-      {"activeborder", CSS_VAL_ACTIVEBORDER},
+      {"line-through", CSS_VAL_LINE_THROUGH},
+      {"infobackground", CSS_VAL_INFOBACKGROUND},
+      {"close-quote", CSS_VAL_CLOSE_QUOTE},
+      {"table-caption", CSS_VAL_TABLE_CAPTION},
+      {"extra-condensed", CSS_VAL_EXTRA_CONDENSED},
+      {"cjk-ideographic", CSS_VAL_CJK_IDEOGRAPHIC},
+      {"buttonhighlight", CSS_VAL_BUTTONHIGHLIGHT},
+      {"message-box", CSS_VAL_MESSAGE_BOX},
+      {"-konq-auto", CSS_VAL__KONQ_AUTO},
+      {"semi-expanded", CSS_VAL_SEMI_EXPANDED},
+      {"lower-greek", CSS_VAL_LOWER_GREEK},
+      {"-konq-normal", CSS_VAL__KONQ_NORMAL},
+      {"appworkspace", CSS_VAL_APPWORKSPACE},
+      {"-konq-text", CSS_VAL__KONQ_TEXT},
+      {"upper-latin", CSS_VAL_UPPER_LATIN},
+      {"ultra-expanded", CSS_VAL_ULTRA_EXPANDED},
+      {"upper-roman", CSS_VAL_UPPER_ROMAN},
+      {"extra-expanded", CSS_VAL_EXTRA_EXPANDED},
+      {"open-quote", CSS_VAL_OPEN_QUOTE},
+      {"-konq-center", CSS_VAL__KONQ_CENTER},
+      {"-konq-body", CSS_VAL__KONQ_BODY},
+      {"upper-alpha", CSS_VAL_UPPER_ALPHA},
       {"no-close-quote", CSS_VAL_NO_CLOSE_QUOTE},
+      {"decimal-leading-zero", CSS_VAL_DECIMAL_LEADING_ZERO},
+      {"-konq-nowrap", CSS_VAL__KONQ_NOWRAP},
       {"-konq-around-floats", CSS_VAL__KONQ_AROUND_FLOATS},
       {"no-open-quote", CSS_VAL_NO_OPEN_QUOTE},
-      {"bidi-override", CSS_VAL_BIDI_OVERRIDE},
-      {"semi-condensed", CSS_VAL_SEMI_CONDENSED},
-      {"ultra-expanded", CSS_VAL_ULTRA_EXPANDED},
-      {"inactiveborder", CSS_VAL_INACTIVEBORDER},
-      {"highlighttext", CSS_VAL_HIGHLIGHTTEXT},
-      {"inactivecaptiontext", CSS_VAL_INACTIVECAPTIONTEXT},
-      {"threeddarkshadow", CSS_VAL_THREEDDARKSHADOW},
-      {"windowtext", CSS_VAL_WINDOWTEXT},
-      {"semi-expanded", CSS_VAL_SEMI_EXPANDED},
-      {"message-box", CSS_VAL_MESSAGE_BOX},
-      {"buttonhighlight", CSS_VAL_BUTTONHIGHLIGHT},
-      {"lower-greek", CSS_VAL_LOWER_GREEK},
-      {"windowframe", CSS_VAL_WINDOWFRAME},
-      {"extra-condensed", CSS_VAL_EXTRA_CONDENSED},
       {"table-row-group", CSS_VAL_TABLE_ROW_GROUP},
-      {"threedhighlight", CSS_VAL_THREEDHIGHLIGHT},
-      {"infobackground", CSS_VAL_INFOBACKGROUND},
-      {"extra-expanded", CSS_VAL_EXTRA_EXPANDED},
-      {"threedlightshadow", CSS_VAL_THREEDLIGHTSHADOW},
-      {"table-column-group", CSS_VAL_TABLE_COLUMN_GROUP},
       {"table-footer-group", CSS_VAL_TABLE_FOOTER_GROUP},
       {"table-header-group", CSS_VAL_TABLE_HEADER_GROUP},
-      {"-konq-baseline-middle", CSS_VAL__KONQ_BASELINE_MIDDLE},
+      {"table-column-group", CSS_VAL_TABLE_COLUMN_GROUP},
       {"-konq-xxx-large", CSS_VAL__KONQ_XXX_LARGE},
-      {"decimal-leading-zero", CSS_VAL_DECIMAL_LEADING_ZERO}
+      {"-konq-baseline-middle", CSS_VAL__KONQ_BASELINE_MIDDLE}
     };
 
   static const short lookup[] =
@@ -353,170 +365,232 @@ findValue (register const char *str, register unsigned int len)
         -1,   -1,    2,   -1,   -1,   -1,   -1,    3,
         -1,   -1,   -1,   -1,    4,   -1,   -1,   -1,
         -1,    5,   -1,   -1,   -1,   -1,    6,   -1,
-        -1,   -1,   -1,    7,   -1,   -1,   -1,    8,
-         9,   -1,   -1,   -1,   -1, -275, -218,   -2,
-        -1,   12,   -1,   -1,   -1,   -1,   13,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   14,   -1,   -1,   -1,   -1,
-        15,   -1,   -1,   -1,   16,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   17,   -1,   -1,
-        -1,   -1,   -1,   18,   19,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   20,
-        -1,   -1,   21,   22,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   23,   24,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   25,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   26,   -1,   -1,   -1,   -1,   -1,   -1,
-        27,   -1,   -1,   -1,   -1,   -1,   28,   -1,
-        -1,   -1,   -1,   29,   30,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   31,   -1,   -1,   -1,   32,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   33,
-        34,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   35,   36,
-        -1,   -1,   -1,   37,   -1,   -1,   -1,   38,
-        -1,   -1,   -1,   -1,   -1,   39,   -1,   -1,
-        -1,   40,   41,   -1,   42,   -1,   43,   -1,
-        -1,   -1,   -1,   44,   -1,   -1,   -1,   45,
-        -1,   46,   -1,   -1,   -1,   47,   -1,   -1,
-        -1,   -1,   48,   -1,   -1,   -1,   -1,   49,
-        -1,   -1,   -1,   -1,   -1,   -1,   50,   51,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   52,
-        -1,   53,   54,   -1,   55,   -1,   56,   -1,
-        -1,   -1,   57,   -1,   -1,   58,   59,   60,
-        -1,   61,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   62,   -1,   -1,   -1,   -1,   63,   -1,
-        64,   65,   -1,   66,   -1,   -1,   -1,   -1,
-        -1,   67,   -1,   -1,   -1,   68,   -1,   -1,
-        -1,   -1,   69,   -1,   -1,   -1,   70,   71,
-        -1,   -1,   72,   73,   74,   75,   -1,   76,
-        77,   78,   79,   -1,   -1,   -1,   80,   -1,
-        -1,   -1,   81,   -1,   -1,   -1,   -1,   82,
-        -1,   83,   -1,   84,   85,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   86,   -1,
-        -1,   -1,   -1,   87,   -1,   -1,   -1,   -1,
-        -1,   88,   -1,   -1,   -1,   89,   -1,   -1,
-        -1,   90,   91,   -1,   -1,   -1,   92,   93,
-        -1,   -1,   94,   -1,   -1,   95,   -1,   -1,
-        96,   -1,   -1,   -1,   97,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   98,   -1,   -1,
-        -1,   99,   -1,   -1,   -1,   -1,  100,   -1,
-       101,   -1,   -1,  102,   -1,   -1,  103,  104,
-        -1,   -1,   -1,  105,   -1,   -1,   -1,   -1,
-       106,  107,  108,   -1,   -1,   -1,  109,   -1,
-        -1,  110,   -1,   -1,  111,   -1,   -1,  112,
-       113,  114,   -1,   -1,   -1,  115,   -1,   -1,
-        -1,  116,   -1,   -1,  117,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-       118,   -1,   -1,   -1,   -1,   -1,   -1,  119,
-        -1,   -1,  120,  121,  122,  123,   -1,  124,
-       125,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,  126,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,  127,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,  128,   -1,
-        -1,   -1,  129,  130,  131,   -1,   -1,  132,
-        -1,  133,   -1,   -1,   -1,  134,  135,   -1,
-       136,  137,   -1,   -1,  138,   -1,  139,   -1,
-       140,   -1,  141,   -1,   -1,   -1,  142,  143,
-        -1,   -1,   -1,   -1,   -1,  144,   -1,  145,
-        -1,   -1,   -1,   -1,   -1,   -1,  146,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,  147,  148,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,  149,   -1,  150,   -1,   -1,
-        -1,   -1,   -1,  151,   -1,  152,   -1,  153,
-        -1,   -1,   -1,   -1,  154,  155,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,  156,   -1,  157,   -1,   -1,  158,   -1,
-       159,   -1,   -1,   -1,   -1,  160,   -1,   -1,
-        -1,   -1,  161,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,  162,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,  163,  164,   -1,   -1,
-        -1,  165,  166,   -1,   -1,  167,   -1,   -1,
-        -1,   -1,   -1,   -1,  168,   -1,   -1,   -1,
-       169,   -1,  170,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,  171,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-       172,   -1,  173,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,  174,   -1,   -1,  175,
-       176,  177,  178,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,  179,   -1,   -1,   -1,   -1,   -1,
-       180,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,  181,
-       182,   -1,   -1,   -1,   -1,   -1,  183,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,  184,   -1,   -1,   -1,   -1,
-       185,   -1,  186,   -1,  187,   -1,   -1,  188,
-        -1,   -1,   -1,  189,  190,   -1,   -1,   -1,
-       191,  192,   -1,   -1,   -1,  193,   -1,   -1,
-        -1,   -1,   -1,   -1,  194,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,  195,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,  196,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,  197,   -1,   -1,   -1,   -1,  198,
-        -1,   -1,  199,  200,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,  201,
-        -1,   -1,   -1,   -1,   -1,   -1,  202,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,  203,   -1,
-       204,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,  205,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,  206,   -1,   -1,   -1,   -1,   -1,
-        -1,  207,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-       208,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-       209,   -1,   -1,   -1,   -1,  210,  211,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,  212,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,  213,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,  214,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,  215,   -1,   -1,  216,
+        -1,   -1,   -1,    7,   -1,   -1,   -1,   -1,
+         8,   -1,   -1,   -1,   -1, -287, -231,   -2,
+        -1,   -1,   11,   -1,   12,   -1,   -1,   13,
+        -1,   -1,   -1,   -1,   14,   15,   -1,   -1,
+        -1,   16,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   17,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   18,
+        -1,   -1,   19,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   20,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   21,   22,   -1,   -1,
+        -1,   -1,   23,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        24,   -1,   25,   -1,   -1,   -1,   26,   27,
+        -1,   28,   -1,   29,   -1,   -1,   -1,   -1,
+        30,   -1,   31,   32,   33,   34,   35,   -1,
+        36,   -1,   37,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   38,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   39,   -1,   40,
+        -1,   41,   -1,   42,   43,   -1,   44,   45,
+        46,   -1,   -1,   47,   -1,   -1,   48,   -1,
+        49,   -1,   50,   -1,   -1,   -1,   51,   -1,
+        -1,   52,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   53,   54,   -1,
+        55,   56,   -1,   -1,   -1,   57,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   58,   59,   -1,   -1,   60,
+        -1,   -1,   -1,   -1,   61,   -1,   62,   63,
+        -1,   64,   -1,   -1,   65,   -1,   -1,   -1,
+        66,   -1,   -1,   67,   -1,   68,   -1,   -1,
+        69,   70,   71,   -1,   -1,   72,   -1,   -1,
+        -1,   -1,   73,   74,   -1,   -1,   -1,   -1,
+        75,   -1,   -1,   -1,   -1,   -1,   -1,   76,
+        77,   -1,   -1,   -1,   -1,   78,   -1,   -1,
+        79,   -1,   80,   -1,   -1,   81,   -1,   -1,
+        -1,   -1,   82,   -1,   -1,   -1,   -1,   83,
+        84,   85,   -1,   -1,   86,   87,   -1,   -1,
+        -1,   88,   -1,   89,   -1,   -1,   90,   91,
+        -1,   -1,   -1,   92,   93,   94,   -1,   95,
+        96,   -1,   -1,   97,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   98,   -1,   99,   -1,   -1,   -1,
+       100,   -1,   -1,   -1,  101,   -1,  102,  103,
+        -1,   -1,   -1,  104,   -1,   -1,  105,   -1,
+       106,   -1,   -1,   -1,  107,   -1,   -1,   -1,
+       108,  109,   -1,   -1,   -1,  110,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,  111,   -1,
+       112,   -1,   -1,   -1,   -1,  113,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,  114,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,  115,   -1,   -1,   -1,   -1,  116,
+       117,   -1,   -1,  118,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,  119,  120,   -1,
+       121,   -1,   -1,  122,   -1,  123,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,  124,   -1,   -1,
+        -1,   -1,  125,  126,   -1,   -1,  127,  128,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,  129,   -1,   -1,   -1,  130,   -1,
+       131,   -1,   -1,   -1,   -1,   -1,   -1,  132,
+       133,   -1,  134,   -1,  135,   -1,   -1,   -1,
+       136,   -1,  137,   -1,  138,   -1,  139,   -1,
+        -1,   -1,  140,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,  141,  142,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,  143,   -1,   -1,
+       144,  145,  146,   -1,  147,  148,   -1,  149,
+        -1,  150,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,  151,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,  152,
+       153,   -1,   -1,  154,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,  155,   -1,   -1,   -1,   -1,   -1,  156,
+        -1,   -1,  157,  158,  159,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,  160,   -1,
+        -1,  161,   -1,  162,   -1,   -1,   -1,   -1,
+       163,   -1,   -1,   -1,   -1,  164,   -1,   -1,
+        -1,  165,   -1,   -1,   -1,   -1,   -1,  166,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+       167,   -1,   -1,   -1,   -1,   -1,   -1,  168,
+       169,   -1,   -1,   -1,   -1,  170,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,  171,   -1,   -1,
+        -1,   -1,  172,   -1,   -1,   -1,   -1,   -1,
+        -1,  173,   -1,   -1,   -1,   -1,   -1,   -1,
+       174,   -1,  175,   -1,  176,   -1,   -1,   -1,
+        -1,   -1,   -1,  177,   -1,   -1,   -1,   -1,
+       178,   -1,   -1,  179,   -1,   -1,   -1,   -1,
+        -1,  180,  181,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,  182,   -1,
+        -1,   -1,   -1,   -1,  183,   -1,   -1,   -1,
+        -1,   -1,  184,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,  185,   -1,   -1,  186,   -1,   -1,
+        -1,   -1,   -1,   -1,  187,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,  188,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,  189,   -1,   -1,   -1,  190,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,  191,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,  192,   -1,  193,
+        -1,   -1,   -1,  194,   -1,  195,   -1,   -1,
+        -1,   -1,   -1,   -1,  196,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,  197,   -1,   -1,  198,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+       199,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,  200,   -1,  201,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+       202,   -1,  203,  204,   -1,  205,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,  206,   -1,   -1,  207,  208,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,  209,   -1,
+        -1,   -1,   -1,   -1,   -1,  210,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,  211,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,  212,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,  213,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+       214,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,  215,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,  216,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,  217,  218,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,  219,
+       220,   -1,   -1,   -1,  221,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,  222,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,  219,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,  223,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,  220,   -1,   -1,
+        -1,   -1,  224,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-       221,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,  222,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,  223,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,  225,   -1,   -1,
+       226,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,  227,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,  228,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,  229,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+       230,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+       231,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,  232,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+       233,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,  234,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,  235,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,  236,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,  224,   -1,   -1,   -1,
+        -1,  237,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,  238,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
@@ -524,10 +598,8 @@ findValue (register const char *str, register unsigned int len)
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,  225,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,  226,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,  227
+        -1,   -1,   -1,   -1,  239
     };
 
   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
@@ -729,6 +801,8 @@ static const char * const valueList[] = {
 "table-column", 
 "table-cell", 
 "table-caption", 
+"box", 
+"inline-box", 
 "auto", 
 "crosshair", 
 "default", 
@@ -794,6 +868,16 @@ static const char * const valueList[] = {
 "-konq-nowrap", 
 "-konq-normal", 
 "-konq-around-floats", 
+"stretch", 
+"start", 
+"end", 
+"reverse", 
+"horizontal", 
+"vertical", 
+"inline-axis", 
+"block-axis", 
+"single", 
+"multiple", 
     0
 };
 DOMString getValueName(unsigned short id)
diff --git a/WebCore/khtml/css/cssvalues.h b/WebCore/khtml/css/cssvalues.h
index 683bd95..c53c52d 100644
--- a/WebCore/khtml/css/cssvalues.h
+++ b/WebCore/khtml/css/cssvalues.h
@@ -172,72 +172,84 @@ DOM::DOMString getValueName(unsigned short id);
 #define CSS_VAL_TABLE_COLUMN 161
 #define CSS_VAL_TABLE_CELL 162
 #define CSS_VAL_TABLE_CAPTION 163
-#define CSS_VAL_AUTO 164
-#define CSS_VAL_CROSSHAIR 165
-#define CSS_VAL_DEFAULT 166
-#define CSS_VAL_POINTER 167
-#define CSS_VAL_PROGRESS 168
-#define CSS_VAL_MOVE 169
-#define CSS_VAL_E_RESIZE 170
-#define CSS_VAL_NE_RESIZE 171
-#define CSS_VAL_NW_RESIZE 172
-#define CSS_VAL_N_RESIZE 173
-#define CSS_VAL_SE_RESIZE 174
-#define CSS_VAL_SW_RESIZE 175
-#define CSS_VAL_S_RESIZE 176
-#define CSS_VAL_W_RESIZE 177
-#define CSS_VAL_TEXT 178
-#define CSS_VAL_WAIT 179
-#define CSS_VAL_HELP 180
-#define CSS_VAL_LTR 181
-#define CSS_VAL_RTL 182
-#define CSS_VAL_CAPITALIZE 183
-#define CSS_VAL_UPPERCASE 184
-#define CSS_VAL_LOWERCASE 185
-#define CSS_VAL_VISIBLE 186
-#define CSS_VAL_COLLAPSE 187
-#define CSS_VAL_ABOVE 188
-#define CSS_VAL_ABSOLUTE 189
-#define CSS_VAL_ALWAYS 190
-#define CSS_VAL_AVOID 191
-#define CSS_VAL_BELOW 192
-#define CSS_VAL_BIDI_OVERRIDE 193
-#define CSS_VAL_BLINK 194
-#define CSS_VAL_BOTH 195
-#define CSS_VAL_CLOSE_QUOTE 196
-#define CSS_VAL_CROP 197
-#define CSS_VAL_CROSS 198
-#define CSS_VAL_EMBED 199
-#define CSS_VAL_FIXED 200
-#define CSS_VAL_HAND 201
-#define CSS_VAL_HIDE 202
-#define CSS_VAL_HIGHER 203
-#define CSS_VAL_INVERT 204
-#define CSS_VAL_LANDSCAPE 205
-#define CSS_VAL_LEVEL 206
-#define CSS_VAL_LINE_THROUGH 207
-#define CSS_VAL_LOUD 208
-#define CSS_VAL_LOWER 209
-#define CSS_VAL_MIX 210
-#define CSS_VAL_NO_CLOSE_QUOTE 211
-#define CSS_VAL_NO_OPEN_QUOTE 212
-#define CSS_VAL_NOWRAP 213
-#define CSS_VAL_OPEN_QUOTE 214
-#define CSS_VAL_OVERLINE 215
-#define CSS_VAL_PORTRAIT 216
-#define CSS_VAL_PRE 217
-#define CSS_VAL_RELATIVE 218
-#define CSS_VAL_SCROLL 219
-#define CSS_VAL_SEPARATE 220
-#define CSS_VAL_SHOW 221
-#define CSS_VAL_STATIC 222
-#define CSS_VAL_THICK 223
-#define CSS_VAL_THIN 224
-#define CSS_VAL_UNDERLINE 225
-#define CSS_VAL__KONQ_NOWRAP 226
-#define CSS_VAL__KONQ_NORMAL 227
-#define CSS_VAL__KONQ_AROUND_FLOATS 228
+#define CSS_VAL_BOX 164
+#define CSS_VAL_INLINE_BOX 165
+#define CSS_VAL_AUTO 166
+#define CSS_VAL_CROSSHAIR 167
+#define CSS_VAL_DEFAULT 168
+#define CSS_VAL_POINTER 169
+#define CSS_VAL_PROGRESS 170
+#define CSS_VAL_MOVE 171
+#define CSS_VAL_E_RESIZE 172
+#define CSS_VAL_NE_RESIZE 173
+#define CSS_VAL_NW_RESIZE 174
+#define CSS_VAL_N_RESIZE 175
+#define CSS_VAL_SE_RESIZE 176
+#define CSS_VAL_SW_RESIZE 177
+#define CSS_VAL_S_RESIZE 178
+#define CSS_VAL_W_RESIZE 179
+#define CSS_VAL_TEXT 180
+#define CSS_VAL_WAIT 181
+#define CSS_VAL_HELP 182
+#define CSS_VAL_LTR 183
+#define CSS_VAL_RTL 184
+#define CSS_VAL_CAPITALIZE 185
+#define CSS_VAL_UPPERCASE 186
+#define CSS_VAL_LOWERCASE 187
+#define CSS_VAL_VISIBLE 188
+#define CSS_VAL_COLLAPSE 189
+#define CSS_VAL_ABOVE 190
+#define CSS_VAL_ABSOLUTE 191
+#define CSS_VAL_ALWAYS 192
+#define CSS_VAL_AVOID 193
+#define CSS_VAL_BELOW 194
+#define CSS_VAL_BIDI_OVERRIDE 195
+#define CSS_VAL_BLINK 196
+#define CSS_VAL_BOTH 197
+#define CSS_VAL_CLOSE_QUOTE 198
+#define CSS_VAL_CROP 199
+#define CSS_VAL_CROSS 200
+#define CSS_VAL_EMBED 201
+#define CSS_VAL_FIXED 202
+#define CSS_VAL_HAND 203
+#define CSS_VAL_HIDE 204
+#define CSS_VAL_HIGHER 205
+#define CSS_VAL_INVERT 206
+#define CSS_VAL_LANDSCAPE 207
+#define CSS_VAL_LEVEL 208
+#define CSS_VAL_LINE_THROUGH 209
+#define CSS_VAL_LOUD 210
+#define CSS_VAL_LOWER 211
+#define CSS_VAL_MIX 212
+#define CSS_VAL_NO_CLOSE_QUOTE 213
+#define CSS_VAL_NO_OPEN_QUOTE 214
+#define CSS_VAL_NOWRAP 215
+#define CSS_VAL_OPEN_QUOTE 216
+#define CSS_VAL_OVERLINE 217
+#define CSS_VAL_PORTRAIT 218
+#define CSS_VAL_PRE 219
+#define CSS_VAL_RELATIVE 220
+#define CSS_VAL_SCROLL 221
+#define CSS_VAL_SEPARATE 222
+#define CSS_VAL_SHOW 223
+#define CSS_VAL_STATIC 224
+#define CSS_VAL_THICK 225
+#define CSS_VAL_THIN 226
+#define CSS_VAL_UNDERLINE 227
+#define CSS_VAL__KONQ_NOWRAP 228
+#define CSS_VAL__KONQ_NORMAL 229
+#define CSS_VAL__KONQ_AROUND_FLOATS 230
+#define CSS_VAL_STRETCH 231
+#define CSS_VAL_START 232
+#define CSS_VAL_END 233
+#define CSS_VAL_REVERSE 234
+#define CSS_VAL_HORIZONTAL 235
+#define CSS_VAL_VERTICAL 236
+#define CSS_VAL_INLINE_AXIS 237
+#define CSS_VAL_BLOCK_AXIS 238
+#define CSS_VAL_SINGLE 239
+#define CSS_VAL_MULTIPLE 240
 
-#define CSS_VAL_TOTAL 229
+#define CSS_VAL_TOTAL 241
 #endif
 
diff --git a/WebCore/khtml/css/cssvalues.in b/WebCore/khtml/css/cssvalues.in
index 39665a4..da0bcdd 100644
--- a/WebCore/khtml/css/cssvalues.in
+++ b/WebCore/khtml/css/cssvalues.in
@@ -231,6 +231,8 @@ table-column-group
 table-column
 table-cell
 table-caption
+box
+inline-box
 #none
 #
 # CSS_PROP_CURSOR:
@@ -382,3 +384,31 @@ underline
 #A code
 #A #none
 
+# CSS3 Values
+# CSS_PROP_BOX_ALIGN
+stretch
+start
+end
+#center
+#baseline
+
+# CSS_PROP_BOX_DIRECTION
+# normal
+reverse
+
+# CSS_PROP_BOX_ORIENT
+horizontal
+vertical
+inline-axis
+block-axis
+
+# CSS_PROP_BOX_PACK
+# start
+# end
+# center
+# justify
+
+# CSS_PROP_BOX_LINES
+single
+multiple
+
diff --git a/WebCore/khtml/khtml_part.cpp b/WebCore/khtml/khtml_part.cpp
index 584525b..29f06e5 100644
--- a/WebCore/khtml/khtml_part.cpp
+++ b/WebCore/khtml/khtml_part.cpp
@@ -3984,7 +3984,7 @@ void KHTMLPart::setZoomFactor (int percent)
       QApplication::setOverrideCursor( waitCursor );
 #endif
     if (d->m_doc->styleSelector())
-      d->m_doc->styleSelector()->computeFontSizes(d->m_doc->paintDeviceMetrics(), d->m_zoomFactor);
+      d->m_doc->styleSelector()->computeFontSizes(d->m_doc->paintDeviceMetrics());
     d->m_doc->recalcStyle( NodeImpl::Force );
 #if !APPLE_CHANGES
     QApplication::restoreOverrideCursor();
diff --git a/WebCore/khtml/khtmlview.cpp b/WebCore/khtml/khtmlview.cpp
index c33c4f4..135437c 100644
--- a/WebCore/khtml/khtmlview.cpp
+++ b/WebCore/khtml/khtmlview.cpp
@@ -1121,7 +1121,7 @@ void KHTMLView::print()
         root->setPrintingMode(true);
         root->setWidth(metrics.width());
 
-        m_part->xmlDocImpl()->styleSelector()->computeFontSizes(&metrics, 100);
+        m_part->xmlDocImpl()->styleSelector()->computeFontSizes(&metrics);
         m_part->xmlDocImpl()->updateStyleSelector();
         root->setPrintImages( printer->option("kde-khtml-printimages") == "true");
         root->setNeedsLayoutAndMinMaxRecalc();
@@ -1170,7 +1170,7 @@ void KHTMLView::print()
         khtml::setPrintPainter( 0 );
         setMediaType( oldMediaType );
         m_part->xmlDocImpl()->setPaintDevice( this );
-        m_part->xmlDocImpl()->styleSelector()->computeFontSizes(m_part->xmlDocImpl()->paintDeviceMetrics(), m_part->zoomFactor());
+        m_part->xmlDocImpl()->styleSelector()->computeFontSizes(m_part->xmlDocImpl()->paintDeviceMetrics());
         m_part->xmlDocImpl()->updateStyleSelector();
         viewport()->unsetCursor();
     }
diff --git a/WebCore/khtml/rendering/bidi.cpp b/WebCore/khtml/rendering/bidi.cpp
index 7d4d643..55f634f 100644
--- a/WebCore/khtml/rendering/bidi.cpp
+++ b/WebCore/khtml/rendering/bidi.cpp
@@ -1477,10 +1477,9 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start)
                 }
             }
             else if (o->isPositioned()) {
-                // If our original display wasn't an INLINE type, then we can
+                // If our original display wasn't an inline type, then we can
                 // go ahead and determine our static x position now.
-                bool isInlineType = o->style()->originalDisplay() == INLINE ||
-                                    o->style()->originalDisplay() == INLINE_TABLE;
+                bool isInlineType = o->style()->isOriginalDisplayInlineType();
                 bool needToSetStaticX = o->hasStaticX();
                 if (o->hasStaticX() && !isInlineType) {
                     o->setStaticX(o->parent()->style()->direction() == LTR ?
@@ -1507,7 +1506,7 @@ BidiIterator RenderBlock::findNextLineBreak(BidiIterator &start)
                         addMidpoint(startMid); // Stop ignoring spaces.
                         addMidpoint(stopMid); // Start ignoring again.
                     }
-                }                
+                }
             }
         } else if (o->isInlineFlow()) {
             // Only empty inlines matter.  We treat those similarly to replaced elements.
diff --git a/WebCore/khtml/rendering/font.cpp b/WebCore/khtml/rendering/font.cpp
index 9016f01..70c97cf 100644
--- a/WebCore/khtml/rendering/font.cpp
+++ b/WebCore/khtml/rendering/font.cpp
@@ -186,7 +186,7 @@ void Font::update( QPaintDeviceMetrics* devMetrics ) const
 	f.setFirstFamily(fontDef.family);
     f.setItalic(fontDef.italic);
     f.setWeight(fontDef.weight);
-    f.setPixelSize(fontDef.pixelSize());
+    f.setPixelSize(fontDef.computedPixelSize());
     f.setPrinterFont(fontDef.usePrinterFont);
 
     fm.setFont(f);
diff --git a/WebCore/khtml/rendering/font.h b/WebCore/khtml/rendering/font.h
index d00c613..272b84e 100644
--- a/WebCore/khtml/rendering/font.h
+++ b/WebCore/khtml/rendering/font.h
@@ -42,25 +42,25 @@ class FontDef
 {
 public:
     FontDef()
-        : size( 0.0f ), italic( false ), smallCaps( false ), sizeSpecified(false), weight( 50 ), 
+        : specifiedSize(0), computedSize(0), 
+          italic( false ), smallCaps( false ), isAbsoluteSize(false), weight( 50 ), 
           genericFamily(0), hasNbsp( true )
 #if APPLE_CHANGES
           , usePrinterFont( false )
 #endif
-          , logicalSize(3)
           {}
     
     bool operator == ( const FontDef &other ) const {
         return ( family == other.family &&
-                 size == other.size &&
+                 specifiedSize == other.specifiedSize &&
+                 computedSize == other.computedSize &&
                  italic == other.italic &&
                  smallCaps == other.smallCaps &&
                  weight == other.weight &&
-                 sizeSpecified == other.sizeSpecified
+                 isAbsoluteSize == other.isAbsoluteSize
 #if APPLE_CHANGES
                  && usePrinterFont == other.usePrinterFont
 #endif
-                 && logicalSize == other.logicalSize
                  );
     }
 
@@ -72,18 +72,16 @@ public:
     
     KWQFontFamily family;
 
-    int pixelSize() const { return int(size + 0.5f); }
-    float floatSize() const { return size; }
-    void setSize(float s) { size = s; }
+    int computedPixelSize() const { return int(computedSize+0.5); }
+    
+    float specifiedSize; // This is the specified CSS value.  It is independent of rendering issues such as
+                         // integer rounding, minimum font sizes, and zooming.
+    float computedSize; // This is the computed size adjusted for the minimum font size and the zoom
+                        // factor.  
     
-private:
-    float size; // Making this private forces people to think about what value they want,
-                // either the floatSize or the pixelSize.
-
-public:
     bool italic 		: 1;
     bool smallCaps 		: 1;
-    bool sizeSpecified		: 1;  // Whether or not CSS specified an explicit size
+    bool isAbsoluteSize    : 1;  // Whether or not CSS specified an explicit size
                                       // (logical sizes like "medium" don't count).
     unsigned int weight 	: 8;
     unsigned int genericFamily	: 3;
@@ -91,9 +89,6 @@ public:
 #if APPLE_CHANGES
     bool usePrinterFont		: 1;
 #endif
-    short logicalSize;   	       // If a logical size is in effect, then we need to
-                                       // cache this value for family changes (e.g., medium
-                                       // monospace may be different than medium serif).
 };
 
 
diff --git a/WebCore/khtml/rendering/render_block.cpp b/WebCore/khtml/rendering/render_block.cpp
index 697f3cb..8b4c697 100644
--- a/WebCore/khtml/rendering/render_block.cpp
+++ b/WebCore/khtml/rendering/render_block.cpp
@@ -67,7 +67,7 @@ RenderBlock::~RenderBlock()
 void RenderBlock::setStyle(RenderStyle* _style)
 {
     RenderFlow::setStyle(_style);
-    setInline(false);
+    setReplaced(style()->display()==INLINE_BLOCK);
     
     m_pre = false;
     if (_style->whiteSpace() == PRE)
@@ -378,8 +378,8 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
     KHTMLAssert( needsLayout() );
     KHTMLAssert( minMaxKnown() );
     
-    if (isInline()) // Inline <form>s inside various table elements can cause us to
-        return;	    // come in here.  Just bail. -dwh
+    if (isInline() && !isInlineBlockOrInlineTable()) // Inline <form>s inside various table elements can
+        return;	    		                     // cause us to come in here.  Just bail. -dwh
 
     int oldWidth = m_width;
 
@@ -438,12 +438,7 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
         // does painting or event handling.
         m_layer->moveScrollbarsAside();
     }
-        
-    // A quirk that has become an unfortunate standard.  Positioned elements, floating elements
-    // and table cells don't ever collapse their margins with either themselves or their
-    // children.
-    bool canCollapseOwnMargins = !isPositioned() && !isFloating() && !isTableCell();
-
+    
     //    kdDebug( 6040 ) << "childrenInline()=" << childrenInline() << endl;
     if (childrenInline())
         layoutInlineChildren( relayoutChildren );
@@ -451,7 +446,8 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
         layoutBlockChildren( relayoutChildren );
 
     // Expand our intrinsic height to encompass floats.
-    if ( hasOverhangingFloats() && (isFloatingOrPositioned() || style()->hidesOverflow()) )
+    if ( hasOverhangingFloats() && (isFloatingOrPositioned() || style()->hidesOverflow() ||
+                                    (parent() && parent()->isFlexibleBox())) )
         m_height = floatBottom() + borderBottom() + paddingBottom();
            
     int oldHeight = m_height;
@@ -461,7 +457,7 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
 
         // If the block got expanded in size, then increase our overflowheight to match.
         if (m_overflowHeight > m_height)
-            m_overflowHeight -= (borderBottom()+paddingBottom());
+            m_overflowHeight -= paddingBottom() + borderBottom();
         if (m_overflowHeight < m_height)
             m_overflowHeight = m_height;
     }
@@ -490,21 +486,6 @@ void RenderBlock::layoutBlock(bool relayoutChildren)
 
     //kdDebug() << renderName() << " layout width=" << m_width << " height=" << m_height << endl;
 
-    if (canCollapseOwnMargins && m_height == 0) {
-        // We are a block with no border and padding and a computed height
-        // of 0.  The CSS spec states that zero-height blocks collapse their margins
-        // together.
-        // When blocks are self-collapsing, we just use the top margin values and set the
-        // bottom margin max values to 0.  This way we don't factor in the values
-        // twice when we collapse with our previous vertically adjacent and
-        // following vertically adjacent blocks.
-        if (m_maxBottomPosMargin > m_maxTopPosMargin)
-            m_maxTopPosMargin = m_maxBottomPosMargin;
-        if (m_maxBottomNegMargin > m_maxTopNegMargin)
-            m_maxTopNegMargin = m_maxBottomNegMargin;
-        m_maxBottomNegMargin = m_maxBottomPosMargin = 0;
-    }
-
     // Always ensure our overflow width is at least as large as our width.
     if (m_overflowWidth < m_width)
         m_overflowWidth = m_width;
@@ -557,6 +538,14 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
     bool canCollapseWithChildren = !isCanvas() && !isRoot() && !isPositioned() &&
         !isFloating() && !isTableCell() && !style()->hidesOverflow();
     bool canCollapseTopWithChildren = canCollapseWithChildren && (m_height == 0);
+
+    // If any height other than auto is specified in CSS, then we don't collapse our bottom
+    // margins with our children's margins.  To do otherwise would be to risk odd visual
+    // effects when the children overflow out of the parent block and yet still collapse
+    // with it.  We also don't collapse if we had any bottom border/padding (represented by
+    // |toAdd|).
+    bool canCollapseBottomWithChildren = canCollapseWithChildren && (toAdd == 0) &&
+        (style()->height().isVariable() && style()->height().value == 0);
     
     // Whether or not we are a quirky container, i.e., do we collapse away top and bottom
     // margins in our container.
@@ -608,8 +597,9 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
         }
         
         // make sure we relayout children if we need it.
-        if ( relayoutChildren || floatBottom() > m_y ||
-             (child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent())))
+        if (relayoutChildren || floatBottom() > m_y ||
+            (child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent())) ||
+            (child->isRenderBlock() && child->style()->height().isPercent()))
             child->setNeedsLayout(true);
 
         //         kdDebug( 6040 ) << "   " << child->renderName() << " loop " << child << ", " << child->isInline() << ", " << child->needsLayout() << endl;
@@ -626,9 +616,7 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
                     child->setStaticX(borderRight()+paddingRight());
             }
             if (child->hasStaticY()) {
-                int yPosEstimate = m_height;
-                if (prevFlow)
-                    yPosEstimate += prevFlow->collapsedMarginBottom();
+                int yPosEstimate = m_height + (!topMarginContributor ? (prevPosMargin - prevNegMargin) : 0);
                 child->setStaticY(yPosEstimate);
             }
             child = child->nextSibling();
@@ -644,10 +632,16 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
             // float positioned properly, and then subtract the margin out of the
             // height again.  In the case of self-collapsing blocks, we always just
             // use the top margins, since the self-collapsing block collapsed its
-            // own bottom margin into its top margin. -dwh
-            int marginOffset = prevFlow ? (prevFlow->isSelfCollapsingBlock() ?
-                                           prevFlow->collapsedMarginTop() :
-                                           prevFlow->collapsedMarginBottom()) : 0;
+            // own bottom margin into its top margin.
+            //
+            // Note also that the previous flow may collapse its margin into the top of
+            // our block.  If this is the case, then we do not add the margin in to our
+            // height when computing the position of the float.   This condition can be tested
+            // for by simply checking the boolean |topMarginContributor| variable.  See
+            // http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/046.html for
+            // an example of this scenario.
+            int marginOffset = !topMarginContributor ? (prevPosMargin - prevNegMargin) : 0;
+            
             m_height += marginOffset;
             positionNewFloats();
             m_height -= marginOffset;
@@ -732,7 +726,7 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
         // Note this occurs after the test for positioning and floating above, since
         // we want to ensure that we don't artificially increase our height because of
         // a positioned or floating child.
-        if ( (child->style()->hidesOverflow() || child->style()->flowAroundFloats())
+        if ( (child->style()->hidesOverflow() || child->isFlexibleBox() || child->style()->flowAroundFloats() )
              && !child->isFloating() &&
              style()->width().isFixed() && child->minWidth() > lineWidth( m_height ) ) {
             m_height = QMAX( m_height, floatBottom() );
@@ -770,6 +764,15 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
             int posTop = child->maxTopMargin(true);
             int negTop = child->maxTopMargin(false);
 
+            // For self-collapsing blocks, collapse our bottom margins into our
+            // top to get new posTop and negTop values.
+            if (child->isSelfCollapsingBlock()) {
+                if (child->maxBottomMargin(true) > posTop)
+                    posTop = child->maxBottomMargin(true);
+                if (child->maxBottomMargin(false) > negTop)
+                    negTop = child->maxBottomMargin(false);
+            }
+            
             // See if the top margin is quirky. We only care if this child has
             // margins that will collapse with us.
             bool topQuirk = child->isTopMarginQuirk();
@@ -809,19 +812,30 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
 
             int ypos = m_height;
             if (child->isSelfCollapsingBlock()) {
-                // This child has no height.  Update our previous pos and neg
-                // values and just keep going.
-                if (posTop > prevPosMargin)
-                    prevPosMargin = posTop;
-                if (negTop > prevNegMargin)
-                    prevNegMargin = negTop;
-
-                if (!topMarginContributor)
+                // This child has no height.  We need to compute our
+                // position before we collapse the child's margins together,
+                // so that we can get an accurate position for the zero-height block.
+                int collapsedTopPos = prevPosMargin;
+                int collapsedTopNeg = prevNegMargin;
+                if (child->maxTopMargin(true) > prevPosMargin)
+                    collapsedTopPos = prevPosMargin = child->maxTopMargin(true);
+                if (child->maxTopMargin(false) > prevNegMargin)
+                    collapsedTopNeg = prevNegMargin = child->maxTopMargin(false);
+
+                // Now collapse the child's margins together, which means examining our
+                // bottom margin values as well. 
+                if (child->maxBottomMargin(true) > prevPosMargin)
+                    prevPosMargin = child->maxBottomMargin(true);
+                if (child->maxBottomMargin(false) > prevNegMargin)
+                    prevNegMargin = child->maxBottomMargin(false);
+
+                if (!canCollapseTopWithChildren || !topMarginContributor)
                     // We need to make sure that the position of the self-collapsing block
                     // is correct, since it could have overflowing content
                     // that needs to be positioned correctly (e.g., a block that
                     // had a specified height of 0 but that actually had subcontent).
-                    ypos = m_height + prevPosMargin - prevNegMargin;
+
+                    ypos = m_height + collapsedTopPos - collapsedTopNeg;
             }
             else {
                 if (!topMarginContributor ||
@@ -852,7 +866,7 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
                     // quirky flowAroundFloats
                     // property set, when the child shifts to clear an item, its width can
                     // change (because it has more available line width).
-                    // So go ahead an mark the item as dirty.
+                    // So go ahead and mark the item as dirty.
                     child->setNeedsLayout(true);
 
                 if (child->containsFloats() || containsFloats())
@@ -905,7 +919,7 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
 
         if (style()->direction() == LTR) {
             // html blocks flow around floats
-            if (child->style()->hidesOverflow() ||
+            if (child->style()->hidesOverflow() || child->isFlexibleBox() ||
                  (( style()->htmlHacks() || child->isTable() ) && child->style()->flowAroundFloats()))
             {
                 int leftOff = leftOffset(m_height);
@@ -924,7 +938,7 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
             }
         } else {
             chPos -= child->width() + child->marginRight();
-            if (child->style()->hidesOverflow() ||
+            if (child->style()->hidesOverflow() || child->isFlexibleBox() ||
                 ((style()->htmlHacks() || child->isTable()) && child->style()->flowAroundFloats()))
                 chPos -= leftOffset(m_height);
         }
@@ -947,8 +961,7 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
 
         // See if this child has made our overflow need to grow.
         // XXXdwh Work with left overflow as well as right overflow.
-        int rightChildPos = child->xPos() + QMAX(child->overflowWidth(),
-                                                 child->width() + child->marginRight());
+        int rightChildPos = child->xPos() + QMAX(child->overflowWidth(false), child->width());
         if (rightChildPos > m_overflowWidth)
             m_overflowWidth = rightChildPos;
 
@@ -977,14 +990,6 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
         child = child->nextSibling();
     }
 
-    // If any height other than auto is specified in CSS, then we don't collapse our bottom
-    // margins with our children's margins.  To do otherwise would be to risk odd visual
-    // effects when the children overflow out of the parent block and yet still collapse
-    // with it.  We also don't collapse if we had any bottom border/padding (represented by
-    // |toAdd|).
-    bool canCollapseBottomWithChildren = canCollapseWithChildren && (toAdd == 0) &&
-        (style()->height().isVariable() && style()->height().value == 0);
-    
     // If we can't collapse with children then go ahead and add in the bottom margins.
     if (!canCollapseBottomWithChildren
         && (strictMode || !quirkContainer || !bottomChildQuirk))
@@ -1591,7 +1596,7 @@ RenderBlock::clearFloats()
     bool parentHasFloats = false;
     while (prev) {
         if (!prev->isRenderBlock() || prev->isFloating() || prev->isPositioned() ||
-            prev->style()->hidesOverflow() ||
+            prev->style()->hidesOverflow() || prev->isFlexibleBox() ||
             (prev->style()->flowAroundFloats() &&
              // A <table> or <ul> can have a height of 0, so its ypos may be the same
              // as m_y.  That's why we have a <= and not a < here. -dwh
@@ -1624,7 +1629,8 @@ RenderBlock::clearFloats()
     if(!prev->isRenderBlock()) return;
     RenderBlock * flow = static_cast<RenderBlock *>(prev);
     if(!flow->m_floatingObjects) return;
-    if (style()->hidesOverflow() || (( style()->htmlHacks() || isTable() ) && style()->flowAroundFloats()))
+    if (style()->hidesOverflow() || isFlexibleBox() ||
+        (( style()->htmlHacks() || isTable()) && style()->flowAroundFloats()))
         return; // these elements don't allow floats from previous blocks to intrude into their space.
 
     if(flow->floatBottom() > offset)
@@ -1836,7 +1842,8 @@ void RenderBlock::calcMinMaxWidth()
         if (!isTableCell())
             m_minWidth = m_maxWidth;
     }
-
+    // FIXME: also compare with min/max width CSS properties...
+    
     int toAdd = 0;
     toAdd = borderLeft() + borderRight() + paddingLeft() + paddingRight();
 
@@ -1854,7 +1861,6 @@ void RenderBlock::calcMinMaxWidth()
     setMinMaxKnown();
 
     //kdDebug( 6040 ) << "Text::calcMinMaxWidth(" << this << "): min = " << m_minWidth << " max = " << m_maxWidth << endl;
-    // ### compare with min/max width set in style sheet...
 }
 
 struct InlineMinMaxIterator
diff --git a/WebCore/khtml/rendering/render_block.h b/WebCore/khtml/rendering/render_block.h
index 6b735be..b3733ae 100644
--- a/WebCore/khtml/rendering/render_block.h
+++ b/WebCore/khtml/rendering/render_block.h
@@ -92,7 +92,7 @@ public:
     virtual void setStyle(RenderStyle* _style);
 
     virtual void layout();
-    void layoutBlock( bool relayoutChildren );
+    virtual void layoutBlock( bool relayoutChildren );
     void layoutBlockChildren( bool relayoutChildren );
     void layoutInlineChildren( bool relayoutChildren );
 
diff --git a/WebCore/khtml/rendering/render_box.cpp b/WebCore/khtml/rendering/render_box.cpp
index 9f2679b..7825979 100644
--- a/WebCore/khtml/rendering/render_box.cpp
+++ b/WebCore/khtml/rendering/render_box.cpp
@@ -82,7 +82,7 @@ void RenderBox::setStyle(RenderStyle *_style)
     //if(!_style->backgroundXPosition().isVariable() && _style->backgroundYPosition().isVariable())
     //style()->setBackgroundYPosition(Length(50, Percent));
 
-    setInline(style()->display()==INLINE);
+    setInline(_style->isDisplayInlineType());
     
     switch(_style->position())
     {
@@ -154,6 +154,9 @@ int RenderBox::contentHeight() const
     int h = m_height - borderTop() - borderBottom();
     h -= paddingTop() + paddingBottom();
 
+    if (style()->scrollsOverflow() && m_layer)
+        h -= m_layer->horizontalScrollbarHeight();
+
     return h;
 }
 
@@ -489,7 +492,8 @@ short RenderBox::containingBlockWidth() const
         return canvas()->view()->visibleWidth();
     
     RenderBlock* cb = containingBlock();
-    if ((style()->hidesOverflow() || ((style()->htmlHacks() || isTable()) && style()->flowAroundFloats()))
+    if ((style()->hidesOverflow() || isFlexibleBox() ||
+         ((style()->htmlHacks() || isTable()) && style()->flowAroundFloats()))
             && style()->width().isVariable())
         return cb->lineWidth(m_y);
     else
@@ -625,8 +629,17 @@ void RenderBox::calcWidth()
     }
     else
     {
+        // The parent box is flexing us, so it has increased or decreased our width.  We just bail
+        // and leave our width unchanged in this case.
+        if (parent()->isFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL
+            && parent()->isFlexingChildren())
+            return;
+
+        bool inVerticalBox = parent()->isFlexibleBox() && parent()->style()->boxOrient() == VERTICAL;
+        bool stretching = parent()->style()->boxAlign() == BSTRETCH;
+        bool treatAsReplaced = isReplaced() && (!inVerticalBox || !stretching);
         Length w;
-        if ( isReplaced () )
+        if (treatAsReplaced)
             w = Length( calcReplacedWidth(), Fixed );
         else
             w = style()->width();
@@ -636,7 +649,7 @@ void RenderBox::calcWidth()
 
         int cw;
         RenderBlock *cb = containingBlock();
-        if (style()->hidesOverflow() || style()->flowAroundFloats())
+        if (style()->hidesOverflow() || isFlexibleBox() || style()->flowAroundFloats())
             cw = cb->lineWidth( m_y );
         else
             cw = cb->contentWidth();
@@ -651,7 +664,7 @@ void RenderBox::calcWidth()
             // just calculate margins
             m_marginLeft = ml.minWidth(cw);
             m_marginRight = mr.minWidth(cw);
-            if (isReplaced())
+            if (treatAsReplaced)
             {
                 m_width = w.width(cw);
                 m_width += paddingLeft() + paddingRight() + borderLeft() + borderRight();
@@ -662,7 +675,7 @@ void RenderBox::calcWidth()
         }
         else {
             LengthType widthType, minWidthType, maxWidthType;
-            if (isReplaced()) {
+            if (treatAsReplaced) {
                 m_width = w.width(cw);
                 m_width += paddingLeft() + paddingRight() + borderLeft() + borderRight();
                 widthType = w.type;
@@ -694,7 +707,8 @@ void RenderBox::calcWidth()
             }
         }
 
-        if (cw && cw != m_width + m_marginLeft + m_marginRight && !isFloating() && !isInline())
+        if (cw && cw != m_width + m_marginLeft + m_marginRight && !isFloating() && !isInline() &&
+            !cb->isFlexibleBox())
         {
             if (style()->direction()==LTR)
                 m_marginRight = cw - m_width - m_marginLeft;
@@ -794,7 +808,16 @@ void RenderBox::calcHeight()
     else
     {
         Length h;
-        if ( isReplaced() ) {
+        bool inHorizontalBox = parent()->isFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL;
+        bool stretching = parent()->style()->boxAlign() == BSTRETCH;
+        
+        // The parent box is flexing us, so it has increased or decreased our height.  We have to
+        // grab our cached flexible height.
+        if (parent()->isFlexibleBox() && parent()->style()->boxOrient() == VERTICAL
+            && parent()->isFlexingChildren() && style()->boxFlexedHeight() != -1)
+            h = Length(style()->boxFlexedHeight() - borderTop() - borderBottom() -
+                       paddingTop() - paddingBottom(), Fixed);
+        else if ( isReplaced() && (!inHorizontalBox || !stretching )) {
             h = Length( calcReplacedHeight(), Fixed );
         }
         else
@@ -806,6 +829,19 @@ void RenderBox::calcHeight()
         if (isTable())
             return;
 
+        // The parent box is flexing us, so it has increased or decreased our height.  We have to
+        // grab our cached flexible height.
+        if (parent()->isFlexibleBox() && parent()->style()->boxOrient() == VERTICAL
+            && parent()->isFlexingChildren() && style()->boxFlexedHeight() != -1)
+            h = Length(style()->boxFlexedHeight() - borderTop() - borderBottom() -
+                       paddingTop() - paddingBottom(), Fixed);
+        
+        // Block children of horizontal flexible boxes fill the height of the box.
+        if (h.isVariable() && parent()->isFlexibleBox() && parent()->style()->boxOrient() == HORIZONTAL
+            && parent()->isStretchingChildren())
+            h = Length(parent()->contentHeight() - marginTop() - marginBottom() -
+                       borderTop() - paddingTop() - borderBottom() - paddingBottom(), Fixed);
+
         if (!h.isVariable())
         {
             int fh=-1;
diff --git a/WebCore/khtml/rendering/render_container.cpp b/WebCore/khtml/rendering/render_container.cpp
index 97dda9e..a1a0d5e 100644
--- a/WebCore/khtml/rendering/render_container.cpp
+++ b/WebCore/khtml/rendering/render_container.cpp
@@ -84,10 +84,12 @@ void RenderContainer::addChild(RenderObject *newChild, RenderObject *beforeChild
         switch(newChild->style()->display()) {
         case INLINE:
         case BLOCK:
+        case INLINE_BLOCK:
         case LIST_ITEM:
         case RUN_IN:
         case COMPACT:
-        case MARKER:
+        case BOX:
+        case INLINE_BOX:
         case TABLE:
         case INLINE_TABLE:
         case TABLE_COLUMN:
diff --git a/WebCore/khtml/rendering/render_flexbox.cpp b/WebCore/khtml/rendering/render_flexbox.cpp
new file mode 100644
index 0000000..81cbf95
--- /dev/null
+++ b/WebCore/khtml/rendering/render_flexbox.cpp
@@ -0,0 +1,918 @@
+/*
+ * This file is part of the render object implementation for KHTML.
+ *
+ * Copyright (C) 1999 Lars Knoll (knoll at kde.org)
+ *           (C) 1999 Antti Koivisto (koivisto at kde.org)
+ * Copyright (C) 2003 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
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include "render_flexbox.h"
+
+using namespace DOM;
+
+namespace khtml {
+
+class FlexBoxIterator {
+public:
+    FlexBoxIterator(RenderFlexibleBox* parent) {
+        box = parent;
+        if (box->style()->boxOrient() == HORIZONTAL && box->style()->direction() == RTL)
+            forward = box->style()->boxDirection() != BNORMAL;
+        else
+            forward = box->style()->boxDirection() == BNORMAL;
+        lastOrdinal = 1; 
+        if (!forward) {
+            // No choice, since we're going backwards, we have to find out the highest ordinal up front.
+            RenderObject* child = box->firstChild();
+            while (child) {
+                if (child->style()->boxOrdinalGroup() > lastOrdinal)
+                    lastOrdinal = child->style()->boxOrdinalGroup();
+                child = child->nextSibling();
+            }
+        }
+        
+        reset();
+    }
+
+    void reset() {
+        current = 0;
+        currentOrdinal = forward ? 0 : lastOrdinal+1;
+    }
+
+    RenderObject* first() {
+        reset();
+        return next();
+    }
+    
+    RenderObject* next() {
+
+        do { 
+            if (!current) {
+                if (forward) {
+                    currentOrdinal++; 
+                    if (currentOrdinal > lastOrdinal)
+                        return 0;
+                    current = box->firstChild();
+                }
+                else {
+                    currentOrdinal--;
+                    if (currentOrdinal == 0)
+                        return 0;
+                    current = box->lastChild();
+                }
+            }
+            else
+                current = forward ? current->nextSibling() : current->previousSibling();
+            if (current && current->style()->boxOrdinalGroup() > lastOrdinal)
+                lastOrdinal = current->style()->boxOrdinalGroup();
+        } while (!current || current->style()->boxOrdinalGroup() != currentOrdinal ||
+                 current->style()->visibility() == COLLAPSE);
+        return current;
+    }
+
+private:
+    RenderFlexibleBox* box;
+    RenderObject* current;
+    bool forward;
+    unsigned int currentOrdinal;
+    unsigned int lastOrdinal;
+};
+    
+RenderFlexibleBox::RenderFlexibleBox(DOM::NodeImpl* node)
+:RenderBlock(node)
+{
+    setChildrenInline(false); // All of our children must be block-level
+    m_flexingChildren = m_stretchingChildren = false;
+}
+
+RenderFlexibleBox::~RenderFlexibleBox()
+{
+}
+
+void RenderFlexibleBox::calcHorizontalMinMaxWidth()
+{
+    RenderObject *child = firstChild();
+    while (child) {
+        // positioned children don't affect the minmaxwidth
+        if (child->isPositioned() || child->style()->visibility() == COLLAPSE)
+        {
+            child = child->nextSibling();
+            continue;
+        }
+
+        int margin=0;
+        //  auto margins don't affect minwidth
+
+        Length ml = child->style()->marginLeft();
+        Length mr = child->style()->marginRight();
+
+        // Call calcWidth on the child to ensure that our margins are
+        // up to date.  This method can be called before the child has actually
+        // calculated its margins (which are computed inside calcWidth).
+        child->calcWidth();
+
+        if (!(ml.type==Variable) && !(mr.type==Variable))
+        {
+            if (!(child->style()->width().type==Variable))
+            {
+                if (child->style()->direction()==LTR)
+                    margin = child->marginLeft();
+                else
+                    margin = child->marginRight();
+            }
+            else
+                margin = child->marginLeft()+child->marginRight();
+
+        }
+        else if (!(ml.type == Variable))
+            margin = child->marginLeft();
+        else if (!(mr.type == Variable))
+            margin = child->marginRight();
+
+        if (margin < 0) margin = 0;
+
+        m_minWidth += child->minWidth() + margin;
+        m_maxWidth += child->maxWidth() + margin;
+
+        child = child->nextSibling();
+    }    
+}
+
+void RenderFlexibleBox::calcVerticalMinMaxWidth()
+{
+    RenderObject *child = firstChild();
+    while(child != 0)
+    {
+        // positioned children don't affect the minmaxwidth
+        if (child->isPositioned() || child->style()->visibility() == COLLAPSE)
+        {
+            child = child->nextSibling();
+            continue;
+        }
+
+        int margin=0;
+        //  auto margins don't affect minwidth
+
+        Length ml = child->style()->marginLeft();
+        Length mr = child->style()->marginRight();
+
+        if (style()->textAlign() == KONQ_CENTER)
+        {
+            if (ml.type==Fixed) margin+=ml.value;
+            if (mr.type==Fixed) margin+=mr.value;
+        }
+        else
+        {
+            // Call calcWidth on the child to ensure that our margins are
+            // up to date.  This method can be called before the child has actually
+            // calculated its margins (which are computed inside calcWidth).
+            child->calcWidth();
+
+            if (!(ml.type==Variable) && !(mr.type==Variable))
+            {
+                if (!(child->style()->width().type==Variable))
+                {
+                    if (child->style()->direction()==LTR)
+                        margin = child->marginLeft();
+                    else
+                        margin = child->marginRight();
+                }
+                else
+                    margin = child->marginLeft()+child->marginRight();
+
+            }
+            else if (!(ml.type == Variable))
+                margin = child->marginLeft();
+            else if (!(mr.type == Variable))
+                margin = child->marginRight();
+        }
+
+        if (margin<0) margin=0;
+
+        int w = child->minWidth() + margin;
+        if(m_minWidth < w) m_minWidth = w;
+        
+        w = child->maxWidth() + margin;
+
+        if(m_maxWidth < w) m_maxWidth = w;
+
+        child = child->nextSibling();
+    }    
+}
+
+void RenderFlexibleBox::calcMinMaxWidth()
+{
+    KHTMLAssert( !minMaxKnown() );
+
+    m_minWidth = 0;
+    m_maxWidth = 0;
+
+    if (hasMultipleLines() || isVertical())
+        calcVerticalMinMaxWidth();
+    else
+        calcHorizontalMinMaxWidth();
+
+    if(m_maxWidth < m_minWidth) m_maxWidth = m_minWidth;
+
+    if (style()->width().isFixed() && style()->width().value > 0)
+        m_minWidth = m_maxWidth = KMAX(m_minWidth,short(style()->width().value));
+    // FIXME: also compare with min/max width CSS properties...
+    
+    int toAdd = borderLeft() + borderRight() + paddingLeft() + paddingRight();
+    m_minWidth += toAdd;
+    m_maxWidth += toAdd;
+
+    // Scrolling marquees like to use this trick:
+    // <td><div style="overflow:hidden; width:300px"><nobr>.....[lots of text].....</nobr></div></td>
+    // We need to sanity-check our m_minWidth, and not let it exceed our clipped boundary.
+    if (style()->hidesOverflow() && m_minWidth > m_width)
+        m_minWidth = m_width;
+
+    setMinMaxKnown();
+}
+
+void RenderFlexibleBox::layoutBlock(bool relayoutChildren)
+{
+    KHTMLAssert(needsLayout());
+    KHTMLAssert(minMaxKnown());
+
+    int oldWidth = m_width;
+    int oldHeight = m_height;
+    
+    calcWidth();
+    calcHeight();
+    m_overflowWidth = m_width;
+
+    if (oldWidth != m_width || oldHeight != m_height || parent()->isFlexingChildren())
+        relayoutChildren = true;
+
+    m_height = 0;
+    m_overflowHeight = 0;
+    m_flexingChildren = m_stretchingChildren = false;
+
+    initMaxMarginValues();
+
+    if (style()->scrollsOverflow() && m_layer) {
+        // For overflow:scroll blocks, ensure we have both scrollbars in place always.
+        if (style()->overflow() == OSCROLL) {
+            m_layer->setHasHorizontalScrollbar(true);
+            m_layer->setHasVerticalScrollbar(true);
+        }
+
+        // Move the scrollbars aside during layout.  The layer will move them back when it
+        // does painting or event handling.
+        m_layer->moveScrollbarsAside();
+    }
+
+    if (isHorizontal())
+        layoutHorizontalBox(relayoutChildren);
+    else
+        layoutVerticalBox(relayoutChildren);
+    
+    oldHeight = m_height;
+    calcHeight();
+    if (oldHeight != m_height) {
+        relayoutChildren = true;
+
+        // If the block got expanded in size, then increase our overflowheight to match.
+        if (m_overflowHeight > m_height)
+            m_overflowHeight -= (borderBottom()+paddingBottom());
+        if (m_overflowHeight < m_height)
+            m_overflowHeight = m_height;
+    }
+
+    layoutPositionedObjects( relayoutChildren );
+
+    //kdDebug() << renderName() << " layout width=" << m_width << " height=" << m_height << endl;
+
+    if (!isFloatingOrPositioned() && m_height == 0) {
+        // We are a block with no border and padding and a computed height
+        // of 0.  The CSS spec states that zero-height blocks collapse their margins
+        // together.
+        // When blocks are self-collapsing, we just use the top margin values and set the
+        // bottom margin max values to 0.  This way we don't factor in the values
+        // twice when we collapse with our previous vertically adjacent and
+        // following vertically adjacent blocks.
+        if (m_maxBottomPosMargin > m_maxTopPosMargin)
+            m_maxTopPosMargin = m_maxBottomPosMargin;
+        if (m_maxBottomNegMargin > m_maxTopNegMargin)
+            m_maxTopNegMargin = m_maxBottomNegMargin;
+        m_maxBottomNegMargin = m_maxBottomPosMargin = 0;
+    }
+
+    // Always ensure our overflow width is at least as large as our width.
+    if (m_overflowWidth < m_width)
+        m_overflowWidth = m_width;
+
+    // Update our scrollbars if we're overflow:auto/scroll now that we know if
+    // we overflow or not.
+    if (style()->scrollsOverflow() && m_layer)
+        m_layer->checkScrollbarsAfterLayout();
+
+    setNeedsLayout(false);
+}
+
+void RenderFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
+{
+    int toAdd = borderBottom() + paddingBottom();
+    int yPos = borderTop() + paddingTop();
+    int xPos = borderLeft() + paddingLeft();
+    bool heightSpecified = false;
+    int oldHeight = 0;
+    
+    unsigned int highestFlexGroup = 0;
+    unsigned int lowestFlexGroup = 0;
+    bool haveFlex = false;
+    int remainingSpace = 0;
+    m_overflowHeight = m_height;
+
+    // The first walk over our kids is to find out if we have any flexible children.
+    FlexBoxIterator iterator(this);
+    RenderObject* child = iterator.next();
+    while (child) {
+        // Check to see if this child flexes.
+        if (!child->isPositioned() && child->style()->boxFlex() > 0.0f) {
+            // We always have to lay out flexible objects again, since the flex distribution
+            // may have changed, and we need to reallocate space.
+            if (!relayoutChildren)
+                child->setNeedsLayout(true);
+            haveFlex = true;
+            unsigned int flexGroup = child->style()->boxFlexGroup();
+            if (lowestFlexGroup == 0)
+                lowestFlexGroup = flexGroup;
+            if (flexGroup < lowestFlexGroup)
+                lowestFlexGroup = flexGroup;
+            if (flexGroup > highestFlexGroup)
+                highestFlexGroup = flexGroup;
+        }
+        child = iterator.next();
+        continue;
+    }
+    
+    // We do 2 passes.  The first pass is simply to lay everyone out at
+    // their preferred widths.  The second pass handles flexing the children.
+    do {
+        // Reset our height.
+        m_height = yPos;
+        m_overflowHeight = m_height;
+        xPos = borderLeft() + paddingLeft();
+                
+        // Our first pass is done without flexing.  We simply lay the children
+        // out within the box.  We have to do a layout first in order to determine
+        // our box's intrinsic height.
+        child = iterator.first();
+        while (child) {
+            // make sure we relayout children if we need it.
+            if ( relayoutChildren || (child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent())))
+                child->setNeedsLayout(true);
+            
+            if (child->isPositioned()) {
+                child = iterator.next();
+                continue;
+            }
+    
+            // Compute the child's vertical margins.
+            child->calcVerticalMargins();
+    
+            // Now do the layout.
+            child->layoutIfNeeded();
+    
+            // Update our height and overflow height.
+            m_height = QMAX(m_height, yPos+child->marginTop()+child->height()+child->marginBottom());
+            m_overflowHeight = QMAX(m_overflowHeight, yPos+child->marginTop()+child->overflowHeight());
+
+            child = iterator.next();
+        }
+        m_height += toAdd;
+
+        // Always make sure our overflowheight is at least our height.
+        if (m_overflowHeight < m_height)
+            m_overflowHeight = m_height;
+        
+        oldHeight = m_height;
+        calcHeight();
+
+        relayoutChildren = false;
+        if (oldHeight != m_height) {
+            heightSpecified = true;
+    
+            // If the block got expanded in size, then increase our overflowheight to match.
+            if (m_overflowHeight > m_height)
+                m_overflowHeight -= (borderBottom() + paddingBottom());
+            if (m_overflowHeight < m_height)
+                m_overflowHeight = m_height;
+        }
+        
+        // Now that our height is actually known, we can place our boxes.
+        m_stretchingChildren = (style()->boxAlign() == BSTRETCH);
+        child = iterator.first();
+        while (child)
+        {
+            if (child->isPositioned())
+            {
+                child->containingBlock()->insertPositionedObject(child);
+                if (child->hasStaticX()) {
+                    if (style()->direction() == LTR)
+                        child->setStaticX(xPos);
+                    else child->setStaticX(width() - xPos);
+                }
+                if (child->hasStaticY())
+                    child->setStaticY(yPos);
+                child = iterator.next();
+                continue;
+            }
+    
+            // We need to see if this child's height has changed, since we make block elements
+            // fill the height of a containing box by default.
+            // Now do a layout.
+            int oldChildHeight = child->height();
+            static_cast<RenderBox*>(child)->calcHeight();
+            if (oldChildHeight != child->height())
+                child->setNeedsLayout(true);
+            child->layoutIfNeeded();
+    
+            // We can place the child now, using our value of box-align.
+            xPos += child->marginLeft();
+            int childY = yPos;
+            switch (style()->boxAlign()) {
+                case BCENTER:
+                case BBASELINE: // FIXME: Implement support for baseline
+                    childY += (contentHeight() - (child->height() + child->marginTop() + child->marginBottom()))/2;
+                    break;
+                case BEND:
+                    childY += contentHeight() - child->marginBottom() - child->height();
+                    break;
+                default: // BSTART
+                    childY += child->marginTop();
+                    break;
+            }
+    
+            // Place the child.
+            child->setPos(xPos, childY);
+            xPos += child->width() + child->marginRight();
+    
+            child = iterator.next();
+        }
+
+        remainingSpace = borderLeft() + paddingLeft() + contentWidth() - xPos;
+        
+        m_stretchingChildren = false;
+        if (m_flexingChildren)
+            haveFlex = false; // We're done.
+        else if (haveFlex) {
+            // We have some flexible objects.  See if we need to grow/shrink them at all.
+            if (!remainingSpace)
+                break;
+
+            // Allocate the remaining space among the flexible objects.  If we are trying to
+            // grow, then we go from the lowest flex group to the highest flex group.  For shrinking,
+            // we go from the highest flex group to the lowest group.
+            unsigned int start = remainingSpace > 0 ? lowestFlexGroup : highestFlexGroup;
+            unsigned int end = remainingSpace > 0 ? highestFlexGroup : lowestFlexGroup;
+            for (unsigned int i = start; i <= end; i++) {
+                float totalFlex = 0.0f;
+                child = iterator.first();
+                while (child) {
+                    if (child->isPositioned() || child->style()->boxFlex() == 0.0f ||
+                        child->style()->boxFlexGroup() != i) {
+                        child = iterator.next();
+                        continue;
+                    }
+
+                    // Add together the flexes so we can normalize.
+                    totalFlex += child->style()->boxFlex();
+                    
+                    child = iterator.next();
+                    continue;
+                }
+
+                // The flex group may not have any flexible objects. 
+                if (totalFlex == 0.0f)
+                    continue;
+
+                // Now distribute the space to objects.
+                child = iterator.first();
+                while (child && remainingSpace && totalFlex) {
+                    if (child->isPositioned() || child->style()->boxFlex() == 0.0f ||
+                        child->style()->boxFlexGroup() != i) {
+                        child = iterator.next();
+                        continue;
+                    }
+
+                    int spaceAdd = (int)(remainingSpace * (child->style()->boxFlex()/totalFlex));
+                    if (remainingSpace > 0) {
+                        // FIXME: For now just handle fixed values.
+                        if (child->style()->maxWidth().value != UNDEFINED &&
+                            child->style()->maxWidth().isFixed()) {
+                            int maxW = child->style()->maxWidth().value;
+                            int w = child->contentWidth();
+                            int allowedGrowth = QMAX(0, maxW - w);
+                            spaceAdd = QMIN(spaceAdd, allowedGrowth);
+                        }
+                    } else {
+                        // FIXME: For now just handle fixed values.
+                        if (child->style()->minWidth().isFixed()) {
+                            int minW = child->style()->minWidth().value;
+                            int w = child->contentWidth();
+                            int allowedShrinkage = QMIN(0, minW - w);
+                            spaceAdd = QMAX(spaceAdd, allowedShrinkage);
+                        }
+                    }
+
+                    if (spaceAdd) {
+                        child->setWidth(child->width()+spaceAdd);
+                        m_flexingChildren = true;
+                        relayoutChildren = true;
+                    }
+
+                    remainingSpace -= spaceAdd;
+                    totalFlex -= child->style()->boxFlex();
+                    
+                    child = iterator.next();
+                }
+            }
+
+            // We didn't find any children that could grow.
+            if (haveFlex && !m_flexingChildren)
+                haveFlex = false;
+        }
+    } while (haveFlex);
+
+    m_flexingChildren = false;
+    
+    if (xPos > m_overflowWidth)
+        m_overflowWidth = xPos;
+
+    if (remainingSpace > 0 && ((style()->direction() == LTR && style()->boxPack() != BSTART) ||
+                               (style()->direction() == RTL && style()->boxPack() != BEND))) {
+        // Children must be repositioned.
+        int offset = 0;
+        if (style()->boxPack() == BJUSTIFY) {
+            // Determine the total number of children.
+            int totalChildren = 0;
+            child = iterator.first();
+            while (child) {
+                if (child->isPositioned()) {
+                    child = iterator.next();
+                    continue;
+                }
+                totalChildren++;
+                child = iterator.next();
+            }
+
+            // Iterate over the children and space them out according to the
+            // justification level.
+            if (totalChildren > 1) {
+                totalChildren--;
+                bool firstChild = true;
+                child = iterator.first();
+                while (child) {
+                    if (child->isPositioned()) {
+                        child = iterator.next();
+                        continue;
+                    }
+
+                    if (firstChild) {
+                        firstChild = false;
+                        child = iterator.next();
+                        continue;
+                    }
+
+                    offset += remainingSpace/totalChildren;
+                    remainingSpace -= (remainingSpace/totalChildren);
+                    totalChildren--;
+                    child->setPos(child->xPos()+offset, child->yPos());
+                    child = iterator.next();
+                }
+            }
+        }
+        else {
+            if (style()->boxPack() == BCENTER)
+                offset += remainingSpace/2;
+            else // END for LTR, START for RTL
+                offset += remainingSpace;
+            child = iterator.first();
+            while (child) {
+                if (child->isPositioned()) {
+                    child = iterator.next();
+                    continue;
+                }
+                child->setPos(child->xPos()+offset, child->yPos());
+                child = iterator.next();
+            }
+        }
+    }
+    
+    // So that the calcHeight in layoutBlock() knows to relayout positioned objects because of
+    // a height change, we revert our height back to the intrinsic height before returning.
+    if (heightSpecified)
+        m_height = oldHeight;
+}
+
+void RenderFlexibleBox::layoutVerticalBox(bool relayoutChildren)
+{
+    int xPos = borderLeft() + paddingLeft();
+    int yPos = borderTop() + paddingTop();
+    if( style()->direction() == RTL )
+        xPos = m_width - paddingRight() - borderRight();
+    int toAdd = borderBottom() + paddingBottom();
+    bool heightSpecified = false;
+    int oldHeight = 0;
+    
+    unsigned int highestFlexGroup = 0;
+    unsigned int lowestFlexGroup = 0;
+    bool haveFlex = false;
+    int remainingSpace = 0;
+    
+    // The first walk over our kids is to find out if we have any flexible children.
+    FlexBoxIterator iterator(this);
+    RenderObject *child = iterator.next();
+    while (child) {
+        // Check to see if this child flexes.
+        if (!child->isPositioned() && child->style()->boxFlex() > 0.0f) {
+            // We always have to lay out flexible objects again, since the flex distribution
+            // may have changed, and we need to reallocate space.
+            if (!relayoutChildren)
+                child->setNeedsLayout(true);
+            haveFlex = true;
+            unsigned int flexGroup = child->style()->boxFlexGroup();
+            if (lowestFlexGroup == 0)
+                lowestFlexGroup = flexGroup;
+            if (flexGroup < lowestFlexGroup)
+                lowestFlexGroup = flexGroup;
+            if (flexGroup > highestFlexGroup)
+                highestFlexGroup = flexGroup;
+        }
+        child = iterator.next();
+        continue;
+    }
+
+    // We do 2 passes.  The first pass is simply to lay everyone out at
+    // their preferred widths.  The second pass handles flexing the children.
+    // Our first pass is done without flexing.  We simply lay the children
+    // out within the box.
+    do {
+        m_height = borderTop() + paddingTop();
+        int minHeight = m_height + toAdd;
+        m_overflowHeight = m_height;
+
+        child = iterator.first();
+        while (child)
+        {
+            // make sure we relayout children if we need it.
+            if ( relayoutChildren || (child->isReplaced() && (child->style()->width().isPercent() || child->style()->height().isPercent())))
+                child->setNeedsLayout(true);
+    
+            if (child->isPositioned())
+            {
+                child->containingBlock()->insertPositionedObject(child);
+                if (child->hasStaticX()) {
+                    if (style()->direction() == LTR)
+                        child->setStaticX(borderLeft()+paddingLeft());
+                    else
+                        child->setStaticX(borderRight()+paddingRight());
+                }
+                if (child->hasStaticY())
+                    child->setStaticY(m_height);
+                child = iterator.next();
+                continue;
+            } 
+    
+            // Compute the child's vertical margins.
+            child->calcVerticalMargins();
+    
+            // Add in the child's marginTop to our height.
+            m_height += child->marginTop();
+    
+            // Now do a layout.
+            child->layoutIfNeeded();
+    
+            // We can place the child now, using our value of box-align.
+            int childX = borderLeft() + paddingLeft();
+            switch (style()->boxAlign()) {
+                case BCENTER:
+                case BBASELINE: // Baseline just maps to center for vertical boxes
+                    childX += (contentWidth() - (child->width() + child->marginLeft() + child->marginRight()))/2;
+                    break;
+                case BEND:
+                    if (style()->direction() == RTL)
+                        childX += child->marginLeft();
+                    else
+                        childX += contentWidth() - child->marginRight() - child->width();
+                    break;
+                default: // BSTART/BSTRETCH
+                    if (style()->direction() == LTR)
+                        childX += child->marginLeft();
+                    else
+                        childX += contentWidth() - child->marginRight() - child->width();
+                    break;
+            }
+    
+            // Place the child.
+            child->setPos(childX, m_height);
+            m_height += child->height() + child->marginBottom();
+    
+            // See if this child has made our overflow need to grow.
+            // XXXdwh Work with left overflow as well as right overflow.
+            int rightChildPos = child->xPos() + QMAX(child->overflowWidth(false), child->width());
+            if (rightChildPos > m_overflowWidth)
+                m_overflowWidth = rightChildPos;
+            
+            child = iterator.next();
+        }
+
+        yPos = m_height;
+        m_height += toAdd;
+
+        // Negative margins can cause our height to shrink below our minimal height (border/padding).
+        // If this happens, ensure that the computed height is increased to the minimal height.
+        if (m_height < minHeight)
+            m_height = minHeight;
+
+        // Always make sure our overflowheight is at least our height.
+        if (m_overflowHeight < m_height)
+            m_overflowHeight = m_height;
+
+        // Now we have to calc our height, so we know how much space we have remaining.
+        oldHeight = m_height;
+        calcHeight();
+        if (oldHeight != m_height)
+            heightSpecified = true;
+
+        remainingSpace = borderTop() + paddingTop() + contentHeight() - yPos;
+        
+        if (m_flexingChildren)
+            haveFlex = false; // We're done.
+        else if (haveFlex) {
+            // We have some flexible objects.  See if we need to grow/shrink them at all.
+            if (!remainingSpace)
+                break;
+
+            // Allocate the remaining space among the flexible objects.  If we are trying to
+            // grow, then we go from the lowest flex group to the highest flex group.  For shrinking,
+            // we go from the highest flex group to the lowest group.
+            unsigned int start = remainingSpace > 0 ? lowestFlexGroup : highestFlexGroup;
+            unsigned int end = remainingSpace > 0 ? highestFlexGroup : lowestFlexGroup;
+            for (unsigned int i = start; i <= end; i++) {
+                float totalFlex = 0.0f;
+                child = iterator.first();
+                while (child) {
+                    if (child->isPositioned() || child->style()->boxFlex() == 0.0f ||
+                        child->style()->boxFlexGroup() != i) {
+                        child = iterator.next();
+                        continue;
+                    }
+
+                    // Add together the flexes so we can normalize.
+                    totalFlex += child->style()->boxFlex();
+
+                    child = iterator.next();
+                }
+
+                // The flex group may not have any flexible objects.
+                if (totalFlex == 0.0f)
+                    continue;
+
+                // Now distribute the space to objects.
+                child = iterator.first();
+                while (child && remainingSpace && totalFlex) {
+                    if (child->isPositioned() || child->style()->boxFlex() == 0.0f ||
+                        child->style()->boxFlexGroup() != i) {
+                        child = iterator.next();
+                        continue;
+                    }
+
+                    int spaceAdd = (int)(remainingSpace * (child->style()->boxFlex()/totalFlex));
+                    if (remainingSpace > 0) {
+                        // FIXME: For now just handle fixed values.
+                        if (child->style()->maxHeight().value != UNDEFINED &&
+                            child->style()->maxHeight().isFixed()) {
+                            int maxH = child->style()->maxHeight().value;
+                            int h = child->contentHeight();
+                            int allowedGrowth = QMAX(0, maxH - h);
+                            spaceAdd = QMIN(spaceAdd, allowedGrowth);
+                        }
+                    } else {
+                        // FIXME: For now just handle fixed values.
+                        if (child->style()->minHeight().isFixed()) {
+                            int minH = child->style()->minHeight().value;
+                            int h = child->contentHeight();
+                            int allowedShrinkage = QMIN(0, minH - h);
+                            spaceAdd = QMAX(spaceAdd, allowedShrinkage);
+                        }
+                    }
+
+                    if (spaceAdd) {
+                        child->style()->setBoxFlexedHeight(child->height()+spaceAdd);
+                        m_flexingChildren = true;
+                        child->setNeedsLayout(true);
+                    }
+
+                    remainingSpace -= spaceAdd;
+                    totalFlex -= child->style()->boxFlex();
+
+                    child = iterator.next();
+                }
+            }
+
+            // We didn't find any children that could grow.
+            if (haveFlex && !m_flexingChildren)
+                haveFlex = false;
+        }        
+    } while (haveFlex);
+
+    if (style()->boxPack() != BSTART && remainingSpace > 0) {
+        // Children must be repositioned.
+        int offset = 0;
+        if (style()->boxPack() == BJUSTIFY) {
+            // Determine the total number of children.
+            int totalChildren = 0;
+            child = iterator.first();
+            while (child) {
+                if (child->isPositioned()) {
+                    child = iterator.next();
+                    continue;
+                }
+                totalChildren++;
+                child = iterator.next();
+            }
+            
+            // Iterate over the children and space them out according to the
+            // justification level.
+            if (totalChildren > 1) {
+                totalChildren--;
+                bool firstChild = true;
+                child = iterator.first();
+                while (child) {
+                    if (child->isPositioned()) {
+                        child = iterator.next();
+                        continue;
+                    }
+                    
+                    if (firstChild) {
+                        firstChild = false;
+                        child = iterator.next();
+                        continue;
+                    }
+
+                    offset += remainingSpace/totalChildren;
+                    remainingSpace -= (remainingSpace/totalChildren);
+                    totalChildren--;
+                    child->setPos(child->xPos(), child->yPos()+offset);
+                    child = iterator.next();
+                }
+            }
+        }
+        else {
+            if (style()->boxPack() == BCENTER)
+                offset += remainingSpace/2;
+            else // END
+                offset += remainingSpace;
+            child = iterator.first();
+            while (child) {
+                if (child->isPositioned()) {
+                    child = iterator.next();
+                    continue;
+                }
+                child->setPos(child->xPos(), child->yPos()+offset);
+                child = iterator.next();
+            }
+        }
+    }
+    
+    // So that the calcHeight in layoutBlock() knows to relayout positioned objects because of
+    // a height change, we revert our height back to the intrinsic height before returning.
+    if (heightSpecified)
+        m_height = oldHeight;    
+}
+
+const char *RenderFlexibleBox::renderName() const
+{
+    if (isFloating())
+        return "RenderFlexibleBox (floating)";
+    if (isPositioned())
+        return "RenderFlexibleBox (positioned)";
+    if (isRelPositioned())
+        return "RenderFlexibleBox (relative positioned)";
+    return "RenderFlexibleBox";
+}
+
+
+} // namespace khtml
+
diff --git a/WebCore/khtml/rendering/render_flexbox.h b/WebCore/khtml/rendering/render_flexbox.h
new file mode 100644
index 0000000..b562cc6
--- /dev/null
+++ b/WebCore/khtml/rendering/render_flexbox.h
@@ -0,0 +1,65 @@
+/*
+ * This file is part of the render object implementation for KHTML.
+ *
+ * Copyright (C) 2003 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
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef RENDER_FLEXIBLE_BOX_H
+#define RENDER_FLEXIBLE_BOX_H
+
+#include "render_block.h"
+#include "render_style.h"
+
+namespace khtml {
+
+class RenderFlexibleBox : public RenderBlock
+{
+public:
+    RenderFlexibleBox(DOM::NodeImpl* node);
+    virtual ~RenderFlexibleBox();
+
+    virtual void calcMinMaxWidth();
+    void calcHorizontalMinMaxWidth();
+    void calcVerticalMinMaxWidth();
+
+    virtual void layoutBlock(bool relayoutChildren);
+    void layoutHorizontalBox(bool relayoutChildren);
+    void layoutVerticalBox(bool relayoutChildren);
+
+    virtual bool isFlexibleBox() const { return true; }
+    virtual bool isFlexingChildren() const { return m_flexingChildren; }
+    virtual bool isStretchingChildren() const { return m_stretchingChildren; }
+    
+    virtual const char *renderName() const;
+    
+protected:
+    bool hasMultipleLines() { return style()->boxLines() == MULTIPLE; }
+    bool isVertical() { return style()->boxOrient() == VERTICAL; }
+    bool isHorizontal() { return style()->boxOrient() == HORIZONTAL; }
+
+    bool m_flexingChildren : 1;
+    bool m_stretchingChildren : 1;
+};
+
+}; // namespace
+
+#endif // RENDER_FLEXIBLE_BOX_H
+
+
+
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index 592d532..17aa90b 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -36,6 +36,7 @@
 #include "render_arena.h"
 #include "render_inline.h"
 #include "render_block.h"
+#include "render_flexbox.h"
 
 #include <assert.h>
 using namespace DOM;
@@ -83,6 +84,9 @@ RenderObject *RenderObject::createObject(DOM::NodeImpl* node,  RenderStyle* styl
         else
             o = new (arena) RenderBlock(node);
         break;
+    case INLINE_BLOCK:
+        o = new (arena) RenderBlock(node);
+        break;
     case LIST_ITEM:
         o = new (arena) RenderListItem(node);
         break;
@@ -90,8 +94,6 @@ RenderObject *RenderObject::createObject(DOM::NodeImpl* node,  RenderStyle* styl
     case COMPACT:
         o = new (arena) RenderBlock(node);
         break;
-    case MARKER:
-        break;
     case TABLE:
     case INLINE_TABLE:
         //kdDebug( 6040 ) << "creating RenderTable" << endl;
@@ -115,6 +117,10 @@ RenderObject *RenderObject::createObject(DOM::NodeImpl* node,  RenderStyle* styl
     case TABLE_CAPTION:
         o = new (arena) RenderBlock(node);
         break;
+    case BOX:
+    case INLINE_BOX:
+        o = new (arena) RenderFlexibleBox(node);
+        break;
     }
     if(o) o->setStyle(style);
     return o;
@@ -474,8 +480,17 @@ int RenderObject::containingBlockHeight() const
 
 bool RenderObject::sizesToMaxWidth() const
 {
-    return isFloating() || isCompact() ||
-      (element() && (element()->id() == ID_BUTTON || element()->id() == ID_LEGEND));
+    if (isFloating() || isCompact() ||
+        (element() && (element()->id() == ID_BUTTON || element()->id() == ID_LEGEND)))
+        return true;
+
+    // Flexible horizontal boxes lay out children at their maxwidths.  Also vertical boxes
+    // that don't stretch their kids lay out their children at their maxwidths.
+    if (parent()->isFlexibleBox() &&
+        (parent()->style()->boxOrient() == HORIZONTAL || parent()->style()->boxAlign() != BSTRETCH))
+        return true;
+
+    return false;
 }
 
 void RenderObject::drawBorder(QPainter *p, int x1, int y1, int x2, int y2,
@@ -927,8 +942,7 @@ void RenderObject::handleDynamicFloatPositionChange()
     // We have gone from not affecting the inline status of the parent flow to suddenly
     // having an impact.  See if there is a mismatch between the parent flow's
     // childrenInline() state and our state.
-    setInline(m_style->display() == INLINE || // m_style->display() == INLINE_BLOCK ||
-              m_style->display() == INLINE_TABLE);
+    setInline(style()->isDisplayInlineType());
     if (isInline() != parent()->childrenInline()) {
         if (!isInline()) {
             if (parent()->isRenderInline()) {
diff --git a/WebCore/khtml/rendering/render_object.h b/WebCore/khtml/rendering/render_object.h
index 0097f0c..24eb904 100644
--- a/WebCore/khtml/rendering/render_object.h
+++ b/WebCore/khtml/rendering/render_object.h
@@ -599,6 +599,11 @@ public:
 	return style( firstLine )->fontMetrics();
     }
 
+    // Virtual function helpers for CSS3 Flexible Box Layout
+    virtual bool isFlexibleBox() const { return false; }
+    virtual bool isFlexingChildren() const { return false; }
+    virtual bool isStretchingChildren() const { return false; }
+
     // Convenience, to avoid repeating the code to dig down to get this.
     QChar backslashAsCurrencySymbol() const;
 
diff --git a/WebCore/khtml/rendering/render_replaced.cpp b/WebCore/khtml/rendering/render_replaced.cpp
index 3be3637..7197864 100644
--- a/WebCore/khtml/rendering/render_replaced.cpp
+++ b/WebCore/khtml/rendering/render_replaced.cpp
@@ -65,9 +65,14 @@ void RenderReplaced::paint(QPainter *p, int _x, int _y, int _w, int _h,
     _tx += m_x;
     _ty += m_y;
 
+    // These checks should probably be >= and <=, because we
+    // can early exit if the element touches the edges.
     if((_ty > _y + _h) || (_ty + m_height < _y))
         return;
 
+    if((_tx >= _x + _w) || (_tx + m_width <= _x))
+        return;
+
     if(shouldPaintBackgroundOrBorder()) 
         paintBoxDecorations(p, _x, _y, _w, _h, _tx, _ty);
 
diff --git a/WebCore/khtml/rendering/render_style.cpp b/WebCore/khtml/rendering/render_style.cpp
index 470684b..f5f7d04 100644
--- a/WebCore/khtml/rendering/render_style.cpp
+++ b/WebCore/khtml/rendering/render_style.cpp
@@ -128,7 +128,39 @@ bool StyleBackgroundData::operator==(const StyleBackgroundData& o) const
 	outline == o.outline;
 }
 
+StyleFlexibleBoxData::StyleFlexibleBoxData()
+: Shared<StyleFlexibleBoxData>()
+{
+    flex = 0.0f;
+    flex_group = 1;
+    ordinal_group = 1;
+    align = BSTRETCH;
+    pack = BSTART;
+    orient = HORIZONTAL;
+    lines = SINGLE;
+    flexed_height = -1;
+}
 
+StyleFlexibleBoxData::StyleFlexibleBoxData(const StyleFlexibleBoxData& o)
+: Shared<StyleFlexibleBoxData>()
+{
+    flex = o.flex;
+    flex_group = o.flex_group;
+    ordinal_group = o.ordinal_group;
+    align = o.align;
+    pack = o.pack;
+    orient = o.orient;
+    lines = o.lines;
+    flexed_height = o.flexed_height;
+}
+
+bool StyleFlexibleBoxData::operator==(const StyleFlexibleBoxData& o) const
+{
+    return flex == o.flex && flex_group == o.flex_group &&
+           ordinal_group == o.ordinal_group && align == o.align &&
+           pack == o.pack && orient == o.orient && lines == o.lines &&
+           flexed_height == o.flexed_height;
+}
 
 StyleInheritedData::StyleInheritedData()
     : indent( Fixed ), line_height( -100, Percent ), style_image( 0 ),
@@ -174,7 +206,8 @@ RenderStyle::RenderStyle()
     visual = _default->visual;
     background = _default->background;
     surround = _default->surround;
-
+    flexible_box = _default->flexible_box;
+    
     inherited = _default->inherited;
 
     setBitDefaults();
@@ -191,7 +224,8 @@ RenderStyle::RenderStyle(bool)
     visual.init();
     background.init();
     surround.init();
-
+    flexible_box.init();
+    
     inherited.init();
 
     pseudoStyle = 0;
@@ -202,6 +236,7 @@ RenderStyle::RenderStyle(const RenderStyle& o)
     : Shared<RenderStyle>(),
       inherited_flags( o.inherited_flags ), noninherited_flags( o.noninherited_flags ),
       box( o.box ), visual( o.visual ), background( o.background ), surround( o.surround ),
+      flexible_box( o.flexible_box ),
       inherited( o.inherited ), pseudoStyle( 0 ), content( o.content )
 {
 }
@@ -238,6 +273,7 @@ bool RenderStyle::operator==(const RenderStyle& o) const
             visual == o.visual &&
             background == o.background &&
             surround == o.surround &&
+            flexible_box == o.flexible_box &&
             inherited == o.inherited);
 }
 
@@ -340,12 +376,14 @@ RenderStyle::Diff RenderStyle::diff( const RenderStyle *other ) const
 
     if ( *box.get() != *other->box.get() ||
         *surround.get() != *other->surround.get() ||
+         *flexible_box.get() != *other->flexible_box.get() ||
         !(inherited->indent == other->inherited->indent) ||
         !(inherited->line_height == other->inherited->line_height) ||
         !(inherited->style_image == other->inherited->style_image) ||
         !(inherited->cursor_image == other->inherited->cursor_image) ||
         !(inherited->font == other->inherited->font) ||
         !(inherited->border_spacing == other->inherited->border_spacing) ||
+        !(inherited_flags._box_direction == other->inherited_flags._box_direction) ||
         !(inherited_flags._visuallyOrdered == other->inherited_flags._visuallyOrdered) ||
         !(inherited_flags._htmlHacks == other->inherited_flags._htmlHacks) ||
         !(noninherited_flags._position == other->noninherited_flags._position) ||
diff --git a/WebCore/khtml/rendering/render_style.h b/WebCore/khtml/rendering/render_style.h
index f630c04..91bed6b 100644
--- a/WebCore/khtml/rendering/render_style.h
+++ b/WebCore/khtml/rendering/render_style.h
@@ -379,6 +379,36 @@ public:
     BorderValue outline;
 };
 
+//------------------------------------------------
+// CSS3 Flexible Box Properties
+
+enum EBoxAlignment { BSTRETCH, BSTART, BCENTER, BEND, BJUSTIFY, BBASELINE };
+enum EBoxOrient { HORIZONTAL, VERTICAL };
+enum EBoxLines { SINGLE, MULTIPLE };
+enum EBoxDirection { BNORMAL, BREVERSE };
+
+class StyleFlexibleBoxData : public Shared<StyleFlexibleBoxData>
+{
+public:
+    StyleFlexibleBoxData();
+    ~StyleFlexibleBoxData() {}
+    StyleFlexibleBoxData(const StyleFlexibleBoxData& o);
+
+    bool operator==(const StyleFlexibleBoxData& o) const;
+    bool operator!=(const StyleFlexibleBoxData &o) const {
+        return !(*this == o);
+    }
+
+    float flex;
+    unsigned int flex_group;
+    unsigned int ordinal_group;
+    int flexed_height; // Not an actual CSS property. Vertical flexing has to use this as a cache.
+    
+    EBoxAlignment align : 3;
+    EBoxAlignment pack: 3;
+    EBoxOrient orient: 1;
+    EBoxLines lines : 1;
+};
 
 //------------------------------------------------
 // Inherited attributes.
@@ -496,11 +526,11 @@ struct ContentData {
 //------------------------------------------------
 
 enum EDisplay {
-    INLINE, BLOCK, LIST_ITEM, RUN_IN, COMPACT, MARKER,
+    INLINE, BLOCK, LIST_ITEM, RUN_IN, COMPACT, INLINE_BLOCK,
     TABLE, INLINE_TABLE, TABLE_ROW_GROUP,
     TABLE_HEADER_GROUP, TABLE_FOOTER_GROUP, TABLE_ROW,
     TABLE_COLUMN_GROUP, TABLE_COLUMN, TABLE_CELL,
-    TABLE_CAPTION, NONE
+    TABLE_CAPTION, BOX, INLINE_BOX, NONE
 };
 
 class RenderStyle : public Shared<RenderStyle>
@@ -539,10 +569,10 @@ protected:
 	bool _border_collapse : 1 ;
 	EWhiteSpace _white_space : 2;
 	EFontVariant _font_variant : 1;
+        EBoxDirection _box_direction : 1; // CSS3 box_direction property (flexible box layout module)
               // non CSS2 inherited
               bool _visuallyOrdered : 1;
               bool _htmlHacks :1;
-              int _unused : 1;
     } inherited_flags;
 
 // don't inherit
@@ -591,7 +621,8 @@ protected:
     DataRef<StyleVisualData> visual;
     DataRef<StyleBackgroundData> background;
     DataRef<StyleSurroundData> surround;
-
+    DataRef<StyleFlexibleBoxData> flexible_box;
+    
 // inherited attributes
     DataRef<StyleInheritedData> inherited;
 
@@ -624,7 +655,7 @@ protected:
 	inherited_flags._font_variant = FVNORMAL;
 	inherited_flags._visuallyOrdered = false;
 	inherited_flags._htmlHacks=false;
-	inherited_flags._unused = 0;
+        inherited_flags._box_direction = BNORMAL;
 
 	noninherited_flags._effectiveDisplay = noninherited_flags._originalDisplay = INLINE;
 	noninherited_flags._bg_repeat = REPEAT;
@@ -799,7 +830,17 @@ public:
 
     CachedImage *cursorImage() const { return inherited->cursor_image; }
 
-
+    // CSS3 Getter Methods
+    EBoxAlignment boxAlign() { return flexible_box->align; }
+    EBoxDirection boxDirection() { return inherited_flags._box_direction; }
+    float boxFlex() { return flexible_box->flex; }
+    unsigned int boxFlexGroup() { return flexible_box->flex_group; }
+    EBoxLines boxLines() { return flexible_box->lines; }
+    unsigned int boxOrdinalGroup() { return flexible_box->ordinal_group; }
+    EBoxOrient boxOrient() { return flexible_box->orient; }
+    EBoxAlignment boxPack() { return flexible_box->pack; }
+    int boxFlexedHeight() { return flexible_box->flexed_height; }
+    
 // attribute setter methods
 
     void setDisplay(EDisplay v) {  noninherited_flags._effectiveDisplay = v; }
@@ -939,6 +980,17 @@ public:
     int zIndex() const { return box->z_index; }
     void setZIndex(int v) { SET_VAR(box, z_auto, false); SET_VAR(box,z_index,v) }
 
+    // CSS3 Setters
+    void setBoxAlign(EBoxAlignment a) { SET_VAR(flexible_box, align, a); }
+    void setBoxDirection(EBoxDirection d) { inherited_flags._box_direction = d; }
+    void setBoxFlex(float f) { SET_VAR(flexible_box, flex, f); }
+    void setBoxFlexGroup(unsigned int fg) { SET_VAR(flexible_box, flex_group, fg); }
+    void setBoxLines(EBoxLines l) { SET_VAR(flexible_box, lines, l); }
+    void setBoxOrdinalGroup(unsigned int og) { SET_VAR(flexible_box, ordinal_group, og); }
+    void setBoxOrient(EBoxOrient o) { SET_VAR(flexible_box, orient, o); }
+    void setBoxPack(EBoxAlignment p) { SET_VAR(flexible_box, pack, p); }
+    void setBoxFlexedHeight(int h) { SET_VAR(flexible_box, flexed_height, h); }
+    
     QPalette palette() const { return visual->palette; }
     void setPaletteColor(QPalette::ColorGroup g, QColorGroup::ColorRole r, const QColor& c);
     void resetPalette() // Called when the desktop color scheme changes.
@@ -954,6 +1006,15 @@ public:
 
     enum Diff { Equal, NonVisible = Equal, Visible, Position, Layout, CbLayout };
     Diff diff( const RenderStyle *other ) const;
+
+    bool isDisplayInlineType() {
+        return display() == INLINE || display() == INLINE_BLOCK || display() == INLINE_BOX ||
+               display() == INLINE_TABLE;
+    }
+    bool isOriginalDisplayInlineType() {
+        return originalDisplay() == INLINE || originalDisplay() == INLINE_BLOCK ||
+               originalDisplay() == INLINE_BOX || originalDisplay() == INLINE_TABLE;
+    }
 };
 
 
diff --git a/WebCore/khtml/rendering/table_layout.cpp b/WebCore/khtml/rendering/table_layout.cpp
index 50fdef5..016b584 100644
--- a/WebCore/khtml/rendering/table_layout.cpp
+++ b/WebCore/khtml/rendering/table_layout.cpp
@@ -173,8 +173,11 @@ int FixedTableLayout::calcWidthArray( int tableWidth )
 	section = table->foot;
     if ( section ) {
 	cCol = 0;
-	// get the first cell in the first row
-	child = section->firstChild()->firstChild();
+        // FIXME: Technically the first row could be in an arbitrary section (e.g., an nth section
+        // if the previous n-1 sections have no rows), so this check isn't good enough.
+        // get the first cell in the first row
+        RenderObject* firstRow = section->firstChild();
+        child = firstRow ? firstRow->firstChild() : 0;
 	while ( child ) {
 	    if ( child->isTableCell() ) {
 		RenderTableCell *cell = static_cast<RenderTableCell *>(child);
diff --git a/WebCore/khtml/xml/dom_docimpl.cpp b/WebCore/khtml/xml/dom_docimpl.cpp
index 4b78bf0..527c759 100644
--- a/WebCore/khtml/xml/dom_docimpl.cpp
+++ b/WebCore/khtml/xml/dom_docimpl.cpp
@@ -934,7 +934,7 @@ void DocumentImpl::recalcStyle( StyleChange change )
                 fontDef.family.setFamily(stdfont);
                 fontDef.family.appendFamily(0);
             }
-            fontDef.setSize(m_styleSelector->fontSizes()[3]);
+            m_styleSelector->setFontSize(fontDef, m_styleSelector->fontSizes()[3]);
         }
 
         //kdDebug() << "DocumentImpl::attach: setting to charset " << settings->charset() << endl;
@@ -1031,7 +1031,7 @@ void DocumentImpl::attach()
     
     // Create the rendering tree
     m_render = new (m_renderArena) RenderCanvas(this, m_view);
-    m_styleSelector->computeFontSizes(paintDeviceMetrics(), m_view ? m_view->part()->zoomFactor() : 100);
+    m_styleSelector->computeFontSizes(paintDeviceMetrics());
     recalcStyle( Force );
 
     RenderObject* render = m_render;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list