Opened 10 years ago

Closed 10 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 10 years ago by Piotrek Koszuliński

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.

comment:2 Changed 10 years ago by Piotrek Koszuliński

Status: newconfirmed

comment:3 Changed 10 years ago by Piotrek Koszuliński

Owner: set to Piotrek Koszuliński
Status: confirmedassigned

comment:4 Changed 10 years ago by Piotrek Koszuliński

Status: assignedreview

comment:5 Changed 10 years ago by Piotrek Koszuliński

Status: reviewreview_failed

Self criticism - I'm checking textContent on a text node instead of element.

comment:6 Changed 10 years ago by Piotrek Koszuliński

Status: review_failedreview

One more time.

comment:7 Changed 10 years ago by Piotr Jasiun

Status: reviewreview_passed

Ok. I rebased branch on the top on the master branch.

comment:8 Changed 10 years ago by Piotrek Koszuliński

Resolution: fixed
Status: review_passedclosed

Fixed on master with git:c151a1b.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy