diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-09-13 12:51:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 20:50:05 +0200 |
commit | d441d6f39bb846989d95bcf5caf387b42414718d (patch) | |
tree | e367e64a75991c554930278175d403c072de6bb8 /Source/WebCore/html/HTMLLabelElement.cpp | |
parent | 0060b2994c07842f4c59de64b5e3e430525c4b90 (diff) | |
download | qtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz |
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit.
Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebCore/html/HTMLLabelElement.cpp')
-rw-r--r-- | Source/WebCore/html/HTMLLabelElement.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Source/WebCore/html/HTMLLabelElement.cpp b/Source/WebCore/html/HTMLLabelElement.cpp index 242fb0cbd..34b9d32b3 100644 --- a/Source/WebCore/html/HTMLLabelElement.cpp +++ b/Source/WebCore/html/HTMLLabelElement.cpp @@ -30,6 +30,7 @@ #include "EventNames.h" #include "FormAssociatedElement.h" #include "HTMLNames.h" +#include "NodeTraversal.h" namespace WebCore { @@ -74,10 +75,10 @@ LabelableElement* HTMLLabelElement::control() // Search the children and descendants of the label element for a form element. // per http://dev.w3.org/html5/spec/Overview.html#the-label-element // the form element must be "labelable form-associated element". - Node* node = this; - while ((node = node->traverseNextNode(this))) { - if (LabelableElement* element = nodeAsLabelableElement(node)) - return element; + Element* element = this; + while ((element = ElementTraversal::next(element, this))) { + if (LabelableElement* labelableElement = nodeAsLabelableElement(element)) + return labelableElement; } return 0; } @@ -135,7 +136,7 @@ void HTMLLabelElement::defaultEventHandler(Event* evt) // Click the corresponding control. element->dispatchSimulatedClick(evt); - // If the control can be focused via the mouse, then do that too. + document()->updateLayoutIgnorePendingStylesheets(); if (element->isMouseFocusable()) element->focus(); @@ -155,11 +156,11 @@ bool HTMLLabelElement::willRespondToMouseClickEvents() return HTMLElement::willRespondToMouseClickEvents(); } -void HTMLLabelElement::focus(bool) +void HTMLLabelElement::focus(bool, FocusDirection direction) { // to match other browsers, always restore previous selection if (HTMLElement* element = control()) - element->focus(); + element->focus(true, direction); } void HTMLLabelElement::accessKeyAction(bool sendMouseEvents) |