Comments (2)
Most legacy DOM objects are "live" and have been forever. It seems really surprising that Firefox 43 would not do this. When I rewrite that code to
<!DOCTYPE html>
...<script>
let x = document.createElement("x"); x.innerHTML = '<input min="${min}" type="number" max="${max}"/>'
let node = x.firstChild
for (var i = 0; i < node.attributes.length; i++) {
w(node.attributes); // => [ type="number", max="99", min="0"];
node.removeAttribute('type');
w(node.attributes); // => [ max="99", min="0" ];
}
</script>
and put that in the Live DOM viewer I get the same behavior in Chrome and Firefox.
Your code does look wrong though. Why do the min and max attribute declarations not have a closing double quote?
from html-tagged-template.
Sorry, that was a mistake on my part, the closing quotes should be there. I'll rewrite the code to only remove the attributes after the for loop is over as other browsers (besides Chrome) may also have this same behavior. Thanks for the helpful information.
from html-tagged-template.
Related Issues (18)
- Should we use the HTML parser HOT 1
- Alternative HOT 2
- Should substitutionindex: really be deterministic? HOT 2
- Comparison to hyperx HOT 1
- How should we handle DOM clobbering
- How should we allow safeHTML HOT 3
- Why not just use this library? HOT 2
- Render Fails with value set to "" HOT 1
- Safe URLs deemed unsafe during attribute substitution HOT 1
- Unused parameter HOT 1
- please don't make SUBSTITUION_INDEX look like a typo :) HOT 1
- allow sub templates ? HOT 2
- do not reject data: protocol HOT 2
- allow values to be array of Nodes (or text), fragments HOT 2
- Easier boolean attributes HOT 2
- Overloaded return type seems problematic HOT 8
- Should we trim whitespace HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from html-tagged-template.