Skip to content

Commit

Permalink
MDL-67970 output: use div for content wraping instead of span
Browse files Browse the repository at this point in the history
span is not a valid content wrapper tag.
Moreover, according to W3C validation service report, it is not valid to
have div elements as children of a span element.
We can safely replace span with div here because the element's css class
is .action and display of .action is set to flex in both boost and
classic themes.
  • Loading branch information
rezaies committed Mar 17, 2020
1 parent 604df14 commit 99cac46
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions completion/tests/behat/behat_completion.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public function activity_has_configuration_completion_checkbox($activityname, $a
}
$iconxpath = "//li[contains(concat(' ', @class, ' '), ' modtype_" . strtolower($activitytype) . " ')]";
$iconxpath .= "[descendant::*[contains(text(), '" . $activityname . "')]]";
$iconxpath .= "/descendant::span[@class='actions']/descendant::img[contains(@src, 'i/completion-')]";
$iconxpath .= "/descendant::div[@class='actions']/descendant::img[contains(@src, 'i/completion-')]";

$this->execute("behat_general::the_attribute_of_should_contain",
array("src", $iconxpath, "xpath_element", $imgname)
Expand All @@ -193,7 +193,7 @@ public function activity_has_status_completion_checkbox($activityname, $activity
}
$iconxpath = "//li[contains(concat(' ', @class, ' '), ' modtype_" . strtolower($activitytype) . " ')]";
$iconxpath .= "[descendant::*[contains(text(), '" . $activityname . "')]]";
$iconxpath .= "/descendant::span[@class='actions']/descendant::img[contains(@src, 'i/completion-')]";
$iconxpath .= "/descendant::div[@class='actions']/descendant::img[contains(@src, 'i/completion-')]";

$this->execute("behat_general::the_attribute_of_should_contain",
array("src", $iconxpath, "xpath_element", $imgname)
Expand Down
2 changes: 1 addition & 1 deletion course/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ public function course_section_cm($course, &$completioninfo, cm_info $mod, $sect
$modicons .= $this->course_section_cm_completion($course, $completioninfo, $mod, $displayoptions);

if (!empty($modicons)) {
$output .= html_writer::span($modicons, 'actions');
$output .= html_writer::div($modicons, 'actions');
}

// Show availability info (if module is not available).
Expand Down

0 comments on commit 99cac46

Please sign in to comment.