Comments (20)
Comment author: dmethvin
Still searching for a good solution, but this isn't a blocker.
from jquery.
Comment author: dmethvin
Ref #12359
from jquery.
Comment author: tomgrohl
Is it a case of copying all the tests and changing the doctype to xhtml, or is it limited to certain test.
I might be able to help on this one.
from jquery.
Comment author: dmethvin
That's part of the investigation to be done.
For example, we support Firefox and you can serve XHTML with the right docttype and HTTP Content-Type to ensure it's interpreted as XHTML, but it just spits out console warnings if you get it wrong according to #12359. Our automated tests wouldn't catch that type of problem.
On the other hand, in #12357 it seems a Firefox XUL application demands correct XHTML to run at all. We don't have XUL on our automated tests so there's no formal support for it, but we've been able to keep it running except when we break XHTML by accident as we've done a couple of times now. There have been similar reports related to Chrome plugins.
Perhaps we can just provide some sort of XUL test in Testswarm, since that seems to be the most sensitive environment.
from jquery.
Comment author: tomgrohl
Thanks for the info.
I'll have a look into it, see what else I can find.
from jquery.
Comment author: tomgrohl
As a starting point, I've wrote some code to check for content type and doctype.
It detects if closing tags / quoted attributes are required based on the following:
1 - content type is application/xhtml+xml 2 - content type is text/html and doctype is XHTML 3 - document is xul (Needs more testing though)
Generally is a doctype and/or content type is omitted it detaults to text/html.
This logic will be good to use and probably fix #12359 as well.
I'll now work on creating some tests for xhtml (based on the existing ones) and see where I get.
from jquery.
Comment author: dmethvin
Bulk change from enhancement to feature.
from jquery.
Comment author: dmethvin
Add IE10 to the list of browsers that will generate console warnings when there are doctype-related errors. Those happen too early for a shim to console.warn to see them.
from jquery.
Comment author: dmethvin
Although I wonder whether the shim would see them in a delay-loaded iframe.
from jquery.
Comment author: anthonyryan1@…
Firstly a note: The majority of the regressions in XHTML compatibility over the past few years have been in feature / bug detection code included in jQuery.
There are two approaches we can take to solving this problem, neither of which is particularly ideal:
We can run the entire test suite in XHTML mode:
Pros:
- No duplicate tests required in the test suite.
- All code paths are properly tested
Cons:
- Looking through the QUnit code history, they are extremely regression prone with XHTML compatibility. We could expect regular breakage when updating QUnit unless they are similarly encouraged to test XHTML support.
- The test running interface uses document.write() and would need to be re-implemented in a better way.
- Some unit tests may not be possible in XHTML mode, they would require some form of indicator that they should not be run in XHTML mode.
- As a result of the previous, some tests may be marked incompatible with XHTML when they could work just fine out of developer laziness or misunderstanding.
- Increases the test-running time by requiring the entire suite be run mulitple times
- iframes tests will be immune to XHTML mode setup in this way, since the iframe has it's own context. This would result is tests passing when they should fail.
Alternatively, we can duplicate specific tests to be run in XHTML iframes:
Pros:
- None
Cons:
- Code coverage will be poor
- Tests will be duplicated from their HTML counterparts
- Maintaining a list of what should be duplicated will be a maintenance burden on jQuery.
from jquery.
Comment author: dmethvin
@anthonyryan, thanks for taking another look at this. I agree that none of the solutions are ideal, and it does get harder now that we are doing the feature detects on an as-needed basis. I'm thinking we may still want to do some sort of basic-functionality test with XHTML, at least it would give us some hope of avoiding these kind of recurring regressions.
from jquery.
Comment author: gibson042
True, just loading jQuery in an iframe and invoking the parent callback on successful load would go a long way. Per-module tests can come later, and need not be much more complicated either.
from jquery.
Comment author: m_gol
Replying to dmethvin:
@anthonyryan, thanks for taking another look at this. I agree that none of the solutions are ideal, and it does get harder now that we are doing the feature detects on an as-needed basis.
In test/support.js we force-compute all support tests to check if they match our expected matrix so that's not a problem.
from jquery.
Per discussion in the meeting today, we might do an occasional run in XHTML mime type.
from jquery.
Ref gh-1969
from jquery.
With the issue of XHTML regressions coming up again, it seems like an appropriate time to revisit this.
I think the optimal course of action would be:
- Fixing QUnit for XHTML and ensuring they start regularly testing in an XHTML mode. We can't expect to keep the XHTML tests green if our test harness keeps breaking.
- Requiring a webserver to serve the test suite so everything can be served with appropriate headers (we can't ensure all of the various
file:///
URLs are served with the correct content-type). - Conditionally skip based on specific criteria (in this case
if (document.contentType === 'application/xhtml+xml') { /* skip */ }
). This would be a very significant effort as each XHTML failing test would need to be manually checked to understand why it's failing. Whether it's because of how it is being used (for example, appending an unclosed tag), or because of a bug in jQuery itself. - Get all of the tests passing or skipping under XHTML. Because while people might notice the difference between 0 and 1 failure. The difference between 17 and 18 will lead to people just ignoring these failures and we'll see no fewer regressions.
from jquery.
Rescheduling to 3.0.1 as it's non-trivial and we still have a lot to do before 3.0.0.
from jquery.
Moving to Roadmap. We're not sure when we'll get to this.
from jquery.
@timmywil When you're closing an issue while not fixing it please always make sure to remove a milestone, otherwise it will get picked up in a changelog totally incorrectly.
from jquery.
@mgol Good call, thanks for the reminder.
from jquery.
Related Issues (20)
- Feature Requests: Please read https://github.com/jquery/jquery/wiki/Adding-new-features Most features should start as pl
- Uncaught TypeError: Cannot read properties of undefined (reading 'createElement') HOT 1
- Event triggering is being captured incorrectly HOT 5
- CSP problem HOT 8
- AJAX with zero form fields does not send `Content-Type` header HOT 1
- manual triggering of pointer event
- jquery destructuring assignment HOT 3
- 网络安全漏洞修复 HOT 1
- Prepare a 4.0 blog post & an upgrade guide HOT 2
- Jquery upgrade from 3.6.0 to 3.7.1
- Cross Site Scripting (DOM) issue
- Treeveiw not woking with jquery 3.7.1 HOT 10
- DOM based Cross-Site Scripting (XSS) HOT 1
- Uncaught TypeError: Cannot read properties of undefined (reading 'createDocumentFragment') in jQuery 3.7.1 HOT 1
- Content-Security-Policy / nonce error in DOMEval HOT 2
- Facing jQuery Selector issue after upgrading from 1.7.1 to 3.7.1 HOT 1
- Jquery 4.0 beta? HOT 1
- jQuery .load function errors if loading html with auto-removing script tag HOT 2
- Strange error behavior of event delegation when customizing jQuery HOT 3
- invalid assignment left-hand side in jquery-3.7.1.min.js HOT 7
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 jquery.