Reviewed by darin
<rdar://problem/
4652788>
REGRESSION: Can't change size or style of any text in message body
* editing/style/designmode-expected.checksum: Added.
* editing/style/designmode-expected.png: Added.
* editing/style/designmode-expected.txt: Added.
* editing/style/designmode.html: Added.
WebCore:
Reviewed by darin
<rdar://problem/
4652788>
REGRESSION: Can't change size or style of any text in message body
* dom/Node.cpp:
(WebCore::Node::isContentRichlyEditable): Mimic Node::isContentEditable.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::isContentRichlyEditable): First check
the frame for editability, then userModify, like what
HTMLElement::isContentEditable() does.
* html/HTMLElement.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15643
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-07-26 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by darin
+
+ <rdar://problem/4652788>
+ REGRESSION: Can't change size or style of any text in message body
+
+ * editing/style/designmode-expected.checksum: Added.
+ * editing/style/designmode-expected.png: Added.
+ * editing/style/designmode-expected.txt: Added.
+ * editing/style/designmode.html: Added.
+
2006-07-25 Justin Garcia <justin.garcia@apple.com>
Reviewed by adele
--- /dev/null
+16ede59e59bd5bfe47377bace0a02169
\ No newline at end of file
--- /dev/null
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 1 of HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of #text > B > DIV > BODY > HTML > #document to 25 of #text > B > 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 737x18
+ text run at (0,0) width 737: "This tests to make sure that rich editing commands like Bold can be performed on text in a document in design mode."
+ RenderBlock {DIV} at (0,34) size 784x18
+ RenderInline {B} at (0,0) size 166x18
+ RenderText {#text} at (0,0) size 166x18
+ text run at (0,0) width 166: "This text should be bold."
+selection start: position 0 of child 0 {#text} of child 0 {B} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
+selection end: position 25 of child 0 {#text} of child 0 {B} of child 2 {DIV} of child 0 {BODY} of child 0 {HTML} of document
--- /dev/null
+<p>This tests to make sure that rich editing commands like Bold can be performed on text in a document in design mode.</p>
+<div id="test">This text should be bold.</div>
+
+<script>
+document.designMode = "on";
+var s = window.getSelection();
+var e = document.getElementById("test");
+s.setBaseAndExtent(e, 0, e, e.childNodes.length);
+document.execCommand("Bold");
+</script>
\ No newline at end of file
+2006-07-26 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by darin
+
+ <rdar://problem/4652788>
+ REGRESSION: Can't change size or style of any text in message body
+
+ * dom/Node.cpp:
+ (WebCore::Node::isContentRichlyEditable): Mimic Node::isContentEditable.
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::isContentRichlyEditable): First check
+ the frame for editability, then userModify, like what
+ HTMLElement::isContentEditable() does.
+ * html/HTMLElement.h:
+
2006-07-26 Mitz Pettel <opendarwin.org@mitzpettel.com>
Reviewed by ap.
bool Node::isContentRichlyEditable() const
{
- return renderer() && renderer()->style()->userModify() == READ_WRITE;
+ return parent() && parent()->isContentRichlyEditable();
}
IntRect Node::getRect() const
return renderer()->style()->userModify() == READ_WRITE || renderer()->style()->userModify() == READ_WRITE_PLAINTEXT_ONLY;
}
+bool HTMLElement::isContentRichlyEditable() const
+{
+ if (document()->frame() && document()->frame()->isContentEditable())
+ return true;
+
+ document()->updateRendering();
+
+ if (!renderer()) {
+ if (parentNode())
+ return parentNode()->isContentEditable();
+ else
+ return false;
+ }
+
+ return renderer()->style()->userModify() == READ_WRITE;
+}
+
String HTMLElement::contentEditable() const
{
document()->updateRendering();
virtual bool isFocusable() const;
virtual bool isContentEditable() const;
+ virtual bool isContentRichlyEditable() const;
virtual String contentEditable() const;
virtual void setContentEditable(MappedAttribute*);
virtual void setContentEditable(const String&);