Title: [226027] releases/WebKitGTK/webkit-2.18/Source/WebDriver
Revision
226027
Author
[email protected]
Date
2017-12-18 03:47:40 -0800 (Mon, 18 Dec 2017)

Log Message

Merge r225082 - WebDriver: crash in Session::computeElementLayout when called without a current browsing context
https://bugs.webkit.org/show_bug.cgi?id=179917

Reviewed by Darin Adler.

In the case of computeElementLayout message, the frameHandle parameter is not optional, but we still need to
provide a valid value (empty string means the default frame) when m_currentBrowsingContext is std::nullopt. The
same applies to selectOptionElement.

* Session.cpp:
(WebDriver::Session::computeElementLayout):
(WebDriver::Session::selectOptionElement):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.18/Source/WebDriver/ChangeLog (226026 => 226027)


--- releases/WebKitGTK/webkit-2.18/Source/WebDriver/ChangeLog	2017-12-18 11:27:46 UTC (rev 226026)
+++ releases/WebKitGTK/webkit-2.18/Source/WebDriver/ChangeLog	2017-12-18 11:47:40 UTC (rev 226027)
@@ -1,3 +1,18 @@
+2017-11-21  Carlos Garcia Campos  <[email protected]>
+
+        WebDriver: crash in Session::computeElementLayout when called without a current browsing context
+        https://bugs.webkit.org/show_bug.cgi?id=179917
+
+        Reviewed by Darin Adler.
+
+        In the case of computeElementLayout message, the frameHandle parameter is not optional, but we still need to
+        provide a valid value (empty string means the default frame) when m_currentBrowsingContext is std::nullopt. The
+        same applies to selectOptionElement.
+
+        * Session.cpp:
+        (WebDriver::Session::computeElementLayout):
+        (WebDriver::Session::selectOptionElement):
+
 2017-11-15  Carlos Garcia Campos  <[email protected]>
 
         [WPE] Add initial support for WebDriver

Modified: releases/WebKitGTK/webkit-2.18/Source/WebDriver/Session.cpp (226026 => 226027)


--- releases/WebKitGTK/webkit-2.18/Source/WebDriver/Session.cpp	2017-12-18 11:27:46 UTC (rev 226026)
+++ releases/WebKitGTK/webkit-2.18/Source/WebDriver/Session.cpp	2017-12-18 11:47:40 UTC (rev 226027)
@@ -822,7 +822,7 @@
 
     RefPtr<InspectorObject> parameters = InspectorObject::create();
     parameters->setString(ASCIILiteral("browsingContextHandle"), m_toplevelBrowsingContext.value());
-    parameters->setString(ASCIILiteral("frameHandle"), m_currentBrowsingContext.value());
+    parameters->setString(ASCIILiteral("frameHandle"), m_currentBrowsingContext.value_or(emptyString()));
     parameters->setString(ASCIILiteral("nodeHandle"), elementID);
     parameters->setBoolean(ASCIILiteral("scrollIntoViewIfNeeded"), options.contains(ElementLayoutOption::ScrollIntoViewIfNeeded));
     parameters->setString(ASCIILiteral("coordinateSystem"), options.contains(ElementLayoutOption::UseViewportCoordinates) ? ASCIILiteral("LayoutViewport") : ASCIILiteral("Page"));
@@ -1280,7 +1280,7 @@
 {
     RefPtr<InspectorObject> parameters = InspectorObject::create();
     parameters->setString(ASCIILiteral("browsingContextHandle"), m_toplevelBrowsingContext.value());
-    parameters->setString(ASCIILiteral("frameHandle"), m_currentBrowsingContext.value());
+    parameters->setString(ASCIILiteral("frameHandle"), m_currentBrowsingContext.value_or(emptyString()));
     parameters->setString(ASCIILiteral("nodeHandle"), elementID);
     m_host->sendCommandToBackend(ASCIILiteral("selectOptionElement"), WTFMove(parameters), [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)](SessionHost::CommandResponse&& response) {
         if (response.isError) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to