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

Unified Diff: Source/bindings/dart/custom/DartElementCustom.cpp

Issue 237513004: Implemented custom support for scrollLeft/scrollTop in Element (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/1847
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/dart/custom/DartElementCustom.cpp
diff --git a/Source/bindings/dart/custom/DartElementCustom.cpp b/Source/bindings/dart/custom/DartElementCustom.cpp
index bcb76c3cbb799a8618403f04b4cf9d4954ddadf9..8bd6865ae9aa3a26975460074af4e485a90c2089 100644
--- a/Source/bindings/dart/custom/DartElementCustom.cpp
+++ b/Source/bindings/dart/custom/DartElementCustom.cpp
@@ -33,6 +33,7 @@
#include "DartElement.h"
#include "DartHTMLElement.h"
#include "DartSVGElement.h"
+#include "RuntimeEnabledFeatures.h"
#include "bindings/dart/DartDOMWrapper.h"
namespace WebCore {
@@ -51,35 +52,46 @@ Dart_Handle DartElement::createWrapper(DartDOMData* domData, Element* element)
namespace DartElementInternal {
-void scrollLeftGetter(Dart_NativeArguments args)
+
+void scrollLeftSetter(Dart_NativeArguments args)
{
+ Dart_Handle exception = 0;
{
- Element* receiver = DartDOMWrapper::receiver< Element >(args);
+ Element* receiver = DartDOMWrapper::receiver<Element>(args);
- DartUtilities::setDartIntegerReturnValue(args, receiver->scrollLeft());
+ // FIXME: The IDL now specifies an option to pass in a dictionary
+ // instead of just an integer.
+ int scrollLeft = DartUtilities::dartToInt(args, 1, exception);
+ if (exception)
+ goto fail;
+
+ receiver->setScrollLeft(scrollLeft);
return;
}
+
+fail:
+ Dart_ThrowException(exception);
+ ASSERT_NOT_REACHED();
}
-void scrollTopGetter(Dart_NativeArguments args)
+void scrollTopSetter(Dart_NativeArguments args)
{
+ Dart_Handle exception = 0;
{
- Element* receiver = DartDOMWrapper::receiver< Element >(args);
+ Element* receiver = DartDOMWrapper::receiver<Element>(args);
- DartUtilities::setDartIntegerReturnValue(args, receiver->scrollTop());
+ // FIXME: The IDL now specifies an option to pass in a dictionary
+ // instead of just an integer.
+ int scrollTop = DartUtilities::dartToInt(args, 1, exception);
+ if (exception)
+ goto fail;
+
+ receiver->setScrollTop(scrollTop);
return;
}
-}
-void scrollLeftSetter(Dart_NativeArguments args)
-{
- // FIXMEDART: implement
- ASSERT_NOT_REACHED();
-}
-
-void scrollTopSetter(Dart_NativeArguments args)
-{
- // FIXMEDART: implement
+fail:
+ Dart_ThrowException(exception);
ASSERT_NOT_REACHED();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698