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

Unified Diff: Source/core/css/InlineVariablesIterator.cpp

Issue 119533003: Clear mutable inline style when it is empty. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Resolved reviewer comments. Created 7 years 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
Index: Source/core/css/InlineVariablesIterator.cpp
diff --git a/Source/core/css/resolver/MediaQueryResult.h b/Source/core/css/InlineVariablesIterator.cpp
similarity index 57%
copy from Source/core/css/resolver/MediaQueryResult.h
copy to Source/core/css/InlineVariablesIterator.cpp
index 1dc00f42dc31c621d290407328d06229fc0e58ff..b5197d1d7745f70f931aefce156e666a7852b1d4 100644
--- a/Source/core/css/resolver/MediaQueryResult.h
+++ b/Source/core/css/InlineVariablesIterator.cpp
@@ -1,6 +1,4 @@
/*
- * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
* Copyright (C) 2013 Google Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
@@ -17,31 +15,33 @@
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
- *
*/
-#ifndef MediaQueryResult_h
-#define MediaQueryResult_h
+#include "config.h"
+#include "core/css/InlineVariablesIterator.h"
-#include "core/css/MediaQueryExp.h"
-#include "wtf/Noncopyable.h"
-#include "wtf/RefCounted.h"
+#include "RuntimeEnabledFeatures.h"
+#include "core/css/CSSVariableValue.h"
+#include "core/css/StylePropertySet.h"
+#include "core/dom/Element.h"
namespace WebCore {
-class MediaQueryResult : public RefCounted<MediaQueryResult> {
- WTF_MAKE_NONCOPYABLE(MediaQueryResult); WTF_MAKE_FAST_ALLOCATED;
-public:
- MediaQueryResult(const MediaQueryExp& expr, bool result)
- : m_expression(expr)
- , m_result(result)
- {
+InlineVariablesIterator::InlineVariablesIterator(Element* element)
+ : m_element(element)
+{
+ ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
+
+ const StylePropertySet* propertySet = element->inlineStyle();
+ if (propertySet) {
+ initRemainingNames(propertySet);
}
+}
- MediaQueryExp m_expression;
- bool m_result;
-};
+MutableStylePropertySet* InlineVariablesIterator::propertySet() const
+{
+ return m_element->ensureMutableInlineStyle();
}
-#endif
+} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698