Chromium Code Reviews| Index: Source/core/dom/Document.cpp |
| diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp |
| index 1682fef5f8627773419e2f59c214ba1e46264e34..429e8478083d4005420a19d851d32d9e2694606c 100644 |
| --- a/Source/core/dom/Document.cpp |
| +++ b/Source/core/dom/Document.cpp |
| @@ -443,7 +443,7 @@ Document::Document(const DocumentInit& initializer, DocumentClassFlags documentC |
| , m_xmlVersion("1.0") |
| , m_xmlStandalone(StandaloneUnspecified) |
| , m_hasXMLDeclaration(0) |
| - , m_designMode(inherit) |
| + , m_designMode(false) |
| , m_hasAnnotatedRegions(false) |
| , m_annotatedRegionsDirty(false) |
| , m_useSecureKeyboardEntryWhenActive(false) |
| @@ -4314,27 +4314,6 @@ void Document::setTransformSource(PassOwnPtr<TransformSource> source) |
| m_transformSource = source; |
| } |
| -void Document::setDesignMode(InheritedBool value) |
| -{ |
| - m_designMode = value; |
| - for (Frame* frame = m_frame; frame; frame = frame->tree().traverseNext(m_frame)) { |
| - if (!frame->isLocalFrame()) |
| - continue; |
| - if (!toLocalFrame(frame)->document()) |
| - break; |
| - toLocalFrame(frame)->document()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::DesignMode)); |
| - } |
| -} |
| - |
| -bool Document::inDesignMode() const |
| -{ |
| - for (const Document* d = this; d; d = d->parentDocument()) { |
| - if (d->m_designMode != inherit) |
| - return d->m_designMode; |
| - } |
| - return false; |
| -} |
| - |
| String Document::designMode() const |
| { |
| return inDesignMode() ? "on" : "off"; |
| @@ -4342,14 +4321,13 @@ String Document::designMode() const |
| void Document::setDesignMode(const String& value) |
| { |
| - InheritedBool mode; |
| if (equalIgnoringCase(value, "on")) |
| - mode = on; |
| + m_designMode = true; |
| else if (equalIgnoringCase(value, "off")) |
| - mode = off; |
| + m_designMode = false; |
| else |
| - mode = inherit; |
| - setDesignMode(mode); |
| + return; |
| + setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::DesignMode)); |
|
yosin_UTC9
2015/03/24 05:18:38
nit: It is better to set style recalc when state w
dcheng
2015/03/26 01:53:14
Done.
|
| } |
| Document* Document::parentDocument() const |