WebCore:
authorthatcher <thatcher@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Oct 2006 18:40:03 +0000 (18:40 +0000)
committerthatcher <thatcher@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Oct 2006 18:40:03 +0000 (18:40 +0000)
commit2a1c776b3f9ccc57f526fdf7570c1d88492305c8
tree3df9e20068b241cb28d8fa6fe1077f4607aa0a8e
parent8d78eb25720569d808f1ba169970e4fbb05ed25c
WebCore:

        Reviewed by Geoff.

        <rdar://problem/4478625> HTML Editing: Basic table editing and culling

        Initial implementaltion of table deletion user interface:
        * Interface shows up on the nearest table containing the entire selection.
        * Shows a Dashboard style close button in the top left corner.
        * Shows a 60% opaque black outline around the table.
        * Adds a new EditorClient function shouldShowDeleteInterface.

        Also adds a new constructor CachedImage and setter functions on
        HTMLImageElement and HTMLImageLoader allowing an Image object to be set
        and image element in the page. This change also paves the way to allow an
        NSImage setter on DOMHTMLImageElement.

        * Resources/deleteButton.tiff: Added.
        * Resources/deleteButtonPressed.tiff: Added.
        * WebCore.xcodeproj/project.pbxproj:
        * bridge/EditorClient.h:
        * editing/DeleteButton.cpp: Added.
        (WebCore::DeleteButton::DeleteButton):
        (WebCore::DeleteButton::defaultEventHandler): notify the controller to delete on click
        * editing/DeleteButton.h: Added.
        * editing/DeleteButtonController.cpp: Added.
        (WebCore::DeleteButtonController::DeleteButtonController):
        (WebCore::DeleteButtonController::respondToChangedSelection): move the interface to the new element, or hide
        (WebCore::DeleteButtonController::respondToChangedContents): call updateOutlineStyle
        (WebCore::DeleteButtonController::updateOutlineStyle): resize the outline if the table changed size
        (WebCore::DeleteButtonController::show): shows the interface on a new element
        (WebCore::DeleteButtonController::hide): hides the existing interface
        (WebCore::DeleteButtonController::deleteTarget): deletes the targeted element
        * editing/DeleteButtonController.h: Added.
        (WebCore::DeleteButtonController::target): getter for the current target
        * editing/Editor.cpp:
        (WebCore::Editor::shouldShowDeleteInterface): call the new shouldShowDeleteInterface client function
        (WebCore::Editor::Editor): remove the manual ref now that we use RefPtr for m_client
        (WebCore::Editor::~Editor): remove the manual deref now that we use RefPtr for m_client
        * editing/Editor.h:
        (WebCore::Editor::frame): new getter
        (WebCore::Editor::deleteButtonController): ditto
        * editing/SelectionController.cpp:
        (WebCore::SelectionController::setSelection): notify the DeleteButtonController about the new selection
        * html/HTMLImageElement.h:
        (WebCore::HTMLImageElement::setCachedImage): new setter that replaces the CachedImage
        * html/HTMLImageLoader.cpp:
        (WebCore::HTMLImageLoader::setImage): ditto
        * html/HTMLImageLoader.h:
        * loader/CachedImage.cpp:
        (WebCore::CachedImage::CachedImage): new constructor that takes an Image
        * loader/CachedImage.h: ditto
        * page/Frame.cpp:
        (WebCore::Frame::selectionController): cleanup coding style
        (WebCore::Frame::editor): ditto
        (WebCore::Frame::command): ditto
        (WebCore::Frame::appliedEditing): tell the delete button outline to update
        (WebCore::Frame::unappliedEditing): ditto
        (WebCore::Frame::reappliedEditing): ditto
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::addChild): workaround until bug 11363 is fixed

WebKit:

        Reviewed by Geoff.

        <rdar://problem/4478625> HTML Editing: Basic table editing and culling

        Initial implementaltion of table deletion user interface:
        * Adds a new editing delegate method, webView:shouldShowDeleteInterfaceForElement:.
        * The new delegate method is called from the new shouldShowDeleteInterface EditorClient function.

        * DefaultDelegates/WebDefaultEditingDelegate.m:
        (-[WebDefaultEditingDelegate webView:shouldShowDeleteInterfaceForElement:]):
        * WebCoreSupport/WebEditorClient.h:
        * WebCoreSupport/WebEditorClient.mm:
        (WebEditorClient::WebEditorClient):
        (WebEditorClient::shouldDeleteRange):
        (WebEditorClient::shouldShowDeleteInterface):
        * WebKit.xcodeproj/project.pbxproj:
        * WebView/WebEditingDelegatePrivate.h: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17196 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
WebCore/ChangeLog
WebCore/Resources/deleteButton.tiff [new file with mode: 0644]
WebCore/Resources/deleteButtonPressed.tiff [new file with mode: 0644]
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/bridge/EditorClient.h
WebCore/editing/DeleteButton.cpp [new file with mode: 0644]
WebCore/editing/DeleteButton.h [new file with mode: 0644]
WebCore/editing/DeleteButtonController.cpp [new file with mode: 0644]
WebCore/editing/DeleteButtonController.h [new file with mode: 0644]
WebCore/editing/Editor.cpp
WebCore/editing/Editor.h
WebCore/editing/SelectionController.cpp
WebCore/html/HTMLImageElement.h
WebCore/html/HTMLImageLoader.cpp
WebCore/html/HTMLImageLoader.h
WebCore/loader/CachedImage.cpp
WebCore/loader/CachedImage.h
WebCore/page/Frame.cpp
WebCore/rendering/RenderTable.cpp
WebKit/ChangeLog
WebKit/DefaultDelegates/WebDefaultEditingDelegate.m
WebKit/WebCoreSupport/WebEditorClient.h
WebKit/WebCoreSupport/WebEditorClient.mm
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/WebView/WebEditingDelegatePrivate.h [new file with mode: 0644]