<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>132581</bug_id>
          
          <creation_ts>2006-08-18 02:21:15 +0000</creation_ts>
          <short_desc>Konqueror renders CSS page wrong vs. Firefox</short_desc>
          <delta_ts>2008-09-25 01:58:42 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>konqueror</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>Ubuntu</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter>tilleyrw</reporter>
          <assigned_to name="Konqueror Bugs">konqueror-bugs-null</assigned_to>
          <cc>germain</cc>
    
    <cc>martin.hohenberg</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>461228</commentid>
    <comment_count>0</comment_count>
    <who name="">tilleyrw</who>
    <bug_when>2006-08-18 02:21:15 +0000</bug_when>
    <thetext>Version:            (using KDE KDE 3.5.4)
Installed from:    Ubuntu Packages

When viewing the page &quot;http://www.oswd.org/design/preview/id/2993&quot; in Firefox 1.5, the entire area on the left side of the window (the Pages/Category/Meta links list) is correctly rendered in light green.  When :hover&apos;ing over a line, the background of the line switches to a lighter green.

When this same page is viewed in Konqueror, the heading &quot;Pages/Category/Meta&quot; areas are colored light green.  However, each link line has a yellow background and when :hover&apos;ed over becomes almost white in color.

This is an extremely noticeable CSS-rendering bug that should be easily fixable.

Hope this helps, Bob</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>646988</commentid>
    <comment_count>1</comment_count>
    <who name="Martin Fabian Hohenberg">martin.hohenberg</who>
    <bug_when>2008-09-17 08:04:16 +0000</bug_when>
    <thetext>Still valid in 4.1.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>648725</commentid>
    <comment_count>2</comment_count>
    <who name="Germain Garand">germain</who>
    <bug_when>2008-09-25 01:58:42 +0000</bug_when>
    <thetext>SVN commit 864150 by ggarand:

do not attempt to recover incorrectly written hexadecimal
colours when the parser is in strict mode.

BUG: 132581


 M  +26 -24    cssparser.cpp  


--- trunk/KDE/kdelibs/khtml/css/cssparser.cpp #864149:864150
@@ -2134,31 +2134,33 @@
     }
 }
 
-static bool parseColor(int unit, const QString&amp; name, QRgb&amp; rgb)
+static bool parseColor(int unit, const QString&amp; name, QRgb&amp; rgb, bool strict)
 {
     int len = name.length();
 
     if ( !len )
         return false;
 
-    const unsigned short* c =
-        reinterpret_cast&lt;const unsigned short*&gt;( name.unicode() );
+    if (unit == CSSPrimitiveValue::CSS_RGBCOLOR || !strict) {
+        const unsigned short* c =
+            reinterpret_cast&lt;const unsigned short*&gt;( name.unicode() );
 
-    rgb = 0xff; // fixed alpha
-    if ( len == 6 ) {
-        // RRGGBB
-        bool error = false;
-        for ( int i = 0; i &lt; 6; ++i, ++c )
-            rgb = rgb &lt;&lt; 4 | hex2int( *c, &amp;error );
-        if ( !error )
-            return true;
-    } else if ( len == 3 ) {
-        // RGB, shortcut for RRGGBB
-        bool error = false;
-        for ( int i = 0; i &lt; 3; ++i, ++c )
-            rgb = rgb &lt;&lt; 8 | 0x11 * hex2int( *c, &amp;error );
-        if ( !error )
-            return true;
+        rgb = 0xff; // fixed alpha
+        if ( len == 6 ) {
+            // RRGGBB
+            bool error = false;
+            for ( int i = 0; i &lt; 6; ++i, ++c )
+                rgb = rgb &lt;&lt; 4 | hex2int( *c, &amp;error );
+            if ( !error )
+                return true;
+        } else if ( len == 3 ) {
+            // RGB, shortcut for RRGGBB
+            bool error = false;
+            for ( int i = 0; i &lt; 3; ++i, ++c )
+                rgb = rgb &lt;&lt; 8 | 0x11 * hex2int( *c, &amp;error );
+            if ( !error )
+                return true;
+        }
     }
 
     if ( unit == CSSPrimitiveValue::CSS_IDENT ) {
@@ -2182,17 +2184,17 @@
 CSSPrimitiveValueImpl *CSSParser::parseColorFromValue(Value* value)
 {
     QRgb c = khtml::transparentColor;
-    if ( !strict &amp;&amp; value-&gt;unit == CSSPrimitiveValue::CSS_NUMBER &amp;&amp;
+    if ( !strict &amp;&amp; value-&gt;unit == CSSPrimitiveValue::CSS_NUMBER &amp;&amp;            // color: 000000 (quirk)
               value-&gt;fValue &gt;= 0. &amp;&amp; value-&gt;fValue &lt; 1000000. ) {
         QString str;
         str.sprintf( &quot;%06d&quot;, (int)(value-&gt;fValue+.5) );
-        if ( !::parseColor( value-&gt;unit, str, c ) )
+        if ( !::parseColor( CSSPrimitiveValue::CSS_RGBCOLOR, str, c, strict ) )
             return 0;
     }
-    else if (value-&gt;unit == CSSPrimitiveValue::CSS_RGBCOLOR ||
-             value-&gt;unit == CSSPrimitiveValue::CSS_IDENT ||
-             (!strict &amp;&amp; value-&gt;unit == CSSPrimitiveValue::CSS_DIMENSION)) {
-        if ( !::parseColor( value-&gt;unit, qString( value-&gt;string ), c) )
+    else if (value-&gt;unit == CSSPrimitiveValue::CSS_RGBCOLOR ||                 // color: #ff0000
+             value-&gt;unit == CSSPrimitiveValue::CSS_IDENT ||                    // color: red || color: ff0000 (quirk)
+             (!strict &amp;&amp; value-&gt;unit == CSSPrimitiveValue::CSS_DIMENSION)) {   // color: 00ffff (quirk)
+        if ( !::parseColor( value-&gt;unit, qString( value-&gt;string ), c, strict) )
             return 0;
     }
     else if ( value-&gt;unit == Value::Function &amp;&amp;
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>