Changeset 219555 in webkit


Ignore:
Timestamp:
Jul 17, 2017 12:03:03 AM (7 years ago)
Author:
Carlos Garcia Campos
Message:

Web Automation: link and partial link queries don't work if the link contains formatting tags
https://bugs.webkit.org/show_bug.cgi?id=174498

Reviewed by Brian Burg.

So, for example, if we find links with text "Foo" and there's a link like <a href=""><bA>Foo</b></a> we fail
with no such element error. This causes test test_Link_With_Formatting_Tags to fail.

  • UIProcess/Automation/atoms/FindNodes.js:

(switch): Use descendant-or-self::text() instead of just text() in the links xpath expressions.

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r219554 r219555  
     12017-07-17  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        Web Automation: link and partial link queries don't work if the link contains formatting tags
     4        https://bugs.webkit.org/show_bug.cgi?id=174498
     5
     6        Reviewed by Brian Burg.
     7
     8        So, for example, if we find links with text "Foo" and there's a link like <a href=""><bA>Foo</b></a> we fail
     9        with no such element error. This causes test test_Link_With_Formatting_Tags to fail.
     10
     11        * UIProcess/Automation/atoms/FindNodes.js:
     12        (switch): Use descendant-or-self::text() instead of just text() in the links xpath expressions.
     13
    1142017-07-16  Carlos Garcia Campos  <cgarcia@igalia.com>
    215
  • trunk/Source/WebKit/UIProcess/Automation/atoms/FindNodes.js

    r219554 r219555  
    3838    case "link text":
    3939        strategy = "xpath";
    40         query = ".//a[@href][text() = \"" + escape(query) + "\"]";
     40        query = ".//a[@href][descendant-or-self::text() = \"" + escape(query) + "\"]";
    4141        break;
    4242    case "partial link text":
    4343        strategy = "xpath";
    44         query = ".//a[@href][contains(text(), \"" + escape(query) + "\")]";
     44        query = ".//a[@href][contains(descendant-or-self::text(), \"" + escape(query) + "\")]";
    4545        break;
    4646    }
Note: See TracChangeset for help on using the changeset viewer.