Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(619)

Unified Diff: Source/core/dom/Document.cpp

Issue 1031543003: Remove inheritance of designMode attribute. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Document.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/dom/Document.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698