From d2c9549a5464809907404de548de38d363f09c4c Mon Sep 17 00:00:00 2001 From: mjs Date: Thu, 23 Sep 2004 21:25:30 +0000 Subject: [PATCH] WebCore: Reviewed by Darin. REGRESSION (Mail): links are not properly editable * khtml/html/html_inlineimpl.cpp: (HTMLAnchorElementImpl::isFocusable): If this element is editable, then follow the normal focus rules so the link does not swallow focus when you arrow key or drag-select into it. WebKit: Reviewed by Darin. REGRESSION (Mail): links are not properly editable * WebView.subproj/WebDefaultUIDelegate.m: By default, don't allow link dragging if the element under the mouse pointer is editable. This way, you can drag-select starting inside a link. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7660 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- WebCore/ChangeLog-2005-08-23 | 11 +++++++++++ WebCore/khtml/html/html_inlineimpl.cpp | 3 +++ WebKit/ChangeLog | 10 ++++++++++ WebKit/WebView.subproj/WebDefaultUIDelegate.m | 5 +++++ 4 files changed, 29 insertions(+) diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23 index 30495654c53d..7ec7786a23f8 100644 --- a/WebCore/ChangeLog-2005-08-23 +++ b/WebCore/ChangeLog-2005-08-23 @@ -1,3 +1,14 @@ +2004-09-23 Maciej Stachowiak + + Reviewed by Darin. + + REGRESSION (Mail): links are not properly editable + + * khtml/html/html_inlineimpl.cpp: + (HTMLAnchorElementImpl::isFocusable): If this element is editable, then follow + the normal focus rules so the link does not swallow focus when you arrow key + or drag-select into it. + 2004-09-23 Darin Adler - added test for the DOM::Range bug fixed recently diff --git a/WebCore/khtml/html/html_inlineimpl.cpp b/WebCore/khtml/html/html_inlineimpl.cpp index 43af4d3aed04..3509b4d5d59a 100644 --- a/WebCore/khtml/html/html_inlineimpl.cpp +++ b/WebCore/khtml/html/html_inlineimpl.cpp @@ -55,6 +55,9 @@ HTMLAnchorElementImpl::~HTMLAnchorElementImpl() bool HTMLAnchorElementImpl::isFocusable() const { + if (isContentEditable()) + return HTMLElementImpl::isFocusable(); + // FIXME: Even if we are not visible, we might have a child that is visible. // Dave wants to fix that some day with a "has visible content" flag or the like. if (!(m_hasAnchor && m_render && m_render->style()->visibility() == VISIBLE)) diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog index e570841d0fe0..fec57a3c39d5 100644 --- a/WebKit/ChangeLog +++ b/WebKit/ChangeLog @@ -1,3 +1,13 @@ +2004-09-23 Maciej Stachowiak + + Reviewed by Darin. + + REGRESSION (Mail): links are not properly editable + + * WebView.subproj/WebDefaultUIDelegate.m: By default, don't allow + link dragging if the element under the mouse pointer is + editable. This way, you can drag-select starting inside a link. + 2004-09-23 John Sullivan Reviewed by Chris. diff --git a/WebKit/WebView.subproj/WebDefaultUIDelegate.m b/WebKit/WebView.subproj/WebDefaultUIDelegate.m index 823e967598ae..c830c038fb93 100644 --- a/WebKit/WebView.subproj/WebDefaultUIDelegate.m +++ b/WebKit/WebView.subproj/WebDefaultUIDelegate.m @@ -10,6 +10,7 @@ #import #import #import +#import @interface NSApplication (DeclarationStolenFromAppKit) - (void)_cycleWindowsReversed:(BOOL)reversed; @@ -189,6 +190,10 @@ static WebDefaultUIDelegate *sharedDelegate = nil; - (unsigned)webView:(WebView *)webView dragSourceActionMaskForPoint:(NSPoint)point; { + DOMElement *elementAtPoint = [[webView elementAtPoint:point] objectForKey:WebElementDOMNodeKey]; + if ([elementAtPoint respondsToSelector:@selector(isContentEditable)] && [(id)elementAtPoint isContentEditable]) + return (WebDragSourceActionAny & ~WebDragSourceActionLink); + return WebDragSourceActionAny; } -- 2.36.0