Comments (3)
For benchmarking this, would you use a jQuery style selector in DevTools to count up the nodes under the contenteditable
section of the element?
from elm-rte-toolkit.
I'm working with a variation of the Basic example (from here).
If we consider the basing the child node count of <elm-editor>
with a small-ish example like this:
<div contenteditable="true" class="rte-main " data-rte-main="true" data-gramm_editor="false">
<div data-rte-doc="true">
<p><i>This is some sample </i><b><i>textlkjlkj</i></b></p>
<p><b>lkjlkajsdflkdjsaflkjdsalkfjds</b></p>
<blockquote>
<p>asdflkdsajfkldsjafkldsjalkfjdsaklfjdslkajfkldsjafkljdsafkljsaldkfjsadfasldfkjsdaf</p>
</blockquote>
<p>lkjkjkljasfdsaf</p>
<ol>
<li>
<p>lkjlkjlkj</p>
</li>
<li>
<p>lkjkljklj</p>
</li>
<li>
<p>lkjlkjklj</p>
</li>
<li>
<p>lkjlkjklj</p>
</li>
</ol>
</div>
</div>
For getting the total nodes, we would need to evaluate the nodes at the top-level, and recursively descend each to count their nodes at level, correct?
If so, I think this would be a potential way to count the above:
$("div[data-rte-doc='true']").getElementsByTagName("*").length
When I evaluate that in Console for DevTools on the node <div data-rte-doc="true">
, I get 18
as the result (which I'm reasonably sure if the count for the children of <div data-rte-doc="true">
).
Or maybe it's easier to just operate from <elm-editor>
:
$("elm-editor").getElementsByTagName("*").length
// 21 output
Is this the sort of beginnings of benchmarking that you were considering for this issue?
I assume that having some sample text to load into examples of varying node count would be helpful too.
from elm-rte-toolkit.
I just realized that the 2500 nodes might be a Debug.log
of the root
's children, so toBlockArray and Array.length
🤦
from elm-rte-toolkit.
Related Issues (20)
- IME support in Chrome and Safari
- Add more powerful validation support
- Google Japanese IME - selection persists after selecting autocomplete HOT 1
- iOS Safari - cursor disappears sometimes HOT 1
- TypeError: HTMLElement constructor: 'new' is required HOT 3
- Pasting in Firefox in the example doesn't have any effect HOT 5
- `htmlToElementArray` fails to parse "empty paragraphs" HOT 4
- `joinBackward` and `joinForward` are not correct HOT 1
- `RichText.Definitions.link` bad `htmlToNode` HOT 4
- Backwards deletion of newline plus character fails (e.g. "\nh") HOT 3
- When you have 2 rte's on one page only the first one is updating the selection HOT 1
- Backspace doesn't work on Chrome when inline text node contains initial newline HOT 2
- Cannot type after a link on Chrome HOT 2
- space at the end of a line in firefox doesn't seem to work HOT 1
- Requires Elm 0.19.1 but can run on 0.19.0
- Cmd-backspace not deleting entire line (most of the time)
- Ignore unknown nodes
- State change story
- ranges are persisted after deselection HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elm-rte-toolkit.