TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

WhatWG: Proposal – Update XPath to at least v2.0

54 pointsby adamretterover 4 years ago

11 comments

lucideerover 4 years ago
Most impactful part of this imo is:<p>&gt; <i>Chrome is not interested in this. The XML parts of our pipeline are in maintenance mode and we would love to eventually deprecate and remove them</i><p>&gt; -- <a href="https:&#x2F;&#x2F;github.com&#x2F;whatwg&#x2F;dom&#x2F;issues&#x2F;903#issuecomment-707748069" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;whatwg&#x2F;dom&#x2F;issues&#x2F;903#issuecomment-707748...</a><p>Given Chrome&#x27;s status as the new IE6 in terms of market share and outsized influence over the technological direction of the web, there&#x27;s a real risk of moves like this being unilateral.<p>On the other hand, the last two comments re: libxml being their primary concern do give some hope.
评论 #24766634 未加载
评论 #24766583 未加载
评论 #24766554 未加载
评论 #24770090 未加载
评论 #24766441 未加载
bawolffover 4 years ago
Everyone is mad at the chrome person, but honestly, all they are saying is they don&#x27;t want the feature bloat of extended support for a super complex standard, that isn&#x27;t very popular despite existing for 21 years and involves a library they want to deprecate.<p>Seems like a very reasonable no to me. You don&#x27;t get good software by saying yes to every feature idea.
评论 #24767102 未加载
评论 #24771276 未加载
评论 #24767500 未加载
评论 #24766648 未加载
评论 #24766756 未加载
shockover 4 years ago
&gt; I can tell this is not going to be a productive conversation, as folks are intent on playing word games to try and pretend Chrome has a different stance than we do. As such, I won&#x27;t be participating in this thread further. I think I&#x27;ve made our position clear. --user domenic (from Google&#x2F;Chrome, I presume)<p>So, a productive conversation is one in which people agree with the position of the Chrome team :-&#x2F;
评论 #24766747 未加载
scottfrover 4 years ago
While we are on the topic of XPath improvements, I would love to see a built-in XPath syntax to pierce the shadow DOM of Web components.<p>It&#x27;s an important need for the automation and testing use cases. Without it, targeting an element within a web component simply cannot be done solely with a single selector.
评论 #24767014 未加载
sam_lowry_over 4 years ago
XPath 2.0 is a complex language able to crash you computer or mine bitcoin.<p>Keep XPath 1.0.
评论 #24766770 未加载
评论 #24766598 未加载
评论 #24766569 未加载
admax88qover 4 years ago
It would have made sense to use XPath for CSS selectors, or at least make the CSS selectors a syntax compatible subset if you wanted to them piecewise in functionality like they currently have done.
评论 #24766509 未加载
评论 #24766850 未加载
vbezhenarover 4 years ago
At this point I think that those APIs should be implemented with high-performance JS or Wasm and browsers should provide just enough API entry points to allow for efficient implementation.
评论 #24767026 未加载
coding123over 4 years ago
The chrome guy is being a punk.
xyzzy_plughover 4 years ago
&gt; domenic commented 2 hours ago<p>&gt; Chrome is not interested in this. The XML parts of our pipeline are in maintenance mode and we would love to eventually deprecate and remove them, or at least replace them with something that generates less security bugs. Increasing the capabilities of XML in the browser runs counter to that goal.<p>Huh? Is he saying they want to remove XML support? Doesn&#x27;t this include... the DOM?<p>This proposal seems reasonable but I don&#x27;t understand this response by someone representing Chrome. Seems like this guy woke up on the wrong side of the bed this morning.
评论 #24766720 未加载
评论 #24766445 未加载
评论 #24767162 未加载
jarymover 4 years ago
&gt; The XML parts of our pipeline are in maintenance mode and we would love to eventually deprecate and remove them, or at least replace them with something that generates less security bugs. Increasing the capabilities of XML in the browser runs counter to that goal.<p>Bit of a weird comment from Chrome. &#x27;XML&#x27; doesn&#x27;t generate &#x27;security bugs&#x27; - sloppy development practices do. If they want to generate less security bugs they should be more aggressive with their testing&#x2F;fuzzing in the parts of code that deal with XML.
评论 #24766684 未加载
评论 #24766745 未加载
sergeykishover 4 years ago
Isn&#x27;t it backwards? WHATWG — there should be two implementations first.<p>Edit: we would not like if Chrome only feature was standardized. Lets have dialog, not silent downvotes.<p>XPath is great, for example<p><pre><code> $x(&#x27;&#x2F;&#x2F;text()[last()]&#x27;) </code></pre> finds last Text node. It is possible to query by text content<p><pre><code> $x(&quot;&#x2F;&#x2F;a[text() = &#x27;parent&#x27;]&quot;) </code></pre> finds parent links on the page. Other the years CSS adopted many selector, recent addition - :has(direct children) not implemented yet<p><pre><code> $(&quot;&#x2F;&#x2F;a[img]&#x27;) </code></pre> works. I would like to hear other examples.<p>What XPath needs is modern interface like CSS has. It is easy to shim [1]<p><pre><code> document.queryXPathAll </code></pre> That would be much better proposal<p>[1] <a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;CSS&#x2F;:has" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;CSS&#x2F;:has</a><p>[2] <a href="http:&#x2F;&#x2F;sergeykish.com&#x2F;web-api-element-prototype-queryxpathall" rel="nofollow">http:&#x2F;&#x2F;sergeykish.com&#x2F;web-api-element-prototype-queryxpathal...</a>