Commit 5241962b authored by justing's avatar justing

Correctly check for input fields and text areas.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@24336 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 50dc2166
......@@ -38,6 +38,7 @@
#include "FrameView.h"
#include "FrameTree.h"
#include "HTMLFrameOwnerElement.h"
#include "HTMLNames.h"
#include "KeyboardEvent.h"
#include "Page.h"
#include "Range.h"
......@@ -50,6 +51,7 @@
namespace WebCore {
using namespace EventNames;
using namespace HTMLNames;
FocusController::FocusController(Page* page)
: m_page(page)
......@@ -238,10 +240,12 @@ static void clearSelectionIfNeeded(Frame* oldFocusedFrame, Frame* newFocusedFram
if (Node* mousePressNode = newFocusedFrame->eventHandler()->mousePressNode())
if (mousePressNode->renderer() && mousePressNode->renderer()->style()->userSelect() == SELECT_IGNORE)
// Don't do this for textareas and text fields, when they lose focus their selections should be cleared
// and then restored when they regain focus, to match other browsers.
if (!s->rootEditableElement()->shadowAncestorNode())
return;
if (Node* root = s->rootEditableElement())
if (Node* shadowAncestorNode = root->shadowAncestorNode())
// Don't do this for textareas and text fields, when they lose focus their selections should be cleared
// and then restored when they regain focus, to match other browsers.
if (!shadowAncestorNode->hasTagName(inputTag) && !shadowAncestorNode->hasTagName(textareaTag))
return;
s->clear();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment