This commit does not actually fix qweb2.js, but it works around a
phantomjs bug. The problem with phantomjs is that in some situations,
the xmlhttprequests are dropped with a status 0. It is most likely
related to the issue:
https://github.com/ariya/phantomjs/issues/11195
In our testing framework, it seems to appear when requests sent before
the 'load' event of phantomjs are received after, and also when those
requests are listened with the onreadystatechange handler.
The bug does not appear if we use addEventListener with the 'load' event (at
least, not for a few builds)
This commit does not worsen qweb, and it is also a small improvement in
style (in my opinion).
If the variable was existing outside the context of the ``foreach``,
the value is copied at the end of the foreach into the global context.
Fix#4461 - Q74531 - Q71486 - Q71675
If the variable was existing outside the context of the ``foreach``,
the value is copied at the end of the foreach into the global context.
Fix#4461 - Q74531 - Q71486 - Q71675
Use the local copy of those libraries instead of fetching them at runtime.
This fix was required for Debian packaging. It fixes the
privacy-breach-may-use-debian-package lintian error.
Had expected regularity, had not noticed the Python version is really an
ignoble hack where the string "0" (exactly) is interpreted in a specific
manner when used in t-raw and format strings, *and nowhere else*.
Had special-cased the expression everywhere which broke e.g.
<t-set="xxx" t-value="0"/>. Reproduce Python behavior more closely,
and strongly consider swapping out both for something different e.g.
[[content]] or something like that, which doesn't cause problems in
Python but doesn't have to be so specially cased either.
* __content__ can't be used in Python implementation because safe_eval, so use
``0`` from Python implementation instead
* remove postfix from t-call tests because due to implementation details all
whitespace crap following a t-name is added to rendered template in Python
impl, and don't want to normalize whitespace.
* document qweb based (mostly) on JS version
* convert JS qweb tests to (mostly) language-independent XML so they can be
used for JS and Python implementations
* add some more tests (e.g. precedence between t-value and body in t-set)
* remove ``t-import``
* fix parity in foreach(dict) (and rename some variables to make array and
object versions more similar)
It does not just collapse the whitespace, it does not even insert the
node into its XML DOM unless said node is within the scope of an
@xml:space="preserve" (which mandates that the parser leaves all text
unmolested).
Added that in the foreach test case (which makes use of significant
whitespace), but we may have to add it to templates as well in some
cases (since whitespace is significant in HTML)..
bzr revid: xmo@openerp.com-20120118112538-ju4kxfz154qm8yny
MSIE serializes nodes to UPPERCASE EVERYTHING (unless the known are generic/unknown), which breaks tests as JS doesn't really have case-insensitive comparisons
bzr revid: xmo@openerp.com-20120118110118-pfiy1n2g4yhfjtso