Index: third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleRuleCustom.cpp |
diff --git a/third_party/WebKit/public/platform/WebDoublePoint.h b/third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleRuleCustom.cpp |
similarity index 60% |
copy from third_party/WebKit/public/platform/WebDoublePoint.h |
copy to third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleRuleCustom.cpp |
index d666e13379a0d23e55f6525c7c49c6c271ace9f8..f21277067630a4372d7e600dff92bd3c2b7514b6 100644 |
--- a/third_party/WebKit/public/platform/WebDoublePoint.h |
+++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleRuleCustom.cpp |
@@ -1,5 +1,5 @@ |
/* |
- * Copyright 2014 Google Inc. All rights reserved. |
+ * Copyright (C) 2007-2011 Google Inc. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -28,58 +28,31 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef WebDoublePoint_h |
-#define WebDoublePoint_h |
+#include "bindings/core/v8/V8CSSStyleRule.h" |
-#include "WebCommon.h" |
+#include "core/css/CSSRule.h" |
+#include "core/css/CSSStyleSheet.h" |
+#include "core/css/CSSValue.h" |
-#if INSIDE_BLINK |
-#include "platform/geometry/DoublePoint.h" |
-#endif |
+using namespace WTF; |
namespace blink { |
-struct WebDoublePoint { |
- double x; |
- double y; |
- |
- WebDoublePoint() |
- : x(0.0) |
- , y(0.0) |
- { |
- } |
- |
- WebDoublePoint(double x, double y) |
- : x(x) |
- , y(y) |
- { |
- } |
- |
-#if INSIDE_BLINK |
- WebDoublePoint(const DoublePoint& p) |
- : x(p.x()) |
- , y(p.y()) |
- { |
+void V8CSSStyleRule::visitDOMWrapper(v8::Isolate* isolate, ScriptWrappable* scriptWrappable, const v8::Persistent<v8::Object>& wrapper) |
+{ |
+ CSSStyleRule* impl = scriptWrappable->toImpl<CSSStyleRule>(); |
+ v8::Local<v8::Object> context = v8::Local<v8::Object>::New(isolate, wrapper); |
+ v8::Context::Scope scope(context->CreationContext()); |
+ CSSRule* parentRule = impl->parentRule(); |
+ if (parentRule) { |
+ if (DOMDataStore::containsWrapper(parentRule, isolate)) |
+ DOMDataStore::setWrapperReference(wrapper, parentRule, isolate); |
} |
- |
- operator DoublePoint() const |
- { |
- return DoublePoint(x, y); |
+ CSSStyleSheet* parentStyleSheet = impl->parentStyleSheet(); |
+ if (parentStyleSheet) { |
+ if (DOMDataStore::containsWrapper(parentStyleSheet, isolate)) |
+ DOMDataStore::setWrapperReference(wrapper, parentStyleSheet, isolate); |
} |
-#endif |
- |
-}; |
- |
-inline bool operator==(const WebDoublePoint& a, const WebDoublePoint& b) |
-{ |
- return a.x == b.x && a.y == b.y; |
-} |
- |
-inline bool operator!=(const WebDoublePoint& a, const WebDoublePoint& b) |
-{ |
- return !(a == b); |
} |
} // namespace blink |
- |
-#endif |