Changeset 109004 in webkit


Ignore:
Timestamp:
Feb 27, 2012 10:00:23 AM (12 years ago)
Author:
mitz@apple.com
Message:

Source/WebKit2: <rdar://problem/9557598> REGRESSION (WebKit2): Non-activating links sometimes don’t work
https://bugs.webkit.org/show_bug.cgi?id=79607

Reviewed by Adele Peterson.

Test: TestWebKitAPI/Tests/mac/AcceptsFirstMouse.mm

This was caused by not mapping the mouse event coordinates from window coordinates to
document coordinates.

  • WebProcess/WebPage/mac/WebPageMac.mm:

(WebKit::WebPage::performDictionaryLookupAtLocation): Convert the point to main frame
coordinates when performing the hit test.
(WebKit::WebPage::shouldDelayWindowOrderingEvent): Convert the point to the main or focused
frame coordinates when perfomring the hit test.
(WebKit::WebPage::acceptsFirstMouse): Ditto.

Tools: Added a test for <rdar://problem/9557598> REGRESSION (WebKit2): Non-activating links sometimes don’t work
https://bugs.webkit.org/show_bug.cgi?id=79607

Reviewed by Adele Peterson.

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Added new files.
  • TestWebKitAPI/Tests/mac/AcceptsFirstMouse.mm: Added.

(TestWebKitAPI::AcceptsFirstMouse::url):
(TestWebKitAPI::AcceptsFirstMouse::didLoadURL):
(TestWebKitAPI::AcceptsFirstMouse::runTest):
(TestWebKitAPI::TEST_F):

  • TestWebKitAPI/Tests/mac/acceptsFirstMouse.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r109002 r109004  
     12012-02-27  Dan Bernstein  <mitz@apple.com>
     2
     3        <rdar://problem/9557598> REGRESSION (WebKit2): Non-activating links sometimes don’t work
     4        https://bugs.webkit.org/show_bug.cgi?id=79607
     5
     6        Reviewed by Adele Peterson.
     7
     8        Test: TestWebKitAPI/Tests/mac/AcceptsFirstMouse.mm
     9
     10        This was caused by not mapping the mouse event coordinates from window coordinates to
     11        document coordinates.
     12
     13        * WebProcess/WebPage/mac/WebPageMac.mm:
     14        (WebKit::WebPage::performDictionaryLookupAtLocation): Convert the point to main frame
     15        coordinates when performing the hit test.
     16        (WebKit::WebPage::shouldDelayWindowOrderingEvent): Convert the point to the main or focused
     17        frame coordinates when perfomring the hit test.
     18        (WebKit::WebPage::acceptsFirstMouse): Ditto.
     19
    1202012-02-27  Timothy Hatcher  <timothy@apple.com>
    221
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm

    r103112 r109004  
    441441    // Find the frame the point is over.
    442442    IntPoint point = roundedIntPoint(floatPoint);
    443     HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(point, false);
     443    HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(point), false);
    444444    frame = result.innerNonSharedNode() ? result.innerNonSharedNode()->document()->frame() : m_page->focusController()->focusedOrMainFrame();
    445445
     
    688688        return;
    689689
    690     HitTestResult hitResult = frame->eventHandler()->hitTestResultAtPoint(event.position(), true);
     690    HitTestResult hitResult = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(event.position()), true);
    691691    if (hitResult.isSelected())
    692692        result = frame->eventHandler()->eventMayStartDrag(platform(event));
     
    700700        return;
    701701   
    702     HitTestResult hitResult = frame->eventHandler()->hitTestResultAtPoint(event.position(), true);
     702    HitTestResult hitResult = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(event.position()), true);
    703703    frame->eventHandler()->setActivationEventNumber(eventNumber);
    704704    if (hitResult.isSelected())
  • trunk/Tools/ChangeLog

    r108985 r109004  
     12012-02-27  Dan Bernstein  <mitz@apple.com>
     2
     3        Added a test for <rdar://problem/9557598> REGRESSION (WebKit2): Non-activating links sometimes don’t work
     4        https://bugs.webkit.org/show_bug.cgi?id=79607
     5
     6        Reviewed by Adele Peterson.
     7
     8        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Added new files.
     9        * TestWebKitAPI/Tests/mac/AcceptsFirstMouse.mm: Added.
     10        (TestWebKitAPI::AcceptsFirstMouse::url):
     11        (TestWebKitAPI::AcceptsFirstMouse::didLoadURL):
     12        (TestWebKitAPI::AcceptsFirstMouse::runTest):
     13        (TestWebKitAPI::TEST_F):
     14        * TestWebKitAPI/Tests/mac/acceptsFirstMouse.html: Added.
     15
    1162012-02-27  Carlos Garcia Campos  <cgarcia@igalia.com>
    217
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r107100 r109004  
    2929                37200B9213A16230007A4FAD /* VectorReverse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 37200B9113A16230007A4FAD /* VectorReverse.cpp */; };
    3030                3722C8691461E03E00C45D00 /* RenderedImageFromDOMRange.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3722C8681461E03E00C45D00 /* RenderedImageFromDOMRange.mm */; };
     31                379028B614FABD92007E6B43 /* AcceptsFirstMouse.mm in Sources */ = {isa = PBXBuildFile; fileRef = 379028B514FABD92007E6B43 /* AcceptsFirstMouse.mm */; };
     32                379028B914FAC24C007E6B43 /* acceptsFirstMouse.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 379028B814FABE49007E6B43 /* acceptsFirstMouse.html */; };
    3133                3799AD3A14120A43005EB0C6 /* StringByEvaluatingJavaScriptFromString.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3799AD3914120A43005EB0C6 /* StringByEvaluatingJavaScriptFromString.mm */; };
    3234                37A6895F148A9B50005100FA /* SubresourceErrorCrash.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37A6895D148A9B50005100FA /* SubresourceErrorCrash.mm */; };
     
    151153                        dstSubfolderSpec = 7;
    152154                        files = (
     155                                379028B914FAC24C007E6B43 /* acceptsFirstMouse.html in Copy Resources */,
    153156                                33DC8912141955FE00747EF7 /* simple-iframe.html in Copy Resources */,
    154157                                1A9E52C913E65EF4006917F5 /* 18-characters.html in Copy Resources */,
     
    193196                37200B9113A16230007A4FAD /* VectorReverse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VectorReverse.cpp; path = WTF/VectorReverse.cpp; sourceTree = "<group>"; };
    194197                3722C8681461E03E00C45D00 /* RenderedImageFromDOMRange.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RenderedImageFromDOMRange.mm; sourceTree = "<group>"; };
     198                379028B514FABD92007E6B43 /* AcceptsFirstMouse.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AcceptsFirstMouse.mm; sourceTree = "<group>"; };
     199                379028B814FABE49007E6B43 /* acceptsFirstMouse.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = acceptsFirstMouse.html; sourceTree = "<group>"; };
    195200                3799AD3914120A43005EB0C6 /* StringByEvaluatingJavaScriptFromString.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StringByEvaluatingJavaScriptFromString.mm; sourceTree = "<group>"; };
    196201                37A6895D148A9B50005100FA /* SubresourceErrorCrash.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SubresourceErrorCrash.mm; sourceTree = "<group>"; };
     
    565570                        children = (
    566571                                C07E6CB013FD737C0038B22B /* Resources */,
     572                                379028B514FABD92007E6B43 /* AcceptsFirstMouse.mm */,
    567573                                37DC678B140D7C5000ABCCDB /* DOMRangeOfString.mm */,
    568574                                C07E6CAE13FD67650038B22B /* DynamicDeviceScaleFactor.mm */,
     
    580586                        isa = PBXGroup;
    581587                        children = (
     588                                379028B814FABE49007E6B43 /* acceptsFirstMouse.html */,
     589                                C07E6CB113FD738A0038B22B /* devicePixelRatio.html */,
    582590                                37DC678F140D7D3A00ABCCDB /* DOMRangeOfString.html */,
    583                                 C07E6CB113FD738A0038B22B /* devicePixelRatio.html */,
    584591                        );
    585592                        name = Resources;
     
    773780                                BC22D31514DC689800FFB1DD /* UserMessage.cpp in Sources */,
    774781                                E490296814E2E3A4002BEDD1 /* TypingStyleCrash.mm in Sources */,
     782                                379028B614FABD92007E6B43 /* AcceptsFirstMouse.mm in Sources */,
    775783                        );
    776784                        runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset for help on using the changeset viewer.