• miletus@chromium.org's avatar
    Hit-test should not descend into iframe unnecessarily · aad344be
    miletus@chromium.org authored
    LayoutObject::hitTest() calls into nodeAtPoint() 4 times
    with different HitTestAction options: HitTestForeground, HitTestFloat,
    HitTestChildBlockBackgrounds, HitTestBlockBackground.
    
    LayoutPart::nodeAtPoint() descends into iframe hit-test
    disregard of HitTestAction options. For rect-based hit-test,
    if the test rect is not totally within the iframe bounds,
    the iframe hit test will return false for the rect-based
    hit test search to continue, which means we will call into
    iframe hit test 4 times unnecessarily.
    
    Lets make the change that LayoutPart::nodeAtPoint() descends
    into iframe only in the HitTestForeground phase. If we do
    hit the iframe, LayoutObject::hitTest() will terminate at
    the HitTestForeground phase, If iframe does not hit, we
    only descend into it once and would have collected enough
    information (e.g. pushing overlapping nodes into hit list).
    
    BUG=520730
    
    Review URL: https://codereview.chromium.org/1302583002
    
    git-svn-id: svn://svn.chromium.org/blink/trunk@200793 bbb929c8-8fbe-4397-9dbb-9b2b20218538
    aad344be
hit-test-counts-expected.txt 1.98 KB