Opened 3 years ago

Closed 3 years ago

#11972 closed Bug (fixed)

Fix feature detection in element#setText

Reported by: Reinmar Owned by: Reinmar
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 3 years ago by Reinmar

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 3 years ago by Reinmar

  • Status changed from new to confirmed

comment:3 Changed 3 years ago by Reinmar

  • Owner set to Reinmar
  • Status changed from confirmed to assigned

comment:4 Changed 3 years ago by Reinmar

  • Status changed from assigned to review

comment:5 Changed 3 years ago by Reinmar

  • Status changed from review to review_failed

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

comment:6 Changed 3 years ago by Reinmar

  • Status changed from review_failed to review

One more time.

comment:7 Changed 3 years ago by pjasiun

  • Status changed from review to review_passed

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

comment:8 Changed 3 years ago by Reinmar

  • Resolution set to fixed
  • Status changed from review_passed to closed

Fixed on master with git:c151a1b.

Note: See TracTickets for help on using tickets.
© 2003 – 2016 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy