Reviewed by Harrison.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Jan 2005 18:49:14 +0000 (18:49 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Jan 2005 18:49:14 +0000 (18:49 +0000)
        - fixed <rdar://problem/3935275> unexpected quit scrolling over link; last.fm (works in IE and Firefox)

        * kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]): By using the correct document, fix the crash reported here.
        The page still crashes when you close the browser window, but it's not trivial to fix so I'll file a new bug after that.

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

WebCore/ChangeLog-2005-08-23
WebCore/kwq/WebCoreBridge.mm

index 19b405652b0d0214a9329c81ac564b40f21690c0..6c7df506be52467d5b9e4b61686d5f5f9d2b90c8 100644 (file)
@@ -1,3 +1,12 @@
+2005-01-31  Darin Adler  <darin@apple.com>
+
+        Reviewed by Harrison.
+
+        - fixed <rdar://problem/3935275> unexpected quit scrolling over link; last.fm (works in IE and Firefox)
+
+        * kwq/WebCoreBridge.mm: (-[WebCoreBridge elementAtPoint:]): By using the correct document, fix the crash reported here.
+        The page still crashes when you close the browser window, but it's not trivial to fix so I'll file a new bug after that.
+
 2005-01-31  Darin Adler  <darin@apple.com>
 
         Reviewed by Ken and Harrison.
index aa69d470c115de510c11561f7cf5bed302a1bb8d..057541ebc92fffc2a1e3bfaa18dc2a336cd7b476 100644 (file)
@@ -1017,6 +1017,8 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
     NodeImpl *URLNode = nodeInfo.URLElement();
     if (URLNode) {
         ElementImpl *e = static_cast<ElementImpl *>(URLNode);
+        DocumentImpl *doc = e->getDocument();
+        ASSERT(doc);
         
         const AtomicString& title = e->getAttribute(ATTR_TITLE);
         if (!title.isEmpty()) {
@@ -1028,7 +1030,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
         const AtomicString& link = e->getAttribute(ATTR_HREF);
         if (!link.isNull()) {
             if (e->firstChild()) {
-                Range r(_part->document());
+                Range r(doc);
                 r.setStartBefore(e->firstChild());
                 r.setEndAfter(e->lastChild());
                 QString t = _part->text(r);
@@ -1037,12 +1039,12 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
                 }
             }
             QString URLString = parseURL(link).string();
-            [element setObject:_part->xmlDocImpl()->completeURL(URLString).getNSString() forKey:WebCoreElementLinkURLKey];
+            [element setObject:doc->completeURL(URLString).getNSString() forKey:WebCoreElementLinkURLKey];
         }
         
         DOMString target = e->getAttribute(ATTR_TARGET);
-        if (target.isEmpty() && _part->xmlDocImpl()) {
-            target = _part->xmlDocImpl()->baseTarget();
+        if (target.isEmpty() && doc) { // FIXME: Take out this doc check when we're not just before a release.
+            target = doc->baseTarget();
         }
         if (!target.isEmpty()) {
             [element setObject:target.string().getNSString() forKey:WebCoreElementLinkTargetFrameKey];
@@ -1078,7 +1080,7 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
             }
             if (!attr.isEmpty()) {
                 QString URLString = parseURL(attr).string();
-                [element setObject:_part->xmlDocImpl()->completeURL(URLString).getNSString() forKey:WebCoreElementImageURLKey];
+                [element setObject:i->getDocument()->completeURL(URLString).getNSString() forKey:WebCoreElementImageURLKey];
             }
             
             // FIXME: Code copied from RenderImage::updateFromElement; should share.