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

Unified Diff: third_party/WebKit/Source/core/css/cssom/TransformValue.cpp

Issue 2099513002: [Typed OM] Rename TransformValue -> CSSTransformValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rename-transformcomponent
Patch Set: sync to head Created 4 years, 6 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
Index: third_party/WebKit/Source/core/css/cssom/TransformValue.cpp
diff --git a/third_party/WebKit/Source/core/css/cssom/TransformValue.cpp b/third_party/WebKit/Source/core/css/cssom/TransformValue.cpp
deleted file mode 100644
index d1466743b7a7ee3e2b27e4fbd5e5ab9714d7b479..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/core/css/cssom/TransformValue.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "core/css/cssom/TransformValue.h"
-
-#include "core/css/CSSValueList.h"
-#include "core/css/cssom/CSSTransformComponent.h"
-
-namespace blink {
-
-namespace {
-
-class TransformValueIterationSource final : public ValueIterable<CSSTransformComponent*>::IterationSource {
-public:
- explicit TransformValueIterationSource(TransformValue* transformValue)
- : m_transformValue(transformValue)
- {
- }
-
- bool next(ScriptState*, CSSTransformComponent*& value, ExceptionState&) override
- {
- if (m_index >= m_transformValue->size()) {
- return false;
- }
- value = m_transformValue->componentAtIndex(m_index);
- return true;
- }
-
- DEFINE_INLINE_VIRTUAL_TRACE()
- {
- visitor->trace(m_transformValue);
- ValueIterable<CSSTransformComponent*>::IterationSource::trace(visitor);
- }
-
-private:
- const Member<TransformValue> m_transformValue;
-};
-
-} // namespace
-
-TransformValue* TransformValue::fromCSSValue(const CSSValue& cssValue)
-{
- if (!cssValue.isValueList()) {
- // TODO(meade): Also need to check the separator here if we care.
- return nullptr;
- }
- HeapVector<Member<CSSTransformComponent>> components;
- for (const CSSValue* value : toCSSValueList(cssValue)) {
- CSSTransformComponent* component = CSSTransformComponent::fromCSSValue(*value);
- if (!component)
- return nullptr;
- components.append(component);
- }
- return TransformValue::create(components);
-}
-
-ValueIterable<CSSTransformComponent*>::IterationSource* TransformValue::startIteration(ScriptState*, ExceptionState&)
-{
- return new TransformValueIterationSource(this);
-}
-
-bool TransformValue::is2D() const
-{
- for (size_t i = 0; i < m_transformComponents.size(); i++) {
- if (!m_transformComponents[i]->is2DComponent()) {
- return false;
- }
- }
- return true;
-}
-
-CSSValue* TransformValue::toCSSValue() const
-{
- CSSValueList* transformCSSValue = CSSValueList::createSpaceSeparated();
- for (size_t i = 0; i < m_transformComponents.size(); i++) {
- transformCSSValue->append(*m_transformComponents[i]->toCSSValue());
- }
- return transformCSSValue;
-}
-
-} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/css/cssom/TransformValue.h ('k') | third_party/WebKit/Source/core/css/cssom/TransformValue.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698