summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2012-04-12 12:27:28 +0100
committerSteve Block <steveblock@google.com>2012-04-12 17:38:06 +0100
commit6fc495ad78b1663298d1395115dc316eeb537036 (patch)
treec62f9a1177bec2dbd5c47ca90b91cde129c37441 /Source
parentd7957e4817d6aa730d583fb56e2556bb4e626fb0 (diff)
downloadexternal_webkit-6fc495ad78b1663298d1395115dc316eeb537036.zip
external_webkit-6fc495ad78b1663298d1395115dc316eeb537036.tar.gz
external_webkit-6fc495ad78b1663298d1395115dc316eeb537036.tar.bz2
Cherry-pick WebKit change r85267 as a prerequisite for r92139
See http://trac.webkit.org/changeset/85267 Bug: 6329073 Change-Id: I7c46eab459647059890732214a9b953adef0a647
Diffstat (limited to 'Source')
-rw-r--r--Source/WebCore/css/CSSStyleSelector.cpp3
-rw-r--r--Source/WebCore/dom/Document.cpp2
-rw-r--r--Source/WebCore/dom/Node.cpp2
-rw-r--r--Source/WebCore/editing/ApplyStyleCommand.cpp6
-rw-r--r--Source/WebCore/html/HTMLElement.cpp5
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);