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

Satyen Desai

YUI Developer

Posted: 04/4/12
  • milestone changed to 3.6.0

Satyen Desai

YUI Developer

Posted: 04/4/12
  • priority changed to P3 (normal)
  • sprint changed to sprint 1
  • status changed from new to accepted

Satyen Desai

YUI Developer

Posted: 04/4/12
  • estimated changed from 0 to 1
  • remaining changed from 0 to 1

Satyen Desai

YUI Developer

Posted: 04/25/12

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).

Satyen Desai

YUI Developer

Posted: 04/25/12
  • completed changed from 0 to 0.5
  • remaining changed from 1 to 0.5

Satyen Desai

YUI Developer

Posted: 05/8/12
  • sprint changed from sprint 1 to sprint 2

Need to move to Sprint 2, since Sprint 1 ended up going mostly towards 3.5.1

Satyen Desai

YUI Developer

Posted: 05/15/12
  • completed changed from 0.5 to 1.5
  • remaining changed from 0.5 to 0.1

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.

Satyen Desai

YUI Developer

Posted: 05/15/12
  • resolution changed to fixed
  • status changed from accepted to checkedin

Don't run html parser against the default contentBox generated from
CONTENT_TEMPLATE. Only run it if the user (or component) provided a
srcNode (or contentBox) node reference.

Fixes #2532074
View Commit: 712600ee870ac2336dfb7757a1dda5dcf52a6f61

Satyen Desai

YUI Developer

Posted: 06/1/12
  • remaining changed from 0.1 to 0

Jenny Donnelly

YUI Developer

Posted: 08/1/12
  • status changed from checkedin to closed

Shipped in 3.6.0. Marking closed/fixed.