[webkit-reviews] review granted: [Bug 230614] [WebDriver] Add support for shadow roots : [Attachment 450514] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Feb 4 06:26:09 PST 2022


Adrian Perez <aperez at igalia.com> has granted Carlos Garcia Campos
<cgarcia at igalia.com>'s request for review:
Bug 230614: [WebDriver] Add support for shadow roots
https://bugs.webkit.org/show_bug.cgi?id=230614

Attachment 450514: Patch

https://bugs.webkit.org/attachment.cgi?id=450514&action=review




--- Comment #3 from Adrian Perez <aperez at igalia.com> ---
Comment on attachment 450514
  --> https://bugs.webkit.org/attachment.cgi?id=450514
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=450514&action=review

> Source/WebDriver/Session.cpp:1139
> +		   if (isShadowRoot == ElementIsShadowRoot::Yes &&
result.errorString() == "stale element reference") {

Wouldn't it be more robust to compare the error code instead of comparing
strings? As in:

  result.errorCode == CommandResult::ErrorCode::StaleElementReference

> Source/WebDriver/WebDriverService.cpp:1461
>  }

These two functions are so similar... the only variation AFAICS is
using FindElementsMode::{Multiple,Single} in the last line; maybe most
of the function body could be factored out?


More information about the webkit-reviews mailing list