Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for Xpath.getElementTreeXPath #138

Merged
merged 1 commit into from May 1, 2014

Conversation

benediktask
Copy link
Contributor

I came accross this issue when I reused getElementTreeXPath() functionality in my project

Case:

Incorrect Xpath string returned if element has siblings of same node name when traversing element node tree

Example (how to reproduce):

Using Firebug's "Copy XPath" when right clicking on element in document's element tree.

Let's say we have we have a HTML document with this structure, where X is the element we're trying to get XPath of:

  • html
    -- body
    --- div
    ---- div [X]
    ---- div

    XPath returned: /html/body/div/div (should be /html/body/div/div[1])

… element has siblings of same node name when traversing element node tree
janodvarko added a commit that referenced this pull request May 1, 2014
@janodvarko janodvarko merged commit 05020a6 into firebug:master May 1, 2014
@janodvarko
Copy link
Member

One followup at:
b4adc6f

We have some coding style rules, see:
https://getfirebug.com/wiki/index.php/Firebug_Coding_Style

I have fixed them, in particular:

  • curly brackets at the new line
  • Variable definitions done separately
  • no tabs, only spaces
  • max 100 characters on a single line

I did it for you, so you can learn for your next patch ;-)

Thanks!
Honza

@janodvarko
Copy link
Member

Automated test at:
3bcebce

Honza

@benediktask benediktask deleted the getElementTreeXPathFix branch May 1, 2014 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants