Reviewed by harrison
<rdar://problem/
3655385>
Editing: -indent: method unimplemented
* editing/execCommand/nsresponder-indent-expected.checksum: Added.
* editing/execCommand/nsresponder-indent-expected.png: Added.
* editing/execCommand/nsresponder-indent-expected.txt: Added.
* editing/execCommand/nsresponder-indent.html: Added.
* editing/execCommand/nsresponder-outdent-expected.checksum: Added.
* editing/execCommand/nsresponder-outdent-expected.png: Added.
* editing/execCommand/nsresponder-outdent-expected.txt: Added.
* editing/execCommand/nsresponder-outdent.html: Added.
WebCore:
Reviewed by harrison
<rdar://problem/
3655385>
Editing: -indent: method unimplemented
Added Frame and bridge methods.
* bridge/mac/WebCoreFrameBridge.h:
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge indent]):
(-[WebCoreFrameBridge outdent]):
* page/Frame.cpp:
(WebCore::Frame::indent):
(WebCore::Frame::outdent):
* page/Frame.h:
WebKit:
Reviewed by harrison
<rdar://problem/
3655385>
Editing: -indent: method unimplemented
* WebView/WebHTMLView.m:
(-[NSArray validateUserInterfaceItem:]): Only allow indent:/outdent: in
richly editable areas.
(-[NSArray indent:]):
(-[NSArray outdent:]):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17074
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-10-16 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by harrison
+
+ <rdar://problem/3655385>
+ Editing: -indent: method unimplemented
+
+ * editing/execCommand/nsresponder-indent-expected.checksum: Added.
+ * editing/execCommand/nsresponder-indent-expected.png: Added.
+ * editing/execCommand/nsresponder-indent-expected.txt: Added.
+ * editing/execCommand/nsresponder-indent.html: Added.
+ * editing/execCommand/nsresponder-outdent-expected.checksum: Added.
+ * editing/execCommand/nsresponder-outdent-expected.png: Added.
+ * editing/execCommand/nsresponder-outdent-expected.txt: Added.
+ * editing/execCommand/nsresponder-outdent.html: Added.
+
2006-10-13 Justin Garcia <justin.garcia@apple.com>
Reviewed by ggaren and harrison
--- /dev/null
+3e8be6972e8bfb47d122d0bffe761c4f
\ No newline at end of file
--- /dev/null
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of BLOCKQUOTE > DIV > BODY > HTML > #document to 0 of BLOCKQUOTE > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x576
+ RenderBlock {P} at (0,0) size 784x18
+ RenderText {#text} at (0,0) size 534x18
+ text run at (0,0) width 281: "This tests the NSResponder method indent:. "
+ text run at (281,0) width 253: "You should see an indented 'foo' below."
+ RenderBlock {DIV} at (0,34) size 784x18
+ RenderBlock {BLOCKQUOTE} at (40,0) size 704x18
+ RenderText {#text} at (0,0) size 21x18
+ text run at (0,0) width 21: "foo"
+ RenderBlock (anonymous) at (0,34) size 784x0
+caret: position 0 of child 0 {#text} of child 0 {BLOCKQUOTE} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
--- /dev/null
+<p>This tests the NSResponder method indent:. You should see an indented 'foo' below.</p>
+<div id="div" contenteditable="true">foo</div>
+
+<script>
+var div = document.getElementById("div");
+var sel = window.getSelection();
+
+sel.setPosition(div, 0);
+
+textInputController.doCommand("indent:");
+</script>
--- /dev/null
+c4345696009513bcb2e6a1ad493871ba
\ No newline at end of file
--- /dev/null
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {P} at (0,0) size 784x18
+ RenderText {#text} at (0,0) size 453x18
+ text run at (0,0) width 196: "This tests the outdent: method. "
+ text run at (196,0) width 257: "You should see an undented 'foo' below."
+ RenderBlock {DIV} at (0,34) size 784x18
+ RenderText {#text} at (0,0) size 21x18
+ text run at (0,0) width 21: "foo"
+caret: position 0 of child 0 {#text} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
--- /dev/null
+<p>This tests the outdent: method. You should see an undented 'foo' below.</p>
+<div id="div" contenteditable="true"><blockquote>foo</blockquote></div>
+
+<script>
+var div = document.getElementById("div");
+var sel = window.getSelection();
+
+sel.setPosition(div, 0);
+
+textInputController.doCommand("outdent:");
+</script>
+2006-10-13 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by harrison
+
+ <rdar://problem/3655385>
+ Editing: -indent: method unimplemented
+
+ Added Frame and bridge methods.
+
+ * bridge/mac/WebCoreFrameBridge.h:
+ * bridge/mac/WebCoreFrameBridge.mm:
+ (-[WebCoreFrameBridge indent]):
+ (-[WebCoreFrameBridge outdent]):
+ * page/Frame.cpp:
+ (WebCore::Frame::indent):
+ (WebCore::Frame::outdent):
+ * page/Frame.h:
+
2006-10-16 Adam Roben <aroben@apple.com>
Reviewed by John.
- (void)setTypingStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
- (void)applyStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
- (void)applyParagraphStyle:(DOMCSSStyleDeclaration *)style withUndoAction:(WebUndoAction)undoAction;
+- (void)indent;
+- (void)outdent;
- (BOOL)selectionStartHasStyle:(DOMCSSStyleDeclaration *)style;
- (NSCellStateValue)selectionHasStyle:(DOMCSSStyleDeclaration *)style;
- (void)applyEditingStyleToBodyElement;
m_frame->applyParagraphStyle([style _CSSStyleDeclaration], static_cast<EditAction>(undoAction));
}
+- (void)indent
+{
+ if (!m_frame)
+ return;
+ m_frame->indent();
+}
+
+- (void)outdent
+{
+ if (!m_frame)
+ return;
+ m_frame->outdent();
+}
+
- (BOOL)selectionStartHasStyle:(DOMCSSStyleDeclaration *)style
{
if (!m_frame)
#include "HTMLObjectElement.h"
#include "HTMLViewSourceDocument.h"
#include "ImageDocument.h"
+#include "IndentOutdentCommand.h"
#include "loader/icon/IconDatabase.h"
#include "loader/icon/IconLoader.h"
#include "MediaFeatureNames.h"
}
}
+void Frame::indent()
+{
+ applyCommand(new IndentOutdentCommand(document(), IndentOutdentCommand::Indent));
+}
+
+void Frame::outdent()
+{
+ applyCommand(new IndentOutdentCommand(document(), IndentOutdentCommand::Outdent));
+}
+
static void updateState(CSSMutableStyleDeclaration *desiredStyle, CSSComputedStyleDeclaration *computedStyle, bool& atStart, Frame::TriState& state)
{
DeprecatedValueListConstIterator<CSSProperty> end;
void computeAndSetTypingStyle(CSSStyleDeclaration* , EditAction editingAction=EditActionUnspecified);
void applyStyle(CSSStyleDeclaration* , EditAction editingAction=EditActionUnspecified);
void applyParagraphStyle(CSSStyleDeclaration* , EditAction editingAction=EditActionUnspecified);
+ void indent();
+ void outdent();
TriState selectionHasStyle(CSSStyleDeclaration*) const;
bool selectionStartHasStyle(CSSStyleDeclaration*) const;
TriState selectionListState() const;
+2006-10-13 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by harrison
+
+ <rdar://problem/3655385>
+ Editing: -indent: method unimplemented
+
+ * WebView/WebHTMLView.m:
+ (-[NSArray validateUserInterfaceItem:]): Only allow indent:/outdent: in
+ richly editable areas.
+ (-[NSArray indent:]):
+ (-[NSArray outdent:]):
+
2006-10-13 Maciej Stachowiak <mjs@apple.com>
Not reviewed, build fix.
|| action == @selector(alignRight:)
|| action == @selector(changeAttributes:)
|| action == @selector(changeColor:)
- || action == @selector(changeFont:)) {
+ || action == @selector(changeFont:)
+ || action == @selector(indent:)
+ || action == @selector(outdent:)) {
return [self _canEditRichly];
} else if (action == @selector(capitalizeWord:)
|| action == @selector(lowercaseWord:)
[self _applyParagraphStyleToSelection:style withUndoAction:WebUndoActionSetWritingDirection];
}
+- (void)indent:(id)sender
+{
+ [[self _bridge] indent];
+}
+
+- (void)outdent:(id)sender
+{
+ [[self _bridge] outdent];
+}
+
#if 0
// CSS does not have a way to specify an outline font, which may make this difficult to implement.
// These methods are not implemented in NSTextView yet, so perhaps there's no rush.
- (void)changeCaseOfLetter:(id)sender;
-- (void)indent:(id)sender;
- (void)transposeWords:(id)sender;
#endif