Bug Tracker

Opened 12 years ago

Closed 11 years ago

#10515 closed feature (wontfix)

Meta: Investigate viability of insertAdjacentHTML use

Reported by: Rick Waldron Owned by: Rick Waldron
Priority: low Milestone: 1.next
Component: manipulation Version: 1.7b2
Keywords: Cc:
Blocked by: Blocking:

Description

The latest Firefox will have support for this, I'm wondering if support is wide enough now to consider adding it to any of the manipulation logic paths.

Change History (11)

comment:1 Changed 12 years ago by Rick Waldron

Component: unfiledmanipulation
Milestone: None1.8
Owner: set to Rick Waldron
Priority: undecidedlow
Status: newassigned

comment:2 Changed 12 years ago by aymeric@…

It's an awesome idea. The Mozilla Team wrote an article about the better performance of this function: http://hacks.mozilla.org/2011/11/insertadjacenthtml-enables-faster-html-snippet-injection/

comment:3 Changed 12 years ago by dmethvin

It would be nice if we could totally replace our fragment cache with insertAdjacentHTML instead. That would mitigate the code bloat and eliminate the pseudo-leak that the frag cache causes. However we'd need to see how iAH handles the cases already in .clean() which are primarily IE 6/7/8 workarounds.

comment:4 Changed 12 years ago by Timmy Willison

If it removes the need for clean, it would be worth the extra codepath.

comment:5 Changed 12 years ago by Timmy Willison

#10804 is a duplicate of this ticket.

comment:6 Changed 12 years ago by dmethvin

Blocking: 10903 added

(In #10903) None of the HTML processing code in jQuery.clean or jQuery.buildFragment currently attaches content to the document, that's done later when the method-specific callback (e.g., append, prepend, before, after) is called. So this isn't a simple change and a very cornery case.

However, we've been talking about using insertAdjacentHTML in #10515 which might solve this problem so I'll leave it open. If it can't be worked in there I think we will close this wontfix.

comment:7 Changed 11 years ago by dmethvin

Blocking: 10903 removed

comment:8 Changed 11 years ago by mikesherov

Milestone: 1.81.next

comment:9 Changed 11 years ago by dmethvin

Type: enhancementfeature

Bulk change from enhancement to feature.

comment:10 Changed 11 years ago by dmethvin

Pull request at https://github.com/jquery/jquery/pull/1095 for one narrow but common case, $(selector).append(html), but I'd like to see perfs before landing it.

comment:11 Changed 11 years ago by dmethvin

Resolution: wontfix
Status: assignedclosed

Thoroughly investigated by @orkel in https://github.com/jquery/jquery/pull/1200 and we came to the conclusion that there is no significant benefit.

Note: See TracTickets for help on using tickets.