Changeset 219604 in webkit


Ignore:
Timestamp:
Jul 17, 2017 11:28:58 PM (7 years ago)
Author:
Carlos Garcia Campos
Message:

Web Automation: link and partial link queries don't work if text link contains trailing or leading whitespaces
https://bugs.webkit.org/show_bug.cgi?id=174499

Reviewed by Brian Burg.

This is causing test test_Driver_Can_Get_Link_By_Link_Test_Ignoring_Trailing_Whitespace to fail.

  • UIProcess/Automation/atoms/FindNodes.js:

(switch): Use normalize-space() in in the links xpath expressions.

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r219595 r219604  
     12017-07-17  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        Web Automation: link and partial link queries don't work if text link contains trailing or leading whitespaces
     4        https://bugs.webkit.org/show_bug.cgi?id=174499
     5
     6        Reviewed by Brian Burg.
     7
     8        This is causing test test_Driver_Can_Get_Link_By_Link_Test_Ignoring_Trailing_Whitespace to fail.
     9
     10        * UIProcess/Automation/atoms/FindNodes.js:
     11        (switch): Use normalize-space() in in the links xpath expressions.
     12
    1132017-07-17  Darin Adler  <darin@apple.com>
    214
  • trunk/Source/WebKit/UIProcess/Automation/atoms/FindNodes.js

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