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

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: Address review comments, add usage counter, rebase tests, rebase to ToT 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') | Source/core/dom/Document.idl » ('j') | 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 aece7b47476a5bd9df0613538e4ceb59afe750ce..0e83a6fc8b4c3f1f9d4761ba9695a15ff178e575 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)
@@ -4324,27 +4324,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";
@@ -4352,14 +4331,15 @@ String Document::designMode() const
void Document::setDesignMode(const String& value)
{
- InheritedBool mode;
+ bool newValue = m_designMode;
if (equalIgnoringCase(value, "on"))
- mode = on;
+ newValue = true;
else if (equalIgnoringCase(value, "off"))
- mode = off;
- else
- mode = inherit;
- setDesignMode(mode);
+ newValue = false;
+ if (newValue == m_designMode)
+ return;
+ m_designMode = newValue;
+ setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::DesignMode));
}
Document* Document::parentDocument() const
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Document.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698