GithubHelp home page GithubHelp logo

Comments (4)

piroor avatar piroor commented on June 3, 2024 1

be3cc52 で直ったはずです。

from textlink.

piroor avatar piroor commented on June 3, 2024

調査の結果、この問題はTwitterのWebページにテキストノードが大量にある事が原因であることが分かりました。
このURLをダブルクリックしたあと、URLのRangeとして
{"framePos":0,"text":"http://party.mozilla.gr.jp/party10/","startTextNodePos":19693,"startOffset":15,"endTextNodePos":19693,"endOffset":50}
という情報が取得されています。
これに基づいてURLの部分を表すRangeを作り選択範囲にするにあたって、descendant::text()[count(preceding::text())=19693]のようなXPath式をDOM3 XPathで評価してテキストノードを特定しているのですが、これに時間がかかっているせいでフリーズしているという状況でした。
DOM3 XPathを呼んだ時点でGeckoのC++の実装に処理を任せており、C++だしそんなに時間はかからないだろうと思っていたのですが、まさかここまで遅いとは……

from textlink.

piroor avatar piroor commented on June 3, 2024

式をdescendant::text()[position()=${19693+1}]に改めたらここまで時間がかかることはなくなりました。
position()は兄弟ノードの中での位置を表す物と思っていたのですが、descendant::text()の集合の中での位置ということだったのですね。ずいぶん長いこと誤解していました。

from textlink.

WhiteHawk-taka avatar WhiteHawk-taka commented on June 3, 2024

ホワイトアウトすることなく、正常に動作することを確認しました。
他のノードが多いページでの動作改善も期待されそうな内容で嬉しいです。
これからも引き続き使わせていただきます。ありがとうございました。

from textlink.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.