1. 13 Jan, 2011 1 commit
    • enrica@apple.com's avatar
      Source/WebCore: WebKit2: Add support for drag and drop · 9d9813d0
      enrica@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=52343
      <rdar://problem/7660558>
                     
      Reviewed by Darin Adler.
      
      This patch contains the changes required to support dropping content
      in WebKit on the Mac. The DragData class has been extended to provide
      additional context from the application (keyboard state, modal windows, etc.)
      as well as information of the drag pasteboard being used.
      The support for WebKit as drag source will be added with a separate patch.
      
      * WebCore.exp.in:
      * page/DragController.cpp:
      (WebCore::DragController::dragIsMove): Added DragData parameter.
      (WebCore::DragController::tryDocumentDrag): Modified call to dragIsMove.
      (WebCore::DragController::concludeEditDrag): Same as above.
      * page/DragController.h: Added parameter to isCopyKeyDown.
      * page/mac/DragControllerMac.mm:
      The following methods have been modified to use the information stored
      in the DragData class.
      (WebCore::DragController::isCopyKeyDown):
      (WebCore::DragController::dragOperation):
      * platform/DragData.h:
      (WebCore::DragData::flags):
      * platform/DragData.cpp: Added default flags parameter to the constructor.
      * platform/mac/DragDataMac.mm:
      (WebCore::DragData::DragData): Added constructor that receives the name of the pasteboard to use.
      (WebCore::DragData::canSmartReplace):
      (WebCore::DragData::containsColor):
      (WebCore::DragData::containsFiles):
      (WebCore::DragData::asFilenames):
      (WebCore::DragData::containsPlainText):
      (WebCore::DragData::asPlainText):
      (WebCore::DragData::containsCompatibleContent):
      (WebCore::DragData::asURL):
      (WebCore::DragData::asFragment):
      All the following files have been modified to add the DragData
      parameter to isCopyKeyDown. I plan to improve this in the future
      and make isCopyKeyDown not platform specific.
      * page/android/DragControllerAndroid.cpp:
      (WebCore::DragController::isCopyKeyDown):
      * page/brew/DragControllerBrew.cpp:
      (WebCore::DragController::isCopyKeyDown):
      * page/chromium/DragControllerChromium.cpp:
      (WebCore::DragController::isCopyKeyDown):
      * page/efl/DragControllerEfl.cpp:
      (WebCore::DragController::isCopyKeyDown):
      * page/gtk/DragControllerGtk.cpp:
      (WebCore::DragController::isCopyKeyDown):
      * page/haiku/DragControllerHaiku.cpp:
      (WebCore::DragController::isCopyKeyDown):
      * page/mac/DragControllerMac.mm:
      (WebCore::DragController::isCopyKeyDown):
      (WebCore::DragController::dragOperation):
      * page/qt/DragControllerQt.cpp:
      (WebCore::DragController::isCopyKeyDown):
      * page/win/DragControllerWin.cpp:
      (WebCore::DragController::isCopyKeyDown):
      * page/wx/DragControllerWx.cpp:
      (WebCore::DragController::isCopyKeyDown):
      
      WebKit/mac: WebKit2: Add support for drag and drop
      https://bugs.webkit.org/show_bug.cgi?id=52343
      <rdar://problem/7660558>
              
      Reviewed by Darin Adler.
      
      The DragData class has been extended to provide
      additional context from the application (keyboard state, modal windows, etc.)
      as well as information of the drag pasteboard being used.
      These are the changes to align the behavior for WebKit.
      
      * WebView/WebView.mm:
      (-[WebView applicationFlags:]): Added.
      (-[WebView draggingEntered:]): Added parameter to the DragData constructor.
      (-[WebView draggingUpdated:]): Added parameter to the DragData constructor.
      (-[WebView draggingExited:]): Added parameter to the DragData constructor.
      (-[WebView performDragOperation:]): Added parameter to the DragData constructor.
      
      WebKit2: WebKit2: Add support for drag and drop
      https://bugs.webkit.org/show_bug.cgi?id=52343
      <rdar://problem/7660558>
                     
      Reviewed by Darin Adler.
      
      This patch contains the changes required to support dropping content
      in WebKit on the Mac. The DragData class has been extended to provide
      additional context from the application (keyboard state, modal windows, etc.)
      as well as information of the drag pasteboard being used.
      The support for WebKit as drag source will be added with a separate patch.
      
      * Shared/DragControllerAction.h: Added.
      * UIProcess/API/mac/WKView.mm:
      Added implemention of the methods required to add suport for a drop target.
      To maintain asynchronous communication with the WebProcess, we always return
      the previous calculated value for the drag operation.
      (-[WKView _registerDraggedTypes]):
      (-[WKView initWithFrame:contextRef:pageGroupRef:]):
      (-[WKView applicationFlags:]):
      (-[WKView draggingEntered:]):
      (-[WKView draggingUpdated:]):
      (-[WKView draggingExited:]):
      (-[WKView prepareForDragOperation:]):
      (-[WKView performDragOperation:]):
      * UIProcess/WebPageProxy.cpp:
      (WebKit::WebPageProxy::WebPageProxy):
      (WebKit::WebPageProxy::performDragControllerAction):
      (WebKit::WebPageProxy::didPerformDragControllerAction):
      * UIProcess/WebPageProxy.h:
      (WebKit::WebPageProxy::dragOperation):
      (WebKit::WebPageProxy::resetDragOperation):
      * UIProcess/WebPageProxy.messages.in:
      * WebKit2.xcodeproj/project.pbxproj:
      * WebProcess/WebCoreSupport/WebDragClient.cpp:
      (WebKit::WebDragClient::willPerformDragDestinationAction):
      (WebKit::WebDragClient::willPerformDragSourceAction):
      (WebKit::WebDragClient::actionMaskForDrag):
      (WebKit::WebDragClient::dragSourceActionMaskForPoint):
      (WebKit::WebDragClient::startDrag):
      * WebProcess/WebPage/WebPage.cpp:
      (WebKit::WebPage::performDragControllerAction):
      * WebProcess/WebPage/WebPage.h:
      * WebProcess/WebPage/WebPage.messages.in:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75743 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9d9813d0
  2. 08 Jan, 2011 1 commit
  3. 16 Aug, 2010 1 commit
    • morrita@google.com's avatar
      2010-08-13 MORITA Hajime <morrita@google.com> · 222ce095
      morrita@google.com authored
              Reviewed by Tony Chang.
      
              https://bugs.webkit.org/show_bug.cgi?id=43778
              Dropping should fire textInput event.
      
              * editing/pasteboard/drop-text-events-expected.txt: Added.
              * editing/pasteboard/drop-text-events-sideeffect-expected.txt: Added.
              * editing/pasteboard/drop-text-events-sideeffect.html: Added.
              * editing/pasteboard/drop-text-events.html: Added.
              * editing/pasteboard/script-tests/drop-text-events-sideeffect.js: Added.
              * editing/pasteboard/script-tests/drop-text-events.js: Added.
      2010-08-13  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Tony Chang.
      
              https://bugs.webkit.org/show_bug.cgi?id=43778
              Dropping should fire textInput event
      
              This change:
              - added TextEvent::m_isDrop to distinguish drop-initiated events.
              - added to dispatch TextEvent from DragController before making a side effect
                and cancel the side effect if the event prevents default
      
              Tests: editing/pasteboard/drop-text-events-sideeffect.html
                     editing/pasteboard/drop-text-events.html
      
              * dom/TextEvent.cpp:
              (WebCore::TextEvent::createForDrop): Added.
              (WebCore::TextEvent::TextEvent):
              * dom/TextEvent.h:
              (WebCore::TextEvent::isDrop): Added.
              * editing/Editor.cpp:
              (WebCore::Editor::handleTextEvent):
              (WebCore::Editor::findEventTargetFrom): Extracted from findEventTargetFromSelection().
              (WebCore::Editor::findEventTargetFromSelection):
              * editing/Editor.h:
              * page/DragController.cpp:
              (WebCore::DragController::dispatchTextInputEventFor): Added.
              (WebCore::DragController::concludeEditDrag): Added an event dispatch path.
              * page/DragController.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      222ce095
  4. 30 Apr, 2010 1 commit
    • ddkilzer@apple.com's avatar
      WebCore: Convert m_documentUnderMouse, m_dragInitiator to RefPtr. · 35884699
      ddkilzer@apple.com authored
      Eliminated unused m_dragInitiator accessor to prevent dereferencing.
      https://bugs.webkit.org/show_bug.cgi?id=37618
      
      Patch by Abhishek Arya <inferno@chromium.org> on 2010-04-30
      Reviewed by David Kilzer.
      
      Test: editing/pasteboard/drag-drop-iframe-refresh-crash.html
      
      * page/DragController.cpp:
      (WebCore::DragController::tryDocumentDrag):
      (WebCore::DragController::concludeEditDrag):
      * page/DragController.h:
      (WebCore::DragController::draggingImageURL):
      (WebCore::DragController::documentUnderMouse):
      
      LayoutTests: Tests for a crash when an image drag-drop operation happens inside a continuously refreshing iframe.
      https://bugs.webkit.org/show_bug.cgi?id=37618
      
      Patch by Abhishek Arya <inferno@chromium.org> on 2010-04-30
      Reviewed by David Kilzer.
      
      * editing/pasteboard/drag-drop-iframe-refresh-crash-expected.txt: Added.
      * editing/pasteboard/drag-drop-iframe-refresh-crash.html: Added.
      * editing/resources/drag-drop.html: Added.
      * platform/qt/Skipped:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@58616 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      35884699
  5. 28 Apr, 2010 2 commits
  6. 27 Feb, 2010 1 commit
    • mitz@apple.com's avatar
      <rdar://problem/7696607> Links do not respect -webkit-user-drag: none · 29bb5006
      mitz@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=35475
      
      Reviewed by Maciej Stachowiak.
      
      WebCore: 
      
      Test: fast/css/user-drag-none.html
      
      * page/DragController.cpp:
      (WebCore::DragController::mayStartDragAtEventLocation): Added a node
      parameter. The image drag check is done against the node, rather than
      than against the hit test result. This prevents a non-draggable image
      with an auto-draggable ancestor from being dragged alone. The link drag
      check now ignores links that are -webkit-user-drag: none.
      * page/DragController.h:
      * page/EventHandler.cpp:
      (WebCore::EventHandler::shouldDragAutoNode): Pass the current node
      to mayStartDragAtEventLocation().
      
      LayoutTests: 
      
      * fast/css/user-drag-none-expected.txt: Added.
      * fast/css/user-drag-none.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55353 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      29bb5006
  7. 11 Nov, 2009 1 commit
    • zoltan@webkit.org's avatar
      Allow custom memory allocation control for the part of page directory in WebCore · 5ecf980a
      zoltan@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=31350
      
      Reviewed by Eric Seidel.
      
      Inherits the following classes from Noncopyable because these are instantiated
      by 'new' and these are no need to be copyable:
      
      class DragController         - instantiated at: WebCore/page/Page.cpp:107
      class FocusController        - instantiated at: WebCore/page/Page.cpp:109
      class Settings               - instantiated at: WebCore/page/Page.cpp:116
      class PluginHalter           - instantiated at: WebCore/page/Page.cpp:160
      struct ScheduledEvent        - instantiated at: WebCore/page/FrameView.cpp:1275
      class UserScript             - instantiated at: WebCore/page/PageGroup.cpp:208
      struct EventHandlerDragState - instantiated at: WebCore/page/EventHandler.cpp:182
      class XSSAuditor             - instantiated at: WebCore/bindings/js/ScriptController.cpp:70
      class UserStyleSheet         - instantiated at: WebCore/page/PageGroup.cpp:222
      
      Inherits PropertyWrapperBase class from Noncopyable because (its child class) 
      PropertyWrapper is instantiated by 'new' in 
      WebCore/page/animation/AnimationBase.cpp:564 it is no need to be copyable.
      
      * page/DragController.h:
      * page/EventHandler.h:
      * page/FocusController.h:
      * page/FrameView.cpp:
      * page/PluginHalter.h:
      * page/Settings.h:
      * page/UserScript.h:
      * page/UserStyleSheet.h:
      * page/XSSAuditor.h:
      * page/animation/AnimationBase.cpp:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50810 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5ecf980a
  8. 11 Sep, 2009 1 commit
    • eric@webkit.org's avatar
      2009-09-11 Eric Seidel <eric@webkit.org> · 58165d43
      eric@webkit.org authored
              No review, rolling out r48229.
              http://trac.webkit.org/changeset/48229
      
              * fast/events/drag-dropeffect-expected.txt: Removed.
              * fast/events/drag-dropeffect.html: Removed.
      2009-09-11  Eric Seidel  <eric@webkit.org>
      
              No review, rolling out r48229.
              http://trac.webkit.org/changeset/48229
      
              * WebCore.base.exp:
              * dom/Clipboard.cpp:
              (WebCore::Clipboard::Clipboard):
              (WebCore::Clipboard::sourceOperation):
              * page/DragController.cpp:
              (WebCore::DragController::DragController):
              (WebCore::DragController::dragExited):
              (WebCore::DragController::performDrag):
              (WebCore::DragController::dragEnteredOrUpdated):
              (WebCore::DragController::tryDHTMLDrag):
              (WebCore::DragController::startDrag):
              * page/DragController.h:
              * page/EventHandler.cpp:
              (WebCore::EventHandler::updateDragAndDrop):
              (WebCore::EventHandler::dragSourceMovedTo):
              (WebCore::EventHandler::handleDrag):
              * page/EventHandler.h:
      2009-09-11  Eric Seidel  <eric@webkit.org>
      
              No review, rolling out r48229.
              http://trac.webkit.org/changeset/48229
      
              * WebView/WebFrame.mm:
              (-[WebFrame _dragSourceMovedTo:]):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48321 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      58165d43
  9. 09 Sep, 2009 1 commit
    • eric@webkit.org's avatar
      2009-09-09 Jens Alfke <snej@chromium.org> · 99e6cded
      eric@webkit.org authored
              Reviewed by Eric Seidel.
      
              Initialize DataTransfer's effectAllowed and dropEffect properties correctly
              according to HTML5 spec (sec. 7.9.2-7.9.3).
              https://bugs.webkit.org/show_bug.cgi?id=26700
      
              * fast/events/drag-dropeffect-expected.txt: Added.
              * fast/events/drag-dropeffect.html: Added.
      2009-09-09  Jens Alfke  <snej@chromium.org>
      
              Reviewed by Eric Seidel.
      
              Initialize DataTransfer's effectAllowed and dropEffect properties correctly
              according to HTML5 spec (sec. 7.9.2-7.9.3).
              https://bugs.webkit.org/show_bug.cgi?id=26700
              - At the start of a drag operation, the value of effectAllowed should be
                the string "uninitialized".
              - At end of dragstart handler, if effectAllowed hasn't been set yet, it
                should be set to "copy".
              - on dragenter and dragover event, dropEffect should be initialized to a
                default value based on the value of effectAllowed.
              - at end of dragenter and dragover the dropEffect should be set to "none"
                if the value set by the handler doesn't match the effectAllowed.
              - on dragleave event, dropEffect should be "none".
              - on drop event, dropEffect should be the previously negotiated value.
      
              Test: fast/events/drag-dropeffect.html
      
              * WebCore.base.exp:
                  Added a parameter to EventHandler::dragSourceMovedTo.
              * dom/Clipboard.cpp:
              (WebCore::Clipboard::Clipboard):
                  Initialize m_effectAllowed to "uninitialized".
              (WebCore::Clipboard::sourceOperation):
                  Treat "uninitialized" as meaning no value has been set.
              * page/DragController.cpp:
              (WebCore::DragController::DragController):
                  Initialize new member m_destinationDragOperation.
              (WebCore::DragController::dragExited):
                  Set m_destinationDragOperation to none on dragExit.
              (WebCore::DragController::performDrag):
                  Set m_destinationDragOperation to current dropEffect.
              (WebCore::DragController::dragEnteredOrUpdated):
                  Make sure to clear the operation if drag source doesn't allow it.
              (WebCore::DragController::tryDHTMLDrag):
                  Set a default value for the dst drag op before sending dragEnter/Over.
              (WebCore::DragController::startDrag):
                  Clear m_destinationDragOperation at start of drag.
              * page/DragController.h:
              (WebCore::DragController::destinationDragOperation):
                  Added new member m_destinationDragOperation, and its public getter.
              * page/EventHandler.cpp:
              (WebCore::EventHandler::updateDragAndDrop):
                  dropEffect should be 'none' during dropleave handler, per spec.
              (WebCore::EventHandler::dragSourceMovedTo):
                  Added DragOperation parameter, so the handler sees the current dropEffect.
              (WebCore::EventHandler::handleDrag):
                  Assume DragOperationEvery for non-DHTML drags.
              * page/EventHandler.h:
                  Added DragOperation parameter to dragSourceMovedTo().
      2009-09-09  Jens Alfke  <snej@chromium.org>
      
              Reviewed by Eric Seidel.
      
              Initialize DataTransfer's effectAllowed and dropEffect properties correctly
              according to HTML5 spec (sec. 7.9.2-7.9.3).
              https://bugs.webkit.org/show_bug.cgi?id=26700
      
              * WebView/WebFrame.mm:
              (-[WebFrame _dragSourceMovedTo:]):
                  Pass current drag operation (if known) to EventHandler::dragSourceMovedTo().
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48229 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      99e6cded
  10. 24 Jun, 2009 1 commit
    • eric@webkit.org's avatar
      2009-06-05 Eric Seidel <eric@webkit.org> · 3c6ea8a1
      eric@webkit.org authored
              Reviewed by Oliver Hunt.
      
              https://bugs.webkit.org/show_bug.cgi?id=25922
              Fix dropEffect = "none" to work as expected.
      
              * fast/events/drag-to-navigate-expected.txt: Copied from LayoutTests/editing/selection/doubleclick-whitespace-img-crash-expected.txt.
              * fast/events/drag-to-navigate.html: Added.
              * fast/events/prevent-drag-to-navigate-expected.txt: Copied from LayoutTests/editing/selection/doubleclick-whitespace-img-crash-expected.txt.
              * fast/events/prevent-drag-to-navigate.html: Added.
              * fast/events/resources/file-for-drag-to-navigate.html: Added.
              * fast/events/resources/file-for-prevent-drag-to-navigate.html: Added.
      
      2009-06-05  Eric Seidel  <eric@webkit.org>
      
              Reviewed by Oliver Hunt.
      
              https://bugs.webkit.org/show_bug.cgi?id=25922
              JS setting dropEffect = "none" causes tryDHTMLDrag
              to return DragOperationNone.  Which is also the value
              tryDHTMLDrag previously used to indicate JS did not
              want to handle the drag.
      
              Make it possible for the DragController::try* methods
              to return a bool to indicate if javascript accepted
              or rejected the drag event, separate from the DragOperation.
      
              Tests:
              - fast/events/drag-to-navigate.html
              - fast/events/prevent-drag-to-navigate.html
      
              * page/DragController.cpp:
              (WebCore::DragController::dragEnteredOrUpdated):
              (WebCore::DragController::tryDocumentDrag):
              (WebCore::defaultOperationForDrag):
              (WebCore::DragController::tryDHTMLDrag):
              * page/DragController.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@45064 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3c6ea8a1
  11. 21 May, 2009 2 commits
    • eric@webkit.org's avatar
      2009-05-21 Eric Seidel <eric@webkit.org> · 3d81d65f
      eric@webkit.org authored
              Reviewed by Alexey Proskuryakov.
      
              Clean up DragController
              https://bugs.webkit.org/show_bug.cgi?id=25926
      
              I renamed m_document to m_documentUnderMouse to better document what it does
              I could call it m_lastDocumentUnderMouse to be most-accurate, but this seemed
              long enough.
      
              I also saw copy/paste code involving clearing the selection when moving out of
              one document and into another.  I moved that code into a function called
              mouseMovedIntoDocument.
      
              I also got rid of a couple needless null-checks after confirming via source
              inspection they were not ever possible.
              In Mac WebKit it's not possible to have a Page that doesn't have a mainFrame()
              I left an ASSERT(m_page->mainFrame()) in case some other port ever violates this.
              It's also not possible to return a document from documentAtPoint that is not
              in a frame (as such a document would not be rendered).
      
              No functional changes, thus no tests.
      
              * page/DragController.cpp:
              (WebCore::DragController::DragController):
              (WebCore::DragController::dragIsMove):
              (WebCore::DragController::dragExited):
              (WebCore::DragController::performDrag):
              (WebCore::DragController::mouseMovedIntoDocument):
              (WebCore::DragController::dragEnteredOrUpdated):
              (WebCore::DragController::tryDocumentDrag):
              (WebCore::DragController::operationForLoad):
              (WebCore::DragController::concludeEditDrag):
              (WebCore::DragController::canProcessDrag):
              (WebCore::DragController::tryDHTMLDrag):
              (WebCore::DragController::placeDragCaret):
              * page/DragController.h:
              (WebCore::DragController::documentUnderMouse):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43968 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3d81d65f
    • eric@webkit.org's avatar
      2009-05-21 Eric Seidel <eric@webkit.org> · 5797165d
      eric@webkit.org authored
              Reviewed by Alexey Proskuryakov.
      
              Rename DragController::dragOperation() to sourceDragOperation() for clarity
              Remove unused setDragOperation()
      
              There are two times DragOperation is used.  The source specifies
              what drag operations it supports (in a mask) and the destination
              picks a subset of those as DragOperations it supports if a drop were
              to occur.  I was confused when I first saw this accessor as to which
              it meant.  It turns out that this is only used when WebKit starts a
              drag, and we keep it around so that we can provide this information
              to other Mac OS X applications when they ask.  I've renamed the method
              for clarity so the next person in this code will be less confused.
      
              No functional changes, thus no tests.
      
              * page/DragController.h:
              (WebCore::DragController::sourceDragOperation):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43967 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5797165d
  12. 12 Jan, 2009 1 commit
    • darin@apple.com's avatar
      2009-01-11 Darin Adler <darin@apple.com> · faced26e
      darin@apple.com authored
              Reviewed by Oliver Hunt.
      
              Bug 23102: turn on unused parameter warnings in WebCore
              https://bugs.webkit.org/show_bug.cgi?id=23102
      
              Fourth step: Remove arguments entirely in the many cases where they are not
              needed at all. This step is a little less mechanical than the earlier ones.
      
              * dom/DOMImplementation.cpp:
              (WebCore::DOMImplementation::isXMLMIMEType): Pass TextCaseSensitive when creating
              the regular expression, since we already specify a-zA-Z in our expression.
      
              * dom/Document.cpp:
              (WebCore::Document::databaseThread): Don't pass in the document when creating
              a DatabaseThread.
      
              * dom/Element.cpp:
              (WebCore::Element::createRareData): Don't pass the element when creating an
              ElementRareData.
              (WebCore::Element::detach): Don't pass the element when calling resetComputedStyle.
              (WebCore::Element::recalcStyle): Ditto.
      
              * dom/ElementRareData.h: Remove the unused Element* from the constructor and
              the resetComputedStyle function.
      
              * dom/EventTargetNode.cpp:
              (WebCore::EventTargetNode::dispatchEvent): Don't pass ec to dispatchGenericEvent.
              (WebCore::EventTargetNode::dispatchGenericEvent): Remove the unused ec argument.
              (WebCore::EventTargetNode::dispatchWindowEvent): Don't pass ec to dispatchGenericEvent.
              * dom/EventTargetNode.h: Remove the ExceptionCode& argument form disaptchGenericEvent.
      
              * editing/ApplyStyleCommand.cpp: Remove the empty removeBlockStyle function.
              (WebCore::ApplyStyleCommand::pushDownTextDecorationStyleAroundNode): Remove the unused
              start and end arguments.
              (WebCore::ApplyStyleCommand::pushDownTextDecorationStyleAtBoundaries): Don't pass start
              and end to pushDownTextDecorationStyleAroundNode.
      
              * editing/ApplyStyleCommand.h: Remove the empty removeBlockStyle function. Removed the
              unused start and end arguments from pushDownTextDecorationStyleAroundNode.
      
              * editing/htmlediting.cpp: Removed include of unused RegularExpression.h header.
      
              * html/HTMLTokenizer.cpp:
              (WebCore::Token::addAttribute): Removed unused Document* argument.
              (WebCore::HTMLTokenizer::parseTag): Don't pass document to addAttribute.
      
              * html/HTMLTokenizer.h: Removed unused Document* argument to to addAttribute.
      
              * page/DOMWindow.cpp:
              (WebCore::DOMWindow::localStorage): Don't pass the frame to storageArea.
      
              * page/DragController.cpp:
              (WebCore::DragController::dragIsMove): Removed unused DragData argument.
              (WebCore::DragController::performDrag): Call concludeEditDrag rather than
              concludeDrag.
              (WebCore::DragController::tryDocumentDrag): Don't pass dragData to dragIsMove.
              (WebCore::DragController::concludeEditDrag): Renamed to make it clear this
              should only be called for edit drags. Removed the action mask argument. Also
              changed dragIsMove call sites to not pass dragData.
      
              * page/DragController.h: Updated for above changes and tweaked comment format.
      
              * page/Frame.cpp:
              (WebCore::createRegExpForLabels): Pass TextCaseSensitive and TextCaseInsensitive
              when creating regular expressions for clarity. Call match instead of search,
              since both do the same thing except for with negative start offsets, and none
              used here are negative.
              (WebCore::Frame::matchLabelsAgainstElement): Ditto.
      
              * page/Page.h: Moved TextCaseSensitivity from here to StringImpl.h in platform.
      
              * page/mac/AccessibilityObjectWrapper.mm:
              (AXAttributeStringSetHeadingLevel): Removed unused object argument.
              (AXAttributedStringAppendText): Ditto.
              (-[AccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]): Ditto.
      
              * page/mac/FrameMac.mm:
              (WebCore::regExpForLabels): Pass TextCaseSensitive and TextCaseInsensitive
              when creating regular expressions for clarity. Call match instead of search,
              since both do the same thing except for with negative start offsets, and none
              used here are negative.
              (WebCore::Frame::matchLabelsAgainstElement): Ditto.
      
              * platform/graphics/SegmentedFontData.cpp:
              (WebCore::SegmentedFontData::containsCharacter): Added.
              (WebCore::SegmentedFontData::containsCharacters): Updated to check all characters
              instead of just the first one, using containsCharacter.
      
              * platform/graphics/SegmentedFontData.h: Made more members private.
              Added containsCharacter function member.
      
              * platform/mac/DragImageMac.mm:
              (WebCore::dragImageSize): Changed to use RetainPtr<NSImage> directly instead of
              DragImageRef for clarity, since this is platform-specific code.
              (WebCore::deleteDragImage): Ditto. Also remove argument name to get rid of unused
              variable warning.
              (WebCore::scaleDragImage): Ditto.
              (WebCore::dissolveDragImageToFraction): Ditto.
              (WebCore::createDragImageFromImage): Ditto.
              (WebCore::createDragImageIconForCachedImage): Ditto.
      
              * platform/mac/WebFontCache.mm:
              (acceptableChoice): Removed the unused weight-related arguments.
              (betterChoice): Ditto.
              (+[WebFontCache internalFontWithFamily:traits:weight:size:]): Ditto.
      
              * platform/posix/FileSystemPOSIX.cpp: Removed the implementation of listDirectory
              because we'd rather get a link error rather than a runtime error if we use it
              for anything, and right now it's not used.
      
              * platform/text/RegularExpression.cpp: Removed unused private data,
              including pattern, lastMatchString, lastMatchOffsets, lastMatchCount,
              and lastMatchPos. Made the RegularExpression::Private::regex be private
              and use an accessor function to get at it.
              (WebCore::RegularExpression::RegularExpression): Removed the const char* version
              of the constructor because it's not any more efficient. Changed the boolean
              constructor argument to use TextCaseSensitivity instead to make it less likely
              we'll use it wrong.
              (WebCore::RegularExpression::operator=): Since the only member is a single RefPtr,
              just use plain old assignment on it. The only reason we do this instead of using
              the compiler generated assignment operator is that we want the Private structure
              to be internal to the .cpp file.
              (WebCore::RegularExpression::match): Added a null check so we won't crash if
              we fail to compile the regular expression. Removed the code to handle multiple
              match strings, since that was unused.
      
              * platform/text/RegularExpression.h: Changed the case sensitivity argument to use
              TextCaseSensitivity and not have a default value. Removed the default constructor,
              and the pattern, match, and pos functions.
      
              * platform/text/StringImpl.h: Moved the TextCaseSensitivity enum here from
              Page.h, because we should eventually use it in all the places where we have
              an argument to control case sensitivity, starting with the functions in this
              class.
      
              * platform/text/mac/ShapeArabic.c:
              (shapeUnicode): Removed the unused options and pErrorCode arguments. Even though
              this is code borrowed from ICU, this seems like a simple safe change to make.
              (shapeArabic): Don't pass options or pErrorCode in to shapeUnicode.
      
              * rendering/RenderPath.cpp:
              (WebCore::RenderPath::RenderPath): Removed the unused style argument.
              Also removed the type check. The argument already has the correct type,
              so it's not helpful to upcast it and then check its type again, unless
              we have some reason to believe the type is not reliable. And we don't.
      
              * rendering/RenderPath.h: Removed the RenderStyle* argument to the
              constructor. Also removed the explicit declaration of the destructor.
              It's not helpful or needed.
      
              * rendering/RenderSVGInlineText.cpp:
              (WebCore::RenderSVGInlineText::localCaretRect): Updated the comment here to
              make it clear that just returning an empty rect is not a good implementation.
              Removed the argument names to get rid of the warning.
      
              * rendering/RenderTreeAsText.cpp:
              (WebCore::printBorderStyle): Removed the unused RenderObject argument.
              (WebCore::operator<<): Updated for the change to printBorderStyle function.
      
              * storage/DatabaseThread.cpp:
              (WebCore::DatabaseThread::DatabaseThread): Removed the unused document argument.
              * storage/DatabaseThread.h: Ditto.
      
              * storage/LocalStorage.cpp:
              (WebCore::LocalStorage::storageArea): Removed the unused Frame* argument.
              * storage/LocalStorage.h: Ditto.
      
              * svg/SVGElement.cpp:
              (WebCore::SVGElement::sendSVGLoadEventIfPossible): Don't pass an exception
              code location to dispatchGenericEvent.
              * svg/SVGElementInstance.cpp:
              (WebCore::SVGElementInstance::dispatchEvent): Ditto.
      
              * svg/SVGStyledTransformableElement.cpp: Removed include of unused RegularExpression.h.
              (WebCore::SVGStyledTransformableElement::createRenderer): Don't pass style in to
              the RenderPath constructor.
      
              * svg/SVGTransformable.cpp: Removed include of unused RegularExpression.h.
      
              * xml/XSLTProcessor.cpp:
              (WebCore::createFragmentFromSource): Removed unused sourceNode argument.
              (WebCore::XSLTProcessor::transformToFragment): Don't pass sourceNode to createFragmentFromSource.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@39818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      faced26e
  13. 26 Nov, 2008 1 commit
    • darin@chromium.org's avatar
      2008-10-31 Tony Chang <tony@chromium.org> · 89e50aab
      darin@chromium.org authored
              Reviewed by Oliver Hunt.
      
              Add a new platform specific method cleanupAfterSystemDrag
              that platforms can ue to clean up drag state after a
              system drag.  Use this method on PLAFORM(MAC).
              https://bugs.webkit.org/show_bug.cgi?id=21956
      
              * ChangeLog:
              * page/DragController.cpp:
              (WebCore::DragController::doSystemDrag):
              * page/DragController.h:
              * page/gtk/DragControllerGtk.cpp:
              (WebCore::DragController::cleanupAfterSystemDrag):
              * page/mac/DragControllerMac.mm:
              (WebCore::DragController::cleanupAfterSystemDrag):
              * page/qt/DragControllerQt.cpp:
              (WebCore::DragController::cleanupAfterSystemDrag):
              * page/win/DragControllerWin.cpp:
              (WebCore::DragController::cleanupAfterSystemDrag):
              * page/wx/DragControllerWx.cpp:
            (WebCore::DragController::cleanupAfterSystemDrag):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@38805 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      89e50aab
  14. 24 Jul, 2007 1 commit
    • oliver's avatar
      WebCore: · 55cc92b5
      oliver authored
              Reviewed by Adam and Justin.
      
              <rdar://problem/5141779> WebView editableDOMRangeForPoint: & moveDragCaretToPoint: returns last position in DOMText range
      
              Remove bridge implementation for editableDOMRangeForPoint: and moveDragCaretToPoint:. 
              Now use cross-platform code Editor::rangeForPoint and DragController::placeDragCaret instead.
              This required lifting local code from DragController.cpp into the shared methods
              Frame::visiblePositionForPoint and Frame::documentAtPoint.
      
              * WebCore.exp:
              * editing/Editor.cpp:
              (WebCore::Editor::rangeForPoint):
              * editing/Editor.h:
              * page/DragController.cpp:
              (WebCore::DragController::dragEnded):
              (WebCore::DragController::performDrag):
              (WebCore::DragController::dragEnteredOrUpdated):
              (WebCore::DragController::tryDocumentDrag):
              (WebCore::DragController::operationForLoad):
              (WebCore::setSelectionToDragCaret):
              (WebCore::DragController::concludeDrag):
              (WebCore::DragController::placeDragCaret):
              * page/DragController.h:
              * page/Frame.cpp:
              (WebCore::Frame::visiblePositionForPoint):
              (WebCore::Frame::documentAtPoint):
              * page/Frame.h:
              * page/mac/WebCoreFrameBridge.h:
              * page/mac/WebCoreFrameBridge.mm:
      
      WebKit:
      
              Reviewed by Adam and Justin.
      
              <rdar://problem/5141779> WebView editableDOMRangeForPoint: & moveDragCaretToPoint: returns last position in DOMText range
      
              editableDOMRangeForPoint:, moveDragCaretToPoint:, and removeDragCaret now call directly into
              WebCore without relying on bridge look up through the now removed _bridgeAtPoint:.
      
              * WebKit.xcodeproj/project.pbxproj:
              * WebView/WebView.mm:
              (-[WebView moveDragCaretToPoint:]):
              (-[WebView removeDragCaret]):
              (-[WebView editableDOMRangeForPoint:]):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@24616 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      55cc92b5
  15. 19 Feb, 2007 1 commit
    • andersca's avatar
      Reviewed by Oliver. · f74b393e
      andersca authored
              Make DragController::maxDragImageSize a function to get rid of the global initializer.
              
              * page/DragController.cpp:
              (WebCore::DragController::doImageDrag):
              * page/DragController.h:
              * page/mac/DragControllerMac.mm:
              (WebCore::DragController::maxDragImageSize):
              * page/qt/DragControllerQt.cpp:
              (WebCore::DragController::maxDragImageSize):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@19713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f74b393e
  16. 18 Feb, 2007 1 commit
    • oliver's avatar
      2007-02-18 Oliver Hunt <oliver@apple.com> · cd54bad1
      oliver authored
              Reviewed by Adam.
      WebCore:
              More drag and drop migration, now the entirety of the
              drag initiation logic has been rendered platform independent
              This has required a number of new interfaces, and a reasonable
              amount of logic migration.
      
              As a side effect, this patch also fixes rdar://problem/4945341
      
              There are some basic Qt stubs that should stop the build from failing,
              however the absence of ClipboardQt means any attempt to initiate a drag 
              may cause a crash.
      
              * WebCore.exp:
                 Exporting new symbols
      
              * WebCore.xcodeproj/project.pbxproj:
                 New files
      
              * dom/Clipboard.cpp:
              (WebCore::Clipboard::canSaveAsWebArchive):
                Migrated from WebKit
      
              * dom/Clipboard.h:
                Added more methods to allow Clipboard to be used as a 
                platform independent container for drag and drop
      
              * page/DragClient.h:
              (WebCore::DragClient::declareAndWriteDragImage):
                This is a mac only helper function, so i've made it have an empty implementation,
                that way we won't need a PLATFORM(MAC) block in SVGImageEmptyClients
      
              * page/DragController.cpp:
              (WebCore::DragController::dragExited):
              (WebCore::DragController::performDrag):
              (WebCore::DragController::tryDocumentDrag): 
              (WebCore::DragController::tryDHTMLDrag):
                Using RefPtrs now
              (WebCore::getCachedImage):
              (WebCore::getImage):
                Helper functions                   
              (WebCore::dragLocForDHTMLDrag):
              (WebCore::dragLocForSelectionDrag):
              (WebCore::DragController::startDrag):
              (WebCore::DragController::doImageDrag):
              (WebCore::DragController::doSystemDrag):
                Logic that generates drag images and clipboard content, and
                initiates the actual system drag operation
      
              * page/DragController.h:
                Method and variable declarations
      
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleDrag):
                handleDrag is now platform independent
              (WebCore::EventHandler::handleTextInputEvent):
                 formatting
      
              * page/EventHandler.h:
              (WebCore::EventHandler::eventLoopHandleMouseDragged):
                Forgot to define this stub function 
      
              * page/Frame.h:
                Declaring dragImageForSelection to provide drag image for selected content
      
              * page/mac/DragControllerMac.mm:
                Defining drag images control vars
      
              * page/mac/EventHandlerMac.mm:
              (WebCore::EventHandler::createDraggingClipboard):
                Migrated old clipboard creation to here
      
              * page/mac/FrameMac.mm:
              (WebCore::Frame::dragImageForSelection):
                Wrap FrameMac::selectionImage
      
              * page/qt/DragControllerQt.cpp:
                Defining drag images control vars
      
              * page/qt/EventHandlerQt.cpp:
              (WebCore::EventHandler::createDraggingClipboard):
                stub
      
              * page/qt/FrameQt.cpp:
              (WebCore::Frame::dragImageForSelection):
                stub
      
              * platform/DragImage.cpp: Added.
              (WebCore::fitDragImageToMaxSize):
              (WebCore::createDragImageForSelection):
                 Platform independent processing for drag images
      
              * platform/DragImage.h: Added.
                 Declaring typedefs and wrapper functions to abstract the handling
                 of drag images 
      
              * platform/Pasteboard.h:
                Declaring extracted writeURL and writeSelection methods
      
              * platform/graphics/svg/SVGImageEmptyClients.h:
              (WebCore::SVGEmptyDragClient::willPerformDragSourceAction):
              (WebCore::SVGEmptyDragClient::startDrag):
              (WebCore::SVGEmptyDragClient::createDragImageForLink):
                Stubs FTW!
      
              * platform/mac/ClipboardMac.h:
              (WebCore::ClipboardMac::pasteboard):
                Provide accessor for underlying NSPasteboard
      
              * platform/mac/ClipboardMac.mm:
              (WebCore::ClipboardMac::hasData):
              (WebCore::ClipboardMac::writeRange):
              (WebCore::ClipboardMac::writeURL):
              (WebCore::ClipboardMac::declareAndWriteDragImage):
              (WebCore::ClipboardMac::createDragImage):
                 Implemented new Clipboarid functionality.
              (WebCore::ClipboardMac::dragNSImage):
                 Made this a const method
      
              * platform/mac/DragImageMac.mm: Added.
              (WebCore::dragImageSize):
              (WebCore::deleteDragImage):
              (WebCore::scaleDragImage):
              (WebCore::dissolveDragImageToFraction):
              (WebCore::createDragImageFromImage):
              (WebCore::createDragImageIconForCachedImage):
                 Implemented platform specific DragImage functions
      
              * platform/mac/PasteboardMac.mm:
              (WebCore::writeSelection):
              (WebCore::Pasteboard::writeSelection):
              (WebCore::writeURL):
              (WebCore::Pasteboard::writeURL):
                 Extracted member implementations of these functions, so that
                 Clipboard could also make use of this functionality.
                 Pasteboard methods now call the new non-member implementations.
                 Also fixed implementations to respect the list of requested types.
      
              * platform/qt/DragImageQt.cpp: Added.
              (WebCore::dragImageSize):
              (WebCore::deleteDragImage):
              (WebCore::scaleDragImage):
              (WebCore::dissolveDragImageToFraction):
              (WebCore::createDragImageFromImage):
              (WebCore::createDragImageIconForCachedImage):  
                Stubs
      
      WebKit:
              Moving the drag initiation logic to WebCore.
              The redundant code in webkit will be moved out in a later patch.
      
              * WebCoreSupport/WebDragClient.h:
              * WebCoreSupport/WebDragClient.mm:
              (getTopHTMLView):
                Helper function
              (WebDragClient::willPerformDragSourceAction):
              (WebDragClient::startDrag):
              (WebDragClient::createDragImageForLink):
                Implemented new DragClient methods
              (WebDragClient::declareAndWriteDragImage):
                Helper function for the Mac to allow new drag and drop
                code to match behaviour
                
              * WebView/WebHTMLView.mm:
              (-[WebHTMLView _dragImageForURL:withLabel:]):
              (-[WebHTMLView _dragImageForLinkElement:]):
                Refactoring old _dragImageForLinkElement function so that 
                the link drag image can be created with just a URL and label, 
                rather than requiring the original element
              (-[WebHTMLView dragImage:at:offset:event:pasteboard:source:slideBack:]):
                Removed logic that is no longer necessary                 
              (-[WebHTMLView _mouseDownEvent]):
                The WebDragClient may need the original mouseDownEvent of a drag when initiating
                a drag
              * WebView/WebHTMLViewInternal.h:
                Declaring _mouseDownEvent
      
              * WebView/WebHTMLViewPrivate.h:
                Declaring _dragImageForURL
                                              
            
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@19689 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cd54bad1
  17. 31 Jan, 2007 1 commit
    • oliver's avatar
      · a485c2f2
      oliver authored
      liver Hunt  <oliver@apple.com>
      
              Reviewed by Adam.
      WebCore:
              Migrate more drag and drop logic to WebCore, start preparing
              to move EventHandler::handleDrag from EventHandlerMac to EventHandler 
      
              * WebCore.exp:   
                updating methods
                          
              * dom/Clipboard.cpp:
              * dom/Clipboard.h:
              (WebCore::Clipboard::Clipboard):
              (WebCore::Clipboard::setDragHasStarted):
              (WebCore::Clipboard::dragStarted): 
                Moving from ClipboardMac to Clipboard 
      
              * dom/EventTargetNode.cpp:
              (WebCore::EventTargetNode::dispatchMouseEvent):
                PlatformMouseEvent no longer lies about button state, however 
                DOM Events don't allow NoButton, so we need to convert NoButton 
                to LeftButton when we create a DOM Event from PlatformMouseEvent
      
              * page/DragClient.h:
                Tidying comment 
      
              * page/DragController.cpp:
              (WebCore::createMouseEvent):
                Updated for new PlatformMouseEvent constructors
              (WebCore::DragController::mayStartDragAtEventLocation):
                Migrated from WebKit
      
              * page/DragController.h:
                Added above function declarations
      
              * page/EventHandler.cpp:
              (WebCore::EventHandler::dragState): 
              (WebCore::EventHandler::dragHysteresisExceeded):
              (WebCore::EventHandler::freeClipboard):
              (WebCore::EventHandler::shouldDragAutoNode):
                Moved from EventHandlerMac
              (WebCore::EventHandler::handleMouseMoveEvent):
              (WebCore::EventHandler::eventMayStartDrag):
              (WebCore::EventHandler::handleMousePressEvent):
                Use DragController     
      
              * page/EventHandler.h:
                Added DragState struct definition to EventHandler
      
              * page/mac/EventHandlerMac.mm:
              (WebCore::EventHandler::eventActivatedView):
              (WebCore::EventHandler::handleDrag):
              (WebCore::EventHandler::handleMouseUp):
              (WebCore::EventHandler::mouseDown):
                Update to use DragController and PlatformMouseEvent
      
              * page/mac/WebCoreFrameBridge.h:
              * page/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge dragSourceMovedTo:]):
              (-[WebCoreFrameBridge dragSourceEndedAt:operation:]):
                Use DragController for state               
      
      WebKit:
              Migrating methods to WebCore
      
              * WebCoreSupport/WebFrameBridge.mm:
              * WebView/WebHTMLView.mm:
              * WebView/WebHTMLViewPrivate.h:
                                               
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@19327 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a485c2f2
  18. 29 Jan, 2007 1 commit
    • oliver's avatar
      2007-01-25 Oliver Hunt <oliver@apple.com> · e71315c1
      oliver authored
              Reviewed by Adam.
      WebKit:
              Migrated drag state and logic to WebCore, removed superfluous methods
      
              * ChangeLog:
              * WebCoreSupport/WebDragClient.h:
              * WebCoreSupport/WebDragClient.mm:
              (WebDragClient::dragSourceActionMaskForPoint):
              * WebCoreSupport/WebFrameBridge.mm:
                 allowDHTMLDrag move to WebCore::EventHandler
              * WebView/WebHTMLView.mm:
              (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]):
              (-[WebHTMLView draggedImage:movedTo:]):
              (-[WebHTMLView draggedImage:endedAt:operation:]):
                dragOffset and dragSourecAction is now stored in WebCore::DragController
                migrated _delegateDragSourceActionMask to WebCore::DragController
              * WebView/WebHTMLViewInternal.h:
                Removed dragOffset declaration, migrated to WebCore::DragController
              * WebView/WebView.mm:
                removed unnecessary method, _loadingDragOperationForDraggingInfo                       
      
      WebKitQt:       
              Reviewed by Adam.
      
              Stub for new DragClient method
      
              * WebCoreSupport/DragClientQt.cpp:
              (WebCore::DragClientQt::dragSourceActionMaskForPoint):
              * WebCoreSupport/DragClientQt.h:                  
      
      WebCore:
              Reviewed by Adam.
      
              Migrated more drag logic and state to WebCore
                                                    
              * page/DragClient.h:       
      
              * page/DragController.cpp:
              (WebCore::DragController::delegateDragSourceAction):
                New forwarding method for the UI delegate
              * page/DragController.h:
              (WebCore::DragController::dragOffset):
                Now store the drag offset -- the offset of the cursor relative to the drag image)
                in DragController
              * page/EventHandler.cpp:
              (WebCore::EventHandler::allowDHTMLDrag):
                Moved from WebFrameBridge
              * page/EventHandler.h:
              * page/mac/EventHandlerMac.mm:
              (WebCore::EventHandler::eventMayStartDrag):
              (WebCore::EventHandler::handleDrag):                  
                EventHandlerMac now uses EventHandler::allowDHTMLDrag rather than the 
                implementation in WebFrameBridge
              * page/mac/WebCoreFrameBridge.h:
                removed definition of allowDHTMLDrag from WebFrameBridge
              * platform/graphics/svg/SVGImageEmptyClients.h:
              (WebCore::SVGEmptyDragClient::dragSourceActionMaskForPoint):
                Updated empty DragClient
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@19230 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e71315c1
  19. 24 Jan, 2007 1 commit
    • oliver's avatar
      Oliver Hunt <oliver@apple.com> · e3c60694
      oliver authored
      WebCore:
              Reviewed by Maciej.
      
              Migrating more drag state information to WebCore
      
              * page/DragController.cpp:
              * page/DragController.h:
              (WebCore::DragController::dragOperation):
              (WebCore::DragController::setDraggingImageURL):
              (WebCore::DragController::draggingImageURL):
              (WebCore::DragController::setDragOffset):
              (WebCore::DragController::dragOffset): 
      WebKit:
              Reviewed by Maciej.
      
              Migrating more drag state information to WebCore
      
              * WebKit.xcodeproj/project.pbxproj:
              * WebView/WebHTMLView.mm:
              (-[WebHTMLViewPrivate dealloc]):
              (-[WebHTMLViewPrivate clear]):
              (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]):
              (-[WebHTMLView _mayStartDragAtEventLocation:]):
              (-[WebHTMLView close]):
              (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]):
              (-[WebHTMLView _delegateDragSourceActionMask]):
              * WebView/WebHTMLViewInternal.h:         
                                                  
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@19104 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e3c60694
  20. 23 Jan, 2007 1 commit
    • oliver's avatar
      2007-01-23 Oliver Hunt <oliver@apple.com> · aeffa297
      oliver authored
              Reviewed by Adam.
      
              Added DragController to handled drag and drop state and control logic.
              Currently this only handles logic for Dragging and Dropping, and is 
              unable to initialise a drag itself.
      
              platform/DragData encapsulate the paltform Drag data (NSDraggingInfo on Mac, 
              QMimeType in Qt).  This provides methods to pull data out the drag data as a String, 
              a URL, a DocumentFragment (for rich content), or a Colour.
      
              * WebCore.exp:
              * WebCore.pro:
              * WebCore.xcodeproj/project.pbxproj:
              * dom/Clipboard.cpp: Added.
              (WebCore::Clipboard::setAccessPolicy):
              (WebCore::dragOpFromIEOp):
              (WebCore::IEOpFromDragOp):
              (WebCore::Clipboard::sourceOperation):
              (WebCore::Clipboard::destinationOperation):
              (WebCore::Clipboard::setSourceOperation):
              (WebCore::Clipboard::setDestinationOperation):
              (WebCore::Clipboard::setDropEffect):
              (WebCore::Clipboard::setEffectAllowed):
                move platform independent functions from ClipboardMac to Clipboard
      
              * dom/Clipboard.h:
              (WebCore::Clipboard::Clipboard):
              (WebCore::Clipboard::dropEffect):
              (WebCore::Clipboard::effectAllowed):
              (WebCore::Clipboard::policy):
                as above -- also removed virtual modifier from now 
                platform independent methods
      
              * editing/Editor.cpp:
              (WebCore::Editor::smartInsertDeleteEnabled): 
              (WebCore::Editor::shouldApplyStyle):
              * editing/Editor.h:
                adding calls through to EditorClient
               
              * page/DragActions.h: Added.
              (WebCore::):
                Replicates a number of NS* enums in the WebCore namespace
      
              * page/DragClient.h: Added.
              (WebCore::DragClient::~DragClient):
                Standard client interface for dragging UIDelegate
      
              * page/DragController.cpp: Added.
              (WebCore::createMouseEvent):
              (WebCore::DragController::DragController):
              (WebCore::DragController::~DragController):
              (WebCore::documentFragmentFromDragData):
              (WebCore::DragController::isMoveDrag):
              (WebCore::visiblePositionForPoint):
              (WebCore::DragController::cancelDrag):
              (WebCore::documentAtPoint):
              (WebCore::DragController::dragEntered):
              (WebCore::DragController::dragExited):
              (WebCore::DragController::dragUpdated):
              (WebCore::DragController::performDrag):
              (WebCore::DragController::dragEnteredOrUpdated):
              (WebCore::DragController::tryDocumentDrag):
              (WebCore::DragController::operationForLoad):
              (WebCore::DragController::concludeDrag):
              (WebCore::DragController::canProcessDrag):
              (WebCore::DragController::tryDHTMLDrag):
                Class to handle state and logic for dragging and dropping
      
              * page/DragController.h: Added.
              (WebCore::DragController::client):
              (WebCore::DragController::didInitiateDrag):
              (WebCore::DragController::isHandlingDrag):
              (WebCore::DragController::dragOperation):
              (WebCore::DragController::document):
              (WebCore::DragController::dragInitiator):
              (WebCore::DragController::dragDestinationAction):
              (WebCore::DragController::dragSourceAction):
              (WebCore::DragController::dragEnded):
              (WebCore::DragController::setIsHandlingDrag):
              (WebCore::DragController::setDidInitiateDrag):
              (WebCore::DragController::setDragOperation):
              (WebCore::DragController::setDragSourceAction):
              (WebCore::DragController::setDragInitiator):
                See above
      
              * page/Page.cpp:
              (WebCore::Page::Page):
                Update Page to have DragController
      
              * page/Page.h:
              (WebCore::Page::dragController):
                ditto
      
              * page/mac/DragControllerMac.mm: Added.
              (WebCore::DragController::isCopyKeyDown):
              (WebCore::DragController::dragOperation):
                Platform specific portions of the DragController
      
              * page/mac/EventHandlerMac.mm:
              (WebCore::EventHandler::handleDrag):
              (WebCore::EventHandler::dragSourceEndedAt):
                Convert from NSDragOperation to WebCore::DragOperation
      
              * page/mac/WebCoreFrameBridge.h:
              * page/mac/WebCoreFrameBridge.mm:
                Remove obsolete Drag functions
      
              * page/qt/DragControllerQt.cpp: Added.
              (WebCore::DragController::isCopyKeyDown):
              (WebCore::DragController::dragOperation):
                Basic stubs to maintain Qt  build
      
              * platform/DragData.cpp: Added.
              (WebCore::DragData::DragData):
              * platform/DragData.h: Added.
              (WebCore::DragData::clientPosition):
              (WebCore::DragData::globalPosition):
              (WebCore::DragData::platformData):
              (WebCore::DragData::draggingSourceOperationMask):
                DragData class to encapsulate platform drag data/event
      
              * platform/graphics/svg/SVGImage.cpp:
              (WebCore::SVGImage::setData):
                Addition of dummy DragClient
      
              * platform/graphics/svg/SVGImageEmptyClients.h:
              (WebCore::SVGEmptyDragClient::~SVGEmptyDragClient):
              (WebCore::SVGEmptyDragClient::willPerformDragDestinationAction):
              (WebCore::SVGEmptyDragClient::actionMaskForDrag):
              (WebCore::SVGEmptyDragClient::dragControllerDestroyed):
                ditto
      
              * platform/mac/ClipboardMac.h:
              * platform/mac/ClipboardMac.mm:
              (WebCore::ClipboardMac::ClipboardMac):
              (WebCore::ClipboardMac::clearData):
              (WebCore::ClipboardMac::clearAllData):
              (WebCore::ClipboardMac::getData):
              (WebCore::ClipboardMac::setData):
              (WebCore::ClipboardMac::types):
              (WebCore::ClipboardMac::setDragImage):
               Moving platform independent logic to Clipboard, and updating
               platform specific methods to use appropriate accessors rather than 
               directly manipulating data they no longer own
      
              * platform/mac/DragDataMac.mm: Added.
              (WebCore::DragData::DragData):
              (WebCore::DragData::canSmartReplace):
              (WebCore::DragData::containsColor):
              (WebCore::DragData::containsPlainText):
              (WebCore::DragData::asPlainText):
              (WebCore::DragData::asColor):
              (WebCore::DragData::createClipboard):
              (WebCore::imageExistsAtPaths):
              (WebCore::DragData::containsCompatibleContent):
              (WebCore::DragData::containsURL):
              (WebCore::DragData::asURL):
              (WebCore::DragData::asFragment):
                Mac implementations of DragData methods.  A number of these use
                a Helper class that accesses WebKit functionality.  That functionality 
                should be migrated to WebCore in the future.
      
              * platform/mac/PasteboardHelper.h: Added.
              (WebCore::PasteboardHelper::~PasteboardHelper):
                Temporary, and Mac only, helper class to access WebKit functionality 
                from WebCore
      
              * platform/qt/DragDataQt.cpp: Added.
              (WebCore::DragData::canSmartReplace):
              (WebCore::DragData::containsColor):
              (WebCore::DragData::containsPlainText):
              (WebCore::DragData::asPlainText):
              (WebCore::DragData::asColor):
              (WebCore::DragData::createClipboard):
              (WebCore::DragData::containsCompatibleContent):
              (WebCore::DragData::containsURL):
              (WebCore::DragData::asURL):
              (WebCore::DragData::asFragment):
               Basic stubs to maintain Qt build
      
              * rendering/HitTestResult.cpp:
              (WebCore::HitTestResult::HitTestResult):
               Correct HitTestResult copy contructor to copy localPoint
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@19039 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      aeffa297