Changeset 66284 in webkit


Ignore:
Timestamp:
Aug 27, 2010 5:23:27 PM (14 years ago)
Author:
Joseph Pecoraro
Message:

2010-08-27 Joseph Pecoraro <Joseph Pecoraro>

Reviewed by Alexey Proskuryakov.

LayoutTests:

2010-08-27 Joseph Pecoraro <Joseph Pecoraro>

Extra Events triggered by <input> on focus
https://bugs.webkit.org/show_bug.cgi?id=44731

  • fast/events/input-focus-no-duplicate-events-expected.txt: Added.
  • fast/events/input-focus-no-duplicate-events.html: Added.
  • fast/events/input-tab-focus-no-duplicate-events-expected.txt: Added.
  • fast/events/input-tab-focus-no-duplicate-events.html: Added.

WebCore:

2010-08-27 Joseph Pecoraro <Joseph Pecoraro>

Extra Events triggered by <input> on focus
https://bugs.webkit.org/show_bug.cgi?id=44731

Tests: fast/events/input-focus-no-duplicate-events.html

fast/events/input-tab-focus-no-duplicate-events.html

  • dom/Element.cpp: (WebCore::Element::focus): do not continue and update the appearance of the element if it was not focused.
  • page/FocusController.cpp: (WebCore::FocusController::setFocusedNode): respect the return value of Document::setFocusedNode.
Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r66283 r66284  
     12010-08-27  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        Extra Events triggered by <input> on focus
     6        https://bugs.webkit.org/show_bug.cgi?id=44731
     7
     8        * fast/events/input-focus-no-duplicate-events-expected.txt: Added.
     9        * fast/events/input-focus-no-duplicate-events.html: Added.
     10        * fast/events/input-tab-focus-no-duplicate-events-expected.txt: Added.
     11        * fast/events/input-tab-focus-no-duplicate-events.html: Added.
     12
    1132010-08-27  Eric Carlson  <eric.carlson@apple.com>
    214
  • trunk/WebCore/ChangeLog

    r66282 r66284  
     12010-08-27  Joseph Pecoraro  <joepeck@webkit.org>
     2
     3        Reviewed by Alexey Proskuryakov.
     4
     5        Extra Events triggered by <input> on focus
     6        https://bugs.webkit.org/show_bug.cgi?id=44731
     7
     8        Tests: fast/events/input-focus-no-duplicate-events.html
     9               fast/events/input-tab-focus-no-duplicate-events.html
     10
     11        * dom/Element.cpp:
     12        (WebCore::Element::focus): do not continue and update the appearance of the element if it was not focused.
     13        * page/FocusController.cpp:
     14        (WebCore::FocusController::setFocusedNode): respect the return value of Document::setFocusedNode.
     15
    1162010-08-26  Joseph Pecoraro  <joepeck@webkit.org>
    217
  • trunk/WebCore/dom/Element.cpp

    r66251 r66284  
    13141314    if (Page* page = doc->page()) {
    13151315        // Focus and change event handlers can cause us to lose our last ref.
     1316        // If a focus event handler changes the focus to a different node it
     1317        // does not make sense to continue and update appearence.
    13161318        protect = this;
    1317         page->focusController()->setFocusedNode(this, doc->frame());
     1319        if (!page->focusController()->setFocusedNode(this, doc->frame()))
     1320            return;
    13181321    }
    13191322
  • trunk/WebCore/page/FocusController.cpp

    r65748 r66284  
    624624    // Setting the focused node can result in losing our last reft to node when JS event handlers fire.
    625625    RefPtr<Node> protect = node;
    626     if (newDocument)
    627         newDocument->setFocusedNode(node);
     626    if (newDocument) {
     627        bool successfullyFocused = newDocument->setFocusedNode(node);
     628        if (!successfullyFocused)
     629            return false;
     630    }
    628631
    629632    if (newDocument->focusedNode() == node)
Note: See TracChangeset for help on using the changeset viewer.