yui/yui3 — pull request #1125 by derek (2013-08-23 06:29:36+00:00)
Title: Improved support for single-box Widgets

Rendering a widget that has `CONTENT_TEMPLATE = null` and a `srcNode` ATTR will result in destruction of the original node as the bounding box replaces it. This is unfortunate because it prevents a use-case where you want the content box (srcNode) and bounding box to point to the same pre-existing node.

This fixes that issue by introducing a `boundingBox` `valueFn` to check for a `srcNode` if `CONTENT_TEMPLATE` is `null`. If so, it defaults `boundingBox` to `srcNode`. If not, it reverts to the original behavior (returning `null`, which creates a bounding box from `BOUNDING_TEMPLATE`).

A full-library run of `yogi lint` checks out fine, as well as select Widgets via Yeti:

Widget
```
✓ Agent completed: Chrome (28.0.1500.95) / Mac OS
✓ Agent completed: Firefox (23.0) / Mac OS
✓ Agent completed: Internet Explorer (10.0) / Windows 8
✓ Agent completed: Internet Explorer (8.0) / Windows XP
✓ Agent completed: Internet Explorer (6.0) / Windows XP
✓ 753 tests passed! (21 seconds)
```

Autocomplete
```
✓ Agent completed: Chrome (28.0.1500.95) / Mac OS
✓ Agent completed: Internet Explorer (10.0) / Windows 8
✓ Agent completed: Internet Explorer (8.0) / Windows XP
✓ Agent completed: Firefox (23.0) / Mac OS
✓ Agent completed: Internet Explorer (6.0) / Windows XP
✓ 452 tests passed! (2 minutes, 12 seconds)
```

Datatable
```
✓ Agent completed: Chrome (28.0.1500.95) / Mac OS
✓ Agent completed: Firefox (23.0) / Mac OS
✓ Agent completed: Internet Explorer (10.0) / Windows 8
✓ Agent completed: Internet Explorer (8.0) / Windows XP
✓ Agent completed: Internet Explorer (6.0) / Windows XP
✓ 1498 tests passed! (3 minutes, 26 seconds)
```
---

Original Ticket: http://yuilibrary.com/projects/yui3/ticket/2530076

A widget with single box format (CONTENT_TEMPLATE = null) will destroy the contents of srcNode on render.

new MyWidget({
srcNode: '#demo' <-- will be destroyed on render
});

Expected behavior would be to use the provided srcNode as the boundingBox and contentBox.