1. 24 Jul, 2013 1 commit
  2. 19 Jul, 2013 1 commit
  3. 05 Jul, 2013 2 commits
    • timothy_horton@apple.com's avatar
      Fix r152265: FrameView's pagination mode is only one of two, and the logic was totally wrong · 719e255a
      timothy_horton@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=118439
      <rdar://problem/14366120>
      
      Reviewed by Anders Carlsson.
      
      * page/FrameView.cpp:
      (WebCore::FrameView::maximumScrollPosition):
      - Test both Page and FrameView's pagination modes.
      - *Don't* clamp negatives to zero if we are paginated with scroll offset set,
          like the original changelog claimed, but the code did the opposite.
      - Don't clamp in *all* pagination modes; with 'direction: RTL' it's still possible
          to have a negative maximum position in LTR/TB pagination modes.
      
      * TestWebKitAPI/Tests/WebKit2/ResizeReversePaginatedWebView.cpp:
      (TestWebKitAPI::didLayout):
      (TestWebKitAPI::TEST):
      - Make use of EXPECT_JS_EQ instead of manually doing JavaScript stuff.
      - Assert that we got the right number of pages for sanity.
      - Reduce the page gap size so that DrawingAreaImpl doesn't try to allocate
          so much memory that SharedMemory asserts and makes the test time out.
      - Use didFirstLayoutAfterSuppressedIncrementalRendering instead of Paint
          because paint doesn't fire if the window is offscreen.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152433 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      719e255a
    • timothy_horton@apple.com's avatar
      [wk2] Add API to lock the scroll position at the top or bottom of the page · 8685d4e7
      timothy_horton@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=118429
      <rdar://problem/14120323>
      
      Reviewed by Anders Carlsson.
      
      Test (API): WebKit2.ScrollPinningBehaviors
      
      * WebCore.exp.in:
      Expose FrameView::setScrollPinningBehavior.
      
      * page/FrameView.cpp:
      (WebCore::FrameView::FrameView):
      Our pinning behavior should be DoNotPin by default.
      
      * page/FrameView.cpp:
      (WebCore::FrameView::minimumScrollPosition):
      (WebCore::FrameView::maximumScrollPosition):
      * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
      (WebCore::ScrollingTreeScrollingNodeMac::minimumScrollPosition):
      (WebCore::ScrollingTreeScrollingNodeMac::maximumScrollPosition):
      Fix the minimum scroll position's vertical location to the maximum if
      we're pinned to the bottom, and vice-versa if we're pinned to the top.
      
      (WebCore::FrameView::setScrollPinningBehavior): Added.
      If scroll pinning behavior has changed, inform ScrollingCoordinator
      and update scrollbars (which will also re-pin the scroll position).
      
      * page/FrameView.h:
      Override minimumScrollPosition, add setScrollPinningBehavior,
      and storage for m_scrollPinningBehavior.
      
      * page/scrolling/ScrollingCoordinator.h:
      (WebCore::ScrollingCoordinator::setScrollPinningBehavior): Added.
      
      * page/scrolling/ScrollingTree.cpp:
      (WebCore::ScrollingTree::ScrollingTree):
      Our pinning behavior should be DoNotPin by default.
      
      (WebCore::ScrollingTree::setScrollPinningBehavior):
      (WebCore::ScrollingTree::scrollPinningBehavior):
      Getter/setter for m_scrollPinningBehavior, scrolling-thread-safe.
      
      * page/scrolling/ScrollingTree.h:
      * page/scrolling/mac/ScrollingCoordinatorMac.h:
      * page/scrolling/mac/ScrollingCoordinatorMac.mm:
      (WebCore::ScrollingCoordinatorMac::setScrollPinningBehavior):
      Inform ScrollingTree of the scroll pinning behavior change.
      
      * platform/ScrollTypes.h:
      Add ScrollPinningBehavior enum.
      
      * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
      * TestWebKitAPI/Tests/WebKit2/ScrollPinningBehaviors.cpp: Added.
      (TestWebKitAPI::didFinishDocumentLoadForFrame):
      (TestWebKitAPI::TEST):
      Add a test that ensures that the three pinning modes (DoNotPin, PinToTop, PinToBottom)
      all work correctly in the face of resizing the view and scrolling from JS.
      
      * Shared/WebPageCreationParameters.cpp:
      (WebKit::WebPageCreationParameters::encode):
      (WebKit::WebPageCreationParameters::decode):
      * Shared/WebPageCreationParameters.h:
      Pass the current ScrollPinningBehavior across to the WebPage upon creation.
      
      * UIProcess/API/C/WKPage.cpp:
      (WKPageGetScrollPinningBehavior):
      (WKPageSetScrollPinningBehavior):
      * UIProcess/API/C/WKPagePrivate.h:
      SPI to get/set the WebPageProxy's current ScrollPinningBehavior.
      Convert between WK API type and WebCore enum.
      
      * UIProcess/WebPageProxy.cpp:
      (WebKit::WebPageProxy::WebPageProxy):
      (WebKit::WebPageProxy::creationParameters):
      Send ScrollPinningBehavior when creating a WebPage.
      
      (WebKit::WebPageProxy::setScrollPinningBehavior):
      Pass ScrollPinningBehavior changes across to the WebProcess (and save it
      in WebPageProxy so it can be sent back across if the WebProcess crashes).
      
      * UIProcess/WebPageProxy.h:
      (WebKit::WebPageProxy::scrollPinningBehavior):
      Getter/setter and storage for m_scrollPinningBehavior.
      
      * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
      (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
      Inform new FrameViews of the current ScrollPinningBehavior.
      
      * WebProcess/WebPage/WebPage.cpp:
      (WebKit::WebPage::WebPage):
      Set our ScrollPinningBehavior based on our creation parameters.
      
      (WebKit::WebPage::setScrollPinningBehavior):
      Inform the FrameView of ScrollPinningBehavior changes.
      
      * WebProcess/WebPage/WebPage.h:
      (WebKit::WebPage::scrollPinningBehavior): Added.
      (WebKit::WebPage::setScrollPinningBehavior): Added.
      Add storage for m_scrollPinningBehavior.
      
      * WebProcess/WebPage/WebPage.messages.in:
      Add SetScrollPinningBehavior message.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8685d4e7
  4. 01 Jul, 2013 1 commit
    • timothy_horton@apple.com's avatar
      Maximum scroll position can be negative in some cases · ed528286
      timothy_horton@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=118175
      <rdar://problem/14301217>
      
      Reviewed by Anders Carlsson.
      
      Test (API): WebKit2.ResizeReversePaginatedWebView
      
      * page/FrameView.cpp:
      (WebCore::FrameView::maximumScrollPosition):
      * page/FrameView.h:
      Override maximumScrollPosition() in FrameView and don't clamp to zero if
      a reverse pagination mode is enabled, as it is possible (and common) to
      have a negative maximum scroll position with reverse pagination.
      
      * platform/ScrollView.cpp:
      (WebCore::ScrollView::updateScrollbars):
      Drive-by adoption of toIntSize().
      
      * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
      * TestWebKitAPI/Tests/WebKit2/ResizeReversePaginatedWebView.cpp: Added.
      (TestWebKitAPI::didRunJavaScript):
      (TestWebKitAPI::didLayout):
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/WebKit2/lots-of-text-vertical-lr.html: Added.
      Add a test that loads a vertical-lr document, paginates it horizontally
      from right to left, resizes the view to fit the entire document, and
      verifies that the scroll position is negative, as it must be for the
      document to be enclosed by the view.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152265 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ed528286
  5. 27 Jun, 2013 1 commit
    • commit-queue@webkit.org's avatar
      Fixing some compiler warnings · e5994d3a
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=117791
      
      Patch by Xabier Rodriguez Calvar <calvaris@igalia.com> on 2013-06-27
      Reviewed by Martin Robinson.
      
      Source/WebCore:
      
      No new tests needed.
      
      * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
      (webkitAccessibleTextGetTextForOffset): Fixed warning about
      uninitialized variable.
      
      Source/WebKit2:
      
      * UIProcess/API/gtk/tests/WebExtensionTest.cpp: Properly
      initialized GDBusInterfaceVTable.
      * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
      (webkitWebPageCreate): Added missing fields to the
      WKBundlePageLoaderClient.
      
      Tools:
      
      * GNUmakefile.am: Silenced format warning.
      * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp:
      (TestWebKitAPI::DOMWindowExtensionNoCache::globalObjectIsAvailableForFrame):
      Solved warning about uninitialized variable.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152095 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e5994d3a
  6. 14 Jun, 2013 1 commit
    • enrica@apple.com's avatar
      WKPageFindStringMatches ignores the kWKFindOptionsBackwards option. · 3dec912d
      enrica@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=117647
      <rdar://problem/13881024>
      
      Source/WebCore: 
      
      Reviewed by Darin Adler.
              
      The API returns the matched ranges in the DOM order regardless of the
      find direction, but the index of the first match after the user selection
      should take the find direction into account.
      
      Extended existing test in TestWebKitAPI.
      
      * page/Page.cpp:
      (WebCore::Page::findStringMatchingRanges): Added handling of the Backwards case.
      * page/Page.h: Fixed incorrect name of the enum.
      
      Source/WebKit2: 
      
      Reviewed by Darin Adler.
              
      The API returns the matched ranges in the DOM order regardless of the
      find direction, but the index of the first match after the user selection
      should take the find direction into account.
      
      Extended existing test in TestWebKitAPI.
      
      * Shared/API/c/WKFindOptions.h: Added enum for the case where there are
      no matches after the user selection in the direction of the find.
      
      Tools: 
      
      Reviewed by Darin Adler.
              
      The test now uses content with a selection and tests both
      forwards and backward find as well as the case of a find
      that has no matches after the user selection.
      
      * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
      * TestWebKitAPI/Tests/WebKit2/FindMatches.mm:
      (TestWebKitAPI::didFindStringMatches):
      * TestWebKitAPI/Tests/WebKit2/findRanges.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@151607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3dec912d
  7. 29 May, 2013 1 commit
    • marcelo.lira@openbossa.org's avatar
      [WK2][CoordinatedGraphics][EFL] WKViewUserViewportToContents() function doesn't do what it says · d8e2fb69
      marcelo.lira@openbossa.org authored
      https://bugs.webkit.org/show_bug.cgi?id=116683
      
      Reviewed by Noam Rosenthal.
      
      Source/WebKit2:
      
      WKViewUserViewportToContents now converts WebView coordinates to
      page contents coordinates, taking into account factors as content
      scale and scroll, and also device scale.
      
      The function WKViewUserViewportToScene was added to convert WebView
      coordinates to the coordinates of the canvas/scene where the view
      is drawn, and EwkView was fixed to use it, instead of
      WKViewUserViewportToContents.
      
      * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
      (WKViewUserViewportToScene):
      * UIProcess/API/C/CoordinatedGraphics/WKView.h:
      * UIProcess/API/efl/EwkView.cpp:
      (EwkView::createGLSurface):
      * UIProcess/CoordinatedGraphics/WebView.cpp:
      (WebKit::WebView::userViewportToContents):
      (WebKit):
      (WebKit::WebView::userViewportToScene):
      (WebKit::WebView::transformToScene):
      * UIProcess/CoordinatedGraphics/WebView.h:
      (WebView):
      
      Tools:
      
      A coordinates conversion test for WKViewUserViewportToContents was
      added to WebKit2 API tests.
      
      * TestWebKitAPI/PlatformEfl.cmake:
      * TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/WKViewUserViewportToContents.cpp: Added.
      (TestWebKitAPI):
      (TestWebKitAPI::TEST):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d8e2fb69
  8. 25 May, 2013 1 commit
    • simon.fraser@apple.com's avatar
      Unprefix Page Visibility API · dc674b34
      simon.fraser@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=102340
      
      Source/WebCore:
      
      Reviewed by Tim Horton.
      
      Remove prefixes from the document properties, and the visibilitychanged event.
      
      Rename the "preview" state to "unloaded". The "unloaded" state is never
      reached yet (see https://bugs.webkit.org/show_bug.cgi?id=116769).
      
      Add some comments to places where we should update the visibility state
      when going in and out of the page cache, but cannot safely do so yet.
      
      Tested by existing Page Visibility tests.
      
      * dom/Document.cpp:
      (WebCore::Document::pageVisibilityState):
      (WebCore::Document::visibilityState):
      (WebCore::Document::hidden):
      (WebCore::Document::dispatchVisibilityStateChangeEvent):
      * dom/Document.h:
      * dom/Document.idl:
      * dom/EventNames.h:
      * history/CachedFrame.cpp:
      (WebCore::CachedFrameBase::restore):
      * loader/FrameLoader.cpp:
      (WebCore::FrameLoader::stopLoading):
      * page/Page.cpp:
      (WebCore::Page::setVisibilityState):
      * page/PageVisibilityState.cpp:
      (WebCore::pageVisibilityStateString):
      * page/PageVisibilityState.h:
      
      Source/WebKit/efl:
      
      Reviewed by Tim Horton.
      
      Rename "preview" state to "unloaded" state.
      
      * WebCoreSupport/AssertMatchingEnums.cpp:
      * ewk/ewk_view.h:
      
      Source/WebKit/mac:
      
      Reviewed by Tim Horton.
      
      Renaming of the "preview" state to "unloaded".
      
      * WebView/WebView.mm:
      * WebView/WebViewPrivate.h:
      
      Source/WebKit2:
      
      Reviewed by Tim Horton.
      
      Renaming of the "preview" state to "unloaded".
      
      * Shared/API/c/WKPageVisibilityTypes.h:
      * Shared/API/c/WKSharedAPICast.h:
      (WebKit::toPageVisibilityState):
      
      Tools:
      
      Reviewed by Tim Horton.
      
      Rename "preview" state to "unloaded" state, and adjust the tests
      to test for it.
      
      * DumpRenderTree/mac/TestRunnerMac.mm:
      (TestRunner::setPageVisibility):
      * TestWebKitAPI/Tests/WebKit2/PageVisibilityState.cpp:
      (TestWebKitAPI::setPageVisibilityStateWithEvalContinuation):
      (TestWebKitAPI::didRunStep2StateChangeHiddenToPrerender):
      (TestWebKitAPI::didRunStep3StateChangePrerenderToUnloaded):
      (TestWebKitAPI::didRunStep4InStateUnloaded):
      * TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.html:
      * TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm:
      (TestWebKitAPI::PageVisibilityStateWithWindowChanges::runTest):
      * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
      (WTR::TestRunner::setPageVisibility):
      
      LayoutTests:
      
      Reviewed by Tim Horton.
      
      Remove prefixes, adjust to state name changes.
      
      * fast/events/page-visibility-iframe-delete-test.html:
      * fast/events/page-visibility-iframe-move-test-expected.txt:
      * fast/events/page-visibility-iframe-move-test.html:
      * fast/events/page-visibility-iframe-propagation-test-expected.txt:
      * fast/events/page-visibility-iframe-propagation-test.html:
      * fast/events/page-visibility-null-view-expected.txt:
      * fast/events/page-visibility-null-view.html:
      * fast/events/page-visibility-transition-test-expected.txt:
      * fast/events/page-visibility-transition-test.html:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      dc674b34
  9. 22 May, 2013 1 commit
  10. 21 May, 2013 3 commits
    • rniwa@webkit.org's avatar
      REGRESSION(r150369): WebKit2WillLoadTest tests are failing · d2b7c8df
      rniwa@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=116585
      
      Reviewed by Alexey Proskuryakov.
      
      willLoadURLRequest and willLoadDataRequest require the API version 6.
      
      * TestWebKitAPI/Tests/WebKit2/WillLoad_Bundle.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150493 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d2b7c8df
    • jberlin@webkit.org's avatar
      Expose a way to know when forms are added to a page or when form controls are added to a form · f13d0a3d
      jberlin@webkit.org authored
      in the injected bundle
      https://bugs.webkit.org/show_bug.cgi?id=116334
      
      Reviewed by Alexey Proskuryakov.
      
      Source/WebKit2:
      
      Add shouldNotifyOnFormChanges and didAssociateFormControls to the WKBundlePageFormClient.
      
      * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
      Add the new callbacks as part of version 2 of the WKBundlePageFormClient.
      
      * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
      (WebKit::InjectedBundlePageFormClient::didAssociateFormControls):
      Pass the message along to the client if the client has a handler.
      (WebKit::InjectedBundlePageFormClient::shouldNotifyOnFormChanges):
      Ditto.
      * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h:
      
      * WebProcess/WebCoreSupport/WebChromeClient.cpp:
      (WebKit::WebChromeClient::didAssociateFormControls):
      Tell the injected bundle form client for the page.
      (WebKit::WebChromeClient::shouldNotifyOnFormChanges):
      Ditto.
      * WebProcess/WebCoreSupport/WebChromeClient.h:
      
      Tools:
      
      Add tests for the new callbacks.
      
      * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
      Add DidAssociateFormControls/_Bundle.cpp and associate-form-controls.html
      
      * TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls.cpp: Added.
      (TestWebKitAPI::nullJavaScriptCallback):
      A "null" callback to handle the fact that WKPageRunJavaScriptInMainFrame cannot handle null
      being passed in for the callback.
      (TestWebKitAPI::didReceiveMessageFromInjectedBundle):
      After receiving the message that didAssociateFormControls callback was invoked from adding
      the form in the onload handler, tell the page to add a password field to the form, which
      should also invoke didAssociateFormControls callback.
      (TestWebKitAPI::setInjectedBundleClient):
      Register to receive messages.
      (TestWebKitAPI::TEST):
      Load associate-form-controls.html and wait until the didAssociateFormControls callback has
      been invoked for both adding the form and for adding a password field to the form.
      
      * TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp: Added.
      (TestWebKitAPI::shouldNotifyOnFormChanges):
      Return true so the didAssociateFormControls callback is invoked.
      (TestWebKitAPI::didAssociateFormControls):
      Tell the UI process.
      (TestWebKitAPI::DidAssociateFormControlsTest::DidAssociateFormControlsTest):
      (TestWebKitAPI::DidAssociateFormControlsTest::didCreatePage):
      Register for the shouldNotifyOnFormChanges and didAssociateFormControls callbacks.
      
      * TestWebKitAPI/Tests/WebKit2/associate-form-controls.html: Added.
      Add a form in response to the onload event. Add a button that will add the password field
      for manual testing.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150441 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f13d0a3d
    • lforschler@apple.com's avatar
      Source/WebKit2: Rollout r150398. · b4f5bdcd
      lforschler@apple.com authored
      Tools:     Rollout 150398.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b4f5bdcd
  11. 20 May, 2013 1 commit
    • jberlin@webkit.org's avatar
      Expose a way to know when forms are added to a page or when form controls are added to a form · 3e17a40b
      jberlin@webkit.org authored
      in the injected bundle
      https://bugs.webkit.org/show_bug.cgi?id=116334
      
      Reviewed by Alexey Proskuryakov.
      
      Source/WebKit2:
      
      Add shouldNotifyOnFormChanges and didAssociateFormControls to the WKBundlePageFormClient.
      
      * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
      Add the new callbacks as part of version 2 of the WKBundlePageFormClient.
      
      * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
      (WebKit::InjectedBundlePageFormClient::didAssociateFormControls):
      Pass the message along to the client if the client has a handler.
      (WebKit::InjectedBundlePageFormClient::shouldNotifyOnFormChanges):
      Ditto.
      * WebProcess/InjectedBundle/InjectedBundlePageFormClient.h:
      
      * WebProcess/WebCoreSupport/WebChromeClient.cpp:
      (WebKit::WebChromeClient::didAssociateFormControls):
      Tell the injected bundle form client for the page.
      (WebKit::WebChromeClient::shouldNotifyOnFormChanges):
      Ditto.
      * WebProcess/WebCoreSupport/WebChromeClient.h:
      
      Tools:
      
      Add tests for the new callbacks.
      
      * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
      Add DidAssociateFormControls/_Bundle.cpp and associate-form-controls.html
      
      * TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls.cpp: Added.
      (TestWebKitAPI::nullJavaScriptCallback):
      A "null" callback to handle the fact that WKPageRunJavaScriptInMainFrame cannot handle null
      being passed in for the callback.
      (TestWebKitAPI::didReceiveMessageFromInjectedBundle):
      After receiving the message that didAssociateFormControls callback was invoked from adding
      the form in the onload handler, tell the page to add a password field to the form, which
      should also invoke didAssociateFormControls callback.
      (TestWebKitAPI::setInjectedBundleClient):
      Register to receive messages.
      (TestWebKitAPI::TEST):
      Load associate-form-controls.html and wait until the didAssociateFormControls callback has
      been invoked for both adding the form and for adding a password field to the form.
      
      * TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp: Added.
      (TestWebKitAPI::shouldNotifyOnFormChanges):
      Return true so the didAssociateFormControls callback is invoked.
      (TestWebKitAPI::didAssociateFormControls):
      Tell the UI process.
      (TestWebKitAPI::DidAssociateFormControlsTest::DidAssociateFormControlsTest):
      (TestWebKitAPI::DidAssociateFormControlsTest::didCreatePage):
      Register for the shouldNotifyOnFormChanges and didAssociateFormControls callbacks.
      
      * TestWebKitAPI/Tests/WebKit2/associate-form-controls.html: Added.
      Add a form in response to the onload event. Add a button that will add the password field
      for manual testing.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150398 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3e17a40b
  12. 16 May, 2013 1 commit
    • weinig@apple.com's avatar
      Add variants of the loading APIs that take user data and a way for the... · 147cb451
      weinig@apple.com authored
      Add variants of the loading APIs that take user data and a way for the injected bundle to find out about them
      https://bugs.webkit.org/show_bug.cgi?id=116132
      
      Reviewed by Anders Carlsson.
      
      Adds "WithUserData" versions of all the load APIs and two new WKBundlePageLoaderClient functions,
      willLoadURLRequest and willLoadDataRequest to let the bundle access them.
      
      Source/WebKit2: 
      
      Adds WebKit2WillLoadTest.* API tests.
      
      * UIProcess/API/C/WKPage.cpp:
      (WKPageLoadURLWithUserData):
      (WKPageLoadURLRequestWithUserData):
      (WKPageLoadFile):
      (WKPageLoadFileWithUserData):
      (WKPageLoadHTMLStringWithUserData):
      (WKPageLoadAlternateHTMLStringWithUserData):
      (WKPageLoadPlainTextStringWithUserData):
      (WKPageLoadWebArchiveDataWithUserData):
      * UIProcess/API/C/WKPage.h:
      * UIProcess/WebPageProxy.cpp:
      * UIProcess/WebPageProxy.h:
      (WebPageProxy):
      * WebKit2.xcodeproj/project.pbxproj:
      * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
      * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
      (WebKit::InjectedBundlePageLoaderClient::willLoadURLRequest):
      (WebKit::InjectedBundlePageLoaderClient::willLoadDataRequest):
      * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
      (WebCore):
      (InjectedBundlePageLoaderClient):
      * WebProcess/WebPage/WebPage.cpp:
      * WebProcess/WebPage/WebPage.h:
      * WebProcess/WebPage/WebPage.messages.in:
      
      Tools: 
      
      * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
      * TestWebKitAPI/Tests/WebKit2/WillLoad.cpp: Added.
      * TestWebKitAPI/Tests/WebKit2/WillLoad_Bundle.cpp: Added.
      * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150242 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      147cb451
  13. 11 May, 2013 1 commit
    • andersca@apple.com's avatar
      Crash when terminating a process that has not been fully launched · d8a9a51a
      andersca@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=115962
      <rdar://problem/13660916>
      
      Reviewed by Andreas Kling.
      
      Source/WebKit2:
      
      Handle terminating a process that has not been fully launched.
      
      * UIProcess/Launcher/ProcessLauncher.cpp:
      (WebKit::ProcessLauncher::didFinishLaunchingProcess):
      If we have been invalidated, dispose the connection identifier.
      
      * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
      (WebKit::ProcessLauncher::terminateProcess):
      If we're still launching the process, invalidate so the client won't get an unexpected
      didFinishLaunching callback.
      
      * UIProcess/WebProcessProxy.cpp:
      (WebKit::WebProcessProxy::requestTermination):
      Check if webConnection() is null before calling it. (It will be null if the process isn't fully launched).
      
      Tools:
      
      Add TerminateTwice, a test that terminates a page, then reloads it and terminates it again
      before the process has had a chance to be fully launched.
      
      * TestWebKitAPI/GNUmakefile.am:
      * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
      * TestWebKitAPI/Tests/WebKit2/TerminateTwice.cpp: Added.
      (TestWebKitAPI):
      (TestWebKitAPI::didFinishLoadForFrame):
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/WebKit2/WebKit2.pro:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149933 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d8a9a51a
  14. 08 May, 2013 1 commit
    • darin@apple.com's avatar
      Source/WebCore: Use adoptCF and adoptNS in more places · f00480b5
      darin@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=115657
      
      Reviewed by Sam Weinig.
      
      This is similar to my last set of changes, but covers code that I missed with
      global replace using the Safari Xcode workspace.
      
      * platform/cf/win/CertificateCFWin.cpp:
      (WebCore::copyCertificateToData):
      * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
      (WebCore::MediaPlayerPrivateAVFoundationCF::platformBufferedTimeRanges):
      (WebCore::MediaPlayerPrivateAVFoundationCF::platformMinTimeSeekable):
      (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeSeekable):
      (WebCore::MediaPlayerPrivateAVFoundationCF::platformMaxTimeLoaded):
      (WebCore::MediaPlayerPrivateAVFoundationCF::totalBytes):
      (WebCore::mimeTypeCache):
      (WebCore::MediaPlayerPrivateAVFoundationCF::tracksChanged):
      (WebCore::MediaPlayerPrivateAVFoundationCF::sizeChanged):
      (WebCore::AVFWrapper::createAssetForURL):
      (WebCore::AVFWrapper::createPlayer):
      (WebCore::AVFWrapper::createPlayerItem):
      (WebCore::AVFWrapper::setAsset):
      (WebCore::AVFWrapper::platformLayer):
      (WebCore::AVFWrapper::createAVCFVideoLayer):
      (WebCore::AVFWrapper::createImageGenerator):
      * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
      (WebCore::InbandTextTrackPrivateLegacyAVFObjC::language):
      * platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
      (toCACFTimingFunction):
      (PlatformCAAnimation::PlatformCAAnimation):
      (PlatformCAAnimation::setFromValue):
      (PlatformCAAnimation::setToValue):
      (PlatformCAAnimation::setValues):
      (PlatformCAAnimation::setKeyTimes):
      (PlatformCAAnimation::setTimingFunctions):
      * platform/graphics/ca/win/PlatformCALayerWin.cpp:
      (PlatformCALayer::PlatformCALayer):
      (PlatformCALayer::setBackgroundColor):
      (PlatformCALayer::setBorderColor):
      * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
      (PlatformCALayerWinInternal::PlatformCALayerWinInternal):
      (PlatformCALayerWinInternal::addTile):
      * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
      (WebCore::WKCACFViewLayerTreeHost::WKCACFViewLayerTreeHost):
      * platform/graphics/gstreamer/PlatformVideoWindowMac.mm:
      (PlatformVideoWindow::PlatformVideoWindow):
      * platform/graphics/win/FontCustomPlatformData.cpp:
      (WebCore::FontCustomPlatformData::fontPlatformData):
      * platform/graphics/win/FontPlatformDataCGWin.cpp:
      (WebCore::getPostScriptName):
      (WebCore::FontPlatformData::platformDataInit):
      * platform/graphics/win/GraphicsContextCGWin.cpp:
      (WebCore::GraphicsContext::drawWindowsBitmap):
      * platform/graphics/win/ImageCGWin.cpp:
      (WebCore::BitmapImage::create):
      * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
      (WebCore::MediaPlayerPrivateFullscreenWindow::setRootChildLayer):
      * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
      (WebCore::MediaPlayerPrivateQuickTimeVisualContext::rfc2616DateStringFromTime):
      (WebCore::QTCFDictionaryCreateWithDataCallback):
      (WebCore::MediaPlayerPrivateQuickTimeVisualContext::retrieveCurrentImage):
      * platform/graphics/win/WKCAImageQueue.cpp:
      (WebCore::WKCAImageQueue::WKCAImageQueue):
      * platform/image-decoders/ImageDecoder.h:
      (WebCore::ImageDecoder::qcmsOutputDeviceProfile):
      * platform/network/cf/AuthenticationCF.cpp:
      (WebCore::core):
      * platform/network/cf/CookieJarCFNet.cpp:
      (WebCore::cookieDomain):
      (WebCore::cookieName):
      (WebCore::cookiePath):
      (WebCore::cookieValue):
      (WebCore::filterCookies):
      (WebCore::setCookiesFromDOM):
      (WebCore::cookiesForDOM):
      (WebCore::cookieRequestHeaderFieldValue):
      (WebCore::getRawCookies):
      (WebCore::deleteCookie):
      (WebCore::getHostnamesWithCookies):
      (WebCore::deleteCookiesForHostname):
      * platform/network/curl/ResourceHandleManager.cpp:
      (WebCore::certificatePath):
      * platform/win/ClipboardUtilitiesWin.cpp:
      (WebCore::urlFromPath):
      (WebCore::getURL):
      * platform/win/LocalizedStringsWin.cpp:
      (WebCore::createWebKitBundle):
      (WebCore::localizedString):
      * platform/win/SearchPopupMenuWin.cpp:
      (WebCore::SearchPopupMenuWin::saveRecentSearches):
      (WebCore::SearchPopupMenuWin::loadRecentSearches):
      * plugins/mac/PluginPackageMac.cpp:
      (WebCore::stringListFromResourceId):
      (WebCore::PluginPackage::fetchInfo):
      (WebCore::PluginPackage::load):
      * plugins/mac/PluginViewMac.mm:
      (WebCore::PluginView::platformStart):
      * rendering/RenderThemeSafari.cpp:
      (WebCore::RenderThemeSafari::platformFocusRingColor):
      (WebCore::RenderThemeSafari::paintMenuListButtonGradients):
      (WebCore::RenderThemeSafari::paintSliderTrack):
      Use adoptCF and adoptNS throughout.
      
      Source/WebKit/win: Use adoptCF and adoptNS in more places
      https://bugs.webkit.org/show_bug.cgi?id=115657
      
      Reviewed by Sam Weinig.
      
      This is similar to my last set of changes, but covers code that I missed with
      global replace using the Safari Xcode workspace.
      
      * CFDictionaryPropertyBag.cpp:
      (CFDictionaryPropertyBag::Write):
      * WebCache.cpp:
      (WebCache::statistics):
      * WebCoreSupport/WebFrameLoaderClient.cpp:
      (WebFrameLoaderClient::dispatchDidFailToStartPlugin):
      * WebCoreSupport/WebInspectorClient.cpp:
      (WebInspectorClient::openInspectorFrontend):
      (WebInspectorFrontendClient::localizedStringsURL):
      * WebDatabaseManager.cpp:
      (WebDatabaseManager::dispatchDidModifyDatabase):
      * WebDownloadCFNet.cpp:
      (WebDownload::init):
      (WebDownload::initWithRequest):
      (WebDownload::initToResumeWithBundle):
      (WebDownload::cancelForResume):
      (WebDownload::useCredential):
      (WebDownload::didReceiveAuthenticationChallenge):
      * WebError.cpp:
      (WebError::sslPeerCertificate):
      * WebHistory.cpp:
      (createUserInfoFromArray):
      (createUserInfoFromHistoryItem):
      (WebHistory::WebHistory):
      (WebHistory::loadFromURL):
      (WebHistory::loadHistoryGutsFromURL):
      (WebHistory::saveToURL):
      (WebHistory::saveHistoryGuts):
      (WebHistory::removeAllItems):
      (WebHistory::removeItem):
      (WebHistory::addItem):
      (WebHistory::itemForURL):
      (WebHistory::addItemToDateCaches):
      (getDayBoundaries):
      * WebIconDatabase.cpp:
      (postDidAddIconNotification):
      * WebLocalizableStrings.cpp:
      (cfBundleForStringsBundle):
      * WebMutableURLRequest.cpp:
      (WebMutableURLRequest::mutableCopy):
      * WebPreferences.cpp:
      (cfNumber):
      (WebPreferences::initializeDefaultSettings):
      (WebPreferences::valueForKey):
      (WebPreferences::setStringValue):
      (WebPreferences::load):
      (WebPreferences::migrateWebKitPreferencesToCFPreferences):
      (WebPreferences::setPreferenceForTest):
      * WebView.cpp:
      (WebView::setCacheModel):
      (WebView::notifyPreferencesChanged):
      Use adoptCF and adoptNS.
      
      Source/WebKit2: Use adoptCF and adoptNS in more places
      https://bugs.webkit.org/show_bug.cgi?id=115657
      
      Reviewed by Sam Weinig.
      
      * Shared/Downloads/cfnet/DownloadCFNet.cpp:
      (WebKit::Download::useCredential):
      (WebKit::Download::start):
      (WebKit::Download::startWithHandle):
      (WebKit::Download::cancel):
      (WebKit::Download::didDecideDestination):
      Use adoptCF and adoptNS.
      
      Tools: Use adoptCF and adoptNS in more places, test code and code not compiled on Mac
      https://bugs.webkit.org/show_bug.cgi?id=115657
      
      Reviewed by Sam Weinig.
      
      This is similar to my last set of changes, but covers code that I missed with
      global replace using the Safari Xcode workspace.
      
      * DumpRenderTree/cf/WebArchiveDumpSupport.cpp:
      (convertWebResourceDataToString):
      (convertWebResourceResponseToDictionary):
      (createXMLStringFromWebArchiveData):
      * DumpRenderTree/cg/ImageDiffCG.cpp:
      (createImageFromStdin):
      (createDifferenceImage):
      (main):
      * DumpRenderTree/cg/PixelDumpSupportCG.cpp:
      (printPNG):
      (dumpBitmap):
      * DumpRenderTree/cg/PixelDumpSupportCG.h:
      (BitmapContext::BitmapContext):
      * DumpRenderTree/mac/MockWebNotificationProvider.mm:
      (-[MockWebNotificationProvider init]):
      * DumpRenderTree/mac/PixelDumpSupportMac.mm:
      (createBitmapContext):
      * DumpRenderTree/mac/TestRunnerMac.mm:
      (TestRunner::addDisallowedURL):
      (TestRunner::applicationCacheDiskUsageForOrigin):
      (TestRunner::localStorageDiskUsageForOrigin):
      (TestRunner::clearApplicationCacheForOrigin):
      (TestRunner::deleteLocalStorageForOrigin):
      (TestRunner::copyDecodedHostName):
      (TestRunner::copyEncodedHostName):
      (TestRunner::queueLoad):
      (TestRunner::setDomainRelaxationForbiddenForURLScheme):
      (TestRunner::setMockGeolocationPositionUnavailableError):
      (TestRunner::setUserStyleSheetLocation):
      (TestRunner::setValueForUser):
      (TestRunner::overridePreference):
      (TestRunner::setPersistentUserStyleSheetLocation):
      (TestRunner::execCommand):
      (TestRunner::findString):
      (TestRunner::isCommandEnabled):
      (TestRunner::addOriginAccessWhitelistEntry):
      (TestRunner::removeOriginAccessWhitelistEntry):
      (TestRunner::addUserScript):
      (TestRunner::addUserStyleSheet):
      (TestRunner::evaluateInWebInspector):
      (TestRunner::evaluateScriptInIsolatedWorld):
      (TestRunner::apiTestNewWindowDataLoadBaseURL):
      (-[SynchronousLoader connection:didReceiveAuthenticationChallenge:]):
      (TestRunner::authenticateSession):
      (TestRunner::grantWebNotificationPermission):
      (TestRunner::denyWebNotificationPermission):
      * DumpRenderTree/mac/WebArchiveDumpSupportMac.mm:
      (createCFURLResponseFromResponseData):
      * DumpRenderTree/mac/WorkQueueItemMac.mm:
      (LoadItem::invoke):
      (LoadHTMLStringItem::invoke):
      (ScriptItem::invoke):
      * DumpRenderTree/win/DumpRenderTree.cpp:
      (substringFromIndex):
      (urlSuitableForTestResult):
      (lastPathComponent):
      (sharedCFURLCache):
      * DumpRenderTree/win/ImageDiffCairo.cpp:
      (createImageFromStdin):
      (main):
      * DumpRenderTree/win/PixelDumpSupportWin.cpp:
      (createBitmapContextFromWebView):
      * DumpRenderTree/win/TestRunnerWin.cpp:
      (TestRunner::setUserStyleSheetLocation):
      (TestRunner::setPersistentUserStyleSheetLocation):
      * TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/TestWebKitAPI/mac/InstanceMethodSwizzler.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/WTF/cf/RetainPtrHashing.cpp:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/WebKit2/FindMatches.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/WebKit2/WebArchive.cpp:
      (TestWebKitAPI::didReceiveMessageFromInjectedBundle):
      * TestWebKitAPI/Tests/WebKit2/mac/GetBackingScaleFactor.mm:
      (TestWebKitAPI::createWindow):
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/WebKit2/win/DoNotCopyANullCFURLResponse.cpp:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/mac/AcceptsFirstMouse.mm:
      (TestWebKitAPI::AcceptsFirstMouse::runTest):
      * TestWebKitAPI/Tests/mac/AttributedString.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/mac/BackForwardList.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/mac/CancelLoadFromResourceLoadDelegate.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/mac/ContextMenuCanCopyURL.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/mac/DOMHTMLTableCellCellAbove.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/mac/DOMRangeOfString.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/mac/DeviceScaleFactorInDashboardRegions.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/mac/DeviceScaleFactorOnBack.mm:
      (TestWebKitAPI::DeviceScaleFactorOnBack::createWindow):
      * TestWebKitAPI/Tests/mac/DynamicDeviceScaleFactor.mm:
      (TestWebKitAPI::DynamicDeviceScaleFactor::createWindow):
      * TestWebKitAPI/Tests/mac/HTMLCollectionNamedItem.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/mac/HTMLFormCollectionNamedItem.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/mac/InspectorBar.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/mac/MemoryCacheDisableWithinResourceLoadDelegate.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/mac/MemoryCachePruneWithinResourceLoadDelegate.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm:
      (TestWebKitAPI::PageVisibilityStateWithWindowChanges::runTest):
      * TestWebKitAPI/Tests/mac/RenderedImageFromDOMRange.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/mac/SetAndUpdateCacheModel.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/mac/SetDocumentURI.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/mac/SimplifyMarkup.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/mac/StringByEvaluatingJavaScriptFromString.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/mac/WillSendSubmitEvent.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/mac/WindowlessWebViewWithMedia.mm:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/mac/PlatformUtilitiesMac.mm:
      (TestWebKitAPI::Util::MIMETypeForWKURLResponse):
      * TestWebKitAPI/mac/WebKitAgnosticTest.mm:
      (TestWebKitAPI::WebKitAgnosticTest::runWebKit1Test):
      (TestWebKitAPI::WebKitAgnosticTest::runWebKit2Test):
      * WebKitTestRunner/InjectedBundle/mac/InjectedBundlePageMac.mm:
      (WTR::testPathFromURL):
      * WebKitTestRunner/InjectedBundle/mac/TestRunnerMac.mm:
      (WTR::TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded):
      * WebKitTestRunner/cg/TestInvocationCG.cpp:
      (WTR::createCGContextFromImage):
      (WTR::dumpBitmap):
      (WTR::TestInvocation::dumpPixelsAndCompareWithExpected):
      * WebKitTestRunner/mac/EventSenderProxy.mm:
      (WTR::EventSenderProxy::mouseScrollBy):
      * WebKitTestRunner/mac/PlatformWebViewMac.mm:
      (WTR::PlatformWebView::windowSnapshotImage):
      * WebKitTestRunner/win/TestControllerWin.cpp:
      (WTR::TestController::initializeTestPluginDirectory):
      Use adoptCF and adoptNS.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149716 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f00480b5
  15. 04 May, 2013 1 commit
  16. 26 Apr, 2013 1 commit
    • aestes@apple.com's avatar
      [WebKit2] Loading a resource from a custom protocol in a synchronous XHR times out · 756003ad
      aestes@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=115223
      
      Reviewed by Darin Adler.
      
      Source/WebKit2:
      
      When WebKit performs a synchronous load on the Mac, it spins a nested
      run loop in a mode that only accepts input from the NSURLConnection
      performing the load. When the load is for a custom protocol in WebKit2,
      we proxy it to the UI process via CoreIPC messages, but the response
      messages from the UI process are never processed as long as the run
      loop is in a non-common mode (and we wouldn't want to process messages
      that could re-enter WebCore in the middle of loading, anyway). Since
      these messages never make it back to the NSURLConnection handling the
      request, the connection eventually times out.
      
      Fix this by using a work queue to handle custom protocol messages in
      the networking process. The work queue can process incoming custom
      protocol messages while the main thread is blocked.
      
      * NetworkProcess/NetworkProcess.cpp:
      (WebKit::NetworkProcess::initializeConnection): Called
      initializeConnection() on all the NetworkProcess's supplements.
      * Shared/ChildProcessSupplement.h: Added a base class for
      NetworkProcessSupplement and WebProcessSupplement which defines
      initializeConnection and provides an empty default implementation.
      (WebKit::ChildProcessSupplement::~ChildProcessSupplement):
      (WebKit::ChildProcessSupplement::initializeConnection):
      * Shared/Network/CustomProtocols/CustomProtocolManager.h:
      * Shared/Network/CustomProtocols/mac/CustomProtocolManagerMac.mm:
      (WebKit::CustomProtocolManager::CustomProtocolManager): Instantiated a
      work queue for message processing.
      (WebKit::CustomProtocolManager::initializeConnection): Added the work
      queue as a message receiver on the CoreIPC connection.
      (WebKit::CustomProtocolManager::initialize): If we're in the web
      process and the network process is being used, unregister and destroy
      the work queue we previously created. It'd be better to not create it
      in the first place, but we have to register our work queue with the
      CoreIPC connection before it is established, which is before the UI
      process has told us whether the network process is in use.
      * Shared/Network/NetworkProcessSupplement.h: Inherited from
      ChildProcessSupplement.
      * WebKit2.xcodeproj/project.pbxproj: Added ChildProcessSupplement.h.
      * WebProcess/WebProcess.cpp:
      (WebKit::WebProcess::initializeConnection): Called
      initializeConnection() on all the WebProcess's supplements.
      * WebProcess/WebProcessSupplement.h: Inherited from
      ChildProcessSupplement.
      
      Tools:
      
      Added an API test.
      
      * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Added new files.
      * TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm: Added.
      (TestWebKitAPI::TEST): Tested that a synchronous XHR does not time out
      when it loads a request with a custom protocol.
      * TestWebKitAPI/Tests/WebKit2/custom-protocol-sync-xhr.html: Added.
      * TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm: Moved the
      NSURLProtocol subclass to TestProtocol.{h, mm} and did some
      miscellaneous cleanup.
      * TestWebKitAPI/mac/TestProtocol.h: Copied from Source/WebKit2/WebProcess/WebProcessSupplement.h.
      * TestWebKitAPI/mac/TestProtocol.mm: Copied from Tools/TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm.
      (+[TestProtocol canInitWithRequest:]):
      (+[TestProtocol canonicalRequestForRequest:]):
      (+[TestProtocol requestIsCacheEquivalent:toRequest:]):
      (+[TestProtocol scheme]):
      (-[TestProtocol startLoading]):
      (-[TestProtocol stopLoading]):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149194 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      756003ad
  17. 24 Apr, 2013 1 commit
    • commit-queue@webkit.org's avatar
      [EFL][WK2]: Fix WKViewClientWebProcessCallbacks WK2 API test · 880febe5
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=114850
      
      Patch by Sergio Correia <sergio.correia@openbossa.org> on 2013-04-24
      Reviewed by Andreas Kling.
      
      Revision r148312 fixed WebPageProxy cleanup and also changed the process
      termination semantics when requested by the user so that a client is not
      notified of a crash anymore, since there was no crash anyway.
      
      That change broke WKViewClientWebProcessCallbacks WK2 API test, since it
      relied on being notified of a crash after calling WKPageTerminate(). As
      a result of not being notified of such non-existent crash, the test would
      timeout right after making the terminate call.
      
      This patch adds an InjectedBundle to be used for simulating a crash, by
      calling abort() upon receiving a "Crash" message, and thus we are able to
      keep testing the crash callback.
      
      This patch also re-enables the WKViewClientWebProcessCallbacks test, which
      had been disabled in revisions r148858 and r148855, since it was failing.
      
      * TestWebKitAPI/PlatformEfl.cmake:
      * TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks.cpp:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks_Bundle.cpp: Added.
      (TestWebKitAPI):
      (WKViewClientWebProcessCallbacksTest):
      (TestWebKitAPI::WKViewClientWebProcessCallbacksTest::WKViewClientWebProcessCallbacksTest):
      (TestWebKitAPI::WKViewClientWebProcessCallbacksTest::didReceiveMessage):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149045 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      880febe5
  18. 12 Apr, 2013 1 commit
    • benjamin@webkit.org's avatar
      [WK2] WebPageProxy loadURL() won't work when called just after terminateProcess() · 21e7432e
      benjamin@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=110743
      
      Patch by Adenilson Cavalcanti <cavalcantii@gmail.com> on 2013-04-12
      Reviewed by Benjamin Poulain.
      
      Source/WebKit2: 
      
      A call to loadURL() just after terminating WebProcess will fail thanks to
      WebPageProxy being in an undefined state since it is in the middle of its own
      cleanup after process termination.
      
      To properly fix this, not only WebPageProxy cleanup should be made
      at WebProcess termination request, but also WebProcessProxy needs
      to only return to its caller after terminating the process and
      closing connections. Otherwise, WebPageProxy can even be able to
      detect that WebProcess is no longer running, but a call to respawn
      the process will fail.
      
      To fix these issues, this patch moves the cleanup code to a shared private function
      that is used for both the cases i.e. user termination and real crash. WebProcess
      shutdown is done using a new method that ensures that all cleanup was done before
      returning.
      
      A last change introduced in this patch is that for user requested termination,
      clients are no longer notified of a crash (since it is not a crash).
      
      * UIProcess/WebPageProxy.cpp:
      (WebKit::WebPageProxy::terminateProcess):
      (WebKit::WebPageProxy::processDidCrash):
      (WebKit):
      (WebKit::WebPageProxy::resetStateAfterProcessExited):
      * UIProcess/WebPageProxy.h:
      (WebPageProxy):
      * UIProcess/WebProcessProxy.cpp:
      (WebKit::WebProcessProxy::userRequestedTerminate):
      (WebKit):
      * UIProcess/WebProcessProxy.h:
      (WebProcessProxy):
      
      Tools: 
      
      Adding a new test file to check if loading a page just after WebProcess
      has crashed (or was terminated) works. The test executes the
      following steps (Load, Crash, Load), thus stressing WebProcess
      reattach and process termination code path.
      
      * TestWebKitAPI/GNUmakefile.am:
      * TestWebKitAPI/PlatformEfl.cmake:
      * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
      * TestWebKitAPI/Tests/WebKit2/MouseMoveAfterCrash.cpp:
      (TestWebKitAPI::setPageLoaderClient):
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/WebKit2/LoadPageOnCrash.cpp: Added.
      (TestWebKitAPI):
      (WebKit2CrashLoader):
      (TestWebKitAPI::WebKit2CrashLoader::WebKit2CrashLoader):
      (TestWebKitAPI::WebKit2CrashLoader::loadUrl):
      (TestWebKitAPI::WebKit2CrashLoader::crashWebProcess):
      (TestWebKitAPI::didFinishLoad):
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/Tests/WebKit2/WebKit2.pro:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148312 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      21e7432e
  19. 09 Apr, 2013 1 commit
    • thiago.santos@intel.com's avatar
      [WK2] Drop WebProcess capabilities on Linux using seccomp filters · 0ee9d4d0
      thiago.santos@intel.com authored
      https://bugs.webkit.org/show_bug.cgi?id=89875
      
      Reviewed by Maciej Stachowiak.
      
      .:
      
      Added the bits to EFL/CMake buildsystem to find the libseccomp
      library.
      
      * Source/cmake/FindLibSeccomp.cmake: Added.
      * Source/cmake/OptionsEfl.cmake:
      * Source/cmake/WebKitFeatures.cmake:
      * Source/cmakeconfig.h.cmake:
      
      Source/WebCore:
      
      Make the DATA_DIR global since it is now needed for WebCore and WebKit2.
      It is now used to set a sandbox policy for the EFL port.
      
      * PlatformEfl.cmake:
      
      Source/WebKit2:
      
      Introduce the foundations of the SeccompFilter-based sandbox. The
      hardening of the WebProcess (and potentially PluginProcess, etc)
      works by a combination of the two things:
      
      - Blocking syscalls that are not used, reducing the size of the attack
      surface.
      - Trapping sensitive syscalls and delegating the execution of these
      syscalls to a separated trusted process subject to a set of policies.
      
      The initial implementation traps the open()-family of syscalls on WebKit
      EFL's and Qt's WebProcess, but it could be easily used by any Linux port,
      since the code is suppose to be Linux-compliant. The list of syscalls handled
      by the broker process should definitely grow as we mature the
      implementation. Other syscalls needs to be handled to get this sandbox
      fully functional, like unlink(), mkdir(), etc.
      
      The broker process should be initialized as early as possible on the
      sandboxed process main() function, because it only does a fork(), which
      is cheap on Linux. That also aims to minimize the resident memory footprint
      of the broker process.
      
      Opening of files for upload and saving downloads is not supported yet,
      since it should be handled to the UIProcess in a similar fashion as
      the Mac port does.
      
      * PlatformEfl.cmake:
      * Shared/linux/SeccompFilters/OpenSyscall.cpp: Added.
      (WebKit):
      (WebKit::OpenSyscall::createFromOpenatContext):
      (WebKit::OpenSyscall::createFromCreatContext):
      (WebKit::OpenSyscall::OpenSyscall):
      (WebKit::OpenSyscall::setResult):
      (WebKit::OpenSyscall::execute):
      (WebKit::OpenSyscall::encode):
      (WebKit::OpenSyscall::decode):
      (WebKit::OpenSyscallResult::OpenSyscallResult):
      (WebKit::OpenSyscallResult::~OpenSyscallResult):
      (WebKit::OpenSyscallResult::encode):
      (WebKit::OpenSyscallResult::decode):
      * Shared/linux/SeccompFilters/OpenSyscall.h: Added.
      (CoreIPC):
      (WebKit):
      (OpenSyscall):
      (WebKit::OpenSyscall::setPath):
      (WebKit::OpenSyscall::setFlags):
      (WebKit::OpenSyscall::setMode):
      (OpenSyscallResult):
      (WebKit::OpenSyscallResult::fd):
      (WebKit::OpenSyscallResult::errorNumber):
      * Shared/linux/SeccompFilters/SeccompBroker.cpp: Added.
      (WebKit):
      (SeccompBrokerClient):
      (WebKit::sendMessage):
      (WebKit::receiveMessage):
      (WebKit::SIGSYSHandler):
      (WebKit::registerSIGSYSHandler):
      (WebKit::SeccompBrokerClient::shared):
      (WebKit::SeccompBrokerClient::SeccompBrokerClient):
      (WebKit::SeccompBrokerClient::~SeccompBrokerClient):
      (WebKit::SeccompBrokerClient::dispatch):
      (WebKit::SeccompBrokerClient::handleIfOpeningOnlineCPUCount):
      (WebKit::SeccompBroker::launchProcess):
      (WebKit::SeccompBroker::initialize):
      (WebKit::SeccompBroker::runLoop):
      * Shared/linux/SeccompFilters/SeccompBroker.h: Added.
      (WebKit):
      (SeccompBroker):
      (WebKit::SeccompBroker::setSyscallPolicy):
      (WebKit::SeccompBroker::SeccompBroker):
      * Shared/linux/SeccompFilters/SeccompFilters.cpp: Added.
      (WebKit):
      (WebKit::SeccompFilters::SeccompFilters):
      (WebKit::SeccompFilters::~SeccompFilters):
      (WebKit::SeccompFilters::addRule):
      (WebKit::SeccompFilters::initialize):
      * Shared/linux/SeccompFilters/SeccompFilters.h: Added.
      (WebKit):
      (SeccompFilters):
      (WebKit::SeccompFilters::context):
      (WebKit::SeccompFilters::platformInitialize):
      * Shared/linux/SeccompFilters/SigactionSyscall.cpp: Added.
      (WebKit):
      (WebKit::SigactionSyscall::createFromContext):
      * Shared/linux/SeccompFilters/SigactionSyscall.h: Added.
      (WebKit):
      (SigactionSyscall):
      * Shared/linux/SeccompFilters/SigprocmaskSyscall.cpp: Added.
      (WebKit):
      (WebKit::SigprocmaskSyscall::createFromContext):
      * Shared/linux/SeccompFilters/SigprocmaskSyscall.h: Added.
      (WebKit):
      (SigprocmaskSyscall):
      * Shared/linux/SeccompFilters/Syscall.cpp: Added.
      (WebKit):
      (WebKit::Syscall::createFromContext):
      (WebKit::Syscall::createFromDecoder):
      (WebKit::Syscall::Syscall):
      (WebKit::SyscallResult::createFromDecoder):
      (WebKit::SyscallResult::SyscallResult):
      * Shared/linux/SeccompFilters/Syscall.h: Added.
      (CoreIPC):
      (WebKit):
      (Syscall):
      (WebKit::Syscall::~Syscall):
      (WebKit::Syscall::type):
      (WebKit::Syscall::setContext):
      (WebKit::Syscall::context):
      (SyscallResult):
      (WebKit::SyscallResult::~SyscallResult):
      (WebKit::SyscallResult::type):
      * Shared/linux/SeccompFilters/SyscallPolicy.cpp: Added.
      (WebKit):
      (WebKit::removeTrailingSlash):
      (WebKit::SyscallPolicy::hasPermissionForPath):
      (WebKit::SyscallPolicy::addFilePermission):
      (WebKit::SyscallPolicy::addDirectoryPermission):
      (WebKit::SyscallPolicy::addDefaultWebProcessPolicy):
      * Shared/linux/SeccompFilters/SyscallPolicy.h: Added.
      (WebKit):
      (SyscallPolicy):
      * Target.pri:
      * WebKit2.pri:
      * WebProcess/efl/SeccompFiltersWebProcessEfl.cpp: Added.
      (WebKit):
      (WebKit::SeccompFiltersWebProcessEfl::SeccompFiltersWebProcessEfl):
      (WebKit::SeccompFiltersWebProcessEfl::platformInitialize):
      * WebProcess/efl/SeccompFiltersWebProcessEfl.h: Added.
      (WebKit):
      (SeccompFiltersWebProcessEfl):
      * WebProcess/qt/SeccompFiltersWebProcessQt.cpp: Added.
      (WebKit):
      (WebKit::SeccompFiltersWebProcessQt::SeccompFiltersWebProcessQt):
      (WebKit::SeccompFiltersWebProcessQt::platformInitialize):
      * WebProcess/qt/SeccompFiltersWebProcessQt.h: Added.
      (WebKit):
      (SeccompFiltersWebProcessQt):
      * WebProcess/qt/WebProcessQt.cpp:
      (WebKit::WebProcess::platformInitializeWebProcess):
      * WebProcess/soup/WebProcessSoup.cpp:
      (WebKit::WebProcess::platformInitializeWebProcess):
      
      Tools:
      
      Add unit tests to verify if the handling of the open, openat, creat syscall
      is being done right. We check if the Read/Write/ReadAndWrite permissions
      are respected, if the canonical path is being resolved and if
      the permissions are falling back to the topmost parent directory with a
      policy set when the directory being opened has no policy.
      
      We also test if any attempt of blocking SIGSYS is silently ignored.
      SIGSYS cannot be blocked because in it's handler is where we hook
      syscalls to the broker process.
      
      Also added libseccomp to EFL's jhbuild to make the life of developers
      willing to help easier.
      
      * Scripts/webkitperl/FeatureList.pm:
      * TestWebKitAPI/PlatformEfl.cmake:
      * TestWebKitAPI/Tests/WebKit2/SeccompFilters.cpp: Added.
      (TestWebKitAPI):
      (SeccompEnvironment):
      (TestWebKitAPI::SeccompEnvironment::SetUp):
      (TestWebKitAPI::SeccompEnvironment::TearDown):
      (TestWebKitAPI::dummyHandler):
      (TestWebKitAPI::TEST):
      (TestWebKitAPI::stressTest):
      * efl/jhbuild.modules:
      * qmake/mkspecs/features/features.pri:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147998 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0ee9d4d0
  20. 19 Mar, 2013 1 commit
    • mikhail.pozdnyakov@intel.com's avatar
      [EFL][WK2] Separate WebView further from EwkView · 95177455
      mikhail.pozdnyakov@intel.com authored
      https://bugs.webkit.org/show_bug.cgi?id=111591
      
      Reviewed by Caio Marcelo de Oliveira Filho.
      
      Source/WebKit2:
      
      Main points are:
      - WKView API has no dependency on EFL types
      - WebView class does not store the Evas_Object
      
      * UIProcess/API/C/efl/WKView.cpp:
      (WKViewCreate):
      
          WKView creation does not require any EFL objects to be passed.
      
      * UIProcess/API/C/efl/WKView.h:
      * UIProcess/API/efl/EwkView.cpp:
      (EwkView::EwkView):
      (EwkView::create):
      
          WKViewRef is passed to EwkView constructor from outside rather than
          created inside.
      
      (EwkView::webView):
      * UIProcess/API/efl/EwkView.h:
      (EwkView):
      (EwkView::wkView):
      (EwkView::page):
      
          EwkView keeps WKViewRef rather than pointer to WebView class.
      
      * UIProcess/API/efl/ewk_view_private.h: Added.
      (EWKViewCreate):
      (EWKViewGetWKView):
      
          Added private API to create ewk view evas object and return its WKViewRef.
      
      * UIProcess/API/efl/ewk_view.cpp:
      (ewkCreateEvasObject):
      (ewk_view_smart_add):
      (ewk_view_add):
      (ewk_view_add_with_context):
      * UIProcess/efl/WebInspectorProxyEfl.cpp:
      (WebKit::WebInspectorProxy::platformCreateInspectorPage):
      
          Updated accordingly to the new APIs.
      
      * UIProcess/efl/WebView.cpp:
      (WebKit::WebView::WebView):
      (WebKit::WebView::create):
      (WebKit):
      (WebKit::WebView::setEwkView):
      (WebKit::WebView::isViewFocused):
      (WebKit::WebView::isViewVisible):
      * UIProcess/efl/WebView.h:
      (WebView):
      
          Implementation of updated WKView API.
      
      Tools:
      
      Updated EFL PlatformWebView to meet the new WKView API and ewk view private API.
      PlatformWKView is pointer to Evas_Object for EFL, as this is more natural and
      since we can afford it having EWKViewGetWKView() private API to access WKView.
      
      * TestWebKitAPI/PlatformWebView.h:
      * TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks.cpp:
      (TestWebKitAPI::TEST):
      * TestWebKitAPI/efl/PlatformWebView.cpp:
      (TestWebKitAPI::PlatformWebView::PlatformWebView):
      (TestWebKitAPI::PlatformWebView::~PlatformWebView):
      (TestWebKitAPI::PlatformWebView::resizeTo):
      (TestWebKitAPI::PlatformWebView::page):
      (TestWebKitAPI::PlatformWebView::simulateSpacebarKeyPress):
      (TestWebKitAPI::PlatformWebView::simulateMouseMove):
      (TestWebKitAPI::PlatformWebView::simulateRightClick):
      * WebKitTestRunner/PlatformWebView.h:
      * WebKitTestRunner/efl/EventSenderProxyEfl.cpp:
      (WTR::EventSenderProxy::dispatchEvent):
      (WTR::EventSenderProxy::keyDown):
      (WTR::EventSenderProxy::sendTouchEvent):
      (WTR::EventSenderProxy::setTouchModifier):
      * WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
      (WTR::PlatformWebView::PlatformWebView):
      (WTR::PlatformWebView::~PlatformWebView):
      (WTR::PlatformWebView::resizeTo):
      (WTR::PlatformWebView::page):
      (WTR::PlatformWebView::focus):
      (WTR::PlatformWebView::windowSnapshotImage):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146265 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      95177455
  21. 15 Mar, 2013 1 commit
  22. 08 Mar, 2013 1 commit
  23. 04 Mar, 2013 1 commit
    • mikhail.pozdnyakov@intel.com's avatar
      [WK2][EFL] Add callbacks to the WKViewClient to handle Web Process crash and relaunch · 5cca59ff
      mikhail.pozdnyakov@intel.com authored
      https://bugs.webkit.org/show_bug.cgi?id=109828
      
      Reviewed by Kenneth Rohde Christiansen.
      
      Source/WebKit2:
      
      Providing WKViewClient with Web Process crash and Web Process relaunch
      callbacks brings better design as WebView should not be aware of
      EFL-specific code handling the corresponding events.
      
      The implementation of the mentioned Web Process callbacks was also added.
      
      * UIProcess/API/C/efl/WKView.cpp:
      (WKViewSetThemePath):
      * UIProcess/API/C/efl/WKView.h:
      * UIProcess/efl/ViewClientEfl.cpp:
      (WebKit::ViewClientEfl::webProcessCrashed):
      (WebKit):
      (WebKit::ViewClientEfl::webProcessDidRelaunch):
      (WebKit::ViewClientEfl::ViewClientEfl):
      * UIProcess/efl/ViewClientEfl.h:
      (ViewClientEfl):
      * UIProcess/efl/WebView.cpp:
      (WebKit::WebView::setThemePath):
      
          Accepts WTF::String instead of WKStringRef as it is
          more appropriate for C++ API implementation class.
      
      (WebKit::WebView::processDidCrash):
      (WebKit::WebView::didRelaunchProcess):
      * UIProcess/efl/WebView.h:
      (WebView):
      * UIProcess/efl/WebViewClient.cpp:
      (WebKit::WebViewClient::webProcessCrashed):
      (WebKit):
      (WebKit::WebViewClient::webProcessDidRelaunch):
      * UIProcess/efl/WebViewClient.h:
      
      Tools:
      
      Added API test for newly added Web Process crash and Web Process relaunch WKViewClient
      callbacks.
      
      * TestWebKitAPI/CMakeLists.txt:
      
          Tests located in 'TestWebKitAPI/Tests/WebKit2' subdirectories are also
          considered.
      
      * TestWebKitAPI/PlatformEfl.cmake:
      * TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks.cpp: Added.
      (TestWebKitAPI):
      (TestWebKitAPI::didFinishLoadForFrame):
      (TestWebKitAPI::setPageLoaderClient):
      (TestWebKitAPI::webProcessCrashed):
      (TestWebKitAPI::webProcessDidRelaunch):
      (TestWebKitAPI::setViewClient):
      (TestWebKitAPI::TEST):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144664 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5cca59ff
  24. 18 Feb, 2013 2 commits
    • commit-queue@webkit.org's avatar
      [Qt][WK2] Remove duped test name and append new test in project file · 72f1d2f7
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=110117
      
      A new WK2 API test has landed recently (ResizeWindowAfterCrash), this patch will
      add this test into the runnable test suite and remove a duped test in project file.
      
      Patch by Adenilson Cavalcanti <cavalcantii@gmail.com> on 2013-02-18
      Reviewed by Jocelyn Turcotte.
      
      * TestWebKitAPI/Tests/WebKit2/WebKit2.pro:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143221 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      72f1d2f7
    • allan.jensen@digia.com's avatar
      [Qt][WK2] Support WK2 API tests · a9ab9240
      allan.jensen@digia.com authored
      https://bugs.webkit.org/show_bug.cgi?id=109843
      
      Reviewed by Jocelyn Turcotte.
      
      Source/WebKit2:
      
      * UIProcess/API/qt/qquickwebview_p.h:
      (TestWebKitAPI):
      
      Tools:
      
      * TestWebKitAPI/DerivedSources.pri: Added.
      * TestWebKitAPI/InjectedBundle.pri: Added.
      * TestWebKitAPI/PlatformWebView.h:
      * TestWebKitAPI/TestWebKitAPI.pri:
      * TestWebKitAPI/TestWebKitAPI.pro:
      * TestWebKitAPI/Tests/JavaScriptCore/JavaScriptCore.pro: Added.
      * TestWebKitAPI/Tests/WTF/WTF.pro:
      * TestWebKitAPI/Tests/WebKit2/WebKit2.pro: Added.
      * TestWebKitAPI/qt/PlatformUtilitiesQt.cpp:
      (TestWebKitAPI::Util::sleep):
      (TestWebKitAPI::Util::createInjectedBundlePath):
      (TestWebKitAPI::Util::createURLForResource):
      (TestWebKitAPI::Util::isKeyDown):
      (Util):
      * TestWebKitAPI/qt/PlatformWebViewQt.cpp: Added.
      (TestWebKitAPI):
      (WrapperWindow):
      (TestWebKitAPI::WrapperWindow::WrapperWindow):
      (TestWebKitAPI::WrapperWindow::handleStatusChanged):
      (TestWebKitAPI::PlatformWebView::PlatformWebView):
      (TestWebKitAPI::PlatformWebView::~PlatformWebView):
      (TestWebKitAPI::PlatformWebView::resizeTo):
      (TestWebKitAPI::PlatformWebView::page):
      (TestWebKitAPI::PlatformWebView::focus):
      (TestWebKitAPI::PlatformWebView::simulateSpacebarKeyPress):
      (TestWebKitAPI::PlatformWebView::simulateAltKeyPress):
      (TestWebKitAPI::PlatformWebView::simulateMouseMove):
      (TestWebKitAPI::PlatformWebView::simulateRightClick):
      * TestWebKitAPI/qt/main.cpp:
      (addQtWebProcessToPath):
      (main):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a9ab9240
  25. 15 Feb, 2013 1 commit
  26. 12 Feb, 2013 1 commit
    • commit-queue@webkit.org's avatar
      [WK2] Page reloading will crash UIProcess after WebProcess was killed · 994a2a11
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=109305
      
      Patch by Adenilson Cavalcanti <cavalcantii@gmail.com> on 2013-02-12
      Reviewed by Benjamin Poulain.
      
      Source/WebKit2:
      
      Re-initialize the pointer to a WebInspectorProxy object before calling
      initializeWebPage().
      
      When the WebProcess crashes, WebPageProxy::processDidCrash() will
      set WebInspectorProxy pointer to null, which later is accessed by
      initializeWebPage(). This patch avoids a crash scenario where
      calls into a null pointer would be made.
      
      * UIProcess/WebPageProxy.cpp:
      (WebKit::WebPageProxy::reattachToWebProcess):
      
      Tools:
      
      Adding a new test to simulate the case of WebProcess crash followed by a trying
      to load a new page.
      
      * TestWebKitAPI/GNUmakefile.am:
      * TestWebKitAPI/PlatformEfl.cmake:
      * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
      * TestWebKitAPI/Tests/WebKit2/ReloadPageAfterCrash.cpp: Added.
      (TestWebKitAPI):
      (TestWebKitAPI::didFinishLoad):
      (TestWebKitAPI::TEST):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142704 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      994a2a11
  27. 03 Feb, 2013 1 commit
  28. 31 Jan, 2013 1 commit
    • enrica@apple.com's avatar
      WebKit2: provide new bundle APIs to allow bundle clients to be notified of pasteboard access. · 7eb1d5bc
      enrica@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=108396.
      <rdar://problem/12920461>
      
      Source/WebCore: 
      
      Reviewed by Alexey Proskuryakov.
      
      Adds support in WebCore to new EditorClient methods to support the modified
      client bundle API in WebKit2.
      
      * WebCore.exp.in:
      * editing/Editor.cpp:
      (WebCore::Editor::cut): Added call to willWriteSelectionToPasteboard.
      (WebCore::Editor::copy): Ditto.
      (WebCore::Editor::willWriteSelectionToPasteboard): Added.
      * editing/Editor.h:
      * loader/EmptyClients.h: Added empty client implementation
      for the new methods.
      (WebCore::EmptyEditorClient::willWriteSelectionToPasteboard):
      (WebCore::EmptyEditorClient::getClientPasteboardDataForRange):
      * page/EditorClient.h:
      * platform/mac/PasteboardMac.mm:
      (WebCore::Pasteboard::writeSelectionForTypes): Added call to getClientPasteboardDataForRange.
      
      Source/WebKit/blackberry: 
      
      Reviewed by Alexey Proskuryakov.
      
      Adds stub implementation for WebKit of the new EditorClient methods.
      
      * WebCoreSupport/EditorClientBlackBerry.cpp:
      (WebCore::EditorClientBlackBerry::willWriteSelectionToPasteboard):
      (WebCore::EditorClientBlackBerry::getClientPasteboardDataForRange):
      * WebCoreSupport/EditorClientBlackBerry.h:
      
      Source/WebKit/chromium: 
      
      Reviewed by Alexey Proskuryakov.
      
      Adds stub implementation for WebKit of the new EditorClient methods.
      
      * src/EditorClientImpl.cpp:
      (WebKit::EditorClientImpl::willWriteSelectionToPasteboard):
      (WebKit::EditorClientImpl::getClientPasteboardDataForRange):
      * src/EditorClientImpl.h:
      
      Source/WebKit/efl: 
      
      Reviewed by Alexey Proskuryakov.
      
      Adds stub implementation for WebKit of the new EditorClient methods.
      
      * WebCoreSupport/EditorClientEfl.cpp:
      (WebCore::EditorClientEfl::willWriteSelectionToPasteboard):
      (WebCore::EditorClientEfl::getClientPasteboardDataForRange):
      * WebCoreSupport/EditorClientEfl.h:
      
      Source/WebKit/gtk: 
      
      Reviewed by Alexey Proskuryakov.
      
      Adds stub implementation for WebKit of the new EditorClient methods.
      
      * WebCoreSupport/EditorClientGtk.cpp:
      (WebKit::EditorClient::willWriteSelectionToPasteboard):
      (WebKit::EditorClient::getClientPasteboardDataForRange):
      * WebCoreSupport/EditorClientGtk.h:
      
      Source/WebKit/mac: 
      
      Reviewed by Alexey Proskuryakov.
      
      Adds stub implementation for WebKit of the new EditorClient methods.
      
      * WebCoreSupport/WebEditorClient.h:
      * WebCoreSupport/WebEditorClient.mm:
      (WebEditorClient::willWriteSelectionToPasteboard):
      (WebEditorClient::getClientPasteboardDataForRange):
      
      Source/WebKit/qt: 
      
      Reviewed by Alexey Proskuryakov.
      
      Adds stub implementation for WebKit of the new EditorClient methods.
      
      * WebCoreSupport/EditorClientQt.cpp:
      (WebCore::EditorClientQt::willWriteSelectionToPasteboard):
      (WebCore::EditorClientQt::getClientPasteboardDataForRange):
      * WebCoreSupport/EditorClientQt.h:
      
      Source/WebKit/win: 
      
      Reviewed by Alexey Proskuryakov.
      
      Adds stub implementation for WebKit of the new EditorClient methods.
      
      * WebCoreSupport/WebEditorClient.cpp:
      (WebEditorClient::willWriteSelectionToPasteboard):
      (WebEditorClient::getClientPasteboardDataForRange):
      * WebCoreSupport/WebEditorClient.h:
      
      Source/WebKit/wince: 
      
      Reviewed by Alexey Proskuryakov.
      
      Adds stub implementation for WebKit of the new EditorClient methods.
      
      * WebCoreSupport/EditorClientWinCE.cpp:
      (WebKit::EditorClientWinCE::willWriteSelectionToPasteboard):
      (WebKit::EditorClientWinCE::getClientPasteboardDataForRange):
      * WebCoreSupport/EditorClientWinCE.h:
      
      Source/WebKit/wx: 
      
      Reviewed by Alexey Proskuryakov.
      
      Adds stub implementation for WebKit of the new EditorClient methods.
      
      * WebKitSupport/EditorClientWx.cpp:
      (WebCore::EditorClientWx::willWriteSelectionToPasteboard):
      (WebCore::EditorClientWx::getClientPasteboardDataForRange):
      * WebKitSupport/EditorClientWx.h:
      
      Source/WebKit2: 
      
      Reviewed by Alexey Proskuryakov.
      
      This patch adds new bundle client API to receive notifications
      relative the pasteboard activity. There are 2 new API added to
      InjectedBundleEditorClient, to receive notification before and
      after the pasteboard content is added and one API to provide
      additional content to add to the pasteboard.
      In order to create content to add to the pasteboard, WKWebArchiveRef
      and WKWebArchiveResourcesRef have been added to the set of API level
      object.
      This work is a joint effort with Sam Weinig who contributed the
      support for WKWebArchiveRef, WKWebArchiveResourcesRef and related
      files. Sam is the author of the first chunk of changes listed below.
              
      * Shared/API/c/WKBase.h:
      * Shared/API/c/WKSharedAPICast.h:
      * Shared/API/c/mac/WKWebArchive.cpp: Added.
      (WKWebArchiveGetTypeID):
      (WKWebArchiveCreate):
      (WKWebArchiveCreateWithData):
      (WKWebArchiveCreateFromRange):
      (WKWebArchiveCopyMainResource):
      (WKWebArchiveCopySubresources):
      (WKWebArchiveCopySubframeArchives):
      (WKWebArchiveCopyData):
      * Shared/API/c/mac/WKWebArchive.h: Added.
      * Shared/API/c/mac/WKWebArchiveResource.cpp: Added.
      (WKWebArchiveResourceGetTypeID):
      (WKWebArchiveResourceCreate):
      (WKWebArchiveResourceCopyData):
      (WKWebArchiveResourceCopyURL):
      (WKWebArchiveResourceCopyMIMEType):
      (WKWebArchiveResourceCopyTextEncoding):
      * Shared/API/c/mac/WKWebArchiveResource.h: Added.
      * Shared/APIObject.h:
      * Shared/WebArchive.cpp: Added.
      (WebKit::WebArchive::create):
      (WebKit::WebArchive::WebArchive):
      (WebKit::WebArchive::~WebArchive):
      (WebKit::WebArchive::mainResource):
      (WebKit::WebArchive::subresources):
      (WebKit::WebArchive::subframeArchives):
      (WebKit::releaseCFData):
      (WebKit::WebArchive::data):
      (WebKit::WebArchive::coreLegacyWebArchive):
      * Shared/WebArchive.h: Added.
      (WebKit::WebArchive::type):
      * Shared/WebArchiveResource.cpp: Added.
      (WebKit::WebArchiveResource::create):
      (WebKit::WebArchiveResource::WebArchiveResource):
      (WebKit::WebArchiveResource::~WebArchiveResource):
      (WebKit::releaseCFData):
      (WebKit::WebArchiveResource::data):
      (WebKit::WebArchiveResource::URL):
      (WebKit::WebArchiveResource::MIMEType):
      (WebKit::WebArchiveResource::textEncoding):
      (WebKit::WebArchiveResource::coreArchiveResource):
      * Shared/WebArchiveResource.h: Added.
      (WebKit::WebArchiveResource::type):
      * WebKit2.xcodeproj/project.pbxproj:
              
      * Shared/APIClientTraits.cpp: Added versioning to InjectedBundlePageEditorClient.
      * Shared/APIClientTraits.h:
      * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
      * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
      (WebKit::InjectedBundlePageEditorClient::willWriteToPasteboard): Added.
      (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange): Added.
      (WebKit::InjectedBundlePageEditorClient::didWriteToPasteboard): Added.
      * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
      * WebProcess/WebCoreSupport/WebEditorClient.cpp:
      (WebKit::WebEditorClient::didWriteSelectionToPasteboard):
      (WebKit::WebEditorClient::willWriteSelectionToPasteboard):
      (WebKit::WebEditorClient::getClientPasteboardDataForRange):
      * WebProcess/WebCoreSupport/WebEditorClient.h:
      
      Tools: 
      
      Reviewed by Alexey Proskuryakov.
              
      Adding new WebKit2 test with relevant bundle, to test the new APIs.
      
      * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
      * TestWebKitAPI/Tests/WebKit2/PasteboardNotifications.mm: Added.
      (TestWebKitAPI::didReceiveMessageFromInjectedBundle):
      (TestWebKitAPI::setInjectedBundleClient):
      * TestWebKitAPI/Tests/WebKit2/PasteboardNotifications_Bundle.cpp: Added.
      (PasteboardNotificationsTest):
      (TestWebKitAPI::willWriteToPasteboard):
      (TestWebKitAPI::getPasteboardDataForRange):
      (TestWebKitAPI::didWriteToPasteboard):
      (TestWebKitAPI::PasteboardNotificationsTest::PasteboardNotificationsTest):
      (TestWebKitAPI::PasteboardNotificationsTest::didCreatePage):
      * TestWebKitAPI/Tests/WebKit2/execCopy.html: Added.
      * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: Updated to reflect
      changes in InjectedBundleEditorClient.
      (WTR::InjectedBundlePage::InjectedBundlePage):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141473 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7eb1d5bc
  29. 28 Jan, 2013 2 commits
    • joepeck@webkit.org's avatar
      [Mac] Update PageVisibilityState when WebView is hidden / visible · 2152e36f
      joepeck@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=107509
      
      Source/WebKit/mac:
      
      Reviewed by NOBODY (OOPS!).
      
      * WebView/WebView.mm:
      * WebView/WebViewPrivate.h:
      (-[WebView _commonInitializationWithFrameName:groupName:]):
      Set the initial visibility of the page.
      
      (-[WebView addWindowObserversForWindow:]):
      (-[WebView removeWindowObservers]):
      (-[WebView _isViewVisible]):
      (-[WebView _updateVisibilityState]):
      (-[WebView viewDidMoveToWindow]):
      (-[WebView _windowVisibilityChanged:]):
      Update visibility state in the same ways WK2 does. This involves
      listening for some new NSWindow delegates.
      
      Tools:
      
      Add a test that PageVisibility of WK1 WebViews and WK2 WKViews
      automatically changes between hidden and visible as the view is added
      and removed from window, or when it is in a window that changes
      visibility, for instance by minimizing / deminimizing.
      
      Reviewed by NOBODY (OOPS!).
      
      * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
      * TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.html: Added.
      * TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm: Added.
      (-[PageVisibilityStateDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:]):
      (runJavaScriptAlert):
      (PageVisibilityStateWithWindowChanges):
      (TestWebKitAPI::PageVisibilityStateWithWindowChanges::initializeView):
      (TestWebKitAPI::PageVisibilityStateWithWindowChanges::deinitializeView):
      (TestWebKitAPI::PageVisibilityStateWithWindowChanges::runTest):
      (TestWebKitAPI::TEST_F):
      Test visibility state of a page in a WebView/WKView with different window states.
      
      * TestWebKitAPI/mac/WebKitAgnosticTest.h:
      * TestWebKitAPI/mac/WebKitAgnosticTest.mm:
      (TestWebKitAPI::WebKitAgnosticTest::deinitializeView):
      (TestWebKitAPI::WebKitAgnosticTest::runWebKit1Test):
      (TestWebKitAPI::WebKitAgnosticTest::runWebKit2Test):
      Add a WK1 and WK2 deinitializeView to balance initializeView.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141011 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2152e36f
    • joepeck@webkit.org's avatar
      Improve PageVisibility API with enums · 5fd52db0
      joepeck@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=107364
      
      Reviewed by Sam Weinig.
      
      Source/WebKit/mac:
      
      * WebView/WebView.mm:
      * WebView/WebViewPrivate.h:
      (corePageVisibilityState):
      (-[WebView _setVisibilityState:isInitialState:]):
      Switch the private API form int to a WebPageVisibilityState enum.
      
      Source/WebKit2:
      
      * Shared/API/c/WKPageVisibilityTypes.h: Added.
      * Shared/API/c/WKSharedAPICast.h:
      (WebKit::toPageVisibilityState):
      Create an enum for page visibility APIs and a conversion function
      for the WK2 values to WebCore values.
      
      * Target.pri:
      * GNUmakefile.list.am:
      * WebKit2.xcodeproj/project.pbxproj:
      Add WKPageVisibilityTypes.h to the build as a private export.
      
      * UIProcess/API/C/WKPage.h:
      * UIProcess/API/C/WKPage.cpp:
      (WKPageSetVisibilityState):
      * UIProcess/WebPageProxy.h:
      * UIProcess/WebPageProxy.cpp:
      (WebKit::WebPageProxy::setVisibilityState):
      UIProcess API to set visibility state. WebPageProxy already
      had m_visibilityState, so update that when setter is used.
      
      * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
      * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
      * WebProcess/InjectedBundle/InjectedBundle.cpp:
      * WebProcess/InjectedBundle/InjectedBundle.h:
      Remove the old SPI for WebKitTestRunner. Tests now use the C API.
      
      * WebProcess/WebPage/WebPage.h:
      * WebProcess/WebPage/WebPage.cpp:
      (WebKit::WebPage::setVisibilityState):
      * WebProcess/WebPage/WebPage.messages.in:
      Update the existing WebPage API to use uint32_t, which matches
      other enum message types.
      
      Tools:
      
      * DumpRenderTree/mac/TestRunnerMac.mm:
      (TestRunner::resetPageVisibility):
      (TestRunner::setPageVisibility):
      Update the WK1 test code to use the new WK1 enums.
      
      * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
      (WTR::InjectedBundle::setVisibilityState):
      * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
      (InjectedBundle):
      * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
      (WTR::TestRunner::setPageVisibility):
      (WTR::TestRunner::resetPageVisibility):
      * WebKitTestRunner/TestController.cpp:
      (WTR::TestController::setVisibilityState):
      * WebKitTestRunner/TestController.h:
      (TestController):
      * WebKitTestRunner/TestInvocation.cpp:
      (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
      Update the WK2 test code to use the new WK2 API and enums.
      
      * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
      * TestWebKitAPI/Tests/WebKit2/PageVisibilityState.cpp: Added.
      (TestWebKitAPI):
      (TestWebKitAPI::setPageVisibilityStateWithEvalContinuation):
      (TestWebKitAPI::assertSerializedScriptValueIsStringValue):
      (TestWebKitAPI::didRunStep1StateChangeVisibleToHidden):
      (TestWebKitAPI::didRunStep2StateChangeHiddenToPrerender):
      (TestWebKitAPI::didRunStep3StateChangePrerenderToPreview):
      (TestWebKitAPI::didRunStep4InStatePreview):
      (TestWebKitAPI::TEST):
      Test the new WK2 API with all enum types.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141010 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5fd52db0
  30. 15 Jan, 2013 1 commit
    • enrica@apple.com's avatar
      Add a new set of WebKit2 APIs for text search and · ebd80c2b
      enrica@apple.com authored
      search results management.
      https://bugs.webkit.org/show_bug.cgi?id=106834.
      <rdar://problem/12597159>
      
      Source/WebCore: 
      
      Reviewed by Simon Fraser.
              
      Adding new API to perform text search in WebKit2 without using
      the stock UI. The new interface provides all the information
      necessary to write a custom UI for search.
      
      Added new TextWebKitAPI test.
      
      * WebCore.exp.in: Added new exported methods.
      * editing/Editor.cpp:
      (WebCore::Editor::countMatchesForText): Added new parameter to store
      all the ranges relative to the matches found.
      * editing/Editor.h: Modified the interface of countMatchesForText and removed
      the other definition of countMatchesForText with a different signature.
      * page/Page.cpp:
      (WebCore::Page::findStringMatchingRanges): Added.
      (WebCore::Page::markAllMatchesForText): Changed to use the new unified
      countMatchesForText.
      * page/Page.h:
      
      Source/WebKit/mac: 
      
      Reviewed by Simon Fraser.
              
      Adding new API to perform text search in WebKit2 without using
      the stock UI. The new interface provides all the information
      necessary to write a custom UI for search.
      
      Added new TextWebKitAPI test.
      
      * WebView/WebHTMLView.mm:
      (-[WebHTMLView countMatchesForText:inDOMRange:options:limit:markMatches:]):
      Modified to reflect the changes to Editor::countMatchesForText interface.
      
      Source/WebKit2: 
      
      Reviewed by Simon Fraser.
              
      Adding new API to perform text search in WebKit2 without using
      the stock UI. The new interface provides all the information
      necessary to write a custom UI for search. The main logic is
      implemented in the new functions added to FindController.
      
      Added new TextWebKitAPI test.
      
      * UIProcess/API/C/WKPage.cpp:
      (WKPageFindStringMatches): Added.
      (WKPageGetImageForFindMatch): Added.
      (WKPageSelectFindMatch): Added.
      (WKPageSetPageFindMatchesClient): Added.
      * UIProcess/API/C/WKPage.h: Added the new API definitions.
      * UIProcess/WebFindClient.cpp: Added new client callbacks.
      (WebKit::WebFindMatchesClient::didFindStringMatches):
      (WebKit::WebFindMatchesClient::didGetImageForMatchResult):
      * UIProcess/WebFindClient.h:
      (WebFindMatchesClient): Added.
      * UIProcess/WebPageProxy.cpp: Added proxy methods.
      (WebKit::WebPageProxy::initializeFindMatchesClient):
      (WebKit::WebPageProxy::findStringMatches):
      (WebKit::WebPageProxy::getImageForFindMatch):
      (WebKit::WebPageProxy::selectFindMatch):
      (WebKit::WebPageProxy::didGetImageForFindMatch):
      (WebKit::WebPageProxy::didFindStringMatches):
      * UIProcess/WebPageProxy.h:
      * UIProcess/WebPageProxy.messages.in:
      * WebProcess/WebPage/FindController.cpp:
      (WebKit::FindController::findStringMatches): Finds all the matching
      text according to the find options. All the matching text ranges are
      stored in a vector until the next call to findStringMatches or until
      hideFindUI is called. The message that is sent back to the UI process
      contains a vector containing an entry for each find match (i.e. for each
      range) and each entry is represented by a vector of the corresponding
      text rects. It also returns the index in the vector of matches corresponding
      to the first match after the user selection.
      If there is no selection the index is always 0 and if there are no
      matches after the user selection, the index returned is -1.
      (WebKit::FindController::getFindIndicatorBitmapAndRect): Helper function
      to share code between updateFindIndicator and getImageForFindMatch.
      (WebKit::FindController::getImageForFindMatch): Creates the image corresponding
      to the text matched at the given match index.
      (WebKit::FindController::selectFindMatch): creates a selection for the range
      corresponding to the given match index.
      (WebKit::FindController::hideFindUI): Added logic to clear the vector
      of matched ranges.
      (WebKit::FindController::updateFindIndicator): Updated to use the
      new helper function getFindIndicatorBitmapAndRect.
      * WebProcess/WebPage/FindController.h:
      * WebProcess/WebPage/WebPage.cpp:
      (WebKit::WebPage::findStringMatches):
      (WebKit::WebPage::getImageForFindMatch):
      (WebKit::WebPage::selectFindMatch):
      * WebProcess/WebPage/WebPage.h:
      * WebProcess/WebPage/WebPage.messages.in:
      
      Tools: 
      
      Added new test for the new WebKit2 API for
      text search.
              
      Reviewed by Simon Fraser.
      
      * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
      * TestWebKitAPI/Tests/WebKit2/FindMatches.mm: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139796 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ebd80c2b
  31. 28 Nov, 2012 1 commit
    • japhet@chromium.org's avatar
      Move empty loading to DocumentLoader, simplify FrameLoader::init() · ce6c1baa
      japhet@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=101512
      
      Reviewed by Adam Barth.
      
      Source/WebCore:
      
      No new tests, though several outputs changed because we no longer send resource
          load callbacks for empty loads.
      
      * loader/DocumentLoader.cpp:
      (WebCore::DocumentLoader::DocumentLoader):
      (WebCore::DocumentLoader::~DocumentLoader):
      (WebCore::DocumentLoader::finishedLoading):
      (WebCore::DocumentLoader::commitData):
      (WebCore::DocumentLoader::clearMainResourceLoader):
      (WebCore::DocumentLoader::isLoadingInAPISense):
      (WebCore::DocumentLoader::documentURL):
      (WebCore::DocumentLoader::isLoadingMainResource):
      (WebCore::DocumentLoader::maybeLoadEmpty):
      (WebCore):
      (WebCore::DocumentLoader::startLoadingMainResource): Handle empty main resource
           loads directly here.
      * loader/DocumentLoader.h:
      (WebCore::DocumentLoader::serverRedirectSourceForHistory):
      (DocumentLoader):
      * loader/FrameLoader.cpp:
      (WebCore::FrameLoader::FrameLoader): Initialize some variables whose values
          were previously being reset in init(). Given that the FrameLoader is in
          an inconsistent state before init() is called anyway, there doesn't seem
          to be a disadvantage to just initializing them to their post-init() values.
      (WebCore::FrameLoader::init): Just call startLoadingMainResource(), instead of
          doing a bunch of direct calls to functions FrameLoader shouldn't know about.
      * loader/FrameLoaderStateMachine.cpp:
      (WebCore::FrameLoaderStateMachine::FrameLoaderStateMachine):
      * loader/FrameLoaderStateMachine.h:
      * loader/MainResourceLoader.cpp: Throughout, remove the concept of an empty load.
      (WebCore::MainResourceLoader::loadNow): This only returned true when an empty
          load got deferred, which won't happen now. Return void and always treat
          as returning false.
      * loader/MainResourceLoader.h:
      (MainResourceLoader):
      
      Tools:
      
      * DumpRenderTree/chromium/WebViewHost.cpp:
      (WebViewHost::updateForCommittedLoad): This function doesn't play nicely with empty urls and incorrectly
          interprets them as a non-empty load. This change is required for
           http/tests/navigation/new-window-redirect-history.html to continue to pass in chromium.
      * TestWebKitAPI/Tests/WebKit2/AboutBlankLoad.cpp: This test relies on a callback that no longer
           is sent for about:blank loads.  Hook into didFinishLoadForFrame() instead.
      (TestWebKitAPI::didFinishLoadForFrame):
      (TestWebKitAPI::TEST):
      
      LayoutTests:
      
      Don't expect resource load callbacks for empty loads.
      
      * http/tests/inspector/network/network-iframe-load-and-delete.html:
      * http/tests/loading/redirect-methods-expected.txt:
      * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt:
      * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt:
      * http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136031 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ce6c1baa
  32. 26 Nov, 2012 1 commit
    • commit-queue@webkit.org's avatar
      Text Autosizing: Add Text Autosizing APIs for WK2 · 213d529a
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=100633
      
      Patch by Jaehun Lim <ljaehun.lim@samsung.com> on 2012-11-26
      Reviewed by Sam Weinig.
      
      Source/WebKit2:
      
      Implement basic Text Autosizing APIs for WK2.
      Text Autosizing is a useful feature for mobile browsers. It adjusts the font size
      of text in wide columns, and makes text more legible.
      This patch adds setting APIs for Text Autosizing in WK2.
      
      * Shared/WebPreferencesStore.h:
      (WebKit):
      * UIProcess/API/C/WKPreferences.cpp:
      (WKPreferencesSetTextAutosizingEnabled):
      (WKPreferencesGetTextAutosizingEnabled):
      * UIProcess/API/C/WKPreferences.h:
      * WebProcess/WebPage/WebPage.cpp:
      (WebKit::WebPage::updatePreferences):
      
      Tools:
      
      Add test cases for Text Autosizing in WKPreferences.
      
      * TestWebKitAPI/Tests/WebKit2/WKPreferences.cpp:
      (TestWebKitAPI::TEST):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      213d529a
  33. 22 Nov, 2012 1 commit
  34. 31 Oct, 2012 1 commit
  35. 30 Oct, 2012 1 commit