Changeset 84056 in webkit


Ignore:
Timestamp:
Apr 15, 2011 5:03:05 PM (13 years ago)
Author:
eae@chromium.org
Message:

2011-04-15 Emil A Eklund <eae@chromium.org>

Reviewed by Dimitri Glazkov.

input field with focus makes appendChild operation ~42x slower
https://bugs.webkit.org/show_bug.cgi?id=57059

Add performance test for cloneNode when an input field has focus.

  • perf/clone-with-focus-expected.txt: Added.
  • perf/clone-with-focus.html: Added.

2011-04-15 Emil A Eklund <eae@chromium.org>

Reviewed by Dimitri Glazkov.

input field with focus makes appendChild operation ~42x slower
https://bugs.webkit.org/show_bug.cgi?id=57059

Change ContainerNode::cloneChildNodes to only disable the
deleteButtonController if the container itself (or any of its children)
is being edited. Thus avoiding a reflow in cases where it's not.

Test: perf/clone-with-focus.html

  • dom/ContainerNode.cpp: (WebCore::ContainerNode::cloneChildNodes):
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r84055 r84056  
     12011-04-15  Emil A Eklund  <eae@chromium.org>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        input field with focus makes appendChild operation ~42x slower
     6        https://bugs.webkit.org/show_bug.cgi?id=57059
     7
     8        Add performance test for cloneNode when an input field has focus.
     9
     10        * perf/clone-with-focus-expected.txt: Added.
     11        * perf/clone-with-focus.html: Added.
     12
    1132011-04-15  Charlie Reis  <creis@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r84053 r84056  
     12011-04-15  Emil A Eklund  <eae@chromium.org>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        input field with focus makes appendChild operation ~42x slower
     6        https://bugs.webkit.org/show_bug.cgi?id=57059
     7
     8        Change ContainerNode::cloneChildNodes to only disable the
     9        deleteButtonController if the container itself (or any of its children)
     10        is being edited. Thus avoiding a reflow in cases where it's not.
     11
     12        Test: perf/clone-with-focus.html
     13
     14        * dom/ContainerNode.cpp:
     15        (WebCore::ContainerNode::cloneChildNodes):
     16
    1172011-04-15  Kinuko Yasuda  <kinuko@chromium.org>
    218
  • trunk/Source/WebCore/dom/ContainerNode.cpp

    r84050 r84056  
    799799{
    800800    // disable the delete button so it's elements are not serialized into the markup
    801     bool isEditorEnabled = document()->frame() && document()->frame()->editor()->canEdit();
    802     if (isEditorEnabled)
    803         document()->frame()->editor()->deleteButtonController()->disable();
     801    bool isEditorEnabled = false;
     802    if (document()->frame() && document()->frame()->editor()->canEdit()) {
     803        SelectionController* selection = document()->frame()->selection();
     804        Element* root = selection ? selection->rootEditableElement() : 0;
     805        isEditorEnabled = root && isDescendantOf(root);
     806
     807        if (isEditorEnabled)
     808            document()->frame()->editor()->deleteButtonController()->disable();
     809    }
     810   
    804811    ExceptionCode ec = 0;
    805812    for (Node* n = firstChild(); n && !ec; n = n->nextSibling())
Note: See TracChangeset for help on using the changeset viewer.