/platform/external/webkit/WebCore/bindings/js/JSSVGLengthCustom.cpp

https://github.com/aharish/totoro-gb-opensource-update2 · C++ · 52 lines · 23 code · 11 blank · 18 comment · 0 complexity · 768b300ac3a6c5b4f42fd3edd13609a8 MD5 · raw file

  1. /*
  2. Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
  3. This library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Library General Public
  5. License as published by the Free Software Foundation; either
  6. version 2 of the License, or (at your option) any later version.
  7. This library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public License
  12. along with this library; see the file COPYING.LIB. If not, write to
  13. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  14. Boston, MA 02110-1301, USA.
  15. */
  16. #include "config.h"
  17. #if ENABLE(SVG)
  18. #include "JSSVGLength.h"
  19. using namespace JSC;
  20. namespace WebCore {
  21. JSValue JSSVGLength::value(ExecState* exec) const
  22. {
  23. JSSVGPODTypeWrapper<SVGLength>* imp = impl();
  24. SVGElement* context = JSSVGContextCache::svgContextForDOMObject(const_cast<JSSVGLength*>(this));
  25. SVGLength podImp(*imp);
  26. return jsNumber(exec, podImp.value(context));
  27. }
  28. JSValue JSSVGLength::convertToSpecifiedUnits(ExecState* exec, const ArgList& args)
  29. {
  30. JSSVGPODTypeWrapper<SVGLength>* imp = impl();
  31. SVGElement* context = JSSVGContextCache::svgContextForDOMObject(this);
  32. SVGLength podImp(*imp);
  33. podImp.convertToSpecifiedUnits(args.at(0).toInt32(exec), context);
  34. imp->commitChange(podImp, this);
  35. return jsUndefined();
  36. }
  37. }
  38. #endif // ENABLE(SVG)