Reviewed by Maciej.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Jan 2006 18:15:49 +0000 (18:15 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Jan 2006 18:15:49 +0000 (18:15 +0000)
        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6550
          REGRESSION: window.open('myurl', '_self') fails to load myurl in current window

        Tests:
        * fast/dom/Window/window-open-parent-no-parent.html: Added.
        * fast/dom/Window/window-open-parent.html: Added.
        * fast/dom/Window/window-open-self.html: Added.
        * fast/dom/Window/window-open-top.html: Added.

        * khtml/ecma/kjs_window.cpp: (KJS::WindowFunc::callAsFunction):
        Fix check for special frame names. These special frame names are supposed
        to always be unaffected by pop-up blocking. But the code instead was
        saying that the special frame names are always blocked. Oops!

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@12459 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/khtml/ecma/kjs_window.cpp
WebCore/khtml/html/htmlparser.cpp

index b5945fccd141375f716199227843360682530d7e..f19fe5bc3cd016f35fe5a118c5a84e0ae482ea61 100644 (file)
@@ -1,3 +1,21 @@
+2006-01-29  Darin Adler  <darin@apple.com>
+
+        Reviewed by Maciej.
+
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6550
+          REGRESSION: window.open('myurl', '_self') fails to load myurl in current window
+
+        Tests:
+        * fast/dom/Window/window-open-parent-no-parent.html: Added.
+        * fast/dom/Window/window-open-parent.html: Added.
+        * fast/dom/Window/window-open-self.html: Added.
+        * fast/dom/Window/window-open-top.html: Added.
+
+        * khtml/ecma/kjs_window.cpp: (KJS::WindowFunc::callAsFunction):
+        Fix check for special frame names. These special frame names are supposed
+        to always be unaffected by pop-up blocking. But the code instead was
+        saying that the special frame names are always blocked. Oops!
+
 2006-01-29  Darin Adler  <darin@apple.com>
 
         Suggested by Alexey.
index 7b769706e7e4fb9aacefab275df37c895f66ce6a..95151a0b00039912fe43f449b349cfa8ac6b5b45 100644 (file)
@@ -1589,9 +1589,8 @@ JSValue *WindowFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const Li
   case Window::Open:
   {
       QString frameName = args[1]->isUndefinedOrNull() ? QString("_blank") : args[1]->toString(exec).qstring();
-      if (!allowPopUp(exec, window) && !(frame->findFrame(frameName)))
-          return jsUndefined();
-      if (frameName == "_top" || frameName == "_parent" || frameName == "_self")
+      if (!allowPopUp(exec, window)
+            && !(frameName == "_top" || frameName == "_parent" || frameName == "_self" || frame->findFrame(frameName)))
           return jsUndefined();
       
       WindowArgs windowArgs;
index 6c2afa6073682cca79482cb452c94adf11aa6d62..7c0297647caa2f3fae1411e03c50742275110c7c 100644 (file)
@@ -540,7 +540,8 @@ bool HTMLParser::handleError(NodeImpl* n, bool flat, const AtomicString& localNa
             e = new HTMLDivElementImpl(document);
             insertNode(e);
             handled = true;
-        } else if (h->hasLocalName(dlTag) || h->hasLocalName(dtTag)) {
+        } else if (h->hasLocalName(addressTag) || h->hasLocalName(buttonTag) ||
+                h->hasLocalName(dlTag) || h->hasLocalName(dtTag) ||  h->hasLocalName(fontTag)) {
             popBlock(currentTagName);
             handled = true;
         } else if (h->hasLocalName(selectTag)) {
@@ -559,17 +560,11 @@ bool HTMLParser::handleError(NodeImpl* n, bool flat, const AtomicString& localNa
                 // IE treats a nested select as </select>. Let's do the same
                 popBlock(localName);
             }
-        } else if (h->hasLocalName(addressTag)) {
-            popBlock(currentTagName);
-            handled = true;
         } else if (h->hasLocalName(colgroupTag)) {
             if (!n->isTextNode()) {
                 popBlock(currentTagName);
                 handled = true;
             }
-        } else if (h->hasLocalName(fontTag)) {
-            popBlock(currentTagName);
-            handled = true;
         } else if (!h->hasLocalName(bodyTag)) {
             if (isInline(current)) {
                 popInlineBlocks();