Reviewed by Adam.
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Jan 2007 20:55:21 +0000 (20:55 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Jan 2007 20:55:21 +0000 (20:55 +0000)
commit7a0d17899a6555daf20ed3a4b421a253f2c77b93
tree003a0fb88f95b8b01f1b51802a29f87a14e9d860
parent6b4c12290a5722300e0cc704e2b66feef426721d
    Reviewed by Adam.

        - http://bugs.webkit.org/show_bug.cgi?id=12143
          remove Widget code unneeded now that form elements do not use Widget

        * bindings/objc/DOMHTML.mm: (-[DOMHTMLSelectElement _activateItemAtIndex:]):
        Removed useless implementation that would only work with NSView-based
        <select> elements, and added a FIXME about the fact that this function
        doesn't do anything any more. I think it's used by Safari forms auto-fill.

        * bridge/mac/WebCoreAXObject.mm: (-[WebCoreAXObject rendererForView:]):
        Removed code that depends on elementForView:, since that always returns
        nil now.

        * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::~HTMLFormElement):
        Use a formDestroyed() function rather than clearing m_form directly so that
        this class doesn't have to be a friend of HTMLGenericFormElement.

        * html/HTMLGenericFormElement.h: Removed now-unneeded friend declaration
        for HTMLFormElement. Moved definition of supportsFocus into the .cpp file.
        Added a public formDestroyed function for use by HTMLFormElement.
        * html/HTMLGenericFormElement.cpp:
        (WebCore::HTMLGenericFormElement::attach): Removed widget-specific code.
        (WebCore::HTMLGenericFormElement::isKeyboardFocusable): Ditto.
        (WebCore::HTMLGenericFormElement::isMouseFocusable): Ditto.
        (WebCore::HTMLGenericFormElement::supportsFocus): Added this here; it was
        in the header file before, for no good reason.

        * page/EventHandler.h: Removed unused Mac-specific
        currentEventIsMouseDownInWidget.
        * page/mac/EventHandlerMac.mm: Ditto.

        * page/Frame.cpp: (WebCore::Frame::frameForWidget): Changed to use
        RenderWidget to find the frame rather than the WigetClient element()
        function.

        * page/mac/FrameMac.h: Removed unused bridgeForWidget.
        * page/mac/FrameMac.mm: Ditto.

        * page/mac/WebCoreFrameBridge.h: Removed elementForView.
        * page/mac/WebCoreFrameBridge.mm: Ditto. While the scroll bar still did
        implement WebCoreWidgetHolder, it does not correspond to a DOM element,
        so this method was always returning nil.

        * platform/Widget.h: Moved unused types and functions that are still
        in the platform-specific implementations into a "to be deleted" section:
        FocusPolicy, NoFocus, TabFocus, ClickFocus, StrongFocus, WheelFocus,
        lockDrawingFocus, font, focusPolicy, hasFocus, clearFocus, setFont,
        disableFlushDrawing, enableFlushDrawing, unlockDrawingFocus.
        Removed unused functions that are not in platform-specific implementations:
        sizeHint, baselinePosition, checksDescendantsForFocus.
        * platform/Widget.cpp: Removed functions.

        * platform/WidgetClient.h: Emptied out the class. Soon we can delete it.

        * platform/mac/PlatformScrollBarMac.mm: (-[WebCoreScrollBar mouseDown:]):
        Got rid of unneeded includes, removed use of the WebCoreWidgetHolder
        protocol and the one method in it, and changed the calls to beforeMouseDown
        and afterMouseDown to pass the widget pointer in.

        * platform/mac/WebCoreWidgetHolder.h: Emptied out the file -- to be deleted
        later.

        * platform/mac/WidgetMac.mm:
        (WebCore::Widget::~Widget): Removed code to manage deferredFirstResponder.
        (WebCore::Widget::hasFocus): Removed body of function and replaced with
        an assertion that it's never called. Later we'll remove it.
        (WebCore::Widget::setFocus): Tweaked a bit to work given changes to the
        FrameMac class. Also added a FIXME. Given how this works, it does not
        belong in the platform layer.
        (WebCore::Widget::clearFocus): Removed body of function and replaced with
        an assertion that it's never called. Later we'll remove it.
        (WebCore::Widget::focusPolicy): Ditto.
        (WebCore::Widget::font): Ditto.
        (WebCore::Widget::setFont): Ditto.
        (WebCore::Widget::lockDrawingFocus): Ditto.
        (WebCore::Widget::unlockDrawingFocus): Ditto.
        (WebCore::Widget::disableFlushDrawing): Ditto.
        (WebCore::Widget::enableFlushDrawing): Ditto.
        (WebCore::Widget::paint): Removed obsolete comment.
        (WebCore::Widget::sendConsumedMouseUp): Removed body of function and replaced with
        an assertion that it's never called. Later we'll remove it.
        (WebCore::Widget::setIsSelected): Tweaked a bit to work given changes to the
        FrameMac class. Also added a FIXME. Given how this works, it does not
        belong in the platform layer.
        (WebCore::Widget::beforeMouseDown): Changed to take an explicit Widget parameter.
        (WebCore::Widget::afterMouseDown): Ditto.

        * rendering/RenderApplet.cpp:
        (WebCore::RenderApplet::intrinsicWidth): Changed to not call sizeHint() any more.
        I didn't change the values returned by the function, but they make no sense and
        this should probably be fixed later.
        (WebCore::RenderApplet::intrinsicHeight): Ditto.

        * rendering/RenderWidget.h: Removed unneeded WidgetClient.h include. Changed
        RenderWidget to no longer inherit from WidgetClient. Added a find function to find
        a RenderWidget given a Widget. Removed all the virtual functions that override
        WidgetClient hooks.
        * rendering/RenderWidget.cpp: Removed all the WidgetClient functions.
        (WebCore::widgetRendererMap): Added. Map that gives the RenderWidget for each
        Widget that is owned by a RenderWidget.
        (WebCore::RenderWidget::destroy): Removed the setClient call and added a call to
        remove the widget from the widgetRendererMap.
        (WebCore::RenderWidget::setWidget): Ditto.
        (WebCore::RenderWidget::setStyle): Removed the call to Widget::setFont.
        (WebCore::RenderWidget::find): Added. Returns the RenderWidget for a Widget, if any.

        - other changes

        * dom/Node.cpp:
        (WebCore::Node::dump): Removed unnecessary use of DeprecatedString.
        (WebCore::appendAttributeDesc): Ditto.
        (WebCore::Node::showNode): Ditto.
        (WebCore::Node::formatForDebugger): Ditto.

        * loader/CachedImage.cpp: (WebCore::CachedImage::createImage): Cleaned up
        conditional compilation so adding more MIME types here doesn't make the
        function more and more difficult to read.

        * page/Frame.h: Removed unneeded includes and declarations.
        Tweaked formatting.
        * page/Page.h: Removed unneeded declarations.
        * platform/ScrollView.h: Removed unneeded includes.

        * rendering/RenderBlock.cpp: (WebCore::RenderBlock::renderName): Tweaked formatting.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@18677 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
WebCore/ChangeLog
WebCore/bindings/objc/DOMHTML.mm
WebCore/bridge/mac/WebCoreAXObject.mm
WebCore/dom/Node.cpp
WebCore/html/HTMLFormElement.cpp
WebCore/html/HTMLGenericFormElement.cpp
WebCore/html/HTMLGenericFormElement.h
WebCore/loader/CachedImage.cpp
WebCore/page/EventHandler.h
WebCore/page/Frame.cpp
WebCore/page/Frame.h
WebCore/page/Page.h
WebCore/page/mac/EventHandlerMac.mm
WebCore/page/mac/FrameMac.h
WebCore/page/mac/FrameMac.mm
WebCore/page/mac/WebCoreFrameBridge.h
WebCore/page/mac/WebCoreFrameBridge.mm
WebCore/platform/ScrollView.h
WebCore/platform/Widget.cpp
WebCore/platform/Widget.h
WebCore/platform/WidgetClient.h
WebCore/platform/mac/PlatformScrollBarMac.mm
WebCore/platform/mac/WebCoreWidgetHolder.h
WebCore/platform/mac/WidgetMac.mm
WebCore/rendering/RenderApplet.cpp
WebCore/rendering/RenderBlock.cpp
WebCore/rendering/RenderWidget.cpp
WebCore/rendering/RenderWidget.h