[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:59:02 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 6ba9ebc93c42bf4463dd5fef9c2fea3484fab7ba
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 1 20:30:38 2003 +0000

    	Fix for 3163840, the images are mispositioned on the DHTML menus at the top of
    	www.aa.com (and in many other places).  We needed to support returning the right
    	value from hasProperty and tryGet for 'cssFloat'.
    
    	This patch also adds support for getting/setting our custom CSS properties (-khtml-*)
    	and just factors the code a bit better for all the special values.
    
            Reviewed by darin
    
            * khtml/ecma/kjs_css.cpp:
            (cssPropertyName):
            (DOMCSSStyleDeclaration::hasProperty):
            (DOMCSSStyleDeclaration::tryGet):
            (DOMCSSStyleDeclaration::tryPut):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5105 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index c0ff38b..10655b6 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,20 @@
+2003-10-01  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3163840, the images are mispositioned on the DHTML menus at the top of
+	www.aa.com (and in many other places).  We needed to support returning the right
+	value from hasProperty and tryGet for 'cssFloat'.  
+
+	This patch also adds support for getting/setting our custom CSS properties (-khtml-*)
+	and just factors the code a bit better for all the special values.
+	
+        Reviewed by darin
+
+        * khtml/ecma/kjs_css.cpp:
+        (cssPropertyName):
+        (DOMCSSStyleDeclaration::hasProperty):
+        (DOMCSSStyleDeclaration::tryGet):
+        (DOMCSSStyleDeclaration::tryPut):
+
 2003-10-01  Darin Adler  <darin at apple.com>
 
         Reviewed by Dave.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index c0ff38b..10655b6 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,20 @@
+2003-10-01  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3163840, the images are mispositioned on the DHTML menus at the top of
+	www.aa.com (and in many other places).  We needed to support returning the right
+	value from hasProperty and tryGet for 'cssFloat'.  
+
+	This patch also adds support for getting/setting our custom CSS properties (-khtml-*)
+	and just factors the code a bit better for all the special values.
+	
+        Reviewed by darin
+
+        * khtml/ecma/kjs_css.cpp:
+        (cssPropertyName):
+        (DOMCSSStyleDeclaration::hasProperty):
+        (DOMCSSStyleDeclaration::tryGet):
+        (DOMCSSStyleDeclaration::tryPut):
+
 2003-10-01  Darin Adler  <darin at apple.com>
 
         Reviewed by Dave.
diff --git a/WebCore/khtml/ecma/kjs_css.cpp b/WebCore/khtml/ecma/kjs_css.cpp
index 116f635..3c2735e 100644
--- a/WebCore/khtml/ecma/kjs_css.cpp
+++ b/WebCore/khtml/ecma/kjs_css.cpp
@@ -31,18 +31,37 @@
 using namespace KJS;
 #include <kdebug.h>
 
-static QString jsNameToProp( const Identifier &p )
+static QString cssPropertyName(const Identifier &p, bool *hadPixelOrPosPrefix = 0)
 {
     QString prop = p.qstring();
+
     int i = prop.length();
-    while( --i ) {
+    while (--i) {
 	char c = prop[i].latin1();
-	if ( c < 'A' || c > 'Z' )
-	    continue;
-	prop.insert( i, '-' );
+	if (c >= 'A' && c <= 'Z')
+            prop.insert(i, '-');
+    }
+
+    prop = prop.lower();
+
+    if (hadPixelOrPosPrefix)
+        *hadPixelOrPosPrefix = false;
+
+    if (prop.startsWith("css-")) {
+        prop = prop.mid(4);
+    } else if (prop.startsWith("pixel-")) {
+        prop = prop.mid(6);
+        if (hadPixelOrPosPrefix)
+            *hadPixelOrPosPrefix = true;
+    } else if (prop.startsWith("pos-")) {
+        prop = prop.mid(4);
+        if (hadPixelOrPosPrefix)
+            *hadPixelOrPosPrefix = true;
+    } else if (prop.startsWith("khtml-")) {
+        prop.insert(0, '-');
     }
 
-    return prop.lower();
+    return prop;
 }
 
 /*
@@ -77,9 +96,11 @@ DOMCSSStyleDeclaration::~DOMCSSStyleDeclaration()
 
 bool DOMCSSStyleDeclaration::hasProperty(ExecState *exec, const Identifier &p) const
 {
-  DOM::DOMString cssprop = jsNameToProp(p);
-  // strip pos- / pixel- prefix here?
-  if (DOM::getPropertyID(cssprop.string().ascii(), cssprop.length()))
+  if (p == "cssText")
+    return true;
+
+  QString prop = cssPropertyName(p);    
+  if (DOM::getPropertyID(prop.ascii(), prop.length()))
       return true;
 
   return ObjectImp::hasProperty(exec, p);
@@ -114,26 +135,21 @@ Value DOMCSSStyleDeclaration::tryGet(ExecState *exec, const Identifier &property
     return getStringOrNull(DOM::CSSStyleDeclaration(styleDecl).item(u));
 
 #ifdef KJS_VERBOSE
-  kdDebug(6070) << "DOMCSSStyleDeclaration: converting to css property name: " << jsNameToProp(propertyName) << endl;
+  kdDebug(6070) << "DOMCSSStyleDeclaration: converting to css property name: " << cssPropertyName(propertyName) << endl;
 #endif
   DOM::CSSStyleDeclaration styleDecl2 = styleDecl;
-  DOM::DOMString p = jsNameToProp(propertyName);
-  bool asNumber = false;
+
+  // Set up pixelOrPos boolean to handle the fact that
   // pixelTop returns "CSS Top" as number value in unit pixels
   // posTop returns "CSS top" as number value in unit pixels _if_ its a
   // positioned element. if it is not a positioned element, return 0
   // from MSIE documentation ### IMPLEMENT THAT (Dirk)
-  {
-    QString prop = p.string();
-    if(prop.startsWith( "pixel-") || prop.startsWith( "pos-" ) ) {
-      p = prop.mid(prop.find( '-' )+1);
-      asNumber = true;
-    }
-  }
+  bool pixelOrPos;
+  DOM::DOMString p = cssPropertyName(propertyName, &pixelOrPos);
 
   DOM::CSSValue v = styleDecl2.getPropertyCSSValue(p);
   if (!v.isNull()) {
-    if (asNumber && v.cssValueType() == DOM::CSSValue::CSS_PRIMITIVE_VALUE)
+    if (pixelOrPos && v.cssValueType() == DOM::CSSValue::CSS_PRIMITIVE_VALUE)
       return Number(static_cast<DOM::CSSPrimitiveValue>(v).getFloatValue(DOM::CSSPrimitiveValue::CSS_PX));
 
     return getStringOrNull(v.cssText());
@@ -148,10 +164,8 @@ Value DOMCSSStyleDeclaration::tryGet(ExecState *exec, const Identifier &property
 }
 
 
-void DOMCSSStyleDeclaration::tryPut(ExecState *exec, const Identifier &pName, const Value& value, int )
+void DOMCSSStyleDeclaration::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int )
 {
-  Identifier propertyName = pName;
-
 #ifdef KJS_VERBOSE
   kdDebug(6070) << "DOMCSSStyleDeclaration::tryPut " << propertyName.qstring() << endl;
 #endif
@@ -159,16 +173,11 @@ void DOMCSSStyleDeclaration::tryPut(ExecState *exec, const Identifier &pName, co
     styleDecl.setCssText(value.toString(exec).string());
   }
   else {
-    QString prop = jsNameToProp(propertyName);
+    bool pixelOrPos;
+    QString prop = cssPropertyName(propertyName, &pixelOrPos);
     QString propvalue = value.toString(exec).qstring();
-
-    if(prop.left(4) == "css-")
-      prop = prop.mid(4);
-
-    if(prop.startsWith( "pixel-") || prop.startsWith( "pos-" ) ) {
-      prop = prop.mid(prop.find( '-' )+1);
+    if (pixelOrPos)
       propvalue += "px";
-    }
 #ifdef KJS_VERBOSE
     kdDebug(6070) << "DOMCSSStyleDeclaration: prop=" << prop << " propvalue=" << propvalue << endl;
 #endif

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list