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

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

Issue 119533003: Clear mutable inline style when it is empty. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed typo. 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/VariablesIterator.cpp
diff --git a/Source/core/css/VariablesIterator.cpp b/Source/core/css/VariablesIterator.cpp
index 9b229f77532aa23a268b6bd4496925df9a835d59..c2e92cce2ab2b22a59508f6d959b5f8215e70b61 100644
--- a/Source/core/css/VariablesIterator.cpp
+++ b/Source/core/css/VariablesIterator.cpp
@@ -23,12 +23,13 @@
#include "RuntimeEnabledFeatures.h"
#include "core/css/CSSVariableValue.h"
#include "core/css/StylePropertySet.h"
+#include "core/dom/Element.h"
namespace WebCore {
-PassRefPtr<VariablesIterator> VariablesIterator::create(MutableStylePropertySet* propertySet)
+void AbstractVariablesIterator::initRemainingNames(
eseidel 2013/12/23 21:30:23 Could this just be part of the AbstractVariablesIt
chrishtr 2013/12/23 22:06:46 I think it can, per your other comment. Will fix.
chrishtr 2013/12/23 22:34:20 Done.
+ const StylePropertySet* propertySet, AbstractVariablesIterator* iterator)
{
- ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
const size_t propertyCount = propertySet->propertyCount();
size_t variableCount = 0;
Vector<AtomicString> remainingNames(propertyCount);
@@ -37,11 +38,17 @@ PassRefPtr<VariablesIterator> VariablesIterator::create(MutableStylePropertySet*
if (property.id() == CSSPropertyVariable)
remainingNames[variableCount++] = toCSSVariableValue(property.value())->name();
}
+ // FIXME: Make use of the Vector move constructor when rvalues are supported on all platforms.
remainingNames.shrink(variableCount);
- RefPtr<VariablesIterator> iterator = adoptRef(new VariablesIterator(propertySet));
- // FIXME: Make use of the Vector move constructor when rvalues are supported on all platforms.
iterator->takeRemainingNames(remainingNames);
+}
+
+PassRefPtr<VariablesIterator> VariablesIterator::create(MutableStylePropertySet* propertySet)
+{
+ ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled());
+ RefPtr<VariablesIterator> iterator = adoptRef(new VariablesIterator(propertySet));
+ AbstractVariablesIterator::initRemainingNames(propertySet, iterator.get());
eseidel 2013/12/23 21:30:23 As I commented in a previous pass, it's uncommon t
chrishtr 2013/12/23 22:34:20 Done.
return iterator.release();
}

Powered by Google App Engine
This is Rietveld 408576698