diff options
Diffstat (limited to 'Source/WebCore')
-rw-r--r-- | Source/WebCore/css/CSSStyleSelector.cpp | 3 | ||||
-rw-r--r-- | Source/WebCore/dom/Document.cpp | 2 | ||||
-rw-r--r-- | Source/WebCore/dom/Node.cpp | 2 | ||||
-rw-r--r-- | Source/WebCore/editing/ApplyStyleCommand.cpp | 6 | ||||
-rw-r--r-- | Source/WebCore/html/HTMLElement.cpp | 5 |
5 files changed, 9 insertions, 9 deletions
diff --git a/Source/WebCore/css/CSSStyleSelector.cpp b/Source/WebCore/css/CSSStyleSelector.cpp index 0b6fd35..8edf0dd 100644 --- a/Source/WebCore/css/CSSStyleSelector.cpp +++ b/Source/WebCore/css/CSSStyleSelector.cpp @@ -1194,7 +1194,8 @@ PassRefPtr<RenderStyle> CSSStyleSelector::styleForDocument(Document* document) documentStyle->setVisuallyOrdered(document->visuallyOrdered()); documentStyle->setZoom(frame ? frame->pageZoomFactor() : 1); documentStyle->setPageScaleTransform(frame ? frame->pageScaleFactor() : 1); - + documentStyle->setUserModify(document->inDesignMode() ? READ_WRITE : READ_ONLY); + Element* docElement = document->documentElement(); RenderObject* docElementRenderer = docElement ? docElement->renderer() : 0; if (docElementRenderer) { diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp index 1b5f55b..7fc628c 100644 --- a/Source/WebCore/dom/Document.cpp +++ b/Source/WebCore/dom/Document.cpp @@ -4083,6 +4083,8 @@ void Document::setTransformSource(PassOwnPtr<TransformSource> source) void Document::setDesignMode(InheritedBool value) { m_designMode = value; + for (Frame* frame = m_frame; frame && frame->document(); frame = frame->tree()->traverseNext(m_frame)) + frame->document()->scheduleForcedStyleRecalc(); } Document::InheritedBool Document::getDesignMode() const diff --git a/Source/WebCore/dom/Node.cpp b/Source/WebCore/dom/Node.cpp index 0967ef5..24b2301 100644 --- a/Source/WebCore/dom/Node.cpp +++ b/Source/WebCore/dom/Node.cpp @@ -770,7 +770,7 @@ bool Node::isContentEditable() const bool Node::rendererIsEditable(EditableLevel editableLevel) const { - if (document()->inDesignMode() || (document()->frame() && document()->frame()->page() && document()->frame()->page()->isEditable())) + if (document()->frame() && document()->frame()->page() && document()->frame()->page()->isEditable()) return true; // Ideally we'd call ASSERT(!needsStyleRecalc()) here, but diff --git a/Source/WebCore/editing/ApplyStyleCommand.cpp b/Source/WebCore/editing/ApplyStyleCommand.cpp index c9649d0..4f1bc93 100644 --- a/Source/WebCore/editing/ApplyStyleCommand.cpp +++ b/Source/WebCore/editing/ApplyStyleCommand.cpp @@ -1316,8 +1316,10 @@ void ApplyStyleCommand::surroundNodeRangeWithElement(PassRefPtr<Node> passedStar RefPtr<Node> node = startNode; while (node) { RefPtr<Node> next = node->nextSibling(); - removeNode(node); - appendNode(node, element); + if (node->isContentEditable()) { + removeNode(node); + appendNode(node, element); + } if (node == endNode) break; node = next; diff --git a/Source/WebCore/html/HTMLElement.cpp b/Source/WebCore/html/HTMLElement.cpp index b2b57a2..82e33d1 100644 --- a/Source/WebCore/html/HTMLElement.cpp +++ b/Source/WebCore/html/HTMLElement.cpp @@ -682,11 +682,6 @@ void HTMLElement::setContentEditable(Attribute* attr) attr->decl()->removeProperty(CSSPropertyWordWrap, false); attr->decl()->removeProperty(CSSPropertyWebkitNbspMode, false); attr->decl()->removeProperty(CSSPropertyWebkitLineBreak, false); - } else if (equalIgnoringCase(enabled, "inherit")) { - addCSSProperty(attr, CSSPropertyWebkitUserModify, CSSValueInherit); - attr->decl()->removeProperty(CSSPropertyWordWrap, false); - attr->decl()->removeProperty(CSSPropertyWebkitNbspMode, false); - attr->decl()->removeProperty(CSSPropertyWebkitLineBreak, false); } else if (equalIgnoringCase(enabled, "plaintext-only")) { addCSSProperty(attr, CSSPropertyWebkitUserModify, CSSValueReadWritePlaintextOnly); addCSSProperty(attr, CSSPropertyWordWrap, CSSValueBreakWord); |