Just replacing <span class="clear"></span> with <div class="clear"></div> does not throw a warning.

Comments

Stefan Nagtegaal’s picture

Status: Needs review » Reviewed & tested by the community

A simple no-brainer, and so this is RTBC.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed.

sun’s picture

Title: Garland clearing element is XHTML invalid » XHTML validation
Component: Garland theme » other
Status: Fixed » Needs review
StatusFileSize
new2.19 KB

Attached patch fixes some more occurences of the clearing element and empty help texts in node/add and node/edit.

Additionally, we have a critical problem in FAPI. All form submit buttons have the same element id:

<input type="submit" name="op" id="edit-submit" value="Search"  class="form-submit" />
<input type="submit" name="op" id="edit-submit" value="Filter"  class="form-submit" />
<input type="submit" name="op" id="edit-submit" value="Update"  class="form-submit" />

I'd suggest to replace those ids with the form id suffixed by -submit, e.g.

<input type="submit" name="op" id="user-admin-account-submit" value="Update"  class="form-submit" />

However, I have no idea if there could be any implications with JavaScript. If you agree, I'll post another patch fixing this particular issue once for all forms.

sun’s picture

StatusFileSize
new2.93 KB

Man, where's my head? This *will* actually break any JavaScript relying on element ids. Thus, attached patch introduces almost unique element ids for submit buttons -

system_settings_form seems to generate this awful code:

<input type="submit" name="op" id="edit-update-settings-submit" value="Save configuration"  class="form-submit" />
<input type="submit" name="op" id="edit-update-settings-submit" value="Reset to defaults"  class="form-submit" />

The second one either needs to be of #type button (instead of submit) or we need another unique but accessible identifier.

JirkaRybka’s picture

The problem with auto-generated form id's (as well as JavaScript compatibility) was discussed at http://drupal.org/node/111719 - including a patch to review.

sun’s picture

Component: other » forms system

system_settings_form is not the only one, the same is true for user/#/edit:

<input type="submit" name="op" id="edit-user-profile-form-submit" value="Save"  class="form-submit" />
<input type="submit" name="op" id="edit-user-profile-form-submit" value="Delete"  class="form-submit" />

However, patch in #3 is unrelated and should be RTBC.

sun’s picture

Component: forms system » other
Status: Needs review » Reviewed & tested by the community

ok, #3 is ready to go then

JirkaRybka’s picture

I agree.

sun’s picture

Status: Reviewed & tested by the community » Needs work

found some more issues...

dvessel’s picture

Why are we still using the .clear class? That was part of drupal.css in 4.7. All core themes should be using .clear-block to clear containers.

for patch #3, the .clear class inside phptemplate_preprocess_page() is obviously wrong since .clear isn't inside defaults.css or system.css.

sun’s picture

Status: Needs work » Needs review
StatusFileSize
new11.09 KB

Now this was some bug squashing... I've enabled all modules and with attached patch applied, (almost) all pages are XHTML valid now.

sun’s picture

@dvessel: That's out of my scope - making pages XHTML valid is one thing, altering themes is another and I do not have any coding experience with Drupal core themes. As a themer I know that even such small changes can break the layout in certain browsers. So, that would have to be done by someone else. Probably best in another issue.

DrupalTestbedBot tested sun's patch, the patch passed. For more information visit http://testing.drupal.org/node/91

DrupalTestbedBot tested sun's patch, the patch passed. For more information visit http://testing.drupal.org/node/92

DrupalTestbedBot tested sun's patch, the patch passed. For more information visit http://testing.drupal.org/node/94

dvessel’s picture

Status: Needs review » Needs work

The original patch that went in is causing Garland to make node links 1px in height. Not good!

dvessel’s picture

Status: Needs work » Needs review
StatusFileSize
new5.2 KB

This patch is to fix what originally went in. It also moves around some of the markup so it's more exposed. i.e. primary/secondary local tasks.

The span clearing tag within the secondary task was not needed at all. There's a rule already set for "ul.secondary" to clear itself.

The clear-block declaration inside the rtl style is not needed so it's been removed. The other instances of the "clear" class has been removed and replaced with "clear-block".

dvessel’s picture

@dvessel: That's out of my scope - making pages XHTML valid is one thing, altering themes is another and I do not have any coding experience with Drupal core themes. As a themer I know that even such small changes can break the layout in certain browsers. So, that would have to be done by someone else. Probably best in another issue.

sun, this is exactly what your doing. Altering a core theme to make it valid. I'm fully behind you with this and lets do it right. :)

sun’s picture

StatusFileSize
new15.73 KB

Merged dvessel's latest patch with my other fixes in #11, additionally fixed clearing element in maintenance.tpl.php

dvessel’s picture

The patch looks great.

Just this one part:

RCS file: /cvs/drupal/drupal/modules/trigger/trigger.module,v
retrieving revision 1.2
diff -u -p -r1.2 trigger.module
--- modules/trigger/trigger.module	26 Sep 2007 18:19:22 -0000	1.2
+++ modules/trigger/trigger.module	5 Oct 2007 20:45:15 -0000
@@ -333,7 +333,12 @@ function theme_trigger_display($element)
     }
   }
 
-  $output = theme('table', $header, $rows) . drupal_render($element);
+  if (count($rows)) {
+    $output = theme('table', $header, $rows) . drupal_render($element);
+  }
+  else {
+    $output = drupal_render($element);
+  }
   return $output;
 }

Do we really want to omit the table? A patch recently went in to prevent validation errors even when there's no content. Have the table present all the time presents a cue to the user that they need to fill it in for it to do anything. The rest of core does this.

sun’s picture

Hm. Without this conditional, <table></table> is output, which is XHTML invalid.

dvessel’s picture

Status: Needs review » Reviewed & tested by the community

Okay, I actually looked at that page where the tables are affected and indeed it needs to go. Sorry bout that.

All tested and it's looking very good.

sun’s picture

#19 still applies cleanly.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Needs review

Why did you move the list logic to the theme instead of the preprocess functions? It does not look logical.

dvessel’s picture

Because it already does an if condition inside .tpl due to the tabs wrapper and it exposes the markup where it should be, the template file. Thought it would benefit themers in a small way if anything.

I can switch it back so the logic goes back into the preprocess function but that condition inside the template has to stay in effect checking twice. Not a big deal, I can change it back.

gábor hojtsy’s picture

Status: Needs review » Reviewed & tested by the community

OK, understood now. Let me think about this a bit more though.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Looked through the patch again and committed, thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)