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

Unified Diff: third_party/WebKit/Source/core/dom/DOMRectReadOnly.h

Issue 2770253003: Revert of Move geometry interface files to geometry directory. (Closed)
Patch Set: Created 3 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: third_party/WebKit/Source/core/dom/DOMRectReadOnly.h
diff --git a/third_party/WebKit/Source/core/dom/DOMRectReadOnly.h b/third_party/WebKit/Source/core/dom/DOMRectReadOnly.h
new file mode 100644
index 0000000000000000000000000000000000000000..957dfc9373b80b5fdfa6960466e0c33a10933545
--- /dev/null
+++ b/third_party/WebKit/Source/core/dom/DOMRectReadOnly.h
@@ -0,0 +1,54 @@
+// 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 DOMRectReadOnly_h
+#define DOMRectReadOnly_h
+
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "core/CoreExport.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class DOMRectInit;
+class ScriptValue;
+class ScriptState;
+
+class CORE_EXPORT DOMRectReadOnly : public GarbageCollected<DOMRectReadOnly>,
+ public ScriptWrappable {
+ DEFINE_WRAPPERTYPEINFO();
+
+ public:
+ static DOMRectReadOnly* create(double x,
+ double y,
+ double width,
+ double height);
+ static DOMRectReadOnly* fromRect(const DOMRectInit&);
+
+ double x() const { return m_x; }
+ double y() const { return m_y; }
+ double width() const { return m_width; }
+ double height() const { return m_height; }
+
+ double top() const { return std::min(m_y, m_y + m_height); }
+ double right() const { return std::max(m_x, m_x + m_width); }
+ double bottom() const { return std::max(m_y, m_y + m_height); }
+ double left() const { return std::min(m_x, m_x + m_width); }
+
+ DEFINE_INLINE_TRACE() {}
+
+ ScriptValue toJSONForBinding(ScriptState*) const;
+
+ protected:
+ DOMRectReadOnly(double x, double y, double width, double height);
+
+ double m_x;
+ double m_y;
+ double m_width;
+ double m_height;
+};
+
+} // namespace blink
+
+#endif
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMRectInit.idl ('k') | third_party/WebKit/Source/core/dom/DOMRectReadOnly.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698