Changeset 44379 in webkit


Ignore:
Timestamp:
Jun 2, 2009 10:37:09 PM (15 years ago)
Author:
Darin Adler
Message:

WebCore:

2009-06-02 Darin Adler <Darin Adler>

Reviewed by David Hyatt.

Bug 26112: viewless WebKit -- make events work
https://bugs.webkit.org/show_bug.cgi?id=26112

The main fix here is to make mouse and wheel event coordinates in the coordinate
system of the top level NSView rather than the NSWindow when in the viewless mode.
This is the design Hyatt chose, but the event part of it wasn't done yet.

Also fix FrameView to do normal reference counting instead of a strange model with
an explicit deref near creation time.

  • WebCore.base.exp: Updated.
  • page/EventHandler.cpp: (WebCore::EventHandler::eventLoopHandleMouseUp): Moved this function into the file to reduce conditionals in the header. (WebCore::EventHandler::eventLoopHandleMouseDragged): Ditto.
  • page/EventHandler.h: Reduced includes. Fixed formatting of Objective-C types. Made currentNSEvent a static member function. Added sendContextMenuEvent and eventMayStartDrag functions that takes NSEvent * so the conversion to PlatformMouseEvent can be done here rather than in WebKit. Reduced #if by making eventLoopHandleMouseUp and eventLoopHandleMouseDragged unconditional.
  • page/Frame.cpp: (WebCore::Frame::setView): Made this take a PassRefPtr since it takes ownership. (WebCore::Frame::createView): Changed to use RefPtr and FrameView::create and remove the explicit deref.
  • page/Frame.h: Changed setView to take a PassRefPtr.
  • page/FrameTree.cpp: Added newly-needed include.
  • page/FrameView.cpp: (WebCore::FrameView::FrameView): Got rid of one of the two constructors, and removed the initialization of m_refCount and call to show from the reamining one. (WebCore::FrameView::create): Added two create functions that do what the two constructors did before, except that they return a PassRefPtr to make sure the reference counting is handled correctly. (WebCore::FrameView::~FrameView): Removed assertion from when FrameView implemented its own reference counting.
  • page/FrameView.h: Inherit from RefCounted for reference counting. Made the constructor private and added create functions. Got rid of the hand-implemented reference counting in this class.
  • page/mac/EventHandlerMac.mm: (WebCore::currentNSEventSlot): Renamed currentEvent to currentNSEventSlot to make it more clear how it relates to currentNSEvent. (WebCore::EventHandler::currentNSEvent): Updated. (WebCore::CurrentEventScope::CurrentEventScope): Added. Use to set/reset the current event in a foolproof way. (WebCore::CurrentEventScope::~CurrentEventScope): Ditto. (WebCore::EventHandler::wheelEvent): Use CurrentEventScope. Pass the platform window in when constructing the PlatformWheelEvent. (WebCore::EventHandler::keyEvent): Use CurrentEventScope. (WebCore::lastEventIsMouseUp): Use currentNSEvent. (WebCore::EventHandler::passMouseDownEventToWidget): Ditto. (WebCore::EventHandler::eventLoopHandleMouseDragged): Ditto. (WebCore::EventHandler::eventLoopHandleMouseUp): Ditto. (WebCore::EventHandler::passSubframeEventToSubframe): Use currentPlatformMouseEvent to get a mouse event that has the appropriate platform window passed to create it. (WebCore::EventHandler::passWheelEventToWidget): Ditto. (WebCore::EventHandler::mouseDown): Ditto. (WebCore::EventHandler::mouseDragged): Ditto. (WebCore::EventHandler::mouseUp): Ditto. (WebCore::EventHandler::mouseMoved): Ditto. (WebCore::EventHandler::currentPlatformMouseEvent): Added. Passes the platform window that's now needed to create a PlatformMouseEvent. (WebCore::EventHandler::sendContextMenuEvent): Added. (WebCore::EventHandler::eventMayStartDrag): Added.
  • platform/HostWindow.h: Removed unneeded includes and constructor definition.
  • platform/PlatformMouseEvent.h: Sorted things in alphabetical order. Changed Mac constructor to take a windowView as well as the event. This is needed in viewless mode, since the "window" is actually an NSView, so the event has to know which view to compute the coordinates with. Made the same change to pointForEvent.
  • platform/PlatformWheelEvent.h: Ditto.
  • platform/mac/PlatformMouseEventMac.mm: (WebCore::pointForEvent): Convert point from window coordinates to view coordinates if a windowView is passed in. This is used in viewless mode. (WebCore::PlatformMouseEvent::PlatformMouseEvent): Ditto.
  • platform/mac/WheelEventMac.mm: (WebCore::PlatformWheelEvent::PlatformWheelEvent): Ditto.
  • platform/mac/WidgetMac.mm: (WebCore::Widget::convertFromContainingWindow): Fixed case where there is no platform widget and no parent. Before it would yield unpredictable results because of dispatching to a nil object and returning a structure. Now it returns the point without changing coordinates at all, which is what we need for this case in viewless mode.
  • rendering/RenderApplet.cpp: Removed unneeded includes. (WebCore::RenderApplet::intrinsicSize): Use widget function. (WebCore::RenderApplet::createWidgetIfNecessary): Ditto.
  • rendering/RenderApplet.h: Make more things private. Get rid of unneeded explicit destructor.
  • rendering/RenderFrame.cpp: Removed unneeded includes. (WebCore::RenderFrame::edgeInfo): Updated to use node function so header doesn't have to define element function. (WebCore::RenderFrame::viewCleared): Ditto. Also changed to use widget function.
  • rendering/RenderFrame.h: Removed unneeded includes. Made some things private. Got rid of element function.
  • rendering/RenderPart.cpp: Removed unneeded includes. (WebCore::RenderPart::~RenderPart): Changed to use clearWidget function. (WebCore::RenderPart::setWidget): Changed to use widget function. (WebCore::RenderPart::deleteWidget): Changed to use passed-in widget. This is now only called by the clearWidget function.
  • rendering/RenderPart.h: Removed unneeded forward declarations. Made more functions private. Updated deleteWidget to take widget argument.
  • rendering/RenderPartObject.cpp: (WebCore::RenderPartObject::~RenderPartObject): use frameView function instead of getting at m_view directly. (WebCore::RenderPartObject::updateWidget): Ditto. (WebCore::RenderPartObject::layout): Ditto. Same for widget and m_widget. (WebCore::RenderPartObject::viewCleared): Ditto.
  • rendering/RenderPartObject.h: Made some functions private.
  • rendering/RenderWidget.cpp: (WebCore::RenderWidget::RenderWidget): Initialize m_frameView with construction syntax instead of assignment. (WebCore::RenderWidget::destroy): Updated for name change of m_view to m_frameView. (WebCore::RenderWidget::~RenderWidget): Use clearWidget to delete the widget. (WebCore::RenderWidget::setWidget): Use clearWidget. (WebCore::RenderWidget::paint): Updated for name change of m_view to m_frameView. (WebCore::RenderWidget::deleteWidget): Changed to use passed-in widget.
  • rendering/RenderWidget.h: Made many functions protected, others private and made all data members private.
  • svg/animation/SMILTime.h: Removed unhelpful max and min functions. These just do what std::max and std::min will already do automatically for this type, so they are not helpful.
  • svg/graphics/SVGImage.cpp: (WebCore::SVGImage::SVGImage): Removed unneeded initial values for types that initialize to zero without anything explicit. (WebCore::SVGImage::~SVGImage): Update since m_frame and m_frameView are no longer stored. (WebCore::SVGImage::setContainerSize): Ditto. (WebCore::SVGImage::usesContainerSize): Ditto. (WebCore::SVGImage::size): Ditto. (WebCore::SVGImage::hasRelativeWidth): Ditto. (WebCore::SVGImage::hasRelativeHeight): Ditto. (WebCore::SVGImage::draw): Ditto. (WebCore::SVGImage::nativeImageForCurrentFrame): Ditto. (WebCore::SVGImage::dataChanged): Ditto.
  • svg/graphics/SVGImage.h: Removed unneeded includes and unneeded data members m_document, m_frame, m_frameView, and m_minSize.

WebKit/mac:

2009-06-02 Darin Adler <Darin Adler>

Reviewed by David Hyatt.

Bug 26112: viewless WebKit -- make events work
https://bugs.webkit.org/show_bug.cgi?id=26112

One change here is to make the -[WebFrame frameView] function assert if ever called
in viewless mode, and fix many callers that would trip that assertion.

A major change is to put some methods and data in WebView that are currently in
WebHTMLView, used only in viewless mode. A next step will be to use the WebView
methods whenever possible, even when not in the viewless mode.

Also fix FrameView to do normal reference counting instead of a strange model with
an explicit deref near creation time.

  • WebCoreSupport/WebChromeClient.mm: (WebChromeClient::scrollRectIntoView): Add code to start in the appropriate place when dealing with viewless mode. This gets triggered when visiting the Google home page. (WebChromeClient::setToolTip): Changed to call WebView instead of WebHTMLView. (WebChromeClient::print): Changed to use a new selector that doesn't require a WebFrameView if present. Also don't even try to use the old selector in viewless mode.
  • WebCoreSupport/WebEditorClient.mm: (WebEditorClient::respondToChangedSelection): Changed to call WebView instead of WebHTMLView.
  • WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::transitionToCommittedForNewPage): Added more code paths for viewless mode to skip things we can't do in that mode, with appropriate FIXME. Use Frame::create and RefPtr and eliminate the strange reference counting of FrameView.
  • WebView/WebDataSource.mm: (-[WebDataSource _receivedData:]): Added a _usesDocumentViews guard around code that's specific to document views.
  • WebView/WebFrame.mm: (-[WebFrame _updateBackgroundAndUpdatesWhileOffscreen]): Added a _usesDocumentViews guard around code that's specific to document views. (-[WebFrame _hasSelection]): Added an implementation for viewless mode. (-[WebFrame _clearSelection]): Assert we're not in viewless mode; it doesn't really make sense to clear the selection in only one frame in viewless mode. Later we can decide what to do. (-[WebFrame _dragSourceMovedTo:]): Assert we're not in viewless mode; the dragging code for viewless mode shouldn't have to involve the WebFrame object at all. (-[WebFrame _dragSourceEndedAt:operation:]): Ditto. (-[WebFrame frameView]): Assert we're not in viewless mode. This assertion fires often, but it's a great pointer to code that needs to be changed.
  • WebView/WebHTMLView.mm: (-[WebHTMLView hitTest:]): Tweaked a comment. (-[WebHTMLView _updateMouseoverWithEvent:]): Fixed a bug where the fake event for moving the mouse out of the old view ended up overwriting the event for moving the mouse within the new view. (-[WebHTMLView mouseDown:]): Got rid of explicit conversion of event to PlatformMouseEvent in call to sendContextMenuEvent; that's no longer possible without passing another argument, and it's now handled in EventHandler.
  • WebView/WebTextCompletionController.h: Copied from WebKit/mac/WebView/WebHTMLView.mm. Removed everything except for the WebTextCompletionController class.
  • WebView/WebTextCompletionController.mm: Copied from WebKit/mac/WebView/WebHTMLView.mm. Ditto.
  • WebView/WebUIDelegatePrivate.h: Added webView:printFrame: method.
  • WebView/WebView.mm: Moved includes and fields in from WebHTMLView. (-[WebView _usesDocumentViews]): Updated for name change from useDocumentViews to usesDocumentViews. (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): Ditto. (-[WebView drawSingleRect:]): Ditto. (-[WebView isFlipped]): Ditto. (-[WebView setFrameSize:]): Ditto. Also changed to use _mainCoreFrame method. (-[WebView _viewWillDrawInternal]): Ditto. (-[WebView viewWillDraw]): Ditto. (-[WebView drawRect:]): Ditto. (-[WebView _close]): Added code to nil out the lastMouseoverView global. (-[WebView _dashboardRegions]): Use _mainCoreFrame. (-[WebView setProhibitsMainFrameScrolling:]): Ditto. (-[WebView _setInViewSourceMode:]): Ditto. (-[WebView _inViewSourceMode]): Ditto. (-[WebView _attachScriptDebuggerToAllFrames]): Ditto. (-[WebView _detachScriptDebuggerFromAllFrames]): Ditto. (-[WebView textIteratorForRect:]): Ditto. (-[WebView _executeCoreCommandByName:value:]): Ditto. (-[WebView addWindowObserversForWindow:]): Ditto. (-[WebView removeWindowObservers]): Ditto. (-[WebView _updateFocusedAndActiveState]): Ditto. (-[WebView _updateFocusedAndActiveStateForFrame:]): Turned into a class method. Added code to handle the viewless case without calling frameView. (-[WebView _windowDidBecomeKey:]): Updated for name change from useDocumentViews to usesDocumentViews. (-[WebView _windowDidResignKey:]): Ditto. (-[WebView _windowWillOrderOnScreen:]): Ditto. (-[WebView mainFrame]): Tweaked. (-[WebView selectedFrame]): Added a conditional to avoid trying to get at the frame view in viewless case. (-[WebView _setZoomMultiplier:isTextOnly:]): Use _mainCoreFrame. (-[WebView setCustomTextEncodingName:]): Ditto. (-[WebView windowScriptObject]): Ditto. (-[WebView setHostWindow:]): Ditto. Also put some code that's needed only for document views inside _private->usesDocumentViews. (-[WebView _hitTest:dragTypes:]): Tweaked. (-[WebView acceptsFirstResponder]): Added case for viewless mode along with a FIXME, since it's not complete. (-[WebView becomeFirstResponder]): Ditto. (-[WebView _webcore_effectiveFirstResponder]): Put the body of this inside a usesDocumentView check, because we don't need the first responder forwarding in viewless mode. (-[WebView setNextKeyView:]): Ditto. (-[WebView mouseDown:]): Added. Copied from WebHTMLView. FIXME in here suggests that we make WebHTMLView share this one soon, which I think is practical. (-[WebView mouseUp:]): Ditto. (-[WebView setHoverFeedbackSuspended:]): Added a code path for viewless mode. (-[WebView shouldClose]): Use _mainCoreFrame. (-[WebView aeDescByEvaluatingJavaScriptFromString:]): Ditto. (-[WebView setEditable:]): Ditto. (-[WebView _frameViewAtWindowPoint:]): Added an assertion that we're not in viewless mode since this method makes no sense in that mode. (-[WebView _setMouseDownEvent:]): Added. Copied from WebHTMLView. I plan to eliminate the one in WebHTMLView soon. (-[WebView _cancelUpdateMouseoverTimer]): Ditto. (-[WebView _stopAutoscrollTimer]): Ditto. (+[WebView _updateMouseoverWithEvent:]): Ditto. (-[WebView _updateMouseoverWithFakeEvent]): Ditto. (-[WebView _setToolTip:]): Added. Calls through to the WebHTMLView version. (-[WebView _selectionChanged]): Ditto. (-[WebView _mainCoreFrame]): Added. (-[WebView _needsOneShotDrawingSynchronization]): Moved into the WebInternal category. (-[WebView _setNeedsOneShotDrawingSynchronization:]): Ditto. (-[WebView _startedAcceleratedCompositingForFrame:]): Ditto. (-[WebView _stoppedAcceleratedCompositingForFrame:]): Ditto. (viewUpdateRunLoopObserverCallBack): Ditto. (-[WebView _scheduleViewUpdate]): Ditto.
  • WebView/WebViewInternal.h: Made most of the file not compile at all when included from non-C++ source files, elminating some excess declarations and typedefs. Moved more methods into the real internal category. Added new methods _setMouseDownEvent, _cancelUpdateMouseoverTimer, _stopAutoscrollTimer, _updateMouseoverWithFakeEvent, _selectionChanged, and _setToolTip:.

WebKit/wx:

2009-06-02 Darin Adler <Darin Adler>

Reviewed by David Hyatt.

  • WebKitSupport/FrameLoaderClientWx.cpp: (WebCore::FrameLoaderClientWx::transitionToCommittedForNewPage): Use FrameView::create and RefPtr instead of the old "crazy" reference counting.
Location:
trunk
Files:
41 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r44378 r44379  
     12009-06-02  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by David Hyatt.
     4
     5        Bug 26112: viewless WebKit -- make events work
     6        https://bugs.webkit.org/show_bug.cgi?id=26112
     7
     8        The main fix here is to make mouse and wheel event coordinates in the coordinate
     9        system of the top level NSView rather than the NSWindow when in the viewless mode.
     10        This is the design Hyatt chose, but the event part of it wasn't done yet.
     11
     12        Also fix FrameView to do normal reference counting instead of a strange model with
     13        an explicit deref near creation time.
     14
     15        * WebCore.base.exp: Updated.
     16
     17        * page/EventHandler.cpp:
     18        (WebCore::EventHandler::eventLoopHandleMouseUp): Moved this function into the file
     19        to reduce conditionals in the header.
     20        (WebCore::EventHandler::eventLoopHandleMouseDragged): Ditto.
     21
     22        * page/EventHandler.h: Reduced includes. Fixed formatting of Objective-C types.
     23        Made currentNSEvent a static member function. Added sendContextMenuEvent and
     24        eventMayStartDrag functions that takes NSEvent * so the conversion to PlatformMouseEvent
     25        can be done here rather than in WebKit. Reduced #if by making eventLoopHandleMouseUp and
     26        eventLoopHandleMouseDragged unconditional.
     27
     28        * page/Frame.cpp:
     29        (WebCore::Frame::setView): Made this take a PassRefPtr since it takes ownership.
     30        (WebCore::Frame::createView): Changed to use RefPtr and FrameView::create and remove
     31        the explicit deref.
     32
     33        * page/Frame.h: Changed setView to take a PassRefPtr.
     34
     35        * page/FrameTree.cpp: Added newly-needed include.
     36
     37        * page/FrameView.cpp:
     38        (WebCore::FrameView::FrameView): Got rid of one of the two constructors, and removed
     39        the initialization of m_refCount and call to show from the reamining one.
     40        (WebCore::FrameView::create): Added two create functions that do what the two
     41        constructors did before, except that they return a PassRefPtr to make sure the
     42        reference counting is handled correctly.
     43        (WebCore::FrameView::~FrameView): Removed assertion from when FrameView implemented
     44        its own reference counting.
     45
     46        * page/FrameView.h: Inherit from RefCounted for reference counting. Made the
     47        constructor private and added create functions. Got rid of the hand-implemented
     48        reference counting in this class.
     49
     50        * page/mac/EventHandlerMac.mm:
     51        (WebCore::currentNSEventSlot): Renamed currentEvent to currentNSEventSlot to
     52        make it more clear how it relates to currentNSEvent.
     53        (WebCore::EventHandler::currentNSEvent): Updated.
     54        (WebCore::CurrentEventScope::CurrentEventScope): Added. Use to set/reset the
     55        current event in a foolproof way.
     56        (WebCore::CurrentEventScope::~CurrentEventScope): Ditto.
     57        (WebCore::EventHandler::wheelEvent): Use CurrentEventScope. Pass the platform
     58        window in when constructing the PlatformWheelEvent.
     59        (WebCore::EventHandler::keyEvent): Use CurrentEventScope.
     60        (WebCore::lastEventIsMouseUp): Use currentNSEvent.
     61        (WebCore::EventHandler::passMouseDownEventToWidget): Ditto.
     62        (WebCore::EventHandler::eventLoopHandleMouseDragged): Ditto.
     63        (WebCore::EventHandler::eventLoopHandleMouseUp): Ditto.
     64        (WebCore::EventHandler::passSubframeEventToSubframe): Use
     65        currentPlatformMouseEvent to get a mouse event that has the appropriate
     66        platform window passed to create it.
     67        (WebCore::EventHandler::passWheelEventToWidget): Ditto.
     68        (WebCore::EventHandler::mouseDown): Ditto.
     69        (WebCore::EventHandler::mouseDragged): Ditto.
     70        (WebCore::EventHandler::mouseUp): Ditto.
     71        (WebCore::EventHandler::mouseMoved): Ditto.
     72        (WebCore::EventHandler::currentPlatformMouseEvent): Added. Passes the
     73        platform window that's now needed to create a PlatformMouseEvent.
     74        (WebCore::EventHandler::sendContextMenuEvent): Added.
     75        (WebCore::EventHandler::eventMayStartDrag): Added.
     76
     77        * platform/HostWindow.h: Removed unneeded includes and constructor definition.
     78
     79        * platform/PlatformMouseEvent.h: Sorted things in alphabetical order.
     80        Changed Mac constructor to take a windowView as well as the event. This is
     81        needed in viewless mode, since the "window" is actually an NSView, so the
     82        event has to know which view to compute the coordinates with. Made the
     83        same change to pointForEvent.
     84        * platform/PlatformWheelEvent.h: Ditto.
     85
     86        * platform/mac/PlatformMouseEventMac.mm:
     87        (WebCore::pointForEvent): Convert point from window coordinates to view
     88        coordinates if a windowView is passed in. This is used in viewless mode.
     89        (WebCore::PlatformMouseEvent::PlatformMouseEvent): Ditto.
     90        * platform/mac/WheelEventMac.mm:
     91        (WebCore::PlatformWheelEvent::PlatformWheelEvent): Ditto.
     92
     93        * platform/mac/WidgetMac.mm:
     94        (WebCore::Widget::convertFromContainingWindow): Fixed case where there
     95        is no platform widget and no parent. Before it would yield unpredictable
     96        results because of dispatching to a nil object and returning a structure.
     97        Now it returns the point without changing coordinates at all, which is what
     98        we need for this case in viewless mode.
     99
     100        * rendering/RenderApplet.cpp: Removed unneeded includes.
     101        (WebCore::RenderApplet::intrinsicSize): Use widget function.
     102        (WebCore::RenderApplet::createWidgetIfNecessary): Ditto.
     103
     104        * rendering/RenderApplet.h: Make more things private. Get rid of unneeded
     105        explicit destructor.
     106
     107        * rendering/RenderFrame.cpp: Removed unneeded includes.
     108        (WebCore::RenderFrame::edgeInfo): Updated to use node function so header
     109        doesn't have to define element function.
     110        (WebCore::RenderFrame::viewCleared): Ditto. Also changed to use widget
     111        function.
     112
     113        * rendering/RenderFrame.h: Removed unneeded includes. Made some things
     114        private. Got rid of element function.
     115
     116        * rendering/RenderPart.cpp: Removed unneeded includes.
     117        (WebCore::RenderPart::~RenderPart): Changed to use clearWidget function.
     118        (WebCore::RenderPart::setWidget): Changed to use widget function.
     119        (WebCore::RenderPart::deleteWidget): Changed to use passed-in widget.
     120        This is now only called by the clearWidget function.
     121
     122        * rendering/RenderPart.h: Removed unneeded forward declarations.
     123        Made more functions private. Updated deleteWidget to take widget argument.
     124
     125        * rendering/RenderPartObject.cpp:
     126        (WebCore::RenderPartObject::~RenderPartObject): use frameView function
     127        instead of getting at m_view directly.
     128        (WebCore::RenderPartObject::updateWidget): Ditto.
     129        (WebCore::RenderPartObject::layout): Ditto. Same for widget and m_widget.
     130        (WebCore::RenderPartObject::viewCleared): Ditto.
     131
     132        * rendering/RenderPartObject.h: Made some functions private.
     133
     134        * rendering/RenderWidget.cpp:
     135        (WebCore::RenderWidget::RenderWidget): Initialize m_frameView with
     136        construction syntax instead of assignment.
     137        (WebCore::RenderWidget::destroy): Updated for name change of m_view
     138        to m_frameView.
     139        (WebCore::RenderWidget::~RenderWidget): Use clearWidget to delete
     140        the widget.
     141        (WebCore::RenderWidget::setWidget): Use clearWidget.
     142        (WebCore::RenderWidget::paint): Updated for name change of m_view
     143        to m_frameView.
     144        (WebCore::RenderWidget::deleteWidget): Changed to use passed-in widget.
     145
     146        * rendering/RenderWidget.h: Made many functions protected, others
     147        private and made all data members private.
     148
     149        * svg/animation/SMILTime.h: Removed unhelpful max and min functions. These
     150        just do what std::max and std::min will already do automatically for this
     151        type, so they are not helpful.
     152
     153        * svg/graphics/SVGImage.cpp:
     154        (WebCore::SVGImage::SVGImage): Removed unneeded initial values for types
     155        that initialize to zero without anything explicit.
     156        (WebCore::SVGImage::~SVGImage): Update since m_frame and m_frameView are
     157        no longer stored.
     158        (WebCore::SVGImage::setContainerSize): Ditto.
     159        (WebCore::SVGImage::usesContainerSize): Ditto.
     160        (WebCore::SVGImage::size): Ditto.
     161        (WebCore::SVGImage::hasRelativeWidth): Ditto.
     162        (WebCore::SVGImage::hasRelativeHeight): Ditto.
     163        (WebCore::SVGImage::draw): Ditto.
     164        (WebCore::SVGImage::nativeImageForCurrentFrame): Ditto.
     165        (WebCore::SVGImage::dataChanged): Ditto.
     166
     167        * svg/graphics/SVGImage.h: Removed unneeded includes and unneeded data
     168        members m_document, m_frame, m_frameView, and m_minSize.
     169
    11702009-06-02  Adam Langley  <agl@google.com>
    2171
  • trunk/WebCore/WebCore.base.exp

    r44322 r44379  
    233233__ZN7WebCore12EventHandler17dragSourceEndedAtERKNS_18PlatformMouseEventENS_13DragOperationE
    234234__ZN7WebCore12EventHandler17dragSourceMovedToERKNS_18PlatformMouseEventE
     235__ZN7WebCore12EventHandler17eventMayStartDragEP7NSEvent
    235236__ZN7WebCore12EventHandler20handleTextInputEventERKNS_6StringEPNS_5EventEbb
    236237__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_8IntPointEbb
    237 __ZN7WebCore12EventHandler20sendContextMenuEventERKNS_18PlatformMouseEventE
     238__ZN7WebCore12EventHandler20sendContextMenuEventEP7NSEvent
    238239__ZN7WebCore12EventHandler27capsLockStateMayHaveChangedEv
    239240__ZN7WebCore12EventHandler7mouseUpEP7NSEvent
     
    396397__ZN7WebCore17GlyphPageTreeNode18treeGlyphPageCountEv
    397398__ZN7WebCore17equalIgnoringCaseEPNS_10StringImplES1_
    398 __ZN7WebCore18PlatformMouseEventC1EP7NSEvent
    399399__ZN7WebCore18isStartOfParagraphERKNS_15VisiblePositionE
    400400__ZN7WebCore19AnimationController20pauseAnimationAtTimeEPNS_12RenderObjectERKNS_6StringEd
     
    520520__ZN7WebCore5Frame4initEv
    521521__ZN7WebCore5Frame6scriptEv
    522 __ZN7WebCore5Frame7setViewEPNS_9FrameViewE
     522__ZN7WebCore5Frame7setViewEN3WTF10PassRefPtrINS_9FrameViewEEE
    523523__ZN7WebCore5FrameC1EPNS_4PageEPNS_21HTMLFrameOwnerElementEPNS_17FrameLoaderClientE
    524524__ZN7WebCore5FrameD1Ev
     
    684684__ZN7WebCore9FrameView29forceLayoutWithPageWidthRangeEffb
    685685__ZN7WebCore9FrameView29setShouldUpdateWhileOffscreenEb
    686 __ZN7WebCore9FrameViewC1EPNS_5FrameE
    687 __ZN7WebCore9FrameViewC1EPNS_5FrameERKNS_7IntSizeE
     686__ZN7WebCore9FrameView6createEPNS_5FrameE
     687__ZN7WebCore9FrameView6createEPNS_5FrameERKNS_7IntSizeE
    688688__ZN7WebCore9HTMLNames10listingTagE
    689689__ZN7WebCore9HTMLNames11textareaTagE
     
    774774__ZNK7WebCore11HistoryItem9urlStringEv
    775775__ZNK7WebCore11HistoryItem9viewStateEv
    776 __ZNK7WebCore12EventHandler17eventMayStartDragERKNS_18PlatformMouseEventE
    777776__ZNK7WebCore12EventHandler20currentKeyboardEventEv
    778777__ZNK7WebCore12IconDatabase12databasePathEv
  • trunk/WebCore/page/EventHandler.cpp

    r44371 r44379  
    118118        e.accept();
    119119}
     120
     121#if !PLATFORM(MAC)
     122
     123inline bool EventHandler::eventLoopHandleMouseUp(const MouseEventWithHitTestResults&)
     124{
     125    return false;
     126}
     127
     128inline bool EventHandler::eventLoopHandleMouseDragged(const MouseEventWithHitTestResults&)
     129{
     130    return false;
     131}
     132
     133#endif
    120134
    121135EventHandler::EventHandler(Frame* frame)
  • trunk/WebCore/page/EventHandler.h

    r42725 r44379  
    11/*
    2  * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
     2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2828
    2929#include "DragActions.h"
    30 #include "FocusDirection.h"
    3130#include "PlatformMouseEvent.h"
    3231#include "ScrollTypes.h"
    3332#include "Timer.h"
    3433#include <wtf/Forward.h>
    35 #include <wtf/Noncopyable.h>
    36 #include <wtf/Platform.h>
    3734#include <wtf/RefPtr.h>
    3835
    39 #if PLATFORM(MAC)
    40 #include "WebCoreKeyboardUIMode.h"
    41 #ifndef __OBJC__
    42 class NSEvent;
     36#if PLATFORM(MAC) && !defined(__OBJC__)
    4337class NSView;
    44 #endif
    4538#endif
    4639
     
    5245class Event;
    5346class FloatPoint;
    54 class FloatRect;
    5547class Frame;
    5648class HitTestRequest;
     
    6961class SVGElementInstance;
    7062class TextEvent;
    71 class VisiblePosition;
    7263class Widget;
    7364   
     
    160151    void sendScrollEvent();
    161152   
    162 #if PLATFORM(MAC)
     153#if PLATFORM(MAC) && defined(__OBJC__)
    163154    PassRefPtr<KeyboardEvent> currentKeyboardEvent() const;
    164155
    165     void mouseDown(NSEvent*);
    166     void mouseDragged(NSEvent*);
    167     void mouseUp(NSEvent*);
    168     void mouseMoved(NSEvent*);
    169     bool keyEvent(NSEvent*);
    170     bool wheelEvent(NSEvent*);
    171 
    172     void sendFakeEventsAfterWidgetTracking(NSEvent* initiatingEvent);
     156    void mouseDown(NSEvent *);
     157    void mouseDragged(NSEvent *);
     158    void mouseUp(NSEvent *);
     159    void mouseMoved(NSEvent *);
     160    bool keyEvent(NSEvent *);
     161    bool wheelEvent(NSEvent *);
     162
     163    bool sendContextMenuEvent(NSEvent *);
     164    bool eventMayStartDrag(NSEvent *);
     165
     166    void sendFakeEventsAfterWidgetTracking(NSEvent *initiatingEvent);
    173167
    174168    void setActivationEventNumber(int num) { m_activationEventNumber = num; }
    175169
    176     NSEvent *currentNSEvent();
     170    static NSEvent *currentNSEvent();
    177171#endif
    178172
     
    194188   
    195189    bool eventActivatedView(const PlatformMouseEvent&) const;
    196     void selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults& event);
    197     void selectClosestWordOrLinkFromMouseEvent(const MouseEventWithHitTestResults& event);
     190    void selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults&);
     191    void selectClosestWordOrLinkFromMouseEvent(const MouseEventWithHitTestResults&);
    198192
    199193    bool handleMouseDoubleClickEvent(const PlatformMouseEvent&);
     
    267261    // The following are called at the beginning of handleMouseUp and handleDrag. 
    268262    // If they return true it indicates that they have consumed the event.
    269 #if PLATFORM(MAC)
    270263    bool eventLoopHandleMouseUp(const MouseEventWithHitTestResults&);
    271264    bool eventLoopHandleMouseDragged(const MouseEventWithHitTestResults&);
     265
     266    bool invertSenseOfTabsToLinks(KeyboardEvent*) const;
     267
     268    void updateSelectionForMouseDrag(Node* targetNode, const IntPoint& localPoint);
     269
     270    bool capturesDragging() const { return m_capturesDragging; }
     271
     272#if PLATFORM(MAC) && defined(__OBJC__)
    272273    NSView *mouseDownViewIfStillGood();
    273 #else
    274     bool eventLoopHandleMouseUp(const MouseEventWithHitTestResults&) { return false; }
    275     bool eventLoopHandleMouseDragged(const MouseEventWithHitTestResults&) { return false; }
    276 #endif
    277 
    278     bool invertSenseOfTabsToLinks(KeyboardEvent*) const;
    279 
    280     void updateSelectionForMouseDrag(Node* targetNode, const IntPoint& localPoint);
    281 
    282     bool capturesDragging() const { return m_capturesDragging; }
     274
     275    PlatformMouseEvent currentPlatformMouseEvent() const;
     276#endif
    283277
    284278    Frame* m_frame;
     
    305299    bool m_mouseDownMayStartAutoscroll;
    306300    bool m_mouseDownWasInSubframe;
     301
    307302#if ENABLE(SVG)
    308303    bool m_svgPan;
     
    339334    int m_activationEventNumber;
    340335#endif
    341 
    342336};
    343337
  • trunk/WebCore/page/Frame.cpp

    r44215 r44379  
    222222}
    223223
    224 void Frame::setView(FrameView* view)
     224void Frame::setView(PassRefPtr<FrameView> view)
    225225{
    226226    // Detach the document now, so any onUnload handlers get run - if
     
    17521752    setView(0);
    17531753
    1754     FrameView* frameView;
     1754    RefPtr<FrameView> frameView;
    17551755    if (isMainFrame) {
    1756         frameView = new FrameView(this, viewportSize);
     1756        frameView = FrameView::create(this, viewportSize);
    17571757        frameView->setFixedLayoutSize(fixedLayoutSize);
    17581758        frameView->setUseFixedLayout(useFixedLayout);
    17591759    } else
    1760         frameView = new FrameView(this);
     1760        frameView = FrameView::create(this);
    17611761
    17621762    frameView->setScrollbarModes(horizontalScrollbarMode, verticalScrollbarMode);
     
    17641764
    17651765    setView(frameView);
    1766     // FrameViews are created with a ref count of 1. Release this ref since we've assigned it to frame.
    1767     frameView->deref();
    17681766
    17691767    if (backgroundColor.isValid())
     
    17741772
    17751773    if (ownerRenderer())
    1776         ownerRenderer()->setWidget(frameView);
     1774        ownerRenderer()->setWidget(frameView.get());
    17771775
    17781776    if (HTMLFrameOwnerElement* owner = ownerElement())
  • trunk/WebCore/page/Frame.h

    r42725 r44379  
    66 *                     2000-2001 Dirk Mueller <mueller@kde.org>
    77 *                     2000 Stefan Schimanski <1Stein@gmx.de>
    8  * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
     8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
    99 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
    1010 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
     
    9292        return adoptRef(new Frame(page, ownerElement, client));
    9393    }
    94     void setView(FrameView*);
     94    void setView(PassRefPtr<FrameView>);
    9595    ~Frame();
    9696   
  • trunk/WebCore/page/FrameTree.cpp

    r40870 r44379  
    2222
    2323#include "Frame.h"
     24#include "FrameView.h"
    2425#include "Page.h"
    2526#include "PageGroup.h"
  • trunk/WebCore/page/FrameView.cpp

    r44311 r44379  
    9191
    9292FrameView::FrameView(Frame* frame)
    93     : m_refCount(1)
    94     , m_frame(frame)
     93    : m_frame(frame)
    9594    , m_vmode(ScrollbarAuto)
    9695    , m_hmode(ScrollbarAuto)
     
    115114{
    116115    init();
    117     show();
    118 }
    119 
    120 FrameView::FrameView(Frame* frame, const IntSize& initialSize)
    121     : m_refCount(1)
    122     , m_frame(frame)
    123     , m_vmode(ScrollbarAuto)
    124     , m_hmode(ScrollbarAuto)
    125     , m_slowRepaintObjectCount(0)
    126     , m_layoutTimer(this, &FrameView::layoutTimerFired)
    127     , m_layoutRoot(0)
    128     , m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired)
    129     , m_needToInitScrollbars(true)
    130     , m_isTransparent(false)
    131     , m_baseBackgroundColor(Color::white)
    132     , m_mediaType("screen")
    133     , m_enqueueEvents(0)
    134     , m_overflowStatusDirty(true)
    135     , m_viewportRenderer(0)
    136     , m_wasScrolledByUser(false)
    137     , m_inProgrammaticScroll(false)
    138     , m_deferredRepaintTimer(this, &FrameView::deferredRepaintTimerFired)
    139     , m_shouldUpdateWhileOffscreen(true)
    140     , m_deferSetNeedsLayouts(0)
    141     , m_setNeedsLayoutWasDeferred(false)
    142     , m_lockedToAnchor(false)
    143 {
    144     init();
    145     Widget::setFrameRect(IntRect(x(), y(), initialSize.width(), initialSize.height()));
    146     show();
     116}
     117
     118PassRefPtr<FrameView> FrameView::create(Frame* frame)
     119{
     120    RefPtr<FrameView> view = adoptRef(new FrameView(frame));
     121    view->show();
     122    return view.release();
     123}
     124
     125PassRefPtr<FrameView> FrameView::create(Frame* frame, const IntSize& initialSize)
     126{
     127    RefPtr<FrameView> view = adoptRef(new FrameView(frame));
     128    view->Widget::setFrameRect(IntRect(view->pos(), initialSize));
     129    view->show();
     130    return view.release();
    147131}
    148132
     
    159143    setHasVerticalScrollbar(false);
    160144   
    161     ASSERT(m_refCount == 0);
    162145    ASSERT(m_scheduledEvents.isEmpty());
    163146    ASSERT(!m_enqueueEvents);
  • trunk/WebCore/page/FrameView.h

    r44311 r44379  
    4949template <typename T> class Timer;
    5050
    51 class FrameView : public ScrollView {
     51class FrameView : public ScrollView, public RefCounted<FrameView> {
    5252public:
    5353    friend class RenderView;
    5454
    55     FrameView(Frame*);
    56     FrameView(Frame*, const IntSize& initialSize);
     55    static PassRefPtr<FrameView> create(Frame*);
     56    static PassRefPtr<FrameView> create(Frame*, const IntSize& initialSize);
    5757
    5858    virtual ~FrameView();
     
    6464    Frame* frame() const { return m_frame.get(); }
    6565    void clearFrame();
    66 
    67     void ref() { ++m_refCount; }
    68     void deref() { if (!--m_refCount) delete this; }
    69     bool hasOneRef() { return m_refCount == 1; }
    7066
    7167    int marginWidth() const { return m_margins.width(); } // -1 means default
     
    194190
    195191private:
     192    FrameView(Frame*);
     193
    196194    void reset();
    197195    void init();
     
    226224    static double sCurrentPaintTimeStamp; // used for detecting decoded resource thrash in the cache
    227225
    228     unsigned m_refCount;
    229226    IntSize m_size;
    230227    IntSize m_margins;
  • trunk/WebCore/page/mac/EventHandlerMac.mm

    r43111 r44379  
    11/*
    2  * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
     2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    6262const double EventHandler::TextDragDelay = 0.15;
    6363
    64 static RetainPtr<NSEvent>& currentEvent()
     64static RetainPtr<NSEvent>& currentNSEventSlot()
    6565{
    6666    DEFINE_STATIC_LOCAL(RetainPtr<NSEvent>, event, ());
     
    7070NSEvent *EventHandler::currentNSEvent()
    7171{
    72     return currentEvent().get();
     72    return currentNSEventSlot().get();
     73}
     74
     75class CurrentEventScope : Noncopyable {
     76public:
     77    CurrentEventScope(NSEvent *);
     78    ~CurrentEventScope();
     79
     80private:
     81    RetainPtr<NSEvent> m_savedCurrentEvent;
     82#ifndef NDEBUG
     83    RetainPtr<NSEvent> m_event;
     84#endif
     85};
     86
     87inline CurrentEventScope::CurrentEventScope(NSEvent *event)
     88    : m_savedCurrentEvent(currentNSEventSlot())
     89#ifndef NDEBUG
     90    , m_event(event)
     91#endif
     92{
     93    currentNSEventSlot() = event;
     94}
     95
     96inline CurrentEventScope::~CurrentEventScope()
     97{
     98    ASSERT(currentNSEventSlot() == m_event);
     99    currentNSEventSlot() = m_savedCurrentEvent;
    73100}
    74101
    75102bool EventHandler::wheelEvent(NSEvent *event)
    76103{
    77     RetainPtr<NSEvent> oldCurrentEvent = currentEvent();
    78     currentEvent() = event;
    79 
    80     PlatformWheelEvent wheelEvent(event);
     104    Page* page = m_frame->page();
     105    if (!page)
     106        return false;
     107
     108    CurrentEventScope scope(event);
     109
     110    PlatformWheelEvent wheelEvent(event, page->chrome()->platformWindow());
    81111    handleWheelEvent(wheelEvent);
    82 
    83     ASSERT(currentEvent() == event);
    84     currentEvent() = oldCurrentEvent;
    85112
    86113    return wheelEvent.isAccepted();
     
    166193bool EventHandler::keyEvent(NSEvent *event)
    167194{
    168     bool result;
    169195    BEGIN_BLOCK_OBJC_EXCEPTIONS;
    170196
    171197    ASSERT([event type] == NSKeyDown || [event type] == NSKeyUp);
    172198
    173     RetainPtr<NSEvent> oldCurrentEvent = currentEvent();
    174     currentEvent() = event;
    175 
    176     result = keyEvent(PlatformKeyboardEvent(event));
    177    
    178     ASSERT(currentEvent() == event);
    179     currentEvent() = oldCurrentEvent;
    180 
    181     return result;
     199    CurrentEventScope scope(event);
     200    return keyEvent(PlatformKeyboardEvent(event));
    182201
    183202    END_BLOCK_OBJC_EXCEPTIONS;
     
    221240static bool lastEventIsMouseUp()
    222241{
    223     // Many AK widgets run their own event loops and consume events while the mouse is down.
    224     // When they finish, currentEvent is the mouseUp that they exited on.  We need to update
    225     // the khtml state with this mouseUp, which khtml never saw.  This method lets us detect
    226     // that state.
     242    // Many AppKit widgets run their own event loops and consume events while the mouse is down.
     243    // When they finish, currentEvent is the mouseUp that they exited on. We need to update
     244    // the WebCore state with this mouseUp, which we never saw. This method lets us detect
     245    // that state. Handling this was critical when we used AppKit widgets for form elements.
     246    // It's not clear in what cases this is helpful now -- it's possible it can be removed.
    227247
    228248    BEGIN_BLOCK_OBJC_EXCEPTIONS;
    229249    NSEvent *currentEventAfterHandlingMouseDown = [NSApp currentEvent];
    230     if (currentEvent() != currentEventAfterHandlingMouseDown &&
    231         [currentEventAfterHandlingMouseDown type] == NSLeftMouseUp &&
    232         [currentEventAfterHandlingMouseDown timestamp] >= [currentEvent().get() timestamp])
    233             return true;
     250    return EventHandler::currentNSEvent() != currentEventAfterHandlingMouseDown
     251        && [currentEventAfterHandlingMouseDown type] == NSLeftMouseUp
     252        && [currentEventAfterHandlingMouseDown timestamp] >= [EventHandler::currentNSEvent() timestamp];
    234253    END_BLOCK_OBJC_EXCEPTIONS;
    235254
     
    239258bool EventHandler::passMouseDownEventToWidget(Widget* widget)
    240259{
    241     // FIXME: this method always returns true
     260    // FIXME: This function always returns true. It should be changed either to return
     261    // false in some cases or the return value should be removed.
    242262
    243263    if (!widget) {
     
    251271    ASSERT(nodeView);
    252272    ASSERT([nodeView superview]);
    253     NSView *view = [nodeView hitTest:[[nodeView superview] convertPoint:[currentEvent().get() locationInWindow] fromView:nil]];
     273    NSView *view = [nodeView hitTest:[[nodeView superview] convertPoint:[currentNSEvent() locationInWindow] fromView:nil]];
    254274    if (!view) {
    255275        // We probably hit the border of a RenderWidget
     
    264284        // Normally [NSWindow sendEvent:] handles setting the first responder.
    265285        // But in our case, the event was sent to the view representing the entire web page.
    266         if ([currentEvent().get() clickCount] <= 1 && [view acceptsFirstResponder] && [view needsPanelToBecomeKey])
     286        if ([currentNSEvent() clickCount] <= 1 && [view acceptsFirstResponder] && [view needsPanelToBecomeKey])
    267287            page->chrome()->client()->makeFirstResponder(view);
    268288    }
     
    281301    ASSERT(!m_sendingEventToSubview);
    282302    m_sendingEventToSubview = true;
    283     [view mouseDown:currentEvent().get()];
     303    [view mouseDown:currentNSEvent()];
    284304    m_sendingEventToSubview = false;
    285305   
     
    356376        m_sendingEventToSubview = true;
    357377        BEGIN_BLOCK_OBJC_EXCEPTIONS;
    358         [view mouseDragged:currentEvent().get()];
     378        [view mouseDragged:currentNSEvent()];
    359379        END_BLOCK_OBJC_EXCEPTIONS;
    360380        m_sendingEventToSubview = false;
     
    383403        m_sendingEventToSubview = true;
    384404        BEGIN_BLOCK_OBJC_EXCEPTIONS;
    385         [view mouseUp:currentEvent().get()];
     405        [view mouseUp:currentNSEvent()];
    386406        END_BLOCK_OBJC_EXCEPTIONS;
    387407        m_sendingEventToSubview = false;
     
    395415    BEGIN_BLOCK_OBJC_EXCEPTIONS;
    396416
    397     switch ([currentEvent().get() type]) {
     417    switch ([currentNSEvent() type]) {
    398418        case NSLeftMouseDragged:
    399419        case NSOtherMouseDragged:
     
    406426                return false;
    407427        case NSMouseMoved:
    408             // Since we're passing in currentEvent() here, we can call
     428            // Since we're passing in currentNSEvent() here, we can call
    409429            // handleMouseMoveEvent() directly, since the save/restore of
    410             // currentEvent() that mouseMoved() does would have no effect.
     430            // currentNSEvent() that mouseMoved() does would have no effect.
    411431            ASSERT(!m_sendingEventToSubview);
    412432            m_sendingEventToSubview = true;
    413             subframe->eventHandler()->handleMouseMoveEvent(currentEvent().get(), hoveredNode);
     433            subframe->eventHandler()->handleMouseMoveEvent(currentPlatformMouseEvent(), hoveredNode);
    414434            m_sendingEventToSubview = false;
    415435            return true;
     
    435455            ASSERT(!m_sendingEventToSubview);
    436456            m_sendingEventToSubview = true;
    437             subframe->eventHandler()->handleMouseReleaseEvent(currentEvent().get());
     457            subframe->eventHandler()->handleMouseReleaseEvent(currentPlatformMouseEvent());
    438458            m_sendingEventToSubview = false;
    439459            return true;
     
    485505    BEGIN_BLOCK_OBJC_EXCEPTIONS;
    486506       
    487     if ([currentEvent().get() type] != NSScrollWheel || m_sendingEventToSubview || !widget)
     507    if ([currentNSEvent() type] != NSScrollWheel || m_sendingEventToSubview || !widget)
    488508        return false;
    489509
     
    491511    ASSERT(nodeView);
    492512    ASSERT([nodeView superview]);
    493     NSView *view = [nodeView hitTest:[[nodeView superview] convertPoint:[currentEvent().get() locationInWindow] fromView:nil]];
     513    NSView *view = [nodeView hitTest:[[nodeView superview] convertPoint:[currentNSEvent() locationInWindow] fromView:nil]];
    494514    if (!view)
    495515        // We probably hit the border of a RenderWidget
     
    502522    // in the nested tracking runloop that -[NSScrollView scrollWheel:] runs.
    503523    setNSScrollViewScrollWheelShouldRetainSelf(true);
    504     [view scrollWheel:currentEvent().get()];
     524    [view scrollWheel:currentNSEvent()];
    505525    setNSScrollViewScrollWheelShouldRetainSelf(false);
    506526    m_sendingEventToSubview = false;
     
    523543    m_mouseDownView = nil;
    524544   
    525     RetainPtr<NSEvent> oldCurrentEvent = currentEvent();
    526     currentEvent() = event;
    527     m_mouseDown = PlatformMouseEvent(event);
    528    
    529     handleMousePressEvent(event);
    530    
    531     ASSERT(currentEvent() == event);
    532     currentEvent() = oldCurrentEvent;
     545    CurrentEventScope scope(event);
     546    m_mouseDown = currentPlatformMouseEvent();
     547    handleMousePressEvent(m_mouseDown);
    533548
    534549    END_BLOCK_OBJC_EXCEPTIONS;
     
    543558    BEGIN_BLOCK_OBJC_EXCEPTIONS;
    544559
    545     RetainPtr<NSEvent> oldCurrentEvent = currentEvent();
    546     currentEvent() = event;
    547 
    548     handleMouseMoveEvent(event);
    549    
    550     ASSERT(currentEvent() == event);
    551     currentEvent() = oldCurrentEvent;
     560    CurrentEventScope scope(event);
     561    handleMouseMoveEvent(currentPlatformMouseEvent());
    552562
    553563    END_BLOCK_OBJC_EXCEPTIONS;
     
    562572    BEGIN_BLOCK_OBJC_EXCEPTIONS;
    563573
    564     RetainPtr<NSEvent> oldCurrentEvent = currentEvent();
    565     currentEvent() = event;
     574    CurrentEventScope scope(event);
    566575
    567576    // Our behavior here is a little different that Qt. Qt always sends
     
    574583    int clickCount = [event clickCount];
    575584    if (clickCount > 0 && clickCount % 2 == 0)
    576         handleMouseDoubleClickEvent(event);
     585        handleMouseDoubleClickEvent(currentPlatformMouseEvent());
    577586    else
    578         handleMouseReleaseEvent(event);
    579    
    580     ASSERT(currentEvent() == event);
    581     currentEvent() = oldCurrentEvent;
     587        handleMouseReleaseEvent(currentPlatformMouseEvent());
    582588   
    583589    m_mouseDownView = nil;
     
    658664   
    659665    BEGIN_BLOCK_OBJC_EXCEPTIONS;
    660 
    661     RetainPtr<NSEvent> oldCurrentEvent = currentEvent();
    662     currentEvent() = event;
    663    
    664     mouseMoved(PlatformMouseEvent(event));
    665    
    666     ASSERT(currentEvent() == event);
    667     currentEvent() = oldCurrentEvent;
    668 
     666    CurrentEventScope scope(event);
     667    mouseMoved(currentPlatformMouseEvent());
    669668    END_BLOCK_OBJC_EXCEPTIONS;
    670669}
     
    696695}
    697696
    698 }
     697PlatformMouseEvent EventHandler::currentPlatformMouseEvent() const
     698{
     699    NSView *windowView = nil;
     700    if (Page* page = m_frame->page())
     701        windowView = page->chrome()->platformWindow();
     702    return PlatformMouseEvent(currentNSEvent(), windowView);
     703}
     704
     705bool EventHandler::sendContextMenuEvent(NSEvent *event)
     706{
     707    Page* page = m_frame->page();
     708    if (!page)
     709        return false;
     710    return sendContextMenuEvent(PlatformMouseEvent(event, page->chrome()->platformWindow()));
     711}
     712
     713bool EventHandler::eventMayStartDrag(NSEvent *event)
     714{
     715    Page* page = m_frame->page();
     716    if (!page)
     717        return false;
     718    return eventMayStartDrag(PlatformMouseEvent(event, page->chrome()->platformWindow()));
     719}
     720
     721}
  • trunk/WebCore/platform/HostWindow.h

    r39717 r44379  
    2828
    2929#include <wtf/Noncopyable.h>
    30 #include "IntRect.h"
    3130#include "Widget.h"
    3231
    3332namespace WebCore {
    3433
    35 class IntPoint;
    36 class IntRect;
    37 
    3834class HostWindow : Noncopyable {
    3935public:
    40     HostWindow() {}
    41     virtual ~HostWindow() {}
     36    virtual ~HostWindow() { }
    4237
    4338    // The repaint method asks the host window to repaint a rect in the window's coordinate space.  The
  • trunk/WebCore/platform/PlatformMouseEvent.h

    r44060 r44379  
    11/*
    2  * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
     2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2828
    2929#include "IntPoint.h"
    30 #include <wtf/Platform.h>
    31 
    32 #if PLATFORM(MAC)
    33 #ifdef __OBJC__
    34 @class NSEvent;
    35 @class NSScreen;
    36 @class NSWindow;
    37 #else
    38 class NSEvent;
    39 class NSScreen;
    40 class NSWindow;
    41 #endif
    42 #endif
    43 
    44 #if PLATFORM(WIN)
    45 typedef struct HWND__* HWND;
    46 typedef unsigned UINT;
    47 typedef unsigned WPARAM;
    48 typedef long LPARAM;
    49 #endif
    5030
    5131#if PLATFORM(GTK)
     
    5838class QInputEvent;
    5939QT_END_NAMESPACE
     40#endif
     41
     42#if PLATFORM(WIN)
     43typedef struct HWND__* HWND;
     44typedef unsigned UINT;
     45typedef unsigned WPARAM;
     46typedef long LPARAM;
    6047#endif
    6148
     
    8572        }
    8673
    87         PlatformMouseEvent(const IntPoint& pos, const IntPoint& globalPos, MouseButton button, MouseEventType eventType,
     74        PlatformMouseEvent(const IntPoint& position, const IntPoint& globalPosition, MouseButton button, MouseEventType eventType,
    8875                           int clickCount, bool shift, bool ctrl, bool alt, bool meta, double timestamp)
    89             : m_position(pos), m_globalPosition(globalPos), m_button(button)
     76            : m_position(position)
     77            , m_globalPosition(globalPosition)
     78            , m_button(button)
    9079            , m_eventType(eventType)
    9180            , m_clickCount(clickCount)
     
    113102        unsigned modifierFlags() const { return m_modifierFlags; }
    114103       
    115         //time in seconds
     104        // Time in seconds.
    116105        double timestamp() const { return m_timestamp; }
    117106
    118 #if PLATFORM(MAC)
    119         PlatformMouseEvent(NSEvent*);
     107#if PLATFORM(GTK)
     108        PlatformMouseEvent(GdkEventButton*);
     109        PlatformMouseEvent(GdkEventMotion*);
     110#endif
     111
     112#if PLATFORM(MAC) && defined(__OBJC__)
     113        PlatformMouseEvent(NSEvent *, NSView *windowView);
    120114        int eventNumber() const { return m_eventNumber; }
    121115#endif
     116
     117#if PLATFORM(QT)
     118        PlatformMouseEvent(QInputEvent*, int clickCount);
     119#endif
     120
    122121#if PLATFORM(WIN)
    123122        PlatformMouseEvent(HWND, UINT, WPARAM, LPARAM, bool activatedWebView = false);
    124123        void setClickCount(int count) { m_clickCount = count; }
    125124        bool activatedWebView() const { return m_activatedWebView; }
    126 #endif
    127 #if PLATFORM(GTK)
    128         PlatformMouseEvent(GdkEventButton*);
    129         PlatformMouseEvent(GdkEventMotion*);
    130 #endif
    131 #if PLATFORM(QT)
    132         PlatformMouseEvent(QInputEvent*, int clickCount);
    133125#endif
    134126
     
    137129#endif
    138130
    139 
    140     protected:
     131    private:
    141132        IntPoint m_position;
    142133        IntPoint m_globalPosition;
     
    150141        double m_timestamp; // unit: seconds
    151142        unsigned m_modifierFlags;
     143
    152144#if PLATFORM(MAC)
    153145        int m_eventNumber;
    154146#endif
     147
    155148#if PLATFORM(WIN)
    156149        bool m_activatedWebView;
     
    158151    };
    159152
    160 #if PLATFORM(MAC)
    161     IntPoint globalPoint(const NSPoint& windowPoint, NSWindow *window);
    162     IntPoint pointForEvent(NSEvent *event);
    163     IntPoint globalPointForEvent(NSEvent *event);
     153#if PLATFORM(MAC) && defined(__OBJC__)
     154    IntPoint globalPoint(const NSPoint& windowPoint, NSWindow *);
     155    IntPoint pointForEvent(NSEvent *, NSView *windowView);
     156    IntPoint globalPointForEvent(NSEvent *);
    164157#endif
    165158
  • trunk/WebCore/platform/PlatformWheelEvent.h

    r41746 r44379  
    11/*
    2  * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
     2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2929#include "IntPoint.h"
    3030
    31 #if PLATFORM(MAC)
    32 #ifdef __OBJC__
    33 @class NSEvent;
    34 #else
    35 class NSEvent;
    36 #endif
    37 #endif
    38 
    39 #if PLATFORM(WIN)
    40 typedef struct HWND__* HWND;
    41 typedef unsigned WPARAM;
    42 typedef long LPARAM;
    43 #endif
    44 
    4531#if PLATFORM(GTK)
    4632typedef struct _GdkEventScroll GdkEventScroll;
     
    5137class QWheelEvent;
    5238QT_END_NAMESPACE
     39#endif
     40
     41#if PLATFORM(WIN)
     42typedef struct HWND__* HWND;
     43typedef unsigned WPARAM;
     44typedef long LPARAM;
    5345#endif
    5446
     
    9486        void ignore() { m_isAccepted = false; }
    9587
    96 #if PLATFORM(MAC)
    97         PlatformWheelEvent(NSEvent*);
     88#if PLATFORM(GTK)
     89        PlatformWheelEvent(GdkEventScroll*);
    9890#endif
     91
     92#if PLATFORM(MAC) && defined(__OBJC__)
     93        PlatformWheelEvent(NSEvent *, NSView *windowView);
     94#endif
     95
     96#if PLATFORM(QT)
     97        PlatformWheelEvent(QWheelEvent*);
     98#endif
     99
    99100#if PLATFORM(WIN)
    100101        PlatformWheelEvent(HWND, WPARAM, LPARAM, bool isMouseHWheel);
    101102#endif
    102 #if PLATFORM(GTK)
    103         PlatformWheelEvent(GdkEventScroll*);
    104 #endif
    105 #if PLATFORM(QT)
    106         PlatformWheelEvent(QWheelEvent*);
    107 #endif
     103
    108104#if PLATFORM(WX)
    109105        PlatformWheelEvent(const wxMouseEvent&, const wxPoint&);
    110106#endif
    111107
    112     protected:
     108    private:
    113109        IntPoint m_position;
    114110        IntPoint m_globalPosition;
  • trunk/WebCore/platform/mac/PlatformMouseEventMac.mm

    r40171 r44379  
    6969}
    7070
    71 IntPoint globalPoint(const NSPoint& windowPoint, NSWindow* window)
     71IntPoint globalPoint(const NSPoint& windowPoint, NSWindow *window)
    7272{
    7373    return IntPoint(flipScreenPoint([window convertBaseToScreen:windowPoint], screenForWindow(window)));
    7474}
    7575
    76 IntPoint pointForEvent(NSEvent *event)
     76IntPoint pointForEvent(NSEvent *event, NSView *windowView)
    7777{
    7878    switch ([event type]) {
     
    8787        case NSOtherMouseDragged:
    8888        case NSMouseMoved:
    89         case NSScrollWheel:
    90             // Note: This has its origin at the bottom left of the window.
    91             // The Y coordinate gets flipped by ScrollView::viewportToContents.
    92             // We should probably change both this and that to not use "bottom left origin" coordinates at all.
    93             return IntPoint([event locationInWindow]);
     89        case NSScrollWheel: {
     90            // Note: This will have its origin at the bottom left of the window unless windowView is flipped.
     91            // In those cases, the Y coordinate gets flipped by Widget::convertFromContainingWindow.
     92            NSPoint location = [event locationInWindow];
     93            if (windowView)
     94                location = [windowView convertPoint:location fromView:nil];
     95            return IntPoint(location);
     96        }
    9497        default:
    9598            return IntPoint();
     
    140143}
    141144
    142 PlatformMouseEvent::PlatformMouseEvent(NSEvent* event)
    143     : m_position(pointForEvent(event))
     145PlatformMouseEvent::PlatformMouseEvent(NSEvent* event, NSView *windowView)
     146    : m_position(pointForEvent(event, windowView))
    144147    , m_globalPosition(globalPointForEvent(event))
    145148    , m_button(mouseButtonForEvent(event))
  • trunk/WebCore/platform/mac/WheelEventMac.mm

    r41746 r44379  
    3333namespace WebCore {
    3434
    35 PlatformWheelEvent::PlatformWheelEvent(NSEvent* event)
    36     : m_position(pointForEvent(event))
     35PlatformWheelEvent::PlatformWheelEvent(NSEvent* event, NSView *windowView)
     36    : m_position(pointForEvent(event, windowView))
    3737    , m_globalPosition(globalPointForEvent(event))
    3838    , m_granularity(ScrollByPixelWheelEvent)
  • trunk/WebCore/platform/mac/WidgetMac.mm

    r40558 r44379  
    286286IntPoint Widget::convertFromContainingWindow(const IntPoint& point) const
    287287{
    288     if (!platformWidget() && parent()) {
     288    if (!platformWidget()) {
     289        if (!parent())
     290            return point;
    289291        IntPoint result = parent()->convertFromContainingWindow(point);
    290292        result.move(parent()->scrollX() - x(), parent()->scrollY() - y());
     
    301303IntRect Widget::convertFromContainingWindow(const IntRect& rect) const
    302304{
    303     if (!platformWidget() && parent()) {
     305    if (!platformWidget()) {
     306        if (!parent())
     307            return rect;
    304308        IntRect result = parent()->convertFromContainingWindow(rect);
    305309        result.move(parent()->scrollX() - x(), parent()->scrollY() - y());
  • trunk/WebCore/rendering/RenderApplet.cpp

    r40107 r44379  
    1 /**
    2  * This file is part of the HTML widget for KDE.
    3  *
     1/*
    42 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
    5  * Copyright (C) 2003, 2006 Apple Computer, Inc.
     3 * Copyright (C) 2003, 2006, 2009 Apple Inc. All rights reserved.
    64 *
    75 * This library is free software; you can redistribute it and/or
     
    2523#include "RenderApplet.h"
    2624
    27 #include "Document.h"
    2825#include "Frame.h"
    29 #include "FrameLoader.h"
    3026#include "HTMLAppletElement.h"
    3127#include "HTMLNames.h"
    3228#include "HTMLParamElement.h"
    33 #include "Widget.h"
    3429
    3530namespace WebCore {
     
    4439}
    4540
    46 RenderApplet::~RenderApplet()
    47 {
    48 }
    49 
    5041IntSize RenderApplet::intrinsicSize() const
    5142{
     
    5445    // layout and sizing to be correct. We should remove this and
    5546    // pass the appropriate intrinsic size in the constructor.
    56     return m_widget ? IntSize(50, 50) : IntSize(150, 150);
     47    return widget() ? IntSize(50, 50) : IntSize(150, 150);
    5748}
    5849
     
    6051{
    6152    HTMLAppletElement* element = static_cast<HTMLAppletElement*>(node());
    62     if (m_widget || !element->isFinishedParsingChildren())
     53    if (widget() || !element->isFinishedParsingChildren())
    6354        return;
    6455
  • trunk/WebCore/rendering/RenderApplet.h

    r25754 r44379  
    11/*
    22 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
    3  * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
     3 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
    44 *
    55 * This library is free software; you can redistribute it and/or
     
    3333    public:
    3434        RenderApplet(HTMLAppletElement*, const HashMap<String, String>& args);
    35         virtual ~RenderApplet();
    3635
     36        void createWidgetIfNecessary();
     37
     38    private:
    3739        virtual const char* renderName() const { return "RenderApplet"; }
    3840
     
    4244        virtual IntSize intrinsicSize() const;
    4345
    44         void createWidgetIfNecessary();
    45 
    46     private:
    4746        HashMap<String, String> m_args;
    4847    };
  • trunk/WebCore/rendering/RenderFrame.cpp

    r25754 r44379  
    1 /**
    2  * This file is part of the KDE project.
    3  *
     1/*
    42 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
    53 *           (C) 2000 Simon Hausmann <hausmann@kde.org>
    64 *           (C) 2000 Stefan Schimanski (1Stein@gmx.de)
    7  * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
     5 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
    86 *
    97 * This library is free software; you can redistribute it and/or
     
    2624#include "config.h"
    2725#include "RenderFrame.h"
    28 #include "RenderFrameSet.h"
     26
    2927#include "FrameView.h"
    30 #include "HTMLFrameSetElement.h"
    31 #include "HTMLNames.h"
     28#include "HTMLFrameElement.h"
    3229
    3330namespace WebCore {
    34 
    35 using namespace HTMLNames;
    3631
    3732RenderFrame::RenderFrame(HTMLFrameElement* frame)
     
    4338FrameEdgeInfo RenderFrame::edgeInfo() const
    4439{
    45     return FrameEdgeInfo(element()->noResize(), element()->hasFrameBorder());
     40    HTMLFrameElement* element = static_cast<HTMLFrameElement*>(node());
     41    return FrameEdgeInfo(element->noResize(), element->hasFrameBorder());
    4642}
    4743
    4844void RenderFrame::viewCleared()
    4945{
    50     if (element() && m_widget && m_widget->isFrameView()) {
    51         FrameView* view = static_cast<FrameView*>(m_widget);
    52         int marginw = element()->getMarginWidth();
    53         int marginh = element()->getMarginHeight();
     46    HTMLFrameElement* element = static_cast<HTMLFrameElement*>(node());
     47    if (!element || !widget() || !widget()->isFrameView())
     48        return;
    5449
    55         if (marginw != -1)
    56             view->setMarginWidth(marginw);
    57         if (marginh != -1)
    58             view->setMarginHeight(marginh);
    59     }
     50    FrameView* view = static_cast<FrameView*>(widget());
     51
     52    int marginw = element->getMarginWidth();
     53    int marginh = element->getMarginHeight();
     54
     55    if (marginw != -1)
     56        view->setMarginWidth(marginw);
     57    if (marginh != -1)
     58        view->setMarginHeight(marginh);
    6059}
    6160
  • trunk/WebCore/rendering/RenderFrame.h

    r40871 r44379  
    11/*
    2  * This file is part of the KDE project.
    3  *
    42 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
    53 *           (C) 2000 Simon Hausmann <hausmann@kde.org>
    6  * Copyright (C) 2006 Apple Computer, Inc.
     4 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
    75 *
    86 * This library is free software; you can redistribute it and/or
     
    2624#define RenderFrame_h
    2725
    28 #include "HTMLFrameElement.h"
    2926#include "RenderPart.h"
    3027#include "RenderFrameSet.h"
     
    3229namespace WebCore {
    3330
     31class HTMLFrameElement;
     32
    3433class RenderFrame : public RenderPart {
    3534public:
    3635    RenderFrame(HTMLFrameElement*);
    3736
     37    FrameEdgeInfo edgeInfo() const;
     38
     39private:
    3840    virtual const char* renderName() const { return "RenderFrame"; }
    3941    virtual bool isFrame() const { return true; }
    40 
    41     HTMLFrameElement* element() const { return static_cast<HTMLFrameElement*>(RenderPart::node()); }
    42 
    43     FrameEdgeInfo edgeInfo() const;
    4442
    4543    virtual void viewCleared();
  • trunk/WebCore/rendering/RenderPart.cpp

    r41042 r44379  
    1 /**
    2  * This file is part of the KDE project.
    3  *
     1/*
    42 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
    53 *           (C) 2000 Simon Hausmann <hausmann@kde.org>
    64 *           (C) 2000 Stefan Schimanski (1Stein@gmx.de)
    7  * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
     5 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
    86 *
    97 * This library is free software; you can redistribute it and/or
     
    2321 *
    2422 */
     23
    2524#include "config.h"
    2625#include "RenderPart.h"
    2726
    28 #include "Document.h"
    2927#include "Frame.h"
    30 #include "FrameTree.h"
    3128#include "FrameView.h"
    32 #include "HTMLFrameOwnerElement.h"
    33 #include "HTMLNames.h"
    34 #include "Page.h"
    3529
    3630namespace WebCore {
    37 
    38 using namespace HTMLNames;
    3931
    4032RenderPart::RenderPart(Element* node)
     
    4739RenderPart::~RenderPart()
    4840{
     41    clearWidget();
     42}
     43
     44void RenderPart::setWidget(Widget* widget)
     45{
     46    if (widget == this->widget())
     47        return;
     48
     49    if (widget && widget->isFrameView())
     50        static_cast<FrameView*>(widget)->ref();
     51    RenderWidget::setWidget(widget);
     52
     53    // make sure the scrollbars are set correctly for restore
     54    // ### find better fix
     55    viewCleared();
     56}
     57
     58void RenderPart::viewCleared()
     59{
     60}
     61
     62void RenderPart::deleteWidget(Widget* widget)
     63{
    4964    // Since deref ends up calling setWidget back on us, need to make sure
    5065    // that widget is already 0 so it won't do any work.
    51     Widget* widget = m_widget;
    52     m_widget = 0;
     66    ASSERT(!this->widget());
     67
    5368    if (widget && widget->isFrameView())
    5469        static_cast<FrameView*>(widget)->deref();
     
    5772}
    5873
    59 void RenderPart::setWidget(Widget* widget)
    60 {
    61     if (widget != m_widget) {
    62         if (widget && widget->isFrameView())
    63             static_cast<FrameView*>(widget)->ref();
    64         RenderWidget::setWidget(widget);
    65 
    66         // make sure the scrollbars are set correctly for restore
    67         // ### find better fix
    68         viewCleared();
    69     }
    7074}
    71 
    72 void RenderPart::viewCleared()
    73 {
    74 }
    75 
    76 void RenderPart::deleteWidget()
    77 {
    78     if (m_widget && m_widget->isFrameView())
    79         static_cast<FrameView*>(m_widget)->deref();
    80     else
    81         delete m_widget;
    82 }
    83 
    84 }
  • trunk/WebCore/rendering/RenderPart.h

    r41042 r44379  
    11/*
    2  * This file is part of the KDE project.
    3  *
    42 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
    53 *           (C) 2000 Simon Hausmann <hausmann@kde.org>
    6  * Copyright (C) 2006 Apple Computer, Inc.
     4 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
    75 *
    86 * This library is free software; you can redistribute it and/or
     
    3028namespace WebCore {
    3129
    32 class Frame;
    33 class HTMLFrameOwnerElement;
    34 
    3530class RenderPart : public RenderWidget {
    3631public:
     
    3833    virtual ~RenderPart();
    3934   
    40     virtual bool isRenderPart() const { return true; }
    41     virtual const char* renderName() const { return "RenderPart"; }
     35    bool hasFallbackContent() const { return m_hasFallbackContent; }
    4236
    4337    virtual void setWidget(Widget*);
    44 
    45     bool hasFallbackContent() const { return m_hasFallbackContent; }
    46 
    4738    virtual void viewCleared();
    4839
     
    5142
    5243private:
    53     virtual void deleteWidget();
     44    virtual bool isRenderPart() const { return true; }
     45    virtual const char* renderName() const { return "RenderPart"; }
     46
     47    virtual void deleteWidget(Widget*);
    5448};
    5549
  • trunk/WebCore/rendering/RenderPartObject.cpp

    r42107 r44379  
    33 *           (C) 2000 Simon Hausmann <hausmann@kde.org>
    44 *           (C) 2000 Stefan Schimanski (1Stein@gmx.de)
    5  * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
     5 * Copyright (C) 2004, 2005, 2006, 2008, 2009 Apple Inc. All rights reserved.
    66 *
    77 * This library is free software; you can redistribute it and/or
     
    2626
    2727#include "Frame.h"
    28 #include "FrameLoader.h"
    2928#include "FrameLoaderClient.h"
    30 #include "FrameTree.h"
    31 #include "FrameView.h"
    3229#include "HTMLEmbedElement.h"
    3330#include "HTMLIFrameElement.h"
     
    3532#include "HTMLObjectElement.h"
    3633#include "HTMLParamElement.h"
    37 #if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
    38 #include "HTMLMediaElement.h"
    39 #include "HTMLVideoElement.h"
    40 #endif
    4134#include "MIMETypeRegistry.h"
    4235#include "Page.h"
     
    4437#include "RenderView.h"
    4538#include "Text.h"
     39
     40#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
     41#include "HTMLVideoElement.h"
     42#endif
    4643
    4744namespace WebCore {
     
    6259RenderPartObject::~RenderPartObject()
    6360{
    64     if (m_view)
    65         m_view->removeWidgetToUpdate(this);
     61    if (frameView())
     62        frameView()->removeWidgetToUpdate(this);
    6663}
    6764
     
    152149    Vector<String> paramNames;
    153150    Vector<String> paramValues;
    154     Frame* frame = m_view->frame();
     151    Frame* frame = frameView()->frame();
    155152
    156153    if (node()->hasTagName(objectTag)) {
     
    338335    RenderPart::layout();
    339336
    340     if (!m_widget && m_view)
    341         m_view->addWidgetToUpdate(this);
     337    if (!widget() && frameView())
     338        frameView()->addWidgetToUpdate(this);
    342339
    343340    setNeedsLayout(false);
     
    346343void RenderPartObject::viewCleared()
    347344{
    348     if (node() && m_widget && m_widget->isFrameView()) {
    349         FrameView* view = static_cast<FrameView*>(m_widget);
     345    if (node() && widget() && widget()->isFrameView()) {
     346        FrameView* view = static_cast<FrameView*>(widget());
    350347        int marginw = -1;
    351348        int marginh = -1;
  • trunk/WebCore/rendering/RenderPartObject.h

    r41042 r44379  
    11/*
    2  * This file is part of the KDE project.
    3  *
    42 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
    53 *           (C) 2000 Simon Hausmann <hausmann@kde.org>
    6  * Copyright (C) 2006 Apple Computer, Inc.
     4 * Copyright (C) 2006, 2009 Apple Inc.
    75 *
    86 * This library is free software; you can redistribute it and/or
     
    3533    virtual ~RenderPartObject();
    3634
     35    void updateWidget(bool onlyCreateNonNetscapePlugins);
     36
     37private:
    3738    virtual const char* renderName() const { return "RenderPartObject"; }
    3839
    3940    virtual void layout();
    40     void updateWidget(bool onlyCreateNonNetscapePlugins);
    4141
    4242    virtual void viewCleared();
  • trunk/WebCore/rendering/RenderWidget.cpp

    r44235 r44379  
    1 /**
    2  * This file is part of the HTML widget for KDE.
    3  *
     1/*
    42 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
    53 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org)
    6  * Copyright (C) 2004, 2006 Apple Computer, Inc.
     4 * Copyright (C) 2004, 2006, 2009 Apple Inc. All rights reserved.
    75 *
    86 * This library is free software; you can redistribute it and/or
     
    2826#include "AnimationController.h"
    2927#include "AXObjectCache.h"
    30 #include "Document.h"
    31 #include "Element.h"
    32 #include "Event.h"
    33 #include "FrameView.h"
    3428#include "GraphicsContext.h"
    3529#include "HitTestResult.h"
    36 #include "RenderLayer.h"
    3730#include "RenderView.h"
    3831
     
    4841
    4942RenderWidget::RenderWidget(Node* node)
    50       : RenderReplaced(node)
    51       , m_widget(0)
    52       , m_refCount(0)
    53 {
    54     // a replaced element doesn't support being anonymous
    55     ASSERT(node);
    56     m_view = node->document()->view();
    57 
     43    : RenderReplaced(node)
     44    , m_widget(0)
     45    , m_frameView(node->document()->view())
     46    , m_refCount(0)
     47{
    5848    view()->addWidget(this);
    5949
     
    8373
    8474    if (m_widget) {
    85         if (m_view)
    86             m_view->removeChild(m_widget);
     75        if (m_frameView)
     76            m_frameView->removeChild(m_widget);
    8777        widgetRendererMap().remove(m_widget);
    8878    }
     
    111101{
    112102    ASSERT(m_refCount <= 0);
    113     deleteWidget();
     103    clearWidget();
    114104}
    115105
     
    130120            m_widget->removeFromParent();
    131121            widgetRendererMap().remove(m_widget);
    132             deleteWidget();
     122            clearWidget();
    133123        }
    134124        m_widget = widget;
     
    146136                    m_widget->show();
    147137            }
    148             m_view->addChild(m_widget);
     138            m_frameView->addChild(m_widget);
    149139        }
    150140    }
     
    185175    }
    186176
    187     if (!m_view || paintInfo.phase != PaintPhaseForeground || style()->visibility() != VISIBLE)
     177    if (!m_frameView || paintInfo.phase != PaintPhaseForeground || style()->visibility() != VISIBLE)
    188178        return;
    189179
     
    285275}
    286276
    287 void RenderWidget::deleteWidget()
    288 {
    289     delete m_widget;
     277void RenderWidget::clearWidget()
     278{
     279    Widget* widget = m_widget;
     280    m_widget = 0;
     281    if (widget)
     282        deleteWidget(widget);
     283}
     284
     285void RenderWidget::deleteWidget(Widget* widget)
     286{
     287    delete widget;
    290288}
    291289
  • trunk/WebCore/rendering/RenderWidget.h

    r42849 r44379  
    11/*
    2  * This file is part of the HTML widget for KDE.
    3  *
    42 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
    5  * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
     3 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
    64 *
    75 * This library is free software; you can redistribute it and/or
     
    3432class RenderWidget : public RenderReplaced, private OverlapTestRequestClient {
    3533public:
    36     RenderWidget(Node*);
    3734    virtual ~RenderWidget();
    3835
     36    Widget* widget() const { return m_widget; }
     37    virtual void setWidget(Widget*);
     38
     39    static RenderWidget* find(const Widget*);
     40
     41    void updateWidgetPosition();
     42
     43protected:
     44    RenderWidget(Node*);
     45
     46    FrameView* frameView() const { return m_frameView; }
     47
     48    void clearWidget();
     49
     50    virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
     51    virtual void layout();
     52
     53private:
    3954    virtual bool isWidget() const { return true; }
    4055
    41     virtual void paint(PaintInfo&, int tx, int ty);
     56    virtual void paint(PaintInfo&, int x, int y);
     57    virtual void destroy();
     58    virtual void setSelectionState(SelectionState);
     59    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
     60    virtual void deleteWidget(Widget*);
     61    virtual void setOverlapTestResult(bool);
    4262
    43     virtual void destroy();
    44     virtual void layout();
    45 
    46     Widget* widget() const { return m_widget; }
    47     static RenderWidget* find(const Widget*);
     63    void setWidgetGeometry(const IntRect&);
    4864
    4965    RenderArena* ref() { ++m_refCount; return renderArena(); }
    5066    void deref(RenderArena*);
    5167
    52     virtual void setSelectionState(SelectionState);
    53 
    54     void updateWidgetPosition();
    55 
    56     virtual void setWidget(Widget*);
    57 
    58     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
    59 
    60 protected:
    61     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
    62 
    63 private:
    64     void setWidgetGeometry(const IntRect&);
    65 
    66     virtual void deleteWidget();
    67 
    68     // OverlapTestRequestClient
    69     virtual void setOverlapTestResult(bool);
    70 
    71 protected:
    7268    Widget* m_widget;
    73     FrameView* m_view;
    74 
    75 private:
     69    FrameView* m_frameView;
    7670    int m_refCount;
    7771};
  • trunk/WebCore/svg/animation/SMILTime.h

    r31808 r44379  
    6363    inline bool operator<=(const SMILTime& a, const SMILTime& b) { return a.value() < b.value() || operator==(a, b); }
    6464
    65     inline SMILTime max(const SMILTime& a, const SMILTime& b) { return std::max(a.value(), b.value()); }
    66     inline SMILTime min(const SMILTime& a, const SMILTime& b) { return std::min(a.value(), b.value()); }
    6765    SMILTime operator+(const SMILTime&, const SMILTime&);
    6866    SMILTime operator-(const SMILTime&, const SMILTime&);
  • trunk/WebCore/svg/graphics/SVGImage.cpp

    r44096 r44379  
    11/*
    22 * Copyright (C) 2006 Eric Seidel (eric@webkit.org)
    3  * Copyright (C) 2008 Apple, Inc. All rights reserved.
     3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
    44 *
    55 * Redistribution and use in source and binary forms, with or without
     
    3131#include "CachedPage.h"
    3232#include "DocumentLoader.h"
     33#include "EmptyClients.h"
    3334#include "FloatRect.h"
    3435#include "Frame.h"
     
    3738#include "GraphicsContext.h"
    3839#include "HTMLFormElement.h"
     40#include "ImageBuffer.h"
    3941#include "ImageObserver.h"
    4042#include "Page.h"
     
    4749#include "Settings.h"
    4850
    49 #include "EmptyClients.h"
    50 
    5151namespace WebCore {
    5252
     
    7777SVGImage::SVGImage(ImageObserver* observer)
    7878    : Image(observer)
    79     , m_document(0)
    80     , m_chromeClient(0)
    81     , m_page(0)
    82     , m_frame(0)
    83     , m_frameView(0)
    8479{
    8580}
     
    8782SVGImage::~SVGImage()
    8883{
    89     if (m_frame)
    90         m_frame->loader()->frameDetached(); // Break both the loader and view references to the frame
    91 
    92     // Clear these manually so we can safely delete the ChromeClient afterwards
    93     m_frameView.clear();
    94     m_frame.clear();
    95     m_page.clear();
    96    
     84    if (m_page) {
     85        m_page->mainFrame()->loader()->frameDetached(); // Break both the loader and view references to the frame
     86
     87        // Clear explicitly because we want to delete the page before the ChromeClient.
     88        // FIXME: I believe that's already guaranteed by C++ object destruction rules,
     89        // so this may matter only for the assertion below.
     90        m_page.clear();
     91    }
     92
    9793    // Verify that page teardown destroyed the Chrome
    9894    ASSERT(!m_chromeClient->image());
     
    10197void SVGImage::setContainerSize(const IntSize& containerSize)
    10298{
    103     if (containerSize.width() <= 0 || containerSize.height() <= 0)
    104         return;
    105 
    106     if (!m_frame)
    107         return;
    108     SVGSVGElement* rootElement = static_cast<SVGDocument*>(m_frame->document())->rootElement();
     99    if (containerSize.isEmpty())
     100        return;
     101
     102    if (!m_page)
     103        return;
     104    Frame* frame = m_page->mainFrame();
     105    SVGSVGElement* rootElement = static_cast<SVGDocument*>(frame->document())->rootElement();
    109106    if (!rootElement)
    110107        return;
     
    115112bool SVGImage::usesContainerSize() const
    116113{
    117     if (!m_frame)
    118         return false;
    119     SVGSVGElement* rootElement = static_cast<SVGDocument*>(m_frame->document())->rootElement();
     114    if (!m_page)
     115        return false;
     116    Frame* frame = m_page->mainFrame();
     117    SVGSVGElement* rootElement = static_cast<SVGDocument*>(frame->document())->rootElement();
    120118    if (!rootElement)
    121119        return false;
     
    126124IntSize SVGImage::size() const
    127125{
    128     if (!m_frame)
     126    if (!m_page)
    129127        return IntSize();
    130    
    131     SVGSVGElement* rootElement = static_cast<SVGDocument*>(m_frame->document())->rootElement();
     128    Frame* frame = m_page->mainFrame();
     129    SVGSVGElement* rootElement = static_cast<SVGDocument*>(frame->document())->rootElement();
    132130    if (!rootElement)
    133131        return IntSize();
     
    152150bool SVGImage::hasRelativeWidth() const
    153151{
    154     if (!m_frame)
    155         return false;
    156     SVGSVGElement* rootElement = static_cast<SVGDocument*>(m_frame->document())->rootElement();
     152    if (!m_page)
     153        return false;
     154    SVGSVGElement* rootElement = static_cast<SVGDocument*>(m_page->mainFrame()->document())->rootElement();
    157155    if (!rootElement)
    158156        return false;
     
    163161bool SVGImage::hasRelativeHeight() const
    164162{
    165     if (!m_frame)
    166         return false;
    167     SVGSVGElement* rootElement = static_cast<SVGDocument*>(m_frame->document())->rootElement();
     163    if (!m_page)
     164        return false;
     165    SVGSVGElement* rootElement = static_cast<SVGDocument*>(m_page->mainFrame()->document())->rootElement();
    168166    if (!rootElement)
    169167        return false;
     
    174172void SVGImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, CompositeOperator compositeOp)
    175173{
    176     if (!m_frame)
    177         return;
    178    
     174    if (!m_page)
     175        return;
     176
     177    FrameView* view = m_page->mainFrame()->view();
     178
    179179    context->save();
    180180    context->setCompositeOperation(compositeOp);
    181181    context->clip(enclosingIntRect(dstRect));
    182182    if (compositeOp != CompositeSourceOver)
    183         context->beginTransparencyLayer(1.0f);
     183        context->beginTransparencyLayer(1);
    184184    context->translate(dstRect.location().x(), dstRect.location().y());
    185     context->scale(FloatSize(dstRect.width()/srcRect.width(), dstRect.height()/srcRect.height()));
    186 
    187     m_frame->view()->resize(size());
    188 
    189     if (m_frame->view()->needsLayout())
    190         m_frame->view()->layout();
    191     m_frame->view()->paint(context, enclosingIntRect(srcRect));
     185    context->scale(FloatSize(dstRect.width() / srcRect.width(), dstRect.height() / srcRect.height()));
     186
     187    view->resize(size());
     188
     189    if (view->needsLayout())
     190        view->layout();
     191    view->paint(context, enclosingIntRect(srcRect));
    192192
    193193    if (compositeOp != CompositeSourceOver)
     
    206206    // having a tiled drawing callback (hopefully non-virtual).
    207207    if (!m_frameCache) {
     208        if (!m_page)
     209            return 0;
    208210        m_frameCache = ImageBuffer::create(size(), false);
    209211        if (!m_frameCache) // failed to allocate image
    210212            return 0;
    211         renderSubtreeToImage(m_frameCache.get(), m_frame->contentRenderer());
     213        renderSubtreeToImage(m_frameCache.get(), m_page->mainFrame()->contentRenderer());
    212214    }
    213215    return m_frameCache->image()->nativeImageForCurrentFrame();
     
    216218bool SVGImage::dataChanged(bool allDataReceived)
    217219{
    218     int length = m_data->size();
    219     if (!length) // if this was an empty image
     220    // Don't do anything if is an empty image.
     221    if (!m_data->size())
    220222        return true;
    221    
     223
    222224    if (allDataReceived) {
    223225        static FrameLoaderClient* dummyFrameLoaderClient =  new EmptyFrameLoaderClient;
     
    229231        m_chromeClient.set(new SVGImageChromeClient(this));
    230232       
    231         // FIXME: If this SVG ends up loading itself, we'll leak this Frame (and associated DOM & render trees).
    232         // The Cache code does not know about CachedImages holding Frames and won't know to break the cycle.
     233        // FIXME: If this SVG ends up loading itself, we might leak the world.
     234        // THe comment said that the Cache code does not know about CachedImages
     235        // holding Frames and won't know to break the cycle. But
    233236        m_page.set(new Page(m_chromeClient.get(), dummyContextMenuClient, dummyEditorClient, dummyDragClient, dummyInspectorClient));
    234237        m_page->settings()->setJavaScriptEnabled(false);
    235238        m_page->settings()->setPluginsEnabled(false);
    236239
    237         m_frame = Frame::create(m_page.get(), 0, dummyFrameLoaderClient);
    238         m_frameView = new FrameView(m_frame.get());
    239         m_frameView->deref(); // FIXME: FrameView starts with a refcount of 1
    240         m_frame->setView(m_frameView.get());
    241         m_frame->init();
     240        RefPtr<Frame> frame = Frame::create(m_page.get(), 0, dummyFrameLoaderClient);
     241        frame->setView(FrameView::create(frame.get()));
     242        frame->init();
    242243        ResourceRequest fakeRequest(KURL(""));
    243         m_frame->loader()->load(fakeRequest, false); // Make sure the DocumentLoader is created
    244         m_frame->loader()->cancelContentPolicyCheck(); // cancel any policy checks
    245         m_frame->loader()->commitProvisionalLoad(0);
    246         m_frame->loader()->setResponseMIMEType("image/svg+xml");
    247         m_frame->loader()->begin(KURL()); // create the empty document
    248         m_frame->loader()->write(m_data->data(), m_data->size());
    249         m_frame->loader()->end();
    250         m_frameView->setTransparent(true); // SVG Images are transparent.
    251     }
    252     return m_frameView;
     244        FrameLoader* loader = frame->loader();
     245        loader->load(fakeRequest, false); // Make sure the DocumentLoader is created
     246        loader->cancelContentPolicyCheck(); // cancel any policy checks
     247        loader->commitProvisionalLoad(0);
     248        loader->setResponseMIMEType("image/svg+xml");
     249        loader->begin(KURL()); // create the empty document
     250        loader->write(m_data->data(), m_data->size());
     251        loader->end();
     252        frame->view()->setTransparent(true); // SVG Images are transparent.
     253    }
     254
     255    return m_page;
    253256}
    254257
  • trunk/WebCore/svg/graphics/SVGImage.h

    r39601 r44379  
    11/*
    22 * Copyright (C) 2006 Eric Seidel (eric@webkit.org)
     3 * Copyright (C) 2009 Apple Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3031
    3132#include "Image.h"
    32 #include "ImageBuffer.h"
    33 #include "IntSize.h"
    34 #include <wtf/OwnPtr.h>
    3533
    3634namespace WebCore {
    37    
    38     class SVGDocument;
    39     class Frame;
    40     class FrameView;
     35
     36    class ImageBuffer;
    4137    class Page;
    4238    class SVGImageChromeClient;
     
    7369        virtual NativeImagePtr nativeImageForCurrentFrame();
    7470       
    75         SVGDocument* m_document;
    7671        OwnPtr<SVGImageChromeClient> m_chromeClient;
    7772        OwnPtr<Page> m_page;
    78         RefPtr<Frame> m_frame;
    79         RefPtr<FrameView> m_frameView;
    80         IntSize m_minSize;
    8173        OwnPtr<ImageBuffer> m_frameCache;
    8274    };
  • trunk/WebKit/mac/ChangeLog

    r44376 r44379  
     12009-06-02  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by David Hyatt.
     4
     5        Bug 26112: viewless WebKit -- make events work
     6        https://bugs.webkit.org/show_bug.cgi?id=26112
     7
     8        One change here is to make the -[WebFrame frameView] function assert if ever called
     9        in viewless mode, and fix many callers that would trip that assertion.
     10
     11        A major change is to put some methods and data in WebView that are currently in
     12        WebHTMLView, used only in viewless mode. A next step will be to use the WebView
     13        methods whenever possible, even when not in the viewless mode.
     14
     15        Also fix FrameView to do normal reference counting instead of a strange model with
     16        an explicit deref near creation time.
     17
     18        * WebCoreSupport/WebChromeClient.mm:
     19        (WebChromeClient::scrollRectIntoView): Add code to start in the appropriate place
     20        when dealing with viewless mode. This gets triggered when visiting the Google home page.
     21        (WebChromeClient::setToolTip): Changed to call WebView instead of WebHTMLView.
     22        (WebChromeClient::print): Changed to use a new selector that doesn't require a
     23        WebFrameView if present. Also don't even try to use the old selector in viewless mode.
     24
     25        * WebCoreSupport/WebEditorClient.mm:
     26        (WebEditorClient::respondToChangedSelection): Changed to call WebView instead of WebHTMLView.
     27
     28        * WebCoreSupport/WebFrameLoaderClient.mm:
     29        (WebFrameLoaderClient::transitionToCommittedForNewPage): Added more code paths for
     30        viewless mode to skip things we can't do in that mode, with appropriate FIXME.
     31        Use Frame::create and RefPtr and eliminate the strange reference counting of FrameView.
     32
     33        * WebView/WebDataSource.mm:
     34        (-[WebDataSource _receivedData:]): Added a _usesDocumentViews guard around code that's
     35        specific to document views.
     36
     37        * WebView/WebFrame.mm:
     38        (-[WebFrame _updateBackgroundAndUpdatesWhileOffscreen]): Added a _usesDocumentViews
     39        guard around code that's specific to document views.
     40        (-[WebFrame _hasSelection]): Added an implementation for viewless mode.
     41        (-[WebFrame _clearSelection]): Assert we're not in viewless mode; it doesn't really
     42        make sense to clear the selection in only one frame in viewless mode. Later we can
     43        decide what to do.
     44        (-[WebFrame _dragSourceMovedTo:]): Assert we're not in viewless mode; the dragging
     45        code for viewless mode shouldn't have to involve the WebFrame object at all.
     46        (-[WebFrame _dragSourceEndedAt:operation:]): Ditto.
     47        (-[WebFrame frameView]): Assert we're not in viewless mode. This assertion fires
     48        often, but it's a great pointer to code that needs to be changed.
     49
     50        * WebView/WebHTMLView.mm:
     51        (-[WebHTMLView hitTest:]): Tweaked a comment.
     52        (-[WebHTMLView _updateMouseoverWithEvent:]): Fixed a bug where the fake event for
     53        moving the mouse out of the old view ended up overwriting the event for moving
     54        the mouse within the new view.
     55        (-[WebHTMLView mouseDown:]): Got rid of explicit conversion of event to
     56        PlatformMouseEvent in call to sendContextMenuEvent; that's no longer possible
     57        without passing another argument, and it's now handled in EventHandler.
     58
     59        * WebView/WebTextCompletionController.h: Copied from WebKit/mac/WebView/WebHTMLView.mm.
     60        Removed everything except for the WebTextCompletionController class.
     61        * WebView/WebTextCompletionController.mm: Copied from WebKit/mac/WebView/WebHTMLView.mm.
     62        Ditto.
     63
     64        * WebView/WebUIDelegatePrivate.h: Added webView:printFrame: method.
     65
     66        * WebView/WebView.mm: Moved includes and fields in from WebHTMLView.
     67        (-[WebView _usesDocumentViews]): Updated for name change from useDocumentViews
     68        to usesDocumentViews.
     69        (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): Ditto.
     70        (-[WebView drawSingleRect:]): Ditto.
     71        (-[WebView isFlipped]): Ditto.
     72        (-[WebView setFrameSize:]): Ditto. Also changed to use _mainCoreFrame method.
     73        (-[WebView _viewWillDrawInternal]): Ditto.
     74        (-[WebView viewWillDraw]): Ditto.
     75        (-[WebView drawRect:]): Ditto.
     76        (-[WebView _close]): Added code to nil out the lastMouseoverView global.
     77        (-[WebView _dashboardRegions]): Use _mainCoreFrame.
     78        (-[WebView setProhibitsMainFrameScrolling:]): Ditto.
     79        (-[WebView _setInViewSourceMode:]): Ditto.
     80        (-[WebView _inViewSourceMode]): Ditto.
     81        (-[WebView _attachScriptDebuggerToAllFrames]): Ditto.
     82        (-[WebView _detachScriptDebuggerFromAllFrames]): Ditto.
     83        (-[WebView textIteratorForRect:]): Ditto.
     84        (-[WebView _executeCoreCommandByName:value:]): Ditto.
     85        (-[WebView addWindowObserversForWindow:]): Ditto.
     86        (-[WebView removeWindowObservers]): Ditto.
     87        (-[WebView _updateFocusedAndActiveState]): Ditto.
     88        (-[WebView _updateFocusedAndActiveStateForFrame:]): Turned into a class method.
     89        Added code to handle the viewless case without calling frameView.
     90        (-[WebView _windowDidBecomeKey:]): Updated for name change from useDocumentViews
     91        to usesDocumentViews.
     92        (-[WebView _windowDidResignKey:]): Ditto.
     93        (-[WebView _windowWillOrderOnScreen:]): Ditto.
     94        (-[WebView mainFrame]): Tweaked.
     95        (-[WebView selectedFrame]): Added a conditional to avoid trying to get at the
     96        frame view in viewless case.
     97        (-[WebView _setZoomMultiplier:isTextOnly:]): Use _mainCoreFrame.
     98        (-[WebView setCustomTextEncodingName:]): Ditto.
     99        (-[WebView windowScriptObject]): Ditto.
     100        (-[WebView setHostWindow:]): Ditto. Also put some code that's needed only for
     101        document views inside _private->usesDocumentViews.
     102        (-[WebView _hitTest:dragTypes:]): Tweaked.
     103        (-[WebView acceptsFirstResponder]): Added case for viewless mode along with a
     104        FIXME, since it's not complete.
     105        (-[WebView becomeFirstResponder]): Ditto.
     106        (-[WebView _webcore_effectiveFirstResponder]): Put the body of this inside
     107        a usesDocumentView check, because we don't need the first responder forwarding
     108        in viewless mode.
     109        (-[WebView setNextKeyView:]): Ditto.
     110        (-[WebView mouseDown:]): Added. Copied from WebHTMLView. FIXME in here suggests
     111        that we make WebHTMLView share this one soon, which I think is practical.
     112        (-[WebView mouseUp:]): Ditto.
     113        (-[WebView setHoverFeedbackSuspended:]): Added a code path for viewless mode.
     114        (-[WebView shouldClose]): Use _mainCoreFrame.
     115        (-[WebView aeDescByEvaluatingJavaScriptFromString:]): Ditto.
     116        (-[WebView setEditable:]): Ditto.
     117        (-[WebView _frameViewAtWindowPoint:]): Added an assertion that we're not in
     118        viewless mode since this method makes no sense in that mode.
     119        (-[WebView _setMouseDownEvent:]): Added. Copied from WebHTMLView. I plan to
     120        eliminate the one in WebHTMLView soon.
     121        (-[WebView _cancelUpdateMouseoverTimer]): Ditto.
     122        (-[WebView _stopAutoscrollTimer]): Ditto.
     123        (+[WebView _updateMouseoverWithEvent:]): Ditto.
     124        (-[WebView _updateMouseoverWithFakeEvent]): Ditto.
     125        (-[WebView _setToolTip:]): Added. Calls through to the WebHTMLView version.
     126        (-[WebView _selectionChanged]): Ditto.
     127        (-[WebView _mainCoreFrame]): Added.
     128        (-[WebView _needsOneShotDrawingSynchronization]): Moved into the WebInternal
     129        category.
     130        (-[WebView _setNeedsOneShotDrawingSynchronization:]): Ditto.
     131        (-[WebView _startedAcceleratedCompositingForFrame:]): Ditto.
     132        (-[WebView _stoppedAcceleratedCompositingForFrame:]): Ditto.
     133        (viewUpdateRunLoopObserverCallBack): Ditto.
     134        (-[WebView _scheduleViewUpdate]): Ditto.
     135
     136        * WebView/WebViewInternal.h: Made most of the file not compile at all when
     137        included from non-C++ source files, elminating some excess declarations and
     138        typedefs. Moved more methods into the real internal category. Added new
     139        methods _setMouseDownEvent, _cancelUpdateMouseoverTimer, _stopAutoscrollTimer,
     140        _updateMouseoverWithFakeEvent, _selectionChanged, and _setToolTip:.
     141
    11422009-06-02  Mark Rowe  <mrowe@apple.com>
    2143
  • trunk/WebKit/mac/WebCoreSupport/WebChromeClient.mm

    r44136 r44379  
    478478    // we just do ourselves).
    479479   
    480     // We have to convert back to document view coordinates in order to let the flipping conversion take place.  It just
    481     // doesn't make sense for the scrollRectIntoView API to take document view coordinates.
    482480    IntRect scrollRect = r;
    483     scrollRect.move(scrollView->scrollOffset());
     481    NSView *startView = m_webView;
     482    if ([m_webView _usesDocumentViews]) {
     483        // We have to convert back to document view coordinates.
     484        // It doesn't make sense for the scrollRectIntoView API to take document view coordinates.
     485        scrollRect.move(scrollView->scrollOffset());
     486        startView = [[[m_webView mainFrame] frameView] documentView];
     487    }
    484488    NSRect rect = scrollRect;
    485     for (NSView *view = [[[m_webView mainFrame] frameView] documentView]; view; view = [view superview]) {
     489    for (NSView *view = startView; view; view = [view superview]) {
    486490        if ([view isKindOfClass:[NSClipView class]]) {
    487491            NSClipView *clipView = (NSClipView *)view;
    488492            NSView *documentView = [clipView documentView];
    489             [documentView scrollRectToVisible:[documentView convertRect:rect fromView:[[[m_webView mainFrame] frameView] documentView]]];
     493            [documentView scrollRectToVisible:[documentView convertRect:rect fromView:startView]];
    490494        }
    491495    }
     
    503507void WebChromeClient::setToolTip(const String& toolTip)
    504508{
    505     [(WebHTMLView *)[[[m_webView mainFrame] frameView] documentView] _setToolTip:toolTip];
     509    [m_webView _setToolTip:toolTip];
    506510}
    507511
    508512void WebChromeClient::print(Frame* frame)
    509513{
    510     WebFrameView* frameView = [kit(frame) frameView];
    511     CallUIDelegate(m_webView, @selector(webView:printFrameView:), frameView);
     514    WebFrame *webFrame = kit(frame);
     515    if ([[m_webView UIDelegate] respondsToSelector:@selector(webView:printFrame:)])
     516        CallUIDelegate(m_webView, @selector(webView:printFrame:), webFrame);
     517    else if ([m_webView _usesDocumentViews])
     518        CallUIDelegate(m_webView, @selector(webView:printFrameView:), [webFrame frameView]);
    512519}
    513520
     
    650657
    651658#if USE(ACCELERATED_COMPOSITING)
     659
    652660void WebChromeClient::attachRootGraphicsLayer(Frame* frame, GraphicsLayer* graphicsLayer)
    653661{
    654662    BEGIN_BLOCK_OBJC_EXCEPTIONS;
    655663    WebFrameView *frameView = [kit(frame) frameView];
    656     WebHTMLView *docView = (WebHTMLView *)[frameView documentView];
     664    WebHTMLView *documentView = (WebHTMLView *)[frameView documentView];
    657665    if (graphicsLayer)
    658         [docView attachRootLayer:graphicsLayer->nativeLayer()];
     666        [documentView attachRootLayer:graphicsLayer->nativeLayer()];
    659667    else
    660         [docView detachRootLayer];
     668        [documentView detachRootLayer];
    661669    END_BLOCK_OBJC_EXCEPTIONS;
    662670}
     
    675683    END_BLOCK_OBJC_EXCEPTIONS;
    676684}
     685
    677686#endif
    678687
  • trunk/WebKit/mac/WebCoreSupport/WebEditorClient.mm

    r43984 r44379  
    281281void WebEditorClient::respondToChangedSelection()
    282282{
    283     NSView <WebDocumentView> *view = [[[m_webView selectedFrame] frameView] documentView];
    284     if ([view isKindOfClass:[WebHTMLView class]])
    285         [(WebHTMLView *)view _selectionChanged];
     283    [m_webView _selectionChanged];
    286284
    287285    // FIXME: This quirk is needed due to <rdar://problem/5009625> - We can phase it out once Aperture can adopt the new behavior on their end
  • trunk/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm

    r44136 r44379  
    10381038void WebFrameLoaderClient::transitionToCommittedForNewPage()
    10391039{
    1040     WebFrameView *v = m_webFrame->_private->webFrameView;
    1041     WebDataSource *ds = [m_webFrame.get() _dataSource];
    1042 
    1043     bool willProduceHTMLView = [[WebFrameView class] _viewClassForMIMEType:[ds _responseMIMEType]] == [WebHTMLView class];
    1044     bool canSkipCreation = core(m_webFrame.get())->loader()->committingFirstRealLoad() && willProduceHTMLView;
    1045     if (canSkipCreation) {
    1046         [[v documentView] setDataSource:ds];
    1047         return;
    1048     }
    1049 
    1050     // Don't suppress scrollbars before the view creation if we're making the view for a non-HTML view.
    1051     if (!willProduceHTMLView)
    1052         [[v _scrollView] setScrollBarsSuppressed:NO repaintOnUnsuppress:NO];
     1040    WebView *webView = getWebView(m_webFrame.get());
     1041    WebDataSource *dataSource = [m_webFrame.get() _dataSource];
     1042    bool usesDocumentViews = [webView _usesDocumentViews];
     1043
     1044    if (usesDocumentViews) {
     1045        // FIXME (Viewless): I assume we want the equivalent of this optimization for viewless mode too.
     1046        bool willProduceHTMLView = [[WebFrameView class] _viewClassForMIMEType:[dataSource _responseMIMEType]] == [WebHTMLView class];
     1047        bool canSkipCreation = core(m_webFrame.get())->loader()->committingFirstRealLoad() && willProduceHTMLView;
     1048        if (canSkipCreation) {
     1049            [[m_webFrame->_private->webFrameView documentView] setDataSource:dataSource];
     1050            return;
     1051        }
     1052
     1053        // Don't suppress scrollbars before the view creation if we're making the view for a non-HTML view.
     1054        if (!willProduceHTMLView)
     1055            [[m_webFrame->_private->webFrameView _scrollView] setScrollBarsSuppressed:NO repaintOnUnsuppress:NO];
     1056    }
    10531057   
    10541058    // clean up webkit plugin instances before WebHTMLView gets freed.
    1055     WebView *webView = getWebView(m_webFrame.get());
    10561059    [webView removePluginInstanceViewsFor:(m_webFrame.get())];
    10571060   
    1058     BOOL useDocumentViews = [webView _usesDocumentViews];
    10591061    NSView <WebDocumentView> *documentView = nil;
    1060     if (useDocumentViews) {
    1061         documentView = [v _makeDocumentViewForDataSource:ds];
     1062    if (usesDocumentViews) {
     1063        documentView = [m_webFrame->_private->webFrameView _makeDocumentViewForDataSource:dataSource];
    10621064        if (!documentView)
    10631065            return;
     
    10731075        coreFrame->view()->setParentVisible(false);
    10741076    coreFrame->setView(0);
    1075     FrameView* coreView;
    1076     if (useDocumentViews)
    1077         coreView = new FrameView(coreFrame);
     1077    RefPtr<FrameView> coreView;
     1078    if (usesDocumentViews)
     1079        coreView = FrameView::create(coreFrame);
    10781080    else
    1079         coreView = new FrameView(coreFrame, IntSize([webView bounds].size));
     1081        coreView = FrameView::create(coreFrame, IntSize([webView bounds].size));
    10801082    coreFrame->setView(coreView);
    1081     coreView->deref(); // FIXME: Eliminate this crazy refcounting!
    10821083
    10831084    [m_webFrame.get() _updateBackgroundAndUpdatesWhileOffscreen];
    10841085
    1085     [v _install];
     1086    if (usesDocumentViews)
     1087        [m_webFrame->_private->webFrameView _install];
    10861088
    10871089    if (isMainFrame)
    10881090        coreView->setParentVisible(true);
    10891091
    1090     // Call setDataSource on the document view after it has been placed in the view hierarchy.
    1091     // This what we for the top-level view, so should do this for views in subframes as well.
    1092     [documentView setDataSource:ds];
     1092    if (usesDocumentViews) {
     1093        // Call setDataSource on the document view after it has been placed in the view hierarchy.
     1094        // This what we for the top-level view, so should do this for views in subframes as well.
     1095        [documentView setDataSource:dataSource];
     1096    }
    10931097   
    10941098    if (HTMLFrameOwnerElement* owner = coreFrame->ownerElement())
    10951099        coreFrame->view()->setCanHaveScrollbars(owner->scrollingMode() != ScrollbarAlwaysOff);
    1096    
    10971100}
    10981101
  • trunk/WebKit/mac/WebView/WebDataSource.mm

    r41299 r44379  
    225225   
    226226    [[self representation] receivedData:data withDataSource:self];
    227     [[[[self webFrame] frameView] documentView] dataSourceUpdated:self];
     227
     228    if ([[self _webView] _usesDocumentViews])
     229        [[[[self webFrame] frameView] documentView] dataSourceUpdated:self];
    228230}
    229231
  • trunk/WebKit/mac/WebView/WebFrame.mm

    r43187 r44379  
    319319    Frame* coreFrame = _private->coreFrame;
    320320    for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame)) {
    321         WebFrame *webFrame = kit(frame);
    322         // Don't call setDrawsBackground:YES here because it may be NO because of a load
    323         // in progress; WebFrameLoaderClient keeps it set to NO during the load process.
    324         if (!drawsBackground)
    325             [[[webFrame frameView] _scrollView] setDrawsBackground:NO];
    326         [[[webFrame frameView] _scrollView] setBackgroundColor:backgroundColor];
    327         id documentView = [[webFrame frameView] documentView];
    328         if ([documentView respondsToSelector:@selector(setDrawsBackground:)])
    329             [documentView setDrawsBackground:drawsBackground];
    330         if ([documentView respondsToSelector:@selector(setBackgroundColor:)])
    331             [documentView setBackgroundColor:backgroundColor];
    332         if (frame && frame->view()) {
    333             frame->view()->setTransparent(!drawsBackground);
    334             Color color = colorFromNSColor([backgroundColor colorUsingColorSpaceName:NSDeviceRGBColorSpace]);
    335             frame->view()->setBaseBackgroundColor(color);
    336             frame->view()->setShouldUpdateWhileOffscreen([webView shouldUpdateWhileOffscreen]);
     321        if ([webView _usesDocumentViews]) {
     322            // Don't call setDrawsBackground:YES here because it may be NO because of a load
     323            // in progress; WebFrameLoaderClient keeps it set to NO during the load process.
     324            WebFrame *webFrame = kit(frame);
     325            if (!drawsBackground)
     326                [[[webFrame frameView] _scrollView] setDrawsBackground:NO];
     327            [[[webFrame frameView] _scrollView] setBackgroundColor:backgroundColor];
     328            id documentView = [[webFrame frameView] documentView];
     329            if ([documentView respondsToSelector:@selector(setDrawsBackground:)])
     330                [documentView setDrawsBackground:drawsBackground];
     331            if ([documentView respondsToSelector:@selector(setBackgroundColor:)])
     332                [documentView setBackgroundColor:backgroundColor];
     333        }
     334
     335        if (FrameView* view = frame->view()) {
     336            view->setTransparent(!drawsBackground);
     337            view->setBaseBackgroundColor(colorFromNSColor([backgroundColor colorUsingColorSpaceName:NSDeviceRGBColorSpace]));
     338            view->setShouldUpdateWhileOffscreen([webView shouldUpdateWhileOffscreen]);
    337339        }
    338340    }
     
    371373- (BOOL)_hasSelection
    372374{
    373     id documentView = [_private->webFrameView documentView];   
    374 
    375     // optimization for common case to avoid creating potentially large selection string
    376     if ([documentView isKindOfClass:[WebHTMLView class]])
    377         if (Frame* coreFrame = _private->coreFrame)
    378             return coreFrame->selection()->isRange();
    379 
    380     if ([documentView conformsToProtocol:@protocol(WebDocumentText)])
    381         return [[documentView selectedString] length] > 0;
    382    
    383     return NO;
     375    if ([getWebView(self) _usesDocumentViews]) {
     376        id documentView = [_private->webFrameView documentView];   
     377
     378        // optimization for common case to avoid creating potentially large selection string
     379        if ([documentView isKindOfClass:[WebHTMLView class]])
     380            if (Frame* coreFrame = _private->coreFrame)
     381                return coreFrame->selection()->isRange();
     382
     383        if ([documentView conformsToProtocol:@protocol(WebDocumentText)])
     384            return [[documentView selectedString] length] > 0;
     385       
     386        return NO;
     387    }
     388
     389    Frame* coreFrame = _private->coreFrame;
     390    return coreFrame && coreFrame->selection()->isRange();
    384391}
    385392
    386393- (void)_clearSelection
    387394{
     395    ASSERT([getWebView(self) _usesDocumentViews]);
    388396    id documentView = [_private->webFrameView documentView];   
    389397    if ([documentView conformsToProtocol:@protocol(WebDocumentText)])
     
    911919    if (!view)
    912920        return;
     921    ASSERT([getWebView(self) _usesDocumentViews]);
    913922    // FIXME: These are fake modifier keys here, but they should be real ones instead.
    914923    PlatformMouseEvent event(IntPoint(windowLoc), globalPoint(windowLoc, [view->platformWidget() window]),
     
    924933    if (!view)
    925934        return;
     935    ASSERT([getWebView(self) _usesDocumentViews]);
    926936    // FIXME: These are fake modifier keys here, but they should be real ones instead.
    927937    PlatformMouseEvent event(IntPoint(windowLoc), globalPoint(windowLoc, [view->platformWidget() window]),
     
    11801190- (WebFrameView *)frameView
    11811191{
     1192    ASSERT(!getWebView(self) || [getWebView(self) _usesDocumentViews]);
    11821193    return _private->webFrameView;
    11831194}
  • trunk/WebKit/mac/WebView/WebHTMLView.mm

    r44313 r44379  
    102102#import <WebCore/Page.h>
    103103#import <WebCore/PlatformKeyboardEvent.h>
    104 #import <WebCore/PlatformMouseEvent.h>
    105104#import <WebCore/Range.h>
    106105#import <WebCore/SelectionController.h>
     
    239238@interface NSWindow (WebNSWindowDetails)
    240239- (id)_newFirstResponderAfterResigning;
    241 - (void)_setForceActiveControls:(BOOL)flag;
    242240@end
    243241
     
    14151413    //   4) NSAccessibilityHitTest relies on this for checking the cursor position.
    14161414    //      Our check for that is whether the event is NSFlagsChanged.  This works
    1417     //      for VoiceOver's cntl-opt-f5 command (move focus to item under cursor)
    1418     //      and Dictionary's cmd-cntl-D (open dictionary popup for item under cursor).
     1415    //      for VoiceOver's Control-Option-F5 command (move focus to item under cursor)
     1416    //      and Dictionary's Command-Control-D (open dictionary popup for item under cursor).
    14191417    //      This is of course a hack.
    14201418
     
    15851583        // If we are moving out of a view (or frame), let's pretend the mouse moved
    15861584        // all the way out of that view. But we have to account for scrolling, because
    1587         // khtml doesn't understand our clipping.
     1585        // WebCore doesn't understand our clipping.
    15881586        NSRect visibleRect = [[[[lastHitView _frame] frameView] _scrollView] documentVisibleRect];
    15891587        float yScroll = visibleRect.origin.y;
    15901588        float xScroll = visibleRect.origin.x;
    15911589
    1592         event = [NSEvent mouseEventWithType:NSMouseMoved
    1593                          location:NSMakePoint(-1 - xScroll, -1 - yScroll )
    1594                          modifierFlags:[[NSApp currentEvent] modifierFlags]
    1595                          timestamp:[NSDate timeIntervalSinceReferenceDate]
    1596                          windowNumber:[[view window] windowNumber]
    1597                          context:[[NSApp currentEvent] context]
    1598                          eventNumber:0 clickCount:0 pressure:0];
     1590        NSEvent *event = [NSEvent mouseEventWithType:NSMouseMoved
     1591            location:NSMakePoint(-1 - xScroll, -1 - yScroll)
     1592            modifierFlags:[[NSApp currentEvent] modifierFlags]
     1593            timestamp:[NSDate timeIntervalSinceReferenceDate]
     1594            windowNumber:[[view window] windowNumber]
     1595            context:[[NSApp currentEvent] context]
     1596            eventNumber:0 clickCount:0 pressure:0];
    15991597        if (Frame* lastHitCoreFrame = core([lastHitView _frame]))
    16001598            lastHitCoreFrame->eventHandler()->mouseMoved(event);
     
    17701768}
    17711769
    1772 - (void)_startAutoscrollTimer: (NSEvent *)triggerEvent
     1770- (void)_startAutoscrollTimer:(NSEvent *)triggerEvent
    17731771{
    17741772    if (_private->autoscrollTimer == nil) {
     
    30773075    page->contextMenuController()->clearContextMenu();
    30783076    coreFrame->eventHandler()->mouseDown(event);
    3079     BOOL handledEvent = coreFrame->eventHandler()->sendContextMenuEvent(PlatformMouseEvent(event));
     3077    BOOL handledEvent = coreFrame->eventHandler()->sendContextMenuEvent(event);
    30803078    _private->handlingMouseDownEvent = NO;
    30813079
     
    33693367    if (hitHTMLView) {
    33703368        bool result = false;
    3371         if ([hitHTMLView _isSelectionEvent:event])
     3369        if ([hitHTMLView _isSelectionEvent:event]) {
    33723370            if (Frame* coreFrame = core([hitHTMLView _frame])) {
    33733371                [hitHTMLView _setMouseDownEvent:event];
     
    33753373                [hitHTMLView _setMouseDownEvent:nil];
    33763374            }
     3375        }
    33773376        return result;
    33783377    }
  • trunk/WebKit/mac/WebView/WebUIDelegatePrivate.h

    r43639 r44379  
    127127- (BOOL)webView:(WebView *)sender frame:(WebFrame *)frame requestGeolocationPermission:(WebGeolocation *)geolocation securityOrigin:(WebSecurityOrigin *)origin;
    128128
     129/*!
     130    @method webView:printFrame:
     131    @abstract Informs that a WebFrame needs to be printed
     132    @param webView The WebView sending the delegate method
     133    @param frameView The WebFrame needing to be printed
     134    @discussion This method is called when a script or user requests the page to be printed.
     135*/
     136- (void)webView:(WebView *)sender printFrame:(WebFrame *)frame;
     137
    129138@end
  • trunk/WebKit/mac/WebView/WebView.mm

    r44181 r44379  
    8888#import "WebScriptDebugDelegate.h"
    8989#import "WebSystemInterface.h"
     90#import "WebTextCompletionController.h"
    9091#import "WebTextIterator.h"
    9192#import "WebUIDelegate.h"
     
    153154#import <WebKit/WebDashboardRegion.h>
    154155#endif
     156
     157@class NSTextInputContext;
     158
     159@interface NSResponder (WebNSResponderDetails)
     160- (NSTextInputContext *)inputContext;
     161@end
     162
     163@interface NSSpellChecker (WebNSSpellCheckerDetails)
     164- (void)_preflightChosenSpellServer;
     165@end
     166
     167@interface NSView (WebNSViewDetails)
     168- (NSView *)_hitTest:(NSPoint *)aPoint dragTypes:(NSSet *)types;
     169- (void)_autoscrollForDraggingInfo:(id)dragInfo timeDelta:(NSTimeInterval)repeatDelta;
     170- (BOOL)_shouldAutoscrollForDraggingInfo:(id)dragInfo;
     171@end
     172
     173@interface NSWindow (WebNSWindowDetails)
     174- (id)_oldFirstResponderBeforeBecoming;
     175@end
    155176
    156177using namespace WebCore;
     
    303324#endif           
    304325
    305 
    306326static BOOL s_didSetCacheModel;
    307327static WebCacheModel s_cacheModel = WebCacheModelDocumentViewer;
     
    309329static BOOL applicationIsTerminating;
    310330static int pluginDatabaseClientCount = 0;
     331
     332static WebView *lastMouseoverView;
    311333
    312334#ifndef NDEBUG
     
    314336#endif
    315337
    316 @interface NSSpellChecker (AppKitSecretsIKnow)
    317 - (void)_preflightChosenSpellServer;
    318 @end
    319 
    320 @interface NSView (AppKitSecretsIKnow)
    321 - (NSView *)_hitTest:(NSPoint *)aPoint dragTypes:(NSSet *)types;
    322 - (void)_autoscrollForDraggingInfo:(id)dragInfo timeDelta:(NSTimeInterval)repeatDelta;
    323 - (BOOL)_shouldAutoscrollForDraggingInfo:(id)dragInfo;
    324 @end
    325 
    326 @interface NSWindow (AppKitSecretsIKnow)
    327 - (id)_oldFirstResponderBeforeBecoming;
    328 @end
    329 
    330 @interface NSObject (ValidateWithoutDelegate)
     338@interface NSObject (WebValidateWithoutDelegate)
    331339- (BOOL)validateUserInterfaceItemWithoutDelegate:(id <NSValidatedUserInterfaceItem>)item;
    332340@end
     
    422430   
    423431    // When this flag is set, we will not make any subviews underneath this WebView.  This means no WebFrameViews and no WebHTMLViews.
    424     BOOL useDocumentViews;
     432    BOOL usesDocumentViews;
    425433   
    426434#if USE(ACCELERATED_COMPOSITING)
     
    437445           
    438446    NSSize lastLayoutSize;
     447
     448    BOOL ignoringMouseDraggedEvents;
     449
     450    NSEvent *mouseDownEvent; // Kept after handling the event.
     451    BOOL handlingMouseDownEvent;
     452    NSEvent *keyDownEvent; // Kept after handling the event.
     453
     454    WebTextCompletionController *completionController;
     455
     456    NSTimer *autoscrollTimer;
     457    NSEvent *autoscrollTriggerEvent;
     458
     459    CFRunLoopTimerRef updateMouseoverTimer;
    439460}
    440461@end
     
    754775- (BOOL)_usesDocumentViews
    755776{
    756     return _private->useDocumentViews;
     777    return _private->usesDocumentViews;
    757778}
    758779
     
    773794    _private->drawsBackground = YES;
    774795    _private->backgroundColor = [[NSColor colorWithDeviceWhite:1 alpha:1] retain];
    775     _private->useDocumentViews = usesDocumentViews;
     796    _private->usesDocumentViews = usesDocumentViews;
    776797
    777798    WebFrameView *frameView = nil;
    778     if (_private->useDocumentViews) {
     799    if (_private->usesDocumentViews) {
    779800        NSRect f = [self frame];
    780801        frameView = [[WebFrameView alloc] initWithFrame: NSMakeRect(0,0,f.size.width,f.size.height)];
     
    900921- (void)drawSingleRect:(NSRect)rect
    901922{
    902     ASSERT(!_private->useDocumentViews);
     923    ASSERT(!_private->usesDocumentViews);
    903924   
    904925    [NSGraphicsContext saveGraphicsState];
     
    924945- (BOOL)isFlipped
    925946{
    926     return _private && !_private->useDocumentViews;
     947    return _private && !_private->usesDocumentViews;
    927948}
    928949
     
    930951{
    931952    if (!NSEqualSizes(_private->lastLayoutSize, size)) {
    932         Frame* frame = core([self mainFrame]);
     953        Frame* frame = [self _mainCoreFrame];
    933954        // FIXME: Viewless WebKit is broken with Safari banners (e.g., the Find banner).  We'll have to figure out a way for
    934955        // Safari to communicate that this space is being consumed.  For WebKit with document views, there's no
    935956        // need to do an explicit resize, since WebFrameViews have auto resizing turned on and will handle changing
    936957        // their bounds automatically. See <rdar://problem/6835573> for details.
    937         if (!_private->useDocumentViews)
     958        if (!_private->usesDocumentViews)
    938959            frame->view()->resize(IntSize(size));
    939960        frame->view()->setNeedsLayout();
     
    946967
    947968#if USE(ACCELERATED_COMPOSITING) || !defined(BUILDING_ON_TIGER)
     969
    948970- (void)_viewWillDrawInternal
    949971{
    950     Frame* frame = core([self mainFrame]);
     972    Frame* frame = [self _mainCoreFrame];
    951973    if (frame && frame->view())
    952974        frame->view()->layoutIfNeededRecursive();
    953975}
     976
    954977#endif
    955978
     
    958981- (void)viewWillDraw
    959982{
    960     if (!_private->useDocumentViews)
     983    if (!_private->usesDocumentViews)
    961984        [self _viewWillDrawInternal];
    962985    [super viewWillDraw];
     
    968991- (void)drawRect:(NSRect)rect
    969992{
    970     if (_private->useDocumentViews)
     993    if (_private->usesDocumentViews)
    971994        return [super drawRect:rect];
    972995   
     
    11601183        return;
    11611184
     1185    if (lastMouseoverView == self)
     1186        lastMouseoverView = nil;
     1187
    11621188#ifndef NDEBUG
    11631189    WTF::RefCountedLeakCounter::cancelMessageSuppression(webViewIsOpen);
     
    11711197    }
    11721198
    1173     if (Frame* mainFrame = core([self mainFrame]))
     1199    if (Frame* mainFrame = [self _mainCoreFrame])
    11741200        mainFrame->loader()->detachFromParent();
    11751201
     
    19311957{
    19321958    // Only return regions from main frame.
    1933     Frame* mainFrame = core([self mainFrame]);
     1959    Frame* mainFrame = [self _mainCoreFrame];
    19341960    if (!mainFrame)
    19351961        return nil;
     
    20512077- (void)setProhibitsMainFrameScrolling:(BOOL)prohibits
    20522078{
    2053     Frame* mainFrame = core([self mainFrame]);
    2054     if (mainFrame)
     2079    if (Frame* mainFrame = [self _mainCoreFrame])
    20552080        mainFrame->view()->setProhibitsScrolling(prohibits);
    20562081}
     
    20642089- (void)_setInViewSourceMode:(BOOL)flag
    20652090{
    2066     Frame* mainFrame = core([self mainFrame]);
    2067     if (mainFrame)
     2091    if (Frame* mainFrame = [self _mainCoreFrame])
    20682092        mainFrame->setInViewSourceMode(flag);
    20692093}
     
    20712095- (BOOL)_inViewSourceMode
    20722096{
    2073     Frame* mainFrame = core([self mainFrame]);
     2097    Frame* mainFrame = [self _mainCoreFrame];
    20742098    return mainFrame && mainFrame->inViewSourceMode();
    20752099}
     
    21142138- (void)_attachScriptDebuggerToAllFrames
    21152139{
    2116     for (Frame* frame = core([self mainFrame]); frame; frame = frame->tree()->traverseNext())
     2140    for (Frame* frame = [self _mainCoreFrame]; frame; frame = frame->tree()->traverseNext())
    21172141        [kit(frame) _attachScriptDebugger];
    21182142}
     
    21202144- (void)_detachScriptDebuggerFromAllFrames
    21212145{
    2122     for (Frame* frame = core([self mainFrame]); frame; frame = frame->tree()->traverseNext())
     2146    for (Frame* frame = [self _mainCoreFrame]; frame; frame = frame->tree()->traverseNext())
    21232147        [kit(frame) _detachScriptDebugger];
    21242148}
     
    21832207    IntPoint rectEnd(rect.origin.x + rect.size.width, rect.origin.y + rect.size.height);
    21842208   
    2185     Frame* coreFrame = core([self mainFrame]);
     2209    Frame* coreFrame = [self _mainCoreFrame];
    21862210    if (!coreFrame)
    21872211        return nil;
     
    22172241- (void)_executeCoreCommandByName:(NSString *)name value:(NSString *)value
    22182242{
    2219     Frame* coreFrame = core([self mainFrame]);
     2243    Frame* coreFrame = [self _mainCoreFrame];
    22202244    if (!coreFrame)
    22212245        return;
     
    22732297    return handCursor().impl();
    22742298}
    2275 
    2276 #if USE(ACCELERATED_COMPOSITING)
    2277 
    2278 - (BOOL)_needsOneShotDrawingSynchronization
    2279 {
    2280     return _private->needsOneShotDrawingSynchronization;
    2281 }
    2282 
    2283 - (void)_setNeedsOneShotDrawingSynchronization:(BOOL)needsSynchronization
    2284 {
    2285     _private->needsOneShotDrawingSynchronization = needsSynchronization;
    2286 }
    2287 
    2288 - (void)_startedAcceleratedCompositingForFrame:(WebFrame*)webFrame
    2289 {
    2290     BOOL entering = _private->acceleratedFramesCount == 0;
    2291     if (entering)
    2292         [self willChangeValueForKey:UsingAcceleratedCompositingProperty];
    2293     ++_private->acceleratedFramesCount;
    2294     if (entering)
    2295         [self didChangeValueForKey:UsingAcceleratedCompositingProperty];
    2296 }
    2297 
    2298 - (void)_stoppedAcceleratedCompositingForFrame:(WebFrame*)webFrame
    2299 {
    2300     BOOL leaving = _private->acceleratedFramesCount == 1;
    2301     ASSERT(_private->acceleratedFramesCount > 0);
    2302    
    2303     if (leaving)
    2304         [self willChangeValueForKey:UsingAcceleratedCompositingProperty];
    2305     --_private->acceleratedFramesCount;
    2306     if (leaving)
    2307         [self didChangeValueForKey:UsingAcceleratedCompositingProperty];
    2308 }
    2309 
    2310 #endif   
    23112299
    23122300- (BOOL)_isUsingAcceleratedCompositing
     
    27142702- (void)addWindowObserversForWindow:(NSWindow *)window
    27152703{
    2716     if (!_private->useDocumentViews && window) {
     2704    if (!_private->usesDocumentViews && window) {
    27172705        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidBecomeKey:)
    27182706            name:NSWindowDidBecomeKeyNotification object:nil];
     
    27272715{
    27282716    NSWindow *window = [self window];
    2729     if (!_private->useDocumentViews && window) {
     2717    if (!_private->usesDocumentViews && window) {
    27302718        [[NSNotificationCenter defaultCenter] removeObserver:self
    27312719            name:NSWindowDidBecomeKeyNotification object:nil];
     
    27802768- (void)_updateFocusedAndActiveState
    27812769{
    2782     ASSERT(!_private->useDocumentViews);
     2770    ASSERT(!_private->usesDocumentViews);
    27832771    [self _updateFocusedAndActiveStateForFrame:[self mainFrame]];
    27842772}
     
    27902778        return;
    27912779   
    2792     Page* page = frame->page();
    2793     if (!page)
    2794         return;
    2795 
    27962780    NSWindow *window = [self window];
    27972781    BOOL windowIsKey = [window isKeyWindow];
     2782
     2783    NSView *contentView = _private->usesDocumentViews ? (NSView *)[[self mainFrame] frameView] : self;
     2784    NSResponder *firstResponder = [window firstResponder];
     2785    if ([firstResponder isKindOfClass:[NSView class]] && [(NSView *)firstResponder isDescendantOf:contentView]) {
     2786        BOOL documentViewIsResigningFirstResponder;
     2787        if (!_private->usesDocumentViews) {
     2788            // FIXME: WebView probably needs a "resigning first responder" state just as WebHTMLView has.
     2789            documentViewIsResigningFirstResponder = NO;
     2790        } else {
     2791            id <WebDocumentView> documentView = [[[self mainFrame] frameView] documentView];
     2792            documentViewIsResigningFirstResponder = [documentView isKindOfClass:[WebHTMLView class]] && [(WebHTMLView *)documentView _isResigningFirstResponder];
     2793        }
     2794        _private->page->focusController()->setActive(windowIsKey && !documentViewIsResigningFirstResponder);
     2795    }
     2796
    27982797    BOOL windowOrSheetIsKey = windowIsKey || [[window attachedSheet] isKeyWindow];
    2799 
    2800     WebFrameView *mainFrameView = [[self mainFrame] frameView];
    2801     id <WebDocumentView> documentView = [mainFrameView documentView];
    2802     BOOL documentViewIsResigningFirstResponder = [documentView isKindOfClass:[WebHTMLView class]] && [(WebHTMLView *)documentView _isResigningFirstResponder];
    2803        
    2804     NSResponder *firstResponder = [window firstResponder];
    2805     if ([firstResponder isKindOfClass:[NSView class]]
    2806         && [(NSView *)firstResponder isDescendantOf:mainFrameView])
    2807         page->focusController()->setActive(windowIsKey && !documentViewIsResigningFirstResponder);
    2808 
    2809     Frame* focusedFrame = page->focusController()->focusedOrMainFrame();
    2810     frame->selection()->setFocused(frame == focusedFrame && windowOrSheetIsKey);
     2798    frame->selection()->setFocused(frame == _private->page->focusController()->focusedOrMainFrame() && windowOrSheetIsKey);
    28112799}
    28122800
    28132801- (void)_windowDidBecomeKey:(NSNotification *)notification
    28142802{
    2815     ASSERT(!_private->useDocumentViews);
     2803    ASSERT(!_private->usesDocumentViews);
    28162804    NSWindow *keyWindow = [notification object];
    28172805    if (keyWindow == [self window] || keyWindow == [[self window] attachedSheet])
     
    28212809- (void)_windowDidResignKey:(NSNotification *)notification
    28222810{
    2823     ASSERT(!_private->useDocumentViews);
     2811    ASSERT(!_private->usesDocumentViews);
    28242812    NSWindow *formerKeyWindow = [notification object];
    28252813    if (formerKeyWindow == [self window] || formerKeyWindow == [[self window] attachedSheet])
     
    28292817- (void)_windowWillOrderOnScreen:(NSNotification *)notification
    28302818{
    2831     ASSERT(!_private->useDocumentViews);
     2819    ASSERT(!_private->usesDocumentViews);
    28322820    if (![self shouldUpdateWhileOffscreen])
    28332821        [self setNeedsDisplay:YES];
     
    29502938{
    29512939    // This can be called in initialization, before _private has been set up (3465613)
    2952     if (!_private)
    2953         return nil;
    2954     if (!_private->page)
     2940    if (!_private || !_private->page)
    29552941        return nil;
    29562942    return kit(_private->page->mainFrame());
     
    29592945- (WebFrame *)selectedFrame
    29602946{
    2961     // If the first responder is a view in our tree, we get the frame containing the first responder.
    2962     // This is faster than searching the frame hierarchy, and will give us a result even in the case
    2963     // where the focused frame doesn't actually contain a selection.
    2964     WebFrame *focusedFrame = [self _focusedFrame];
    2965     if (focusedFrame)
    2966         return focusedFrame;
     2947    if (_private->usesDocumentViews) {
     2948        // If the first responder is a view in our tree, we get the frame containing the first responder.
     2949        // This is faster than searching the frame hierarchy, and will give us a result even in the case
     2950        // where the focused frame doesn't actually contain a selection.
     2951        WebFrame *focusedFrame = [self _focusedFrame];
     2952        if (focusedFrame)
     2953            return focusedFrame;
     2954    }
    29672955   
    29682956    // If the first responder is outside of our view tree, we search for a frame containing a selection.
     
    29802968}
    29812969
    2982 - (void)setMaintainsBackForwardList: (BOOL)flag
     2970- (void)setMaintainsBackForwardList:(BOOL)flag
    29832971{
    29842972    if (!_private->page)
     
    30323020    // FIXME: it would be nice to rework this code so that _private->zoomMultiplier doesn't exist and callers
    30333021    // all access _private->page->settings().
    3034     Frame* coreFrame = core([self mainFrame]);
     3022    Frame* coreFrame = [self _mainCoreFrame];
    30353023    if (coreFrame)
    30363024        coreFrame->setZoomFactor(m, isTextOnly);
     
    31793167    if (encoding == oldEncoding || [encoding isEqualToString:oldEncoding])
    31803168        return;
    3181     if (Frame* mainFrame = core([self mainFrame]))
     3169    if (Frame* mainFrame = [self _mainCoreFrame])
    31823170        mainFrame->loader()->reloadWithOverrideEncoding(encoding);
    31833171}
     
    32203208- (WebScriptObject *)windowScriptObject
    32213209{
    3222     Frame* coreFrame = core([self mainFrame]);
     3210    Frame* coreFrame = [self _mainCoreFrame];
    32233211    if (!coreFrame)
    32243212        return nil;
     
    32393227        return;
    32403228
    3241     Frame* coreFrame = core([self mainFrame]);
    3242     for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
    3243         [[[kit(frame) frameView] documentView] viewWillMoveToHostWindow:hostWindow];
     3229    Frame* coreFrame = [self _mainCoreFrame];
     3230    if (_private->usesDocumentViews) {
     3231        for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
     3232            [[[kit(frame) frameView] documentView] viewWillMoveToHostWindow:hostWindow];
     3233    }
    32443234    if (_private->hostWindow && [self window] != _private->hostWindow)
    32453235        [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowWillCloseNotification object:_private->hostWindow];
     
    32483238    [_private->hostWindow release];
    32493239    _private->hostWindow = [hostWindow retain];
    3250     for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
    3251         [[[kit(frame) frameView] documentView] viewDidMoveToHostWindow];
     3240    if (_private->usesDocumentViews) {
     3241        for (Frame* frame = coreFrame; frame; frame = frame->tree()->traverseNext(coreFrame))
     3242            [[[kit(frame) frameView] documentView] viewDidMoveToHostWindow];
     3243    }
    32523244}
    32533245
     
    32853277}
    32863278
    3287 // The following 2 internal NSView methods are called on the drag destination by make scrolling while dragging work.
     3279// The following 2 internal NSView methods are called on the drag destination to make scrolling while dragging work.
    32883280// Scrolling while dragging will only work if the drag destination is in a scroll view. The WebView is the drag destination.
    32893281// When dragging to a WebView, the document subview should scroll, but it doesn't because it is not the drag destination.
     
    33543346}
    33553347
    3356 - (NSView *)_hitTest:(NSPoint *)aPoint dragTypes:(NSSet *)types
    3357 {
    3358     NSView *hitView = [super _hitTest:aPoint dragTypes:types];
    3359     if (!hitView && [[self superview] mouse:*aPoint inRect:[self frame]]) {
     3348- (NSView *)_hitTest:(NSPoint *)point dragTypes:(NSSet *)types
     3349{
     3350    NSView *hitView = [super _hitTest:point dragTypes:types];
     3351    if (!hitView && [[self superview] mouse:*point inRect:[self frame]])
    33603352        return self;
    3361     } else {
    3362         return hitView;
    3363     }
     3353    return hitView;
    33643354}
    33653355
    33663356- (BOOL)acceptsFirstResponder
    33673357{
    3368     return [[[self mainFrame] frameView] acceptsFirstResponder];
     3358    if (_private->usesDocumentViews)
     3359        return [[[self mainFrame] frameView] acceptsFirstResponder];
     3360
     3361    // FIXME (Viewless): Need more code from WebHTMLView here.
     3362    return YES;
    33693363}
    33703364
    33713365- (BOOL)becomeFirstResponder
    33723366{
    3373     if (_private->becomingFirstResponder) {
    3374         // Fix for unrepro infinite recursion reported in radar 4448181. If we hit this assert on
    3375         // a debug build, we should figure out what causes the problem and do a better fix.
    3376         ASSERT_NOT_REACHED();
    3377         return NO;
    3378     }
    3379    
    3380     // This works together with setNextKeyView to splice the WebView into
    3381     // the key loop similar to the way NSScrollView does this. Note that
    3382     // WebFrameView has very similar code.
    3383     NSWindow *window = [self window];
    3384     WebFrameView *mainFrameView = [[self mainFrame] frameView];
    3385 
    3386     NSResponder *previousFirstResponder = [[self window] _oldFirstResponderBeforeBecoming];
    3387     BOOL fromOutside = ![previousFirstResponder isKindOfClass:[NSView class]] || (![(NSView *)previousFirstResponder isDescendantOf:self] && previousFirstResponder != self);
    3388    
    3389     if ([window keyViewSelectionDirection] == NSSelectingPrevious) {
    3390         NSView *previousValidKeyView = [self previousValidKeyView];
    3391         if ((previousValidKeyView != self) && (previousValidKeyView != mainFrameView)) {
     3367    if (_private->usesDocumentViews) {
     3368        if (_private->becomingFirstResponder) {
     3369            // Fix for unrepro infinite recursion reported in Radar 4448181. If we hit this assert on
     3370            // a debug build, we should figure out what causes the problem and do a better fix.
     3371            ASSERT_NOT_REACHED();
     3372            return NO;
     3373        }
     3374       
     3375        // This works together with setNextKeyView to splice the WebView into
     3376        // the key loop similar to the way NSScrollView does this. Note that
     3377        // WebFrameView has very similar code.
     3378        NSWindow *window = [self window];
     3379        WebFrameView *mainFrameView = [[self mainFrame] frameView];
     3380
     3381        NSResponder *previousFirstResponder = [[self window] _oldFirstResponderBeforeBecoming];
     3382        BOOL fromOutside = ![previousFirstResponder isKindOfClass:[NSView class]] || (![(NSView *)previousFirstResponder isDescendantOf:self] && previousFirstResponder != self);
     3383
     3384        if ([window keyViewSelectionDirection] == NSSelectingPrevious) {
     3385            NSView *previousValidKeyView = [self previousValidKeyView];
     3386            if (previousValidKeyView != self && previousValidKeyView != mainFrameView) {
     3387                _private->becomingFirstResponder = YES;
     3388                _private->becomingFirstResponderFromOutside = fromOutside;
     3389                [window makeFirstResponder:previousValidKeyView];
     3390                _private->becomingFirstResponderFromOutside = NO;
     3391                _private->becomingFirstResponder = NO;
     3392                return YES;
     3393            }
     3394            return NO;
     3395        }
     3396
     3397        if ([mainFrameView acceptsFirstResponder]) {
    33923398            _private->becomingFirstResponder = YES;
    33933399            _private->becomingFirstResponderFromOutside = fromOutside;
    3394             [window makeFirstResponder:previousValidKeyView];
     3400            [window makeFirstResponder:mainFrameView];
    33953401            _private->becomingFirstResponderFromOutside = NO;
    33963402            _private->becomingFirstResponder = NO;
    33973403            return YES;
    3398         } else {
    3399             return NO;
     3404        }
     3405
     3406        return NO;
     3407    }
     3408
     3409    // FIXME (Viewless): Need more code from WebHTMLView here.
     3410    return YES;
     3411}
     3412
     3413- (NSView *)_webcore_effectiveFirstResponder
     3414{
     3415    if (_private && _private->usesDocumentViews) {
     3416        if (WebFrameView *frameView = [[self mainFrame] frameView])
     3417            return [frameView _webcore_effectiveFirstResponder];
     3418    }
     3419    return [super _webcore_effectiveFirstResponder];
     3420}
     3421
     3422- (void)setNextKeyView:(NSView *)view
     3423{
     3424    if (_private && _private->usesDocumentViews) {
     3425        // This works together with becomeFirstResponder to splice the WebView into
     3426        // the key loop similar to the way NSScrollView does this. Note that
     3427        // WebFrameView has similar code.
     3428        if (WebFrameView *mainFrameView = [[self mainFrame] frameView]) {
     3429            [mainFrameView setNextKeyView:view];
     3430            return;
    34003431        }
    34013432    }
    3402    
    3403     if ([mainFrameView acceptsFirstResponder]) {
    3404         _private->becomingFirstResponder = YES;
    3405         _private->becomingFirstResponderFromOutside = fromOutside;
    3406         [window makeFirstResponder:mainFrameView];
    3407         _private->becomingFirstResponderFromOutside = NO;
    3408         _private->becomingFirstResponder = NO;
    3409         return YES;
    3410     }
    3411    
    3412     return NO;
    3413 }
    3414 
    3415 - (NSView *)_webcore_effectiveFirstResponder
    3416 {
    3417     WebFrameView *frameView = [[self mainFrame] frameView];
    3418     return frameView ? [frameView _webcore_effectiveFirstResponder] : [super _webcore_effectiveFirstResponder];
    3419 }
    3420 
    3421 - (void)setNextKeyView:(NSView *)aView
    3422 {
    3423     // This works together with becomeFirstResponder to splice the WebView into
    3424     // the key loop similar to the way NSScrollView does this. Note that
    3425     // WebFrameView has very similar code.
    3426     WebFrameView *mainFrameView = [[self mainFrame] frameView];
    3427     if (mainFrameView != nil) {
    3428         [mainFrameView setNextKeyView:aView];
    3429     } else {
    3430         [super setNextKeyView:aView];
    3431     }
    3432 }
    3433 
    3434 static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
    3435 {
    3436     Frame* coreFrame = core(curr);
     3433
     3434    [super setNextKeyView:view];
     3435}
     3436
     3437static WebFrame *incrementFrame(WebFrame *frame, BOOL forward, BOOL wrapFlag)
     3438{
     3439    Frame* coreFrame = core(frame);
    34373440    return kit(forward
    34383441        ? coreFrame->tree()->traverseNextWithWrap(wrapFlag)
     
    34753478    if (!_private->page)
    34763479        return 0.0;
    3477 
    34783480    return _private->page->progress()->estimatedProgress();
    34793481}
     
    36413643    } while ([result isDescendantOf:previousView]);
    36423644    return [previousView previousValidKeyView];
     3645}
     3646
     3647- (void)mouseDown:(NSEvent *)event
     3648{
     3649    // FIXME (Viewless): This method should be shared with WebHTMLView, which needs to
     3650    // do the same work in the usesDocumentViews case. We don't want to maintain two
     3651    // duplicate copies of this method.
     3652
     3653    if (_private->usesDocumentViews) {
     3654        [super mouseDown:event];
     3655        return;
     3656    }
     3657   
     3658    // There's a chance that responding to this event will run a nested event loop, and
     3659    // fetching a new event might release the old one. Retaining and then autoreleasing
     3660    // the current event prevents that from causing a problem inside WebKit or AppKit code.
     3661    [[event retain] autorelease];
     3662
     3663    RetainPtr<WebView> protector = self;
     3664    if ([[self inputContext] wantsToHandleMouseEvents] && [[self inputContext] handleMouseEvent:event])
     3665        return;
     3666
     3667    _private->handlingMouseDownEvent = YES;
     3668
     3669    // Record the mouse down position so we can determine drag hysteresis.
     3670    [self _setMouseDownEvent:event];
     3671
     3672    NSInputManager *currentInputManager = [NSInputManager currentInputManager];
     3673    if ([currentInputManager wantsToHandleMouseEvents] && [currentInputManager handleMouseEvent:event])
     3674        goto done;
     3675
     3676    [_private->completionController endRevertingChange:NO moveLeft:NO];
     3677
     3678    // If the web page handles the context menu event and menuForEvent: returns nil, we'll get control click events here.
     3679    // We don't want to pass them along to KHTML a second time.
     3680    if (!([event modifierFlags] & NSControlKeyMask)) {
     3681        _private->ignoringMouseDraggedEvents = NO;
     3682
     3683        // Don't do any mouseover while the mouse is down.
     3684        [self _cancelUpdateMouseoverTimer];
     3685
     3686        // Let WebCore get a chance to deal with the event. This will call back to us
     3687        // to start the autoscroll timer if appropriate.
     3688        if (Frame* frame = [self _mainCoreFrame])
     3689            frame->eventHandler()->mouseDown(event);
     3690    }
     3691
     3692done:
     3693    _private->handlingMouseDownEvent = NO;
     3694}
     3695
     3696- (void)mouseUp:(NSEvent *)event
     3697{
     3698    // FIXME (Viewless): This method should be shared with WebHTMLView, which needs to
     3699    // do the same work in the usesDocumentViews case. We don't want to maintain two
     3700    // duplicate copies of this method.
     3701
     3702    if (_private->usesDocumentViews) {
     3703        [super mouseUp:event];
     3704        return;
     3705    }
     3706
     3707    // There's a chance that responding to this event will run a nested event loop, and
     3708    // fetching a new event might release the old one. Retaining and then autoreleasing
     3709    // the current event prevents that from causing a problem inside WebKit or AppKit code.
     3710    [[event retain] autorelease];
     3711
     3712    [self _setMouseDownEvent:nil];
     3713
     3714    NSInputManager *currentInputManager = [NSInputManager currentInputManager];
     3715    if ([currentInputManager wantsToHandleMouseEvents] && [currentInputManager handleMouseEvent:event])
     3716        return;
     3717
     3718    [self retain];
     3719
     3720    [self _stopAutoscrollTimer];
     3721    if (Frame* frame = [self _mainCoreFrame])
     3722        frame->eventHandler()->mouseUp(event);
     3723    [self _updateMouseoverWithFakeEvent];
     3724
     3725    [self release];
    36433726}
    36443727
     
    39374020   
    39384021    _private->hoverFeedbackSuspended = newValue;
    3939     id <WebDocumentView> documentView = [[[self mainFrame] frameView] documentView];
    3940     // FIXME: in a perfect world we'd do this in a general way that worked with any document view,
    3941     // such as by calling a protocol method or using respondsToSelector or sending a notification.
    3942     // But until there is any need for these more general solutions, we'll just hardwire it to work
    3943     // with WebHTMLView.
    3944     // Note that _hoverFeedbackSuspendedChanged needs to be called only on the main WebHTMLView, not
    3945     // on each subframe separately.
    3946     if ([documentView isKindOfClass:[WebHTMLView class]])
    3947         [(WebHTMLView *)documentView _hoverFeedbackSuspendedChanged];
     4022
     4023    if (_private->usesDocumentViews) {
     4024        id <WebDocumentView> documentView = [[[self mainFrame] frameView] documentView];
     4025        // FIXME: in a perfect world we'd do this in a general way that worked with any document view,
     4026        // such as by calling a protocol method or using respondsToSelector or sending a notification.
     4027        // But until there is any need for these more general solutions, we'll just hardwire it to work
     4028        // with WebHTMLView.
     4029        // Note that _hoverFeedbackSuspendedChanged needs to be called only on the main WebHTMLView, not
     4030        // on each subframe separately.
     4031        if ([documentView isKindOfClass:[WebHTMLView class]])
     4032            [(WebHTMLView *)documentView _hoverFeedbackSuspendedChanged];
     4033        return;
     4034    }
     4035
     4036    [self _updateMouseoverWithFakeEvent];
    39484037}
    39494038
     
    40034092- (BOOL)shouldClose
    40044093{
    4005     Frame* coreFrame = core([self mainFrame]);
     4094    Frame* coreFrame = [self _mainCoreFrame];
    40064095    if (!coreFrame)
    40074096        return YES;
     
    40664155- (NSAppleEventDescriptor *)aeDescByEvaluatingJavaScriptFromString:(NSString *)script
    40674156{
    4068     Frame* coreFrame = core([self mainFrame]);
     4157    Frame* coreFrame = [self _mainCoreFrame];
    40694158    if (!coreFrame)
    40704159        return nil;
     
    44414530        if (!_private->tabKeyCyclesThroughElementsChanged && _private->page)
    44424531            _private->page->setTabKeyCyclesThroughElements(!flag);
    4443         Frame* mainFrame = core([self mainFrame]);
     4532        Frame* mainFrame = [self _mainCoreFrame];
    44444533        if (mainFrame) {
    44454534            if (flag) {
     
    51185207    if (_private->closed)
    51195208        return nil;
     5209    ASSERT(_private->usesDocumentViews);
    51205210    NSView *view = [self hitTest:[[self superview] convertPoint:point fromView:nil]];
    51215211    if (![view isDescendantOf:[[self mainFrame] frameView]])
     
    53625452    _private->insertionPasteboard = pasteboard;
    53635453}
     5454
     5455- (void)_setMouseDownEvent:(NSEvent *)event
     5456{
     5457    ASSERT(!event || [event type] == NSLeftMouseDown || [event type] == NSRightMouseDown || [event type] == NSOtherMouseDown);
     5458
     5459    if (event == _private->mouseDownEvent)
     5460        return;
     5461
     5462    [event retain];
     5463    [_private->mouseDownEvent release];
     5464    _private->mouseDownEvent = event;
     5465}
     5466
     5467- (void)_cancelUpdateMouseoverTimer
     5468{
     5469    if (_private->updateMouseoverTimer) {
     5470        CFRunLoopTimerInvalidate(_private->updateMouseoverTimer);
     5471        CFRelease(_private->updateMouseoverTimer);
     5472        _private->updateMouseoverTimer = NULL;
     5473    }
     5474}
     5475
     5476- (void)_stopAutoscrollTimer
     5477{
     5478    NSTimer *timer = _private->autoscrollTimer;
     5479    _private->autoscrollTimer = nil;
     5480    [_private->autoscrollTriggerEvent release];
     5481    _private->autoscrollTriggerEvent = nil;
     5482    [timer invalidate];
     5483    [timer release];
     5484}
     5485
     5486+ (void)_updateMouseoverWithEvent:(NSEvent *)event
     5487{
     5488    WebView *oldView = lastMouseoverView;
     5489
     5490    lastMouseoverView = nil;
     5491
     5492    NSView *contentView = [[event window] contentView];
     5493    NSPoint locationForHitTest = [[contentView superview] convertPoint:[event locationInWindow] fromView:nil];
     5494    for (NSView *hitView = [contentView hitTest:locationForHitTest]; hitView; hitView = [hitView superview]) {
     5495        if ([hitView isKindOfClass:[WebView class]]) {
     5496            lastMouseoverView = static_cast<WebView *>(hitView);
     5497            break;
     5498        }
     5499    }
     5500
     5501    if (lastMouseoverView && lastMouseoverView->_private->hoverFeedbackSuspended)
     5502        lastMouseoverView = nil;
     5503
     5504    if (lastMouseoverView != oldView) {
     5505        if (Frame* oldCoreFrame = [oldView _mainCoreFrame]) {
     5506            NSEvent *oldViewEvent = [NSEvent mouseEventWithType:NSMouseMoved
     5507                location:NSMakePoint(-1, -1)
     5508                modifierFlags:[[NSApp currentEvent] modifierFlags]
     5509                timestamp:[NSDate timeIntervalSinceReferenceDate]
     5510                windowNumber:[[oldView window] windowNumber]
     5511                context:[[NSApp currentEvent] context]
     5512                eventNumber:0 clickCount:0 pressure:0];
     5513            oldCoreFrame->eventHandler()->mouseMoved(oldViewEvent);
     5514        }
     5515    }
     5516
     5517    if (!lastMouseoverView)
     5518        return;
     5519
     5520    if (Frame* coreFrame = core([lastMouseoverView mainFrame]))
     5521        coreFrame->eventHandler()->mouseMoved(event);
     5522}
     5523
     5524- (void)_updateMouseoverWithFakeEvent
     5525{
     5526    [self _cancelUpdateMouseoverTimer];
     5527   
     5528    NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved
     5529        location:[[self window] convertScreenToBase:[NSEvent mouseLocation]]
     5530        modifierFlags:[[NSApp currentEvent] modifierFlags]
     5531        timestamp:[NSDate timeIntervalSinceReferenceDate]
     5532        windowNumber:[[self window] windowNumber]
     5533        context:[[NSApp currentEvent] context]
     5534        eventNumber:0 clickCount:0 pressure:0];
     5535   
     5536    [[self class] _updateMouseoverWithEvent:fakeEvent];
     5537}
     5538
     5539- (void)_setToolTip:(NSString *)toolTip
     5540{
     5541    if (_private->usesDocumentViews) {
     5542        id documentView = [[[self selectedFrame] frameView] documentView];
     5543        if ([documentView isKindOfClass:[WebHTMLView class]])
     5544            [documentView _setToolTip:toolTip];
     5545        return;
     5546    }
     5547
     5548    // FIXME (Viewless): Code to handle tooltips needs to move into WebView.
     5549}
     5550
     5551- (void)_selectionChanged
     5552{
     5553    if (_private->usesDocumentViews) {
     5554        id documentView = [[[self selectedFrame] frameView] documentView];
     5555        if ([documentView isKindOfClass:[WebHTMLView class]])
     5556            [documentView _selectionChanged];
     5557        return;
     5558    }
     5559
     5560    // FIXME (Viewless): We'll need code here.
     5561}
     5562
     5563- (Frame*)_mainCoreFrame
     5564{
     5565    return (_private && _private->page) ? _private->page->mainFrame() : 0;
     5566}
     5567
     5568#if USE(ACCELERATED_COMPOSITING)
     5569
     5570- (BOOL)_needsOneShotDrawingSynchronization
     5571{
     5572    return _private->needsOneShotDrawingSynchronization;
     5573}
     5574
     5575- (void)_setNeedsOneShotDrawingSynchronization:(BOOL)needsSynchronization
     5576{
     5577    _private->needsOneShotDrawingSynchronization = needsSynchronization;
     5578}
     5579
     5580- (void)_startedAcceleratedCompositingForFrame:(WebFrame*)webFrame
     5581{
     5582    BOOL entering = _private->acceleratedFramesCount == 0;
     5583    if (entering)
     5584        [self willChangeValueForKey:UsingAcceleratedCompositingProperty];
     5585    ++_private->acceleratedFramesCount;
     5586    if (entering)
     5587        [self didChangeValueForKey:UsingAcceleratedCompositingProperty];
     5588}
     5589
     5590- (void)_stoppedAcceleratedCompositingForFrame:(WebFrame*)webFrame
     5591{
     5592    BOOL leaving = _private->acceleratedFramesCount == 1;
     5593    ASSERT(_private->acceleratedFramesCount > 0);
     5594   
     5595    if (leaving)
     5596        [self willChangeValueForKey:UsingAcceleratedCompositingProperty];
     5597    --_private->acceleratedFramesCount;
     5598    if (leaving)
     5599        [self didChangeValueForKey:UsingAcceleratedCompositingProperty];
     5600}
     5601
     5602static void viewUpdateRunLoopObserverCallBack(CFRunLoopObserverRef, CFRunLoopActivity, void* info)
     5603{
     5604    WebView* webView = reinterpret_cast<WebView*>(info);
     5605    [webView _viewWillDrawInternal];
     5606    [webView->_private _clearViewUpdateRunLoopObserver];
     5607}
     5608
     5609- (void)_scheduleViewUpdate
     5610{
     5611    // This is the compositing equivalent of -viewWillDraw. When we know that compositing layers
     5612    // have been set as needing display, we have to make an eager layout happen before the
     5613    // layers get committed by CoreAnimation.
     5614
     5615    if (_private->viewUpdateRunLoopObserver)
     5616        return;
     5617
     5618    // Run before AppKit does its window update.
     5619    const CFIndex runLoopOrder = NSDisplayWindowRunLoopOrdering - 1;
     5620
     5621    // The WebView always outlives the observer, so no need to retain/release.
     5622    CFRunLoopObserverContext context = { 0, self, 0, 0, 0 };
     5623
     5624    _private->viewUpdateRunLoopObserver = CFRunLoopObserverCreate(NULL,
     5625        kCFRunLoopBeforeWaiting | kCFRunLoopExit, FALSE /* one shot */,
     5626        runLoopOrder, viewUpdateRunLoopObserverCallBack, &context);
     5627
     5628    CFRunLoopAddObserver(CFRunLoopGetCurrent(), _private->viewUpdateRunLoopObserver, kCFRunLoopCommonModes);
     5629}
     5630
     5631#endif
    53645632
    53655633@end
     
    58946162}
    58956163
    5896 #if USE(ACCELERATED_COMPOSITING)
    5897 static void viewUpdateRunLoopObserverCallBack(CFRunLoopObserverRef, CFRunLoopActivity, void* info)
    5898 {
    5899     WebView* webView = reinterpret_cast<WebView*>(info);
    5900     [webView _viewWillDrawInternal];
    5901     [webView->_private _clearViewUpdateRunLoopObserver];
    5902 }
    5903 
    5904 - (void)_scheduleViewUpdate
    5905 {
    5906     // This is the compositing equivalent of -viewWillDraw. When we know that compositing layers
    5907     // have been set as needing display, we have to make an eager layout happen before the
    5908     // layers get committed by CA.
    5909     if (!_private->viewUpdateRunLoopObserver) {
    5910         const CFIndex runLoopOrder = NSDisplayWindowRunLoopOrdering-1; // Run before AppKit does its window update
    5911         CFRunLoopObserverContext context = {
    5912             0,
    5913             reinterpret_cast<void*>(self),
    5914             NULL,   // The WebView always outlives the observer, so no need to retain/release.
    5915             NULL,
    5916             NULL
    5917         };
    5918         _private->viewUpdateRunLoopObserver = CFRunLoopObserverCreate(NULL, kCFRunLoopBeforeWaiting | kCFRunLoopExit, false /* one shot */,
    5919                                                         runLoopOrder, viewUpdateRunLoopObserverCallBack, &context);
    5920 
    5921         CFRunLoopAddObserver(CFRunLoopGetCurrent(), _private->viewUpdateRunLoopObserver, kCFRunLoopCommonModes);
    5922     }
    5923    
    5924 }
    5925 #endif
    5926 
    59276164@end
    59286165
  • trunk/WebKit/mac/WebView/WebViewInternal.h

    r42208 r44379  
    3939#ifdef __cplusplus
    4040namespace WebCore {
     41    class Frame;
     42    class KURL;
    4143    class KeyboardEvent;
    42     class KURL;
    4344    class Page;
    4445    class String;
    4546}
    46 typedef WebCore::KeyboardEvent WebCoreKeyboardEvent;
    47 typedef WebCore::Page WebCorePage;
    48 #else
    49 @class WebCoreKeyboardEvent;
    50 @class WebCorePage;
    5147#endif
    5248
     
    5551@class WebNodeHighlight;
    5652
     53#ifdef __cplusplus
     54
    5755@interface WebView (WebViewEditingExtras)
    58 - (BOOL)_interceptEditingKeyEvent:(WebCoreKeyboardEvent *)event shouldSaveCommand:(BOOL)shouldSave;
     56- (BOOL)_interceptEditingKeyEvent:(WebCore::KeyboardEvent*)event shouldSaveCommand:(BOOL)shouldSave;
    5957- (BOOL)_shouldChangeSelectedDOMRange:(DOMRange *)currentRange toDOMRange:(DOMRange *)proposedRange affinity:(NSSelectionAffinity)selectionAffinity stillSelecting:(BOOL)flag;
    6058@end
     
    6765
    6866@interface WebView (WebViewInternal)
    69 #ifdef __cplusplus
     67
     68- (WebCore::Frame*)_mainCoreFrame;
     69
    7070- (WebCore::String)_userAgentForURL:(const WebCore::KURL&)url;
    7171- (WebCore::KeyboardUIMode)_keyboardUIMode;
    72 #endif
    73 @end
    74 
    75 @interface WebView (WebViewMiscInternal)
     72
     73- (BOOL)_becomingFirstResponderFromOutside;
     74
     75- (void)_registerForIconNotification:(BOOL)listen;
     76- (void)_dispatchDidReceiveIconFromWebFrame:(WebFrame *)webFrame;
     77
     78- (void)_setMouseDownEvent:(NSEvent *)event;
     79- (void)_cancelUpdateMouseoverTimer;
     80- (void)_stopAutoscrollTimer;
     81- (void)_updateMouseoverWithFakeEvent;
     82- (void)_selectionChanged;
     83- (void)_setToolTip:(NSString *)toolTip;
     84
     85#if USE(ACCELERATED_COMPOSITING)
     86- (BOOL)_needsOneShotDrawingSynchronization;
     87- (void)_setNeedsOneShotDrawingSynchronization:(BOOL)needsSynchronization;
     88- (void)_startedAcceleratedCompositingForFrame:(WebFrame*)webFrame;
     89- (void)_stoppedAcceleratedCompositingForFrame:(WebFrame*)webFrame;
     90- (void)_scheduleViewUpdate;
     91#endif
     92
     93@end
     94
     95#endif
     96
     97// FIXME: Temporary way to expose methods that are in the wrong category inside WebView.
     98@interface WebView (WebViewOtherInternal)
    7699
    77100+ (void)_setCacheModel:(WebCacheModel)cacheModel;
    78101+ (WebCacheModel)_cacheModel;
    79 - (WebCorePage*)page;
     102
     103#ifdef __cplusplus
     104- (WebCore::Page*)page;
     105#endif
     106
    80107- (NSMenu *)_menuForElement:(NSDictionary *)element defaultItems:(NSArray *)items;
    81108- (id)_UIDelegateForwarder;
     
    124151- (id)_objectForIdentifier:(unsigned long)identifier;
    125152- (void)_removeObjectForIdentifier:(unsigned long)identifier;
    126 - (BOOL)_becomingFirstResponderFromOutside;
    127 
    128 - (void)_registerForIconNotification:(BOOL)listen;
    129 - (void)_dispatchDidReceiveIconFromWebFrame:(WebFrame *)webFrame;
    130 
    131 - (void)_setZoomMultiplier:(float)m isTextOnly:(BOOL)isTextOnly;
     153
     154- (void)_setZoomMultiplier:(float)multiplier isTextOnly:(BOOL)isTextOnly;
    132155- (float)_zoomMultiplier:(BOOL)isTextOnly;
    133156- (float)_realZoomMultiplier;
     
    145168+ (BOOL)_canHandleRequest:(NSURLRequest *)request forMainFrame:(BOOL)forMainFrame;
    146169
    147 #if USE(ACCELERATED_COMPOSITING)
    148 - (BOOL)_needsOneShotDrawingSynchronization;
    149 - (void)_setNeedsOneShotDrawingSynchronization:(BOOL)needsSynchronization;
    150 - (void)_startedAcceleratedCompositingForFrame:(WebFrame*)webFrame;
    151 - (void)_stoppedAcceleratedCompositingForFrame:(WebFrame*)webFrame;
    152 - (void)_scheduleViewUpdate;
    153 #endif
    154 
    155170- (void)_setInsertionPasteboard:(NSPasteboard *)pasteboard;
    156171
    157172@end
    158173
    159 typedef struct _WebResourceDelegateImplementationCache {
     174#ifdef __cplusplus
     175
     176struct WebResourceDelegateImplementationCache {
    160177    IMP didCancelAuthenticationChallengeFunc;
    161178    IMP didReceiveAuthenticationChallengeFunc;
     
    170187    IMP plugInFailedWithErrorFunc;
    171188    IMP shouldUseCredentialStorageFunc;
    172 } WebResourceDelegateImplementationCache;
    173 
    174 typedef struct _WebFrameLoadDelegateImplementationCache {
     189};
     190
     191struct WebFrameLoadDelegateImplementationCache {
    175192    IMP didClearWindowObjectForFrameFunc;
    176193    IMP windowScriptObjectAvailableFunc;
     
    191208    IMP didReceiveIconForFrameFunc;
    192209    IMP didFinishDocumentLoadForFrameFunc;
    193 } WebFrameLoadDelegateImplementationCache;
    194 
    195 typedef struct _WebScriptDebugDelegateImplementationCache {
     210};
     211
     212struct WebScriptDebugDelegateImplementationCache {
    196213    BOOL didParseSourceExpectsBaseLineNumber;
    197214    IMP didParseSourceFunc;
     
    201218    IMP willLeaveCallFrameFunc;
    202219    IMP exceptionWasRaisedFunc;
    203 } WebScriptDebugDelegateImplementationCache;
    204 
    205 WebResourceDelegateImplementationCache* WebViewGetResourceLoadDelegateImplementations(WebView *webView);
    206 WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementations(WebView *webView);
    207 WebScriptDebugDelegateImplementationCache* WebViewGetScriptDebugDelegateImplementations(WebView *webView);
    208 
    209 #ifdef __cplusplus
     220};
     221
     222WebResourceDelegateImplementationCache* WebViewGetResourceLoadDelegateImplementations(WebView *);
     223WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementations(WebView *);
     224WebScriptDebugDelegateImplementationCache* WebViewGetScriptDebugDelegateImplementations(WebView *);
    210225
    211226id CallFormDelegate(WebView *, SEL, id, id);
  • trunk/WebKit/wx/ChangeLog

    r44096 r44379  
     12009-06-02  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by David Hyatt.
     4
     5        * WebKitSupport/FrameLoaderClientWx.cpp:
     6        (WebCore::FrameLoaderClientWx::transitionToCommittedForNewPage): Use FrameView::create
     7        and RefPtr instead of the old "crazy" reference counting.
     8
    192009-05-23  David Kilzer  <ddkilzer@apple.com>
    210
  • trunk/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp

    r43442 r44379  
    891891    m_frame->setView(0);
    892892
    893     FrameView* frameView;
     893    RefPtr<FrameView> frameView;
    894894    if (isMainFrame)
    895         frameView = new FrameView(m_frame, IntRect(m_webView->GetRect()).size());
     895        frameView = FrameView::create(m_frame, IntRect(m_webView->GetRect()).size());
    896896    else
    897         frameView = new FrameView(m_frame);
     897        frameView = FrameView::create(m_frame);
    898898
    899899    ASSERT(frameView);
    900900    m_frame->setView(frameView);
    901     frameView->deref(); // FrameViews are created with a ref count of 1. Release this ref since we've assigned it to frame.
    902901
    903902    frameView->setPlatformWidget(m_webView);
Note: See TracChangeset for help on using the changeset viewer.