Skip to content

Commit fab6569

Browse files
committed
Add tests for new specs
1 parent ce6df8c commit fab6569

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

includes/sanitizers/class-amp-img-sanitizer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ private function filter_attributes( $attributes ) {
221221
break;
222222

223223
// Skip directly copying new web platform attributes from img to amp-img which are largely handled by AMP already.
224-
case Attribute::IMPORTANCE: // Not supported by AMP.
225224
case Attribute::INTRINSICSIZE: // Responsive images handled by amp-img directly.
226225
break;
227226

tests/php/test-amp-img-sanitizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function get_data() {
148148

149149
'image_with_new_platform_attributes' => [
150150
'<img src="https://placehold.it/150x300" width="150" height="300" importance="low" intrinsicsize="150x300" loading="lazy">',
151-
'<amp-img src="https://placehold.it/150x300" width="150" height="300" class="amp-wp-enforced-sizes" layout="intrinsic"><noscript><img src="https://placehold.it/150x300" width="150" height="300" importance="low" intrinsicsize="150x300" loading="lazy"></noscript></amp-img>',
151+
'<amp-img src="https://placehold.it/150x300" width="150" height="300" importance="low" class="amp-wp-enforced-sizes" layout="intrinsic"><noscript><img src="https://placehold.it/150x300" width="150" height="300" importance="low" intrinsicsize="150x300" loading="lazy"></noscript></amp-img>',
152152
[
153153
'add_noscript_fallback' => true,
154154
],

tests/php/test-tag-and-attribute-sanitizer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,7 @@ static function () {
958958
<input type="submit"
959959
value="Subscribe">
960960
</fieldset>
961+
<input type="image" name="img" src="https://example.com/image.png" width="10" height="30">
961962
</form>
962963
',
963964
null,
@@ -2778,7 +2779,7 @@ class="slide"
27782779
<ul>
27792780
<li>
27802781
<span role="button">Image</span>
2781-
<div role="dialog">
2782+
<div role="dialog" aria-modal="true" id="unique_id">
27822783
<amp-img
27832784
src="/static/inline-examples/images/image1.jpg"
27842785
width="300"

0 commit comments

Comments
 (0)