WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-163534-20161017175338.patch (text/plain), 52.27 KB, created by
Simon Fraser (smfr)
on 2016-10-17 17:57:11 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2016-10-17 17:57:11 PDT
Size:
52.27 KB
patch
obsolete
>Subversion Revision: 207438 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3142876a6404a37ef021b56c2ade6df88ffa2395..6fa1ea8479f43e8bea5973b5d07c46a92dc40cfa 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,5 +1,49 @@ > 2016-10-17 Simon Fraser <simon.fraser@apple.com> > >+ Implement DOMQuad >+ https://bugs.webkit.org/show_bug.cgi?id=163534 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Implement DOMQuad according to <https://drafts.fxtf.org/geometry/#DOMQuad>. >+ >+ Use custom getters for p1...p4 so that DOMQuad can return const DOMPointInit&, >+ while the bindings need RefPtr<DOMPoint>. Similarly for getBounds(). >+ >+ Test: geometry/DOMQuad-001.html >+ >+ * CMakeLists.txt: >+ * DerivedSources.make: >+ * WebCore.xcodeproj/project.pbxproj: >+ * bindings/js/JSBindingsAllInOne.cpp: >+ * bindings/js/JSDOMQuadCustom.cpp: Added. >+ (WebCore::JSDOMQuad::p1): >+ (WebCore::JSDOMQuad::p2): >+ (WebCore::JSDOMQuad::p3): >+ (WebCore::JSDOMQuad::p4): >+ (WebCore::JSDOMQuad::getBounds): >+ * bindings/scripts/IDLParser.pm: >+ (isSerializableAttribute): >+ * dom/DOMQuad.cpp: Added. >+ (WebCore::DOMQuad::getBounds): >+ * dom/DOMQuad.h: Added. >+ (WebCore::DOMQuad::create): >+ (WebCore::DOMQuad::fromRect): >+ (WebCore::DOMQuad::fromQuad): >+ (WebCore::DOMQuad::p1): >+ (WebCore::DOMQuad::p2): >+ (WebCore::DOMQuad::p3): >+ (WebCore::DOMQuad::p4): >+ (WebCore::DOMQuad::DOMQuad): >+ (WebCore::DOMQuad::m_p2): >+ (WebCore::DOMQuad::m_p3): >+ (WebCore::DOMQuad::m_p4): >+ * dom/DOMQuad.idl: Added. >+ * dom/DOMQuadInit.h: Added. >+ * dom/DOMQuadInit.idl: Added. >+ >+2016-10-17 Simon Fraser <simon.fraser@apple.com> >+ > Implement DOMRect/DOMRectReadOnly > https://bugs.webkit.org/show_bug.cgi?id=163464 > >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index 81e7ec50bcb1f386a8ffc78f526d55b5db42bf50..7ba3965502dd89a30ccfebbcc468985a1efd8491 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -389,6 +389,8 @@ set(WebCore_NON_SVG_IDL_FILES > dom/DOMPoint.idl > dom/DOMPointInit.idl > dom/DOMPointReadOnly.idl >+ dom/DOMQuad.idl >+ dom/DOMQuadInit.idl > dom/DOMRect.idl > dom/DOMRectInit.idl > dom/DOMRectReadOnly.idl >@@ -1102,6 +1104,7 @@ set(WebCore_SOURCES > bindings/js/JSDOMPluginArrayCustom.cpp > bindings/js/JSDOMPluginCustom.cpp > bindings/js/JSDOMPromise.cpp >+ bindings/js/JSDOMQuadCustom.cpp > bindings/js/JSDOMStringMapCustom.cpp > bindings/js/JSDOMWindowBase.cpp > bindings/js/JSDOMWindowCustom.cpp >diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make >index 818ad905c50955b27692a6aeec8c2e02744dd59c..1a12cae552d6b799b2914a0a33dc4ebc32221a63 100644 >--- a/Source/WebCore/DerivedSources.make >+++ b/Source/WebCore/DerivedSources.make >@@ -297,6 +297,8 @@ JS_BINDING_IDLS = \ > $(WebCore)/dom/DOMPoint.idl \ > $(WebCore)/dom/DOMPointInit.idl \ > $(WebCore)/dom/DOMPointReadOnly.idl \ >+ $(WebCore)/dom/DOMQuad.idl \ >+ $(WebCore)/dom/DOMQuadInit.idl \ > $(WebCore)/dom/DOMRect.idl \ > $(WebCore)/dom/DOMRectInit.idl \ > $(WebCore)/dom/DOMRectReadOnly.idl \ >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 376d5731ccb83281eebf5bc37747f9392a241ef4..b1bfaea257d628d4c3119a88d3380de08dce7503 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -475,6 +475,14 @@ > 0F4710BE1DB56BE8002DCEC3 /* JSDOMRectInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4710B81DB56BE8002DCEC3 /* JSDOMRectInit.h */; }; > 0F4710BF1DB56BE8002DCEC3 /* JSDOMRectReadOnly.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4710B91DB56BE8002DCEC3 /* JSDOMRectReadOnly.cpp */; }; > 0F4710C01DB56BE8002DCEC3 /* JSDOMRectReadOnly.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4710BA1DB56BE8002DCEC3 /* JSDOMRectReadOnly.h */; }; >+ 0F4710C61DB595EF002DCEC3 /* DOMQuad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4710C11DB595EF002DCEC3 /* DOMQuad.cpp */; }; >+ 0F4710C71DB595EF002DCEC3 /* DOMQuad.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4710C21DB595EF002DCEC3 /* DOMQuad.h */; }; >+ 0F4710C91DB595EF002DCEC3 /* DOMQuadInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4710C41DB595EF002DCEC3 /* DOMQuadInit.h */; }; >+ 0F4710CF1DB59628002DCEC3 /* JSDOMQuad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4710CB1DB59628002DCEC3 /* JSDOMQuad.cpp */; }; >+ 0F4710D01DB59628002DCEC3 /* JSDOMQuad.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4710CC1DB59628002DCEC3 /* JSDOMQuad.h */; }; >+ 0F4710D11DB59628002DCEC3 /* JSDOMQuadInit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4710CD1DB59628002DCEC3 /* JSDOMQuadInit.cpp */; }; >+ 0F4710D21DB59628002DCEC3 /* JSDOMQuadInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4710CE1DB59628002DCEC3 /* JSDOMQuadInit.h */; }; >+ 0F4710D41DB5A488002DCEC3 /* JSDOMQuadCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F4710D31DB5A488002DCEC3 /* JSDOMQuadCustom.cpp */; }; > 0F49669D1DB408C100A274BB /* DOMPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4966991DB408C100A274BB /* DOMPoint.h */; }; > 0F49669F1DB408C100A274BB /* DOMPointReadOnly.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F49669B1DB408C100A274BB /* DOMPointReadOnly.h */; }; > 0F4966A31DB4091000A274BB /* DOMPointInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F4966A21DB4091000A274BB /* DOMPointInit.h */; }; >@@ -7324,12 +7332,22 @@ > 0F4710AC1DB56AFC002DCEC3 /* DOMRectInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMRectInit.idl; sourceTree = "<group>"; }; > 0F4710AD1DB56AFC002DCEC3 /* DOMRectReadOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMRectReadOnly.h; sourceTree = "<group>"; }; > 0F4710AE1DB56AFC002DCEC3 /* DOMRectReadOnly.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMRectReadOnly.idl; sourceTree = "<group>"; }; >- 0F4710B51DB56BE8002DCEC3 /* JSDOMRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSDOMRect.cpp; path = JSDOMRect.cpp; sourceTree = "<group>"; }; >- 0F4710B61DB56BE8002DCEC3 /* JSDOMRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSDOMRect.h; path = JSDOMRect.h; sourceTree = "<group>"; }; >- 0F4710B71DB56BE8002DCEC3 /* JSDOMRectInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSDOMRectInit.cpp; path = JSDOMRectInit.cpp; sourceTree = "<group>"; }; >- 0F4710B81DB56BE8002DCEC3 /* JSDOMRectInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSDOMRectInit.h; path = JSDOMRectInit.h; sourceTree = "<group>"; }; >- 0F4710B91DB56BE8002DCEC3 /* JSDOMRectReadOnly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSDOMRectReadOnly.cpp; path = JSDOMRectReadOnly.cpp; sourceTree = "<group>"; }; >- 0F4710BA1DB56BE8002DCEC3 /* JSDOMRectReadOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSDOMRectReadOnly.h; path = JSDOMRectReadOnly.h; sourceTree = "<group>"; }; >+ 0F4710B51DB56BE8002DCEC3 /* JSDOMRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMRect.cpp; sourceTree = "<group>"; }; >+ 0F4710B61DB56BE8002DCEC3 /* JSDOMRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMRect.h; sourceTree = "<group>"; }; >+ 0F4710B71DB56BE8002DCEC3 /* JSDOMRectInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMRectInit.cpp; sourceTree = "<group>"; }; >+ 0F4710B81DB56BE8002DCEC3 /* JSDOMRectInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMRectInit.h; sourceTree = "<group>"; }; >+ 0F4710B91DB56BE8002DCEC3 /* JSDOMRectReadOnly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMRectReadOnly.cpp; sourceTree = "<group>"; }; >+ 0F4710BA1DB56BE8002DCEC3 /* JSDOMRectReadOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMRectReadOnly.h; sourceTree = "<group>"; }; >+ 0F4710C11DB595EF002DCEC3 /* DOMQuad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMQuad.cpp; sourceTree = "<group>"; }; >+ 0F4710C21DB595EF002DCEC3 /* DOMQuad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMQuad.h; sourceTree = "<group>"; }; >+ 0F4710C31DB595EF002DCEC3 /* DOMQuad.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMQuad.idl; sourceTree = "<group>"; }; >+ 0F4710C41DB595EF002DCEC3 /* DOMQuadInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMQuadInit.h; sourceTree = "<group>"; }; >+ 0F4710C51DB595EF002DCEC3 /* DOMQuadInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMQuadInit.idl; sourceTree = "<group>"; }; >+ 0F4710CB1DB59628002DCEC3 /* JSDOMQuad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMQuad.cpp; sourceTree = "<group>"; }; >+ 0F4710CC1DB59628002DCEC3 /* JSDOMQuad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMQuad.h; sourceTree = "<group>"; }; >+ 0F4710CD1DB59628002DCEC3 /* JSDOMQuadInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMQuadInit.cpp; sourceTree = "<group>"; }; >+ 0F4710CE1DB59628002DCEC3 /* JSDOMQuadInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMQuadInit.h; sourceTree = "<group>"; }; >+ 0F4710D31DB5A488002DCEC3 /* JSDOMQuadCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMQuadCustom.cpp; sourceTree = "<group>"; }; > 0F4966991DB408C100A274BB /* DOMPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMPoint.h; sourceTree = "<group>"; }; > 0F49669A1DB408C100A274BB /* DOMPoint.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMPoint.idl; sourceTree = "<group>"; }; > 0F49669B1DB408C100A274BB /* DOMPointReadOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMPointReadOnly.h; sourceTree = "<group>"; }; >@@ -17702,10 +17720,10 @@ > 71D6AA391DA4EAF700B23969 /* modern-media-controls */ = { > isa = PBXGroup; > children = ( >- 71D02D901DB55C4E00DD5CF5 /* main.js */, > 716FA0D71DB26591007323CC /* controls */, > 71D6AA6F1DA4EAF700B23969 /* images */, > 71D02D911DB55C4E00DD5CF5 /* media */, >+ 71D02D901DB55C4E00DD5CF5 /* main.js */, > ); > path = "modern-media-controls"; > sourceTree = "<group>"; >@@ -19980,6 +19998,10 @@ > 0F4966A71DB40C4300A274BB /* JSDOMPointInit.h */, > 0F4966A81DB40C4300A274BB /* JSDOMPointReadOnly.cpp */, > 0F4966A91DB40C4300A274BB /* JSDOMPointReadOnly.h */, >+ 0F4710CB1DB59628002DCEC3 /* JSDOMQuad.cpp */, >+ 0F4710CC1DB59628002DCEC3 /* JSDOMQuad.h */, >+ 0F4710CD1DB59628002DCEC3 /* JSDOMQuadInit.cpp */, >+ 0F4710CE1DB59628002DCEC3 /* JSDOMQuadInit.h */, > 0F4710B51DB56BE8002DCEC3 /* JSDOMRect.cpp */, > 0F4710B61DB56BE8002DCEC3 /* JSDOMRect.h */, > 0F4710B71DB56BE8002DCEC3 /* JSDOMRectInit.cpp */, >@@ -21545,6 +21567,7 @@ > A9C6E6460D7465CA006442E9 /* JSDOMMimeTypeArrayCustom.cpp */, > A9C6E64A0D7465E7006442E9 /* JSDOMPluginArrayCustom.cpp */, > A9C6E64B0D7465E7006442E9 /* JSDOMPluginCustom.cpp */, >+ 0F4710D31DB5A488002DCEC3 /* JSDOMQuadCustom.cpp */, > BC64649B11D8238C006455B0 /* JSDOMStringMapCustom.cpp */, > BCD9C25E0C17AA67005C90A2 /* JSDOMWindowCustom.cpp */, > 652FBBBB0DE27CB60001D386 /* JSDOMWindowCustom.h */, >@@ -23452,6 +23475,11 @@ > 0F4966A11DB4090100A274BB /* DOMPointInit.idl */, > 0F49669B1DB408C100A274BB /* DOMPointReadOnly.h */, > 0F49669C1DB408C100A274BB /* DOMPointReadOnly.idl */, >+ 0F4710C11DB595EF002DCEC3 /* DOMQuad.cpp */, >+ 0F4710C21DB595EF002DCEC3 /* DOMQuad.h */, >+ 0F4710C31DB595EF002DCEC3 /* DOMQuad.idl */, >+ 0F4710C41DB595EF002DCEC3 /* DOMQuadInit.h */, >+ 0F4710C51DB595EF002DCEC3 /* DOMQuadInit.idl */, > 0F4710A91DB56AFC002DCEC3 /* DOMRect.h */, > 0F4710AA1DB56AFC002DCEC3 /* DOMRect.idl */, > 0F4710AB1DB56AFC002DCEC3 /* DOMRectInit.h */, >@@ -24813,6 +24841,8 @@ > 0F49669D1DB408C100A274BB /* DOMPoint.h in Headers */, > 0F4966A31DB4091000A274BB /* DOMPointInit.h in Headers */, > 0F49669F1DB408C100A274BB /* DOMPointReadOnly.h in Headers */, >+ 0F4710C71DB595EF002DCEC3 /* DOMQuad.h in Headers */, >+ 0F4710C91DB595EF002DCEC3 /* DOMQuadInit.h in Headers */, > 0F4710AF1DB56AFC002DCEC3 /* DOMRect.h in Headers */, > 0F4710B11DB56AFC002DCEC3 /* DOMRectInit.h in Headers */, > 0F4710B31DB56AFC002DCEC3 /* DOMRectReadOnly.h in Headers */, >@@ -25485,6 +25515,8 @@ > 0F4966AD1DB40C4300A274BB /* JSDOMPointInit.h in Headers */, > 0F4966AF1DB40C4300A274BB /* JSDOMPointReadOnly.h in Headers */, > E172AF901811BC3700FBADB9 /* JSDOMPromise.h in Headers */, >+ 0F4710D01DB59628002DCEC3 /* JSDOMQuad.h in Headers */, >+ 0F4710D21DB59628002DCEC3 /* JSDOMQuadInit.h in Headers */, > 0F4710BC1DB56BE8002DCEC3 /* JSDOMRect.h in Headers */, > 0F4710BE1DB56BE8002DCEC3 /* JSDOMRectInit.h in Headers */, > 0F4710C01DB56BE8002DCEC3 /* JSDOMRectReadOnly.h in Headers */, >@@ -28530,6 +28562,7 @@ > 2D5002F81B56D7810020AAF7 /* DOMPath.cpp in Sources */, > A9C6E4EB0D745E2B006442E9 /* DOMPlugin.cpp in Sources */, > A9C6E4EF0D745E38006442E9 /* DOMPluginArray.cpp in Sources */, >+ 0F4710C61DB595EF002DCEC3 /* DOMQuad.cpp in Sources */, > BC5A86840C33676000EEA649 /* DOMSelection.cpp in Sources */, > C55610F111A704EB00B82D27 /* DOMStringList.cpp in Sources */, > 188604B30F2E654A000B6443 /* DOMTimer.cpp in Sources */, >@@ -29167,6 +29200,9 @@ > 0F4966AC1DB40C4300A274BB /* JSDOMPointInit.cpp in Sources */, > 0F4966AE1DB40C4300A274BB /* JSDOMPointReadOnly.cpp in Sources */, > E172AF8F1811BC3700FBADB9 /* JSDOMPromise.cpp in Sources */, >+ 0F4710CF1DB59628002DCEC3 /* JSDOMQuad.cpp in Sources */, >+ 0F4710D41DB5A488002DCEC3 /* JSDOMQuadCustom.cpp in Sources */, >+ 0F4710D11DB59628002DCEC3 /* JSDOMQuadInit.cpp in Sources */, > 0F4710BB1DB56BE8002DCEC3 /* JSDOMRect.cpp in Sources */, > 0F4710BD1DB56BE8002DCEC3 /* JSDOMRectInit.cpp in Sources */, > 0F4710BF1DB56BE8002DCEC3 /* JSDOMRectReadOnly.cpp in Sources */, >diff --git a/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp b/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp >index 821ad27068f9db919ec7b05d2ffa0cf0377072f4..cdb08bb022f5d6365a1895306b8e13ffb9bd1cd7 100644 >--- a/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp >+++ b/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp >@@ -54,6 +54,7 @@ > #include "JSDOMPluginArrayCustom.cpp" > #include "JSDOMPluginCustom.cpp" > #include "JSDOMPromise.cpp" >+#include "JSDOMQuadCustom.cpp" > #include "JSDOMStringMapCustom.cpp" > #include "JSDOMWindowBase.cpp" > #include "JSDOMWindowCustom.cpp" >diff --git a/Source/WebCore/bindings/js/JSDOMQuadCustom.cpp b/Source/WebCore/bindings/js/JSDOMQuadCustom.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..5819ab3b405ab3babf96b042b9006da4eeb0ccbe >--- /dev/null >+++ b/Source/WebCore/bindings/js/JSDOMQuadCustom.cpp >@@ -0,0 +1,89 @@ >+/* >+ * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "JSDOMQuad.h" >+ >+#include "ExceptionCode.h" >+#include "JSDOMPoint.h" >+#include "JSDOMRect.h" >+#include <wtf/GetPtr.h> >+ >+using namespace JSC; >+ >+namespace WebCore { >+ >+JSValue JSDOMQuad::p1(ExecState& state) const >+{ >+ if (JSValue cachedValue = m_p1.get()) >+ return cachedValue; >+ auto& impl = wrapped(); >+ Ref<DOMPoint> point = DOMPoint::create(impl.p1().x, impl.p1().y, impl.p1().z, impl.p1().w); >+ JSValue result = toJS(&state, globalObject(), point.get()); >+ m_p1.set(state.vm(), this, result); >+ return result; >+} >+ >+JSValue JSDOMQuad::p2(ExecState& state) const >+{ >+ if (JSValue cachedValue = m_p2.get()) >+ return cachedValue; >+ auto& impl = wrapped(); >+ Ref<DOMPoint> point = DOMPoint::create(impl.p2().x, impl.p2().y, impl.p2().z, impl.p2().w); >+ JSValue result = toJS(&state, globalObject(), point.get()); >+ m_p2.set(state.vm(), this, result); >+ return result; >+} >+ >+JSValue JSDOMQuad::p3(ExecState& state) const >+{ >+ if (JSValue cachedValue = m_p3.get()) >+ return cachedValue; >+ auto& impl = wrapped(); >+ Ref<DOMPoint> point = DOMPoint::create(impl.p3().x, impl.p3().y, impl.p3().z, impl.p3().w); >+ JSValue result = toJS(&state, globalObject(), point.get()); >+ m_p3.set(state.vm(), this, result); >+ return result; >+} >+ >+JSValue JSDOMQuad::p4(ExecState& state) const >+{ >+ if (JSValue cachedValue = m_p4.get()) >+ return cachedValue; >+ auto& impl = wrapped(); >+ Ref<DOMPoint> point = DOMPoint::create(impl.p4().x, impl.p4().y, impl.p4().z, impl.p4().w); >+ JSValue result = toJS(&state, globalObject(), point.get()); >+ m_p4.set(state.vm(), this, result); >+ return result; >+} >+ >+JSValue JSDOMQuad::getBounds(ExecState& state) >+{ >+ auto& impl = wrapped(); >+ Ref<DOMRect> boundsRect = DOMRect::fromRect(impl.getBounds()); >+ return toJS(&state, globalObject(), boundsRect); >+} >+ >+} >diff --git a/Source/WebCore/bindings/scripts/IDLParser.pm b/Source/WebCore/bindings/scripts/IDLParser.pm >index cd9683912ee471158cab94b732bcaa9ffda3ae6b..5f9715e2504bd76eb7284edeb5d8d9e2de94cdb6 100644 >--- a/Source/WebCore/bindings/scripts/IDLParser.pm >+++ b/Source/WebCore/bindings/scripts/IDLParser.pm >@@ -2339,7 +2339,7 @@ sub isSerializableAttribute > # FIXME: Need to support more than primitive serializable types. > # This check may have to move to the code generator, if we don't have enough information > # here to determine serializability: https://heycam.github.io/webidl/#idl-serializers >- my $serializable_types = '^(\(byte|octet|short|unsigned short|long|unsigned long|long long|unsigned long long|float|unrestricted float|double|unrestricted double|boolean|DOMString|ByteString|USVString)$'; >+ my $serializable_types = '^(\(byte|octet|short|unsigned short|long|unsigned long|long long|unsigned long long|float|unrestricted float|double|unrestricted double|boolean|DOMPoint|DOMString|ByteString|USVString)$'; > return $attribute->signature->type =~ /$serializable_types/; > } > >diff --git a/Source/WebCore/dom/DOMQuad.cpp b/Source/WebCore/dom/DOMQuad.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..0b34a511c01fcf4b81d0c20271f1d3873bd98d79 >--- /dev/null >+++ b/Source/WebCore/dom/DOMQuad.cpp >@@ -0,0 +1,43 @@ >+/* >+ * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "DOMQuad.h" >+ >+#include <wtf/MathExtras.h> >+ >+namespace WebCore { >+ >+DOMRectInit DOMQuad::getBounds() const >+{ >+ double left = WTF::nanPropagatingMin(WTF::nanPropagatingMin(WTF::nanPropagatingMin(m_p1.x, m_p2.x), m_p3.x), m_p4.x); >+ double top = WTF::nanPropagatingMin(WTF::nanPropagatingMin(WTF::nanPropagatingMin(m_p1.y, m_p2.y), m_p3.y), m_p4.y); >+ double right = WTF::nanPropagatingMax(WTF::nanPropagatingMax(WTF::nanPropagatingMax(m_p1.x, m_p2.x), m_p3.x), m_p4.x); >+ double bottom = WTF::nanPropagatingMax(WTF::nanPropagatingMax(WTF::nanPropagatingMax(m_p1.y, m_p2.y), m_p3.y), m_p4.y); >+ >+ return { left, top, right - left, bottom - top }; >+} >+ >+} >diff --git a/Source/WebCore/dom/DOMQuad.h b/Source/WebCore/dom/DOMQuad.h >new file mode 100644 >index 0000000000000000000000000000000000000000..7a6bf728d437dd8b745cf214cce01517c941d6e7 >--- /dev/null >+++ b/Source/WebCore/dom/DOMQuad.h >@@ -0,0 +1,84 @@ >+/* >+ * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "DOMPointInit.h" >+#include "DOMQuadInit.h" >+#include "DOMRect.h" >+#include "DOMRectInit.h" >+#include "ScriptWrappable.h" >+#include <wtf/Ref.h> >+#include <wtf/RefCounted.h> >+ >+namespace WebCore { >+ >+class DOMQuad : public ScriptWrappable, public RefCounted<DOMQuad> { >+public: >+ static Ref<DOMQuad> create() { return adoptRef(*new DOMQuad); } >+ static Ref<DOMQuad> create(const DOMPointInit& p1, const DOMPointInit& p2, const DOMPointInit& p3, const DOMPointInit& p4) { return adoptRef(*new DOMQuad(p1, p2, p3, p4)); } >+ >+ static Ref<DOMQuad> fromRect(const DOMRectInit& init) { return adoptRef(*new DOMQuad(init)); } >+ static Ref<DOMQuad> fromQuad(const DOMQuadInit& init) { return create(init.p1, init.p2, init.p3, init.p4); } >+ >+ const DOMPointInit& p1() const { return m_p1; } >+ const DOMPointInit& p2() const { return m_p2; } >+ const DOMPointInit& p3() const { return m_p3; } >+ const DOMPointInit& p4() const { return m_p4; } >+ >+ DOMRectInit getBounds() const; >+ >+private: >+ DOMQuad() >+ { >+ } >+ >+ DOMQuad(const DOMPointInit& p1, const DOMPointInit& p2, const DOMPointInit& p3, const DOMPointInit& p4) >+ : m_p1(p1) >+ , m_p2(p2) >+ , m_p3(p3) >+ , m_p4(p4) >+ { >+ } >+ >+ // p1------p2 >+ // | | >+ // | | >+ // p4------p3 >+ explicit DOMQuad(const DOMRectInit& r) >+ : m_p1({ r.x, r.y }) >+ , m_p2({ r.x + r.width, r.y }) >+ , m_p3({ r.x + r.width, r.y + r.height }) >+ , m_p4({ r.x, r.y + r.height }) >+ { >+ } >+ >+ DOMPointInit m_p1; >+ DOMPointInit m_p2; >+ DOMPointInit m_p3; >+ DOMPointInit m_p4; >+}; >+ >+} >diff --git a/Source/WebCore/dom/DOMQuad.idl b/Source/WebCore/dom/DOMQuad.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..dfd662d0254cb89b30afdc9f4ff4f68c3f6a80d2 >--- /dev/null >+++ b/Source/WebCore/dom/DOMQuad.idl >@@ -0,0 +1,46 @@ >+/* >+ * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+// https://drafts.fxtf.org/geometry-1/#DOMRect >+ >+[ >+ Constructor(optional DOMPointInit p1, optional DOMPointInit p2, >+ optional DOMPointInit p3, optional DOMPointInit p4), >+ Exposed=(Window,Worker), >+ ImplementationLacksVTable >+] >+interface DOMQuad { >+ [NewObject] static DOMQuad fromRect(optional DOMRectInit other); >+ [NewObject] static DOMQuad fromQuad(optional DOMQuadInit other); >+ >+ // FIXME: Add support for SameObject >+ [CachedAttribute, CustomGetter] readonly attribute DOMPoint p1; >+ [CachedAttribute, CustomGetter] readonly attribute DOMPoint p2; >+ [CachedAttribute, CustomGetter] readonly attribute DOMPoint p3; >+ [CachedAttribute, CustomGetter] readonly attribute DOMPoint p4; >+ [NewObject, Custom] DOMRect getBounds(); >+ >+ serializer = { attribute }; >+}; >diff --git a/Source/WebCore/dom/DOMQuadInit.h b/Source/WebCore/dom/DOMQuadInit.h >new file mode 100644 >index 0000000000000000000000000000000000000000..cf869ec2f2f5dee0dc28d84c760b62a6c6e7acab >--- /dev/null >+++ b/Source/WebCore/dom/DOMQuadInit.h >@@ -0,0 +1,39 @@ >+/* >+ * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "DOMPointInit.h" >+ >+namespace WebCore { >+ >+struct DOMQuadInit { >+ DOMPointInit p1; >+ DOMPointInit p2; >+ DOMPointInit p3; >+ DOMPointInit p4; >+}; >+ >+} >diff --git a/Source/WebCore/dom/DOMQuadInit.idl b/Source/WebCore/dom/DOMQuadInit.idl >new file mode 100644 >index 0000000000000000000000000000000000000000..b0ee434ff01beaadc2947d828a28b6da17189e32 >--- /dev/null >+++ b/Source/WebCore/dom/DOMQuadInit.idl >@@ -0,0 +1,33 @@ >+/* >+ * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+// https://drafts.fxtf.org/geometry-1/#DOMRect >+ >+dictionary DOMQuadInit { >+ DOMPointInit p1; >+ DOMPointInit p2; >+ DOMPointInit p3; >+ DOMPointInit p4; >+}; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 0c03abcf822b56691292426dbe806924eddac7ef..539ac58d212fa5195bbf552811119bbe450a2aac 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,5 +1,24 @@ > 2016-10-17 Simon Fraser <simon.fraser@apple.com> > >+ Implement DOMQuad >+ https://bugs.webkit.org/show_bug.cgi?id=163534 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * geometry/DOMQuad-001-expected.txt: Added. >+ * geometry/DOMQuad-001.html: Added. >+ * geometry/DOMRect-001.html: >+ * js/dom/global-constructors-attributes-dedicated-worker-expected.txt: >+ * js/dom/global-constructors-attributes-expected.txt: >+ * platform/efl/js/dom/global-constructors-attributes-expected.txt: >+ * platform/gtk/js/dom/global-constructors-attributes-expected.txt: >+ * platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt: >+ * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt: >+ * platform/mac/js/dom/global-constructors-attributes-expected.txt: >+ * platform/win/js/dom/global-constructors-attributes-expected.txt: >+ >+2016-10-17 Simon Fraser <simon.fraser@apple.com> >+ > Implement DOMRect/DOMRectReadOnly > https://bugs.webkit.org/show_bug.cgi?id=163464 > >diff --git a/LayoutTests/geometry/DOMQuad-001-expected.txt b/LayoutTests/geometry/DOMQuad-001-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..09ce56c95b5542cac110541d7e6aa6651573f2b5 >--- /dev/null >+++ b/LayoutTests/geometry/DOMQuad-001-expected.txt >@@ -0,0 +1,20 @@ >+Test the DOMQuad interface >+ >+ >+PASS testConstructor0 >+PASS testConstructor1 >+PASS testConstructor2 >+PASS testConstructorDOMPointDOMPointInit >+PASS testConstructor1Arg >+PASS testConstructor2Arg >+PASS testConstructor3Arg >+PASS testConstructorNaNs >+PASS testConstructorInfs >+PASS testFromQuad >+PASS testFromRect >+PASS testFromRectNaN >+PASS testBounds1 >+PASS testBounds2 >+PASS testBoundsNaNInf >+PASS testSameObjects >+ >diff --git a/LayoutTests/geometry/DOMQuad-001.html b/LayoutTests/geometry/DOMQuad-001.html >new file mode 100644 >index 0000000000000000000000000000000000000000..de173478f1906915e6d346387bb62fccca695750 >--- /dev/null >+++ b/LayoutTests/geometry/DOMQuad-001.html >@@ -0,0 +1,126 @@ >+<!DOCTYPE html> >+<html> >+<head> >+ <title>Geometry Interfaces: DOMQuad interface tests.</title> >+ <link rel="author" title="Simon Fraser" href="mailto:simon.fraser@apple.com" /> >+ <link rel="help" href="http://www.w3.org/TR/geometry-1/#DOMQuad"> >+ <link rel="help" href="https://drafts.fxtf.org/geometry/#DOMQuad"> >+ >+ <script src="../resources/testharness.js"></script> >+ <script src="../resources/testharnessreport.js"></script> >+</head> >+<body> >+ <p>Test the DOMQuad interface</p> >+ <div id="log"></div> >+ <script> >+ test(function() { >+ checkDOMQuad(new DOMQuad(), { p1:{ x:0, y:0 }, p2:{ x:0, y:0 }, p3:{ x:0, y:0 }, p4:{ x:0, y:0 } }); >+ },'testConstructor0'); >+ test(function() { >+ var init = { p1:{ x:11, y:12 }, p2:{ x:22, y:23 }, p3:{ x:33, y:34 }, p4:{ x:44, y:45 } }; >+ checkDOMQuad(new DOMQuad(init.p1, init.p2, init.p3, init.p4), init); >+ },'testConstructor1'); >+ test(function() { >+ var init = { p1:{ x:Math.PI, y:12 }, p2:{ x:22, y:Math.PI }, p3:{ x:Infinity, y:34 }, p4:{ x:44, y:Infinity } }; >+ checkDOMQuad(new DOMQuad(init.p1, init.p2, init.p3, init.p4), init); >+ },'testConstructor2'); >+ test(function() { >+ var quad = new DOMQuad(new DOMPoint(11, 12), {x: 22, y: 23}, {x: 33, y: 34}, {x: 44, y: 45}); >+ var init = { p1:{ x:11, y:12 }, p2:{ x:22, y:23 }, p3:{ x:33, y:34 }, p4:{ x:44, y:45 } }; >+ checkDOMQuad(quad, init); >+ },'testConstructorDOMPointDOMPointInit'); >+ test(function() { >+ var init = { p1:{ x:11, y:12 }, p2:{ x:0, y:0 }, p3:{ x:0, y:0 }, p4:{ x:0, y:0 } }; >+ checkDOMQuad(new DOMQuad(init.p1), init); >+ },'testConstructor1Arg'); >+ test(function() { >+ var init = { p1:{ x:11, y:12 }, p2:{ x:22, y:23 }, p3:{ x:0, y:0 }, p4:{ x:0, y:0 } }; >+ checkDOMQuad(new DOMQuad(init.p1, init.p2), init); >+ },'testConstructor2Arg'); >+ test(function() { >+ var init = { p1:{ x:11, y:12 }, p2:{ x:22, y:23 }, p3:{ x:33, y:34 }, p4:{ x:0, y:0 } }; >+ checkDOMQuad(new DOMQuad(init.p1, init.p2, init.p3), init); >+ },'testConstructor3Arg'); >+ test(function() { >+ var init = { p1:{ x:11, y:12 }, p2:{ x:NaN, y:23 }, p3:{ x:33, y:NaN }, p4:{ x:NaN, y:NaN } }; >+ checkDOMQuad(new DOMQuad(init.p1, init.p2, init.p3, init.p4), init); >+ },'testConstructorNaNs'); >+ test(function() { >+ var init = { p1:{ x:11, y:12 }, p2:{ x:Number.POSITIVE_INFINITY, y:23 }, p3:{ x:33, y:Number.POSITIVE_INFINITY }, p4:{ x:Number.POSITIVE_INFINITY, y:Number.POSITIVE_INFINITY } }; >+ checkDOMQuad(new DOMQuad(init.p1, init.p2, init.p3, init.p4), init); >+ },'testConstructorInfs'); >+ test(function() { >+ var init = { p1:{ x:11, y:12 }, p2:{ x:22, y:23 }, p3:{ x:33, y:34 }, p4:{ x:44, y:45 } }; >+ checkDOMQuad(DOMQuad.fromQuad(init), init); >+ },'testFromQuad'); >+ test(function() { >+ var x = 11; >+ var y = 12 >+ var width = 104; >+ var height = 105; >+ >+ // p1------p2 >+ // | | >+ // | | >+ // p4------p3 >+ var quad = { p1:{ x:x, y:y }, p2:{ x:x + width, y:y }, p3:{ x:x + width, y:y + height }, p4:{ x:x, y:y + height } }; >+ var rect = new DOMRect(x, y, width, height); >+ checkDOMQuad(DOMQuad.fromRect(rect), quad); >+ },'testFromRect'); >+ test(function() { >+ var x = NaN; >+ var y = 12 >+ var width = NaN; >+ var height = 105; >+ var quad = { p1:{ x:x, y:y }, p2:{ x:x + width, y:y }, p3:{ x:x + width, y:y + height }, p4:{ x:x, y:y + height } }; >+ var rect = new DOMRect(x, y, width, height); >+ checkDOMQuad(DOMQuad.fromRect(rect), quad); >+ },'testFromRectNaN'); >+ test(function() { >+ var x = 11; >+ var y = 12 >+ var width = 104; >+ var height = 105; >+ var rect = new DOMRect(x, y, width, height); >+ checkDOMRect(DOMQuad.fromRect(rect).getBounds(), { x, y, width, height }); >+ },'testBounds1'); >+ test(function() { >+ var init = { p1:{ x:5, y:1.5 }, p2:{ x:50, y:3 }, p3:{ x:36, y:26.7 }, p4:{ x:2, y:15 } }; >+ checkDOMRect(new DOMQuad(init.p1, init.p2, init.p3, init.p4).getBounds(), { x:2, y:1.5, width:48, height:25.2 }); >+ },'testBounds2'); >+ test(function() { >+ var init = { p1:{ x:5, y:NaN }, p2:{ x:Infinity, y:3 }, p3:{ x:36, y:26.7 }, p4:{ x:2, y:15 } }; >+ checkDOMRect(new DOMQuad(init.p1, init.p2, init.p3, init.p4).getBounds(), { x:2, y:NaN, width:Infinity, height:NaN }); >+ },'testBoundsNaNInf'); >+ test(function() { >+ var init = { p1:{ x:11, y:12 }, p2:{ x:22, y:23 }, p3:{ x:33, y:34 }, p4:{ x:44, y:45 } }; >+ var quad = new DOMQuad(init.p1, init.p2, init.p3, init.p4); >+ assert_true(quad.p1 == quad.p1); >+ assert_true(quad.p2 == quad.p2); >+ assert_true(quad.p3 == quad.p3); >+ assert_true(quad.p4 == quad.p4); >+ },'testSameObjects'); >+ >+ function checkDOMRect(rect, exp) { >+ assert_equals(rect.x, exp.x, "Expected value for x is " + exp.x); >+ assert_equals(rect.y, exp.y, "Expected value for y is " + exp.y); >+ assert_equals(rect.width, exp.width, "Expected value for width is " + exp.width); >+ assert_equals(rect.height, exp.height, "Expected value for height is " + exp.height); >+ } >+ >+ function checkDOMQuad(quad, exp) { >+ assert_equals(quad.p1.x, exp.p1.x, "Expected value for p1.x is " + exp.p1.x); >+ assert_equals(quad.p1.y, exp.p1.y, "Expected value for p1.y is " + exp.p1.y); >+ >+ assert_equals(quad.p2.x, exp.p2.x, "Expected value for p2.x is " + exp.p2.x); >+ assert_equals(quad.p2.y, exp.p2.y, "Expected value for p2.y is " + exp.p2.y); >+ >+ assert_equals(quad.p3.x, exp.p3.x, "Expected value for p3.x is " + exp.p3.x); >+ assert_equals(quad.p3.y, exp.p3.y, "Expected value for p3.y is " + exp.p3.y); >+ >+ assert_equals(quad.p4.x, exp.p4.x, "Expected value for p4.x is " + exp.p4.x); >+ assert_equals(quad.p4.y, exp.p4.y, "Expected value for p4.y is " + exp.p4.y); >+ } >+ </script> >+</body> >+</html> >diff --git a/LayoutTests/geometry/DOMRect-001.html b/LayoutTests/geometry/DOMRect-001.html >index 130e069fe3b40601ce6c7c9fe08994ce70a49a4b..f2ced917e8d830197d12c641bcf38e3c8b2c29b7 100644 >--- a/LayoutTests/geometry/DOMRect-001.html >+++ b/LayoutTests/geometry/DOMRect-001.html >@@ -2,7 +2,7 @@ > <html> > <head> > <title>Geometry Interfaces: DOMRect and DOMRectReadOnly interface tests.</title> >- <link rel="author" title="Dirk Schulze" href="mailto:simon.fraser@apple.com" /> >+ <link rel="author" title="Simon Fraser" href="mailto:simon.fraser@apple.com" /> > <link rel="help" href="http://www.w3.org/TR/geometry-1/#DOMRect"> > <link rel="help" href="https://drafts.fxtf.org/geometry/#DOMRect"> > <script src="../resources/testharness.js"></script> >diff --git a/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt b/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt >index ef5873dc0d1b43493c96a419cc4a6d027b6ed320..37c45b75289aa1e414033c88bc9a6d63a3bc1c06 100644 >--- a/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt >+++ b/LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt >@@ -59,6 +59,11 @@ PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwn > PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('set') is false > PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').enumerable is false > PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').configurable is true >+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMQuad').value is DOMQuad >+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMQuad').hasOwnProperty('get') is false >+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMQuad').hasOwnProperty('set') is false >+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMQuad').enumerable is false >+PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMQuad').configurable is true > PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMRect').value is DOMRect > PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMRect').hasOwnProperty('get') is false > PASS [Worker] Object.getOwnPropertyDescriptor(global, 'DOMRect').hasOwnProperty('set') is false >diff --git a/LayoutTests/js/dom/global-constructors-attributes-expected.txt b/LayoutTests/js/dom/global-constructors-attributes-expected.txt >index e59a60a4214811681c49792e51beef05e9ed8408..e8199b49629399eaf66594d003ee411a6cd6b619 100644 >--- a/LayoutTests/js/dom/global-constructors-attributes-expected.txt >+++ b/LayoutTests/js/dom/global-constructors-attributes-expected.txt >@@ -298,6 +298,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty( > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('set') is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').enumerable is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').configurable is true >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').value is DOMQuad >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').hasOwnProperty('get') is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').hasOwnProperty('set') is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').enumerable is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').configurable is true > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').value is DOMRect > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').hasOwnProperty('get') is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').hasOwnProperty('set') is false >diff --git a/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt b/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt >index 150e418d4d79df806845ae35478eb312db1f2997..88037430e1351f02c47a7c27859f7f8ac4b5ca0b 100644 >--- a/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt >+++ b/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt >@@ -298,6 +298,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty( > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('set') is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').enumerable is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').configurable is true >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').value is DOMQuad >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').hasOwnProperty('get') is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').hasOwnProperty('set') is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').enumerable is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').configurable is true > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').value is DOMRect > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').hasOwnProperty('get') is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').hasOwnProperty('set') is false >diff --git a/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt b/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt >index 9fcda6e85dab28b71ee504c9a46d8a0f05fa79c9..21a6ea9f5dcbe1e1e2aee0b3fd99bb9cc5814848 100644 >--- a/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt >+++ b/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt >@@ -333,6 +333,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty( > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('set') is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').enumerable is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').configurable is true >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').value is DOMQuad >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').hasOwnProperty('get') is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').hasOwnProperty('set') is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').enumerable is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').configurable is true > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').value is DOMRect > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').hasOwnProperty('get') is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').hasOwnProperty('set') is false >diff --git a/LayoutTests/platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt b/LayoutTests/platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt >index a7fb0868afdbc9041b13b4c5edb41e434aec0af5..e3884c5156e3b0e73672a5bb7157b5c9fb309906 100644 >--- a/LayoutTests/platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt >+++ b/LayoutTests/platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt >@@ -343,6 +343,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty( > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('set') is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').enumerable is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').configurable is true >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').value is DOMQuad >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').hasOwnProperty('get') is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').hasOwnProperty('set') is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').enumerable is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').configurable is true > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').value is DOMRect > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').hasOwnProperty('get') is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').hasOwnProperty('set') is false >diff --git a/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt b/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt >index 729e2c114dd52ea89f09a3a9a670d1dfc667a1a8..476d1932161e07c434306e3222fd3f73db2c0e59 100644 >--- a/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt >+++ b/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt >@@ -343,6 +343,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty( > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('set') is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').enumerable is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').configurable is true >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').value is DOMQuad >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').hasOwnProperty('get') is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').hasOwnProperty('set') is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').enumerable is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').configurable is true > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').value is DOMRect > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').hasOwnProperty('get') is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').hasOwnProperty('set') is false >diff --git a/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt b/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt >index 0718f823f52d58d76c9b3451e6448ea4477242df..b9937fd670eded9872c8ba049b91f5d7a6c0a777 100644 >--- a/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt >+++ b/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt >@@ -343,6 +343,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty( > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('set') is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').enumerable is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').configurable is true >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').value is DOMQuad >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').hasOwnProperty('get') is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').hasOwnProperty('set') is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').enumerable is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').configurable is true > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').value is DOMRect > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').hasOwnProperty('get') is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').hasOwnProperty('set') is false >diff --git a/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt b/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt >index 8e7e338415ee4fc8f4909de111d6398f988d8691..402e890704e6206d8538958711777ff899b217a2 100644 >--- a/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt >+++ b/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt >@@ -238,6 +238,11 @@ PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty( > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').hasOwnProperty('set') is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').enumerable is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMPointReadOnly').configurable is true >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').value is DOMQuad >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').hasOwnProperty('get') is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').hasOwnProperty('set') is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').enumerable is false >+PASS Object.getOwnPropertyDescriptor(global, 'DOMQuad').configurable is true > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').value is DOMRect > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').hasOwnProperty('get') is false > PASS Object.getOwnPropertyDescriptor(global, 'DOMRect').hasOwnProperty('set') is false
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 163534
:
291793
|
291905
|
311929
|
311930
|
312748
|
313199
|
313201
|
313203
|
313206
|
313210