Commit a23c0523 authored by bashi@chromium.org's avatar bashi@chromium.org

Add DOMPointInit

To remove generic Dictionary from a DOMPoint constructor.
No changes in behavior; fast/dom/geometry-interfaces-dom-point.html
should cover this change.

Spec: http://dev.w3.org/fxtf/geometry/#DOMPoint

BUG=403150

Review URL: https://codereview.chromium.org/558163002

git-svn-id: svn://svn.chromium.org/blink/trunk@181877 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 30444604
......@@ -3346,11 +3346,14 @@
],
'core_dictionary_idl_files': [
'css/FontFaceDescriptors.idl',
'dom/DOMPointInit.idl',
'page/EventSourceInit.idl',
],
'generated_core_dictionary_files': [
'<(blink_core_output_dir)/css/FontFaceDescriptors.cpp',
'<(blink_core_output_dir)/css/FontFaceDescriptors.h',
'<(blink_core_output_dir)/dom/DOMPointInit.cpp',
'<(blink_core_output_dir)/dom/DOMPointInit.h',
'<(blink_core_output_dir)/page/EventSourceInit.cpp',
'<(blink_core_output_dir)/page/EventSourceInit.h',
],
......
......@@ -4,26 +4,13 @@
#include "config.h"
#include "core/dom/DOMPoint.h"
#include "core/dom/DOMPointInit.h"
namespace blink {
DOMPoint* DOMPoint::create(const Dictionary& point)
DOMPoint* DOMPoint::create(const DOMPointInit& point)
{
double x = 0;
double y = 0;
double z = 0;
double w = 0;
if (!DictionaryHelper::get(point, "x", x))
x = 0;
if (!DictionaryHelper::get(point, "y", y))
y = 0;
if (!DictionaryHelper::get(point, "z", z))
z = 0;
if (!DictionaryHelper::get(point, "w", w))
w = 1;
return new DOMPoint(x, y, z, w);
return new DOMPoint(point.x(), point.y(), point.z(), point.w());
}
DOMPoint* DOMPoint::create(double x, double y, double z, double w)
......
......@@ -5,14 +5,15 @@
#ifndef DOMPoint_h
#define DOMPoint_h
#include "bindings/core/v8/Dictionary.h"
#include "core/dom/DOMPointReadOnly.h"
namespace blink {
class DOMPointInit;
class DOMPoint FINAL : public DOMPointReadOnly {
public:
static DOMPoint* create(const Dictionary&);
static DOMPoint* create(const DOMPointInit&);
static DOMPoint* create(double x, double y, double z = 0, double w = 1);
void setX(double x) { m_x = x; }
......
......@@ -2,17 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// FIXME: Blink doesn't currently support dictionary definitions.
// For now, we can use Dictionary interface. See http://crbug.com/321462.
// dictionary DOMPointInit {
// unrestricted double x = 0;
// unrestricted double y = 0;
// unrestricted double z = 0;
// unrestricted double w = 1;
// };
[
Constructor(optional Dictionary point),
Constructor(optional DOMPointInit point),
Constructor(unrestricted double x, unrestricted double y,
optional unrestricted double z = 0, optional unrestricted double w = 1),
RuntimeEnabled=GeometryInterfaces,
......
// 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.
// Spec: http://dev.w3.org/fxtf/geometry/#DOMPoint
[
GarbageCollected
] dictionary DOMPointInit {
unrestricted double x = 0;
unrestricted double y = 0;
unrestricted double z = 0;
unrestricted double w = 1;
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment