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

List:       kde-commits
Subject:    =?utf-8?q?=5Bkdelibs/KDE/4=2E7=5D_khtml/ecma=3A_Make_sure_that_s?=
From:       Maks Orlovich <maksim () kde ! org>
Date:       2011-06-22 21:47:35
Message-ID: 20110622214735.7A078A60B9 () git ! kde ! org
[Download RAW message or body]

Git commit 7b3cbac3c4fd2d555ff77f6881cd60b52f23cb76 by Maks Orlovich.
Committed on 22/06/2011 at 23:33.
Pushed by orlovich into branch 'KDE/4.7'.

Make sure that setting the hash to empty sets it #, as per HTML5 2.6
Fixes reload loop on the correlate googlelab (reported on IRC)

M  +9    -2    khtml/ecma/kjs_window.cpp     

http://commits.kde.org/kdelibs/7b3cbac3c4fd2d555ff77f6881cd60b52f23cb76

diff --git a/khtml/ecma/kjs_window.cpp b/khtml/ecma/kjs_window.cpp
index 5437591..6b6a795 100644
--- a/khtml/ecma/kjs_window.cpp
+++ b/khtml/ecma/kjs_window.cpp
@@ -2723,8 +2723,15 @@ void Location::put(ExecState *exec, const Identifier &p, JSValue *v, int attr)
         str = str.mid(1);
 
       // Note that we want to do gotoAnchor even when the hash is already set, so we
-      // scroll the destination into view
-      url.setRef(str);
+      // scroll the destination into view.
+
+      // Setting this must always provide a ref, even if just ; see
+      // HTML5 2.6.
+      if (str.isEmpty()) {
+        url.setHTMLRef("");
+      } else {
+        url.setRef(str);
+      }
       break;
     case Host: {
       QString host = str.left(str.indexOf(":"));

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

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