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

Unified Diff: Source/bindings/v8/custom/V8CSSRegionCustom.cpp

Issue 38943008: Explore the possibility of implementing the CSS Region interface. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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/bindings/v8/custom/V8CSSRegionCustom.cpp
diff --git a/Source/core/css/CSSFilterRule.h b/Source/bindings/v8/custom/V8CSSRegionCustom.cpp
similarity index 61%
copy from Source/core/css/CSSFilterRule.h
copy to Source/bindings/v8/custom/V8CSSRegionCustom.cpp
index 9e605873553aef3821cd10a78e96aa14b9ab9a55..93e47970546d2c1720e39501538dff19f3c9582d 100644
--- a/Source/core/css/CSSFilterRule.h
+++ b/Source/bindings/v8/custom/V8CSSRegionCustom.cpp
@@ -27,37 +27,31 @@
* SUCH DAMAGE.
*/
-#ifndef CSSFilterRule_h
-#define CSSFilterRule_h
+#include "config.h"
+#include "V8CSSRegion.h"
-#include "core/css/CSSRule.h"
+#include "V8HTMLElement.h"
+#include "bindings/v8/V8Binding.h"
+#include "core/css/CSSRegion.h"
+#include "core/dom/Element.h"
+#include "core/dom/Range.h"
+#include "core/rendering/RenderRegion.h"
+#include "wtf/RefPtr.h"
namespace WebCore {
-class CSSStyleDeclaration;
-class StyleRuleFilter;
-class StyleRuleCSSStyleDeclaration;
-
-class CSSFilterRule : public CSSRule {
-public:
- static PassRefPtr<CSSFilterRule> create(StyleRuleFilter* rule, CSSStyleSheet* sheet) { return adoptRef(new CSSFilterRule(rule, sheet)); }
-
- virtual ~CSSFilterRule();
-
- virtual CSSRule::Type type() const OVERRIDE { return WEBKIT_FILTER_RULE; }
- virtual String cssText() const OVERRIDE;
- virtual void reattach(StyleRuleBase*) OVERRIDE;
-
- CSSStyleDeclaration* style() const;
-
-private:
- CSSFilterRule(StyleRuleFilter*, CSSStyleSheet* parent);
-
- RefPtr<StyleRuleFilter> m_filterRule;
- mutable RefPtr<StyleRuleCSSStyleDeclaration> m_propertiesCSSOMWrapper;
-};
-
+v8::Handle<v8::Object> wrap(CSSRegion* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+{
+ ASSERT(impl);
+ const RenderRegion* region = impl->region();
+
+ // FIXME: Add more types once we support the PseudoElement interface
+ ASSERT(region->element());
+ ASSERT(region->element()->isHTMLElement());
+ v8::Handle<v8::Object> wrapper = DOMDataStore::getWrapper<V8HTMLElement>(toHTMLElement(region->element()), isolate);
+ if (!wrapper.IsEmpty())
+ return wrapper;
+ return wrap(toHTMLElement(region->element()), creationContext, isolate);
}
-
-#endif // CSSFilterRule_h
+} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698