Opened 8 years ago

Closed 5 years ago

#14691 closed feature (fixed)

remove/disable support for dir/lang/textdir inheritance in Parser

Reported by: Kitson Kelly Owned by: bill
Priority: undecided Milestone: 2.0
Component: Parser Version: 1.7.1
Keywords: Cc: ben hockey
Blocked By: Blocking:

Description

The dojo.parser should support the ability to disable support for special attributes that are inherited from the HTML structure in order to reduce the overhead of the parser. This should be supported in both the require loading syntax and the options parameters passed to the parser.

For example:

require(["dojo/parser!noHTMLInherited"], function(parser) {
  parser.parse();
});

And:

require(["dojo/parser"], function(parser) {
  parser.parser({
    noHTMLInherited: true
  });

Should disable the parser from attempting to search for and propagate inherited attributes of dir, lang and data-dojo-textdir. End developers would still be able to specify those attributes on the individual widgets if required, but they no longer would be inherited from HTML DOM nodes.

Related to performance discussion in #14591.

Change History (4)

comment:1 Changed 8 years ago by bill

Well, I plan to get rid of that support altogether in 2.0. We could add a flag to the parser now, but it wouldn't be worth it unless there's a significant performance impact.

In general for the code it would be good to have a has("2.0api") type flag for building out the 1.x deprecated features. That might be the better route.

comment:2 Changed 8 years ago by ben hockey

Cc: ben hockey added

comment:3 Changed 8 years ago by bill

Milestone: tbd2.0
Summary: Support "disabling" support for Special Attributes in Parserremove/disable support for dir/lang/textdir inheritance in Parser

comment:4 Changed 5 years ago by bill

Resolution: fixed
Status: newclosed

I'm closing this as fixed because the Web Components "parser" doesn't do inheritance of these attributes... actually it doesn't do much of anything besides calling createdCallback() and attachedCallback(), and leaves it up to the widgets to initialize themselves. The http://webcomponents.org/ polyfill works the same way.

Delite's (http://ibm-js.github.io/delite/) Widget base class actually has a has("inherit-dir") flag to inherit the dir from any ancestor rather than just from <body> or the node itself. And (as requested) the flag is off by default.

Note: See TracTickets for help on using tickets.