[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdelibs/khtml
From:       Germain Garand <germain () ebooksfrance ! com>
Date:       2004-07-12 19:49:09
Message-ID: 20040712194909.A43E516B04 () office ! kde ! org
[Download RAW message or body]

CVS commit by ggarand: 

* ecma/kjs_navigator.{h,cpp} (getValueProperty):
   implement navigator.productSub. Fixes most
   instances of #68271

Reviewed by David

CCMAIL: 68271@bugs.kde.org


  M +5 -0      ChangeLog   1.268
  M +17 -1     ecma/kjs_navigator.cpp   1.74
  M +2 -2      ecma/kjs_navigator.h   1.26


--- kdelibs/khtml/ChangeLog  #1.267:1.268
@@ -1,2 +1,7 @@
+2004-07-12 Germain Garand <germain@ebooksfrance.org>
+
+        * ecma/kjs_navigator.{h,cpp} (getValueProperty):
+        implement navigator.productSub. Fixes most
+        instances of #68271
 
 2004-07-10 Germain Garand <germain@ebooksfrance.org>

--- kdelibs/khtml/ecma/kjs_navigator.h  #1.25:1.26
@@ -36,6 +36,6 @@ namespace KJS {
     static const ClassInfo info;
     enum { AppCodeName, AppName, AppVersion, Language, UserAgent, UserLanguage, Platform,
-           _Plugins, _MimeTypes, Product, Vendor, CookieEnabled, JavaEnabled, BrowserLanguage,
-           CpuClass };
+           _Plugins, _MimeTypes, Product,  ProductSub, Vendor, CookieEnabled, JavaEnabled, 
+           BrowserLanguage, CpuClass };
     KHTMLPart *part() const { return m_part; }
   private:

--- kdelibs/khtml/ecma/kjs_navigator.cpp  #1.73:1.74
@@ -135,5 +135,5 @@ int KJS::PluginBase::m_refCount = 0;
 const ClassInfo Navigator::info = { "Navigator", 0, &NavigatorTable, 0 };
 /*
-@begin NavigatorTable 11
+@begin NavigatorTable 12
   appCodeName   Navigator::AppCodeName  DontDelete|ReadOnly
   appName       Navigator::AppName      DontDelete|ReadOnly
@@ -149,4 +149,5 @@ const ClassInfo Navigator::info = { "Nav
   product       Navigator::Product      DontDelete|ReadOnly
   vendor        Navigator::Vendor       DontDelete|ReadOnly
+  productSub    Navigator::ProductSub   DontDelete|ReadOnly
   cookieEnabled Navigator::CookieEnabled DontDelete|ReadOnly
   javaEnabled   Navigator::JavaEnabled  DontDelete|Function 0
@@ -194,4 +195,19 @@ Value Navigator::getValueProperty(ExecSt
   case Product:
     return String("Konqueror/khtml");
+  case ProductSub:
+    {
+      int ix = userAgent.find("Gecko");
+      if (ix >= 0 && userAgent.length() >= (uint)ix+14 && userAgent.at(ix+5) == '/' && 
+          userAgent.find(QRegExp("\\d{8}"), ix+6) == ix+6)
+      {
+          // We have Gecko/<productSub> in the UA string
+          return String(userAgent.mid(ix+6, 8));
+      }
+      else if (ix >= 0)
+      {
+          return String("20040107");
+      }
+    } 
+    return Undefined();
   case Vendor:
     return String("KDE");


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic