Reviewed by mjs
<http://bugzilla.opendarwin.org/show_bug.cgi?id=10225>
GMail Editor: Change Hilite Color doesn't work
* editing/execCommand/hilitecolor-expected.checksum: Added.
* editing/execCommand/hilitecolor-expected.png: Added.
* editing/execCommand/hilitecolor-expected.txt: Added.
* editing/execCommand/hilitecolor.html: Added.
WebCore:
Reviewed by mjs
<http://bugzilla.opendarwin.org/show_bug.cgi?id=10225>
GMail Editor: Change Hilite Color doesn't work
* editing/JSEditor.cpp: Added support for execCommand("HiliteColor", ...).
It's what GMail uses to implement text hiliting. It's just a synonym for BackColor.
* editing/SelectionController.cpp:
(WebCore::SelectionController::nodeWillBeRemoved): Moved a comment
a more appropriate place.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15772
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-08-02 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by mjs
+
+ <http://bugzilla.opendarwin.org/show_bug.cgi?id=10225>
+ GMail Editor: Change Hilite Color doesn't work
+
+ * editing/execCommand/hilitecolor-expected.checksum: Added.
+ * editing/execCommand/hilitecolor-expected.png: Added.
+ * editing/execCommand/hilitecolor-expected.txt: Added.
+ * editing/execCommand/hilitecolor.html: Added.
+
2006-08-03 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by Adele and Darin.
--- /dev/null
+56816cdf8a1834a12e1bbfd085ac7be4
\ 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: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > SPAN > SPAN > DIV > BODY > HTML > #document to 6 of #text > SPAN > SPAN > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+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 {DIV} at (0,0) size 784x18
+ RenderInline {SPAN} at (0,0) size 616x18
+ RenderText {#text} at (0,0) size 29x18
+ text run at (0,0) width 29: "The "
+ RenderInline {SPAN} at (0,0) size 44x18 [bgcolor=#FF0000]
+ RenderText {#text} at (29,0) size 44x18
+ text run at (29,0) width 44: "second"
+ RenderText {#text} at (73,0) size 543x18
+ text run at (73,0) width 543: " word, and only the second word of this sentence should have a red background color."
+caret: position 0 of child 0 {#text} of child 0 {SPAN} of child 0 {DIV} of child 0 {BODY} of child 0 {HTML} of document
--- /dev/null
+<div id="test" contenteditable="true">The second word, and only the second word of this sentence should have a red background color.</div>
+
+<script>
+var sel = window.getSelection();
+var e = document.getElementById("test");
+
+sel.setPosition(e, 0);
+sel.modify("move", "forward", "word");
+sel.modify("move", "forward", "word");
+sel.modify("extend", "backward", "word");
+document.execCommand("HiliteColor", false, "red");
+sel.modify("move", "backward", "line");
+</script>
\ No newline at end of file
+2006-08-02 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by mjs
+
+ <http://bugzilla.opendarwin.org/show_bug.cgi?id=10225>
+ GMail Editor: Change Hilite Color doesn't work
+
+ * editing/JSEditor.cpp: Added support for execCommand("HiliteColor", ...).
+ It's what GMail uses to implement text hiliting. It's just a synonym for BackColor.
+ * editing/SelectionController.cpp:
+ (WebCore::SelectionController::nodeWillBeRemoved): Moved a comment
+ a more appropriate place.
+
2006-08-03 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by Adele and Darin.
bool execBackColor(Frame *frame, bool userInterface, const String &value)
{
- return execStyleChange(frame, CSS_PROP_BACKGROUND_COLOR, value);
+ return execStyleChange(frame, CSS_PROP_BACKGROUND_COLOR, value);
}
bool execBold(Frame *frame, bool userInterface, const String &value)
bool execForeColor(Frame *frame, bool userInterface, const String &value)
{
- return execStyleChange(frame, CSS_PROP_COLOR, value);
+ return execStyleChange(frame, CSS_PROP_COLOR, value);
}
bool execFormatBlock(Frame *frame, bool userInterface, const String &value)
static const EditorCommand commands[] = {
- { "BackColor", { execBackColor, enabledAnyRangeSelection, stateNone, valueBackColor } },
+ { "BackColor", { execBackColor, enabledAnyRichlyEditableRangeSelection, stateNone, valueBackColor } },
{ "Bold", { execBold, enabledAnyRichlyEditableSelection, stateBold, valueNull } },
{ "Copy", { execCopy, enabledAnyRangeSelection, stateNone, valueNull } },
{ "CreateLink", { execCreateLink, enabledAnyRichlyEditableRangeSelection, stateNone, valueNull } },
{ "ForeColor", { execForeColor, enabledAnySelection, stateNone, valueForeColor } },
{ "FormatBlock", { execFormatBlock, enabledAnyRichlyEditableSelection, stateNone, valueNull } },
{ "ForwardDelete", { execForwardDelete, enabledAnyEditableSelection, stateNone, valueNull } },
+ { "HiliteColor", { execBackColor, enabledAnyRichlyEditableSelection, stateNone, valueNull } },
{ "Indent", { execIndent, enabledAnyRichlyEditableSelection, stateNone, valueNull } },
{ "InsertHorizontalRule", { execInsertHorizontalRule, enabledAnyRichlyEditableSelection, stateNone, valueNull } },
{ "InsertHTML", { execInsertHTML, enabledAnyEditableSelection, stateNone, valueNull } },
}
if (clearRenderTreeSelection) {
- // FIXME (6498): This doesn't notify the editing delegate of a selection change.
RefPtr<Document> document = start->document();
document->updateRendering();
if (RenderView* view = static_cast<RenderView*>(document->renderer()))
}
if (clearDOMTreeSelection)
+ // FIXME (6498): This doesn't notify the editing delegate of a selection change.
setSelection(Selection());
}