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

Unified Diff: Source/core/rendering/style/AppliedTextDecorationList.h

Issue 219633002: Proper support for multiple text decorations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
Index: Source/core/rendering/style/AppliedTextDecorationList.h
diff --git a/Source/core/rendering/style/AppliedTextDecorationList.h b/Source/core/rendering/style/AppliedTextDecorationList.h
new file mode 100644
index 0000000000000000000000000000000000000000..aab7580bde723d0b4e6c41c27a3ee8c4a5d56b92
--- /dev/null
+++ b/Source/core/rendering/style/AppliedTextDecorationList.h
@@ -0,0 +1,38 @@
+// Copyright 2014 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.
+
+#ifndef AppliedTextDecorationList_h
+#define AppliedTextDecorationList_h
+
+#include "core/rendering/style/AppliedTextDecoration.h"
+#include "wtf/RefCounted.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+class AppliedTextDecorationList : public RefCounted<AppliedTextDecorationList> {
esprehn 2014/03/31 17:41:24 This is so silly, we should add a template for the
+public:
+ static PassRefPtr<AppliedTextDecorationList> create() { return adoptRef(new AppliedTextDecorationList); }
+ PassRefPtr<AppliedTextDecorationList> copy() { return adoptRef(new AppliedTextDecorationList(*this)); }
+
+ const AppliedTextDecoration& operator[](int i) const { return m_vector[i]; }
+ AppliedTextDecoration& operator[](int i) { return m_vector[i]; }
+ const AppliedTextDecoration& at(size_t i) const { return m_vector.at(i); }
+ AppliedTextDecoration& at(size_t i) { return m_vector.at(i); }
+
+ bool operator==(const AppliedTextDecorationList& o) const { return m_vector == o.m_vector; }
+ bool operator!=(const AppliedTextDecorationList& o) const { return m_vector != o.m_vector; }
+
+ size_t size() const { return m_vector.size(); }
+ void append(const AppliedTextDecoration& decoration) { m_vector.append(decoration); }
+
+private:
+ Vector<AppliedTextDecoration, 1> m_vector;
+ AppliedTextDecorationList() { }
+ AppliedTextDecorationList(const AppliedTextDecorationList& o) : m_vector(o.m_vector) { }
+};
+
+} // namespace WebCore
+
+#endif // AppliedTextDecorationList_h

Powered by Google App Engine
This is Rietveld 408576698