+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.
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()) {
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);
}
}
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];
}
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.