Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Damien Tournoud’s picture

mr.baileys’s picture

I'm unsure what exactly this patch is about... I arrived here while searching for duplicates for #402356: XHTML validator needed in SimpleTest..

Can you explain a bit what the goal behind this patch is? Also, is simpletest the correct component for this (most of the changes seem to be in the filter module)

Damien Tournoud’s picture

Damien Tournoud’s picture

@mr.baileys: I uploaded the wrong patch. I wanted to know how many exceptions are hidden by the '@' before the loadHTML().

Status: Needs review » Needs work

The last submitted patch failed testing.

mr.baileys’s picture

Gotcha...

I don't think loadHTML will validate XHTML though unless validateOnParse is set (which will cause some other issues), so it's not really XHTML validation, more HTML validation. It will raise errors on invalid HTML like unclosed or mismatched tags, so still nice to have. One example of the errors against the XHTML spec it probably won't report is the use of duplicate IDs.

I'm working on full-blown XHTML validation in #402356: XHTML validator needed in SimpleTest. but it's proving more difficult than I originally thought.

Damien Tournoud’s picture

@mr.baileys: could we first try to concentrate on fixing the issues identified by the test bot above?

Damien Tournoud’s picture

Status: Needs work » Needs review
FileSize
4.12 KB

Folded #399488: Invalid markup generated by l(). inside, and prevented meta check when we are not on a HTML page (should fix Aggregator exceptions).

Dries’s picture

Interesting patch! My tests are still running but it seems to have identified quite a few problems already. Just like I hoped/expected. This is certainly a good first start.

Status: Needs review » Needs work

The last submitted patch failed testing.

Damien Tournoud’s picture

Status: Needs work » Needs review
Damien Tournoud’s picture

Damien Tournoud’s picture

Let's try again.

Status: Needs review » Needs work

The last submitted patch failed testing.

Damien Tournoud’s picture

Damien Tournoud’s picture

Dave Reid’s picture

Issue tags: +XHTML validation
boombatower’s picture

Good to see HTML cleanup, subscribe.

Damien Tournoud’s picture

Issue tags: -XHTML validation

Several of the "duplicate IDs" issues are probably duplicates of #111719: FAPI fails to check auto-generated IDs for uniqueness - XHTML validation fails..

Damien Tournoud’s picture

Issue tags: +XHTML validation

Sorry about the tag change.

c960657’s picture

FileSize
13.87 KB

I don't know if it has been discussed, but we could parse the page using the XML parser instead of the more forgiving HTML parser. This will not validate the page, but it will report if the page is not well-formed XML.

Note that all browsers parse the pages as HTML, not XML (unless we change the Content-Type to application/xhtml+xml). With PHP's XML and HTML parser it looks like the resulting DOMs are identical (in a browser, the DOMs may be slightly different), except that the XML parser imports the elements into the proper XHTML namespace, so I don't think this will be a problem.

This patch is just a proof of concept.

Damien Tournoud’s picture

@c960657: I really don't see the point. The main difference between loadHTML() and loadXML(), except the root of the DOM, is that loadHTML() will issue warnings, while loadXML() will fail the loading completely.

loadHTML() is really what we need, as it does proper XHTML validation without failing to load the tree altogether.

c960657’s picture

@Damian Tournoud: loadXML() also complains about unclosed tags (e.g. <br>), unquoted attribute values (<div id=abc>), attribute minimization (<option selected>) and tags using the wrong case (<div>...</DIV>). These are allowed in HTML but not in XHTML.

Dries’s picture

I've been thinking about this patch and it _might_ be best to just commit it, break the test bot for a day or two, and collectively fix the notices over the next couple of days.

Sometimes, it is good to create efforts that are laser-focused and to step away from the convential path for a while. It might be the best and fastest way to get these 174 notices fixed in a short time frame, and to significantly advance our test framework.

I'd happy to be bold, break the bot, and put all other patches on hold until these 174 notices are fixed.

Thoughts?

ejort’s picture

subscribe

boombatower’s picture

As I always ask, please please let me know before you do this....instead of after (like usual).

Dries’s picture

Issue tags: +Favorite-of-Dries

Tagging.

rcross’s picture

I guess Dries decided not to make his bold move on this. Still interested in seeing how this progresses. Probably will be something post code freeze i guess.

effulgentsia’s picture

Subscribing from #750008: Add test for HTML ID uniqueness which was marked a "duplicate" of this one. That issue just adds a test for id uniqueness and is showing quite a few failures of that in HEAD.

Damien Tournoud’s picture

@effulgentsia: see #15 and #16 for a bunch of issues (some of them related to ID uniqueness). I marked the other issue as a duplicate because this one has a larger scope (and already studied two different ways to validate the markup during testing).

ohnobinki’s picture

Issue tags: +xhtml compliance

+

mgifford’s picture

Version: 7.x-dev » 8.x-dev

Maybe this isn't needed in D8 as it's all HTML5.

mgifford’s picture

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

DamienMcKenna’s picture

Version: 9.5.x-dev » 11.x-dev
longwave’s picture

Status: Needs work » Closed (outdated)

I'm sure this is completely outdated now, we support HTML5 everywhere over XHTML now, simpletest.module is long gone, and it's not clear to me from reading the issue or comments exactly what this was meant to solve.