Stealth-empty input to replaceWith leaves content in place #2204

Closed
gibson042 opened this Issue Apr 13, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@gibson042
Member

gibson042 commented Apr 13, 2015

e.g., $collection.replaceWith([""]) is a no-op: http://jsfiddle.net/w03Lertu/

@gibson042 gibson042 added this to the 3.0.0 milestone Apr 13, 2015

gibson042 added a commit to gibson042/jquery that referenced this issue Apr 13, 2015

gibson042 added a commit to gibson042/jquery that referenced this issue Apr 13, 2015

@gibson042 gibson042 self-assigned this Apr 17, 2015

@markelog

This comment has been minimized.

Show comment
Hide comment
@markelog

markelog Apr 20, 2015

Member

Is that a real use-case? Since in this docs i see -

May be an HTML string, DOM element, array of DOM elements

Since this would not be "array of DOM elements". What is byte-size and perf hit?

Member

markelog commented Apr 20, 2015

Is that a real use-case? Since in this docs i see -

May be an HTML string, DOM element, array of DOM elements

Since this would not be "array of DOM elements". What is byte-size and perf hit?

@gibson042

This comment has been minimized.

Show comment
Hide comment
@gibson042

gibson042 Apr 20, 2015

Member

This is necessary for gh-1747, because intercepted HTML can be replaced with an empty string.

Member

gibson042 commented Apr 20, 2015

This is necessary for gh-1747, because intercepted HTML can be replaced with an empty string.

markelog added a commit to markelog/jquery that referenced this issue Apr 20, 2015

gibson042 added a commit that referenced this issue Apr 30, 2015

Manipulation: Detect sneaky no-content replaceWith input
Fixes gh-2204
Ref 642e9a4
Closes gh-1752
Closes gh-2206

(cherry picked from commit 4b27ae1)

Conflicts:
	src/manipulation.js
	test/unit/manipulation.js

@gibson042 gibson042 closed this in 4b27ae1 Apr 30, 2015

@dmethvin dmethvin modified the milestones: 1.12/2.2, 3.0.0 Jan 7, 2016

@cssmagic cssmagic referenced this issue in cssmagic/ChangeLog May 18, 2016

Open

jQuery #5

@jquery jquery locked as resolved and limited conversation to collaborators Jun 19, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.