Title: [207526] trunk/Source/WebKit2
- Revision
- 207526
- Author
- carlo...@webkit.org
- Date
- 2016-10-19 00:24:04 -0700 (Wed, 19 Oct 2016)
Log Message
Unreviewed. Fix GTK+ build after r207497.
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
(webkit_dom_html_select_element_add): Update implementation since add() now takes a Variant.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (207525 => 207526)
--- trunk/Source/WebKit2/ChangeLog 2016-10-19 07:20:32 UTC (rev 207525)
+++ trunk/Source/WebKit2/ChangeLog 2016-10-19 07:24:04 UTC (rev 207526)
@@ -1,3 +1,10 @@
+2016-10-19 Carlos Garcia Campos <cgar...@igalia.com>
+
+ Unreviewed. Fix GTK+ build after r207497.
+
+ * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
+ (webkit_dom_html_select_element_add): Update implementation since add() now takes a Variant.
+
2016-10-18 Simon Fraser <simon.fra...@apple.com>
Add a MiniBrowser menu item to apply page scale in WK1 and WK2
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp (207525 => 207526)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp 2016-10-19 07:20:32 UTC (rev 207525)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp 2016-10-19 07:24:04 UTC (rev 207526)
@@ -28,6 +28,7 @@
#include <WebCore/ExceptionCodeDescription.h>
#include "GObjectEventListener.h"
#include <WebCore/HTMLNames.h>
+#include <WebCore/HTMLOptGroupElement.h>
#include <WebCore/JSMainThreadExecState.h>
#include "WebKitDOMEventPrivate.h"
#include "WebKitDOMEventTarget.h"
@@ -360,12 +361,22 @@
WebCore::HTMLSelectElement* item = WebKit::core(self);
WebCore::HTMLElement* convertedElement = WebKit::core(element);
WebCore::HTMLElement* convertedBefore = WebKit::core(before);
- WebCore::ExceptionCode ec = 0;
- item->add(*convertedElement, convertedBefore, ec);
- if (ec) {
- WebCore::ExceptionCodeDescription ecdesc(ec);
+ Variant<RefPtr<WebCore::HTMLOptionElement>, RefPtr<WebCore::HTMLOptGroupElement>> variantElement;
+ if (is<WebCore::HTMLOptionElement>(convertedElement))
+ variantElement = &downcast<WebCore::HTMLOptionElement>(*convertedElement);
+ else if (is<WebCore::HTMLOptGroupElement>(convertedElement))
+ variantElement = &downcast<WebCore::HTMLOptGroupElement>(*convertedElement);
+ else {
+ WebCore::ExceptionCodeDescription ecdesc(WebCore::TypeError);
g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
+ return;
}
+
+ auto exception = item->add(WTFMove(variantElement), WebCore::HTMLSelectElement::HTMLElementOrInt(convertedBefore));
+ if (exception.hasException()) {
+ WebCore::ExceptionCodeDescription ecdesc(exception.releaseException().code());
+ g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
+ }
}
void webkit_dom_html_select_element_remove(WebKitDOMHTMLSelectElement* self, glong index)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes