WebKit Bugzilla
Attachment 371987 Details for
Bug 198805
: openDatabase should return an empty object when WebSQL is disabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198805-20190612143916.patch (text/plain), 4.63 KB, created by
Sihui Liu
on 2019-06-12 14:39:17 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Sihui Liu
Created:
2019-06-12 14:39:17 PDT
Size:
4.63 KB
patch
obsolete
>Subversion Revision: 246325 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 5b234e8f985697fdd710c0c47c727b1114714ed1..d651219769096c23c8029196478b2bd617f2cac1 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,16 @@ >+2019-06-12 Sihui Liu <sihui_liu@apple.com> >+ >+ openDatabase should return an empty object when WebSQL is disabled and quirk is enabled >+ https://bugs.webkit.org/show_bug.cgi?id=198805 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ To reduce the scope of the WebSQL quirk. >+ >+ * Modules/webdatabase/DOMWindowWebDatabase.idl: >+ * bindings/js/JSDOMWindowCustom.cpp: >+ (WebCore::JSDOMWindow::openDatabase): >+ > 2019-06-11 Greg Doolittle <gr3g@apple.com> > > Web Inspector: AXI: Audit: image label test is throwing spurious errors on elements with existing alt attr, but no value: <img alt> >diff --git a/Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.idl b/Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.idl >index 438a3821e130c1e02c87c08af62bf3f9017acfae..d3a70a4d535722c6ac7fe4cdecdcf42ced200f94 100644 >--- a/Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.idl >+++ b/Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.idl >@@ -29,5 +29,5 @@ > EnabledByQuirk=hasWebSQLSupport, > ] > partial interface DOMWindow { >- [MayThrowException] Database? openDatabase(DOMString name, DOMString version, DOMString displayName, unsigned long estimatedSize, optional DatabaseCallback? creationCallback); >+ [MayThrowException, Custom] Database? openDatabase(DOMString name, DOMString version, DOMString displayName, unsigned long estimatedSize, optional DatabaseCallback? creationCallback); > }; >diff --git a/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp b/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp >index a5f0619fecf912bcccc208ceb51f5dcb9eccf652..1bb6f8c93e06b766af98842270a1cb70e1fc4a7e 100644 >--- a/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp >+++ b/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp >@@ -22,6 +22,7 @@ > #include "JSDOMWindowCustom.h" > > #include "DOMWindowIndexedDatabase.h" >+#include "DOMWindowWebDatabase.h" > #include "Frame.h" > #include "HTMLCollection.h" > #include "HTMLDocument.h" >@@ -31,6 +32,8 @@ > #include "JSDOMConvertNullable.h" > #include "JSDOMConvertNumbers.h" > #include "JSDOMConvertStrings.h" >+#include "JSDatabase.h" >+#include "JSDatabaseCallback.h" > #include "JSEvent.h" > #include "JSEventListener.h" > #include "JSHTMLAudioElement.h" >@@ -41,6 +44,7 @@ > #include "JSWindowProxy.h" > #include "JSWorker.h" > #include "Location.h" >+#include "Quirks.h" > #include "RuntimeEnabledFeatures.h" > #include "ScheduledAction.h" > #include "Settings.h" >@@ -564,4 +568,44 @@ JSValue JSDOMWindow::frames(JSC::ExecState&) const > return globalThis(); > } > >+JSValue JSDOMWindow::openDatabase(JSC::ExecState& state) >+{ >+ VM& vm = state.vm(); >+ auto scope = DECLARE_THROW_SCOPE(vm); >+ >+ bool hasWebSQLQuirk = (downcast<Document>(jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext())->quirks().hasWebSQLSupportQuirk()); >+ bool webSQLEnabled = RuntimeEnabledFeatures::sharedFeatures().webSQLEnabled(); >+ ASSERT(hasWebSQLQuirk || webSQLEnabled); >+ >+ if (UNLIKELY(state.argumentCount() < 4)) >+ return throwException(&state, scope, createNotEnoughArgumentsError(&state)); >+ >+ auto name = convert<IDLDOMString>(state, state.uncheckedArgument(0)); >+ RETURN_IF_EXCEPTION(scope, JSValue()); >+ >+ auto version = convert<IDLDOMString>(state, state.uncheckedArgument(1)); >+ RETURN_IF_EXCEPTION(scope, JSValue()); >+ >+ auto displayName = convert<IDLDOMString>(state, state.uncheckedArgument(2)); >+ RETURN_IF_EXCEPTION(scope, JSValue()); >+ >+ auto estimatedSize = convert<IDLUnsignedLong>(state, state.uncheckedArgument(3)); >+ RETURN_IF_EXCEPTION(scope, JSValue()); >+ >+ if (!webSQLEnabled && hasWebSQLQuirk) { >+ ASSERT(name == "null"); >+ ASSERT(version == "null"); >+ ASSERT(displayName == "null"); >+ ASSERT(!estimatedSize); >+ >+ return JSValue(); >+ } >+ >+ auto creationCallback = convert<IDLNullable<IDLCallbackFunction<JSDatabaseCallback>>>(state, state.argument(4), *globalObject(), [](JSC::ExecState& state, JSC::ThrowScope& scope) { >+ throwArgumentMustBeFunctionError(state, scope, 4, "creationCallback", "Window", "openDatabase"); >+ }); >+ RETURN_IF_EXCEPTION(scope, JSValue()); >+ return toJS<IDLNullable<IDLInterface<Database>>>(state, *globalObject(), scope, WebCore::DOMWindowWebDatabase::openDatabase(wrapped(), WTFMove(name), WTFMove(version), WTFMove(displayName), WTFMove(estimatedSize), WTFMove(creationCallback))); >+} >+ > } // namespace WebCore
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 198805
:
371987
|
372617
|
372638
|
372641
|
372648
|
372650
|
372653
|
372654
|
372655
|
372673