File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed
spec/transformers/valid/ServerSideRendering/generates_unique_ids_for_items_with_media_and_ignores_items_with_own_id Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -219,6 +219,7 @@ class ApplyCommonAttributes {
219
219
}
220
220
if ( nodeHasBeenTransformed ) {
221
221
node . attribs . id = id ;
222
+ this . ids . add ( id ) ;
222
223
} else {
223
224
this . transformedNodesCounter -- ;
224
225
}
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html ⚡ i-amphtml-layout i-amphtml-no-boilerplate >
3
+ < head > < style amp-runtime > </ style >
4
+ < script data-rh async src ="https://cdn.ampproject.org/v0.js "> </ script >
5
+ < style amp-custom > @media not all and (min-width : 0px ) and (max-width : 50px ){# i-amp-0 {display : none}}@media not all and (min-width : 51px ) and (max-width : 129px ){# i-amp-1 {display : none}}</ style >
6
+ </ head >
7
+ < body >
8
+ < amp-img height ="100 " width ="100 " layout ="responsive " src ="img1.png " class ="i-amphtml-layout-responsive i-amphtml-layout-size-defined " i-amphtml-layout ="responsive " id ="i-amp-0 ">
9
+ < i-amphtml-sizer slot ="i-amphtml-svc " style ="display:block;padding-top:100% "> </ i-amphtml-sizer >
10
+ </ amp-img >
11
+ < amp-img id ="customId " height ="100 " width ="100 " layout ="responsive " src ="img2.png " class ="i-amphtml-layout-responsive i-amphtml-layout-size-defined " i-amphtml-layout ="responsive ">
12
+ < i-amphtml-sizer slot ="i-amphtml-svc " style ="display:block;padding-top:100% "> </ i-amphtml-sizer >
13
+ </ amp-img >
14
+ < amp-img height ="100 " width ="100 " layout ="responsive " src ="img3.png " class ="i-amphtml-layout-responsive i-amphtml-layout-size-defined " i-amphtml-layout ="responsive " id ="i-amp-1 ">
15
+ < i-amphtml-sizer slot ="i-amphtml-svc " style ="display:block;padding-top:100% "> </ i-amphtml-sizer >
16
+ </ amp-img >
17
+ </ body >
18
+ </ html >
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html ⚡ >
3
+ < head >
4
+ < script data-rh ="" async ="" src ="https://cdn.ampproject.org/v0.js "> </ script >
5
+ </ head >
6
+ < body >
7
+ < amp-img media ="(min-width: 0px) and (max-width: 50px) " height ="100 " width ="100 " layout ="responsive " src ="img1.png "> </ amp-img >
8
+ < amp-img id ="customId " height ="100 " width ="100 " layout ="responsive " src ="img2.png "> </ amp-img >
9
+ < amp-img media ="(min-width: 51px) and (max-width: 129px) " height ="100 " width ="100 " layout ="responsive " src ="img3.png "> </ amp-img >
10
+ </ body >
11
+ </ html >
You can’t perform that action at this time.
0 commit comments