RESOLVED FIXED Bug 23943
Implement WebKitPoint and APIs to map points through transforms
https://bugs.webkit.org/show_bug.cgi?id=23943
Summary Implement WebKitPoint and APIs to map points through transforms
Simon Fraser (smfr)
Reported 2009-02-12 22:25:45 PST
We need to add a 'point' object (WebKitPoint) and a way to map points through possibly-transformed elements.
Attachments
Patch with test (41.92 KB, patch)
2009-02-24 17:26 PST, Chris Marrin
simon.fraser: review+
Chris Marrin
Comment 1 2009-02-24 17:26:55 PST
Created attachment 27944 [details] Patch with test
Simon Fraser (smfr)
Comment 2 2009-02-24 17:41:24 PST
Comment on attachment 27944 [details] Patch with test > Index: WebCore/WebCore.vcproj/WebCore.vcproj > =================================================================== > <File > + RelativePath="..\page\WebKitPoint.cpp" > + > > + <FileConfiguration Don't include the FileConfiguration hunks > Index: WebCore/WebCore.xcodeproj/project.pbxproj > =================================================================== > + 494BD51E0F53721D00747828 /* WebKitPoint.idl in Resources */ = {isa = PBXBuildFile; fileRef = 494BD51C0F53721C00747828 /* WebKitPoint.idl */; }; Please remove the idl from Resources. > Index: WebCore/bindings/js/JSWebKitPointConstructor.cpp > =================================================================== > --- WebCore/bindings/js/JSWebKitPointConstructor.cpp (revision 0) > +++ WebCore/bindings/js/JSWebKitPointConstructor.cpp (revision 0) > @@ -0,0 +1,61 @@ > +/* > + * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. > + * > + * This library is free software; you can redistribute it and/or > + * modify it under the terms of the GNU Library General Public > + * License as published by the Free Software Foundation; either > + * version 2 of the License, or (at your option) any later version. > + * > + * This library is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * Library General Public License for more details. > + * > + * You should have received a copy of the GNU Library General Public License > + * along with this library; see the file COPYING.LIB. If not, write to > + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, > + * Boston, MA 02110-1301, USA. > + */ Apple license, not LGPL please. > Index: WebCore/bindings/js/JSWebKitPointConstructor.h > =================================================================== > --- WebCore/bindings/js/JSWebKitPointConstructor.h (revision 0) > +++ WebCore/bindings/js/JSWebKitPointConstructor.h (revision 0) > @@ -0,0 +1,46 @@ > +/* > + * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 2009 > Index: WebCore/page/DOMWindow.cpp > =================================================================== > +PassRefPtr<WebKitPoint> DOMWindow::webkitConvertPointFromNodeToPage(Node* node, const WebKitPoint* p) const > +{ > + if (!node || !p) > + return 0; > + > + FloatPoint pp(p->x(), p->y()); > + pp = node->convertToPage(pp); > + return WebKitPoint::create(pp.x(), pp.y()); > +} Use pagePoint, or absolutePoint, not pp, for readability. > + FloatPoint pp(p->x(), p->y()); > + pp = node->convertFromPage(pp); > + return WebKitPoint::create(pp.x(), pp.y()); localPoint, rather than pp. > Index: WebCore/page/WebKitPoint.h > =================================================================== > --- WebCore/page/WebKitPoint.h (revision 0) > +++ WebCore/page/WebKitPoint.h (revision 0) > @@ -0,0 +1,66 @@ > +/* > + * Copyright (C) 2007 Apple Inc. All rights reserved. 2009 > + private: > + WebKitPoint(float x=0, float y=0) > + : m_x(x) > + , m_y(y) Indent these two lines > Index: WebCore/page/WebKitPoint.idl > =================================================================== > + * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 2009 > +module window { > + > + interface WebKitPoint { > + attribute float x; > + attribute float y; > + }; r=me with those fixes.
Simon Fraser (smfr)
Comment 3 2009-02-25 11:06:14 PST
Chris Marrin
Comment 4 2009-02-25 11:10:24 PST
Sending LayoutTests/ChangeLog Adding LayoutTests/fast/dom/Window/webkitConvertPoint-expected.txt Adding LayoutTests/fast/dom/Window/webkitConvertPoint.html Sending LayoutTests/fast/dom/Window/window-properties-expected.txt Sending LayoutTests/fast/js/global-constructors-expected.txt Sending WebCore/ChangeLog Sending WebCore/DerivedSources.make Sending WebCore/WebCore.pro Sending WebCore/WebCore.vcproj/WebCore.vcproj Sending WebCore/WebCore.xcodeproj/project.pbxproj Sending WebCore/WebCoreSources.bkl Sending WebCore/bindings/js/JSDOMWindowBase.cpp Adding WebCore/bindings/js/JSWebKitPointConstructor.cpp Adding WebCore/bindings/js/JSWebKitPointConstructor.h Sending WebCore/dom/Node.cpp Sending WebCore/dom/Node.h Sending WebCore/page/DOMWindow.cpp Sending WebCore/page/DOMWindow.h Sending WebCore/page/DOMWindow.idl Adding WebCore/page/WebKitPoint.h Adding WebCore/page/WebKitPoint.idl Transmitting file data ..................... Committed revision 41218.
Chris Marrin
Comment 5 2009-02-25 11:56:39 PST
Windows build is broken
Chris Marrin
Comment 6 2009-02-25 14:00:04 PST
Note You need to log in before you can comment on or make changes to this bug.