Ticket #2532074 (closed defect)
Reporter Ryan Cannon |
Opened: 03/30/12 Last modified: 08/1/12 Status: closed Type: defect Resolution: fixed |
Owner Satyen Desai |
Target Release: 3.6.0 Priority: P3 (normal) |
|---|---|---|---|
| Summary: | Widget runs HTML_PARSER on when srcNode and contentBox are unset. | ||
| Description: | When you initialize a widget without setting the contentBox or srcNode, Widget runs the HTML_PARSER on the CONTENT_TEMPLATE property (usually an empty div). This will frequently cause errors. See the JSFiddle linked below. A potential patch would be - srcNode = widget.get(SRC_NODE); + srcNode = Y.one(config.srcNode || config.contentBox); |
||
| Type: | defect | Observed in Version: | 3.4.1 |
| Component: | Widget | Severity: | S3 (normal) |
| Assigned To: | Satyen Desai | Target Release: | 3.6.0 |
| Location: | Priority: | P3 (normal) | |
| Tags: | Relates To: | ||
| Browsers: | All | ||
| URL: | http://jsfiddle.net/mDMwX/ | ||
| Test Information: | |||
Change History
|
Posted: 04/4/12
|
|
Posted: 04/4/12
|
|
Posted: 04/4/12
|
|
Posted: 04/25/12
|
|
Posted: 04/25/12
|
|
Posted: 05/8/12
Need to move to Sprint 2, since Sprint 1 ended up going mostly towards 3.5.1 |
|
Posted: 05/15/12
Have a fix implemented locally (based on trying to identify if contentBox was generated from the template or not). Will merge to master once tested. |
|
Posted: 05/15/12
Don't run html parser against the default contentBox generated from Fixes #2532074 |
|
Posted: 06/1/12
|
|
Posted: 08/1/12
Shipped in 3.6.0. Marking closed/fixed. |
This doesn't seem to be a bug exactly, but I think the change you propose makes sense.
The reason I say that is because offhand I'd think an html parser implementation would generally account for elements inside the contentBox not being found (since the user may have some of the markup, but not all of it).
That said, I think it makes sense to say "Only bother running the html parser if we got a user provided node".
There are potential edge cases which may break as a result of the proposed change though, so we'd need something more robust.
For example, I know some folks set srcNode as a default value in their ATTRS config (so config.srcNode, config.contentBox would be false).