2006-01-21 Anders Carlsson <andersca@mac.com>
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Jan 2006 20:15:17 +0000 (20:15 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 21 Jan 2006 20:15:17 +0000 (20:15 +0000)
        Reviewed by Darin.

        - fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=6691
        TinyMCE: strikethrough unimplemented

        * khtml/editing/jsediting.cpp:
        Add support for the "Strikethrough" command.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@12274 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/editing/editing.js
LayoutTests/editing/execCommand/strikethroughSelection-expected.checksum [new file with mode: 0644]
LayoutTests/editing/execCommand/strikethroughSelection-expected.png [new file with mode: 0644]
LayoutTests/editing/execCommand/strikethroughSelection-expected.txt [new file with mode: 0644]
LayoutTests/editing/execCommand/strikethroughSelection.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/khtml/editing/jsediting.cpp

index 62f1999..093ecd4 100644 (file)
@@ -1,3 +1,18 @@
+2006-01-21  Anders Carlsson  <andersca@mac.com>
+
+        Reviewed by Darin.
+
+        - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=6691
+        TinyMCE: strikethrough unimplemented
+        
+        * editing/editing.js:
+        Add strikethrough commands.
+        
+        * editing/execCommand/strikethroughSelection-expected.checksum: Added.
+        * editing/execCommand/strikethroughSelection-expected.png: Added.
+        * editing/execCommand/strikethroughSelection-expected.txt: Added.
+        * editing/execCommand/strikethroughSelection.html: Added.
+
 2006-01-21  Mitz Pettel  <opendarwin.org@mitzpettel.com>
 
         Reviewed by Darin.
index 400dcb7..7a29574 100644 (file)
@@ -423,6 +423,21 @@ function selectAllCommand() {
 
 //-------------------------------------------------------------------------------------------------------
 
+function execStrikethroughCommand() {
+    document.execCommand("Strikethrough");
+}
+function boldCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execStrikethroughCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execStrikethroughCommand();
+    }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
 function execUndoCommand() {
     document.execCommand("Undo");
 }
diff --git a/LayoutTests/editing/execCommand/strikethroughSelection-expected.checksum b/LayoutTests/editing/execCommand/strikethroughSelection-expected.checksum
new file mode 100644 (file)
index 0000000..58577d3
--- /dev/null
@@ -0,0 +1 @@
+6973577cb46f24cd41a27e40091eb823
\ No newline at end of file
diff --git a/LayoutTests/editing/execCommand/strikethroughSelection-expected.png b/LayoutTests/editing/execCommand/strikethroughSelection-expected.png
new file mode 100644 (file)
index 0000000..a0504cc
Binary files /dev/null and b/LayoutTests/editing/execCommand/strikethroughSelection-expected.png differ
diff --git a/LayoutTests/editing/execCommand/strikethroughSelection-expected.txt b/LayoutTests/editing/execCommand/strikethroughSelection-expected.txt
new file mode 100644 (file)
index 0000000..2cbc9b2
--- /dev/null
@@ -0,0 +1,167 @@
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > DIV > BODY > HTML > #document toDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 1 of #text > SPAN > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+layer at (0,0) size 800x600
+  RenderCanvas 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 {DIV} at (0,0) size 784x356 [border: (2px solid #FF0000)]
+        RenderBlock (anonymous) at (14,14) size 756x56
+          RenderInline {SPAN} at (0,0) size 687x56
+            RenderInline {SPAN} at (0,0) size 219x28
+              RenderText {TEXT} at (0,0) size 10x28
+                text run at (0,0) width 10: "\""
+              RenderText {TEXT} at (10,0) size 15x28
+                text run at (10,0) width 15: "T"
+              RenderText {TEXT} at (25,0) size 12x28
+                text run at (25,0) width 12: "h"
+              RenderText {TEXT} at (37,0) size 11x28
+                text run at (37,0) width 11: "e"
+              RenderText {TEXT} at (48,0) size 6x28
+                text run at (48,0) width 6: " "
+              RenderText {TEXT} at (54,0) size 12x28
+                text run at (54,0) width 12: "q"
+              RenderText {TEXT} at (66,0) size 12x28
+                text run at (66,0) width 12: "u"
+              RenderText {TEXT} at (78,0) size 7x28
+                text run at (78,0) width 7: "i"
+              RenderText {TEXT} at (85,0) size 11x28
+                text run at (85,0) width 11: "c"
+              RenderText {TEXT} at (96,0) size 12x28
+                text run at (96,0) width 12: "k"
+              RenderText {TEXT} at (108,0) size 6x28
+                text run at (108,0) width 6: " "
+              RenderText {TEXT} at (114,0) size 12x28
+                text run at (114,0) width 12: "b"
+              RenderText {TEXT} at (126,0) size 8x28
+                text run at (126,0) width 8: "r"
+              RenderText {TEXT} at (134,0) size 12x28
+                text run at (134,0) width 12: "o"
+              RenderText {TEXT} at (146,0) size 17x28
+                text run at (146,0) width 17: "w"
+              RenderText {TEXT} at (163,0) size 12x28
+                text run at (163,0) width 12: "n"
+              RenderText {TEXT} at (175,0) size 6x28
+                text run at (175,0) width 6: " "
+              RenderText {TEXT} at (181,0) size 8x28
+                text run at (181,0) width 8: "f"
+              RenderText {TEXT} at (189,0) size 12x28
+                text run at (189,0) width 12: "o"
+              RenderText {TEXT} at (201,0) size 12x28
+                text run at (201,0) width 12: "x"
+              RenderText {TEXT} at (213,0) size 6x28
+                text run at (213,0) width 6: " "
+            RenderText {TEXT} at (219,0) size 687x56
+              text run at (219,0) width 468: "jumps over the lazy dog\" uses every letter in the"
+              text run at (0,28) width 170: "english language."
+        RenderBlock (anonymous) at (14,94) size 756x224
+          RenderBlock {P} at (0,0) size 756x224
+            RenderText {TEXT} at (0,0) size 755x224
+              text run at (0,0) width 462: "Here's to the crazy ones, the misfits, the rebels, "
+              text run at (462,0) width 193: "the trouble makers, "
+              text run at (655,0) width 92: "the round"
+              text run at (0,28) width 243: "pegs in the square holes, "
+              text run at (243,28) width 350: "the ones who see things differently. "
+              text run at (593,28) width 144: "There not fond"
+              text run at (0,56) width 510: "of rules, and they have no respect for the status quo, "
+              text run at (510,56) width 190: "you can quote then,"
+              text run at (0,84) width 197: "disagree with them, "
+              text run at (197,84) width 218: "glorify or vilify them, "
+              text run at (415,84) width 340: "about the only thing you can't do is"
+              text run at (0,112) width 129: "ignore them. "
+              text run at (129,112) width 281: "Because they change things. "
+              text run at (410,112) width 344: "They push the human race forward."
+              text run at (0,140) width 481: "And while some may see them as the crazy ones, "
+              text run at (481,140) width 146: "we see genius. "
+              text run at (627,140) width 117: "Because the"
+              text run at (0,168) width 632: "people who are crazy enough to think they can change the world "
+              text run at (632,168) width 116: "are the ones"
+              text run at (0,196) width 77: "who do."
+        RenderBlock (anonymous) at (14,342) size 756x0
+          RenderInline {SPAN} at (0,0) size 0x0
+          RenderText {TEXT} at (0,0) size 0x0
+selection start: position 0 of child 0 {TEXT} of child 0 {SPAN} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+selection end:   position 1 of child 20 {TEXT} of child 0 {SPAN} of child 1 {SPAN} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/execCommand/strikethroughSelection.html b/LayoutTests/editing/execCommand/strikethroughSelection.html
new file mode 100644 (file)
index 0000000..92462b0
--- /dev/null
@@ -0,0 +1,57 @@
+<html> 
+<head>
+
+<style>
+.editing { 
+    border: 2px solid red; 
+    padding: 12px; 
+    font-size: 24px; 
+}
+</style>
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
+
+<script>
+
+function editingTest() {
+
+    for (i = 0; i < 21; i++) {
+            execExtendSelectionForwardByCharacterCommand();
+            execStrikethroughCommand();
+            
+    }
+ }
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">"The quick brown fox jumps over the lazy dog" uses every
+letter in the english language.
+
+<p>Here's to the crazy ones, the misfits, the rebels,
+ the trouble makers,
+ the round pegs in the square holes,
+ the ones who see things differently.
+ There not fond of rules, and they have no respect for the status quo,
+ you can quote then,
+ disagree with them,
+ glorify or vilify them,
+ about the only thing you can't do is ignore them. 
+ Because they change things.
+ They push the human race forward.
+ And while some may see them as the crazy ones,
+ we see genius.
+ Because the people who are crazy enough to think they can change the world
+ are the ones who do.
+</p>
+</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
index 5c10ed9..ede9e91 100644 (file)
@@ -1,3 +1,13 @@
+2006-01-21  Anders Carlsson  <andersca@mac.com>
+
+        Reviewed by Darin.
+
+        - fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=6691
+        TinyMCE: strikethrough unimplemented
+        
+        * khtml/editing/jsediting.cpp:
+        Add support for the "Strikethrough" command.
+        
 2006-01-21  Mitz Pettel  <opendarwin.org@mitzpettel.com>
 
         Test: fast/dynamic/hovered-detach.html
index 7b6de45..e6a72b9 100644 (file)
@@ -324,6 +324,12 @@ bool execSelectAll(Frame *frame, bool userInterface, const DOMString &value)
     return true;
 }
 
+bool execStrikethrough(Frame *frame, bool userInterface, const DOMString &value)
+{
+    bool isStrikethrough = selectionStartHasStyle(frame,  CSS_PROP__KHTML_TEXT_DECORATIONS_IN_EFFECT, "line-through");
+    return execStyleChange(frame,  CSS_PROP__KHTML_TEXT_DECORATIONS_IN_EFFECT, isStrikethrough ? "none" : "line-through");
+}
+
 bool execSubscript(Frame *frame, bool userInterface, const DOMString &value)
 {
     return execStyleChange(frame,  CSS_PROP_VERTICAL_ALIGN, "sub");
@@ -436,6 +442,11 @@ Frame::TriState stateItalic(Frame *frame)
     return stateStyle(frame,  CSS_PROP_FONT_STYLE, "italic");
 }
 
+Frame::TriState stateStrikethrough(Frame *frame)
+{
+    return stateStyle(frame,  CSS_PROP_TEXT_DECORATION, "line-through");
+}
+
 Frame::TriState stateSubscript(Frame *frame)
 {
     return stateStyle(frame,  CSS_PROP_VERTICAL_ALIGN, "sub");
@@ -521,6 +532,7 @@ CommandMap *createCommandDictionary()
         { "Print", { execPrint, enabled, stateNone, valueNull } },
         { "Redo", { execRedo, enabledRedo, stateNone, valueNull } },
         { "SelectAll", { execSelectAll, enabled, stateNone, valueNull } },
+        { "Strikethrough", { execStrikethrough, enabledAnySelection, stateStrikethrough, valueNull } },
         { "Subscript", { execSubscript, enabledAnySelection, stateSubscript, valueNull } },
         { "Superscript", { execSuperscript, enabledAnySelection, stateSuperscript, valueNull } },
         { "Transpose", { execTranspose, enabled, stateNone, valueNull } },
@@ -582,7 +594,6 @@ CommandMap *createCommandDictionary()
         // SizeToControlWidth (not supported)
         // Stop (not supported)
         // StopImage (not supported)
-        // Strikethrough (not supported)
         // Unbookmark (not supported)
         // Unlink (not supported)
     };