This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 13046 - Should we get rid of replaceWholeText?
Summary: Should we get rid of replaceWholeText?
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard: CORE-41309
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-24 12:32 UTC by Ms2ger
Modified: 2011-09-20 08:48 UTC (History)
7 users (show)

See Also:


Attachments

Description Ms2ger 2011-06-24 12:32:21 UTC

    
Comment 1 Jonas Sicking (Not reading bugmail) 2011-06-24 20:31:56 UTC
Yes! As far as I know no good use cases have ever been presented.
Comment 2 Anne 2011-06-25 10:02:37 UTC
Apparently Acid3 uses replaceWholeText().
Comment 3 Anne 2011-06-25 10:03:40 UTC
Only once though and should be easy to remove.
Comment 5 Olli Pettay 2011-08-31 13:53:16 UTC
replaceWholeText makes certain DOM modifications faster.
If you have <span>[text1][text2][text3]</span>
using [textX].replaceWholeText(foo) should be faster than
span.textContent = foo; or span.innerHTML = foo;
Or manually removing all but one text node.

But I'm not sure if that is a case to worry about.


(In any case http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-text-replacewholetext is buggy, since based on it all the adjacent text nodes should be removed, but that is not what replaceWholeText does.)
Comment 6 Anne 2011-09-07 13:08:22 UTC
I fixed the description of replaceWholeText for now. Hopefully we can remove it though. I do not think performance matters that much here.