Changeset 191756 in webkit


Ignore:
Timestamp:
Oct 29, 2015 2:54:24 PM (8 years ago)
Author:
Simon Fraser
Message:

Very slow typing on pages with wheel event handlers on the body, and deep content
https://bugs.webkit.org/show_bug.cgi?id=150692
rdar://problem/23242631

Reviewed by Zalan Bujtas.

On a large page with a wheel event handler on the body, we would call
Element::absoluteEventHandlerBounds() for every element under the body,
and compute an absolute bounds for each one. This is very slow.

For now, optimize computing a region for the <body> by just using the document
bounds, which will always be as big or larger. It's OK for this region to
be an overestimate.

  • dom/Document.cpp:

(WebCore::Document::absoluteRegionForEventTargets):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r191751 r191756  
     12015-10-29  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Very slow typing on pages with wheel event handlers on the body, and deep content
     4        https://bugs.webkit.org/show_bug.cgi?id=150692
     5        rdar://problem/23242631
     6
     7        Reviewed by Zalan Bujtas.
     8       
     9        On a large page with a wheel event handler on the body, we would call
     10        Element::absoluteEventHandlerBounds() for every element under the body,
     11        and compute an absolute bounds for each one. This is very slow.
     12       
     13        For now, optimize computing a region for the <body> by just using the document
     14        bounds, which will always be as big or larger. It's OK for this region to
     15        be an overestimate.
     16
     17        * dom/Document.cpp:
     18        (WebCore::Document::absoluteRegionForEventTargets):
     19
    1202015-10-29  Wenson Hsieh  <wenson_hsieh@apple.com>
    221
  • trunk/Source/WebCore/dom/Document.cpp

    r191451 r191756  
    62396239        } else if (is<Element>(keyValuePair.key)) {
    62406240            Element* element = downcast<Element>(keyValuePair.key);
    6241             rootRelativeBounds = element->absoluteEventHandlerBounds(insideFixedPosition);
     6241            if (is<HTMLBodyElement>(element)) {
     6242                // For the body, just use the document bounds.
     6243                // The body may not cover this whole area, but it's OK for this region to be an overestimate.
     6244                rootRelativeBounds = absoluteEventHandlerBounds(insideFixedPosition);
     6245            } else
     6246                rootRelativeBounds = element->absoluteEventHandlerBounds(insideFixedPosition);
    62426247        }
    62436248       
Note: See TracChangeset for help on using the changeset viewer.