Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃И Remove and launch sticky ad safety area css experiment #30169

Merged
merged 1 commit into from
Sep 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 0 additions & 7 deletions ads/google/a4a/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ const AmpAdImplementation = {
AMP_AD_IFRAME_GET: '5',
};

/** @const {!{id: string, control: string, experiment: string}} */
export const STICKY_AD_PADDING_BOTTOM_EXP = {
id: 'sticky-ad-padding-bottom',
control: '21066401',
experiment: '21066402',
};

/** @const {!Object} */
export const ValidAdContainerTypes = {
'AMP-CAROUSEL': 'ac',
Expand Down
1 change: 0 additions & 1 deletion build-system/global-configs/canary-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"swg-gpay-native": 1,
"version-locking": 1,
"amp-ad-no-center-css": 0,
"sticky-ad-padding-bottom": 1,
"analytics-chunks": 1,
"render-on-idle-fix": 1
}
3 changes: 1 addition & 2 deletions build-system/global-configs/prod-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,5 @@
"swg-gpay-native": 1,
"version-locking": 1,
"amp-ad-no-center-css": 0,
"analytics-chunks": 1,
"sticky-ad-padding-bottom": 1
"analytics-chunks": 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {Navigation} from '../../../src/service/navigation';
import {
QQID_HEADER,
SANDBOX_HEADER,
STICKY_AD_PADDING_BOTTOM_EXP,
ValidAdContainerTypes,
addCsiSignalsToAmpAnalyticsConfig,
additionalDimensions,
Expand Down Expand Up @@ -220,16 +219,7 @@ export class AmpAdNetworkAdsenseImpl extends AmpA4A {
* @visibleForTesting
*/
divertExperiments() {
const experimentInfoList = /** @type {!Array<!../../../src/experiments.ExperimentInfo>} */ ([
{
experimentId: STICKY_AD_PADDING_BOTTOM_EXP.id,
isTrafficEligible: () => true,
branches: [
STICKY_AD_PADDING_BOTTOM_EXP.control,
STICKY_AD_PADDING_BOTTOM_EXP.experiment,
],
},
]);
const experimentInfoList = /** @type {!Array<!../../../src/experiments.ExperimentInfo>} */ ([]);
const setExps = randomlySelectUnsetExperiments(
this.win,
experimentInfoList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import {
AmpAnalyticsConfigDef,
QQID_HEADER,
SANDBOX_HEADER,
STICKY_AD_PADDING_BOTTOM_EXP,
ValidAdContainerTypes,
addCsiSignalsToAmpAnalyticsConfig,
extractAmpAnalyticsConfig,
Expand Down Expand Up @@ -427,14 +426,6 @@ export class AmpAdNetworkDoubleclickImpl extends AmpA4A {
isTrafficEligible: () => true,
branches: Object.values(ZINDEX_EXP_BRANCHES),
},
{
experimentId: STICKY_AD_PADDING_BOTTOM_EXP.id,
isTrafficEligible: () => true,
branches: [
STICKY_AD_PADDING_BOTTOM_EXP.control,
STICKY_AD_PADDING_BOTTOM_EXP.experiment,
],
},
]);
const setExps = this.randomlySelectUnsetExperiments_(experimentInfoList);
Object.keys(setExps).forEach(
Expand Down
12 changes: 6 additions & 6 deletions extensions/amp-sticky-ad/1.0/amp-sticky-ad.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

amp-sticky-ad {
position: fixed !important;
text-align:center;
text-align: center;
bottom: 0 !important;
left: 0;
width: 100% !important;
Expand All @@ -26,8 +26,9 @@ amp-sticky-ad {
opacity: 1 !important;
background-image: none !important;
background-color: #fff;
box-shadow: 0 0 5px 0 rgba(0,0,0, 0.2) !important;
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2) !important;
margin-bottom: 0 !important;
padding-bottom: env(safe-area-inset-bottom, 0px);
}

amp-sticky-ad-top-padding {
Expand Down Expand Up @@ -58,7 +59,6 @@ amp-sticky-ad[visible] {
display: block;
}


.amp-sticky-ad-close-button {
position: absolute;
visibility: hidden;
Expand All @@ -71,7 +71,7 @@ amp-sticky-ad[visible] {
background-position: 9px center;
background-color: #fff;
background-repeat: no-repeat;
box-shadow: 0 -1px 1px 0 rgba(0,0,0, 0.2);
box-shadow: 0 -1px 1px 0 rgba(0, 0, 0, 0.2);
border: none;
border-radius: 12px 0 0 0;
}
Expand All @@ -90,15 +90,15 @@ amp-sticky-ad[visible] > .amp-sticky-ad-close-button {
bottom: 0;
}

[dir=rtl] .amp-sticky-ad-close-button {
[dir='rtl'] .amp-sticky-ad-close-button {
right: auto;
left: 0;
border-top-left-radius: 0;
border-top-right-radius: 12px;
background-position: 6px center;
}

[dir=rtl] .amp-sticky-ad-close-button:before {
[dir='rtl'] .amp-sticky-ad-close-button:before {
right: -20px;
left: 0;
}
31 changes: 0 additions & 31 deletions extensions/amp-sticky-ad/1.0/amp-sticky-ad.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import {CSS} from '../../../build/amp-sticky-ad-1.0.css';
import {CommonSignals} from '../../../src/common-signals';
import {STICKY_AD_PADDING_BOTTOM_EXP} from '../../../ads/google/a4a/utils';
import {Services} from '../../../src/services';
import {
computedStyle,
Expand All @@ -25,11 +24,6 @@ import {
toggle,
} from '../../../src/style';
import {dev, user, userAssert} from '../../../src/log';
import {
getExperimentBranch,
isExperimentOn,
randomlySelectUnsetExperiments,
} from '../../../src/experiments';
import {removeElement, whenUpgradedToCustomElement} from '../../../src/dom';

class AmpStickyAd extends AMP.BaseElement {
Expand Down Expand Up @@ -64,31 +58,6 @@ class AmpStickyAd extends AMP.BaseElement {
this.viewport_ = this.getViewport();
this.element.classList.add('i-amphtml-sticky-ad-layout');

// Setting padding-bottom to avoid iPhone home bar
if (isExperimentOn(this.win, 'sticky-ad-padding-bottom')) {
const experimentInfoList = /** @type {!Array<!../../../src/experiments.ExperimentInfo>} */ ([
{
experimentId: STICKY_AD_PADDING_BOTTOM_EXP.id,
isTrafficEligible: () => true,
branches: [
STICKY_AD_PADDING_BOTTOM_EXP.control,
STICKY_AD_PADDING_BOTTOM_EXP.experiment,
],
},
]);
randomlySelectUnsetExperiments(this.win, experimentInfoList);
if (
getExperimentBranch(this.win, STICKY_AD_PADDING_BOTTOM_EXP.id) ==
STICKY_AD_PADDING_BOTTOM_EXP.experiment
) {
setStyle(
this.element,
'padding-bottom',
'env(safe-area-inset-bottom, 0px)'
);
}
}

const children = this.getRealChildren();
userAssert(
children.length == 1 && children[0].tagName == 'AMP-AD',
Expand Down
5 changes: 0 additions & 5 deletions tools/experiments/experiments-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,6 @@ export const EXPERIMENTS = [
name: 'Remove signing requirement for AMPHTML ads',
spec: 'https://github.com/ampproject/amphtml/issues/27189',
},
{
id: 'sticky-ad-padding-bottom',
name: 'Add a bottom padding for edgeless iPhones',
spec: 'https://github.com/ampproject/amphtml/issues/22251',
},
{
id: 'expand-json-targeting',
name: 'Allow CLIENT_ID in doubleclick json targeting feature',
Expand Down