Opened 11 years ago
Closed 11 years ago
#11972 closed Bug (fixed)
Fix feature detection in element#setText
| Reported by: | Piotrek Koszuliński | Owned by: | Piotrek Koszuliński |
|---|---|---|---|
| Priority: | Normal | Milestone: | CKEditor 4.4.2 |
| Component: | General | Version: | |
| Keywords: | Cc: |
Description
I was wondering why single innerText access takes so much time during CKEditor initialization. Surprisingly, the answer makes sense.
http://www.domenlightenment.com/
innerText is aware of style and will not return the text of hidden elements, whereas textContent will
So, poor feature detection done on a wrong node may require the entire layout recalculation.
Change History (8)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
| Status: | new → confirmed |
|---|
comment:3 Changed 11 years ago by
| Owner: | set to Piotrek Koszuliński |
|---|---|
| Status: | confirmed → assigned |
comment:5 Changed 11 years ago by
| Status: | review → review_failed |
|---|
Self criticism - I'm checking textContent on a text node instead of element.
comment:7 Changed 11 years ago by
| Status: | review → review_passed |
|---|
Ok. I rebased branch on the top on the master branch.
comment:8 Changed 11 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | review_passed → closed |
Fixed on master with git:c151a1b.

Additionally - this feature detection is wrong, because we should use standard textContent rather than innerText.
The same applies to getText, because if textContent is empty we make a request to innerText.